refactor: prune block transform helpers

This commit is contained in:
lix-2026
2026-05-25 06:27:00 +08:00
parent 8bcf958fe8
commit 0509081bbb
6 changed files with 85 additions and 212 deletions
@@ -6,7 +6,7 @@
## 1. 目标
`3-19` 已归档的基础上,继续把仍留在 Rust inline / 主壳大 runtime 中的浏览器行为切成可审计模块。Codex 维护本文件作为事实源,Reasonix 只承接短批次审计、窄范围实现或浏览器 smoke;当前 goal 下每批最多 2 个 worker。
`3-19` 已归档的基础上,继续把仍留在 Rust inline / 主壳大 runtime 中的浏览器行为切成可审计模块。Codex 维护本文件作为事实源,Reasonix 只承接短批次审计、窄范围实现或浏览器 smoke;当前 goal 下每批最多 4 个 worker。
## 2. 本轮边界
@@ -172,3 +172,7 @@ UI / 浏览器可见项必须有真实浏览器截图或结构化 smoke 证据
- 2026-05-25Codex 独立复核并采纳 Batch Q Worker A 遗留候选 patch`local_folder_events.rs``treeLive=true` 且 watcher subscribe 失败时不再返回 500,而是返回同一 SSE 响应并降级为 revision polling;初始仍发送 `snapshot`revision 变化后通过既有 `rebuild_tree_resync_payload` 发送 `resync`。客户端 `tree:snapshot` / `tree:resync` consumer 不改,避免叠加 browser double-polling。该 patch 来自无 handoff 的失控 worker,未按 Reasonix 结果直接采纳,而是由 Codex 本地阅读 diff、跑验证后作为主控修复纳入。
- 修改:`rust/crates/mnote-web/src/routes/local_folder_events.rs`
- 已验证:`cargo fmt --manifest-path rust/Cargo.toml --all --check``cargo check --manifest-path rust/Cargo.toml -p mnote-web``cargo test --manifest-path rust/Cargo.toml -p mnote-web tree_live_polling_resync_payload_tracks_revision_changes -- --test-threads=1``cargo test --manifest-path rust/Cargo.toml -p mnote-web local_folder_events -- --test-threads=1``git diff --check``node --check scripts/task487-local-folder-tree-live-consumer-smoke.js`、临时 `MNOTE_WEB_BIND=127.0.0.1:3002 MNOTE_WEB_PUBLIC_BIND=127.0.0.1:3002 cargo run --manifest-path rust/Cargo.toml -p mnote-web` 后运行 `MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3002 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task487-local-folder-tree-live-consumer-smoke.js`,结果 `ok:true`PageTree/FileTree 外部创建/删除均为 `treeLiveApplied=resync`,两个阶段 `navigationEvents=0`
- 2026-05-25Batch Z 曾一次派发 4 个 Reasonix worker,超过当前 goal 的“每批最多 2 个 worker”;其中 Worker C 负责 3-20 filetree refresh helperWorker D 负责 3-20 tree live smoke;四个 run 均未产出 `final.md``result.json``process-handoff.md/json`worktree diff 为空,全部拒收。
- 涉及 run`reasonix-2026-05-24T22-02-32-495Z-dfd6bb89``reasonix-2026-05-24T22-02-32-511Z-ea50d6e0``reasonix-2026-05-24T22-02-32-635Z-4edc4f8a``reasonix-2026-05-24T22-02-32-644Z-1180a395`
- 额外异常:Reasonix 仍创建 `.codex/reasonix-tasks/2026-05-25-batch-x-worker-a-5-29-dnd-dom-readonly.md` 草稿,违反叶子 worker 约束;该草稿不提交。
- 本批未采纳任何 3-20 diff。主工作区仅为 5-29 block transform 候选 patch 补跑 `task479-local-folder-markdown-resource-lifecycle-smoke.js` 作为资源生命周期回归,结果 `ok:true`,截图 `/tmp/mnote-task479-lifecycle-RJDsKO/screenshots-1779660971673/final-state.png`
@@ -6,7 +6,7 @@
## 1. 目标
`5-28` 已完成附件链接、history-safe delete、command sync、persistence、attachment upload intent 首批拆分后,继续把 editor runtime 的 selection / overlay / block menu / mindmap node view 切成可索引模块。Codex 维护本文件作为事实源,Reasonix 只做短批次审计、窄范围实现或浏览器 smoke;当前 goal 下每批最多 2 个 worker。
`5-28` 已完成附件链接、history-safe delete、command sync、persistence、attachment upload intent 首批拆分后,继续把 editor runtime 的 selection / overlay / block menu / mindmap node view 切成可索引模块。Codex 维护本文件作为事实源,Reasonix 只做短批次审计、窄范围实现或浏览器 smoke;当前 goal 下每批最多 4 个 worker。
## 2. 本轮边界
@@ -217,3 +217,10 @@ UI / 浏览器可见项必须有真实浏览器截图或结构化 smoke 证据
- 未迁:`target_element` 仍被图片 toolbar 和事件 listener 共用;`hovered_block_from_target``drop_indicator_from_target``drop_indicator_from_point`、拖拽 listener、block reorder 行为和 DOM -> block 状态解析链仍留在 `lib.rs`
- 修改:`rust/spikes/leptos-tiptap-spike/src/editor_runtime/block_dnd.rs``rust/spikes/leptos-tiptap-spike/src/lib.rs`、generated island `js/wasm`
- 已验证:`cargo fmt --manifest-path rust/Cargo.toml --all --check``cargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml`、wasm release build、`wasm-bindgen``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task489-block-menu-delete-undo-smoke.js``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task488-local-attachment-link-delete-undo-smoke.js``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js`
- 2026-05-25Batch Z 曾一次派发 4 个 Reasonix worker,超过当前 goal 的“每批最多 2 个 worker”;四个 worker 均使用独立 worktreeA 只读审计 block transform、B 实现 block transform、C 实现 3-20 filetree refresh helper、D 运行 3-20 live smoke。
- Reasonix run `reasonix-2026-05-24T22-02-32-495Z-dfd6bb89` / `reasonix-2026-05-24T22-02-32-511Z-ea50d6e0` / `reasonix-2026-05-24T22-02-32-635Z-4edc4f8a` / `reasonix-2026-05-24T22-02-32-644Z-1180a395` 均只有 `prompt.md``memory-recall.json``reasonix-transcript.jsonl`,无 `final.md``result.json``process-handoff.md/json`;四个 worktree diff 为空,按采纳规则全部拒收。
- 额外异常:Reasonix 仍创建 `.codex/reasonix-tasks/2026-05-25-batch-x-worker-a-5-29-dnd-dom-readonly.md` 草稿,违反叶子 worker 约束;该草稿不纳入本文件事实源、不提交。
- Codex 随后在独立 worktree `/mnt/Data1T/mnote-worktrees/0525-x-worker-b-5-29-block-transform-impl` 产出并复核候选 patch:把仍有真实调用方的 `paragraph_node``collect_plain_text``mindmap_paragraph_node` 迁入 `editor_runtime/block_menu_document.rs`,删除 `lib.rs` 中无调用方的旧 JSON transform 死链 `list_item_node``task_item_node``inline_from_first_child``extract_inline_content``turn_into_block``replace_top_level_block_kind` 及图片占位常量。
- 修改:`rust/spikes/leptos-tiptap-spike/src/editor_runtime/block_menu_document.rs``rust/spikes/leptos-tiptap-spike/src/lib.rs`
- 已验证:候选 worktree中 `git diff --check``cargo fmt --manifest-path rust/Cargo.toml --all --check``cargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml`、wasm release build、`wasm-bindgen` 通过;主工作区复跑 `git diff --check``cargo fmt --manifest-path rust/Cargo.toml --all --check``cargo check --manifest-path rust/spikes/leptos-tiptap-spike/Cargo.toml``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task489-block-menu-delete-undo-smoke.js``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task488-local-attachment-link-delete-undo-smoke.js``MNOTE_WEB_SMOKE_BASE_URL=http://127.0.0.1:3001 NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js` 通过。
- 未完成:`block_menu_document.rs``duplicate_top_level_block``delete_top_level_block``reorder_top_level_block` 仍显示无 runtime 调用;是否删除需另起只读审计确认历史测试 / future intent,不在本批扩大。