feat(kernel): finish phase3 bridge cutover and phase4 tree projection

- add generic mnote-web query transport and bridge routes for workspace/request/trace

- route sidebar compat traffic through mnote-web and tighten fixture fallback to dev/test

- unify sidebar/page tree/file tree/picker consumers on page_tree projection

- sync phase3/phase4 checklist, breakdown docs, and harness progress state
This commit is contained in:
lix-2026
2026-04-17 00:25:28 +08:00
parent b1d5d97142
commit ddf285b82d
27 changed files with 2650 additions and 340 deletions
+343 -43
View File
@@ -2226,47 +2226,6 @@
],
"completed_at": "2026-04-16T04:52:15Z"
},
{
"id": "task-058",
"title": "按 AI 前端精简方案 v1 补齐 Hermes 与 mnote Rust 的业务能力桥:明确并落地 Hermes 调用 mnote 文档/导图/OnlyOffice Rust 能力的最小边界,优先评估 MCP server、Hermes plugin/tool adapter 或最小业务 bridge",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-054"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "4fbab6dd",
"validation": {
"command": "cd /mnt/Data1T/mnote && python3 - <<'PY'\nimport json\nfrom pathlib import Path\ntext = Path('/mnt/Data1T/mnote/design/ai-frontend-simplification-plan-v1.md').read_text(encoding='utf-8')\nneedles = [\n 'Hermes API Server',\n 'mnote Rust',\n 'MCP server',\n 'Hermes plugin/tool adapter',\n]\nfor needle in needles:\n assert needle in text, needle\nprint('task-058-doc-ok')\nPY",
"timeout_seconds": 1800
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 3,
"description": "已明确 Hermes 不复制 mnote 业务真逻辑,mnote Rust 继续作为文档、块、导图与 OnlyOffice 的真执行面。",
"timestamp": "2026-04-16T04:52:02Z"
},
{
"step": 2,
"total": 3,
"description": "已在 AI 前端精简方案中固定首选接缝:优先最小业务 bridge,并记录 MCP server 与 Hermes plugin/tool adapter 的评估边界。",
"timestamp": "2026-04-16T04:52:03Z"
},
{
"step": 3,
"total": 3,
"description": "已补齐 Hermes API Server -> mnote Rust 的最小业务桥边界,避免 /api/ai-agent/run 收口后出现业务能力真空。",
"timestamp": "2026-04-16T04:52:04Z"
}
],
"completed_at": "2026-04-16T04:52:05Z"
},
{
"id": "task-057",
"title": "按 AI 前端精简方案 v1 执行第四阶段:清理前端 AI 遗留 registry、builtins、重复 localStorage/session 管理与历史兼容 helper,仅保留 Hermes bridge、mnote Rust 业务执行面与浏览器专属 client capability bridge",
@@ -2311,6 +2270,47 @@
],
"completed_at": "2026-04-16T04:52:20Z"
},
{
"id": "task-058",
"title": "按 AI 前端精简方案 v1 补齐 Hermes 与 mnote Rust 的业务能力桥:明确并落地 Hermes 调用 mnote 文档/导图/OnlyOffice Rust 能力的最小边界,优先评估 MCP server、Hermes plugin/tool adapter 或最小业务 bridge",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-054"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "4fbab6dd",
"validation": {
"command": "cd /mnt/Data1T/mnote && python3 - <<'PY'\nimport json\nfrom pathlib import Path\ntext = Path('/mnt/Data1T/mnote/design/ai-frontend-simplification-plan-v1.md').read_text(encoding='utf-8')\nneedles = [\n 'Hermes API Server',\n 'mnote Rust',\n 'MCP server',\n 'Hermes plugin/tool adapter',\n]\nfor needle in needles:\n assert needle in text, needle\nprint('task-058-doc-ok')\nPY",
"timeout_seconds": 1800
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 3,
"description": "已明确 Hermes 不复制 mnote 业务真逻辑,mnote Rust 继续作为文档、块、导图与 OnlyOffice 的真执行面。",
"timestamp": "2026-04-16T04:52:02Z"
},
{
"step": 2,
"total": 3,
"description": "已在 AI 前端精简方案中固定首选接缝:优先最小业务 bridge,并记录 MCP server 与 Hermes plugin/tool adapter 的评估边界。",
"timestamp": "2026-04-16T04:52:03Z"
},
{
"step": 3,
"total": 3,
"description": "已补齐 Hermes API Server -> mnote Rust 的最小业务桥边界,避免 /api/ai-agent/run 收口后出现业务能力真空。",
"timestamp": "2026-04-16T04:52:04Z"
}
],
"completed_at": "2026-04-16T04:52:05Z"
},
{
"id": "task-059",
"title": "按 Rust Web 长期架构实施清单 v1 推进长期重构主线:统一阶段边界、依赖顺序、横向能力和最终验收口径,避免后续再次回到“Rust 内核 + 重前端页面壳”的临时态",
@@ -2966,8 +2966,308 @@
}
],
"completed_at": "2026-04-16T13:18:39Z"
},
{
"id": "task-081",
"title": "执行 Kernel Phase 3 P3-1/P3-2:把 mnote-web query transport 从 Sidebar 单点实现提升为通用 Convex query 执行层,并把 fixture fallback 收紧到测试/开发边界",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-080"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "17afde7d",
"validation": {
"command": "cargo test -p mnote-web --manifest-path rust/Cargo.toml && cargo check --manifest-path rust/Cargo.toml",
"timeout_seconds": 1800
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 1,
"description": "已把 mnote-web transport 收口为通用 execute_convex_query_plan,并以 allow_dev_fixtures + MNOTE_WEB_QUERY_FIXTURES_JSON 将 fixture 限定到测试/开发边界;mnote-web 定向 cargo test/check 通过。",
"timestamp": "2026-04-16T15:00:56Z"
}
],
"completed_at": "2026-04-16T15:00:57Z"
},
{
"id": "task-082",
"title": "执行 Kernel Phase 3 P3-3:为 mnote-web 新增 bridge.workspace/request/trace 真实查询主链,证明 Rust Web 不再只承接 sidebar 数据集",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-081"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "17afde7d",
"validation": {
"command": "cargo test -p mnote-web --manifest-path rust/Cargo.toml",
"timeout_seconds": 1200
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 1,
"description": "已新增 /api/bridge/workspace、/api/bridge/request、/api/bridge/trace,并复用通用 query transport 读取真实 bridgeLogs 查询;mnote-web route test 通过。",
"timestamp": "2026-04-16T15:00:59Z"
}
],
"completed_at": "2026-04-16T15:01:00Z"
},
{
"id": "task-083",
"title": "执行 Kernel Phase 3 P3-4/P3-5:补齐 workspace/request/trace/error 语义,并把 Sidebar 首包与 /api/sidebar 通过 compat sidebar 接到 mnote-web,形成第一条真实切流边界",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-081",
"task-082"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "17afde7d",
"validation": {
"command": "cd /mnt/Data1T/mnote/wolai-frontend && pnpm test src/lib/sidebar-data.test.ts && pnpm exec eslint src/app/api/sidebar/route.ts src/lib/server/sidebar-data.ts src/lib/server/mnote-web.ts",
"timeout_seconds": 1800
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 1,
"description": "已统一 workspace 解析与错误码,transport 优先转发真实 AuthorizationSidebar 服务端首包与 /api/sidebar 在配置 MNOTE_WEB_BASE_URL 后默认经 /api/compat/next/sidebar 走 mnote-web。前端定向 vitest / eslint 通过(eslint 仅 baseline-browser-mapping 提示,无 error)。",
"timestamp": "2026-04-16T15:01:02Z"
}
],
"completed_at": "2026-04-16T15:01:03Z"
},
{
"id": "task-084",
"title": "执行 Kernel Phase 3 P3-6:回写 phase3 拆解/checklist 与 harness 状态,确认 Tree-First Graph Kernel Phase 3 已满足 DONE 判定",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-081",
"task-082",
"task-083"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "17afde7d",
"validation": {
"command": "python3 - <<'PY2'\nfrom pathlib import Path\nroot = Path('/mnt/Data1T/mnote')\ncheck = (root / 'design/tree-first-graph-kernel-checklist-v2.md').read_text(encoding='utf-8')\nassert 'Kernel Phase 3``DONE`' in check or 'Kernel Phase 3`DONE`' in check\nprint('task-084-phase3-docs-updated')\nPY2",
"timeout_seconds": 120
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 1,
"description": "已回写 tree-first kernel checklist、phase3 breakdown 与 rust-web long-term checklist,统一 Phase 3 DONE / Rust Web Phase 1 仍 PARTIAL 的真实口径,并同步 harness 完成状态。",
"timestamp": "2026-04-16T15:01:04Z"
}
],
"completed_at": "2026-04-16T15:01:05Z"
},
{
"id": "task-085",
"title": "执行 Kernel Phase 4 P4-1:冻结树域 page_tree projection protocol,并补齐 Sidebar / 页面树共享字段与类型边界",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-084"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "17afde7d",
"validation": {
"command": "cd /mnt/Data1T/mnote/wolai-frontend && pnpm test src/lib/tree-projection.test.ts src/lib/sidebar-data.test.ts",
"timeout_seconds": 1200
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 1,
"description": "已新增 tree-projection.ts,冻结 rowId/nodeId/parentNodeId/projectionKind/depth/position/capabilities/resourceMeta 等 page_tree protocol,并补充对应单测。",
"timestamp": "2026-04-16T16:11:20Z"
}
],
"completed_at": "2026-04-16T16:11:21Z"
},
{
"id": "task-086",
"title": "执行 Kernel Phase 4 P4-2:统一 Sidebar 主树与页面树 consumer,让 PrivateTree 与相关树列表直接消费 page_tree projection",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-085"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "17afde7d",
"validation": {
"command": "cd /mnt/Data1T/mnote/wolai-frontend && pnpm test src/lib/tree-projection.test.ts src/lib/sidebar-data.test.ts && pnpm exec eslint src/components/sidebar/private-tree.tsx src/components/sidebar/sidebar.tsx src/lib/tree-projection.ts",
"timeout_seconds": 1800
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 1,
"description": "已让 Sidebar 顶部树列表、PrivateTree 与 convert-to-child 等页面树 consumer 统一消费 page_tree projection,可见行只保留 expanded 等 UI 状态。",
"timestamp": "2026-04-16T16:11:23Z"
}
],
"completed_at": "2026-04-16T16:11:24Z"
},
{
"id": "task-087",
"title": "执行 Kernel Phase 4 P4-3:把文件树收口为统一 projection consumer,让 buildVisibleRows 只负责 projection 到 visible rows 的映射",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-085",
"task-086"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "17afde7d",
"validation": {
"command": "cd /mnt/Data1T/mnote/wolai-frontend && pnpm test src/lib/file-tree/rows.test.ts src/lib/tree-projection.test.ts && pnpm exec eslint src/lib/file-tree/rows.ts src/lib/file-tree/rows.test.ts src/components/sidebar/sidebar.tsx",
"timeout_seconds": 1800
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 1,
"description": "文件树已改为只消费 page_tree projection + asset 映射;buildVisibleRows 不再递归定义树结构真相,相关 rows 单测通过。",
"timestamp": "2026-04-16T16:11:26Z"
}
],
"completed_at": "2026-04-16T16:11:27Z"
},
{
"id": "task-088",
"title": "执行 Kernel Phase 4 P4-4:统一 move/embed picker 等兼容树域,结束 documents[] 到 buildDocumentTree 的双轨主路径",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-085",
"task-086"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "17afde7d",
"validation": {
"command": "cd /mnt/Data1T/mnote/wolai-frontend && pnpm test src/lib/tree-projection.test.ts src/lib/sidebar-data.test.ts && pnpm exec eslint src/components/documents/move-embed-picker-dialog.tsx src/lib/tree-projection.ts",
"timeout_seconds": 1800
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 1,
"description": "move-embed picker 空查询态已直接消费 kernelSidebarTree -> page_tree projection,不再调用 buildDocumentTree(...)。",
"timestamp": "2026-04-16T16:11:29Z"
}
],
"completed_at": "2026-04-16T16:11:30Z"
},
{
"id": "task-089",
"title": "执行 Kernel Phase 4 P4-5:收敛旧 helper 与兼容逻辑,把 buildDocumentTree 退回兼容边界并收紧 sidebar-data 主路径投影要求",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-087",
"task-088"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "17afde7d",
"validation": {
"command": "cd /mnt/Data1T/mnote/wolai-frontend && pnpm test src/lib/sidebar-data.test.ts src/lib/tree-projection.test.ts src/lib/file-tree/rows.test.ts && pnpm exec eslint src/lib/sidebar-data.ts src/components/sidebar/types.ts src/lib/documents.ts",
"timeout_seconds": 1800
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 1,
"description": "已将 SidebarInitialData 的 kernelSidebarProjection/kernelSidebarTree 收紧为主路径必备字段,并给 buildDocumentTree 标明仅保留兼容 helper 边界。",
"timestamp": "2026-04-16T16:11:32Z"
}
],
"completed_at": "2026-04-16T16:11:33Z"
},
{
"id": "task-090",
"title": "执行 Kernel Phase 4 P4-6:回写 Phase 4 checklist/breakdown 与 harness 状态,确认树域 consumer/protocol 已满足 DONE 判定并交接下一阶段 Rust Web tree shell 重构",
"status": "completed",
"priority": "P0",
"depends_on": [
"task-085",
"task-086",
"task-087",
"task-088",
"task-089"
],
"attempts": 1,
"max_attempts": 3,
"started_at_commit": "17afde7d",
"validation": {
"command": "python3 - <<'PY2'\nfrom pathlib import Path\nroot = Path('/mnt/Data1T/mnote')\ncheck = (root / 'design/tree-first-graph-kernel-checklist-v2.md').read_text(encoding='utf-8')\nbreakdown = (root / 'design/tree-first-graph-kernel-phase4-task-breakdown-v1.md').read_text(encoding='utf-8')\nassert 'Kernel Phase 4``DONE' in check or 'Kernel Phase 4`DONE`' in check\nassert 'P4-6Phase 4 验收矩阵与下一阶段交接' in breakdown\nassert 'sidebar-pagetree-filetree-rust-web-rebuild-v1.md' in breakdown\nprint('task-090-phase4-docs-updated')\nPY2",
"timeout_seconds": 120
},
"on_failure": {
"cleanup": null
},
"error_log": [],
"checkpoints": [
{
"step": 1,
"total": 1,
"description": "已回写 Phase 4 checklist/breakdown 与 harness 状态,统一 Phase 4 DONE 口径,并明确下一阶段才是 sidebar-pagetree-filetree-rust-web-rebuild-v1.md。",
"timestamp": "2026-04-16T16:11:35Z"
}
],
"completed_at": "2026-04-16T16:11:36Z"
}
],
"session_count": 31,
"last_session": "2026-04-16T13:18:40Z"
"session_count": 33,
"last_session": "2026-04-16T16:11:37Z"
}