From f0c01404c4260fbff79126b07c4f6013236ea59a Mon Sep 17 00:00:00 2001 From: lix-2026 Date: Mon, 25 May 2026 22:36:04 +0800 Subject: [PATCH] docs: close runtime extraction checklists --- .../3-24-mnote-web-lib-test-failures-v1.md | 123 ++++++++++++++++++ ...0-browser-runtime-followup-checklist-v1.md | 0 ...-21-final-sidebar-runtime-extraction-v1.md | 28 ++-- ...ebar-tree-runtime-second-stage-split-v1.md | 77 +++++++++++ ...29-editor-runtime-followup-checklist-v1.md | 0 5 files changed, 216 insertions(+), 12 deletions(-) create mode 100644 bugs/03-rust-web/process/3-24-mnote-web-lib-test-failures-v1.md rename design/03-rust-web/{process => done}/3-20-browser-runtime-followup-checklist-v1.md (100%) rename design/03-rust-web/{process => done}/3-21-final-sidebar-runtime-extraction-v1.md (84%) create mode 100644 design/03-rust-web/process/3-22-sidebar-tree-runtime-second-stage-split-v1.md rename design/05-editor-mainline/{process => done}/5-29-editor-runtime-followup-checklist-v1.md (100%) diff --git a/bugs/03-rust-web/process/3-24-mnote-web-lib-test-failures-v1.md b/bugs/03-rust-web/process/3-24-mnote-web-lib-test-failures-v1.md new file mode 100644 index 00000000..388ce575 --- /dev/null +++ b/bugs/03-rust-web/process/3-24-mnote-web-lib-test-failures-v1.md @@ -0,0 +1,123 @@ +# 3-24 mnote-web 全量 lib 测试失败分类 v1 + +> 创建时间:2026-05-25 +> 状态:`process` +> 来源:`design/03-rust-web/done/3-21-final-sidebar-runtime-extraction-v1.md` 归档时拆出的横向测试债。 + +## 1. 背景 + +`3-21` 的 runtime extraction 主体已经完成:`SIDEBAR_TREE_JS` 已外置,`layout.rs` 已回到 SSR/bootstrap 职责,`editor_runtime/mindmap_node_view.rs` 与 `bridge_events.rs` 已激活。归档时剩余的阻塞不是 runtime extraction 本身,而是: + +```bash +cargo test --manifest-path rust/Cargo.toml -p mnote-web --lib -- --test-threads=1 +``` + +2026-05-25 22:32 复跑结果为 `529/549` 通过、`20` 个失败。失败簇包含 watcher OS limit、legacy proxy、access policy dialog、Hermes block tools 403、local search index、resource trash 503、web_shell 旧断言等。 + +本 bug/checklist 负责把这些失败从 `3-21` 中拆出来,避免已完成的 browser runtime 外置继续被横向测试债卡在 `process/`。 + +## 2. 非目标 + +- 不把旧 Convex / task158 作为当前主线验收阻塞。 +- 不在本 bug 中继续拆 `sidebar-tree-runtime.js`;二阶段拆分归 `design/03-rust-web/process/3-22-sidebar-tree-runtime-second-stage-split-v1.md`。 +- 不一次性修所有失败;先分类,再按 owner 拆批。 + +## 3. 分类维度 + +- 环境限制:inotify/watch limit、端口占用、本机外部服务不可用。 +- legacy/历史断言:测试仍指向旧路径、旧兼容契约或已退役 runtime。 +- fixture/auth/policy:测试数据、默认账号、权限 fixture 或 dialog 状态不稳定。 +- 疑似真实回归:当前主链契约应通过但失败,且不是环境或历史断言。 + +## 4. 当前待确认清单 + +- [x] 复跑全量命令,记录失败测试名称列表。 +- [x] 按第 3 节给每个失败项归类。 +- [x] 标出可在一批内快速修复的低风险测试。 +- [ ] 对疑似真实回归新建或补充对应 `bugs/03-rust-web/process/` / `bugs/07-ai/process/` 条目。 +- [ ] 修复或豁免后再决定本文件是否移动到 `done/`。 + +## 5. Reasonix 只读审计 + +2026-05-25 已派发一个 Reasonix 只读 worker,任务文件: + +```text +/tmp/reasonix-mnote-web-lib-test-audit.md +``` + +采纳条件: + +- `modified_files` 必须为空。 +- 必须列出实际运行命令和失败测试名。 +- 只读结论需要由 Codex 用本地测试输出或源码定位复核后再写回本文件。 + +实际结果:该 Reasonix run 未产出 `result.json` / `process-handoff.md/json` / `final.md`,transcript 中出现无关 `hermes_client.rs` grep;Codex 已终止 runner,不采纳其文字过程。随后由 Codex 主控复跑测试并生成 `/tmp/mnote-web-lib-test-20260525.log`。 + +## 6. 复跑证据 + +命令: + +```bash +cargo test --manifest-path rust/Cargo.toml -p mnote-web --lib -- --test-threads=1 +``` + +结果: + +```text +test result: FAILED. 529 passed; 20 failed; 0 ignored; 0 measured; 0 filtered out; finished in 17.53s +``` + +失败测试: + +```text +local_folder_watcher_registry::tests::different_roots_create_independent_watchers +local_folder_watcher_registry::tests::same_root_subscribers_share_single_watcher +routes::gateway::tests::legacy_proxy_normalizes_auth_post_origin_to_upstream_origin +routes::gateway::tests::legacy_proxy_preserves_multiple_set_cookie_headers +routes::gateway::tests::root_entry_renders_access_policy_dialog_templates_for_all_actors +routes::hermes_tools::tests::hermes_tools_block_insert_after_accepts_multiple_blocks_and_returns_ids +routes::hermes_tools::tests::hermes_tools_block_insert_after_rejects_more_than_twenty_blocks +routes::hermes_tools::tests::hermes_tools_block_move_after_blocks_complex_and_nested_blocks +routes::hermes_tools::tests::hermes_tools_block_replace_and_insert_after_write_through_page_body_save +routes::hermes_tools::tests::hermes_tools_block_tools_selection_scope_rejects_out_of_scope_targets +routes::hermes_tools::tests::hermes_tools_block_write_requires_fresh_revision_and_block_ref +routes::hermes_tools::tests::hermes_tools_doc_find_and_block_fetch_use_block_projection +routes::hermes_tools::tests::hermes_tools_plan_update_and_block_move_after_are_dry_run_only +routes::local_search_index::tests::local_search_index_incrementally_updates_single_markdown_path +routes::resource_trash::tests::media_trash_routes_delete_restore_purge_and_empty +routes::resource_trash::tests::resource_move_uses_resource_command_not_document_command +routes::resource_trash::tests::resource_rename_uses_resource_command_not_document_command +routes::web_shell::tests::document_shell_renders_local_markdown_with_same_sidebar_surfaces +routes::web_shell::tests::document_shell_returns_page_aggregate_snapshot +routes::web_shell::tests::page_aggregate_endpoint_allows_sqlite_granted_local_folder_read_access +``` + +## 7. 分类 + +| 分类 | 失败项 | 依据 | 建议 | +|------|--------|------|------| +| 环境限制 | `local_folder_watcher_registry::*watcher*` 2 项 | panic 明确为 `OS file watch limit reached` | 不阻塞 runtime extraction;后续改成 watch limit 下 skip/降级断言,或提高本机 inotify limit 后复测。 | +| legacy/历史断言 | `legacy_proxy_normalizes_auth_post_origin_to_upstream_origin`、`legacy_proxy_preserves_multiple_set_cookie_headers` | 期望 legacy upstream `200`,实际返回 `400`;Convex/Next 旧兼容已退役,不应成为当前主线阻塞 | 单独审计是否仍需要 legacy proxy 单测;若保留,只验证显式 compat flag 下的错误语义。 | +| fixture/auth/policy | `root_entry_renders_access_policy_dialog_templates_for_all_actors` | 断言 `data-testid="mnote-account-access-policy"`,当前首屏模板/账号菜单契约可能已调整 | 小批修复:对齐当前 UI testid 或补回稳定模板锚点。 | +| fixture/auth/policy | 8 个 `routes::hermes_tools::*block*` / `doc_find_and_block_fetch` 失败 | 全部实际 `403`,期望 `200`/`400`;集中在 Hermes block tools 的 write/read scope、fixture actor 或 capability 授权 | 拆到 `07-ai` 或 Hermes tools bug;先确认测试 fixture 是否缺少当前 `AiAccessScope` / allowed roots / allowed target blocks。 | +| 疑似真实回归 | `local_search_index_incrementally_updates_single_markdown_path` | 更新 frontmatter 后仍返回文件名派生标题 `child`,期望 `Child Updated` | 值得优先修:范围小,可能是增量索引未重读 frontmatter 或标题派生优先级错误。 | +| fixture/compat | `routes::resource_trash::*` 3 项 | 全部实际 `503`,期望 `200`;测试仍走 table/resource compat fixture 或 upstream 命令链 | 拆成 resource trash compat bug;先确认 local-first resource command 是否已有新主链替代。 | +| legacy/历史断言 | `document_shell_returns_page_aggregate_snapshot`、`document_shell_renders_local_markdown_with_same_sidebar_surfaces` | 断言旧 inline JS 字符串,例如 `.tree-row...` / `fileAction === 'open'...`;runtime 已外置,字符串不应继续在 HTML 中出现 | 低风险修复:改测 asset script/module 引用或新 runtime 文件内容,不应阻塞 `3-21`。 | +| 疑似契约漂移 | `page_aggregate_endpoint_allows_sqlite_granted_local_folder_read_access` | 当前 head title 为 `Grant Root`,旧断言期望正文 H1 `Grant Heading` | 需要产品口径确认:本地 Markdown 标题来源是文件名还是 H1。若遵循当前 AGENTS 主线“本地 .md 是正文真相,文件树文件名是组织投影”,倾向更新断言为文件名标题。 | + +## 8. 下一步建议 + +优先顺序: + +1. 先修或调整 3 个低风险旧断言:两个 `web_shell` inline JS 断言 + access policy testid 断言。 +2. 单独处理 `local_search_index_incrementally_updates_single_markdown_path`,这是最像真实回归的小范围失败。 +3. 把 8 个 Hermes block tools 403 移到 `07-ai`,按 AI access scope fixture 统一修。 +4. 把 3 个 resource trash 503 移到 resource/tree command 兼容 bug,确认是否还需要旧 compat fixture。 +5. watcher 两项按环境限制处理,不作为 runtime extraction 阻塞。 + +## 9. 归档条件 + +- 全量失败列表有一次可复现记录。 +- 每个失败项都有明确分类和 owner。 +- 能立即修复的低风险失败已修复,或已拆成独立 bug。 +- 本文件不再承担多个不相关失败的长期追踪。 diff --git a/design/03-rust-web/process/3-20-browser-runtime-followup-checklist-v1.md b/design/03-rust-web/done/3-20-browser-runtime-followup-checklist-v1.md similarity index 100% rename from design/03-rust-web/process/3-20-browser-runtime-followup-checklist-v1.md rename to design/03-rust-web/done/3-20-browser-runtime-followup-checklist-v1.md diff --git a/design/03-rust-web/process/3-21-final-sidebar-runtime-extraction-v1.md b/design/03-rust-web/done/3-21-final-sidebar-runtime-extraction-v1.md similarity index 84% rename from design/03-rust-web/process/3-21-final-sidebar-runtime-extraction-v1.md rename to design/03-rust-web/done/3-21-final-sidebar-runtime-extraction-v1.md index e92c0e11..9c66b014 100644 --- a/design/03-rust-web/process/3-21-final-sidebar-runtime-extraction-v1.md +++ b/design/03-rust-web/done/3-21-final-sidebar-runtime-extraction-v1.md @@ -1,9 +1,12 @@ # 03-19 / 05-28 末尾 — 最终完整收口计划 > 创建时间:2026-05-25 -> 状态:`process` +> 完成时间:2026-05-25 +> 状态:`done` > 来源:基于 3-19 / 5-28 原始设计,独立制定,不依赖 3-20 / 5-29 checklist。 +归档说明(2026-05-25):本文件记录的是 `3-19` / `5-28` 末尾收口计划。第 1-3 节中的“当前代码基线”是制定计划时的历史状态;真实最终状态以第 5 节执行记录和第 7 节为准。`SIDEBAR_TREE_JS` 已外置到 `browser/sidebar-tree-runtime.js`,`mindmap_node_view.rs` / `bridge_events.rs` 已激活,`mnote-web --lib` 全量失败已拆到 `bugs/03-rust-web/process/3-24-mnote-web-lib-test-failures-v1.md`,不再阻塞本 runtime extraction 归档。 + ## 1. 背景 `3-20` 和 `5-29` 的 followup checklist 虽已标记 done,但通过 `codegraph` 和直接文件审计发现核心剩余工作: @@ -77,19 +80,19 @@ editor_runtime/ **执行步骤**: -- [ ] **A1** — 创建 `browser/sidebar-tree-runtime.js` +- [x] **A1** — 创建 `browser/sidebar-tree-runtime.js` - 将 `SIDEBAR_TREE_JS` 内容逐个字符同构迁入该文件 - 所有引用已外置 runtime 模块(filetree-*, local-upload 等)的逻辑保持不变 - 保证语义完全不变,不引入任何行为修改 - 验证:`node --check`、`cargo test -p mnote-web --lib` -- [ ] **A2** — 将注入方式改为外置 module script +- [x] **A2** — 将注入方式改为外置 module script - 注册 asset route:`GET /api/mnote-browser-runtime/sidebar-tree-runtime.js` - `layout.rs` 改为 `