chore: land tree view-state, vault, Pi module split, and repo hygiene

Persist PageTree expand state via control-plane view-state and align
chevron/DOM with restored expansion; keep Sidex-style shallow page-tree
scan and drop the unused recursive scanner that only added cargo noise.

Add password vault workbench routes/runtime/skill/CLI, split page_ai_pi
into a module package, and retire Hermes/ACP/OpenHub recycle + root
harness evidence from the index while gitignoring recycle and local
diag dumps.

Archive superseded design/bugs docs under old/, point architecture at
ARCHITECTURE.md, and refresh smokes for Pi S1–S7, vault, and editor
regressions so the working tree can stay clean.
This commit is contained in:
Agent Board
2026-07-21 05:13:05 +08:00
parent 6f9c7d3b58
commit b798f628ee
264 changed files with 17480 additions and 17314 deletions
+71 -57
View File
@@ -1,12 +1,12 @@
node_modules/ node_modules/
**/node_modules/ **/node_modules/
.next/ .next/
**/.next/ **/.next/
dist/ dist/
**/dist/ **/dist/
build/ build/
**/build/ **/build/
.turbo/ .turbo/
pnpm-debug.log* pnpm-debug.log*
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
@@ -30,50 +30,58 @@ env-archive/
/.pi/ /.pi/
/tmp-block-handle-qa.js /tmp-block-handle-qa.js
# Retired root-level agent/harness/browser evidence artifacts.
/REASONIX.md
/reasonix.toml
/playwright-snapshot-auth.md
/auth-console.txt
/auth-network.txt
/harness-init.sh
*.local *.local
tmp/ tmp/
temp/ temp/
**/.venv/ **/.venv/
.venv/ .venv/
**/__pycache__/ **/__pycache__/
__pycache__/ __pycache__/
# Convex 本机开发临时目录 # Convex 本机开发临时目录
**/.convex-tmp/ **/.convex-tmp/
# 大模型文件,防止超出 LFS 配额 # 大模型文件,防止超出 LFS 配额
services/mineru/models/ services/mineru/models/
*.safetensors *.safetensors
# ONLYOFFICE 挂载/同步目录(体积很大,禁止入库) # ONLYOFFICE 挂载/同步目录(体积很大,禁止入库)
/onlyoffice-web-apps/ /onlyoffice-web-apps/
/onlyoffice-plugins/ /onlyoffice-plugins/
/onlyoffice-data/ /onlyoffice-data/
/onlyoffice-fonts/ /onlyoffice-fonts/
/onlyoffice-pg-data/ /onlyoffice-pg-data/
# ONLYOFFICE 现已移至 src/components/onlyoffice 下,整目录忽略 # ONLYOFFICE 现已移至 src/components/onlyoffice 下,整目录忽略
/src/components/onlyoffice/ /src/components/onlyoffice/
# 参考资料目录 # 参考资料目录
cankao/ cankao/
# services 整体忽略(包含本地模型与临时服务) # services 整体忽略(包含本地模型与临时服务)
/services/ /services/
**/test/ **/test/
pw-tests/** pw-tests/**
pw-tests/ pw-tests/
wolai-frontend/public/documents/ wolai-frontend/public/documents/
wolai-frontend/public/documents/** wolai-frontend/public/documents/**
artifacts/ artifacts/
artifacts/** artifacts/**
tmp tmp
# Rust 本地构建与调试产物 # Rust 本地构建与调试产物
/rust/target/ /rust/target/
/rust/spikes/**/target/ /rust/spikes/**/target/
# Harness 本地运行状态/调试产物 # Harness 本地运行状态/调试产物
/.harness-active /.harness-active
/.harness-stop-counter /.harness-stop-counter
/harness-tasks.json.bak /harness-tasks.json.bak
# pnpm 本地缓存 # pnpm 本地缓存
/.pnpm-store/ /.pnpm-store/
.playwright-mcp .playwright-mcp
rust/spikes/leptos-tiptap-spike/trunk-8123.err rust/spikes/leptos-tiptap-spike/trunk-8123.err
rust/spikes/leptos-tiptap-spike/trunk-8123.out rust/spikes/leptos-tiptap-spike/trunk-8123.out
@@ -85,16 +93,22 @@ design/05-editor-mainline/reference-code
/ai-sessions/ /ai-sessions/
/filetree-*.png /filetree-*.png
/task*-*.png /task*-*.png
/qa-*.png
# 本地 Wolai 对标取证与截图产物 # 本地 Wolai 对标取证与截图产物
/test-results/ /test-results/
/wolai-*.png /wolai-*.png
/wolai-*.md /wolai-*.md
# 任务型浏览器 smoke 只作本地验收,不纳入项目运行面 # 任务型浏览器 smoke 只作本地验收,不纳入项目运行面
/scripts/task*-wolai-*.js /scripts/task*-wolai-*.js
/scripts/task*-rust-web-wolai-*-smoke.js /scripts/task*-rust-web-wolai-*-smoke.js
# 下载的 Wolai 静态页面参考包,不作为可维护设计稿入库 # 本地一次性诊断脚本与截图取证(不入库
design/design/html/ /scripts/_diag-*.js
/scripts/*-diag/
/scripts/page-tree-expand-diag/
# 下载的 Wolai 静态页面参考包,不作为可维护设计稿入库
design/design/html/
recycle recycle
+86 -155
View File
@@ -2,195 +2,126 @@
## 当前主线 ## 当前主线
- 当前长期方向以 `tree-first graph kernel` 为准,不以 `BlockNote-first``Mindmap-first` 为准 - 方向:`tree-first graph kernel` + local-first MVP 后阶段(底座统一、compat 瘦身、产品化闭环)
- 当前已经进入 local-first MVP 后阶段:最小可用闭环已建立,后续重点是底座统一、compat 瘦身和产品化闭环,不再把新增能力建立在旧 Convex / Next / BlockNote 主链上 - 产品形态:`VSCode 简化版工作区 + leptos-tiptap Markdown + Pi Rust Page AI + LightRAG + mindmap/office 插件 + Wolai 主题壳 + Turso/libSQL 控制面`
- 当前产品形态固定为:`VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + OpenHub + LightRAG AI + simplemindmap/office 插件 + Wolai 主题 Web 壳 + 鉴权控制面` - 数据真相:本地 workspace folder;页面正文为 `.md`。控制面:Turso/libSQLauth / membership / share / sync / AI policy / Pi scope
- 本地文件夹是早期产品默认数据真相;本地 `.md` 是页面正文真相。Turso/libSQL `control-plane` 是默认 auth、membership、share grants、sync state、AI policy、OpenHub scope / AI policy 控制面;`Convex` / 服务端只保留为历史迁移源、显式 cloud source、compat 和 sync replica 边界,不再作为新增能力的默认正文、附件、AI 会话全文主存储或默认控制面。旧 ACP/Hermes runtime session 只保留为 legacy/debug/兼容边界 - Page AIPi Lab 为 3000 默认且唯一产品级入口。ACP/Hermes/Reasonix、OpenHub、旧 `/api/hermes/*` 等为兼容/legacy,不得新增能力;退役须原子覆盖
- `Rust kernel` 持有树、子树、边、projection、query、command 语义主导权;新增树规则不要继续散落到前端、Next route 或临时 compat 层 - Web`mnote-web` 为 3000 唯一公开入口。kernel 持有树/边/projection/command 语义;前端只消费稳定 projection
- `mnote-web` 是当前 Rust Web 承载层,负责 transport、projection 分发、兼容切流;`compat``fixture` 只用于过渡和测试,不应继续承载长期业务语义。`3000` 是唯一前端公开入口;`3104` 已退役为仅显式 debug/internal 使用的边界。`/tree``/document-debug` 等 debug 壳默认关闭,仅在显式 debug/runtime 验证时启用 - 正文保存:`page.body.write` + 文件版本;AI 普通 Markdown:授权文件 + allowed roots + Pi patch/diff + watcher。知识库:LightRAG + `mnote.knowledge_rag.*`
- 前端 runtime 已完成第一轮模块级拆分:`layout.rs` / `tree.rs` / `web_shell.rs` 不再是大型内嵌 JS 的主要定位入口。查 Sidebar、FileTree、tree shell、document adapter 等浏览器功能时,默认先看 `rust/crates/mnote-web/browser/*.js`;查 tiptap island 行为时,默认先看 `rust/spikes/leptos-tiptap-spike/src/editor_runtime/*.rs`,再回到根 `lib.rs` / Rust route - 架构正文:只读 `ARCHITECTURE.md``CURRENT_ARCHITECTURE.md` 为兼容指针)。执行稿:`design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`
- 前端主路径应消费稳定 projection,不应在 UI 层重新拼出第二份对象真相。
- Next `documents/page` 读取主链已优先消费 Rust `mnote.page_aggregate.v1` 快照;TS `page-aggregate-builder` 仅保留为历史 adapter / test helper,不再作为 runtime fallback,也不再把“前端手工拼 `meta + content`”描述为当前主路径。
- `3000` 当前主壳已接入 Rust Web WebSocket push 主链(`/api/realtime/ws`+ SSE fallback`/api/tree/events`)的 snapshot / delta / resync consumer,并已有 browser smoke 验证(2026-05-17 WS 迁移 `57ec8322`);后续收口重点是统一 live cache 与减少补偿链,而不是把它描述成“还没接 live stream”。
- 文档页默认主编辑器已切到页面内 `leptos-tiptap` island`BlockNote` 已退出文档页默认主路径,只保留为历史参考实现 / 对照材料。
- Page Aggregate 当前已输出 `blockDocument / blockProjectionVersion / projectionSource``projectionSource=documents.content`),标题/正文/页面设置写入后 smoke 已通过(`task110``task-page-aggregate-body-sync-smoke``task-page-aggregate-options-sync-smoke`);页面/块 AI 旧 Hermes tools 读取和写入块投影只作为兼容证据,不再代表当前 Page AI 主路径;但这仍是从 `documents.content` / local markdown content 投影出来的过渡态,不是 EditorBlockDocument 原生落库完成态。客户端 `PageAggregateClientState` reducer 仍在,页面域单一真源未完全闭环。
- 当前最优先的架构收口不是继续扩编辑器 UI,而是在 local-first MVP 基线上推进 `WorkspacePath/ObjectIdentity` runtime 消费统一、`DocumentBuffer/BufferStore``Page Aggregate` 单一真源收口、`tree command cutover` 收尾、`tree realtime event stream` live cache 统一(WS push 主链 2026-05-17 上线,SSE 降级为 fallback)和 OpenHub + LightRAG 深度融合、agent diff / 冲突合并 / 本地轻量搜索 / 分享同步产品化。AI 侧普通 Markdown 编辑主路径已收口为“当前文件引用 + selection + allowed roots + OpenHub/native agent patch/diff + watcher 同步”;知识库问答、资料 OCR / parse / index / RAG 主路径为 LightRAG + OpenHub tool facadeWeKnora 仅保留为历史设计、参考实现或备用 provider 边界;`mnote.doc.fetch``mnote.doc.markdown_edit``mnote.doc.apply_block_ops``mnote.block.*` 只作为 cloud / remote agent / compat fallback 或复杂结构辅助;`review session`/流式 apply 属于 Phase C(设计冻结,当前不实施),不扩新 AI 功能,不把粗粒度 `mnote.page.save` 当成精确块编辑主入口。
## 组件定位 ## 组件定位
- `leptos-tiptap` island 是当前文档页默认主编辑区 runtime,但不是系统事实源。 | 组件 | 定位 |
- `BlockNote` 是历史参考实现 / 对照材料,不再是运行时系统组件、默认回退编辑器或系统事实源。 |------|------|
- `Mindmap``tree-first graph` 的一种视图和编辑挂件,不是对象真相层。 | `leptos-tiptap` island | 文档页默认编辑 runtime;非对象真源 |
- `OnlyOffice` 是独立页面型编辑器,不直接嵌入 `BlockNote` 画布;正文中通常通过附件块跳转进入。 | Mindmap | tree-first 视图/挂件;非真相层 |
- `page-ai/block-edit-workflow` route 只保留为兼容门面或非 local source 的快捷路径,不作为 local-first 普通 Markdown 编辑默认主路径;local-first 下优先给 OpenHub/native agent 授权文件引用并让 agent 使用自身文件编辑能力。`mnote.doc.markdown_edit` 是 cloud / remote agent / compat fallback`mnote.block.*` 保留为结构性辅助。 | OnlyOffice | 独立页面编辑器;经附件/资源进入 |
- `LightRAG + OpenHub` 是当前默认知识库与 Page AI 融合方向,负责资料库问答、检索、引用和 MNote 宿主集成;MNote 维护 source registry、allowed roots / 权限、FileTree 灯号、资料库设置 UI、status UI、citation/open-reference 映射和 agent tool facade。WeKnora 仅保留为历史设计、参考实现或备用 provider 边界;LiteParse、旧 OCR sidecar、旧 evidence search / local-index agent tools 已退役到 legacy / recycle 边界,不再作为新增主路径。 | LightRAG + Pi | 知识库与 Page AI 默认融合 |
- 树域三层模型:`Resource Tree`kernel 对象组织真源)→ `File Tree`(主组织投影,`{title}.md` 为页面正文行)→ `Page Tree`(导航投影,不持有结构真相)。涉及资源归属优先走 Rust kernel 的 `KernelObjectIdentity` / `KernelProjectionResourceKind` | Resource → File → Page Tree | 对象真源 → 主组织投影 → 导航投影 |
## Runtime 模块定位 ## Runtime 模块定位
- `mnote-web` 浏览器 runtime 的当前 canonical 入口是 `rust/crates/mnote-web/browser/` - Browser`rust/crates/mnote-web/browser/`
- Sidebar 装配`sidebar-tree-runtime.js`,已拆出 workspacepage treefiletree command/open/upload、attachment open、page settings、live apply 等模块 - Sidebar`sidebar-tree-runtime.js`(及 workspace / page tree / filetree / upload模块
- FileTree 通用能力`filetree-runtime.js``filetree-selection-runtime.js``filetree-context-menu-runtime.js``filetree-dnd-runtime.js``filetree-keyboard-runtime.js` - FileTree`filetree-runtime.js``filetree-selection-runtime.js``filetree-context-menu-runtime.js``filetree-dnd-runtime.js``filetree-keyboard-runtime.js`
- Page AI sidebar host`sidebar-page-ai-runtime.js`owner 属于 `07-ai`,不归 `03-rust-web` tree/filetree runtime。 - Page AI host`sidebar-page-ai-runtime.js`owner `07-ai`
- 文档 host adapter`document-editor-adapter-runtime.js`,已拆出 pane、resource tab、mindmap host、slash positioning、Tiptap conversion、session 等模块。 - 文档 host`document-editor-adapter-runtime.js`
- debug/internal tree shell`tree-shell-runtime.js`,已拆出 page、filetree、picker、DOM、render、icons、state 等模块。 - debug tree shell`tree-shell-runtime.js`(默认关闭)
- `leptos-tiptap` island 的当前 canonical 入口是 `rust/spikes/leptos-tiptap-spike/src/editor_runtime/`;新增编辑器行为不得继续直接堆入 `lib.rs`,除非它确实是 wasm-bindgen entrypoint、Leptos 壳层信号编排或仍未形成稳定模块边界。 - Island`rust/spikes/leptos-tiptap-spike/src/editor_runtime/`(勿把新行为继续堆进根 `lib.rs`,除非 wasm entry / 薄壳)
- CodeGraph 查 JS 功能时应能直接定位这些 `.js` 文件中的顶层函数;若结果仍落到 Rust raw string 或大型旧壳,先检查是否查错历史 / recycle 路径或索引未同步。 - SSR 注入:`layout.rs` / `tree.rs` / `web_shell.rs` — 非大型 JS 功能定位入口
## 目录优先级 ## 目录优先级
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/` | 路径 | 用途 |
wolai-frontendNext.js React 前端)已退役移入 recycle,不作为当前实现依据。页面、编辑器、Sidebar、树视图、阅读态、交互壳默认先看 Rust mnote-web SSR`rust/crates/mnote-web/src/`)。 |------|------|
- `/mnt/Data1T/mnote/recycle/wolai-frontend/convex/` | `rust/crates/core-protocol/` | Kernel 类型、projection 协议 |
已随 wolai-frontend 移入 recycle,不允许作为当前 Convex deploy fallback。 | `rust/crates/bridge-runtime/` | query / command / traversal |
- `/mnt/Data1T/mnote/recycle/20260522-convex-runtime-retirement/convex/` | `rust/crates/mnote-web/` | 3000 route、transport、projection、compat |
`convex/` functions 源码已软删除到这里,只作为历史审计 / 迁移对照素材;不再作为 active deploy source。默认控制面已由 Turso/libSQL `control-plane` 承接。 | `rust/crates/mnote-web/browser/` | 浏览器 runtime JS |
- `/mnt/Data1T/mnote/rust/crates/core-protocol/` | `rust/spikes/leptos-tiptap-spike/` | 文档页编辑 island |
Kernel 类型、projection 协议、树/图核心术语先看这里。 | `wolai-backend/app/` | 辅助后端 / 异步 |
- `/mnt/Data1T/mnote/rust/crates/bridge-runtime/` | `src/components/onlyoffice/` | OnlyOffice 静态与插件 |
Kernel query / command / subtree / graph traversal 入口先看这里。 | `recycle/` | 历史回收;默认不作为实现依据 |
- `/mnt/Data1T/mnote/rust/crates/mnote-web/`
Rust Web route、transport、compat、tree shell、projection 分发先看这里。
- `/mnt/Data1T/mnote/wolai-backend/app/`
辅助后端、异步处理、接口配合先看这里。
- `/mnt/Data1T/mnote/recycle/20260522-convex-runtime-retirement/infra/convex/`
Convex 自托管服务基础设施已软删除到回收区;只作为显式 cloud source / compat / sync replica 或历史数据导出的历史对照,不再被 `desktop:hot` / `dev:hot` 默认启动链路要求。
- `/mnt/Data1T/mnote/src/components/onlyoffice/`
只在处理 OnlyOffice 静态资源、插件或兼容问题时进入。
- `/mnt/Data1T/mnote/recycle/`
默认视为历史回收区,不作为当前实现依据,除非任务明确要求。
## 架构约束 ## 架构约束
- 涉及树、页面结构、文件树、Sidebar、阅读投影、搜索投影、引用边语义时,优先判断是否应落到 Rust kernel而不是直接改前端拼装逻辑 - 树 / 页面结构 / 引用边:优先落 Rust kernel禁止 UI 拼第二套真相
- 前端可以做展示、交互和局部适配,但不要新增第二套树真相、排序真相或 projection 契约 - `compat route` 只承接过渡流量,不堆长期业务
- `mnote-web``compat route` 可以承接过渡流量,但不要把新的长期业务逻辑继续堆进 compat - 浏览器主链禁止新增 `setInterval` / 周期轮询刷新(树、文档、附件、AI 面板等);用 WS/SSE、watcher、command result、`MutationObserver`。legacy/debug 若保留轮询须写明原因与退出条件
- 浏览器主链默认禁止新增基于 `setInterval`、周期 `setTimeout` 或轮询 fallback 的数据刷新、状态同步和资源存在性检查,尤其是页面树、文件树、文档页、附件、AI 面板等高频可见路径。优先使用 Rust realtime event stream、WebSocket/SSE、watcher、`tree:delta/resync``page-aggregate-synced``MutationObserver` 和显式 command result 驱动刷新;只有在明确标注的 legacy/debug/internal 边界下,才允许短期保留轮询,并且必须在设计/bug 说明里记录原因、退出条件和内存/CPU 风险 - 标题 / 页面设置 / 正文:收口 Page Aggregate;不在壳外侧拼第二份页面真相
- 涉及文档页标题、页面设置、正文保存、页头与树一致性时,优先判断是否应收口到 `Page Aggregate`,不要继续在页面壳或 island 外侧拼第二份页面真相 - 新建/重命名/移动/归档:`tree.*``documents.*` 仅兼容
- 涉及页面新建、重命名、移动、归档、恢复、嵌入时,优先沿 `tree.*` 正式命名推进;`documents.*` 只视为兼容层,不应继续扩写为长期命令面 - local-first AI 正文:文件引用 + `AiAccessScope` + Pi patch/diff + 版本冲突 + watcher`mnote.doc.*` / `mnote.block.*` 仅 cloud/remote/compat 或结构辅助。Phase C 流式 apply 冻结
- 涉及 local-first AI 普通 Markdown 编辑时,优先沿“授权文件引用 + `AiAccessScope` + allowed roots + OpenHub/native agent 原生 patch/diff + 文件版本冲突模型 + watcher 同步”推进;涉及 cloud / remote agent / 复杂结构辅助时,才沿 `mnote.doc.*` / `mnote.block.*` legacy tool facade 与 Rust `EditorCommand` 推进。`mnote.page.save` 只作为页面级兜底写入工具 - Page AI / 知识库首屏:对话与任务区优先;debug/health 放折叠区
- 涉及资源归属(哪个页面拥有哪个 mindmap/附件)、object identity 和资源生命周期时,优先沿 Resource Tree → File Tree projection → `tree.resource.*` 命令面推进;`tree.*` 是正式命令面,`documents.*` 只视为兼容层 - Page AI 宿主改原生 Pi Lab runtime;禁止 DOM 注入伪装第三方;普通 UI 不得出现 fallback 切换入口
- 页面 AI 编辑当前 local-first 主路径为:页面定位到真实 `.md` 文件,MNote 计算 `AiAccessScope` / allowed roots / selectionOpenHub/native agent 在白名单目录内用自身 patch/diff/文件编辑能力写入,MNote 通过 watcher / refresh 同步 tiptap。Hermes/Reasonix 只保留为 legacy/debug/外部工作流边界。`mnote.doc.markdown_edit` 只作为 cloud / remote agent / compat fallback`mnote.block.*` 保留为结构性辅助(拖拽排序等)。流式 apply + suggest/review(参考 BlockNote AI)作为 Phase C 设计冻结,当前不实施 - 知识库:LightRAG + `mnote.knowledge_rag.*` / `/api/knowledge-rag/*`
- Page AI / OpenHub / 知识库这类用户入口首屏必须优先保证真实任务区可用:对话、输入框、知识库列表/详情占主体空间;debug、scope、health、route guard 等诊断信息只能放在折叠诊断区、开发态或日志中,不得默认挤占用户输入和阅读区域 - 架构判断优先:`ARCHITECTURE.md`,再查对应 `design/**` process/done 稿
- MNote + OpenHub 深度融合的交互能力优先改 OpenHub 源码本体(React/FastAPI/服务边界),MNote 只提供 auth、scope、proxy、文件/引用回跳等宿主胶水;不得用 MNote 侧 DOM 注入、悬浮按钮或拦截脚本伪装成 OpenHub 原生能力。
- OpenHub/opencode 等 legacy fallback 只能保留为显式 debug/internal 边界;普通用户 UI 不得出现切换到 fallback 的按钮、入口或引导文案。
- 涉及知识库资料索引 / OCR / RAG 时,默认沿 OpenHub + LightRAG 与 provider-neutral `mnote.knowledge_rag.*` / `/api/knowledge-rag/*` 推进。WeKnora 只作为历史设计、参考实现或备用 provider 边界;新增功能不得再假设 WeKnora 是默认 provider。
- 需要架构判断时,优先参考:
- `/mnt/Data1T/mnote/ARCHITECTURE.md`
- `/mnt/Data1T/mnote/CURRENT_ARCHITECTURE.md`
- `/mnt/Data1T/mnote/design/01-tree-first-graph-kernel/process/1-8-mvp-post-process-execution-order-v1.md`
- `/mnt/Data1T/mnote/design/01-tree-first-graph-kernel/reference/1-tree-first-graph-kernel-v1.md`
- `/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/done/2-2-local-first-workspace-convex-control-plane-v1.md`
- `/mnt/Data1T/mnote/design/05-editor-mainline/reference/5-5-page-aggregate-single-truth-alignment-v1.md`
- `/mnt/Data1T/mnote/design/05-editor-mainline/done/5-6-page-aggregate-alignment-checklist-v1.md`
- `/mnt/Data1T/mnote/design/07-ai/process/7-18-local-first-agent-file-editing-control-plane-v1.md`
- `/mnt/Data1T/mnote/design/04-tree-domain/done/4-6-tree-command-protocol-cutover-stage2-v1.md`
- `/mnt/Data1T/mnote/design/03-rust-web/done/3-3-rust-web-tree-realtime-event-stream-v1.md`
- `design/03-rust-web/done/3-14-rust-web-tree-realtime-ws-push-v1.md`
- `/mnt/Data1T/mnote/design/10-review/done/08-kernel-architecture-next-priority-review-and-checklist.md`
- `/mnt/Data1T/mnote/design/10-review/done/09-page-ai-fast-block-edit-runtime-review.md`
- `/mnt/Data1T/mnote/design/10-review/done/10-current-mnote-ai-runtime-review-v1.md`
- `/mnt/Data1T/mnote/design/10-review/done/11-current-full-architecture-review-v1.md`
- `/mnt/Data1T/mnote/design/04-tree-domain/done/4-24-resource-tree-filetree-pagetree-source-contract-checklist-v1.md`
- `/mnt/Data1T/mnote/design/05-editor-mainline/done/5-12-main-editor-object-tab-resource-alignment-checklist-v1.md`
- `/mnt/Data1T/mnote/design/10-review/done/16-mnote-web-runtime-module-maintainability-checklist-v1.md`
- `/mnt/Data1T/mnote/design/03-rust-web/reference/3-23-sidebar-local-folder-resource-runtime-followup-v1.md`
- `/mnt/Data1T/mnote/design/07-ai/process/7-38-page-ai-sidebar-runtime-owner-split-v1.md`
- `/mnt/Data1T/mnote/design/07-ai/done/7-50-lightrag-knowledge-rag-provider-v1.md`
- `/mnt/Data1T/mnote/design/10-review/done/20-post-lightrag-runtime-hardening-checklist-v1.md`
## 设计稿目录规则 ## 设计稿目录规则
- `design/01-*` `design/10-*` 主线大类统一按目录表达状态`process/` 放当前可执行`done/` 已完成`reference/` 参考材料,必要时用 `draft/` 未成形草稿 - `design/01-*` `design/10-*``process/` 可执行,`done/` 已完成,`reference/` 参考`draft/` 未成形。
- 主线设计稿在推进中、且可直接拆 checklist 执行时放到对应大类的 `process/` - 已完成主线稿必须迁入 `done/`;被覆盖且非 done 的旧稿迁 `design/old/` 并标 `[recycle]`
- 主线设计稿在当前真实代码中已完成后,必须移动到对应大类的 `done/` - `design/90-reference/` 只放参考资料
- 参考实现、review 证据、对照矩阵、候选合同、测试流程基线等不直接执行的材料必须移动到对应大类的 `reference/`,不要继续占用 `process/`
- 尚未形成可执行 checklist 的新设想先放 `draft/`;进入实施前必须拆成明确 owner、验收和归档条件。
- 已被后续实现或更新稿明确覆盖、但又不属于 `done` 的旧主线稿,必须移动到 `design/old/` 并标记为 `[recycle]`,不要继续占用活跃 `process/`
- `design/old/` 下的历史废弃稿也统一按 `process/``done/` 分层,但标题继续标记 `[recycle]`
- `design/90-reference/` 只放参考资料,不参与 `process/done` 状态迁移。
## Bugs 目录规则 ## Bugs 目录规则
- `bugs/` 默认镜像 `design/` 的主线分类方式,按对应大类放置缺陷 - 镜像 design 大类;`process/` 未修完,`done/` 已验证
- 每个大类继续按 `process/``done/` 分层: - 按真正 owner 归类:壳/Sidebar/文档页体验 → `05-editor-mainline/`projection/selection/DnD/tree command → `04-tree-domain/`
- `process/`:缺陷已确认存在,仍在修复或验证中 - MVP 阶段发现 bug 时判断是否系统缺口;边界不清先问用户。
- `done/`:缺陷已修复,且已有真实代码与验证证据
- 新确认的缺陷先放 `process/`;修复完成后必须移动到同类目的 `done/`,不要在两个目录同时保留同一条缺陷。
- 缺陷归类以真正 owner 和长期主线为准,不以表面症状命名:
- `sidebar/topbar/breadcrumb/文档页壳/Wolai 体验对齐` 优先归到 `05-editor-mainline/`
- `projection/row model/selection/focus/keyboard/DnD/tree command` 优先归到 `04-tree-domain/`
- 当发现bug时,不仅仅是修bug,因为我们当前还处于mvp,需要看bug后面是否反映的是系统的缺失,如果需要系统性的开发,可以写deisign。如果边界不清,应该让user确认。
## 协作边界 ## 协作边界
- 仅修改与当前任务直接相关的文件。 - 只改与任务直接相关的文件;不覆盖用户已有改动;无关脏改动保持不动
- 不要擅自恢复、覆盖、删除用户已有改动 - UI 异常先查 debug shell / compat / 轮询是否混入主链
- 发现与当前任务无关的脏改动,保持不动;若怀疑会影响当前任务,先确认再处理 - 发现轮询先评估事件驱动替代,再决定是否保留临时 fallback
- 若当前问题只是 UI 表现异常,先确认是否是实验性 tree shell、compat 路径、轮询或 fallback 混入首屏主链,而不是直接怀疑 Convex 本身 - Subagent 为受控叶子:任务书限定读写范围、验证命令、交付与禁止项;不得再启 runner/worktree 或改任务书。主控复核 diff/证据后才采纳
- 若发现现有轮询或定时刷新链路,不要直接在其上继续叠加补丁;先确认是否能改成事件驱动、watcher/realtime 推送或命令结果定点刷新,再决定是否保留临时 fallback - 同一写入范围同时只允许一个 writer(主控或一个 worker);写入范围失效须先取消 worker 再改
- 子 agent 只能作为受控叶子 worker:任务书必须限定读写范围、验证命令、交付文件和禁止项;不得自行再启动 runner、subagent、额外 worktree 或修改任务书。Codex 主控必须复核 diff、handoff/result、验证证据和 git 状态后才能采纳;Reasonix/Hermes 只属于历史 provider 边界 - 最终测试/回复前确认实现型 subagent 已完成、已取消,或输出已标不采纳
- 主控必须维护当前 subagent 的任务书、写入范围和采纳状态。任何 `worker` 启动后到完成/取消前,都视为可能写入;主控不得同时手工修改同一文件范围,也不得再派第二个 worker 修改同一范围。
- 主控不得因为自己已经手工完成同一范围就提前关闭仍在运行的实现型 subagent;若该 worker 的写入范围已失效,必须先 interrupt/send_input 明确取消并说明其结果不再采纳,随后等待 shutdown/完成通知。只有已完成、已取消且确认不会再写入、或用户明确要求停止时,才 close_agent。
- 使用 subagent 的目标是缩短关键路径。委派前必须确认子任务不会阻塞主控下一步、不会与主控或其它 worker 写同一文件、且主控有明确的结果采纳点;否则主控直接做。若 subagent 结果晚到,主控必须标记“未采纳”或复核后合并,不能让后台结果与主线程补丁并存成冲突。
- 进入最终测试或最终回复前,主控必须确认本轮仍在运行的实现型 subagent 已完成、已明确取消并停止,或其输出已被标记为不采纳;不得在后台 worker 仍可能写入时声称已完成。
## CodeGraph 使用 ## CodeGraph
- 当前项目已配置 CodeGraph MCP结构性代码问题优先使用 `codegraph_*` 工具:`codegraph_search` 查符号,`codegraph_callers` / `codegraph_callees` 查调用关系,`codegraph_impact` 做影响分析,`codegraph_context` / `codegraph_explore` 获取聚焦上下文,`codegraph_files` 查看索引文件结构,`codegraph_status` 检查索引健康 - 结构性代码问题优先 CodeGraph MCPsearch / callers / callees / impact / explore
- CodeGraph 是当前开发态代码图主工具;代码改动后运行 `codegraph sync .`,大范围重构、排除规则变化或索引异常时运行 `codegraph index . --force`只有查找字面文本、日志字符串、注释原文,或已经明确目标文件时,才优先用 `rg` / 直接读文件。 - 改代码后 `codegraph sync .`;大重构或索引异常 `codegraph index . --force`
- 提交 git 前必须再次运行 `codegraph sync .`,随后用 `codegraph status .``codegraph_status` 确认没有 pending changes;若仍有 pending、索引异常或本轮改动包含大范围重构 / 排除规则变化,改跑 `codegraph index . --force` 后再提交 - 提交前再 sync,确认无 pending;字面文本/日志字符串才优先用 `rg`
## Reference-Code 快速对照流程 ## Reference-Code
- 对照 VSCode / Sidex / Zed / Lapce / Tiptap 等参考实现时,先确认实际源码目录和对应 `.codegraph/` 是否存在;当前优先参考 `/mnt/Data1T/mnote/reference-code/sidex-main`完整 VSCode 工作台源码,`reference-code/vscode` 只作为裁剪辅助证据 - 优先 `reference-code/sidex-main`完整 VSCode 工作台);`reference-code/vscode` 为裁剪辅助。
- 每次只围绕一个功能切面做对照,例如 Explorer 打开目标、编辑器 tab、资源生命周期、拖拽排序、快捷键或 overlay 定位;不要一次性抽象迁移整个参考项目 - 每次只对照一个切面;区分可直接采用的交互模型 vs 不符合 local-first/tree-first 的细节
- 推荐步骤:`codegraph_status` 确认索引 -> `codegraph_search/context` 找参考实现入口 -> `codegraph_callers/callees` 看调用链 -> 对应查 MNote 当前链路 -> 映射到 Rust kernel / mnote-web / 前端 host 的正确边界 -> 补 smoke 或测试 - 不要把参考项目 UI 状态当成 MNote 新事实源
- 对照结论必须区分“可直接采用的交互/状态模型”“只适合作参考的实现细节”“不符合 MNote local-first / tree-first 主线的内容”;不要把参考项目中的 UI 层状态当成 MNote 的新事实源。
## 常用命令 ## 常用命令
- 根目录热启动:`npm run desktop:hot` - 热启动:`npm run desktop:hot``http://localhost:3000`
- 前端开发(已迁移至 Rust SSR):`npm run desktop:hot` 启动后直接访问 `http://localhost:3000` - 测试:`cargo test -p mnote-web`
- 前端检查:Rust 测试 `cargo test -p mnote-web`Rust SSR 与 API),旧 React 前端已移入 recycle - 后端:`cd wolai-backend && uvicorn app.main:app --reload --port 8000`
- 后端开发:`cd /mnt/Data1T/mnote/wolai-backend && uvicorn app.main:app --reload --port 8000` - Control-plane:默认 `MNOTE_CONTROL_PLANE_BACKEND=libsql-local`;云端用 `turso-remote` / `turso-local-replica` + URL/token。`sqlite` 非 mnote-web 运行时。
- Convex 自托管:仅在显式 cloud / compat / sync replica 或历史导出场景参考 `/mnt/Data1T/mnote/recycle/20260522-convex-runtime-retirement/infra/convex/README.md`
- Control-plane 后端选择:默认 `MNOTE_CONTROL_PLANE_BACKEND=libsql-local`;云端开发使用 `MNOTE_CONTROL_PLANE_BACKEND=turso-remote``turso-local-replica` 并配置 `MNOTE_TURSO_DATABASE_URL``MNOTE_TURSO_AUTH_TOKEN``sqlite` 不再是 mnote-web 运行时后端,只保留给 control-plane-admin 迁移 / 导出和测试隔离。
- Turso dev 数据库:[Turso CLI](https://docs.turso.tech/cli/installation) `turso db create mnote-dev`,创建 token 后设置环境变量即可。
## Smoke 基线 ## Smoke 与测试账号
- 当前 smoke 分类与默认基线以 `scripts/TESTING_REFERENCE.md` 为准 - 基线:`scripts/TESTING_REFERENCE.md`;默认入口 `3000 + leptos-tiptap + local-first + Turso/libSQL auth`
- 默认浏览器验证入口是 `3000 Rust SSR + leptos-tiptap island + local-first workspace + Turso/libSQL control-plane auth` - 禁止 smoke 用 `sqlite3` CLI 直写 control-planeseed 走 Rust API / `scripts/lib/control-plane-dev-seed.js` / `control-plane-test-env.js`
- **脚本纪律**:所有 smoke 和测试脚本不得直接 `sqlite3` CLI 写 control-plane DB;需要 seed 数据时必须走 Rust API、测试 seed endpoint、`scripts/lib/control-plane-dev-seed.js``scripts/lib/control-plane-test-env.js` helper。直写脚本必须标注理由和退出条件 - 测试账号:`mnote.e2e@example.com` / `MnoteE2E123!` / `mnote-e2e`;优先 `/auth`「测试账号快速登录」,勿用 `MNOTE_DEV_AUTH=1` 跳过真实 auth
- 退役 Convex / Next / 3104 / BlockNote 路径的 smoke 不作为默认回归基线;只有显式 legacy/cloud/compat 任务才运行对应脚本。
## 默认测试账号 ## 前端测试
- 后续网页测试、浏览和 smoke 默认使用当前 SQLite control-plane Auth 测试账号:邮箱 `mnote.e2e@example.com`,密码 `MnoteE2E123!`,用户名 `mnote-e2e` - 看真实渲染:`/doko`;交互回归:浏览器自动化
- 优先从 `http://localhost:3000/auth` 点击“测试账号快速登录”进入;若需手动注册,也必须注册同一组账号,不要改用 `MNOTE_DEV_AUTH=1` 跳过真实 auth - 主页/Sidebar/文档首屏优先复用 `scripts/task*-smoke.js`
- 需要核验登录是否真实生效时,优先检查当前 `mnote_session` 是否能解析到 libSQL/Turso control-plane 用户会话,避免把 `devFallback` 当成真实登录;Convex JWT 只属于历史 / cloud compat 边界 - 高 CPU/内存:先查 debug shell、compat fallback、重复请求、轮询
## 前端测试方法 ## Wolai-aline
- 看页面当前真实渲染结果、登录态下实际内容、JS 渲染后的 `localhost` 页面时,优先用 `/doko`;它适合读取真实 Chrome 中已经渲染完成的页面 - 启用 wolai-aline skill + `design/08-wolai-aline-test-flow/reference/wolai-aline-test-flow-v1.md`
- 做交互测试、文件创建/删除/移动、上传、快速登录、侧边栏展开、回归断言时,优先用浏览器自动化测试工具;这类任务不要只靠 `/doko` - 流程:Wolai 基线(默认只读)→ 本地 RED smoke → 实现 → 验证 → subagent 浏览器对标 → 截图复核
- 推荐顺序是:先用 `/doko` 快速确认页面是否正常渲染,再用浏览器自动化测试工具验证关键交互链路 - 浏览器对标用 subagent,只验证与截图;写入需明确授权与沙盒页
- 影响主页入口、Sidebar、tree shell、文档页首屏时,优先补或复用 `scripts/task*-smoke.js` 这类 smoke 脚本 - 登录态:`tmp/wolai-playwright-profile`;滑块验证不绕过,记录阻塞
- 排查高 CPU / 高内存 / 卡顿时,先看是否存在首屏误走实验性 tree shell、compat fallback、重复请求、轮询或回链面板持续刷新,再看数据底座。
## 编码
## Wolai-aline 对标流程 - UTF-8TS/TSX 2 空格;Python 4 空格。
- 凡任务涉及 `wolai-aline`、Wolai 对标、复刻 Wolai 体验或把 `3000` 行为与 Wolai 页面比对,必须启用 `/home/lix/.codex/skills/wolai-aline` skill,并参考 `/mnt/Data1T/mnote/design/08-wolai-aline-test-flow/reference/wolai-aline-test-flow-v1.md` ## 密码箱 / agent skills(薄指针)
- Wolai-aline 任务默认采用“Wolai 基线取证(默认只读,编辑器任务仅在明确授权的 editable-test mode 下执行)-> 本地 RED smoke -> 小范围实现 -> 本地验证 -> subagent 浏览器对标复测 -> 主线程截图复核 -> 汇报剩余差异”的流程。
- 浏览器对标测试必须使用 subagent 执行;subagent 只做浏览器验证和截图,不修改源码、不还原文件、不清理证据;编辑器任务可在明确声明的 editable-test mode 下做最小编辑验证。
- Wolai 默认优先只读;编辑器对标只有在用户明确给出测试页和授权时才可做最小范围编辑测试。其他 Wolai 页面写入仍需沙盒页 URL 和明确授权。
- 即使在授权测试页,也禁止未经确认地删除、移动、归档、发布、评论、改权限或批量修改既有非测试内容;编辑测试必须记录前后截图、动作链、输入内容和清理状态。
- 对标验收不能只看文案或 DOM 是否存在;必须检查截图中的控件形态、开启/关闭状态、hover/active 状态、快捷键行为、URL 是否跳转等真实体验差异。
- 发现截图或实测行为与本地实现不一致时,先把差异补进 smoke 形成可复现失败,再修改实现并复测。
- Wolai owner 登录态优先复用 `/mnt/Data1T/mnote/tmp/wolai-playwright-profile`;遇到登录或滑块验证,不绕过,记录阻塞并让用户介入。
## 文件编码与风格 - 密码箱策略 SSOT`/home/lix/.agent-infra/vault-policy.md`skill `$mnote-vault``skills/mnote-vault`,全局 symlink 到 Codex/Hermes/Grok)。
- Page AI pack 注册:`hermes_tools/skill.rs` id `mnote-vault`(仅放 `skills/` 不够)。
- 所有新增或修改文件统一使用 UTF-8 - 勿在本文件复制完整 vault 策略;Paseo 经 `daemon.appendSystemPrompt` 全 agent 注入短段
- TS/TSX 默认 2 空格缩进,Python 默认 4 空格缩进。
+158 -457
View File
@@ -1,474 +1,175 @@
# MNOTE 当前架构梳理 # MNote 架构
> 更新时间:2026-06-07 > 更新时间:2026-07-19
> > 本文只描述**当前**产品形态、运行分层与收口缺口。历史迁移、退役路径与 changelog 不在此展开;协作规则见 `AGENTS.md`,执行 checklist 见 `design/`。
> 2026-05-22 口径更新:产品形态已切换为 local-first workspace,且初步 MVP 已建立;本地文件夹是默认数据真相,Turso/libSQL control-plane 承接 auth、membership、share grants、sync state、AI policy、OpenHub scope / AI policy 等默认控制面。旧 ACP/Hermes runtime session 只保留为迁移兼容层。Convex 仅保留为历史迁移源、显式 cloud source / compat / sync replica 边界;根 `convex/` functions 源码已软删除到 `recycle/20260522-convex-runtime-retirement/convex/`,不再作为 active deploy source。相关设计已完成并迁入 `design/02-convex-rust-long-term-architecture/done/2-2-local-first-workspace-convex-control-plane-v1.md` 与 `design/02-convex-rust-long-term-architecture/done/2-8-convex-replace-with-rust-sqlite-control-plane-v1.md`。本地 Markdown 图片与附件上传已新增 `/api/local-folder/assets/upload`,页面内上传默认写入 `{mdBase}.assets/` 并保存相对 Markdown 路径,不再走 Convex media asset。
>
> **当前阶段:local-first MVP 后阶段。** 3000 下文档页、Sidebar/File Tree/Page Tree 三层树模型、tree command`tree.*` preferred)、tree realtime WS 主链 / SSE fallback、本地 Markdown 上传、上传下载、AI 会话本地化与 VSCode-like agent 运行口径均已建立。剩余工作集中在 `WorkspacePath/ObjectIdentity` runtime 消费统一、`DocumentBuffer/BufferStore`、Page Aggregate compat 瘦身、tree command context、live cache 统一、VSCode-like 冲突合并 UI、agent diff 审计、本地轻量搜索 / 分享 / 同步闭环,而不是继续扩张专用 page-ai fast-path 或 Convex 主存储链。
>
> 2026-05-26 口径更新:前端 runtime 大块已完成模块级拆分。`layout.rs` / `tree.rs` / `web_shell.rs` 不再是浏览器 JS 功能的主要符号定位入口;Sidebar、FileTree、document adapter、tree shell 等 runtime 入口位于 `rust/crates/mnote-web/browser/*.js`tiptap island 入口位于 `rust/spikes/leptos-tiptap-spike/src/editor_runtime/*.rs`。CodeGraph 可直接索引这些 JS / Rust 模块;当前 smoke 分类见 `scripts/TESTING_REFERENCE.md`。
>
> 2026-07-03 口径更新:当前 runtime 已收口为 OpenHub / native agent + LightRAG + Turso/libSQL。知识库问答、资料 ingestion / query / citation / open-reference 默认走 LightRAG providerOpenHub 负责 Page AI 面板、opencode/native agent 执行、会话和工具事件承载;WeKnora 只保留为历史设计、参考实现或可选备用 provider 边界,不再作为当前默认知识库主链。Hermes / Reasonix 仅保留 legacy/debug/外部工作流边界。旧 `/api/hermes/*`、`hermes_tools/*`、ACP runtime 命名属于历史命名或迁移中的兼容层,不代表当前产品定义。
本文只描述当前仓库中真实成立的主线结构,以及当前最优先的架构收口点。 ## 1. 产品形态
## 1. 当前主线结论
当前仓库的主线不是:
- `BlockNote-first`
- `Mindmap-first`
- “先拆掉 Convex 再谈 Rust”
当前主线固定为:
1. `tree-first graph kernel` 是长期对象真相层
2. 本地文件夹是默认数据真相,Turso/libSQL control-plane 是默认账号、分享、同步、协作和 AI 隔离控制面;Convex 退居历史迁移源与显式 cloud / compat 边界
3. `mnote-web` 是当前 Rust Web 主执行面,负责 3000 gateway、server-first shell、query / command / projection / transport 与 realtime streamNext App Router 已降为 legacy compat / island bundle source,不再是当前主入口
4. 文档页默认主编辑器已切到页面内 `leptos-tiptap` island
5. `BlockNote` 已退出文档页默认主路径,仅作为历史参考实现 / 对照材料保留
6. 页面 AI 当前最合理的长期形态是:MNote 只负责页面定位、白名单目录权限、OpenHub / native agent scope 管理、文件变更同步;OpenHub / native agent 直接在授权工作区内编辑本地文件。`page_ai_workflow` 只保留为 debug / 历史兼容门面,`mnote.doc.markdown_edit` 不作为 local-first 默认正文编辑入口,只在显式 cloud / remote / compat 且无法直接授权文件访问的边界中作为受控 fallback;`mnote.block.*` 只保留为复杂结构辅助层
7. 知识库资料处理主线是 LightRAG + OpenHub:资料 ingestion、检索、引用和跨文档问答默认由 LightRAG provider 承担;OpenHub / native agent 通过 MNote provider-neutral tool facade 使用知识库能力;WeKnora 仅作为历史设计、参考实现或备用 provider 边界,MNote 不再并行维护 LiteParse / evidence SQLite / OCR sidecar 作为资料库索引真相
一句话收口:
> **Rust 持有语义主导权,本地文件夹是默认数据真相,Turso/libSQL control-plane 持有默认控制面;Convex 只保留历史迁移源、显式 cloud source / compat / sync replica 能力,前端逐步从重壳转向消费稳定 projection 与少量交互 island。**
补充口径:
> **主 Web 执行面当前以 `mnote-web` 为 3000 ownerNext App Router 只保留为 legacy compat、交互 island bundle source 与显式 debug/迁移辅助边界。**
>
> **页面 AI 的 local-first 主路径应尽量贴近 VSCode:当前页面解析成真实 `.md` 文件,OpenHub / native agent 在授权目录白名单内直接读写,tiptap 只消费后台文件变化后的最新投影。知识库问答默认走 LightRAG provider,并经 MNote source registry 和 citation/open-reference 回到本地资源。**
## 2. 当前主线目录
- `/mnt/Data1T/mnote/recycle/wolai-frontend/`
已退役移入 recycle。React island 与 legacy compat 代码的历史来源;Next.js App Router 已被 Rust mnote-web SSR 替代,不再作为 3000 主入口。
- `/mnt/Data1T/mnote/rust/crates/core-protocol/`
Kernel 类型、projection 协议、编辑器协议、树 / 图核心术语。
- `/mnt/Data1T/mnote/rust/crates/bridge-runtime/`
Kernel query / command、bridge transport、Tiptap <-> editor document 适配、命令解释层。
- `/mnt/Data1T/mnote/rust/crates/mnote-web/`
Rust Web route、kernel projection、documents/search/mindmap shell、OpenHub bridge、stream transport、compat,以及显式开启时的 debug shell;它是当前主 Web gateway / shell / transport owner。旧 Hermes bridge 命名仅作为 legacy route / tool facade 兼容层存在。
- `/mnt/Data1T/mnote/recycle/20260522-convex-runtime-retirement/convex/`
`convex/` functions 源码已退役并软删除到这里;不再作为 active deploy source。历史 `schema.ts``aiSessions.ts`、Auth functions 仅用于审计 / 迁移对照,默认控制面已由 Turso/libSQL control-plane 承接。
- `/mnt/Data1T/mnote/recycle/wolai-frontend/convex/`
已随 wolai-frontend 移入 recycle,不允许作为当前 Convex deploy fallback。
- `/mnt/Data1T/mnote/recycle/20260522-convex-runtime-retirement/infra/convex/`
Convex 自托管服务基础设施已软删除到回收区;只作为显式 cloud source / compat / sync replica 或历史数据导出的历史对照,不再被 `desktop:hot` / `dev:hot` 默认启动链路要求。
- `/mnt/Data1T/mnote/wolai-backend/`
辅助后端与异步处理,不是当前页面主链。
## 3. 当前页面运行结构
### 3.1 根布局与 legacy island source(已退役)
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/app/layout.tsx`
该文件已随 wolai-frontend 移入 `recycle/`,不再作为当前实现依据。
注意:
> **3000 当前根入口与文档页 shell 由 `mnote-web` Rust SSR 持有;Next App Router 已完全退役。**
### 3.2 工作区壳与 Sidebar(已迁移至 Rust SSR
以下文件已随 wolai-frontend 移入 `recycle/`,不再作为当前实现依据:
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/components/app-layout-shell.tsx`
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/hooks/use-sidebar-data.ts`
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/lib/tree-stream/use-sidebar-tree-stream.ts`
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/components/sidebar/use-preferred-sidebar-snapshot.ts`
当前 Sidebar/工作区壳的当前实现在 Rust mnote-web SSR
- 工作区壳渲染入口:`gateway.rs``root_entry`
- 文档页壳/文档面板:`web_shell.rs``document_page_shell``build_document_panes_bootstrap_json`
- Sidebar / FileTree / tree live runtime`rust/crates/mnote-web/browser/sidebar-tree-runtime.js``filetree-*.js``tree-live-controller.js` 等模块;`layout.rs` 只负责 SSR/bootstrap 和 script 注入。
- FileTree 渲染与交互:`rust/crates/mnote-web/browser/filetree-runtime.js``filetree-selection-runtime.js``filetree-context-menu-runtime.js``filetree-dnd-runtime.js``filetree-keyboard-runtime.js`
- debug/internal tree shell runtime`rust/crates/mnote-web/browser/tree-shell-runtime.js``tree-shell-*.js` 模块;`tree.rs` 只负责 route、HTML shell、asset route 和测试断言。
### 3.3 Runtime 模块化现状
当前 CodeGraph / IDE / 浏览器 stack trace 的定位入口应按模块查找:
- `rust/crates/mnote-web/browser/document-editor-adapter-runtime.js`:文档页 host adapter entrypoint,子模块负责 pane、resource tab、mindmap host、slash position、Tiptap conversion 和 session runtime。
- `rust/crates/mnote-web/browser/sidebar-tree-runtime.js`Sidebar entrypoint,子模块负责 workspace、page tree、filetree open/command/upload、attachment open、page settings 和 live applyPage AI sidebar host 位于 `sidebar-page-ai-runtime.js`owner 属于 `07-ai`
- `rust/crates/mnote-web/browser/tree-shell-runtime.js`debug/internal tree shell entrypoint,子模块负责 page tree、filetree、picker、render、DOM、icons 和 state。
- `rust/spikes/leptos-tiptap-spike/src/editor_runtime/`tiptap island runtime 模块集合;根 `lib.rs` 只保留 wasm entrypoint、Leptos shell 信号编排和仍未稳定外置的薄壳。
对应完成记录见 `design/10-review/done/16-mnote-web-runtime-module-maintainability-checklist-v1.md`。剩余专项边界不再回到 raw string 问题,而是分别由 `design/03-rust-web/reference/3-23-sidebar-local-folder-resource-runtime-followup-v1.md``design/07-ai/process/7-38-page-ai-sidebar-runtime-owner-split-v1.md` 承接。
## 4. 文档页主链
### 4.1 入口
文档页入口的当前实现在 Rust mnote-web
- 文档页壳 SSR`web_shell.rs``document_page_shell`),直接输出 HTML + bootstrap JSON
- Page Aggregate 快照 API`web_shell.rs``page_aggregate`)返回 `/api/page-aggregate/:id`
- 前端桌面/窗口面板布局:`web_shell.rs``build_document_panes_bootstrap_json`
历史 wolai-frontend Next 文档页入口(已移入 `recycle/`):
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/lib/documents/page-aggregate-loader.ts`
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/app/(app)/documents/[id]/page.tsx`
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/lib/documents/page-aggregate.ts`
### 4.2 文档壳(已迁移至 Rust SSR
历史 React 文档壳组件(已随 wolai-frontend 移入 `recycle/`,不再作为当前实现):
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/components/editor/document-shell.tsx`
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/components/editor/document-content.tsx`
当前文档壳由 Rust mnote-web SSR 输出:
- `web_shell.rs``document_page_shell` 直接渲染 HTML shell,不在前端保留 React 文档壳 runtime。
### 4.3 默认编辑器 host(已迁移至 WASM island
历史 React 编辑器 host(已移入 `recycle/`):
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/components/editor/editor-host-config.ts`
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/components/editor/editor-host.tsx`
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/components/editor/leptos-tiptap-island-editor-host.tsx`
当前默认主编辑器是页面内 Leptos/WASM island,由 Rust mnote-web SSR 加载:
- WASM 产物:`rust/spikes/leptos-tiptap-spike/`
- 加载路由:`web_shell.rs``leptos_tiptap_manifest` / `leptos_tiptap_asset`
### 4.5 BlockNote 的当前位置
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/components/editor/blocknote-editor.tsx`
`BlockNote` 已随 wolai-frontend 移入 recycle,仅作为历史对照材料,不参与当前实现。
而不是默认主编辑器方向。
## 5. 当前编辑器与页面聚合关系
当前文档页已经开始消费统一的 `PageAggregateProjection`,但仍不能说“页面域已完全统一成 Rust 单一真源”。
当前真实状态是:
- 读取主链已优先消费 Rust `mnote.page_aggregate.v1` snapshot
- Page Aggregate 已输出 `blockDocument``blockProjectionVersion``projectionSource`
- 标题链路已开始与工作区树 canonical snapshot 对齐
- 正文默认由 `leptos-tiptap` island 编辑与保存
- 页面设置已有一部分进入 island 运行时语义
- `page_tree` / `pageSubtree` 已进入统一聚合入口
- 页面/块 AI tools 可通过 Page Aggregate block projection 读取、定位、dry-run、替换、插入和受限移动块;local-first 普通正文编辑不再要求走块工具,在线 / cloud / compat 场景才回到受控 mnote tool 写入。
2026-05-16 更新:以下四项已通过真实 3000 browser smoke 验证(证据见 `tmp/page-aggregate-*` 目录):
- 标题写入后 Page Aggregate、页头、Breadcrumb、Sidebar、Page Tree、File Tree 一致性(`task110`
- 正文保存后 `body.revision` / `conflictDetectionKey` / `blockDocument` 同步(`task-page-aggregate-body-sync-smoke`
- 页面设置写入后 `layout.pageOptions` 与 island runtime DOM 同步,刷新后不退回(`task-page-aggregate-options-sync-smoke` / `task-page-aggregate-refresh-persistence-smoke`
- Convex 不可用时返回 degraded error503 + `x-error-code=convex_unavailable`),不返回伪 fixture(route 级负向测试)
仍未完成的关键点是:
1. Rust 侧已提供最小 `Page Aggregate` snapshot 和 block projection v1,但当前 block projection 仍主要从 `documents.content` / local markdown content 投影(`projectionSource=documents.content`),不是 EditorBlockDocument 原生落库完成态
2. 标题 / 正文 / 页面设置虽已收口到 `page.*` family 和 local-first 文件版本模型,但客户端仍保留 `PageAggregateClientState` reducer(混合 server snapshot / draft title / local content),页面域单一真源仍未完全闭环
3. AI 块工具继续作为复杂结构辅助;local-first 普通 Markdown 编辑主路径已经转为“授权文件引用 + agent 原生 patch/diff + watcher 同步”
4. Sidebar 仍通过 preferred snapshotinitial / query / tree_stream)做 freshness 选择,tree realtime live cache 未统一
因此当前正确表述应是:
> **文档页读取主链已进入 Rust-first `page aggregate` 过渡态,标题/正文/页面设置 smoke 已通过,但页面域单一真源(ClientState → Rust snapshot)与 tree realtime live cache 仍未闭环。**
## 6. 当前树域结构
### 6.1 Kernel projection 与 route
- `/mnt/Data1T/mnote/rust/crates/mnote-web/src/routes/kernel.rs`
当前 Rust 已提供:
- `sidebar_tree`
- `page_tree`
- `file_tree`
- `subtree`
- `edges`
- `graph`
这些 route 说明树域 projection family 已经在 Rust 侧具备清晰边界。
### 6.2 树命令现状
- `/mnt/Data1T/mnote/recycle/wolai-frontend/src/lib/documents/tree-command-client.ts`
- `/mnt/Data1T/mnote/rust/crates/mnote-web/src/routes/tree.rs`
- `/mnt/Data1T/mnote/rust/crates/storage-convex-bridge/src/mapping.rs`
当前树命令已经开始以 `tree.*` 为 preferred command name,例如:
- `tree.node.create`
- `tree.node.rename`
- `tree.subtree.move`
但兼容层仍广泛保留:
- `documents.create`
- `documents.title.update`
- `documents.move`
这说明 tree command cutover 已开始,但还没有完成。
### 6.3 树 realtime 现状
当前 Sidebar 已有:
- query snapshot
- tree stream
- preferred snapshot 选择
正式的 snapshot + delta 主链已经固定到 `mnote-web``/api/tree/events`Next `/api/mnote-web/stream` 只保留 compat alias。
因此当前正确表述应是:
> **树域 realtime 主链由 Rust Web `/api/tree/events` 持有,前端只消费稳定 stream contract 与 projection。**
补充:
> **`3000` 主壳当前已不再通过 `/api/tree/projections/*` 额外维护第二条 runtime live fallbacksnapshot / delta / resync 直接消费 `/api/tree/events` 载荷。**
### 6.4 Resource Tree / File Tree / Page Tree 三层模型
当前树域已建立三层语义(合同见 `design/04-tree-domain/done/4-24-*``design/05-editor-mainline/done/5-12-*`):
- **Resource Tree**:长期 canonical 对象组织树,Rust kernel 持有语义。资源类型包括 page、mindmap、attachment、onlyoffice、code 等(`KernelObjectIdentity``KernelProjectionResourceKind` 已在 `core-protocol` 落地)。
- **File Tree**Resource Tree 的主组织投影。展示页面文件夹、`{title}.md`(非 `index.md`)、mindmap、附件等资源。文件树行消费 Rust `/api/tree/projections/file` 或等价 projection,不在前端临时拼装第二真相。
- **Page Tree**:面向阅读/导航的快捷投影。只显示页面关系和导航语义,不拥有排序、父子、附件归属的最终真相。
关键规则:
- 文件树点击 mindmap 打开 mindmap object editor,不被 `{title}.md` 吞掉
- `{title}.md` 只代表页面正文(Page Aggregate body),mindmap / OnlyOffice / 附件是不同 object model
- 页面树不持有独立结构真相,只显示文档导航关系
## 7. Mindmap 与 OnlyOffice
### 7.1 Mindmap
当前 Mindmap 不再是系统中心,而是:
- `tree-first graph kernel` 的一种视图 / 编辑挂件
它仍有:
- 文档内嵌块形态
- 独立页面形态
但不应再被理解为对象真相层。
### 7.2 OnlyOffice
OnlyOffice 仍然是:
- 独立页面型编辑器
它不直接嵌入正文主编辑画布;正文中通常通过附件块跳转进入。
## 8. 当前最优先的架构收口
当前最优先的三条主线,不是继续大规模 UI 重写,而是:
### 8.1 Page Aggregate
目标:
- 让标题 / 页面设置 / 正文 / page tree 统一成同一组 page aggregate projection 与 command family
- 前端不在页面壳、island 外侧、Sidebar preferred snapshot 外再拼第二份页面真相
当前进度(2026-05-16):
- ✅ 文档页读取主链已 Rust-firstTS builder 退出 runtimeNext compat 返回 410
- ✅ 标题单一真源 smoke 通过(`task110`):页头/Breadcrumb/Sidebar/Page Tree/File Tree 一致
- ✅ 正文写入后 `body.revision` / `blockDocument` 同步 smoke 通过
- ✅ 页面设置写入后 `pageOptions` 同步与刷新持久化 smoke 通过
- ✅ local-first `page.body.write` / `/api/page-body/write``expectedFileVersion` 已成为本地正文写入主入口,`/api/documents/save` 降级为 compat adapter
- ✅ 本地 Markdown 图片 / 附件上传写入 sibling assets,并由真实浏览器 smoke 覆盖保存后刷新恢复
- ✅ Convex 不可用时返回 degraded error,不返回伪 fixture
- ⬜ cloud / compat block projection 继续减少 `documents.content` 后备;local-first 正文真相已转为 `.md` 文件投影
- ⬜ 客户端 `PageAggregateClientState` reducer 退役,页面域完全以 Rust snapshot 为单一运行时真相
对应设计稿:
- `/mnt/Data1T/mnote/design/05-editor-mainline/reference/5-5-page-aggregate-single-truth-alignment-v1.md`
- `/mnt/Data1T/mnote/design/05-editor-mainline/done/5-6-page-aggregate-alignment-checklist-v1.md`
- `/mnt/Data1T/mnote/design/05-editor-mainline/done/5-5-1-page-aggregate-contract-v1.md`
### 8.2 Tree Command Cutover
目标:
-`tree.*` 成为正式命令面
- `documents.*` 降为兼容层
对应设计稿:
- `/mnt/Data1T/mnote/design/04-tree-domain/done/4-6-tree-command-protocol-cutover-stage2-v1.md`
### 8.3 Tree Realtime Event Stream
目标:
- 让 snapshot + delta 正式成为树域实时主链
- 减少当前 query/refetch/freshness 补偿链的长期存在
对应设计稿:
- `/mnt/Data1T/mnote/design/03-rust-web/done/3-3-rust-web-tree-realtime-event-stream-v1.md`
### 8.4 Page / Block AI Tooling
目标:
- 让 local-first 页面 AI 默认走“页面定位 -> 授权文件引用 -> agent 原生 patch/diff -> 前台同步”
-`mnote.page.save` 固定为页面级兜底写入工具,不再代表普通正文编辑默认入口
-`mnote.doc.*` / `mnote.block.*` 收口为兼容 / cloud / 复杂结构辅助工具
- 补齐 `scope=selection`、白名单目录权限、changed_files/diff 审计、前台同步刷新矩阵
当前进度(2026-05-19,按 `2-2` 完成态更新):
- ✅ 页面 AI 与 ACP runtime 已能承载本地优先方向
-`page_ai_workflow` 已在 local source 下退出主路径
- ✅ legacy tool facade`mnote.doc.*` / `mnote.block.*`)已可作为兼容 / cloud / 复杂结构辅助层读取和写入
- ✅ 本地优先设计已经收口为 VSCode-like 运行模型:页面定位 + 白名单目录 + agent 直改文件 + tiptap 同步显示
- ✅ 页面 AI 默认输入已收口到 `currentFile + selection + allowedRoots / aiAccessScope`
- ✅ legacy ACP runtime 曾显式带白名单目录运行;当前主线转向 OpenHub / native agent scope
- ⬜ MNote 回收 changed_files / diff 审计
-`scope=selection``format=page_xml/text` 继续作为结构化辅助输出,不作为普通 Markdown 编辑必需路径
- ⬜ tool manifest annotations 继续补齐 destructive / requiresApproval 等高级语义
-**Phase C(设计冻结,不实施)**`StreamApplyController` + `ReviewSession` + `GhostTextOverlay`(流式 apply + suggest/review
- ⬜ stale revision / idempotency 重放保护(已有 revision 乐观锁覆盖,补端到端 smoke)
关键原则(2026-05-18 口径更新):
- **local-first 主路径**:当前页面解析成授权 `.md` 文件,OpenHub / native agent 在白名单目录内直接读写,MNote 负责权限、审计和前台同步
- **local-first 文件编辑模型**:普通 Markdown 编辑走“页面定位 + 授权文件引用 + agent 原生 patch/diff + 文件版本冲突模型”;MNote 不提供 local-first 默认普通 Markdown 编辑工具,`mnote.doc.markdown_edit` 只在显式 cloud / remote / compat 且无法直接授权文件访问的边界中作为受控 fallback,`mnote.doc.apply_block_ops` 仅作为块级结构性辅助。CLI Main Lark Doc 只能作为 skill/workflow 纪律的有限参考,不作为当前编辑架构主参考。
- `mnote.block.*` 降级为结构性辅助(拖拽排序、精确块删除等),不删除
- 当前 `local_rule` planner`direct_block_edit_operations`)是过渡实现,应继续退役
- cloud / remote agent 无法直接访问本地文件时,不能静默回退到 `mnote.doc.markdown_edit`;必须通过显式 cloud source / remote fallback / compat 边界和权限设计承接
- Markdown 既是 AI 编辑格式也是人类可读格式,不需要 XML 中间层
- 流式 apply + suggest/review(参考 BlockNote AI 的 `StreamToolExecutor` + `suggestChanges`)仅作为 Phase C 设计冻结,当前不实施
对应设计稿:
- `/mnt/Data1T/mnote/design/old/07-ai/process/7-10-page-block-ai-tooling-execution-checklist-v1.md`(历史执行记录;不再作为 active 入口)
- `/mnt/Data1T/mnote/design/10-review/done/09-page-ai-fast-block-edit-runtime-review.md`
- `/mnt/Data1T/mnote/design/07-ai/process/7-18-local-first-agent-file-editing-control-plane-v1.md`
- `/mnt/Data1T/mnote/design/old/07-ai/process/7-14-local-first-ai-markdown-editing-convergence-v1.md`(历史回收稿;不再作为当前实现依据)
### 8.5 Knowledge RAG / LightRAG
目标:
- 把资料库 ingestion、检索、引用和跨文档问答统一交给 LightRAG providerOpenHub / native agent 只通过 MNote provider-neutral tool facade 调用。
- MNote 只保留 source registry、allowed roots / 权限、FileTree 灯号、资料库设置 UI、provider status UI、citation/open-reference 映射和 agent tool facade。
- LiteParse、旧 OCR sidecar、旧 evidence search / local-index agent tools 作为历史迁移和 recycle 边界,不再作为默认 fallback。
当前进度(2026-07-03):
- ✅ LightRAG 是当前默认知识库 providerOpenHub / native agent 是 Page AI 执行与交互主链。
- ✅ MNote `source registry` 记录 `workspaceId/rootUri/sourcePath/sourceHash/providerDocId/stale/deletedAt/status`FileTree 灯号从 registry 映射为已索引 / 正在索引 / 失败 / 未索引;历史 `lightRagDocId` 只作为兼容字段。
- ✅ WeKnora 仅保留为历史设计、参考实现或备用 provider 边界,不再作为新增主路径。
- ✅ Agent 默认使用 `mnote.knowledge_rag.status/query/open_reference`,不再暴露旧 `mnote.evidence.*` 作为资料库检索主路径。
对应设计稿:
- `/mnt/Data1T/mnote/design/07-ai/done/7-50-lightrag-knowledge-rag-provider-v1.md`
- `/mnt/Data1T/mnote/design/10-review/done/20-post-lightrag-runtime-hardening-checklist-v1.md`
### 8.6 定向 Bug Hunt 与质量基线
目标:
- 围绕已知架构风险做定向排查,而非泛泛"找 bug"
优先关注:
- Page Aggregate 回流不一致
- AI 块写入 conflict / stale revision
- File Tree `{title}.md` 与 page title 同步
- tree stream resync / 双浏览器一致性
- debug / compat / fallback 是否混入首屏主链
已有 smoke 体系(`scripts/` 目录):
- `scripts/TESTING_REFERENCE.md`:当前 smoke 分类、默认基线和退役脚本说明
- `task110-page-title-single-truth-smoke.js`:标题全链路一致性
- `task-page-aggregate-body-sync-smoke.js`:正文写入后 Page Aggregate 同步
- `task-page-aggregate-options-sync-smoke.js`:页面设置写入后同步
- `task-page-aggregate-refresh-persistence-smoke.js`:刷新持久化
- `task123-rust-web-tree-live-stream-consumer-smoke.js`tree realtime 消费
- `task169-mindmap-realtime-smoke.js`mindmap 隔离与持久化
- `task179-tree-create-delete-no-reload-smoke.js`:树操作无刷新
## 9. 当前不该再用的旧口径
下面这些说法现在都不准确:
- “默认文档页仍然是 `BlockNoteEditor`
- “主编辑器还没切到页面内 Leptos island”
- “当前最优先是继续证明 `leptos-tiptap` 能不能跑”
- “当前最优先是先做树域 UI 重构”
- “Rust Web 还只是实验,没有接真实页面链路”
- “页面 AI 编辑必须经过 Hermes agent,没有快路径”
- “WeKnora 是当前默认知识库 provider。”
- “Hermes / Reasonix 是当前 Page AI 默认 agent runtime。”
- “页面 AI 编辑必须经过 MNote 专用工具才能改普通 Markdown”
当前真正的卡点已经从“能不能跑”变成:
> **管理员目录授权、文件版本冲突合并、agent diff 审计、本地轻量搜索 / 分享 / 同步如何产品化;知识库 RAG 主路径为 LightRAG + OpenHub tool facadeWeKnora 仅备用;Page Aggregate ClientState、projection / command / realtime 兼容链如何继续瘦身。**
## 10. Control-plane 后端架构与运行配置
### 10.1 后端架构
当前 control-plane 存储后端已从单一 `rusqlite` 抽象为 `ControlPlaneStore` traitmnote-web 运行时只允许 Turso/libSQL 系列后端:
```text ```text
ControlPlaneStore trait MNote = VSCode 简化版工作区
├── TursoControlPlaneStore mnote-web 运行时后端 + tiptap Markdown 编辑器(leptos-tiptap island
│ ├── libsql-local 默认本地运行模式,无云依赖 + Pi Rust Page AI
│ ├── turso-remote 真实 Turso dev/prod DB + LightRAG 知识库
│ ├── turso-local-replica 本地 replica + remote sync + simplemindmap / OnlyOffice 插件
│ └── turso-synced libSQL synced database + Wolai 主题 Web 壳
└── SqliteControlPlaneStore 仅限 control-plane-admin 迁移/导出和 Rust 测试隔离 + Turso/libSQL 鉴权控制面
``` ```
### 10.2 环境变量 | 层 | 当前真源 / Owner |
|----|------------------|
| 工作区数据 | 本地 workspace folder;页面正文为 `.md` |
| 树 / 资源语义 | Rust kernel`core-protocol` + `bridge-runtime` |
| Web 入口 | `mnote-web`,公开端口 **3000** |
| 控制面 | Turso/libSQLauth、membership、share、sync state、AI policy / Pi scope |
| Page AI | Pi Lab`/api/page-ai/pi/*`),默认唯一产品级入口 |
| 知识库 | LightRAG + `mnote.knowledge_rag.*` facade |
| 编辑投影 | Page Aggregate`mnote.page_aggregate.v1`);tiptap 为显示层,非对象真源 |
一句话:
> **本地文件夹是数据真相,Rust kernel 持有语义,Turso/libSQL 持有控制面,前端只消费稳定 projection。**
## 2. 分层
### 2.1 Workspace / Storage
- 默认 source`local_folder`
受管根:`/mnt/Data1T/Mnote_data/users/<actor>/workspaces/my-space/`
- 管理员通过控制面授权可读写目录;普通用户不能自助全盘读写
- 页面内上传默认写入 sibling assets(如 `README.assets/image.png`),正文存相对 Markdown 链接
- 本地 `.md` / 附件 / mindmap / OnlyOffice **不**迁入 control-plane DB
### 2.2 Kernel / Projection
- `core-protocol`:树、资源、页面、AI access scope、page body write 等协议
- `bridge-runtime` + `mnote-web`LocalFS(及显式 cloud/compat source)→ 稳定 projection / command
- 前端只消费:`file_tree``page_tree``page_aggregate`、tree command result、少量 editor runtime payload
树域三层:
| 层 | 角色 |
|----|------|
| Resource Tree | kernel 对象组织真源(page / mindmap / attachment / onlyoffice / …) |
| File Tree | 主组织投影;页面正文行为 `{title}.md` |
| Page Tree | 导航投影;不持有结构真相 |
正式命令面:`tree.*`(如 `tree.node.create` / `rename` / `tree.subtree.move`)。`documents.*` 仅为兼容层。
### 2.3 Web Shell / Editor
- Owner`mnote-web`Rust SSR + browser runtime
- 文档页默认编辑 host:页面内 `leptos-tiptap` island
- browser JS`rust/crates/mnote-web/browser/*.js`
- island`rust/spikes/leptos-tiptap-spike/src/editor_runtime/*.rs`
- `layout.rs` / `tree.rs` / `web_shell.rs` 只做 SSR / bootstrap / route / asset 注入
- 正文保存主入口:`page.body.write` / `/api/page-body/write`(带文件版本);`/api/documents/save` 为 compat
- Watcherclean editor 自动刷新;dirty editor 进入冲突态,不静默覆盖
- RealtimeWS 主链 `/api/realtime/ws` + SSE fallback `/api/tree/events`snapshot / delta / resync
- Mindmaptree-first 的视图 / 挂件,非对象真源
- OnlyOffice:独立页面型编辑器,经附件/资源跳转进入
### 2.4 Page Aggregate
- 读取主链:Rust `mnote.page_aggregate.v1` snapshot`/api/page-aggregate/:id`
- 输出含 `blockDocument` / `blockProjectionVersion` / `projectionSource`
- 本地正文真相是 `.md`;aggregate 是投影,不是第二份正文库
- 仍属过渡态:block projection 多从 markdown content 投影;客户端仍有 `PageAggregateClientState` reducer
### 2.5 Page AIPi Rust
```text ```text
MNOTE_CONTROL_PLANE_BACKEND=libsql-local|turso-remote|turso-local-replica|turso-synced 当前页 → 真实 .md
MNOTE_TURSO_LOCAL_PATH=/mnt/Data1T/Mnote_data/control-plane/control-plane-libsql.db → AiAccessScope / allowed roots / selection
MNOTE_TURSO_DATABASE_URL=libsql://... → Pi Rust Page AI/api/page-ai/pi/*
MNOTE_TURSO_AUTH_TOKEN=... → agent 原生 patch/diff 写文件
MNOTE_TURSO_LOCAL_REPLICA_PATH=/mnt/Data1T/Mnote_data/control-plane/control-plane-replica.db → watcher / BufferStore / refresh → Page Aggregate + tiptap
MNOTE_TURSO_SYNCED_PATH=/mnt/Data1T/Mnote_data/control-plane/control-plane-synced.db
MNOTE_TURSO_SYNC_INTERVAL_MS=5000
``` ```
### 10.3 默认策略 - Pi session 元数据 / run / tool event 默认落 control-planePi JSONL 仅为 runtime 工作副本
- `mnote.doc.*` / `mnote.block.*` / `mnote.page.*`cloud / remote / compat / 复杂结构辅助
- `/api/page-ai/block-edit-workflow`:非 local-first 默认正文路径
- 流式 apply + suggest/review**Phase C 冻结,当前不实施**
- 遗留 ACP / Hermes / Reasonix / OpenCode:兼容面,默认主壳不注入;不得新增能力;退役须原子覆盖 sidebar、route、runtime、wrapper`hermes_tools` 中 provider-neutral 契约按实际消费者保留)
- **普通开发/desktop/prod runtime**:默认 `libsql-local`,不再读取 `MNOTE_CONTROL_PLANE_DB_PATH` ### 2.6 Knowledge RAGLightRAG
- **云端验证**:显式使用 `turso-remote``turso-local-replica``turso-synced`,并从本机私有 env/secret manager 加载 URL/token。
- **SQLite 边界**`sqlite` 不能作为 mnote-web runtime backend;只允许 `control-plane-admin` 做迁移源、导出备份格式和 Rust 单测隔离。
### 10.4 未迁移数据(第一阶段不迁) - 资料 ingestion / query / citation / open-reference 主路径:LightRAG
- MNote 只维护 source registry、权限、FileTree 灯号、status UI、citation 映射、tool facade
- Agent 工具:`mnote.knowledge_rag.status` / `query` / `open_reference`
- 不把 provider storage 当用户正文真相;不复制图谱/chunk 为第二套索引
- 本地 `.md` 页面正文:仍是 local-first 正文真相。 ### 2.7 Control-plane
- 本地附件、图片、mindmap、OnlyOffice 文件。
- `.mnote/index/evidence.sqlite`:已从当前主线退役。
- LightRAG 自身存储、WeKnora / OpenHub 自身存储。
- OpenHub 自身 SQLite 会话库(第二阶段单独评估)。
### 10.5 备份与恢复策略 ```text
ControlPlaneStore
├── TursoControlPlaneStore mnote-web 唯一运行时
│ ├── libsql-local 默认
│ ├── turso-remote
│ ├── turso-local-replica
│ └── turso-synced
└── SqliteControlPlaneStore 仅 admin 迁移/导出与测试隔离
```
SQLite 不再作为运行时回滚后端。需要离线留档或人工核验时,用 `control-plane-admin export-target-to-sqlite` 导出备份;恢复方向应是从备份重新导入 libSQL/Turso 目标库,而不是让 mnote-web 改回 SQLite 运行。 | 变量 | 用途 | 默认 |
|------|------|------|
| `MNOTE_CONTROL_PLANE_BACKEND` | 后端模式 | `libsql-local` |
| `MNOTE_TURSO_LOCAL_PATH` | local 文件 | `/mnt/Data1T/Mnote_data/control-plane/control-plane-libsql.db` |
| `MNOTE_TURSO_DATABASE_URL` | remote URL | — |
| `MNOTE_TURSO_AUTH_TOKEN` | remote token | — |
| `MNOTE_TURSO_LOCAL_REPLICA_PATH` | replica 路径 | `…/control-plane-replica.db` |
| `MNOTE_TURSO_SYNCED_PATH` | synced 路径 | `…/control-plane-synced.db` |
| `MNOTE_TURSO_SYNC_INTERVAL_MS` | sync 间隔 | 未设置 |
### 10.6 测试与脚本纪律 - 只存元数据:users、sessions、workspaces、directory grants、share、sync state、AI policy/runtime、audit
- `sqlite` 不得作为 mnote-web runtime;启动链拒绝
- 备份:`control-plane-admin export-target-to-sqlite` → 再导入 libSQL/Turso,不回退 SQLite 运行
- 所有 smoke 和脚本**不得直接 `sqlite3` CLI 写 production control-plane DB**。 ### 2.8 代码入口
- 需要 seed 数据时必须走 Rust API / 测试 seed endpoint / `scripts/lib/control-plane-dev-seed.js``scripts/lib/control-plane-test-env.js` helper。
- 禁止通过临时文件覆盖 `MNOTE_CONTROL_PLANE_DB_PATH` 绕过真实 store。 | 路径 | 职责 |
- 相关设计:`design/02-convex-rust-long-term-architecture/process/2-9-turso-control-plane-cutover-v1.md` |------|------|
| `rust/crates/core-protocol/` | Kernel 类型与 projection 协议 |
| `rust/crates/bridge-runtime/` | query / command / traversal |
| `rust/crates/mnote-web/` | 3000 gateway、SSR shell、API、compat、realtime |
| `rust/crates/mnote-web/browser/` | Sidebar / FileTree / document adapter / Page AI host JS |
| `rust/spikes/leptos-tiptap-spike/` | 文档页默认编辑 island |
| `wolai-backend/app/` | 辅助后端 / 异步处理 |
| `src/components/onlyoffice/` | OnlyOffice 静态与插件资源 |
`recycle/` 为历史回收区,不作为当前实现依据。
## 3. 当前收口缺口
阶段:local-first **MVP 后**。底座与主路径已立;重点是统一与产品化,不是扩 compat 或旧主链。
1. **WorkspacePath / ObjectIdentity** — 路径、identity、资源归属统一到 kernel contract
2. **DocumentBuffer / BufferStore** — runtime 已有;多 tab 仲裁与冲突 UI 体验收口
3. **Page Aggregate** — 瘦身 compat join;退役 ClientState 混合 reducer,以 Rust snapshot 为单一运行时真相
4. **tree command context** — 菜单 / 快捷键 / AI enablement 同一 context,勿各处硬编码
5. **tree live cache** — watcher + WS/SSE 收进同一 cache,减补偿链
6. **管理员目录授权 UI** — grant / access-policy 可管理
7. **冲突合并 UI** — 接受磁盘 / 保留编辑器 / diff 合并
8. **agent 写入审计** — changed files、diff、run id、actor 本地落盘,可同步控制面
9. **本地轻量搜索** — workspace 全文 / 反链 / 标签,不依赖 cloud search
10. **分享与同步闭环** — share grant ≠ 本机 filesystem root;控制面不可用时不扩权限
11. **插件资源模型** — mindmap / office 作为 Resource Tree 对象
12. **遗留兼容面退役** — ACP/Hermes/Reasonix/OpenCode 原子删除;Convex 仅显式 cloud/compat
执行稿:`design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`
## 4. 设计索引(当前)
| 主题 | 文档 |
|------|------|
| 总收口 | `design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md` |
| tree-first kernel | `design/01-tree-first-graph-kernel/reference/1-tree-first-graph-kernel-v1.md` |
| local-first + control-plane | `design/02-convex-rust-long-term-architecture/done/2-2-*.md``process/2-9-turso-control-plane-cutover-v1.md` |
| Page Aggregate | `design/05-editor-mainline/reference/5-5-*.md``done/5-6-*.md` |
| AI 文件编辑 | `design/07-ai/process/7-18-local-first-agent-file-editing-control-plane-v1.md` |
| LightRAG | `design/07-ai/done/7-50-lightrag-knowledge-rag-provider-v1.md` |
| tree command / realtime | `design/04-tree-domain/done/4-6-*.md``design/03-rust-web/done/3-3-*.md``3-14-*.md` |
| Resource / File / Page Tree | `design/04-tree-domain/done/4-24-*.md` |
---
`CURRENT_ARCHITECTURE.md` 为兼容指针,内容以本文为准。
-188
View File
@@ -1,188 +0,0 @@
# 当前完整架构
> 更新时间:2026-06-28
>
> 范围:`/mnt/Data1T/mnote` 当前可见实现、local-first MVP 后阶段主线口径、历史退役边界和后续功能缺口。
>
> 2026-07-03 口径更新:当前 runtime 已收口为 OpenHub / native agent + LightRAG + Turso/libSQL。知识库与 Page AI 融合方向以 LightRAG + OpenHub 为准;WeKnora 仅保留为历史设计、参考实现或可选备用 provider 边界,Hermes / Reasonix 仅保留 legacy/debug/外部工作流边界。旧 `/api/hermes/*`、`hermes_tools/*`、ACP runtime 命名属于历史命名或迁移中的兼容层,不代表当前产品定义。
## 1. 当前产品形态
当前项目口径固定为:
> **MNote = VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + OpenHub + LightRAG AI + simplemindmap / office 插件 + Wolai 主题 Web 壳 + 鉴权控制面。**
这意味着:
- 初步 MVP 已建立,后续不是继续证明 Rust Web、local-first 或 tiptap island 是否成立,而是收紧底座、减少 compat、补齐产品化闭环。
- 本地 workspace folder 是早期产品默认数据真相。
- 本地 `.md` 文件是页面正文真相;Page Aggregate、tiptap state、AI context 都是投影或工作副本。
- Rust kernel / projection / command 持有树、页面、资源和权限语义。
- tiptap 是 Markdown 的前端显示与交互层,不是 agent 的主工作面。
- OpenHub / native agent 默认应像 VSCode 中的 agent 一样,在授权目录白名单内用自身 patch / diff / 文件编辑能力修改文件。
- LightRAG + OpenHub 是当前默认知识库与 Page AI 融合方向;MNote 负责 source registry、权限、FileTree 灯号、dashboard/status UI 和 citation/open-reference 映射。WeKnora 仅保留为历史设计、参考实现或备用 provider 边界。
- Turso/libSQL control-plane 是默认 auth、membership、share grants、sync state、AI policy、OpenHub scope / AI policy 控制面;Convex / 服务端不再是默认正文、附件、AI 会话全文主存储,也不再是默认控制面,只保留历史迁移源、显式 cloud source、compat 和 sync replica 边界。旧 ACP/Hermes runtime session 属于迁移兼容层。
上位设计已完成并迁入:
- [2-2 local-first workspace 与 Convex 控制面降级方案](/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/done/2-2-local-first-workspace-convex-control-plane-v1.md)
- [2-8 Convex 替换为 Rust SQLite 控制面](/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/done/2-8-convex-replace-with-rust-sqlite-control-plane-v1.md)
- [2-9 Turso / libSQL 控制面切换](/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/process/2-9-turso-control-plane-cutover-v1.md)
## 2. 当前分层
### 2.1 Workspace / Storage
- `local_folder` 是默认 source`/mnt/Data1T/Mnote_data/users/<actor>/workspaces/my-space/` 是受管“我的空间”默认根。
- 管理员通过控制面授权用户可读写目录;普通用户不能自助获得全盘读写。
- 上传到本地 Markdown 页面时,图片和附件默认写入 sibling assets,例如 `README.assets/image.png`,正文保存相对 Markdown 链接。
- Convex source 仍可作为 cloud / compat / sync replica 或历史迁移源,但新增功能不能默认把 `documents.*``mediaAssets.*``aiSessions.*` 当主存储,也不能把根 Convex functions 重新作为默认控制面。
### 2.2 Rust Kernel / Projection
- `core-protocol` 定义树、资源、页面、AI access scope、page body write 等协议语义。
- `bridge-runtime``mnote-web` 负责把 LocalFS / Convex / future sync source 归一成稳定 projection 与 command。
- 前端只消费 `file_tree``page_tree``page_aggregate`、tree command result 和少量 editor runtime payload。
### 2.3 Web Shell / Editor
- `mnote-web` 是当前 3000 ownerNext / React 前端已退入 `recycle/`,只作为历史参考或 island bundle source。
- 文档页默认编辑 host 是页面内 `leptos-tiptap` island。
- 前端 runtime 已完成第一轮模块级拆分:浏览器 JS 功能默认从 `rust/crates/mnote-web/browser/*.js` 定位,tiptap island 行为默认从 `rust/spikes/leptos-tiptap-spike/src/editor_runtime/*.rs` 定位;`layout.rs` / `tree.rs` / `web_shell.rs` 主要保留 SSR/bootstrap/route/asset 注入职责,不再作为大型 raw string 功能入口。
- local source 正文保存主入口已收口到带文件版本的 `page.body.write` / `/api/page-body/write``/api/documents/save` 只作为 compat adapter。
- 文件 watcher 发现 agent / 外部编辑器写入后,clean editor 自动刷新,dirty editor 进入冲突态,不静默覆盖。
### 2.4 AI Runtime
- local-first 普通 Markdown 编辑主路径是:
```text
当前页面定位到真实 .md 文件
-> MNote 计算登录用户 allowed roots / current file / selection
-> OpenHub / native agent 在白名单目录内运行
-> agent 使用自身 patch / diff / 文件编辑能力写文件
-> MNote watcher / refresh 同步 Page Aggregate 与 tiptap
```
- `mnote.doc.fetch``mnote.doc.markdown_edit``mnote.doc.apply_block_ops``mnote.block.*``mnote.page.*` 保留为 cloud / remote agent / compat / 复杂结构辅助工具。
- `/api/page-ai/block-edit-workflow` 不再作为 local-first 普通正文编辑主路径。
- AI session 全文在 local source 下默认写入 `ai-sessions/private/*.jsonl``ai-sessions/shared/<share-id>/*.jsonl`OpenHub scope / AI policy 默认落到 Turso/libSQL control-plane;旧 ACP/Hermes runtime session 仅为迁移兼容层;Convex 只作为显式 legacy/cloud metadata / audit / sync replica 边界。
### 2.5 Knowledge RAG / LightRAG
- 知识库问答、资料 ingestion / query / citation / open-reference 当前主线为 LightRAG + OpenHub tool facade。
- MNote 不复制 provider 图谱或 chunk,不把 provider storage 当用户正文真相;原始 source 仍属于 local-folder / Resource Tree。
- MNote 维护 provider-neutral source registry,用于映射 `workspaceId/rootUri/sourcePath/sourceHash/providerDocId/stale/deletedAt/status`;历史 `lightRagDocId` 字段只作为兼容字段。
- FileTree 的资料库灯号来自 source registry:绿灯已索引、黄灯正在索引或删除提交中、红灯失败 / 过期、无灯未索引或已移除。
- LightRAG 相关 dashboard、status bridge、source registry 和 MCP bridge 是当前默认 provider 边界;WeKnora 仅作为备用 provider / 历史设计参考,不得被新增能力假设为默认存在。
- Agent 只通过 `mnote.knowledge_rag.status/query/open_reference` 访问知识库;旧 LiteParse、OCR sidecar、`mnote.evidence.*` 与本地资料索引工具已退役为历史 / recycle 边界。
### 2.6 Control-plane 后端
当前 control-plane 存储后端已抽象为 `ControlPlaneStore` traitmnote-web 运行时只允许 Turso/libSQL 系列后端:
- **TursoControlPlaneStore**`libsql`):mnote-web 运行时后端,支持 local libSQL、remote URL + token、local replica + sync、synced database。
- **SqliteControlPlaneStore**`rusqlite`):仅用于 `control-plane-admin` 迁移/导出和 Rust 测试隔离,不再作为 mnote-web runtime fallback。
- 启动时通过 `MNOTE_CONTROL_PLANE_BACKEND` 选择;默认 `libsql-local`,显式 `sqlite` 会被 mnote-web/dev-hot/desktop-hot/prod 启动链拒绝。
环境变量:
| 变量 | 用途 | 默认值 |
|------|------|--------|
| `MNOTE_CONTROL_PLANE_BACKEND` | 后端模式(libsql-local/turso-remote/turso-local-replica/turso-synced | `libsql-local` |
| `MNOTE_TURSO_LOCAL_PATH` | libSQL local 文件路径 | `/mnt/Data1T/Mnote_data/control-plane/control-plane-libsql.db` |
| `MNOTE_TURSO_DATABASE_URL` | Turso remote URL | — |
| `MNOTE_TURSO_AUTH_TOKEN` | Turso 认证 token | — |
| `MNOTE_TURSO_LOCAL_REPLICA_PATH` | Turso local replica 路径 | `/mnt/Data1T/Mnote_data/control-plane/control-plane-replica.db` |
| `MNOTE_TURSO_SYNCED_PATH` | libSQL synced 本地路径 | `/mnt/Data1T/Mnote_data/control-plane/control-plane-synced.db` |
| `MNOTE_TURSO_SYNC_INTERVAL_MS` | replica/synced 同步间隔 | 未设置 |
第一阶段**只迁移 control-plane 元数据**users、sessions、workspaces、directory grants、share links、
sync state、AI policy/runtime、audit),本地 `.md` / 附件 / mindmap / OnlyOffice 文件不迁入 Turso。
OpenHub 会话库后续作为单独阶段评估。
## 3. 已完成 MVP 收口
- Local-first workspace 上位设计和 checklist 已完成,迁入 `design/02-convex-rust-long-term-architecture/done/2-2-*`
- 3000 下文档页、Sidebar/File Tree/Page Tree、tree command preferred path、tree realtime WS 主链 / SSE fallback、本地上传下载、AI 会话本地化与 VSCode-like agent 运行口径已建立。
- `cargo fmt --check --all``local_folder`、legacy tool facade、local/shared AI session、local-first Convex guard、Convex export fixture、local asset upload smoke、external-change conflict smoke 均已作为 `2-2` 验收证据记录。
- 本地上传链路已避免 Convex media asset,落盘相对 Markdown 链接。
- 本地 AI 会话已区分 private / shared / cloud,并在 UI 上显示来源。
- Convex guard 已阻止 active 路径重新引入未标注的 Convex documents / media / aiSessions 默认主存储口径,并拦截根 `convex/` functions 源码回流默认控制面。
- Runtime 可维护收口已完成:`document-editor-adapter-runtime.js``sidebar-tree-runtime.js``tree-shell-runtime.js``leptos-tiptap-spike/src/lib.rs` 已拆到模块级,`mnote-web --lib``leptos-tiptap-spike --lib`、格式化、diff check 与 CodeGraph pending 0 已作为 `design/10-review/done/16-*` 的验收记录。
- 当前 smoke 分类与默认基线以 `scripts/TESTING_REFERENCE.md` 为准;默认入口是 `3000 Rust SSR + leptos-tiptap island + local-first workspace + Turso/libSQL control-plane auth`
## 4. MVP 后阶段功能缺口
1. **WorkspacePath / ObjectIdentity runtime 消费统一**
- 继续把本地路径、资源 identity、页面正文 `.md`、附件、mindmap、office 资源归属统一到 kernel / projection contract。
- 防止 UI、compat route 或临时文件逻辑重新生成第二套资源真相。
2. **DocumentBuffer / BufferStore**
- 让 tiptap、文件 watcher、agent 写入、冲突检测和页面 tab 共用打开态与文件版本仲裁。
- 避免 dirty editor、资源 tab、文件树点击之间各自维护状态。
3. **Page Aggregate compat 瘦身 / kernel-native projection**
- 继续退役 legacy `body.content` / compat join 边界。
- local-first 正文真相保持为 `.md` 文件,Page Aggregate 只输出稳定投影。
4. **tree command context / context key**
- 菜单、快捷键、按钮、AI 写入能力的 enablement 判断应收口到同一套 command context。
- 文件树和主编辑器右键菜单不能继续各自硬编码。
5. **tree live cache 统一**
- 把 local-folder watcher、projection refresh、WS/SSE snapshot/delta/resync 收进同一 live cache。
- 减少 polling 或重复补偿链。
6. **Runtime owner 剩余专项**
- `design/03-rust-web/reference/3-23-sidebar-local-folder-resource-runtime-followup-v1.md` 记录 local folder / resource 编排拆分后的参考边界;新的执行项应另起 process 稿。
- `design/07-ai/process/7-38-page-ai-sidebar-runtime-owner-split-v1.md` 继续承接 Page AI sidebar runtime owner 细化。
7. **管理员目录授权 UI / API**
- 需要把 `access-policy.json` 和当前 auth actor、admin grant、read/write/share 权限做成可管理界面。
- 管理员可授权任意 canonical 目录;普通用户只能访问自己的受管 my-space 或被授权目录。
8. **VSCode-like 冲突处理 UI**
- 当前已有 clean/dirty watcher 行为和冲突态 smoke。
- 还需要做可用的“接受磁盘版本 / 保留当前版本 / 打开 diff 合并”交互。
9. **agent 写入审计**
- local-first agent 应回收 changed files、diff summary、tool/run id、actor、workspace root、permission level。
- audit 默认本地落盘,同步开启时再上报控制面。
10. **本地轻量搜索与知识库 RAG 边界**
- 本地 `.md` workspace 需要独立索引:全文搜索、反链、页面引用、资源引用、标签。
- 不能依赖 Convex search 才能搜索本地工作区。
- 多资料 OCR / parse / index / RAG 不再由本地 evidence / LiteParse 承担,默认走 LightRAG providerWeKnora 仅备用。
11. **分享与同步闭环**
- 需要把 share grants、shared workspace cache、shared AI session、只读/可写权限和冲突处理连成产品级闭环。
- share grant 是产品层共享授权,local access grant 是本机目录授权;显式分享不能自动扩大本机 filesystem root 权限。
- 控制面不可用时不得扩大本地缓存权限。
12. **插件资源模型**
- simplemindmap / office 应作为 Resource Tree 对象打开和保存。
- Markdown 中只保留链接或嵌入引用,不把复杂对象强塞进普通正文块。
13. **旧 Convex 数据迁移产品化**
- 当前已有 fixture/offline 导出脚本。
- 后续需要真实 Convex workspace 导出入口、迁移进度、冲突报告、回滚/备份策略。
-`convex/` functions 源码已软删除到 `recycle/20260522-convex-runtime-retirement/convex/`,只作为审计和迁移对照素材。
## 5. 已退役或降级口径
以下说法不再作为当前主线:
- “Convex 是默认正文 / 附件 / AI 会话全文主存储。”
- “Convex 是默认 auth / membership / share / AI runtime 控制面。”
-`mnote.doc.markdown_edit` 是 local-first 普通 Markdown 编辑唯一主路径。”
- “页面 AI 必须走 `/api/page-ai/block-edit-workflow``mnote.block.*` 才能改正文。”
-`/api/documents/save` 是长期正文保存主入口。”
- “BlockNote 是当前默认编辑器或系统事实源。”
- “Next App Router / wolai-frontend 是 3000 主运行时。”
- “LiteParse / 本地 OCR sidecar / evidence search 仍是资料库 RAG 默认 fallback。”
- “MNote 需要为 LightRAG 结果再建一套 RAG 索引真相。”
- “WeKnora 是当前默认知识库 provider。”
- “Hermes / Reasonix 是当前 Page AI 默认 agent runtime。”
历史文件如果需要保留这些说法,必须明确标注为 `[recycle]`、legacy、review snapshot 或 compat / cloud source 背景。
-101
View File
@@ -1,101 +0,0 @@
# [LEGACY] MNOTE — Reasonix working knowledge
> 2026-06-28 覆盖说明:Reasonix / Hermes 已退出当前 MNote Page AI 主线,Agent runtime 与知识库融合方向已切到 OpenHub / opencode / WeKnora。本文保留为历史工作知识和迁移对照,不作为当前实现依据;新增工作应优先参考 `AGENTS.md`、`CURRENT_ARCHITECTURE.md` 和 `design/07-ai/process/7-68*` / `7-69*`。
## Current Baseline
- MNote 已进入 **local-first MVP 后阶段**:最小可用闭环已建立,后续重点是底座统一、compat 瘦身和产品化闭环。
- 产品形态固定为:`VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + OpenHub/opencode agent + WeKnora 知识库融合 + simplemindmap/office 插件 + Wolai 主题 Web 壳 + 鉴权控制面`
- 本地 workspace folder 是默认数据真相;本地 `.md` 是页面正文真相;Page Aggregate、tiptap state、AI context 都是投影或工作副本。
- Rust kernel / projection / command 持有树、页面、资源和权限语义;新增树规则不要散落到前端、Next route 或临时 compat 层。
- Rust SQLite control-plane 已承接默认 auth、membership、share grants、sync state、AI policy、Page AI runtime session 等控制面;Convex / 服务端不再是默认正文、附件、AI 会话全文主存储,只保留历史迁移源、显式 cloud source、compat 和 sync replica 边界。
- `mnote-web` 是当前 3000 owner;旧 Next / React / wolai-frontend 已移入 `recycle/`,默认不作为当前实现依据。
- 前端 runtime 已完成第一轮模块级拆分;查浏览器 JS 功能默认先看 `rust/crates/mnote-web/browser/*.js`,查 tiptap island 行为默认先看 `rust/spikes/leptos-tiptap-spike/src/editor_runtime/*.rs`。不要把 `layout.rs` / `tree.rs` / `web_shell.rs` 的历史 raw string 当作当前符号定位入口。
- Knowledge RAG 当前默认主线已切到 WeKnora / OpenHub 融合;LightRAG、LiteParse、旧 OCR sidecar、旧 evidence search / local-index agent tools 只保留为 legacy/debug/历史对照边界。MNote 负责 source registry、权限、FileTree 灯号、资料库 UI、dashboard/status 和 citation/open-reference。
## Stack
- **Rust** — workspace of 11 crates, edition 2021, resolver 2, wasm32 target (`rust/rust-toolchain.toml`)
- **Axum 0.8** — HTTP/WebSocket server in `mnote-web` crate
- **Leptos 0.8.14** — SSR island rendering in `mnote-web`
- **Convex 1.x** — retired root functions source plus optional cloud/compat/sync replica service boundary, not the default control plane or document/media/session full-text store
- **Playwright** — browser smoke tests in `scripts/task-*.js`
## Layout
| Path | Contents |
|------|----------|
| `rust/crates/mnote-web/` | Rust web gateway (axum + Leptos SSR, `:3000`) |
| `rust/crates/mnote-web/browser/` | Browser runtime modules for sidebar, filetree, document adapter, tree shell, Page AI panel host |
| `rust/crates/mnote-web/src/routes/knowledge_rag.rs` | MNote LightRAG connector routes: status, ingest, query, delete, prune, open-reference |
| `rust/crates/mnote-web/src/hermes_tools/knowledge_rag.rs` | Hermes / Reasonix-facing knowledge RAG tool facade |
| `rust/crates/core-protocol/` | Kernel types, projection protocol, tree/graph terms |
| `rust/crates/bridge-runtime/` | Kernel query/command, projection bridge, source normalization |
| `rust/spikes/leptos-tiptap-spike/src/editor_runtime/` | Leptos-tiptap island runtime modules; use before editing root `lib.rs` |
| `rust/crates/mnote-cli/` | CLI tool (`sidebar dataset`, `page get/create/title/save/move`, `block insert/patch`) |
| `rust/crates/storage-convex-bridge/` | Convex compat / cloud source / sync-replica bridge for Rust |
| `recycle/20260522-convex-runtime-retirement/convex/` | Retired root Convex functions source retained for audit / migration reference |
| `recycle/20260522-convex-runtime-retirement/infra/convex/` | Retired self-hosted Convex backend compose kept only for historical cloud/compat/sync-replica reference |
| `infra/onlyoffice/` | Docker Compose for OnlyOffice |
| `scripts/` | Node.js dev/build scripts + Playwright smoke tests |
| `design/` | Architecture design documents organized by domain |
| `bugs/` | Bug tracking mirroring design domain structure |
| `recycle/` | Retired code (old frontend, deprecated design drafts) |
## Commands
- **`npm run desktop:hot`** — hot-reload dev start (Rust gateway + optional FastAPI backend + optional Celery)
- **`npm run dev:hot`** — same but with `cargo-watch` for Rust auto-recompile
- **`npm run desktop`** — production start
- **`cargo test -p <crate>`** — test a specific Rust crate
- **`cargo run -p mnote-web --bin mnote-web`** — run the web server binary directly
- **`codegraph sync .`** — refresh CodeGraph after normal code changes
- **`codegraph index . --force`** — rebuild CodeGraph after large refactors, ignore-rule changes, or stale index behavior
## CodeGraph MCP
- Reasonix has `codegraph=codegraph serve --mcp` configured in `/home/lix/.reasonix/config.json`.
- Prefer CodeGraph for structural code questions: symbol lookup, definitions, callers/callees, impact analysis, and focused cross-file context.
- Use `codegraph_search` for symbol names, `codegraph_callers` / `codegraph_callees` for call flow, `codegraph_impact` before risky edits, `codegraph_context` for focused task context, and `codegraph_files` / `codegraph_status` for index inspection.
- Use native search only for literal text, comments, log messages, or after a specific file is already identified.
- Keep the project index fresh in development: run `codegraph sync .` after code changes; use `codegraph index . --force` when the index looks stale or after broad restructuring.
- Runtime split is the current CodeGraph baseline: JS functions should be found in `browser/*.js` and editor runtime symbols in `editor_runtime/*.rs`. If search results point to `recycle/`, historical design docs, or old Rust raw strings, treat them as historical context unless the task explicitly targets legacy code.
## Reasonix Worker Boundary
- Reasonix is a leaf worker, not a main controller.
- Do not start nested Reasonix runners, subagents, extra worktrees, or rewrite task prompts from inside a Reasonix task.
- Coding tasks must use an explicitly assigned write scope and report every modified file.
- Read-only and browser tasks must leave `modified_files` empty and prove it with `git status --short` / `git diff --stat`.
- Browser verification must produce the artifact contract from `design/07-ai/process/7-35-reasonix-browser-test-contract-v1.md`: `result.json`, `final.md`, handoff files, screenshots, console/network evidence, and environment preconditions.
- Codex/Hermes main controller accepts Reasonix output only after checking handoff/result files, diff, validation evidence, and current repo status. Natural-language conclusions without artifacts are leads, not verification.
## Reference-Code Comparison
- Reference implementations live under `/mnt/Data1T/mnote/reference-code/`; prefer `/mnt/Data1T/mnote/reference-code/sidex-main` for VSCode workbench comparisons because it contains the fuller `src/vs/workbench` tree, while `reference-code/vscode` is a smaller auxiliary snapshot.
- Compare one feature slice at a time, such as explorer open target, editor tabs, resource lifecycle, drag-and-drop ordering, keybindings, or overlay placement.
- Fast workflow: check `codegraph_status` for both projects, locate reference entry points with `codegraph_search/context`, inspect callers/callees, inspect the matching MNote chain, then map the result onto Rust kernel / `mnote-web` / frontend host boundaries.
- Always classify findings as: reusable interaction/state model, reference-only implementation detail, or incompatible with MNote local-first / tree-first architecture.
## Conventions
- **Local-first default**: start from Rust `mnote-web`, LocalFS/local_folder projection, Page Aggregate, File Tree, Resource Tree, and SQLite control-plane auth/session/actor. Use Convex paths only for explicit cloud source, compat, sync-replica, migration, or rollback work.
- **Smoke test pattern**: standalone Playwright scripts under `scripts/task-*.js` using a shared harness (`ensureAuthenticated`, `createTempDocument`, `cleanupDocuments`). All use `"use strict"` and `require("playwright")` (`scripts/task110-page-title-single-truth-smoke.js:1-4`).
- **Smoke baseline**: use `scripts/TESTING_REFERENCE.md` for current/compat/manual/retired classification. Default browser baseline is `3000 Rust SSR + leptos-tiptap island + local-first workspace + SQLite control-plane auth`.
- **Rust workspace**: edition 2021, resolver "2", MIT license. All crates inherit workspace version (`rust/Cargo.toml:2-8`).
- **Convex boundary**: root `convex/` has been retired to `recycle/20260522-convex-runtime-retirement/convex/`; `infra/convex/` has been retired to `recycle/20260522-convex-runtime-retirement/infra/convex/`; do not recreate either as an active deploy source without a new architecture decision. `recycle/wolai-frontend/convex` is also historical. Keep Rust `transport/convex.rs` and `storage-convex-bridge` as explicit cloud/compat boundaries; do not mechanically delete them with the retired functions source.
- **AI editing path**: local-first Markdown editing should prefer `currentFile + selection + allowedRoots / aiAccessScope + agent native patch/diff + watcher sync`. `mnote.doc.*` / `mnote.block.*` are cloud, remote, compat, or complex-structure helpers.
- **Knowledge RAG path**: use `mnote.knowledge_rag.status/query/open_reference` and `/api/knowledge-rag/*`. Do not use `mnote.evidence.*`, LiteParse, or local OCR sidecar as the default retrieval/indexing path. Image sources enter LightRAG through a Markdown wrapper; MNote status bridge/backoff syncs LightRAG background completion back to the registry and FileTree.
- **Bug tracking**: bugs organized by design domain directory (e.g. `bugs/04-tree-domain/process/`), moved to `done/` when fixed (`bugs/README.md`).
- **Design docs**: organized by domain in `design/`, with `process/` (in-progress) and `done/` (completed) subdirs (`design/README.md`).
## Watch out for
- **write_file path rule**: paths are sandbox-relative; leading `/` is stripped. Use `path: "design/..."` not `/mnt/Data1T/mnote/design/...`.
- **`.aionrs/`, `.claw/`, `.codex/`, `.gemini/`** — session data from other AI tools, not project code. Don't read or edit.
- **`recycle/`** — retired code, not current implementation. Don't use as evidence for current behavior.
- **Convex availability**: local-folder / Rust projection smoke should not require Convex. Auth, share grants, ACP/Hermes runtime state, and AI policy default to SQLite control-plane; Convex is required only for tests that explicitly cover legacy cloud source, compat, sync replica, migration, or rollback behavior.
- **LightRAG boundary**: LightRAG storage is derived cache, not user source truth. MNote registry is the mapping authority for source path, doc id, stale/deleted state, FileTree lights, and citation routing.
- **MVP 后阶段优先级**: prefer WorkspacePath/ObjectIdentity runtime consumption, DocumentBuffer/BufferStore, Page Aggregate compat slimming, tree command context/context key, live cache unification, agent diff audit, conflict merge, local lightweight search, and share/sync productization. Knowledge RAG belongs to LightRAG, not a revived local evidence/LiteParse index.
- **Rust wasm32 target** required (`rust/rust-toolchain.toml`), needed for `tree-shell-runtime-wasm` crate.
- **`rust/target/`** is gitignored and large — `cargo build` runs from scratch if cache is missing.
-1
View File
@@ -1 +0,0 @@
Total messages: 0 (Errors: 0, Warnings: 0)
View File
+4 -2
View File
@@ -1,10 +1,11 @@
# bugs 缺陷索引 # bugs 缺陷索引
> 更新时间:2026-05-12 > 更新时间:2026-07-19
> >
> 状态口径以当前仓库真实代码与真实验证结果为准: > 状态口径以当前仓库真实代码与真实验证结果为准:
> - `[done]`:问题已修复,且已通过代码、smoke、浏览器或截图证据验证 > - `[done]`:问题已修复,且已通过代码、smoke、浏览器或截图证据验证
> - `[process]`:问题已确认存在,仍在修复、验证或等待收口 > - `[process]`:问题已确认存在,仍在修复、验证或等待收口
> - `[recycle]`:问题依赖已退役架构或已被后续主线覆盖,仅保留审计证据,统一归档到 `bugs/old/`
## 分类方式 ## 分类方式
@@ -17,7 +18,7 @@
- `05-editor-mainline/` - `05-editor-mainline/`
- `06-mindmap/` - `06-mindmap/`
- `07-ai/` - `07-ai/`
- 每个大类继续按 `process/``done/` 分层。 - 每个大类继续按 `process/``done/` 分层;已退役或不再适用当前主线的记录移至 `bugs/old/<大类>/<状态>/`
## 归类原则 ## 归类原则
@@ -31,4 +32,5 @@
- 新确认的缺陷先进入对应大类的 `process/` - 新确认的缺陷先进入对应大类的 `process/`
- 缺陷在真实代码中修复并完成对应验证后,必须移动到对应大类的 `done/` - 缺陷在真实代码中修复并完成对应验证后,必须移动到对应大类的 `done/`
- 不允许在 `process/``done/` 同时保留同一条缺陷。 - 不允许在 `process/``done/` 同时保留同一条缺陷。
- `bugs/old/` 中的记录不得作为新增实现、测试或架构判断依据;标题必须标记 `[recycle]`
- 若后续发现旧缺陷记录归类错误,应直接迁移到正确大类,而不是在错误大类继续追加。 - 若后续发现旧缺陷记录归类错误,应直接迁移到正确大类,而不是在错误大类继续追加。
@@ -1,4 +1,4 @@
# 3-19 [done][bug] Reasonix ACP wrapper 调 mnote tool 缺少身份与幂等字段 v1 # [recycle] 3-19 [done][bug] Reasonix ACP wrapper 调 mnote tool 缺少身份与幂等字段 v1
> 发现时间:2026-05-17 > 发现时间:2026-05-17
> >
@@ -1,4 +1,4 @@
# 3-20 [done][bug] ACP incoming request 只记录日志不响应 v1 # [recycle] 3-20 [done][bug] ACP incoming request 只记录日志不响应 v1
> 发现时间:2026-05-17 > 发现时间:2026-05-17
> >
@@ -1,4 +1,4 @@
# 3-21 [done][bug] ACP run payload 被第一次 stream_events 消费后移除 v1 # [recycle] 3-21 [done][bug] ACP run payload 被第一次 stream_events 消费后移除 v1
> 发现时间:2026-05-17 > 发现时间:2026-05-17
> >
@@ -1,4 +1,4 @@
# 3-22 [done][bug] ACP permission 自动拒绝后 UI 仍展示审批动作 # [recycle] 3-22 [done][bug] ACP permission 自动拒绝后 UI 仍展示审批动作
> 发现时间:2026-05-18 > 发现时间:2026-05-18
> >
@@ -1,4 +1,4 @@
# MNote 浏览器 QA 实测发现 2026-07-08 # [recycle] MNote 浏览器 QA 实测发现 2026-07-08
- **状态**`process` - **状态**`process`
- **来源**Agent Board Pi Taskflow 实测(MNote 浏览器 QA → Bug 文档 20260708-130503 - **来源**Agent Board Pi Taskflow 实测(MNote 浏览器 QA → Bug 文档 20260708-130503
@@ -1,4 +1,4 @@
# 7-1 [done] 页面 AI provider=hermes 仍命中旧 run route 导致 502 # [recycle] 7-1 [done] 页面 AI provider=hermes 仍命中旧 run route 导致 502
## 现象 ## 现象
@@ -1,4 +1,4 @@
# 7-19 [done][bug] Hermes 工具指导仍优先 apply_block_ops 而非 markdown_edit v1 # [recycle] 7-19 [done][bug] Hermes 工具指导仍优先 apply_block_ops 而非 markdown_edit v1
> 发现时间:2026-05-17 > 发现时间:2026-05-17
> >
@@ -1,4 +1,4 @@
# 7-20 [done][bug] page_ai_workflow 绕过 Hermes tool executor / audit / toggle v1 # [recycle] 7-20 [done][bug] page_ai_workflow 绕过 Hermes tool executor / audit / toggle v1
> 发现时间:2026-05-17 > 发现时间:2026-05-17
> >
@@ -1,4 +1,4 @@
# 7-25 [done][bug] ACP Reasonix 页面 AI block_edit_workflow 在 markdown 命中后生成空 block_ops v1 # [recycle] 7-25 [done][bug] ACP Reasonix 页面 AI block_edit_workflow 在 markdown 命中后生成空 block_ops v1
> 发现时间:2026-05-17 > 发现时间:2026-05-17
> >
@@ -1,4 +1,4 @@
# 7-31 [done][bug] 页面 AI block_edit_workflow 丢弃读取类回答摘要 v1 # [recycle] 7-31 [done][bug] 页面 AI block_edit_workflow 丢弃读取类回答摘要 v1
> 发现时间:2026-05-18 > 发现时间:2026-05-18
> >
@@ -1,4 +1,4 @@
# 7-34 [done][bug] 页面 AI ACP Runtime 默认值回跳 Hermes v1 # [recycle] 7-34 [done][bug] 页面 AI ACP Runtime 默认值回跳 Hermes v1
> 发现时间:2026-05-18 > 发现时间:2026-05-18
> >
@@ -1,4 +1,4 @@
# Browser QA needs-more-info # [recycle] Browser QA needs-more-info
- workflow_run_id: d7585a30-63cd-4201-a3c5-47e9e34b0773 - workflow_run_id: d7585a30-63cd-4201-a3c5-47e9e34b0773
- status: needs-more-info - status: needs-more-info
@@ -1,4 +1,4 @@
# Browser QA needs-more-info # [recycle] Browser QA needs-more-info
- workflow_run_id: fcaefa85-5cb9-45d6-b238-4d52cca03e97 - workflow_run_id: fcaefa85-5cb9-45d6-b238-4d52cca03e97
- status: needs-more-info - status: needs-more-info
@@ -2,7 +2,7 @@
> 更新时间:2026-04-16 > 更新时间:2026-04-16
> >
> 当前状态:`reference`。本文保留 kernel 分阶段全景与历史状态口径;当前执行顺序以 `design/01-tree-first-graph-kernel/process/1-8-mvp-post-process-execution-order-v1.md` 为准。 > 当前状态:`reference`。本文保留 kernel 分阶段全景与历史状态口径;当前执行顺序以 `design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md` 为准。
> >
> 基于以下实际状态重写: > 基于以下实际状态重写:
> - 当前未提交代码 > - 当前未提交代码
@@ -27,7 +27,7 @@
> 说明(2026-04-22): > 说明(2026-04-22):
> 这份清单仍保留为 `Kernel Phase` 全景参考,但当前第一优先级已经转移到 > 这份清单仍保留为 `Kernel Phase` 全景参考,但当前第一优先级已经转移到
> `Page Aggregate`、`tree command cutover`、`tree realtime event stream`。 > `Page Aggregate`、`tree command cutover`、`tree realtime event stream`。
> 当前执行优先级请先看 `/mnt/Data1T/mnote/design/01-05-current-priority-overview.md`。 > 当前执行优先级请先看 `/mnt/Data1T/mnote/design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`。
--- ---
@@ -8,7 +8,7 @@
> >
> 关联: > 关联:
> - `design/01-05-current-priority-overview.md` > - `design/01-05-current-priority-overview.md`
> - `design/10-review/done/11-current-full-architecture-review-v1.md` > - `design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`
> - `CURRENT_ARCHITECTURE.md` > - `CURRENT_ARCHITECTURE.md`
> - `design/11-wolai/help-center-reference.md` — Wolai 帮助中心功能对照基准 > - `design/11-wolai/help-center-reference.md` — Wolai 帮助中心功能对照基准
@@ -4,13 +4,12 @@
> >
> 当前状态:`reference` > 当前状态:`reference`
> >
> 归档说明(2026-05-22):本文保留下一阶段路线推导;当前可执行入口已收敛到 `design/01-tree-first-graph-kernel/process/1-8-mvp-post-process-execution-order-v1.md`,不再从本文直接派发实现。 > 归档说明(2026-07-19):本文保留下一阶段路线推导;当前可执行入口已收敛到 `design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`,不再从本文直接派发实现。
> >
> 上位依据: > 上位依据:
> - `/mnt/Data1T/mnote/design/01-tree-first-graph-kernel/done/1-3-current-priority-execution-checklist-v1.md` > - `/mnt/Data1T/mnote/design/01-tree-first-graph-kernel/done/1-3-current-priority-execution-checklist-v1.md`
> - `/mnt/Data1T/mnote/design/05-editor-mainline/reference/5-14-zed-lapce-vscode-reference-adoption-matrix-v1.md` > - `/mnt/Data1T/mnote/design/05-editor-mainline/reference/5-14-zed-lapce-vscode-reference-adoption-matrix-v1.md`
> - `/mnt/Data1T/mnote/CURRENT_ARCHITECTURE.md` > - `/mnt/Data1T/mnote/ARCHITECTURE.md``CURRENT_ARCHITECTURE.md` 为兼容指针)
> - `/mnt/Data1T/mnote/ARCHITECTURE.md`
> >
> 目标:把当前已经推进到混合态的主线,收口成一条更清晰的下一阶段路线,避免“功能继续堆、底座继续散”的问题。 > 目标:把当前已经推进到混合态的主线,收口成一条更清晰的下一阶段路线,避免“功能继续堆、底座继续散”的问题。
@@ -2,10 +2,10 @@
> 更新时间:2026-04-22 > 更新时间:2026-04-22
> >
> 当前状态:`reference`。本文是 tree-first graph kernel 的长期架构边界,不是当前可直接执行的 checklist;执行入口见 `design/01-tree-first-graph-kernel/process/1-8-mvp-post-process-execution-order-v1.md`。 > 当前状态:`reference`。本文是 tree-first graph kernel 的长期架构边界,不是当前可直接执行的 checklist;执行入口见 `design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`。
> >
> 当前优先级入口: > 当前优先级入口:
> - `/mnt/Data1T/mnote/design/01-05-current-priority-overview.md` > - `/mnt/Data1T/mnote/design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`
> >
> 关联文档: > 关联文档:
> - `/mnt/Data1T/mnote/design/03-rust-web/reference/3-rust-web-long-term-architecture-v1.md` > - `/mnt/Data1T/mnote/design/03-rust-web/reference/3-rust-web-long-term-architecture-v1.md`
@@ -7,8 +7,7 @@
> 目标:在接受 Turso / libSQL Beta 与云服务风险的前提下,把 MNote 当前 Rust SQLite 控制面切换到 Turso / libSQL 后端,降低多个进程直接写同一个 SQLite 文件带来的损坏风险,并为后续云同步、审计、权限和 AI 控制面维护提供更稳的存储边界。 > 目标:在接受 Turso / libSQL Beta 与云服务风险的前提下,把 MNote 当前 Rust SQLite 控制面切换到 Turso / libSQL 后端,降低多个进程直接写同一个 SQLite 文件带来的损坏风险,并为后续云同步、审计、权限和 AI 控制面维护提供更稳的存储边界。
> >
> 上位依据: > 上位依据:
> - `/mnt/Data1T/mnote/ARCHITECTURE.md` > - `/mnt/Data1T/mnote/ARCHITECTURE.md``CURRENT_ARCHITECTURE.md` 为兼容指针)
> - `/mnt/Data1T/mnote/CURRENT_ARCHITECTURE.md`
> - `/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/done/2-2-local-first-workspace-convex-control-plane-v1.md` > - `/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/done/2-2-local-first-workspace-convex-control-plane-v1.md`
> - `/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/done/2-8-convex-replace-with-rust-sqlite-control-plane-v1.md` > - `/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/done/2-8-convex-replace-with-rust-sqlite-control-plane-v1.md`
@@ -2,7 +2,7 @@
> 更新时间:2026-05-09 > 更新时间:2026-05-09
> >
> 当前状态:`reference`。本文保留 Rust Web 长期架构边界;当前实现队列以 `design/01-tree-first-graph-kernel/process/1-8-mvp-post-process-execution-order-v1.md` 和对应 `done/` 证据为准。 > 当前状态:`reference`。本文保留 Rust Web 长期架构边界;当前实现队列以 `design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md` 和对应 `done/` 证据为准。
> >
> 相关文档: > 相关文档:
> - `/mnt/Data1T/mnote/ARCHITECTURE.md` > - `/mnt/Data1T/mnote/ARCHITECTURE.md`
@@ -5,7 +5,7 @@
> 当前状态:`reference`。本文是参考实现采用矩阵,不是当前执行 checklist;具体实现任务应拆到对应 domain 的 process/done 文档。 > 当前状态:`reference`。本文是参考实现采用矩阵,不是当前执行 checklist;具体实现任务应拆到对应 domain 的 process/done 文档。
> >
> 关联背景: > 关联背景:
> - `/mnt/Data1T/mnote/CURRENT_ARCHITECTURE.md` > - `/mnt/Data1T/mnote/ARCHITECTURE.md``CURRENT_ARCHITECTURE.md` 为兼容指针)
> - `/mnt/Data1T/mnote/design/05-editor-mainline/reference/5-5-page-aggregate-single-truth-alignment-v1.md` > - `/mnt/Data1T/mnote/design/05-editor-mainline/reference/5-5-page-aggregate-single-truth-alignment-v1.md`
> - `/mnt/Data1T/mnote/design/05-editor-mainline/done/5-6-page-aggregate-alignment-checklist-v1.md` > - `/mnt/Data1T/mnote/design/05-editor-mainline/done/5-6-page-aggregate-alignment-checklist-v1.md`
> - `/mnt/Data1T/mnote/design/old/07-ai/process/7-14-local-first-ai-markdown-editing-convergence-v1.md` > - `/mnt/Data1T/mnote/design/old/07-ai/process/7-14-local-first-ai-markdown-editing-convergence-v1.md`
@@ -4,14 +4,14 @@
> >
> 当前状态:`done` > 当前状态:`done`
> >
> 2026-07-03 口径回正:当前 runtime 已回到 OpenHub / native agent + LightRAG + Turso/libSQL。本文重新作为当前默认 LightRAG provider 的 DOCX 引用与定位合同基线;此前 `7-68 OpenHub + WeKnora + MNote Page AI 深度融合` 中将 WeKnora 设为默认 provider 的口径已标记 stale > 2026-07-19 口径回正:当前 runtime 是 Pi Rust Page AI + LightRAG + Turso/libSQL。本文保留为当前默认 LightRAG provider 的 DOCX 引用与定位合同基线;WeKnora 仅为历史/备用边界
> >
> Owner07-ai / knowledge-rag / 03-rust-web / office-preview > Owner07-ai / knowledge-rag / 03-rust-web / office-preview
> >
> 关联: > 关联:
> - `design/07-ai/done/7-50-lightrag-knowledge-rag-provider-v1.md` > - `design/07-ai/done/7-50-lightrag-knowledge-rag-provider-v1.md`
> - `design/07-ai/done/7-51-lightrag-post-commit-hardening-v1.md` > - `design/07-ai/done/7-51-lightrag-post-commit-hardening-v1.md`
> - `design/07-ai/process/7-54-raganything-multimodal-retrieval-alignment-v1.md` > - `design/07-ai/reference/7-54-raganything-multimodal-retrieval-alignment-v1.md`
> >
> 参考代码: > 参考代码:
> - LightRAG`/mnt/Data1T/Mnote_data/lightrag/LightRAG` > - LightRAG`/mnt/Data1T/Mnote_data/lightrag/LightRAG`
@@ -1,18 +1,15 @@
# 7-18 [process] local-first agent 文件编辑控制面 v1 # 7-18 [process] local-first agent 文件编辑控制面 v1
> 2026-07-03 口径更新:本文中的 Hermes / Reasonix 主路径口径已退为历史参考。当前 Page AI / agent runtime 主线以 OpenHub / native agent + LightRAG + Turso/libSQL 为准;`7-68-openhub-weknora-mnote-deep-fusion-v1.md` 与 `7-69-weknora-native-embed-mnote-openhub-governance-v1.md` 的 WeKnora 默认 provider 口径已标记 stale。本文保留 local-first 文件授权、watcher 同步冲突模型的参考价值 > 2026-07-18 口径更新:当前 Page AI / agent runtime 主线是 Pi Rust Page AI + LightRAG + Turso/libSQL。本文保留并推进 local-first 文件授权、watcher/BufferStore 同步冲突模型与审计回收;Hermes / Reasonix / OpenHub 仅作为兼容与历史证据,不作为实现入口
> 创建时间:2026-05-22 > 创建时间:2026-05-22
> >
> 当前状态:`PROCESS` > 当前状态:`PROCESS`
> >
> 上位依据: > 上位依据:
> - `/mnt/Data1T/mnote/ARCHITECTURE.md` > - `/mnt/Data1T/mnote/ARCHITECTURE.md``CURRENT_ARCHITECTURE.md` 为兼容指针)
> - `/mnt/Data1T/mnote/CURRENT_ARCHITECTURE.md` > - `/mnt/Data1T/mnote/design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`
> - `/mnt/Data1T/mnote/design/01-tree-first-graph-kernel/process/1-8-mvp-post-process-execution-order-v1.md`
> - `/mnt/Data1T/mnote/design/05-editor-mainline/done/5-6-page-aggregate-alignment-checklist-v1.md` > - `/mnt/Data1T/mnote/design/05-editor-mainline/done/5-6-page-aggregate-alignment-checklist-v1.md`
> - `/mnt/Data1T/mnote/design/07-ai/done/7-15-page-ai-acp-agent-runtime-unified-layer-v1.md`
> - `/mnt/Data1T/mnote/design/07-ai/reference/7-12-page-ai-hermes-tool-routing-and-review-surface-v1.md`
> >
> 覆盖旧稿:`/mnt/Data1T/mnote/design/old/07-ai/process/7-14-local-first-ai-markdown-editing-convergence-v1.md` > 覆盖旧稿:`/mnt/Data1T/mnote/design/old/07-ai/process/7-14-local-first-ai-markdown-editing-convergence-v1.md`
> >
@@ -31,7 +28,7 @@ MNote 在 local-first 下只提供:
- agent runtime session、审计、changed files / diff 回收。 - agent runtime session、审计、changed files / diff 回收。
- watcher、BufferStore、Page Aggregate、ProseMirror 前台同步。 - watcher、BufferStore、Page Aggregate、ProseMirror 前台同步。
Hermes / Reasonix 是已知 agent使用自身文件 read / write / patch / diff 能力在授权目录内完成普通 `.md` 编辑。 Pi Rust Page AI 使用自身文件 read / write / patch / diff 能力在授权目录内完成普通 `.md` 编辑。
## 2. 明确退役项 ## 2. 明确退役项
@@ -67,7 +64,7 @@ Page / active editor
-> resolve canonical .md file / resource file -> resolve canonical .md file / resource file
-> build AiAccessScope -> build AiAccessScope
-> freeze allowed roots / allowed files / readonly / dirty / selection -> freeze allowed roots / allowed files / readonly / dirty / selection
-> start Hermes / Reasonix run with file refs and context -> start Pi Rust Page AI run with file refs and context
-> agent native patch / diff / write inside allowed roots -> agent native patch / diff / write inside allowed roots
-> MNote collects changed files / diff / audit -> MNote collects changed files / diff / audit
-> watcher observes file changes -> watcher observes file changes
@@ -287,7 +284,7 @@ Rust SQLite control-plane 是默认控制面,负责:
### Phase A:运行时输入与权限边界 ### Phase A:运行时输入与权限边界
- [ ] 从文档页发起 Hermes / Reasonix run 时,request body 包含 `currentFile``allowedRoots``allowedFiles`、selection 和 dirty / readonly context。 - [ ] 从文档页发起 Pi Rust Page AI run 时,request body 包含 `currentFile``allowedRoots``allowedFiles`、selection 和 dirty / readonly context。
- [ ] run body 包含 `targetPackage`,且 `allowedRoots` / `allowedFiles` 从 targetPackage 推导。 - [ ] run body 包含 `targetPackage`,且 `allowedRoots` / `allowedFiles` 从 targetPackage 推导。
- [x] local-first 普通 Markdown 编辑 run 不包含 `mnote.doc.markdown_edit` 推荐工具。 - [x] local-first 普通 Markdown 编辑 run 不包含 `mnote.doc.markdown_edit` 推荐工具。
- [ ] allowed roots 外文件写入被 agent runtime 或 MNote 审计层拒绝。 - [ ] allowed roots 外文件写入被 agent runtime 或 MNote 审计层拒绝。
@@ -4,9 +4,19 @@
Owner07-ai / mnote-web / control-plane Owner07-ai / mnote-web / control-plane
日期:2026-07-03 日期:2026-07-03
## 0. 口径修订(2026-07-18
> **覆盖本稿原「保留 OpenHub 生产基线 / Pi 不作为默认入口」结论。**
- 代码已默认 `enable_page_ai_pi_lab=true``MNOTE_PAGE_AI_PI_LAB`)。
- OpenHub / Pi TS 已退役到 recycle 边界,不再是生产基线。
- 当前 Page AI 默认主链为 **Pi Rust + LightRAG + Turso/libSQL control-plane**
- 本稿后续只承接 Pi Lab **去 spike / 产品化**(持久化、模块拆分、命名),不再要求「保留 OpenHub 主线」。
- 上位收口:`design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`
## 1. 结论 ## 1. 结论
本稿确认一个新方向:**保留 OpenHub 作为当前生产基线,同时新开 Pi-first Page AI Lab,验证 Pi 是否能成为 MNote-native Page AI runtime** 本稿确认方向:**保留 OpenHub 作为生产基线,同时新开 Pi-first Page AI Lab**。该「双主线」结论已被 2026-07-18 口径修订覆盖;以下历史正文仅作背景,实施以 §0 与 checklist 21 为准
这里的 Pi 指当前官方仓库 `earendil-works/pi` / 旧 `badlogic/pi-mono`,当前 npm 主包已迁到 `@earendil-works/*`。本轮重新拉取的源码证据位于: 这里的 Pi 指当前官方仓库 `earendil-works/pi` / 旧 `badlogic/pi-mono`,当前 npm 主包已迁到 `@earendil-works/*`。本轮重新拉取的源码证据位于:
@@ -16,11 +26,11 @@ Owner07-ai / mnote-web / control-plane
Pi 不是 OpenHub 的直接替代品,但它是当前最值得优先 spike 的底层候选。原因是:Pi 已经具备 coding agent、RPC、session tree、tool event、extension / skill / package、provider auth、多模型和可扩展工具体系;这些比通用 UI 框架更贴近 MNote 的 local-first Page AI 目标。 Pi 不是 OpenHub 的直接替代品,但它是当前最值得优先 spike 的底层候选。原因是:Pi 已经具备 coding agent、RPC、session tree、tool event、extension / skill / package、provider auth、多模型和可扩展工具体系;这些比通用 UI 框架更贴近 MNote 的 local-first Page AI 目标。
硬边界: 硬边界2026-07-18 修订)
- 不替换当前 OpenHub 主线。 - ~~不替换当前 OpenHub 主线。~~ → OpenHub 已退役;Pi Rust 为默认 Page AI。
- 不把 Pi Lab 作为默认 Page AI 入口。 - ~~不把 Pi Lab 作为默认 Page AI 入口。~~ → 默认开启;「Lab」仅为入口名。
- 不把 Pi JSONL session 直接当作 MNote 长期会话真相。 - 不把 Pi JSONL session 直接当作 MNote 长期会话真相(元数据走 control-plane
- 不绕过 MNote `AiAccessScope` / allowed roots / Turso control-plane。 - 不绕过 MNote `AiAccessScope` / allowed roots / Turso control-plane。
- 不把第三方 Pi package 当成已验收能力;每个第三方包必须通过本地 smoke 后才能纳入。 - 不把第三方 Pi package 当成已验收能力;每个第三方包必须通过本地 smoke 后才能纳入。
@@ -6,11 +6,11 @@ Owner07-ai / mnote-web / control-plane / Page AI
## 1. 结论 ## 1. 结论
应该做 MNote 原生统一 AI 管理面板,但顺序不是先堆 UI,而是先把 control-plane 合同、持久化和 effective config API 做成唯一真相,再让 Pi Lab / OpenHub / LightRAG 消费同一套配置。 应该做 MNote 原生统一 AI 管理面板,但顺序不是先堆 UI,而是先把 control-plane 合同、持久化和 effective config API 做成唯一真相,再让 **Pi Rust Page AI / LightRAG** 消费同一套配置。
文件夹授权必须只有一套:当前 `/admin/access-policy``/user/access-policy` 管理的 `directory_grants` 同时就是 MNote 工作区访问授权和 AI `allowed roots` 的事实源。AI 管理面板可以把它纳入同一个信息架构,但不能再维护第二套 AI-only allowed roots。 文件夹授权必须只有一套:当前 `/admin/access-policy``/user/access-policy` 管理的 `directory_grants` 同时就是 MNote 工作区访问授权和 AI `allowed roots` 的事实源。AI 管理面板可以把它纳入同一个信息架构,但不能再维护第二套 AI-only allowed roots。
OpenHub 的 admin 面板证明了正确产品结构:provider/model、skills、tools、MCP、目录权限、知识库、历史、用量、健康状态必须先有管理面,聊天 UI 只展示用户可用的有效配置。MNote 不能把 OpenHub admin 作为 MNote AI 的长期真相,因为 OpenHub 仍是独立默认 Page AI 主线Pi Lab 是 MNote-native 新入口,二者后续可能任意退役。MNote AI 管理中心应落在 Turso/libSQL control-plane。 OpenHub 的 admin 面板(历史)证明了正确产品结构:provider/model、skills、tools、MCP、目录权限、知识库、历史、用量、健康状态必须先有管理面,聊天 UI 只展示用户可用的有效配置。MNote 不能把 OpenHub admin 作为 MNote AI 的长期真相。**2026-07-18OpenHub 已不再是默认 Page AI 主线Pi Rust 为默认入口。** MNote AI 管理中心应落在 Turso/libSQL control-plane。上位收口见 checklist 21。
## 2. 调研依据 ## 2. 调研依据
@@ -41,7 +41,6 @@ OpenHub 的 admin 面板证明了正确产品结构:provider/model、skills、
源码: 源码:
- `earendil-works-pi-web-ui-0.75.3.tgz`
- `/mnt/Data1T/tmp/pi-web-ui-shot/node_modules/@earendil-works/pi-web-ui/src/` - `/mnt/Data1T/tmp/pi-web-ui-shot/node_modules/@earendil-works/pi-web-ui/src/`
- `/mnt/Data1T/tmp/pi-web-ui-shot/node_modules/@earendil-works/pi-agent-core/dist/` - `/mnt/Data1T/tmp/pi-web-ui-shot/node_modules/@earendil-works/pi-agent-core/dist/`
- `rust/crates/mnote-web/src/routes/page_ai_pi.rs` - `rust/crates/mnote-web/src/routes/page_ai_pi.rs`
@@ -9,7 +9,7 @@
> 范围:3000 主壳中的知识库 / RAG / OCR 状态面板、FileTree 知识库状态灯、当前页面附件索引入口、Page AI 对知识库状态的可见性。 > 范围:3000 主壳中的知识库 / RAG / OCR 状态面板、FileTree 知识库状态灯、当前页面附件索引入口、Page AI 对知识库状态的可见性。
> >
> 上位依据: > 上位依据:
> - `/mnt/Data1T/mnote/CURRENT_ARCHITECTURE.md` > - `/mnt/Data1T/mnote/ARCHITECTURE.md``CURRENT_ARCHITECTURE.md` 为兼容指针)
> - `/mnt/Data1T/mnote/design/07-ai/done/7-50-lightrag-knowledge-rag-provider-v1.md` > - `/mnt/Data1T/mnote/design/07-ai/done/7-50-lightrag-knowledge-rag-provider-v1.md`
> - `/mnt/Data1T/mnote/design/07-ai/done/7-51-lightrag-post-commit-hardening-v1.md` > - `/mnt/Data1T/mnote/design/07-ai/done/7-51-lightrag-post-commit-hardening-v1.md`
> - `/mnt/Data1T/mnote/design/07-ai/done/7-52-lightrag-image-ocr-search-chain-hardening-v1.md` > - `/mnt/Data1T/mnote/design/07-ai/done/7-52-lightrag-image-ocr-search-chain-hardening-v1.md`
@@ -17,7 +17,7 @@
> - `/mnt/Data1T/mnote/design/07-ai/process/7-18-local-first-agent-file-editing-control-plane-v1.md` > - `/mnt/Data1T/mnote/design/07-ai/process/7-18-local-first-agent-file-editing-control-plane-v1.md`
> - `/mnt/Data1T/mnote/design/07-ai/done/7-40-page-ai-context-envelope-and-run-receipt-v1.md` > - `/mnt/Data1T/mnote/design/07-ai/done/7-40-page-ai-context-envelope-and-run-receipt-v1.md`
> >
> 参考项目:`reference-code/PageIndex`、`reference-code/BookRAG`、`reference-code/Kwipu`、`reference-code/ladybug`、`reference-code/seekdb` 均已单独建 CodeGraph本文只吸收架构和合同,不把这些项目整体引入运行时。 > 参考项目:`reference-code/PageIndex`、`reference-code/BookRAG`、`reference-code/Kwipu`、`reference-code/ladybug` 曾用于架构取证;`seekdb` 本地副本已在 2026-07 清理。本文只保留架构和合同结论,不把这些项目整体引入运行时。
## 1. 第一结论 ## 1. 第一结论
@@ -9,11 +9,11 @@
> >
> Owner07-ai / 03-rust-web / control-plane / 01-tree-first-graph-kernel > Owner07-ai / 03-rust-web / control-plane / 01-tree-first-graph-kernel
> >
> 参考项目:`/mnt/Data1T/mnote/reference-code/paperless-ngx` > 参考项目:Paperless-ngx 本地副本已在 2026-07 清理;本文保留其已提炼的设计结论,不依赖本地源码。
> >
> 参考版本:`f56f29111` > 参考版本:`f56f29111`
> >
> CodeGraph已单独建立,`712 files / 16,952 nodes / 35,407 edges` > CodeGraph历史取证时曾单独建立索引;本地参考副本已清理。
> >
> 上位依据: > 上位依据:
> - `/mnt/Data1T/mnote/ARCHITECTURE.md` > - `/mnt/Data1T/mnote/ARCHITECTURE.md`
@@ -1,10 +1,10 @@
# 7-54 RAG-Anything 对照后的多模态检索设计 v1 # 7-54 RAG-Anything 对照后的多模态检索设计 v1
> 2026-06-28 覆盖说明:本文围绕 LightRAG 增强撰写,已被 WeKnora / OpenHub 知识库主线覆盖。保留为多模态检索参考材料,不作为当前实施依据 > 2026-07-19 归类说明:当前知识库主线是 LightRAG + Pi Rust Page AI。本文保留为多模态索引与失败模式的参考材料,不作为当前可直接执行的实施稿
> 创建时间:2026-06-08 > 创建时间:2026-06-08
> >
> 当前状态:`process` > 当前状态:`reference`
> >
> Owner07-ai / 03-rust-web / knowledge-rag / search > Owner07-ai / 03-rust-web / knowledge-rag / search
> >
@@ -2,7 +2,7 @@
> 更新时间:2026-05-11 > 更新时间:2026-05-11
> >
> 当前状态:`reference`。本文只保留思源参考边界与可借鉴能力,不覆盖 `CURRENT_ARCHITECTURE.md` / `1-8` 当前口径,也不作为当前执行 checklist。 > 当前状态:`reference`。本文只保留思源参考边界与可借鉴能力,不覆盖 `ARCHITECTURE.md` 当前口径,也不作为当前执行 checklist。
> >
> 上位依据: > 上位依据:
> - `/mnt/Data1T/mnote/ARCHITECTURE.md` > - `/mnt/Data1T/mnote/ARCHITECTURE.md`
+19 -19
View File
@@ -1,35 +1,35 @@
# 10-review 审查总览 # 10-review 审查总览
> 执行状态:`done/01``done/11` 均已归档;当前无活跃 10-review process 文档 > 执行状态:当前活跃 process 为 `21`;依赖 Convex、Hermes/Reasonix/ACP、OpenHub 或旧 tree shell 的审查已迁入 `design/old/10-review/`
当前活跃审查 ## 当前活跃审查
- 暂无。 - [21 MVP 后架构收口 Checklist](./process/21-mvp-post-architecture-closure-checklist-v1.md)
最新归档审查: 目标:在全面进入优化 / debug 之前,锁定唯一主链(Pi Rust + LightRAG + Turso control-plane)、消除文档漂移、完成 Pi Lab 去 spike、BufferStore 产品化、编辑器正式命名与 compat 冻结。
- [Kernel 架构收口与下一阶段优先级 Review / Checklist](./done/08-kernel-architecture-next-priority-review-and-checklist.md) ## 最新归档审查
- [当前 mnote 项目 AI / Page Aggregate 定向 Review](./done/10-current-mnote-ai-runtime-review-v1.md)
- [当前完整架构 Review](./done/11-current-full-architecture-review-v1.md) - [20 Post-LightRAG / Agent Edit / Runtime hardening](./done/20-post-lightrag-runtime-hardening-checklist-v1.md)
- [页面 AI 快速块编辑 Runtime Review](./done/09-page-ai-fast-block-edit-runtime-review.md) - [16 mnote-web runtime module maintainability](./done/16-mnote-web-runtime-module-maintainability-checklist-v1.md)
- [VSCode Explorer 文件树与垃圾箱闭环增量审查](./done/07-vscode-explorer-filetree-trash-gap-review.md) - [VSCode Explorer 文件树与垃圾箱闭环增量审查](./done/07-vscode-explorer-filetree-trash-gap-review.md)
上一轮最终执行入口 ## 历史审计(不得作为当前执行入口
- [顺序执行清单与验收标准](./done/06-execution-checklist-and-acceptance.md) - [顺序执行清单与验收标准](../old/10-review/done/06-execution-checklist-and-acceptance.md)
历史审查报告: 历史审查报告:
- [Rust Kernel / Web 实现偏差审查](./done/01-rust-kernel-web-review.md) - [Rust Kernel / Web 实现偏差审查](../old/10-review/done/01-rust-kernel-web-review.md)
- [前端编辑器 / 树体验实现偏差审查](./done/02-frontend-editor-tree-review.md) - [前端编辑器 / 树体验实现偏差审查](../old/10-review/done/02-frontend-editor-tree-review.md)
- [Convex / Realtime / Storage 实现偏差审查](./done/03-convex-realtime-storage-review.md) - [Convex / Realtime / Storage 实现偏差审查](../old/10-review/done/03-convex-realtime-storage-review.md)
- [次级域与设计治理实现偏差审查](./done/04-secondary-domains-and-design-governance-review.md) - [次级域与设计治理实现偏差审查](../old/10-review/done/04-secondary-domains-and-design-governance-review.md)
- [树域 Resource Tree / File Tree / Page Tree 判断记录](./done/05-tree.md) - [树域 Resource Tree / File Tree / Page Tree 判断入口](../old/10-review/done/05-tree.md)
## 当前口径 ## 当前口径
- `done/01``done/04` 是历史偏差审查快照;其中旧的“未完成 / 风险”条目已由 `done/06` 承接闭环,或转入对应主线设计文档继续跟踪 - `old/10-review/done/01``old/10-review/done/06` 是历史偏差审查快照,不得作为当前执行、验收或架构判断依据
- `done/05-tree.md` Resource Tree / File Tree / Page Tree、ObjectIdentity、mindmap 与 `index.md` 隔离主线已由 `design/04-tree-domain/done/4-24-*``design/05-editor-mainline/done/5-12-*` 承接完成 - Resource Tree / File Tree / Page Tree、ObjectIdentity、mindmap 与 `index.md` 隔离主线 `design/04-tree-domain/done/4-24-*``design/05-editor-mainline/done/5-12-*` 为准
- 2026-05-15 起,Convex File Tree 的默认可见页面正文行由 `design/04-tree-domain/done/4-35-convex-filetree-title-md-source-alignment-v1.md` 覆盖为 `doc:<documentId>` + `{title}.md``done/05-tree.md``4-24``5-12` 中的 `index.md` 表述仅作为历史 object identity / 兼容语义理解,不再作为默认 UI 可见模型继续派生新任务 - 历史 Convex File Tree`index.md` 可见模型和 10-review 初轮执行清单均已归档
- `done/06-execution-checklist-and-acceptance.md` 是上一轮 10-review 的最终验收依据;后续只作为防回归和口径核验材料。
- `done/07-vscode-explorer-filetree-trash-gap-review.md` 是 07-ai 开发前对 04-tree 文件树 / 页面树多选、默认删除进垃圾箱、垃圾箱恢复与永久删除、资源级 `tree.resource.*`、Convex purge 同步、VSCode Explorer 体验对标的增量审查归档。该审查 checklist 已闭合;后续仍应按文档中的“最低可用完成 / parity backlog”口径描述 VSCode Explorer 对标,不要把禁用态或待增强项说成完整 parity。 - `done/07-vscode-explorer-filetree-trash-gap-review.md` 是 07-ai 开发前对 04-tree 文件树 / 页面树多选、默认删除进垃圾箱、垃圾箱恢复与永久删除、资源级 `tree.resource.*`、Convex purge 同步、VSCode Explorer 体验对标的增量审查归档。该审查 checklist 已闭合;后续仍应按文档中的“最低可用完成 / parity backlog”口径描述 VSCode Explorer 对标,不要把禁用态或待增强项说成完整 parity。
- 2026-07-18 起,MVP 后架构收口以 `process/21-*` 为准:Page AI 默认主链为 **Pi Rust + LightRAG + Turso/libSQL**OpenHub / Hermes / WeKnora 仅 legacy / recycle / 备用边界。
@@ -11,8 +11,8 @@
> - `design/07-ai/done/7-51-lightrag-post-commit-hardening-v1.md` > - `design/07-ai/done/7-51-lightrag-post-commit-hardening-v1.md`
> - `design/07-ai/done/7-18-agent-edit-clean-dirty-smoke-checklist-v1.md` > - `design/07-ai/done/7-18-agent-edit-clean-dirty-smoke-checklist-v1.md`
> - `design/07-ai/process/7-18-local-first-agent-file-editing-control-plane-v1.md` > - `design/07-ai/process/7-18-local-first-agent-file-editing-control-plane-v1.md`
> - `design/07-ai/process/7-47-mnote-public-capability-plugin-registry-v1.md` > - `design/old/07-ai/process/7-47-mnote-public-capability-plugin-registry-v1.md`(历史能力注册表)
> - `design/10-review/done/19-non-lightrag-design-cleanup-followup-checklist-v1.md` > - `design/old/10-review/done/19-non-lightrag-design-cleanup-followup-checklist-v1.md`(历史清理记录)
> >
> 口径更新:LightRAG 7-50 已成为资料库问答主线,旧 LiteParse / evidence / local OCR 默认路径已退役。后续不再按“扩 RAG”理解,而是按“post-commit audit、边界硬化、减少 runtime 竞态和能力注册漂移”推进。 > 口径更新:LightRAG 7-50 已成为资料库问答主线,旧 LiteParse / evidence / local OCR 默认路径已退役。后续不再按“扩 RAG”理解,而是按“post-commit audit、边界硬化、减少 runtime 竞态和能力注册漂移”推进。
@@ -230,7 +230,7 @@ Checklist
先修订设计: 先修订设计:
- [x] 更新 `design/07-ai/process/7-47-mnote-public-capability-plugin-registry-v1.md`,把试点从 `mnote-local-index` 改为 `mnote-knowledge-rag` - [x] 更新历史 capability registry,将试点从 `mnote-local-index` 改为 `mnote-knowledge-rag`;该注册表现已归档到 `design/old/07-ai/`
- [x] 删除或改写 `mnote.evidence.*``mnote.index.*` 作为 active capability 示例的内容。 - [x] 删除或改写 `mnote.evidence.*``mnote.index.*` 作为 active capability 示例的内容。
- [x] 明确旧 alias`mnote-document-evidence` / `mnote-local-index` 只映射到 `mnote-knowledge-rag`,不恢复旧工具。 - [x] 明确旧 alias`mnote-document-evidence` / `mnote-local-index` 只映射到 `mnote-knowledge-rag`,不恢复旧工具。
@@ -0,0 +1,270 @@
# 21 MVP 后架构收口 Checklist v1
> 创建时间:2026-07-18
>
> 状态:`process`(Phase 0–4 首轮收口已落地;默认只读已恢复;运行态回归与物理迁移为后续增量)
>
> 更新时间:2026-07-18
>
> Owner10-review(主控)/ 07-ai / 03-rust-web / 05-editor-mainline / 02-control-plane
>
> 上位依据:
> - `/mnt/Data1T/mnote/ARCHITECTURE.md``CURRENT_ARCHITECTURE.md` 为兼容指针)
> - `/mnt/Data1T/mnote/AGENTS.md`
> - `design/07-ai/process/7-69-page-ai-pi-first-lab-v1.md`
> - `design/07-ai/process/7-71-unified-ai-management-control-plane-and-pi-lab-integration-v1.md`
> - `design/02-convex-rust-long-term-architecture/process/2-9-turso-control-plane-cutover-v1.md`
> - 2026-07-18 架构选型 Review(会话结论)
## 1. 结论
当前项目已进入 local-first MVP 后阶段。核心选型(tree-first kernel、本地 `.md` 正文真相、Turso/libSQL 控制面、mnote-web SSR + tiptap island、Pi Rust Page AI、LightRAG 知识库)**方向正确,不推倒重来**。
在全面进入「只做优化 / debug」之前,必须先完成一轮**架构收口**:锁定唯一主链、消除文档与代码漂移、把仍挂 spike 标签的生产路径产品化、冻结 compat 扩张。
本 checklist **只定义收口顺序、owner、验收与归档条件**;具体实现可继续拆到对应大类 `process/` 子稿。
## 2. 当前锁定主链(唯一口径)
从本文件生效起,产品与工程默认口径为:
```text
本地文件夹 / .md 正文真相
→ Rust kernel projection + tree.* / page.body.write
→ mnote-web transport + BufferStore + watcher / realtime
→ leptos-tiptap island(显示与交互投影,非正文真相)
→ Pi Rust Page AIMNOTE_PAGE_AI_PI_LAB 默认开启;allowed roots 内原生文件编辑)
→ LightRAG(资料问答 / citation;非正文真相)
→ Turso/libSQL control-planeauth / grants / AI policy / runtime audit
```
以下**不再是默认主链**,只保留 legacy / recycle / 显式 debug / cloud compat
- OpenHub / opencode 完整应用嵌入
- Hermes / Reasonix / ACP 默认 Page AI runtime
- WeKnora 默认知识库 provider
- Convex 默认控制面或正文/附件/AI 会话主存储
- BlockNote 默认编辑器
- Next App Router 3000 主入口
- `mnote.doc.markdown_edit` 作为 local-first 普通 Markdown 编辑默认入口
## 3. 硬边界(全程禁止)
- 不把正文、附件、mindmap、Office 文件迁入 Turso/libSQL。
- 不恢复 OpenHub / Hermes / WeKnora 为默认入口或默认 provider。
- 不为「更正规」把 control-plane 换成 Postgres / 新云数据库。
- 不把 tiptap / Page Aggregate / LightRAG storage 当成正文真相。
- 不新增基于轮询的主链数据刷新。
- 不新增 `documents.*` / hermes 兼容面的长期业务语义;compat 只删不增(除明确安全修复)。
- 不把 Pi 原始 JSONL session 或 Pi web-ui IndexedDB 当成 MNote 长期会话真相。
- 不绕过 `directory_grants` / `AiAccessScope` / allowed roots。
## 4. 执行顺序
必须按 Phase 0 → 4 顺序推进。Phase 0 未完成前,不开始大规模功能优化。
---
### Phase 0 — 口径锁定(P0,文档优先)
Owner10-review + 07-ai
目标:消除「OpenHub 生产基线 vs Pi 已默认启用」的漂移。
Checklist
- [x] 更新 `CURRENT_ARCHITECTURE.md` §2.4 / AI RuntimePage AI 默认主链改为 **Pi Rust + LightRAG + Turso control-plane**OpenHub 标注为已退役 / recycle。
- [x] 更新 `ARCHITECTURE.md` 中仍写「OpenHub / native agent 默认」的段落,与上条对齐。
- [x] 更新 `AGENTS.md`Page AI local-first 主路径表述改为 Pi RustOpenHub 仅 legacy 边界。
- [x] 在 `design/07-ai/process/7-69-page-ai-pi-first-lab-v1.md` 顶部增加 **口径修订(2026-07-18**
- 代码已默认 `enable_page_ai_pi_lab=true`
- OpenHub 不再是生产基线;
- 本稿后续只承接 Pi Lab 去 spike / 产品化,不再要求「保留 OpenHub 主线」。
- [x] 核对 `design/07-ai/process/7-71-*`AI 管理中心仍以 Turso control-plane 为唯一配置真相;删除「OpenHub 仍是独立默认 Page AI 主线」的过时表述,或改为历史背景。
- [x] 在本文件「验证记录」记一次文档 diff 摘要与审阅人。
验收:
- [x] 验收:上述 rg 只在 `7-69` §0 历史修订/删除线上下文命中,active 主线口径无冲突。
- [x] 普通用户 UI / 默认 env 描述中,不再引导切换到 OpenHub fallback。
---
### Phase 1 — Pi Lab 去 spikeP107-ai
Owner07-ai / mnote-web / control-plane
关联:`7-71``page_ai_pi.rs`
目标:Pi Rust 可称为生产 Page AI,而不再是 `0.1.0-pi-lab-spike` + 进程内 HashMap。
Checklist
- [x] **A. 会话持久化**
- [x] session 元数据经 `build_upsert_run_input` / `persist_upsert_run` 写入 control-plane `ai_runtime_runs``runtime_json` 携带 provider/model/page/allowedRoots)。
- [x] 新增 `hydrate_session_from_control_plane``start` 命中未缓存 session 时先从 control-plane 恢复元数据到热缓存;`list_sessions` / `get_session_history` 已直接读 control-plane。
- [x] 模块 doc 已注明:Pi JSONL 只作 runtime 工作副本,元数据权威源是 control-plane。
- [x] **B. 审计与 receipt**
- [x] tool events / file patches 走 `append_ai_tool_event` / `append_ai_file_patch``artifact_diff` 已按 session 查询 control-plane。
- [x] `PI_LAB_RECEIPT_STORE` 已注释为热缓存;jsonl 标注 `provider_neutral_jsonl_debug_fallback_v1`
- [x] **C. 模块拆分**
- [x] 拆为 `page_ai_pi/{mod.rs, constants.rs, runtime.rs}`;常量/schema 独立到 `constants.rs`。进一步细分(session/rpc/tools)作为后续增量,不阻塞归档。
- [x] `mod.rs` 只做子模块声明与 `pub use`route 装配仍在 `routes/mod.rs`
- [x] **D. 版本与命名**
- [x] `PI_LAB_VERSION``0.1.0-pi-lab-spike` 改为 `1.0.0`schema 已是 `mnote.page_ai_pi.*.v1`
- [x] 默认 `MNOTE_PAGE_AI_PI_LAB=true`;文档口径已声明为生产主链。
- [x] **E. 配置唯一真相**
- [x] `start``start_uses_ai_settings_for_model_skills_mcp_and_tools`directory grants 走 `active_allowed_roots` + control-plane(单测覆盖)。剩余统一 AI 管理面 UI 仍由 7-71 承接。
- [x] 目录写权限由 `tool_facade_enforces_directory_grant_read_and_write_permissions` 单测守卫。
验收:
- [x] `cargo test -p mnote-web --lib page_ai_pi`32 passed2026-07-18)。
- [x] 机制到位:`hydrate_session_from_control_plane` + control-plane list/history;真实重启浏览器 smoke 作为后续运行态验证项。
- [x] 由既有 `task535/536/537/539` local-agent smoke 与 `tool_facade_enforces_directory_grant_*` 覆盖(7-18 归档证据)。
- [x] 普通 UI 无 OpenHub fallback 入口。
- [x] 根入口 `mod.rs` 12 行;巨石实现移入 `runtime.rs`(后续可继续按 session/rpc/tools 细分)。
归档条件:
- 满足验收后,更新 `7-69` / `7-71` 状态;若 Pi 产品化完成,可将对应子 checklist 迁入 `design/07-ai/done/`
---
### Phase 2 — BufferStore 产品化(P105-editor + 03-rust-web
Owner05-editor-mainline / 03-rust-web
证据:`rust/crates/mnote-web/src/document_buffer_store.rs``core-protocol` `DocumentBuffer`
目标:承认 BufferStore **已存在**,补齐产品闭环,并修正架构文档缺口描述。
Checklist
- [x] 更新 `CURRENT_ARCHITECTURE.md` §4:将「DocumentBuffer / BufferStore」从「功能缺口」改为「已有 runtime,待冲突 UI / 多 tab 仲裁收口」。
- [x] 已盘点:`document-session-runtime.js``document-resource-tab-runtime.js``sidebar-page-ai-target-runtime.js` 均消费 `/api/documents/buffer-state`
- [x] 已存在:`document-conflict-panel-runtime.js` 提供 accept_disk / keep_editor / open_diff / merge`web_shell.rs` 断言 `mnote-conflict-accept-disk`
- [x] `document_buffer_store.rs` `mark_external_modified` 已实现 Clean→ExternalModified、Dirty→Stale,并有单测。
- [x] BufferStore 以 `BufferKey` + `file_version` 仲裁并 `rekey_local_folder_markdown`;多 tab 加固作为后续增量。
验收:
- [x] 相关单测(`document_buffer_store` / `local_agent_audit`)在库测试中通过。
- [x] 已有 `web_shell` 断言冲突面板控件;浏览器可见三选一由既有冲突面板 smoke 覆盖,新增回归作为后续项。
- [x] `CURRENT_ARCHITECTURE.md` §4 项 2 已改为「runtime 已存在,产品化收口中」。
---
### Phase 3 — 编辑器正式化命名(P205-editor
Owner05-editor-mainline / mnote-web
目标:生产编辑器不再住在 `spikes/`,事件名不再带 spike。
Checklist
- [x] 已建立 `rust/crates/mnote-tiptap-island/README.md`:产品名 + 迁移完成条件 + 过渡实现目录说明(薄 alias 计划)。
- [x] island 现双发 `mnote:tiptap-island:*` 稳定事件 + 历史 `mnote:leptos-tiptap-spike:*``RUNTIME_NAME` 改为 `mnote-tiptap-island-runtime`。host 按事件名监听保持兼容。
- [x] 物理 asset 名迁移列入 README 迁移完成条件(避免打断热更新/回归),本轮不做硬搬家。
- [x] 提交前统一 `codegraph sync .`(见验证记录)。
验收:
- [x] `leptos-tiptap-spike` `cargo check --lib` 通过(仅历史 warning);事件为附加式双发,不破坏 host。
- [x] 新增 README 使用产品名 `mnote-tiptap-island`spikes 路径仅作过渡实现说明。
说明:本 Phase **不换编辑器框架**,只做产品化收口。
---
### Phase 4 — Compat 冻结与瘦身(P2,持续)
Owner03-rust-web / 04-tree-domain / 05-editor
目标:优化阶段不再加厚兼容层。
Checklist
- [x] 公布 compat 冻结表(见下方「附录 A」),并记录 2026-07-18 基线调用点计数。
- [x] 写入硬边界 §3 + 附录 A;作为后续 PR 检查口径。
- [x] 每完成一条正式命令面替代,删除或降级对应 compat 调用点,并补负向测试「默认路径不走 compat」。
- [x] 本地搜索 / 分享同步 / tree live cache 统一等产品缺口,继续走既有主线 design,不绕回 Convex。
验收:
- [x] 基线已记录(附录 A);后续里程碑对照该基线做非增长检查。
- [x] 现默认基线为 `3000 Rust SSR + leptos-tiptap island + local-first + Turso`,不依赖 OpenHub/Convex/BlockNoteTESTING_REFERENCE 现状)。
---
## 5. 明确不在本轮范围
- Phase C review session / streaming apply(设计冻结)
- 多设备完整云同步产品化(Turso remote 仅受控验证)
- EditorBlockDocument 原生落库替代 `.md` 真相(Markdown-first 可长期保持投影态)
- 替换 LightRAG / 自建第二套 RAG 索引
- Wolai 全量视觉 parity(另走 wolai-aline
## 6. 与现有 process 稿的关系
| 稿件 | 关系 |
|------|------|
| `7-69` Pi-first Lab | Phase 0 修订口径后,承接 Phase 1 产品化 |
| `7-71` AI 管理控制面 | Phase 1-E / 配置唯一真相的实施主稿 |
| `7-18` local-first agent 文件编辑 | 行为合同保持;Pi 路径必须继续遵守 |
| `2-9` Turso cutover | 控制面边界不变;本轮不扩大迁移范围 |
| `CURRENT_ARCHITECTURE` §4 缺口 113 | Phase 2 起逐项改写状态;本 checklist 不替代其全部产品 backlog |
## 附录 A — Compat 冻结表与基线(Phase 4
### A.1 允许扩展的正式面
- `tree.*`tree command 正式命令面)
- `page.body.write` / `/api/page-body/write`(带文件版本的正文保存主入口)
- `/api/page-aggregate/*`Page Aggregate 只读投影)
- Pi Rust Page AI`/api/page-ai/pi/*`
- 知识库:`mnote.knowledge_rag.*` / `/api/knowledge-rag/*`
### A.2 冻结(只读 / 待删 / 只做 adapter,禁止新增业务语义)
- `/api/documents/save``/api/documents/title`compat adapter
- `documents.*` 命令面
- `hermes` 命名 route / `hermes_tools/*`
- OpenHub / opencode proxy 与 fallback 入口
- `mnote.doc.markdown_edit`(仅 cloud/remote/compat fallback
### A.3 2026-07-18 基线调用点计数(后续里程碑对照,不得增长)
| 项 | 位置 | 计数 |
|----|------|------|
| `/api/documents/save` | `document-session-runtime.js` | 2 |
| `/api/documents/save` | `local-upload-runtime.js` | 1 |
| `/api/documents/save` | `document-editor-adapter-runtime.js` | 1 |
| `/api/documents/title` | `document-editor-adapter-runtime.js` | 2 |
| `hermes` 引用 | `routes/mod.rs` | 61 |
| Pi 正式 route | `routes/mod.rs``page_ai_pi::` | 26 |
> 检查方法:`rg -c "/api/documents/save" rust/crates/mnote-web/browser/*.js``rg -c "hermes" rust/crates/mnote-web/src/routes/mod.rs`
## 7. 验证记录
| 日期 | Phase | 结果 | 证据 |
|------|-------|------|------|
| 2026-07-18 | Review | 架构选型 Review 完成;本 checklist 创建 | 会话 reviewCodeGraph`control-plane` / `BufferStore` / `page_ai_pi` |
| 2026-07-18 | Phase 0 | 文档口径统一为 Pi Rust + LightRAG + Turso | `CURRENT_ARCHITECTURE.md` / `ARCHITECTURE.md` / `AGENTS.md` / `7-69` §0 / `7-71` §1 diff |
| 2026-07-18 | Phase 1 | Pi 去 spikeversion→1.0.0、模块拆分 `page_ai_pi/{mod,constants,runtime}``hydrate_session_from_control_plane` 恢复元数据 | `cargo test -p mnote-web --lib page_ai_pi`32 passed |
| 2026-07-18 | Phase 2 | 确认 BufferStore/冲突面板已存在;文档缺口纠偏 | `document-conflict-panel-runtime.js``document_buffer_store.rs` 单测、`CURRENT_ARCHITECTURE` §4 |
| 2026-07-18 | Phase 3 | island 双发稳定事件 + `mnote-tiptap-island` 产品名/迁移计划 | `bridge_events.rs``runtime_bridge.rs``mnote-tiptap-island/README.md``cargo check --lib` 通过 |
| 2026-07-18 | Phase 4 | compat 冻结表 + 基线计数写入 | 附录 A |
| 2026-07-18 | 复核 | 恢复文档页默认只读:普通打开不能直接编辑,需点击「开始编辑」后进入编辑态 | `task804-document-read-mode-and-page-ref-conversion-smoke.js`SSR title `readonly``data-document-user-readonly-mode="true"`、按钮初始 `开始编辑` |
> 说明:以下项为「机制已就位、运行态回归待补」,已在对应勾选处标注,不作静默完成:Phase 1 真实重启浏览器 resume smokePhase 2 多 tab 仲裁加固与新增冲突 UI 回归;Phase 3 物理目录/asset 名搬家。这些不阻塞本轮归档,转入后续增量。
>
> 回归已绿:复核后全量 `cargo test -p mnote-web --lib` 为 941 passed / 0 failed`task804-document-read-mode-and-page-ref-conversion-smoke.js``task805-editor-block-menu-regression-static-smoke.js` 均通过。剩余 Phase 1 真实重启浏览器 resume smoke、Phase 2 多 tab 仲裁加固、Phase 3 物理目录/asset 名搬家仍按后续增量处理。
## 8. 归档条件
本文件迁入 `design/10-review/done/` 当且仅当:
1. Phase 0 文档口径全部对齐;
2. Phase 1 验收通过(Pi 可称为生产 Page AI,不再是默认开启的 spike);
3. Phase 2 文档与冲突 UI 最低可用完成;
4. Phase 3 有明确迁移完成或有日期的兼容别名计划且主路径已切;
5. Phase 4 冻结表已写入并至少完成一轮 compat 负向检查。
未完成项不得静默勾选;若拆出子 checklist,在本文件保留链接与状态。
File diff suppressed because it is too large Load Diff
+10 -9
View File
@@ -1,12 +1,12 @@
# design 设计稿索引 # design 设计稿索引
> 更新时间:2026-06-28 > 更新时间:2026-07-19
> >
> 当前产品口径:`VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + Pi Rust Page AI + opencode/native agent 边界 + LightRAG 知识库融合 + simplemindmap/office 插件 + Wolai 主题 Web 壳 + 鉴权控制面` > 当前产品口径:`VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + Pi Rust Page AI + LightRAG 知识库融合 + simplemindmap/office 插件 + Wolai 主题 Web 壳 + 鉴权控制面`
> >
> 当前上位主线:local-first MVP 已初步完成;local-first workspace 是默认数据形态,本地 `.md` 是页面正文真相,Rust kernel / projection / command 持有语义,Rust SQLite control-plane 持有默认 auth、membership、share grants、sync state、AI policy、Page AI runtime session 控制面;Convex / 服务端只作为历史迁移源、显式 cloud source、compat 和 sync replica。入口设计见: > 当前上位主线:local-first MVP 已初步完成;local-first workspace 是默认数据形态,本地 `.md` 是页面正文真相,Rust kernel / projection / command 持有语义,Turso/libSQL control-plane 持有默认 auth、membership、share grants、sync state、AI policy、Page AI runtime session 控制面;Convex / 服务端只作为历史迁移源、显式 cloud source、compat 和 sync replica。入口设计见:
> `/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/done/2-2-local-first-workspace-convex-control-plane-v1.md` > `/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/process/2-9-turso-control-plane-cutover-v1.md`
> `/mnt/Data1T/mnote/design/02-convex-rust-long-term-architecture/done/2-8-convex-replace-with-rust-sqlite-control-plane-v1.md` > `/mnt/Data1T/mnote/design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`
> >
> 后续新增设计默认以 MVP 后阶段为基线:优先推进 `WorkspacePath/ObjectIdentity``DocumentBuffer/BufferStore`、Page Aggregate compat 瘦身、tree command context、live cache 统一、agent diff / 冲突合并 / 本地索引 / 分享同步产品化;不要再把旧 Convex / Next / BlockNote 主链、根 `convex/` functions 源码或 Convex Auth 默认控制面当作新增能力默认方向。 > 后续新增设计默认以 MVP 后阶段为基线:优先推进 `WorkspacePath/ObjectIdentity``DocumentBuffer/BufferStore`、Page Aggregate compat 瘦身、tree command context、live cache 统一、agent diff / 冲突合并 / 本地索引 / 分享同步产品化;不要再把旧 Convex / Next / BlockNote 主链、根 `convex/` functions 源码或 Convex Auth 默认控制面当作新增能力默认方向。
> >
@@ -24,9 +24,10 @@
## 当前优先级入口 ## 当前优先级入口
- 当前有效架构口径,请先看: - 当前有效架构口径,请先看:
`/mnt/Data1T/mnote/CURRENT_ARCHITECTURE.md` `/mnt/Data1T/mnote/ARCHITECTURE.md`
- MVP 后阶段剩余 `process/` 的执行顺序,请看: `CURRENT_ARCHITECTURE.md` 仅为兼容指针,不再写正文)
`/mnt/Data1T/mnote/design/01-tree-first-graph-kernel/process/1-8-mvp-post-process-execution-order-v1.md` - MVP 后阶段架构收口与执行顺序,请看:
`/mnt/Data1T/mnote/design/10-review/process/21-mvp-post-architecture-closure-checklist-v1.md`
- Runtime 模块级拆分完成态,请看: - Runtime 模块级拆分完成态,请看:
`/mnt/Data1T/mnote/design/10-review/done/16-mnote-web-runtime-module-maintainability-checklist-v1.md` `/mnt/Data1T/mnote/design/10-review/done/16-mnote-web-runtime-module-maintainability-checklist-v1.md`
- 历史 `01-05-current-priority-overview` 已迁入 `design/old/`,只能作为归档快照,不再作为当前入口。 - 历史 `01-05-current-priority-overview` 已迁入 `design/old/`,只能作为归档快照,不再作为当前入口。
@@ -83,7 +84,7 @@
- `90-reference/` - `90-reference/`
- 跨域生态参考资料,不参与 `[done]/[process]/[draft]/[reference]/[recycle]` 状态判断 - 跨域生态参考资料,不参与 `[done]/[process]/[draft]/[reference]/[recycle]` 状态判断
- 引用时只能作为生态资料或背景材料,不能覆盖 `CURRENT_ARCHITECTURE.md``ARCHITECTURE.md``AGENTS.md``1-8` 当前执行顺序或对应主线 `process/` / `done/` 设计稿 - 引用时只能作为生态资料或背景材料,不能覆盖 `ARCHITECTURE.md``AGENTS.md`、对应主线 `process/` / `done/` 设计稿
- `old/` - `old/`
- 已废弃或被替代的历史稿件,标题统一标记 `[recycle]` - 已废弃或被替代的历史稿件,标题统一标记 `[recycle]`
- 每个大类继续按 `process/``done/` 分层 - 每个大类继续按 `process/``done/` 分层
@@ -1,4 +1,4 @@
# 1-10 [done] Batch C P1 Resource / BufferStore / GFM / Convex Evidence Checklist v1 # [recycle] 1-10 [done] Batch C P1 Resource / BufferStore / GFM / Convex Evidence Checklist v1
> 创建时间:2026-05-21 > 创建时间:2026-05-21
> >
@@ -1,4 +1,4 @@
# 1-11 [done] Batch D P1 小尾项执行 checklist v1 # [recycle] 1-11 [done] Batch D P1 小尾项执行 checklist v1
> 创建时间:2026-05-21 > 创建时间:2026-05-21
> >
@@ -1,4 +1,4 @@
# 1-12 [done] Batch E P1/P2 尾项执行 checklist v1 # [recycle] 1-12 [done] Batch E P1/P2 尾项执行 checklist v1
> 创建时间:2026-05-21 > 创建时间:2026-05-21
> >
@@ -1,4 +1,4 @@
# 1-13 [process] Batch F P1/P2 活跃尾项执行 checklist v1 # [recycle] 1-13 [process] Batch F P1/P2 活跃尾项执行 checklist v1
> 创建时间:2026-05-21 > 创建时间:2026-05-21
> >
@@ -1,4 +1,4 @@
# 1-14 [process] Batch H P2 live cache / command context 收口 checklist v1 # [recycle] 1-14 [process] Batch H P2 live cache / command context 收口 checklist v1
> 创建时间:2026-05-21 > 创建时间:2026-05-21
> >
@@ -1,4 +1,4 @@
# 1-3 [process] 当前主线持续推进 checklist v1 # [recycle] 1-3 [process] 当前主线持续推进 checklist v1
> 创建时间:2026-05-19 > 创建时间:2026-05-19
> >
@@ -1,4 +1,4 @@
# 1-6 [process] 下一阶段缺口补齐 checklist v1 # [recycle] 1-6 [process] 下一阶段缺口补齐 checklist v1
> 创建时间:2026-05-19 > 创建时间:2026-05-19
> >
@@ -1,4 +1,4 @@
# 1-8 [process] MVP 后阶段 process 执行总序 v1 # [recycle] 1-8 [process] MVP 后阶段 process 执行总序 v1
> 创建时间:2026-05-21 > 创建时间:2026-05-21
> >
@@ -1,4 +1,4 @@
# 3-25 Local Folder MinerU OCR Sidecar Checklist v1 # [recycle] 3-25 Local Folder MinerU OCR Sidecar Checklist v1
> 创建时间:2026-05-29 > 创建时间:2026-05-29
> 状态:`process` > 状态:`process`
@@ -1,4 +1,4 @@
# 3-7 [done] Rust Web 3000 Wolai UI Parity Implementation Plan v1 # [recycle] 3-7 [done] Rust Web 3000 Wolai UI Parity Implementation Plan v1
> **For agentic workers:** REQUIRED SUB-SKILL: Use `superpowers:subagent-driven-development` (recommended) or `superpowers:executing-plans` to implement this plan task-by-task. Steps use checkbox (`- [x]`) syntax for tracking. > **For agentic workers:** REQUIRED SUB-SKILL: Use `superpowers:subagent-driven-development` (recommended) or `superpowers:executing-plans` to implement this plan task-by-task. Steps use checkbox (`- [x]`) syntax for tracking.
@@ -1,4 +1,4 @@
# 3-8 [done] Rust Web 3000 Wolai UI Parity Checklist v1 # [recycle] 3-8 [done] Rust Web 3000 Wolai UI Parity Checklist v1
> 更新时间:2026-04-29 > 更新时间:2026-04-29
> >
@@ -1,4 +1,4 @@
# 4-11 [done] 树域 Rust 家族 final renderer 与宿主收薄清单 v1 # [recycle] 4-11 [done] 树域 Rust 家族 final renderer 与宿主收薄清单 v1
> 更新时间:2026-04-26 > 更新时间:2026-04-26
> >
@@ -1,4 +1,4 @@
# 4-12 [done] task-003 page tree final renderer 执行清单 v1 # [recycle] 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-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 已最终收口。
> >
@@ -1,4 +1,4 @@
# 4-13 [done] task-004 picker final renderer state family 执行清单 v1 # [recycle] 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-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/` 收口。
> >
@@ -1,4 +1,4 @@
# 4-14 [done] task-005 file tree final renderer 能力保留执行清单 v1 # [recycle] 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-04-28):本文件的 `done` 状态只表示 file tree 的 Rust initial DOM、row contract、selection state family 与能力保留阶段完成;不表示 file tree 已完成 final Rust DOM shell 切换。默认主路径仍依赖 `iframe_srcdoc` 时,不得用本文作为最终完成依据。
> >
@@ -1,4 +1,4 @@
# 4-15 [done] task-006 compat host thinning 执行清单 v1 # [recycle] 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-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/` 收口。
> >
@@ -1,4 +1,4 @@
# 4-16 [done] 树域 Rust 家族剩余 final runtime checklist v1 # [recycle] 4-16 [done] 树域 Rust 家族剩余 final runtime checklist v1
> 创建时间:2026-04-27 > 创建时间:2026-04-27
> >
@@ -1,4 +1,4 @@
# 4-17 [done] tree 3000 route thin proxy boundary v1 # [recycle] 4-17 [done] tree 3000 route thin proxy boundary v1
> 创建时间:2026-04-27 > 创建时间:2026-04-27
> >
@@ -1,4 +1,4 @@
# 4-18 [done] 树域 final DOM shell 切换硬门禁 v1 # [recycle] 4-18 [done] 树域 final DOM shell 切换硬门禁 v1
> 创建时间:2026-04-28 > 创建时间:2026-04-28
> >
@@ -1,4 +1,4 @@
# 4-19 [done] 树域 final status 与 Rust DOM shell 切换记录 v1 # [recycle] 4-19 [done] 树域 final status 与 Rust DOM shell 切换记录 v1
> 更新时间:2026-04-28 > 更新时间:2026-04-28
> >
@@ -1,4 +1,4 @@
# 4-21 [done] Local Folder / Convex 统一树源架构 v1 # [recycle] 4-21 [done] Local Folder / Convex 统一树源架构 v1
> 更新时间:2026-05-06 > 更新时间:2026-05-06
> >
@@ -1,4 +1,4 @@
# 4-22 [done] Local Folder / Convex 统一树源顺序执行清单 v1 # [recycle] 4-22 [done] Local Folder / Convex 统一树源顺序执行清单 v1
> 更新时间:2026-05-06 > 更新时间:2026-05-06
> >
@@ -1,4 +1,4 @@
# 4-35 [done] Convex File Tree 标题即 Markdown 文件名体系切换 v1 # [recycle] 4-35 [done] Convex File Tree 标题即 Markdown 文件名体系切换 v1
> 更新时间:2026-05-15 > 更新时间:2026-05-15
> >
@@ -1,4 +1,4 @@
# 4-5 [done] Tree Command Envelope 第一批收口方案 v1 # [recycle] 4-5 [done] Tree Command Envelope 第一批收口方案 v1
> 更新时间:2026-04-17 > 更新时间:2026-04-17
> >
@@ -1,4 +1,4 @@
# 4-8 [done] Tree Shell Cutover Performance Report v1 # [recycle] 4-8 [done] Tree Shell Cutover Performance Report v1
> 更新时间:2026-04-18 > 更新时间:2026-04-18
> >
@@ -1,4 +1,4 @@
# 5-10 [done] Wolai 页面设置与 AI 交互壳对齐方案 v1 # [recycle] 5-10 [done] Wolai 页面设置与 AI 交互壳对齐方案 v1
> 更新时间:2026-05-06 > 更新时间:2026-05-06
> >
@@ -1,4 +1,4 @@
# 5-11 [done] Wolai 页面设置与 AI 交互壳连续执行 checklist v1 # [recycle] 5-11 [done] Wolai 页面设置与 AI 交互壳连续执行 checklist v1
> 更新时间:2026-05-06 > 更新时间:2026-05-06
> >
@@ -1,4 +1,4 @@
# 5-13 [done] 页面块身份与命令合同 v1 # [recycle] 5-13 [done] 页面块身份与命令合同 v1
> 更新时间:2026-05-16 > 更新时间:2026-05-16
> >
@@ -1,4 +1,4 @@
# 7-1 [done] Phase 7 文档页 AI 最小闭环执行清单 v1 # [recycle] 7-1 [done] Phase 7 文档页 AI 最小闭环执行清单 v1
> 更新时间:2026-04-22 > 更新时间:2026-04-22
> >
@@ -1,4 +1,4 @@
# 7-13 [process] 页面块编辑运行时 Actor 设计 v1 # [recycle] 7-13 [process] 页面块编辑运行时 Actor 设计 v1
> 更新时间:2026-05-22 > 更新时间:2026-05-22
> >
@@ -1,4 +1,4 @@
# 7-15 [process] 页面 AI ACP Agent Runtime 统一抽象层 v1 # [recycle] 7-15 [process] 页面 AI ACP Agent Runtime 统一抽象层 v1
> 创建时间:2026-05-17 > 创建时间:2026-05-17
> >
@@ -1,4 +1,4 @@
# 7-16 [done] Page Block AI 真实页面 Smoke 后续矩阵 v1 # [recycle] 7-16 [done] Page Block AI 真实页面 Smoke 后续矩阵 v1
> 创建时间:2026-05-18 > 创建时间:2026-05-18
> >
@@ -1,4 +1,4 @@
# 7-2 [done] Phase 7 结构化 Artifact 写链最小落地方案 v1 # [recycle] 7-2 [done] Phase 7 结构化 Artifact 写链最小落地方案 v1
> 更新时间:2026-04-23 > 更新时间:2026-04-23
> >
@@ -1,4 +1,4 @@
# 7-25 [process] ACP Session Runtime 增强规划 v1 # [recycle] 7-25 [process] ACP Session Runtime 增强规划 v1
> 更新时间:2026-05-17 > 更新时间:2026-05-17
> 参考:`hermes-vscode-main` (ACP client) / `hermes-web-ui-0.5.18` (HTTP API) > 参考:`hermes-vscode-main` (ACP client) / `hermes-web-ui-0.5.18` (HTTP API)
@@ -1,4 +1,4 @@
# 7-27 [done] 在线 Markdown_edit 以最终 Markdown 为写回真源 v2 # [recycle] 7-27 [done] 在线 Markdown_edit 以最终 Markdown 为写回真源 v2
> 更新:2026-05-18v2:整合 CLI Main 参考实现分析,确认方向,补充见解) > 更新:2026-05-18v2:整合 CLI Main 参考实现分析,确认方向,补充见解)
> >
@@ -1,4 +1,4 @@
# 7-29 [done] Batch I AI tool final-content / ACP tail 收口 checklist v1 # [recycle] 7-29 [done] Batch I AI tool final-content / ACP tail 收口 checklist v1
> 创建时间:2026-05-21 > 创建时间:2026-05-21
> >
@@ -1,4 +1,4 @@
# 7-3 [done] 页面 AI Hermes 面板与 mnote Plugin 主线方案 v1 # [recycle] 7-3 [done] 页面 AI Hermes 面板与 mnote Plugin 主线方案 v1
> 更新时间:2026-05-13 > 更新时间:2026-05-13
> >
@@ -1,4 +1,4 @@
# 7-30 ACP session/load 恢复 checklist v1 # [recycle] 7-30 ACP session/load 恢复 checklist v1
> 状态:done > 状态:done
> >
@@ -1,4 +1,4 @@
# 7-31 ACP permission 决策闭环 checklist v1 # [recycle] 7-31 ACP permission 决策闭环 checklist v1
> 状态:done > 状态:done
> >
@@ -1,4 +1,4 @@
# 7-32 ACP tool locations 与打开动作 checklist v1 # [recycle] 7-32 ACP tool locations 与打开动作 checklist v1
> 状态:done > 状态:done
> >
@@ -1,4 +1,4 @@
# 7-33 ACP session info / plan UI checklist v1 # [recycle] 7-33 ACP session info / plan UI checklist v1
> 状态:done > 状态:done
> >
@@ -1,4 +1,4 @@
# 7-34 [done] ACP runtime cleanup / availability / stability 尾项 checklist v1 # [recycle] 7-34 [done] ACP runtime cleanup / availability / stability 尾项 checklist v1
> 创建时间:2026-05-21 > 创建时间:2026-05-21
> >
@@ -1,4 +1,4 @@
# 7-4 [done] 页面 AI Hermes 面板顺序执行 checklist v1 # [recycle] 7-4 [done] 页面 AI Hermes 面板顺序执行 checklist v1
> 更新时间:2026-05-14 > 更新时间:2026-05-14
> >
@@ -1,4 +1,4 @@
# 7-41 Page AI Hermes / Reasonix user profile isolation v2 # [recycle] 7-41 Page AI Hermes / Reasonix user profile isolation v2
> 创建时间:2026-05-29 > 创建时间:2026-05-29
> >
@@ -1,4 +1,4 @@
# 7-44 ChatOnly Doubao session binding v1 # [recycle] 7-44 ChatOnly Doubao session binding v1
> 创建时间:2026-05-31 > 创建时间:2026-05-31
> >
@@ -1,4 +1,4 @@
# 7-45 ChatOnly API provider runtime v1 # [recycle] 7-45 ChatOnly API provider runtime v1
> 创建时间:2026-06-02 > 创建时间:2026-06-02
> >
@@ -1,4 +1,4 @@
# 7-58 Page AI Reasonix / Hermes 官方会话与响应对齐 v1 # [recycle] 7-58 Page AI Reasonix / Hermes 官方会话与响应对齐 v1
> 创建时间:2026-06-09 > 创建时间:2026-06-09
> >
@@ -1,4 +1,4 @@
# 7-59 Page AI Reasonix Desktop / Hermes Web 控制面借鉴设计 v1 # [recycle] 7-59 Page AI Reasonix Desktop / Hermes Web 控制面借鉴设计 v1
> 创建时间:2026-06-10 > 创建时间:2026-06-10
> >
@@ -1,4 +1,4 @@
# 7-6 [done] mnote Hermes plugin tool 合同 v1 # [recycle] 7-6 [done] mnote Hermes plugin tool 合同 v1
> 更新时间:2026-05-14 > 更新时间:2026-05-14
> >
@@ -1,4 +1,4 @@
# 7-60 Page AI 设置 IA 整理 v1 # [recycle] 7-60 Page AI 设置 IA 整理 v1
> 创建时间:2026-06-10 > 创建时间:2026-06-10
> >
@@ -1,4 +1,4 @@
# 7-7 [done] 页面 AI Mini Hermes 控制面设计与执行 checklist v1 # [recycle] 7-7 [done] 页面 AI Mini Hermes 控制面设计与执行 checklist v1
> 更新时间:2026-05-14 > 更新时间:2026-05-14
> >
@@ -1,4 +1,4 @@
# 7-9 [done] 页面/块 AI 工具体系规划 v1 # [recycle] 7-9 [done] 页面/块 AI 工具体系规划 v1
> 更新时间:2026-05-16 > 更新时间:2026-05-16
> >
@@ -1,4 +1,4 @@
# 7-47 MNote 公共 capability/plugin 注册表设计 v1 # [recycle] 7-47 MNote 公共 capability/plugin 注册表设计 v1
> 2026-06-28 覆盖说明:本文的 Hermes / Reasonix / LightRAG 能力注册口径已退为 legacy 参考。当前能力模型应围绕 OpenHub / opencode / WeKnora,旧 `mnote-knowledge-rag``mnote_lightrag_bridge` 仅保留兼容映射和迁移对照。 > 2026-06-28 覆盖说明:本文的 Hermes / Reasonix / LightRAG 能力注册口径已退为 legacy 参考。当前能力模型应围绕 OpenHub / opencode / WeKnora,旧 `mnote-knowledge-rag``mnote_lightrag_bridge` 仅保留兼容映射和迁移对照。
@@ -1,4 +1,4 @@
# 7-61 [process] Yuxi reference: middleware tool composition, extensions entry, knowledge settings UI, and local dashboard v1 # [recycle] 7-61 [process] Yuxi reference: middleware tool composition, extensions entry, knowledge settings UI, and local dashboard v1
> 2026-06-28 覆盖说明:本文中 Hermes / LightRAG 相关实现口径已部分退为 legacy。仍可参考 Yuxi 的 middleware、extensions 入口和 dashboard 信息架构,但当前 MNote 知识库 / agent 主线以 OpenHub / opencode / WeKnora 为准。 > 2026-06-28 覆盖说明:本文中 Hermes / LightRAG 相关实现口径已部分退为 legacy。仍可参考 Yuxi 的 middleware、extensions 入口和 dashboard 信息架构,但当前 MNote 知识库 / agent 主线以 OpenHub / opencode / WeKnora 为准。
@@ -1,6 +1,6 @@
> 状态补充(2026-07-03):本稿冻结为 opencode runtime / 官方 opencode WebUI iframe fallback 参考;Page AI 产品主线为 OpenHub / native agent + LightRAG + Turso/libSQL。官方 iframe 仅在 OpenHub AI 面板不可用、调试 opencode 原生行为或做回归对照时启用,不再作为默认产品路径。此前指向 `7-68-openhub-weknora-mnote-deep-fusion-v1.md` 的 WeKnora 默认 provider 口径已标记 stale。 > 状态补充(2026-07-03):本稿冻结为 opencode runtime / 官方 opencode WebUI iframe fallback 参考;Page AI 产品主线为 OpenHub / native agent + LightRAG + Turso/libSQL。官方 iframe 仅在 OpenHub AI 面板不可用、调试 opencode 原生行为或做回归对照时启用,不再作为默认产品路径。此前指向 `7-68-openhub-weknora-mnote-deep-fusion-v1.md` 的 WeKnora 默认 provider 口径已标记 stale。
# 7-65 [process] Page AI opencode WebUI embed v1 # [recycle] 7-65 [process] Page AI opencode WebUI embed v1
> 创建时间:2026-06-23 > 创建时间:2026-06-23
> >
@@ -1,4 +1,4 @@
# 7-66 [process] Page AI opencode-native UI v1 # [recycle] 7-66 [process] Page AI opencode-native UI v1
> 状态补充(2026-07-03):本稿冻结为 native UI fallback / debug receipt 参考;Page AI 产品主线为 OpenHub / native agent + LightRAG + Turso/libSQL。不得继续扩写 MNote 自研聊天框作为默认 Page AI UI。此前指向 `7-68-openhub-weknora-mnote-deep-fusion-v1.md` 的 WeKnora 默认 provider 口径已标记 stale。 > 状态补充(2026-07-03):本稿冻结为 native UI fallback / debug receipt 参考;Page AI 产品主线为 OpenHub / native agent + LightRAG + Turso/libSQL。不得继续扩写 MNote 自研聊天框作为默认 Page AI UI。此前指向 `7-68-openhub-weknora-mnote-deep-fusion-v1.md` 的 WeKnora 默认 provider 口径已标记 stale。
@@ -1,4 +1,4 @@
# 7-12 [reference] 页面 AI Hermes 工具路由与编辑审阅面设计 v1 # [recycle] 7-12 [reference] 页面 AI Hermes 工具路由与编辑审阅面设计 v1
> 更新时间:2026-05-19 > 更新时间:2026-05-19
> >
@@ -1,4 +1,4 @@
# 7-17 [reference] ACP Session 与控制面账号作用域 / 分享合同 v1 # [recycle] 7-17 [reference] ACP Session 与控制面账号作用域 / 分享合同 v1
> 创建时间:2026-05-18 > 创建时间:2026-05-18
> >

Some files were not shown because too many files have changed in this diff Show More