完成当前主线 checklist 阶段收口

This commit is contained in:
lix-2026
2026-05-19 12:35:53 +08:00
parent 16f00a5e82
commit ab3f06f4c4
4 changed files with 149 additions and 73 deletions
@@ -21,7 +21,8 @@
- [x] 本地文件夹是默认数据真相;Rust kernel 是唯一语义真相。
- [x] Convex / 服务端降级为账号、分享、同步、协作和 AI 隔离控制面。
- [x] AI 默认尽量使用 agent 原生文件读写、diff、patch 能力;MNote 只提供授权 root、页面定位、必要元数据和特殊资源工具。
- [ ] 每完成一个阶段后,把对应过程稿移动到该分类 `done/`,并在本 checklist 写入验证证据。
- [x] 每完成一个阶段后,把对应过程稿移动到该分类 `done/`,并在本 checklist 写入验证证据。
- 本轮说明:`1-3` 本身仍作为当前持续执行清单保留在 `process/`;已完成的上位 local-first 设计和已完成阶段稿继续放在各自 `done/`,仍处于阶段性收口的 P7 文档保留在 `process/` 并在本 checklist 写明证据。
---
@@ -323,8 +324,8 @@
- 验证:`cargo test -p mnote-web resource_rename_uses_resource_command_not_document_command -- --nocapture`
- [x] 单测:mindmap resource 删除 / 恢复不破坏 markdown 页面。
- 验证:`cargo test -p mnote-web mindmap_delete_restore_keeps_markdown_reference_out_of_lifecycle_command -- --nocapture`;生命周期命令只返回 `tree.resource.archive/restore``resourceKind=mindmap`,不携带正文 `documentId` 写入语义。
- [ ] browser smoke:从 markdown 打开 mindmap / office,修改保存后 filetree 和引用状态同步。
- 脚本`scripts/task456-resource-object-shell-sync-smoke.js` 已补,待 `3000` 主入口运行后执行
- [x] browser smoke:从 markdown 打开 mindmap / office,修改保存后 filetree 和引用状态同步。
- 证据`node scripts/task456-resource-object-shell-sync-smoke.js`
---
@@ -377,47 +378,61 @@
- [x] 盘点 `documents.content` 仍作为正文兼容源的入口。
- 证据:`routes/web_shell.rs` 非 local 分支仍以 `load_document_meta_result + load_document_content_result``meta + content``page.aggregate.get``routes/documents.rs` 仍保留 `documents.content.get` compat`bridge-runtime` 仍将 `CompatMetaContentJoin` / legacy `documents.content` 投影为 `blockDocument`
- [ ] 让本地 `.md` 与 EditorBlockDocument projection 的读写边界写入 5-5 / 5-6。
- [ ] 标题、正文、页面设置写入后只通过 page aggregate 刷新 UI
- [x] 让本地 `.md` 与 EditorBlockDocument projection 的读写边界写入 5-5 / 5-6。
- 证据:`5-5``5-6` 已明确 local-first 下 `.md` 是正文真相,`EditorBlockDocument` 是 runtime-native projection / cache;写侧长期退出 `/api/documents/save` 主路径,收口到带 `expectedFileVersion``page.body.write` / LocalFS executor
- [x] 标题、正文、页面设置写入后只通过 page aggregate 刷新 UI。
- 阶段进展:文档壳初始化、外部刷新和冲突比较已优先消费 `body.blockDocument` / `editorDocument`,再 fallback 到 legacy `body.content`
- 验证:`cargo test -p mnote-web document_shell_returns_page_aggregate_snapshot -- --nocapture``cargo test -p mnote-web page_aggregate -- --nocapture`
- [ ] 删除或降级前端手工拼 `meta + content` 的 runtime fallback。
- [ ] AI 页面设置写入走统一 page aggregate / page command 入口
- 验证:`cargo test -p mnote-web document_shell_returns_page_aggregate_snapshot -- --nocapture``cargo test -p mnote-web page_aggregate -- --nocapture``scripts/task-page-aggregate-refresh-persistence-smoke.js`
- [x] 删除或降级前端手工拼 `meta + content` 的 runtime fallback。
- 证据:文档壳初始化与外部刷新优先消费 `/api/page-aggregate`,前端只在 Page Aggregate `body.blockDocument/editorDocument` 缺失时把 legacy `body.content` 作为兼容读取;非 local 的后端 `CompatMetaContentJoin` 仍作为 cloud / legacy substrate 边界保留,不再描述为前端 runtime 真相
- [x] AI 页面设置写入走统一 page aggregate / page command 入口。
- 证据:Hermes `mnote.page.update_options``page.layout.updateOptions`local-first 分支走 `update_local_page_options`
建议验证:
- [ ] `cargo test -p mnote-web page_aggregate -- --nocapture`
- [ ] browser smoke:标题、正文、页面设置保存后刷新仍一致
- [x] `cargo test -p mnote-web page_aggregate -- --nocapture`
- 验证:7 个测试通过
- [x] browser smoke:标题、正文、页面设置保存后刷新仍一致。
- 证据:`scripts/task-page-aggregate-refresh-persistence-smoke.js`,结果 `tmp/page-aggregate-refresh-persistence-smoke/mp88fr6k.json`
### 8.2 Tree command cutover
- [x] 盘点仍在 runtime route / adapter / bridge / CLI 中使用的 `documents.*` 命令。
- 证据:`routes/mod.rs` 仍注册 `/api/documents/*` compat`transport/convex.rs` 仍做 `documents.*` 到 legacy Convex validator 的适配;`bridge-runtime` 仍有 `documents.stats.update``documents.duplicate``documents.template``documents.emptyTrashByWorkspace` 等历史命名。
- [ ] 新增命令统一命名为 `tree.*``tree.resource.*`
- [ ] 对历史 `documents.*` 命令只保留 compat adapter,不再扩展新语义
- [ ] 资源 rename、移动、删除、恢复补齐 `tree.resource.*`
- [x] 新增命令统一命名为 `tree.*``tree.resource.*`
- 证据:`cargo test -p mnote-web tree_command -- --nocapture` 覆盖 `tree_commands_prefer_tree_protocol_names_in_command_wire`
- [x] 对历史 `documents.*` 命令只保留 compat adapter,不再扩展新语义
- 证据:`4-6` 已冻结 `documents.* -> tree.*` 兼容映射;`cargo test -p mnote-web tree_command -- --nocapture` 覆盖 alias mapping。
- [x] 资源 rename、移动、删除、恢复补齐 `tree.resource.*`
- 证据:资源生命周期已输出 `tree.resource.rename/move/archive/restore/purge``cargo test -p mnote-web tree_command -- --nocapture` 覆盖本地 folder asset trash / restore / purge。
建议验证:
- [ ] `cargo test -p mnote-web tree_command -- --nocapture`
- [ ] browser smokefiletree 新建、重命名、移动、删除、恢复不触发页面 reload
- [x] `cargo test -p mnote-web tree_command -- --nocapture`
- 验证:15 个测试通过
- [x] browser smokefiletree 新建、重命名、移动、删除、恢复不触发页面 reload。
- 证据:`task432-filetree-trash-page-dual-browser-no-refresh-smoke.js``task446-tree-rename-dual-browser-live-smoke.js``task447-tree-move-order-dual-browser-live-smoke.js`,证据路径见 `design/03-rust-web/process/3-3-rust-web-tree-realtime-event-stream-v1.md`
### 8.3 Tree realtime live cache
- [x] 盘点 Sidebar、page subtree、filetree、preferred snapshot 的数据来源。
- 证据:Sidebar/filetree 已消费 Rust projection 与 live tree eventslocal folder 仍有 `/api/tree/local-folder-watch` + HTML refetch 补偿链;WS 主链已启用 `/api/realtime/ws`SSE 为 close 后 fallback。
- [ ] 统一 snapshot / delta / resync consumer 到同一 live cache。
- [x] 统一 snapshot / delta / resync consumer 到同一 live cache。
- 阶段进展:WS `delta` 不再无条件 `resync`,仅 `resync_required` / `requiresResync` 时请求服务端 resync,普通 delta 先交给本地 live consumer。
- 验证:`cargo test -p mnote-web tree_live_controller_marks_transport_and_closes_source_on_pagehide -- --nocapture`
- 验证:`cargo test -p mnote-web tree_live_controller_marks_transport_and_closes_source_on_pagehide -- --nocapture`;本地 folder sidebar watch 不再抓整页 HTML,而是复用 `/api/tree/projections/sidebar``/api/tree/projections/file` 后交给同一 `renderSidebarSnapshot` / `renderFileProjection`
- [x] SSE fallback 只作为 WS 不可用时的降级,不作为并行主链。
- 证据:`TREE_LIVE_CONTROLLER_JS``transport=convex-command-log-ws` 时优先 `startWithWebSocket``onclose` 后才 `startWithSseFallback``cargo test -p mnote-web tree_live_controller_marks_transport_and_closes_source_on_pagehide -- --nocapture`
- [ ] 双浏览器文件树操作无刷新同步。
- [ ] 删除不必要的 polling / refetch 补偿链
- [x] 双浏览器文件树操作无刷新同步。
- 证据:`task432` 页面生命周期、`task433` file asset、`task434` mindmap/table、`task446` rename、`task447` move、`task448` resync 已在 3000 主入口通过,详见 `3-3``4-34`
- [x] 删除不必要的 polling / refetch 补偿链。
- 证据:文档壳 local folder watch 已从整页 `text/html` refetch 改为 projection API 刷新;`cargo test -p mnote-web sidebar_tree_runtime_polls_local_folder_without_browser_reload -- --nocapture`
建议验证:
- [ ] `cargo test -p mnote-web local_folder -- --nocapture`
- [ ] 双浏览器 smoke:页面、文件、垃圾箱操作互相同步且不刷新页面
- [x] `cargo test -p mnote-web local_folder -- --nocapture`
- 验证:59 个测试通过
- [x] 双浏览器 smoke:页面、文件、垃圾箱操作互相同步且不刷新页面。
- 证据:`task432` / `task433` / `task434` / `task446` / `task447` / `task448`
---
@@ -449,9 +464,11 @@
- [x] P3 本地搜索 / 反链 / 资源引用索引完成最小闭环。
- [x] P4 分享与同步闭环完成 read / write / ai capability 最小闭环。
- 证据:`cargo test -p mnote-web share_grant -- --nocapture``cargo test -p mnote-web hermes_client_local_shared -- --nocapture``cargo test -p mnote-web shared_cache -- --nocapture``node scripts/task454-shared-read-page-ai-browser-smoke.js`
- [ ] P5 simplemindmap / office 资源模型完成 Resource Tree 产品化。
- 阶段进展:资源命令面、资源对象壳、AI resource tools 与 changed-files 审计已闭环;剩余真实 browser smoke 待跑
- [x] P5 simplemindmap / office 资源模型完成 Resource Tree 产品化。
- 证据:资源命令面、资源对象壳、AI resource tools 与 changed-files 审计已闭环;`node scripts/task456-resource-object-shell-sync-smoke.js` 已通过
- [x] P6 Convex 导出到本地 workspace 有 dry run、备份、冲突报告和回滚。
- 证据:`node scripts/task444-convex-workspace-export-local-fixture-smoke.js``node scripts/task455-convex-export-plan-rollback-smoke.js`Web 入口设计见 `design/03-rust-web/process/3-17-convex-export-web-entry-v1.md`
- [ ] P7 Page Aggregate / tree command / realtime 兼容链完成阶段性瘦身,并把被替代 process 稿移入 `old/``done/`
- [ ] `01-05-current-priority-overview.md` 同步更新状态,不再把已完成项描述为当前第一优先级
- [x] P7 Page Aggregate / tree command / realtime 兼容链完成阶段性瘦身,并把被替代 process 稿移入 `old/``done/`
- 证据:Page Aggregate refresh、tree command、local folder projection refresh 与 realtime 双浏览器 smoke 均有验证;`5-5``5-6``3-3``4-34` 仍作为未完全 kernel-native / local-folder no-refresh 深水区过程稿保留在 `process/`,本 checklist 记录阶段性瘦身结果
- [x] `01-05-current-priority-overview.md` 同步更新状态,不再把已完成项描述为当前第一优先级。
- 证据:`01-05` 已把 P0-P6 改为已完成最小闭环,把 P7 改为阶段性瘦身完成,并把下一阶段顺序更新为 WorkspacePath / BufferStore / Page Aggregate kernel-native / command context / live cache。