收口 MNote P0 P1 P2 审查尾项

- 归档 OnlyOffice live bridge、Page AI、mindmap、design governance 与相关 bug 条目
- 补齐 MinerU OCR 后端 runtime 合同与 smoke/test 基线
- 收口 ChatOnly/Doubao、ObjectIdentity、Page Aggregate compat 与 runtime owner 文档口径

验证:
- cargo test --manifest-path rust/Cargo.toml -p mnote-web local_ocr -- --test-threads=1
- cargo test --manifest-path rust/Cargo.toml -p mnote-web onlyoffice_bridge -- --test-threads=1
- git diff --check
- git diff --cached --check
- codegraph index . --force && codegraph status .
- codegraph sync . && codegraph status .
This commit is contained in:
lix-2026
2026-06-01 09:29:12 +08:00
parent 49a0545148
commit 1882db7681
143 changed files with 29810 additions and 3228 deletions
@@ -0,0 +1,48 @@
# 4-52 resource lifecycle 兼容路径在 Convex 退役后丢失 artifact / 拒绝 mindmap lifecycle
## 状态
- 状态:done
- Owner04-tree-domain / bridge-runtime / resource lifecycle command
- 发现时间:2026-06-01
- 修复时间:2026-06-01
## 现象
执行 `cargo test -p mnote-web mindmap -- --test-threads=1` 时,mindmap 相关宽测曾失败:
- `mindmap_put_derives_workspace_and_returns_tree_artifacts`
- `mindmap_command_apply_returns_object_artifacts_without_tree_resync`
- `mindmap_delete_restore_keeps_markdown_reference_out_of_lifecycle_command`
- `mindmap_trash_routes_delete_restore_purge_and_empty`
- `sidebar_runtime_routes_local_mindmap_and_office_assets`
前两个失败是 `execute_retired_command_plan_with_artifacts()` 在 Convex 退役后仍能执行 fixture mutation,但把 Rust artifact plan 置为 `None`,导致调用方拿不到 `commandLog` / `domainEvent`
后两个失败是 `tree.resource.archive/restore/purge/rename` 在 bridge-runtime 生成 resource-kind 专用函数名前,会先经过 `build_write_request()`;旧 `legacy_command_function_name()` 没有这些正式 tree resource command 名,导致 mindmap lifecycle 被 `retired_bridge_error()` 拒绝。
最后一个失败是 runtime 拆分后,OnlyOffice local open 逻辑已迁到 `sidebar-filetree-open-runtime.js`,但 Rust include 断言仍检查旧 `sidebar-tree-runtime.js` 字符串。
## 根因
- Convex 退役后,artifact 持久化不能再作为兼容路径成功条件;Rust artifact plan 应继续返回给调用方和 realtime consumer。
- resource lifecycle command 的正式命名已从表面 compat alias 收口到 `tree.resource.*`,但旧 Convex 兼容映射表未允许这些名称通过前置 request 构造。
- browser runtime 模块拆分后,测试断言没有同步到新的 canonical owner 文件。
## 修复
- `rust/crates/mnote-web/src/transport/convex.rs`
- `persist_runtime_command_artifacts()` 在 Convex 退役路径改为 no-op 成功。
- `execute_retired_command_plan_with_artifacts()` 重新构造并返回 `RuntimeCommandArtifactPlan`,不重新启用 Convex artifact 持久化。
- `rust/crates/bridge-runtime/src/lib.rs`
- `legacy_command_function_name()` 允许 `tree.resource.archive/restore/purge/rename` 通过前置 request 构造;最终函数名仍由 resource lifecycle plan 按资源类型分流。
- `rust/crates/mnote-web/src/ssr/pages/layout.rs`
- OnlyOffice local open 断言改查 `SIDEBAR_FILETREE_OPEN_RUNTIME_JS`
- `rust/crates/mnote-web/src/routes/resource_trash.rs`
- `delete_json()` test helper 在状态码失败时输出 body,便于后续定位真实错误码。
## 验证
- `cargo test -p mnote-web mindmap -- --test-threads=1`
结果:26 个 mindmap 相关测试全部通过。
@@ -0,0 +1,33 @@
# 4-53 WorkspacePath / ObjectIdentity 浏览器矩阵缺口
## 状态
- 状态:done
- Owner04-tree-domain / 05-editor-mainline runtime identity
- 发现时间:2026-06-01
- 修复时间:2026-06-01
## 现象
P1 `WorkspacePath / ObjectIdentity` 已有底层协议与部分 smoke,但缺少一个单独覆盖 page `.md`、directory、raw file、mindmap、OnlyOffice 的浏览器矩阵。FileTree row、Resource Tab、OpenEditorsSnapshot、URL `resourceTab` 和 active tab identity 如果各自拼身份,后续 raw resource / mindmap / Office target 容易继续退化为“当前页”语义。
## 根因
已有 smoke 分散覆盖 copy-id、resource tab、mindmap 和 Office,但没有把统一 `ObjectWorkspacePath` 当作运行时消费合同统一断言。local folder 目录行还缺少 `local-dir:*` 的稳定 `documentId` fallbackresource tab 在部分本地资源打开路径下也缺少 `sourceKind` / `rootUri` fallback。
## 修复
- `rust/crates/mnote-web/browser/filetree-runtime.js`
- `readWorkspacePathFromRow()` 为 folder / index 行合成 `local-dir:{relativePath}`
- `fileTreeRowDocumentId()` 允许读取 `data-owner-document-id`,用于资源行 owner page 对齐。
- `rust/crates/mnote-web/browser/document-resource-tab-runtime.js`
- 在 URL 参数缺失时,从 body dataset 或 FileTree row workspacePath 兜底读取 `sourceKind` / `rootUri`
- `scripts/task524-workspace-object-identity-matrix-smoke.js`
- 新增 browser smoke,覆盖 page `.md`、directory、raw text、mindmap、OnlyOffice 的 FileTree row workspacePath、OpenEditorsSnapshot、URL `resourceTab`、active tab identity 对齐。
## 验收
- [x] `node --check rust/crates/mnote-web/browser/document-resource-tab-runtime.js`
- [x] `node --check rust/crates/mnote-web/browser/filetree-runtime.js`
- [x] `node --check scripts/task524-workspace-object-identity-matrix-smoke.js`
- [x] `MNOTE_UI_BASE_URL=http://127.0.0.1:3301 node scripts/task524-workspace-object-identity-matrix-smoke.js`