chore(tree): remove legacy iframe tree shell

Remove the active TreeShellIframeHost path and legacy env flag so rust_family only mounts the Rust/WASM DOM shell host.

Move legacy iframe host files to ignored recycle storage, clear tracked recycle cache entries, and update tree-domain design wording to the current no-iframe position.

Align filetree default active rows with doc:<documentId> and update the renderer artifact bridge contract to dom_wasm.
This commit is contained in:
lix-2026
2026-05-16 08:57:40 +08:00
parent 384da4e44c
commit f9336257a5
52 changed files with 145 additions and 13538 deletions
@@ -9,7 +9,9 @@
>
> 口径覆盖(2026-04-28):此前 `rust_runtime_artifact_host`、Rust/WASM reducer runtime、Rust initial DOM 与 `task112/task113` smoke 通过,只能证明 reducer/runtime 阶段完成,不能证明 final Rust DOM renderer 完成。真正 final renderer 的硬门禁以 `/mnt/Data1T/mnote/design/04-tree-domain/done/4-18-tree-final-dom-shell-cutover-hard-gate-v1.md` 为准:默认真实流量必须不再依赖 `TreeShellIframeHost` 的 `iframe_srcdoc` DOM shell。
>
> 收口更新(2026-04-28):`task-010` 至 `task-013` 已完成上述 final DOM shell 硬门禁。`rust_family` 默认真实流量已切到 `rust_wasm_dom_shell_host` + `dom_wasm` bridge`TreeShellIframeHost` 只在显式 `NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST=1` 下作为 legacy/debug host
> 收口更新(2026-04-28):`task-010` 至 `task-013` 已完成上述 final DOM shell 硬门禁。`rust_family` 默认真实流量已切到 `rust_wasm_dom_shell_host` + `dom_wasm` bridge。
>
> 最终清理更新(2026-05-16):`TreeShellIframeHost` 与对应测试已移动到 `recycle/``NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST` 入口已删除;active source 不再保留 iframe/srcDoc legacy/debug host。
## 1. 当前已收口基线
@@ -109,9 +111,9 @@
- 2026-04-28 final DOM shell 硬门禁已完成:`TreeShellIframeHost``iframe_srcdoc` browser bridge 不再是默认 page tree / file tree / picker DOM shell。
- `page tree / file tree / picker` 3000 默认主路径已标识为 `rust_wasm_dom_shell_host`,默认浏览器 bridge 为 `data-tree-browser-bridge="dom_wasm"`
- `TreeShellIframeHost`降级为显式 legacy/debug host,只能通过 `NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST=1` 进入;旧 `LOCAL_TREE_SHELL_TEMPLATE``buildInline*Html` 不再参与默认路径。
- `TreeShellIframeHost`从 active source 移到 `recycle/`;旧 `LOCAL_TREE_SHELL_TEMPLATE``buildInline*Html` 不再参与 active 路径。
- 默认 DOM host 已通过 `TreeShellRuntimeRequest/Result` 消费 WASM artifact 或同源 Rust HTTP seam 返回的 state、hostEvents、commandEvents;本地 JS fallback reducer 不再参与默认真实流量。
- 仍未完成的是非 DOM shell 范围:`tree.subtree.move``normalizedMove` compat fallback 删除、`document.snapshot.saved` 独立事件、`tree.node.embed` Page Aggregate/Rust artifact 深层收口,以及后续删除 legacy iframe host 清理。
- 仍未完成的是非 DOM shell 范围:`tree.subtree.move``normalizedMove` compat fallback 删除、`document.snapshot.saved` 独立事件、`tree.node.embed` Page Aggregate/Rust artifact 深层收口等历史条目的后续核验;legacy iframe host 清理已完成
- 宿主仍承担文件字节读取、外部上传 transport、菜单状态、实际命令调度、乐观 UI 和副作用通知;资源 upload/copy/move、内部 drop preflight、粘贴 preflight、外部上传目标 preflight 的目标与 metadata plan 已进入 Rust command contract。
- `tree.subtree.move` 的 canonical sort plan 已在 Rust 产出并进入 Convex 可选校验,但实际排序写入仍由 Convex `documents.move` 执行。
- `file_tree` 搜索过滤主链已改为 Rust projection query`maxResults / index.md / 附件 / 导图子附件 / book/pdf` 扩展 fixture 已补齐,后续仅保留更丰富搜索语义 hardening。
@@ -125,7 +127,7 @@
`page tree / file tree / picker``TreeShellIframeHost` 内联 DOM compat shell,迁到正式 Rust family renderer。
状态:默认主路径已完成迁移,legacy iframe host 作为显式排障开关保留。
状态:默认主路径已完成迁移,legacy iframe host 已移入 `recycle/`,不再作为显式排障开关保留。
### checklist
@@ -138,7 +140,7 @@
- `command dispatcher`
- 当前已作为 `rendererInput` 嵌入 `mnote-web` tree shell HTMLruntime DOM shell 已优先读该合同初始化局部状态,但尚未完全改为只消费该合同。
- 历史 3000 inline host 已把 `rendererInput``items` 注入同一个 appState;当前默认 DOM host 直接消费 projection model,不再通过 `__MNOTE_TREE_SHELL_OVERRIDE__` 主路径注入第二份 items。
- 默认 DOM shell 已固定 `family=rust_family / version=1 / executionStrategy=dom_wasm`,并优先使用 3000 同源 `tree-shell-runtime` artifactlegacy iframe manifest 中的 `browserBridge=iframe_srcdoc` 仅保留在显式 legacy/debug host。
- 默认 DOM shell 已固定 `family=rust_family / version=1 / executionStrategy=dom_wasm`,并优先使用 3000 同源 `tree-shell-runtime` artifactactive source 不再保留 `browserBridge=iframe_srcdoc` host。
- runtime artifact manifest 已新增 `runtimeApi`,显式暴露 `TreeShellRuntimeRequest / TreeShellRuntimeResult`、state snapshot、DOM patch、host event、command event kind。
- runtime artifact manifest 已继续暴露 `reduceEndpoint=/api/tree/runtime/reduce`3000 同源 thin proxy 与 mnote-web endpoint 保留为 fallback/debug。
- 正式 Rust/WASM reducer runtime 已落地:`tree-shell-runtime-wasm` 导出 `reduceTreeShellRuntime`3000 主路径默认优先加载 `mnote-tree-shell-runtime.js``mnote-tree-shell-runtime_bg.wasm` 执行 reduce。
@@ -162,7 +164,7 @@
- [x] `file tree` 后切 final renderer,并保留 `doc / index / asset-folder / asset` 能力。
- 当前状态:默认 file tree 由 `TreeShellRustDomShellHost` 渲染 DOMselection、context menu、open、internal/external drop 与 drop target 通过 runtime result/hostEvents 驱动,并保留 doc/index/asset-folder/asset row 口径。
- [x] compat host 退为 debug/internal fallback(本批可验证范围)。
- 3000 默认主路径不再请求 `/api/tree/shell -> mnote-web:3104`,也不再回退旧 React rendererhost implementation 已切到 `rust_wasm_dom_shell_host``mnote-web /tree` `TreeShellIframeHost` 仅保留显式 debug/internal/legacy 验证边界
- 3000 默认主路径不再请求 `/api/tree/shell -> mnote-web:3104`,也不再回退旧 React rendererhost implementation 已切到 `rust_wasm_dom_shell_host``mnote-web /tree` 仅保留显式 debug/internal 验证边界,`TreeShellIframeHost` 已进入 `recycle/`
### 验收
@@ -1,6 +1,8 @@
# 4-12 [done] task-003 page tree final renderer 执行清单 v1
> 口径修正(2026-04-28):本文件的 `done` 状态只表示 page tree 的 Rust initial DOM、hydration patch 与 state-family 阶段完成;不表示 `4-11` 所定义的 final Rust DOM shell 已完成。默认主路径仍依赖 `TreeShellIframeHost` / `iframe_srcdoc` 时,不得引用本文宣称 page tree final renderer 已最终收口。
>
> 最终清理更新(2026-05-16):`TreeShellIframeHost` 与 `iframe_srcdoc` 已退出 active source 并移动到 `recycle/`;本文保留为历史 state-family 阶段记录,当前口径以 `4-18` / `4-19` 为准。
## 目标
@@ -1,6 +1,8 @@
# 4-13 [done] task-004 picker final renderer state family 执行清单 v1
> 口径修正(2026-04-28):本文件的 `done` 状态只表示 picker state-family / runtime reducer / hydrated DOM patch 阶段完成;不表示 picker 已脱离 `TreeShellIframeHost` 的 inline JS DOM shell。final DOM shell 收口以 `4-18-tree-final-dom-shell-cutover-hard-gate-v1.md` 为准;该硬门禁现已在同目录 `done/` 收口。
>
> 最终清理更新(2026-05-16):`TreeShellIframeHost` 与 `iframe_srcdoc` 已退出 active source 并移动到 `recycle/`;本文保留为历史 state-family 阶段记录,当前口径以 `4-18` / `4-19` 为准。
## 目标
@@ -1,6 +1,8 @@
# 4-14 [done] task-005 file tree final renderer 能力保留执行清单 v1
> 口径修正(2026-04-28):本文件的 `done` 状态只表示 file tree 的 Rust initial DOM、row contract、selection state family 与能力保留阶段完成;不表示 file tree 已完成 final Rust DOM shell 切换。默认主路径仍依赖 `iframe_srcdoc` 时,不得用本文作为最终完成依据。
>
> 最终清理更新(2026-05-16):`TreeShellIframeHost` 与 `iframe_srcdoc` 已退出 active source 并移动到 `recycle/`;本文保留为历史 state-family 阶段记录,当前口径以 `4-18` / `4-19` 为准。
## 目标
@@ -1,6 +1,8 @@
# 4-15 [done] task-006 compat host thinning 执行清单 v1
> 口径修正(2026-04-28):本文件的 `done` 状态只表示本批可验证范围内的 compat host 收薄完成;不表示 compat host 已退为纯 debug/internal,也不表示 `TreeShellIframeHost` 的 JS DOM/state machine 已从默认真实流量删除。最终退场门禁以 `4-18-tree-final-dom-shell-cutover-hard-gate-v1.md` 为准;该硬门禁现已在同目录 `done/` 收口。
>
> 最终清理更新(2026-05-16):本文以下关于 `TreeShellIframeHost` 仍在 3000 主路径或作为 legacy/debug 暂留的表述均为历史阶段记录;当前 active source 已删除 legacy iframe 入口,旧源码与测试已移动到 `recycle/`。
## 目标
@@ -9,7 +11,7 @@
## 当前边界
- 本任务不声称已经完成完整 Rust runtime / wasm 替换。
- `TreeShellIframeHost` 是 3000 主路径的 same-origin inline host它的职责已收窄为挂载 srcDoc、postMessage transport、状态 patch 与 debug/internal fallback,而不是最终移除
- 历史阶段中 `TreeShellIframeHost` 是 3000 主路径的 same-origin inline host当前已退出 active source,不能再作为当前主路径或 debug/internal fallback。
- 3104 `/tree` 只保留显式 debug/internal 验证边界,`task112` 中 direct tree shell debug 已默认跳过。
## 执行项
@@ -8,7 +8,9 @@
>
> 口径修正(2026-04-28):本文记录的 `harness task-001` 至 `task-009` 完成,只代表 Rust/WASM reducer runtime、artifact、route thinning、projection hardening 等阶段性目标完成;不代表 page tree / file tree / picker 已完成 final Rust DOM shell 切换。真正 final DOM shell 的硬门禁以 `../done/4-18-tree-final-dom-shell-cutover-hard-gate-v1.md` 为准。
>
> 收口更新(2026-04-28):`harness task-010` 至 `task-013` 已完成 final DOM shell 默认路径切换。`rust_family` 默认 host 已改为 `rust_wasm_dom_shell_host`,默认 bridge 为 `dom_wasm``TreeShellIframeHost` 仅在显式 `NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST=1` 下作为 legacy/debug host 进入
> 收口更新(2026-04-28):`harness task-010` 至 `task-013` 已完成 final DOM shell 默认路径切换。`rust_family` 默认 host 已改为 `rust_wasm_dom_shell_host`,默认 bridge 为 `dom_wasm`。
>
> 最终清理更新(2026-05-16):`TreeShellIframeHost` 与对应测试已移动到 `recycle/``NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST` 入口已删除;active source 不再保留 iframe/srcDoc legacy/debug host。
>
> 最终 runtime 剩余项收口(2026-04-28):`harness task-014` 至 `task-018` 已完成。`normalizedMove` fallback 已删除;`page.body.saved` 与 `document.snapshot.saved` 已拆分为双 domain event plan`tree.node.embed` 的 `pageReference` 结构与插入位置已迁入 Rust `pageAggregateEmbedPlan``file_tree` 搜索索引可见性已成为 projection result `meta.search.indexingVisibility`。
@@ -20,7 +22,7 @@
- Phase K 已完成 `rust_tree_shell_runtime_artifact_v1` artifact 边界,以及 page / filetree / picker 的 Rust-side runtime reducer contract。
- Phase K 历史阶段曾固定 3000 inline host 与 `mnote-web /tree` debug shell 都输出同名 runtime artifact;当前默认主路径已继续收口为 `rust_wasm_dom_shell_host``/api/tree/shell -> mnote-web:3104` debug 直连默认关闭。
- Phase K 历史阶段曾把 3000 host implementation 从 `rust_inline_compat_host` 收口为 `rust_runtime_artifact_host`,并在 legacy runtime artifact manifest 中显式标注 `family=rust_family / version=1 / executionStrategy=browser_bridge / browserBridge=iframe_srcdoc`;当前该 host 只代表显式 legacy/debug
- Phase K 历史阶段曾把 3000 host implementation 从 `rust_inline_compat_host` 收口为 `rust_runtime_artifact_host`,并在 legacy runtime artifact manifest 中显式标注 `family=rust_family / version=1 / executionStrategy=browser_bridge / browserBridge=iframe_srcdoc`;当前该 active host 已删除,历史源码只在 `recycle/` 中保留
- Phase K 已新增 Rust `TreeShellRuntimeRequest / TreeShellRuntimeResult` wire-safe facadepage / filetree / picker 三类 request 可 `serde_json` roundtrip,输出统一分为 `TreeShellDomPatch``TreeShellHostEvent``TreeShellCommandEvent`,并已在 runtime artifact manifest 中暴露 request/result contract、state snapshot、patch/event kind。
- Phase K 已新增 `mnote-web POST /api/tree/runtime/reduce`,并新增 3000 同源 `POST /api/tree/runtime/reduce` thin proxy;这是当前 browser bridge 调用 Rust runtime facade 的首个正式 HTTP seam。
- Phase K 已把 3000 `TreeShellIframeHost` 的 filetree selection / normalize visible rows / drag row ids 路径接到 runtime reduce seam,保留本地 reducer fallback,避免 Rust runtime endpoint 不可用时破坏现有真实交互。
@@ -40,7 +42,7 @@
### 后续阶段已收口
- final DOM shell 默认路径已切到 `rust_wasm_dom_shell_host`page / file tree / picker 不再通过 `TreeShellIframeHost``srcDoc` 内联模板承载默认 DOM shell。
- 默认 DOM host 通过 `reduceTreeShellRuntime` WASM artifact 或同源 `/api/tree/runtime/reduce` Rust seam 消费 `state / hostEvents / commandEvents`;旧本地 JS fallback reducer 只保留在 legacy iframe host
- 默认 DOM host 通过 `reduceTreeShellRuntime` WASM artifact 或同源 `/api/tree/runtime/reduce` Rust seam 消费 `state / hostEvents / commandEvents`;旧本地 JS fallback reducer 不再保留 active 入口
- 默认真实流量已禁止 `iframe_srcdoc` 作为 tree DOM shell 成功路径;对应负向门禁与 smoke 已覆盖。
- `normalizedMove` fallback 已删除,无 `treeWriteOperation` 的 move 不再进入主写路径。
- `document.snapshot.saved` 已作为独立 event type 固定;`page.body.saved` payload 只保留 page 与 blockssnapshot 版本/hash/updatedAt 进入独立事件。
@@ -129,13 +131,13 @@
- [x] `build-tree-shell-runtime.js` 生成固定 `mnote-tree-shell-runtime.js``mnote-tree-shell-runtime_bg.wasm`
- [x] 3000 同源 `/api/tree-shell-runtime/manifest.json``/api/tree-shell-runtime/mnote-tree-shell-runtime.js``/api/tree-shell-runtime/mnote-tree-shell-runtime_bg.wasm` 已覆盖。
- [x] `TreeShellIframeHost` 已通过 `loadTreeShellWasmRuntime / reduceTreeShellRuntimeViaWasm / reduceTreeShellRuntimeWithArtifact` 默认优先使用 wasm artifact。
- [x] 3000 默认 host 不再维护主路径 JS adapter 状态机;`TreeShellIframeHost` 内联模板 browser bridge JS DOM shell 已降级为显式 legacy/debug
- [x] 3000 默认 host 不再维护主路径 JS adapter 状态机;`TreeShellIframeHost` 内联模板 browser bridge JS DOM shell 已移入 `recycle/`
- [x] `mnote-web /tree` debug shell 只保留 debug/internal runtime 验证入口。
### 验收
- [x] `pnpm vitest run src/components/sidebar/tree-shell-iframe-host.test.tsx src/components/sidebar/tree-shell-surface.test.tsx`
- [x] `pnpm vitest run src/app/api/tree/runtime/reduce/route.test.ts src/app/api/tree/shell/route.test.ts src/components/sidebar/tree-shell-iframe-host.test.tsx src/components/sidebar/tree-shell-surface.test.tsx src/components/documents/move-embed-picker-dialog.test.tsx`
- [x] 历史验收曾覆盖 `tree-shell-iframe-host.test.tsx`2026-05-16 后该测试已随旧 host 移入 `recycle/`active 验收改为 `tree-shell-host.test.tsx` / `tree-shell-surface.test.tsx` 的负向门禁。
- [x] `pnpm vitest run src/app/api/tree/runtime/reduce/route.test.ts src/app/api/tree/shell/route.test.ts src/components/sidebar/tree-shell-host.test.tsx src/components/sidebar/tree-shell-surface.test.tsx src/components/documents/move-embed-picker-dialog.test.tsx`
- [x] `pnpm vitest run src/components/documents/move-embed-picker-dialog.test.tsx`
- [x] `cargo test -p mnote-web page_renderer filetree_renderer picker_renderer`
- [x] `cargo test -p mnote-web tree_runtime_reduce_endpoint_returns_filetree_runtime_result`
@@ -144,7 +146,7 @@
- [x] `cargo test -p mnote-web tree_shell_renderer_input_exposes_runtime_artifact_boundary`
- [x] `cargo test -p tree-shell-runtime-wasm -- --nocapture`
- [x] `node scripts/build-tree-shell-runtime.js`
- [x] `pnpm vitest run src/app/api/tree-shell-runtime/[...asset]/route.test.ts src/components/sidebar/tree-shell-iframe-host.test.tsx`
- [x] `pnpm vitest run src/app/api/tree-shell-runtime/[...asset]/route.test.ts src/components/sidebar/tree-shell-host.test.tsx`
- [x] Node smoke:加载 `generated/mnote-tree-shell-runtime.js` + `.wasm` 后调用 `reduceTreeShellRuntime(mode=page, action=moveNext)`,返回 `focusedId=doc:child`
- [x] `node scripts/task112-tree-rust-family-regression-smoke.js`
- [x] `node scripts/task113-picker-keyboard-regression-smoke.js`
@@ -4,6 +4,8 @@
>
> 目的:纠正此前把 `Rust/WASM reducer runtime` 误当成 `final Rust renderer` 的完成口径,重新定义 page tree / file tree / picker 真正收口所需的不可绕过门禁。
>
> 收口更新(2026-05-16):旧 `TreeShellIframeHost` 与对应测试已退出 active source,并移动到 `recycle/``NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST` 回退入口已删除。当前口径不再保留 iframe/srcDoc legacy/debug host,默认与唯一活跃 host 是 `rust_wasm_dom_shell_host + dom_wasm`。
>
> 前置文档:
> - `/mnt/Data1T/mnote/design/04-tree-domain/done/4-11-tree-rust-family-final-renderer-and-host-thinning-checklist-v1.md`
> - `/mnt/Data1T/mnote/design/04-tree-domain/process/4-16-tree-rust-family-remaining-final-runtime-checklist-v1.md`
@@ -16,11 +18,11 @@
本轮 `task-010``task-013` 已按本文硬门禁完成默认主路径切换:
- `TreeShellHost``rust_family + workspaceId` 下默认选择 `rust_wasm_dom_shell_host`
- `TreeShellIframeHost` 仅在显式 `NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST=1` 时进入,继续作为 legacy/debug 排障 host。
- 历史 `TreeShellIframeHost` 不再保留 active 入口;相关源码与测试已进入 `recycle/`,不再作为可开启的 legacy/debug 排障 host。
- 默认 page tree / file tree / picker 主路径标注 `data-tree-browser-bridge="dom_wasm"`,负向测试禁止 `iframe_srcdoc` 被当成默认成功路径。
- 默认 DOM host 不再调用 `LOCAL_TREE_SHELL_TEMPLATE``buildInlinePageTreeHtml``buildInlineFileTreeHtml``buildInlinePickerHtml`
- 默认 DOM host 的展开、选择、高亮、打开、右键、拖放、picker pick 由 `reduceTreeShellRuntime` WASM artifact 或同源 `/api/tree/runtime/reduce` Rust seam 返回的 `state / hostEvents / commandEvents` 驱动;本地 JS fallback reducer 只保留在 legacy iframe host 内
- `task112-tree-rust-family-regression-smoke.js``task113-picker-keyboard-regression-smoke.js` 已支持并验证默认 DOM hostlegacy iframe 仅兼容显式 legacy 路径。
- 默认 DOM host 的展开、选择、高亮、打开、右键、拖放、picker pick 由 `reduceTreeShellRuntime` WASM artifact 或同源 `/api/tree/runtime/reduce` Rust seam 返回的 `state / hostEvents / commandEvents` 驱动;不再保留 iframe/srcDoc JS fallback reducer 作为可用路径
- `task112-tree-rust-family-regression-smoke.js``task113-picker-keyboard-regression-smoke.js` 已支持并验证默认 DOM host后续不再验收 legacy iframe 路径。
`task-010` 之前,过去几轮已经完成的是:
@@ -48,7 +50,7 @@
- 3000 默认真实流量的 page tree / file tree / picker 不再通过 `TreeShellIframeHost``srcDoc` 内联模板承载 DOM shell。
- 默认主路径不再标注 `data-tree-browser-bridge="iframe_srcdoc"`
- `LOCAL_TREE_SHELL_TEMPLATE``buildInlinePageTreeHtml``buildInlineFileTreeHtml``buildInlinePickerHtml` 不再参与默认 page / filetree / picker 渲染路径。
- `TreeShellIframeHost` 只能作为显式 legacy/debug host 存在,必须由明确 debug flag 或 debug route 进入
- `TreeShellIframeHost` 不得继续存在于 active source;历史源码只能位于 `recycle/` 且被 gitignore 排除
- Rust/WASM 或等价 Rust family renderer 持有初始渲染、动态 DOM patch、事件绑定归一化、展开/选择/高亮/拖放反馈的运行时 DOM shell。
- 3000 host 只保留挂载、认证、transport、文件字节读取、postMessage / command bridge、artifact 资源发布等浏览器能力边界。
- page / filetree / picker 的主路径回归测试必须包含负向断言:默认路径不得出现 `iframe_srcdoc` DOM renderer。
@@ -60,7 +62,7 @@
### 前端门禁
- `tree-shell-iframe-host.test.tsx` 或新测试必须断言默认主路径不再输出:
- `tree-shell-host.test.tsx`、surface 测试或新测试必须断言默认主路径不再输出:
- `srcDoc={renderedInlineSrcDoc}`
- `data-tree-browser-bridge="iframe_srcdoc"`
- `LOCAL_TREE_SHELL_TEMPLATE`
@@ -68,7 +70,7 @@
- `buildInlinePageTreeHtml`
- `buildInlineFileTreeHtml`
- `buildInlinePickerHtml`
- 允许这些字符串只出现在显式 `legacy/debug` 测试或旧 host 文件中,但不能在默认 host implementation 测试作为成功条件。
- 允许这些字符串只出现在 `recycle/` 下的历史文件中;active source 与默认 host implementation 测试不能再把它们作为成功条件。
### smoke 门禁
@@ -87,19 +89,19 @@
状态:已完成。
目标:把旧 `TreeShellIframeHost`“默认主路径”降级为“legacy/debug 候选
目标:把旧 `TreeShellIframeHost` active source 中移出,彻底关闭 legacy/debug 候选入口
执行项:
- 新增主路径 host 名称,例如 `rust_dom_shell_host``rust_wasm_dom_shell_host`
- 保留`TreeShellIframeHost`,但改名或包裹为 `LegacyTreeShellIframeHost`,只允许 debug/legacy flag 入。
-`TreeShellIframeHost` 与测试移动到 `recycle/`,不再提供 debug/legacy flag 入
- `TreeShellHost` 默认选择新 host;旧 host 不再作为 `rust_family` 默认实现。
- 所有旧 `srcDoc` 合同测试迁到 legacy/debug 测试组。
验收:
- 默认 `TreeShellHost` 测试不再匹配 `iframe_srcdoc`
- legacy/debug 测试仍能证明旧 host 可用于回退排障。
- active 测试不再证明旧 host 可用于回退排障,只保留默认 DOM/WASM host 的负向门禁
### Phase Q:建立 Rust/WASM DOM shell host
@@ -122,21 +124,21 @@
### Phase R:删除默认路径 JS renderer 状态机
状态:已完成默认路径隔离;旧 JS renderer/state machine 仅保留在 legacy iframe host
状态:已完成默认路径隔离;旧 JS renderer/state machine 已从 active source 移到 `recycle/`
目标:移除默认主路径对旧 JS DOM renderer/state machine 的依赖。
执行项:
- 默认路径删除对 `renderTree()``renderFileTree()``hydrateInitialPageTree()``hydrateInitialPickerTree()` 等旧 DOM shell 的调用。
- 旧本地 fallback reducer 只保留在 legacy/debug host,不参与默认真实流量
- 旧本地 fallback reducer 不再保留 active 入口
- 删除或隔离 `buildInlinePageTreeHtml` / `buildInlineFileTreeHtml` / `buildInlinePickerHtml` 的默认路径调用。
验收:
- 默认 host implementation 中没有 `srcDoc` 主渲染链。
- 默认主路径没有第二套 JS 展开、选择、高亮、拖放接受规则。
- `TreeShellIframeHost` 可被删除,或只以 `LegacyTreeShellIframeHost` 形式留在 debug 目录
- `TreeShellIframeHost` 已移动到 `recycle/`,不能再作为 debug 目录或 active 回退入口
### Phase S:最终文档收口
@@ -167,6 +169,6 @@
本文定义的 final DOM shell 硬门禁已收口。后续继续推进时,不应再回到 `iframe_srcdoc` 默认路径,而应沿以下方向继续减少过渡面:
1. 保留 `NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST=1` 作为短期排障开关,后续在 smoke 与线上观测稳定后删除旧 host
2. 继续把剩余 tree command、Page Aggregate、snapshot 独立事件等非 DOM shell 收口项按各自设计稿推进
3.新增 page / filetree / picker 交互,默认必须接入 `TreeShellRuntimeRequest/Result`,不得在 DOM host 增加第二套 JS reducer
1. 继续把剩余 tree command、Page Aggregate、snapshot 独立事件等非 DOM shell 收口项按各自设计稿推进
2. 若新增 page / filetree / picker 交互,默认必须接入 `TreeShellRuntimeRequest/Result`,不得在 DOM host 增加第二套 JS reducer
3.需要排障,只能在 Rust DOM/WASM host 或 Rust Web debug route 上加临时观测,不得恢复 iframe/srcDoc host
@@ -3,29 +3,31 @@
> 更新时间:2026-04-28
>
> 本文由 `process/1.md` 归档而来,用于记录 `design/04-tree-domain` 当前代码已完成的最终树域收口状态。
>
> 收口更新(2026-05-16):旧 `TreeShellIframeHost` 与对应测试已移动到 `recycle/``NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST` 入口已删除。当前 active source 不再保留 iframe/srcDoc legacy/debug host。
## 执行状态(2026-04-28
- [x] 口径收口:`task-001``task-009` 完成的是 Rust/WASM reducer runtime、runtime artifact、route thinning 与 projection hardening`task-010``task-013` 才是 `4-18-tree-final-dom-shell-cutover-hard-gate-v1.md` 定义的 final DOM shell 默认路径切换。
- [x] 默认 host 已从历史 `rust_runtime_artifact_host + iframe_srcdoc` 切到 `rust_wasm_dom_shell_host + dom_wasm``rust_runtime_artifact_host``data-tree-browser-bridge="iframe_srcdoc"` 只允许出现在显式 legacy/debug host
- [x] `TreeShellHost``rust_family + workspaceId` 下默认挂载 `TreeShellRustDomShellHost`;旧 `TreeShellIframeHost` 只能通过 `NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST=1` 进入
- [x] 默认 host 已从历史 `rust_runtime_artifact_host + iframe_srcdoc` 切到 `rust_wasm_dom_shell_host + dom_wasm``rust_runtime_artifact_host` active `data-tree-browser-bridge="iframe_srcdoc"` 已退出 active source
- [x] `TreeShellHost``rust_family + workspaceId` 下默认且唯一挂载 `TreeShellRustDomShellHost`;旧 `TreeShellIframeHost` 已移动到 `recycle/`
- [x] 默认 DOM host 不再调用 `LOCAL_TREE_SHELL_TEMPLATE``buildInlinePageTreeHtml``buildInlineFileTreeHtml``buildInlinePickerHtml`,也不再把 `srcDoc` inline DOM shell 当作成功路径。
- [x] 默认 page / filetree / picker DOM host 标注 `data-tree-runtime-artifact-host="rust_tree_shell_runtime_artifact_v1"``data-tree-browser-bridge="dom_wasm"`
- [x] 默认 DOM host 的 page focus / keyboard / expand / collapse / open / context / create / rename / dropfiletree selection / open / context / internal drop / external drop / drop target,以及 picker keyboard / focus / pick,均通过 `TreeShellRuntimeRequest/Result` 消费 WASM artifact 或同源 Rust HTTP seam 返回的 state、hostEvents、commandEvents。
- [x] 旧 JS DOM renderer、inline template、fallback reducer/state machine 已从默认真实流量隔离,只保留在显式 legacy iframe host 内作为短期排障面。
- [x] 旧 JS DOM renderer、inline template、fallback reducer/state machine 已从 active source 移到 `recycle/`,不再作为短期排障面。
- [x] 默认主路径负向测试已覆盖:`tree-shell-host.test.tsx``tree-shell-surface.test.tsx``move-embed-picker-dialog.test.tsx` 均断言默认路径不得出现 `iframe_srcdoc` / `rust-iframe`
- [x] `task112-tree-rust-family-regression-smoke.js``task113-picker-keyboard-regression-smoke.js` 默认验证 `dom_wasm` DOM hostlegacy iframe 仅在显式 legacy flag 下兼容
- [x] `task112-tree-rust-family-regression-smoke.js``task113-picker-keyboard-regression-smoke.js` 默认验证 `dom_wasm` DOM hostlegacy iframe 不再作为兼容验收路径
## 历史 runtime 阶段保留记录
- Rust/WASM reducer runtime artifact 已落地:`rust/crates/tree-shell-runtime-wasm` 通过 wasm-bindgen 导出 `reduceTreeShellRuntime`3000 同源 `/api/tree-shell-runtime/*` 发布 `mnote-tree-shell-runtime.js``mnote-tree-shell-runtime_bg.wasm`
- `mnote-web` 与 3000 同源均保留 `POST /api/tree/runtime/reduce` seam;默认 DOM host 优先调用 WASM artifactHTTP seam 作为同源 Rust fallback/debug。
- 历史 `TreeShellIframeHost` 已完成过 page/filetree/picker reducer result 回放、hostEvent/commandEvent 回放、page drop target runtime 收口、picker runtime-first、filetree drop hardening 等切片;这些能力现在作为 legacy/debug host 的保留行为,不再代表默认 DOM shell
- 历史 `TreeShellIframeHost` 已完成过 page/filetree/picker reducer result 回放、hostEvent/commandEvent 回放、page drop target runtime 收口、picker runtime-first、filetree drop hardening 等切片;这些能力只作为历史记录保留,不再对应 active legacy/debug host
## 当前保留边界
- `normalizedMove` compat fallback 已删除;无 `treeWriteOperation` 的 move 不再进入主写路径。
- `document.snapshot.saved` 已作为独立 event type 固定;`page.body.saved` 不再携带 snapshot payload。
- `tree.node.embed``pageReference` block 结构与插入位置已迁入 Rust `pageAggregateEmbedPlan`3000 route 只负责读取源/目标 substrate 快照并作为 preflight 传入。
- `TreeShellIframeHost` 仍作为显式 legacy/debug host 暂留;默认路径稳定后可继续删除 legacy iframe host 与对应旧测试
- `TreeShellIframeHost` 与对应旧测试已移入 `recycle/`active source 不再保留 legacy iframe host。
- 3000 仍保留挂载、认证、transport、文件字节读取、浏览器 DnD `File[]`、菜单状态、实际命令调度、乐观 UI 与副作用通知等浏览器能力边界;这是浏览器公开入口职责,不再代表树域主语义滞留在 Next route。
@@ -364,7 +364,7 @@
**验收记录:**
- local 外部 drop`scripts/task163-local-folder-unified-tree-browser-smoke.js` 使用真实 Chromium `DataTransfer/File`,覆盖取消 preflight 不写入、确认后复制进目录、drop 到 `.md` 时写入父目录、readonly 目标拒绝且不发 execute。
- Convex 外部 drop:同一 smoke 通过 iframe 宿主监听 `tree.filetree.external-drop`,覆盖 Convex document 与 asset-folder 两类目标;宿主侧继续由 `tree-shell-iframe-host.tsx -> Sidebar.handleResourcePaneDropFiles -> uploadFileTreeResourceAsset -> /api/media/upload` 上传对象存储。
- Convex 外部 drop:同一 smoke 通过 Rust DOM host 监听 `tree.filetree.external-drop`,覆盖 Convex document 与 asset-folder 两类目标;宿主侧继续由 `tree-shell-dom-host.tsx -> Sidebar.handleResourcePaneDropFiles -> uploadFileTreeResourceAsset -> /api/media/upload` 上传对象存储。历史 `tree-shell-iframe-host.tsx` 已于 2026-05-16 移入 `recycle/`,不再作为 active 路径。
- 对象存储链路:`resource-command-client.test.ts` 覆盖 `uploadFileTreeResourceAsset``app/api/media/upload/route.test.ts` 覆盖 `tree.resource.upload` plan、Convex upload URL、`mediaAssets:createWithStorage` 与资源 delta artifact。
- indicator:同一 smoke 覆盖本地目录 before/inside/after、hover auto expand,以及 Convex document before/inside/after 与 asset-folder inside。