chore: align ai stack with openhub weknora
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
|
||||
- 当前长期方向以 `tree-first graph kernel` 为准,不以 `BlockNote-first` 或 `Mindmap-first` 为准。
|
||||
- 当前已经进入 local-first MVP 后阶段:最小可用闭环已建立,后续重点是底座统一、compat 瘦身和产品化闭环,不再把新增能力建立在旧 Convex / Next / BlockNote 主链上。
|
||||
- 当前产品形态固定为:`VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + Hermes/Reasonix agent + simplemindmap/office 插件 + Wolai 主题 Web 壳 + 鉴权控制面`。
|
||||
- 本地文件夹是早期产品默认数据真相;本地 `.md` 是页面正文真相。Rust SQLite `control-plane` 是默认 auth、membership、share grants、sync state、AI policy、ACP/Hermes runtime session 控制面;`Convex` / 服务端只保留为历史迁移源、显式 cloud source、compat 和 sync replica 边界,不再作为新增能力的默认正文、附件、AI 会话全文主存储或默认控制面。
|
||||
- 当前产品形态固定为:`VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + OpenHub/WeKnora AI + simplemindmap/office 插件 + Wolai 主题 Web 壳 + 鉴权控制面`。
|
||||
- 本地文件夹是早期产品默认数据真相;本地 `.md` 是页面正文真相。Rust SQLite `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/兼容边界。
|
||||
- `Rust kernel` 持有树、子树、边、projection、query、command 的语义主导权;新增树规则不要继续散落到前端、Next route 或临时 compat 层。
|
||||
- `mnote-web` 是当前 Rust Web 承载层,负责 transport、projection 分发、兼容切流;`compat` 与 `fixture` 只用于过渡和测试,不应继续承载长期业务语义。`3000` 是唯一前端公开入口;`3104` 已退役为仅显式 debug/internal 使用的边界。`/tree`、`/document-debug` 等 debug 壳默认关闭,仅在显式 debug/runtime 验证时启用。
|
||||
- 前端 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。
|
||||
@@ -13,8 +13,8 @@
|
||||
- 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 最小工具链已通过 Rust Hermes tools 读取和写入块投影;但这仍是从 `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)和 agent diff / 冲突合并 / 本地轻量搜索 / 分享同步产品化。AI 侧普通 Markdown 编辑主路径已收口为“当前文件引用 + selection + allowed roots + agent 原生 patch/diff + watcher 同步”;知识库问答、资料 OCR / parse / index / RAG 主路径已收口到 LightRAG,不再维护 LiteParse / 本地 OCR / evidence 资料索引多套 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` 当成精确块编辑主入口。
|
||||
- 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 / WeKnora 深度融合、agent diff / 冲突合并 / 本地轻量搜索 / 分享同步产品化。AI 侧普通 Markdown 编辑主路径已收口为“当前文件引用 + selection + allowed roots + OpenHub/native agent patch/diff + watcher 同步”;知识库问答、资料 OCR / parse / index / RAG 主路径已转向 WeKnora/OpenHub,LightRAG 仅作为 legacy fallback / 历史兼容边界;`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` 当成精确块编辑主入口。
|
||||
|
||||
## 组件定位
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
- `BlockNote` 是历史参考实现 / 对照材料,不再是运行时系统组件、默认回退编辑器或系统事实源。
|
||||
- `Mindmap` 是 `tree-first graph` 的一种视图和编辑挂件,不是对象真相层。
|
||||
- `OnlyOffice` 是独立页面型编辑器,不直接嵌入 `BlockNote` 画布;正文中通常通过附件块跳转进入。
|
||||
- `page-ai/block-edit-workflow` route 只保留为兼容门面或非 local source 的快捷路径,不作为 local-first 普通 Markdown 编辑默认主路径;local-first 下优先给 Hermes / Reasonix 授权文件引用并让 agent 使用自身文件编辑能力。`mnote.doc.markdown_edit` 是 cloud / remote agent / compat fallback;`mnote.block.*` 保留为结构性辅助。
|
||||
- `LightRAG` 是当前唯一默认知识库 RAG provider,负责资料库 OCR、parse、chunk、vector、graph、rerank、query 与跨文档问答。MNote 只维护 source registry、allowed roots / 权限、FileTree 灯号、资料库设置 UI、dashboard/status UI、citation/open-reference 映射和 agent tool facade;LiteParse、旧 OCR sidecar、旧 evidence search / local-index agent tools 已退役到历史 / recycle 边界。
|
||||
- `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.*` 保留为结构性辅助。
|
||||
- `WeKnora/OpenHub` 是当前默认知识库与 Page AI 融合方向,负责资料库问答、检索、引用和 MNote 宿主集成;MNote 维护 source registry、allowed roots / 权限、FileTree 灯号、资料库设置 UI、status UI、citation/open-reference 映射和 agent tool facade。LightRAG、LiteParse、旧 OCR sidecar、旧 evidence search / local-index agent tools 已退役到 legacy / recycle 边界,不再作为新增主路径。
|
||||
- 树域三层模型:`Resource Tree`(kernel 对象组织真源)→ `File Tree`(主组织投影,`{title}.md` 为页面正文行)→ `Page Tree`(导航投影,不持有结构真相)。涉及资源归属优先走 Rust kernel 的 `KernelObjectIdentity` / `KernelProjectionResourceKind`。
|
||||
|
||||
## Runtime 模块定位
|
||||
@@ -68,13 +68,13 @@
|
||||
- 浏览器主链默认禁止新增基于 `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`,不要继续在页面壳或 island 外侧拼第二份页面真相。
|
||||
- 涉及页面新建、重命名、移动、归档、恢复、嵌入时,优先沿 `tree.*` 正式命名推进;`documents.*` 只视为兼容层,不应继续扩写为长期命令面。
|
||||
- 涉及 local-first AI 普通 Markdown 编辑时,优先沿“授权文件引用 + `AiAccessScope` + allowed roots + agent 原生 patch/diff + 文件版本冲突模型 + watcher 同步”推进;涉及 cloud / remote agent / 复杂结构辅助时,才沿 `mnote.doc.*` / `mnote.block.*` Hermes tools 与 Rust `EditorCommand` 推进。`mnote.page.save` 只作为页面级兜底写入工具。
|
||||
- 涉及 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` 只作为页面级兜底写入工具。
|
||||
- 涉及资源归属(哪个页面拥有哪个 mindmap/附件)、object identity 和资源生命周期时,优先沿 Resource Tree → File Tree projection → `tree.resource.*` 命令面推进;`tree.*` 是正式命令面,`documents.*` 只视为兼容层。
|
||||
- 页面 AI 编辑当前 local-first 主路径为:页面定位到真实 `.md` 文件,MNote 计算 `AiAccessScope` / allowed roots / selection,Hermes 或 Reasonix 在白名单目录内用自身 patch/diff/文件编辑能力写入,MNote 通过 watcher / refresh 同步 tiptap。`mnote.doc.markdown_edit` 只作为 cloud / remote agent / compat fallback;`mnote.block.*` 保留为结构性辅助(拖拽排序等)。两层操作模型已获 CLI Main(Lark Doc)参考实现验证。流式 apply + suggest/review(参考 BlockNote AI)作为 Phase C 设计冻结,当前不实施。
|
||||
- 页面 AI 编辑当前 local-first 主路径为:页面定位到真实 `.md` 文件,MNote 计算 `AiAccessScope` / allowed roots / selection,OpenHub/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 设计冻结,当前不实施。
|
||||
- Page AI / OpenHub / 知识库这类用户入口首屏必须优先保证真实任务区可用:对话、输入框、知识库列表/详情占主体空间;debug、scope、health、route guard 等诊断信息只能放在折叠诊断区、开发态或日志中,不得默认挤占用户输入和阅读区域。
|
||||
- MNote + OpenHub 深度融合的交互能力优先改 OpenHub 源码本体(React/FastAPI/服务边界),MNote 只提供 auth、scope、proxy、文件/引用回跳等宿主胶水;不得用 MNote 侧 DOM 注入、悬浮按钮或拦截脚本伪装成 OpenHub 原生能力。
|
||||
- OpenHub/opencode 等 legacy fallback 只能保留为显式 debug/internal 边界;普通用户 UI 不得出现切换到 fallback 的按钮、入口或引导文案。
|
||||
- 涉及知识库资料索引 / OCR / RAG 时,默认沿 `mnote.knowledge_rag.*` / `/api/knowledge-rag/*` 和 LightRAG source registry 推进。图片源不能直接假设会被 LightRAG `/documents/scan` 识别,当前通过 MNote 生成 Markdown wrapper 后进入 LightRAG;LightRAG 后台完成状态通过 MNote 有界 status bridge/backoff 同步到 registry 与 FileTree 灯号,而不是新增无界轮询。
|
||||
- 涉及知识库资料索引 / OCR / RAG 时,默认沿 OpenHub/WeKnora 与 provider-neutral `mnote.knowledge_rag.*` / `/api/knowledge-rag/*` 推进。LightRAG source registry、LightRAG dashboard/status bridge 只作为 legacy fallback;新增功能不得再假设 LightRAG 是默认 provider。
|
||||
- 需要架构判断时,优先参考:
|
||||
- `/mnt/Data1T/mnote/ARCHITECTURE.md`
|
||||
- `/mnt/Data1T/mnote/CURRENT_ARCHITECTURE.md`
|
||||
@@ -96,7 +96,7 @@
|
||||
- `/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/07-ai/process/7-68-openhub-weknora-mnote-deep-fusion-checklist-v1.md`
|
||||
|
||||
## 设计稿目录规则
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
- 若发现与当前任务无关的脏改动,保持不动;若怀疑会影响当前任务,先确认再处理。
|
||||
- 若当前问题只是 UI 表现异常,先确认是否是实验性 tree shell、compat 路径、轮询或 fallback 混入首屏主链,而不是直接怀疑 Convex 本身。
|
||||
- 若发现现有轮询或定时刷新链路,不要直接在其上继续叠加补丁;先确认是否能改成事件驱动、watcher/realtime 推送或命令结果定点刷新,再决定是否保留临时 fallback。
|
||||
- Reasonix / subagent 只能作为受控叶子 worker:任务书必须限定读写范围、验证命令、交付文件和禁止项;不得自行再启动 runner、subagent、额外 worktree 或修改任务书。Codex/Hermes 主控必须复核 diff、handoff/result、验证证据和 git 状态后才能采纳。
|
||||
- 子 agent 只能作为受控叶子 worker:任务书必须限定读写范围、验证命令、交付文件和禁止项;不得自行再启动 runner、subagent、额外 worktree 或修改任务书。Codex 主控必须复核 diff、handoff/result、验证证据和 git 状态后才能采纳;Reasonix/Hermes 只属于历史 provider 边界。
|
||||
|
||||
## CodeGraph 使用
|
||||
|
||||
@@ -174,10 +174,10 @@
|
||||
## Wolai-aline 对标流程
|
||||
|
||||
- 凡任务涉及 `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`。
|
||||
- Wolai-aline 任务默认采用“Wolai 基线取证(默认只读,编辑器任务可用 Hermes editable-test mode)-> 本地 RED smoke -> 小范围实现 -> 本地验证 -> subagent 浏览器对标复测 -> 主线程截图复核 -> 汇报剩余差异”的流程。
|
||||
- 浏览器对标测试必须使用 subagent 执行;subagent 只做浏览器验证和截图,不修改源码、不还原文件、不清理证据;编辑器任务可在明确声明的 Hermes editable-test mode 下做最小编辑验证。
|
||||
- Wolai 默认优先只读;当前 Hermes 测试页 `https://www.wolai.com/liaibo/ikFSSM1a4GgvmHBYFCNfVd` 已授权用于 Wolai-aline 编辑器对标,可做最小范围编辑测试。其他 Wolai 页面写入仍需沙盒页 URL 和明确授权。
|
||||
- 即使在 Hermes 测试页,也禁止未经确认地删除、移动、归档、发布、评论、改权限或批量修改既有非测试内容;编辑测试必须记录前后截图、动作链、输入内容和清理状态。
|
||||
- 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`;遇到登录或滑块验证,不绕过,记录阻塞并让用户介入。
|
||||
|
||||
+20
-19
@@ -2,13 +2,13 @@
|
||||
|
||||
> 更新时间:2026-06-07
|
||||
>
|
||||
> 2026-05-22 口径更新:产品形态已切换为 local-first workspace,且初步 MVP 已建立;本地文件夹是默认数据真相,Rust SQLite control-plane 承接 auth、membership、share grants、sync state、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。
|
||||
> 2026-05-22 口径更新:产品形态已切换为 local-first workspace,且初步 MVP 已建立;本地文件夹是默认数据真相,Rust SQLite 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-06-07 口径更新:知识库问答、资料 OCR / parse / index / RAG 已收口到 LightRAG 单外挂 provider。LiteParse、旧本地 OCR sidecar、旧 evidence search / local-index agent tools 不再作为默认 fallback;MNote 负责 source registry、权限、FileTree 灯号、资料库设置 UI、dashboard/status UI、citation/open-reference 映射和 agent facade。图片源通过 MNote 生成 Markdown wrapper 入 LightRAG;LightRAG 后台完成状态通过有界 status bridge/backoff 回写 MNote registry。当前 LightRAG 文本 / extract / query / VLM 模型口径为 `aigc/qwen-3.5`。
|
||||
> 2026-06-28 口径更新:LightRAG / Hermes / Reasonix 已退出当前主线。知识库问答、资料 ingestion / query / citation / open-reference 和 Page AI 融合方向以 WeKnora / OpenHub 为准;LightRAG 仅保留 legacy fallback / parse 兼容边界,Hermes / Reasonix 仅保留 legacy/debug/外部工作流边界。旧 `/api/hermes/*`、`hermes_tools/*`、ACP runtime 命名属于历史命名或迁移中的兼容层,不代表当前产品定义。
|
||||
|
||||
本文只描述当前仓库中真实成立的主线结构,以及当前最优先的架构收口点。
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
3. `mnote-web` 是当前 Rust Web 主执行面,负责 3000 gateway、server-first shell、query / command / projection / transport 与 realtime stream;Next App Router 已降为 legacy compat / island bundle source,不再是当前主入口
|
||||
4. 文档页默认主编辑器已切到页面内 `leptos-tiptap` island
|
||||
5. `BlockNote` 已退出文档页默认主路径,仅作为历史参考实现 / 对照材料保留
|
||||
6. 页面 AI 当前最合理的长期形态是:MNote 只负责页面定位、白名单目录权限、agent runtime 管理、文件变更同步;Hermes / Reasonix 直接在授权工作区内编辑本地文件。`page_ai_workflow` 只保留为 debug / 历史兼容门面,`mnote.doc.markdown_edit` 不作为 local-first 默认正文编辑入口,只在显式 cloud / remote / compat 且无法直接授权文件访问的边界中作为受控 fallback;`mnote.block.*` 只保留为复杂结构辅助层
|
||||
7. 知识库资料处理主线是 LightRAG:OCR、parse、chunk、向量、图谱、RAG query 和跨文档召回由 LightRAG 承担;MNote 不再并行维护 LiteParse / evidence SQLite / OCR sidecar 作为资料库索引真相
|
||||
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. 知识库资料处理主线是 WeKnora / OpenHub:资料 ingestion、检索、引用和跨文档问答由 WeKnora/OpenHub 承担;LightRAG 仅 legacy fallback / parse 兼容,MNote 不再并行维护 LiteParse / evidence SQLite / OCR sidecar 作为资料库索引真相
|
||||
|
||||
一句话收口:
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
> **主 Web 执行面当前以 `mnote-web` 为 3000 owner;Next App Router 只保留为 legacy compat、交互 island bundle source 与显式 debug/迁移辅助边界。**
|
||||
>
|
||||
> **页面 AI 的 local-first 主路径应尽量贴近 VSCode:当前页面解析成真实 `.md` 文件,Hermes / Reasonix 在授权目录白名单内直接读写,tiptap 只消费后台文件变化后的最新投影。知识库问答另走 LightRAG provider,经 MNote source registry 和 citation/open-reference 回到本地资源。**
|
||||
> **页面 AI 的 local-first 主路径应尽量贴近 VSCode:当前页面解析成真实 `.md` 文件,OpenHub / native agent 在授权目录白名单内直接读写,tiptap 只消费后台文件变化后的最新投影。知识库问答走 WeKnora/OpenHub provider,经 MNote source registry 和 citation/open-reference 回到本地资源。**
|
||||
|
||||
## 2. 当前主线目录
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
- `/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、Hermes bridge、stream transport、compat,以及显式开启时的 debug shell;它是当前主 Web gateway / shell / transport owner。
|
||||
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 仅用于审计 / 迁移对照,默认控制面已由 Rust SQLite control-plane 承接。
|
||||
- `/mnt/Data1T/mnote/recycle/wolai-frontend/convex/`
|
||||
@@ -329,10 +329,10 @@ OnlyOffice 仍然是:
|
||||
|
||||
- ✅ 页面 AI 与 ACP runtime 已能承载本地优先方向
|
||||
- ✅ `page_ai_workflow` 已在 local source 下退出主路径
|
||||
- ✅ Hermes tools(`mnote.doc.*` / `mnote.block.*`)已可作为兼容 / cloud / 复杂结构辅助层读取和写入
|
||||
- ✅ legacy tool facade(`mnote.doc.*` / `mnote.block.*`)已可作为兼容 / cloud / 复杂结构辅助层读取和写入
|
||||
- ✅ 本地优先设计已经收口为 VSCode-like 运行模型:页面定位 + 白名单目录 + agent 直改文件 + tiptap 同步显示
|
||||
- ✅ 页面 AI 默认输入已收口到 `currentFile + selection + allowedRoots / aiAccessScope`
|
||||
- ✅ Hermes / Reasonix runtime 已显式带白名单目录运行
|
||||
- ✅ legacy ACP runtime 曾显式带白名单目录运行;当前主线转向 OpenHub / native agent scope
|
||||
- ⬜ MNote 回收 changed_files / diff 审计
|
||||
- ⬜ `scope=selection`、`format=page_xml/text` 继续作为结构化辅助输出,不作为普通 Markdown 编辑必需路径
|
||||
- ⬜ tool manifest annotations 继续补齐 destructive / requiresApproval 等高级语义
|
||||
@@ -341,7 +341,7 @@ OnlyOffice 仍然是:
|
||||
|
||||
关键原则(2026-05-18 口径更新):
|
||||
|
||||
- **local-first 主路径**:当前页面解析成授权 `.md` 文件,Hermes / Reasonix 在白名单目录内直接读写,MNote 负责权限、审计和前台同步
|
||||
- **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`)是过渡实现,应继续退役
|
||||
@@ -356,25 +356,24 @@ OnlyOffice 仍然是:
|
||||
- `/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
|
||||
### 8.5 Knowledge RAG / WeKnora
|
||||
|
||||
目标:
|
||||
|
||||
- 把资料库 OCR、解析、索引、图谱、召回和跨文档问答统一交给 LightRAG。
|
||||
- MNote 只保留 source registry、allowed roots / 权限、FileTree 灯号、资料库设置 UI、LightRAG dashboard/status UI、citation/open-reference 映射和 agent tool facade。
|
||||
- 把资料库 ingestion、检索、引用和跨文档问答统一交给 WeKnora / OpenHub。
|
||||
- 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-06-07):
|
||||
当前进度(2026-06-28):
|
||||
|
||||
- ✅ LightRAG 是当前唯一默认知识库 RAG provider;当前模型口径为 `aigc/qwen-3.5`。
|
||||
- ✅ MNote `source registry` 记录 `workspaceId/rootUri/sourcePath/sourceHash/lightRagDocId/stale/deletedAt/status`,FileTree 灯号从 registry 映射为已索引 / 正在索引 / 失败 / 未索引。
|
||||
- ✅ 图片源通过 Markdown wrapper 入 LightRAG,避免 LightRAG `/documents/scan` 忽略原始图片文件。
|
||||
- ✅ MNote 在 ingest / reindex 后通过有界 status bridge/backoff 对照 LightRAG `/documents`,把后台完成状态同步回 registry、设置面板和 FileTree。
|
||||
- ✅ WeKnora / OpenHub 是当前默认知识库与 Page AI 融合方向。
|
||||
- ✅ MNote `source registry` 记录 `workspaceId/rootUri/sourcePath/sourceHash/providerDocId/stale/deletedAt/status`,FileTree 灯号从 registry 映射为已索引 / 正在索引 / 失败 / 未索引;历史 `lightRagDocId` 只作为兼容字段。
|
||||
- ✅ LightRAG dashboard/status bridge 仅作为 legacy fallback,不再作为新增主路径。
|
||||
- ✅ 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/07-ai/process/7-68-openhub-weknora-mnote-deep-fusion-checklist-v1.md`
|
||||
|
||||
### 8.6 定向 Bug Hunt 与质量基线
|
||||
|
||||
@@ -412,8 +411,10 @@ OnlyOffice 仍然是:
|
||||
- “当前最优先是先做树域 UI 重构”
|
||||
- “Rust Web 还只是实验,没有接真实页面链路”
|
||||
- “页面 AI 编辑必须经过 Hermes agent,没有快路径”
|
||||
- “LightRAG 是当前默认知识库 provider。”
|
||||
- “Hermes / Reasonix 是当前 Page AI 默认 agent runtime。”
|
||||
- “页面 AI 编辑必须经过 MNote 专用工具才能改普通 Markdown”
|
||||
|
||||
当前真正的卡点已经从“能不能跑”变成:
|
||||
|
||||
> **管理员目录授权、文件版本冲突合并、agent diff 审计、本地轻量搜索 / 分享 / 同步如何产品化;知识库 RAG 已交给 LightRAG;Page Aggregate ClientState、projection / command / realtime 兼容链如何继续瘦身。**
|
||||
> **管理员目录授权、文件版本冲突合并、agent diff 审计、本地轻量搜索 / 分享 / 同步如何产品化;知识库 RAG 已转向 WeKnora / OpenHub;Page Aggregate ClientState、projection / command / realtime 兼容链如何继续瘦身。**
|
||||
|
||||
+19
-16
@@ -1,14 +1,16 @@
|
||||
# 当前完整架构
|
||||
|
||||
> 更新时间:2026-06-07
|
||||
> 更新时间:2026-06-28
|
||||
>
|
||||
> 范围:`/mnt/Data1T/mnote` 当前可见实现、local-first MVP 后阶段主线口径、历史退役边界和后续功能缺口。
|
||||
>
|
||||
> 2026-06-28 口径更新:LightRAG / Hermes / Reasonix 已退出当前主线。知识库与 Page AI 融合方向以 WeKnora / OpenHub 为准;LightRAG 仅保留 legacy fallback / parse 兼容边界,Hermes / Reasonix 仅保留 legacy/debug/外部工作流边界。旧 `/api/hermes/*`、`hermes_tools/*`、ACP runtime 命名属于历史命名或迁移中的兼容层,不代表当前产品定义。
|
||||
|
||||
## 1. 当前产品形态
|
||||
|
||||
当前项目口径固定为:
|
||||
|
||||
> **MNote = VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + Hermes / Reasonix agent + simplemindmap / office 插件 + Wolai 主题 Web 壳 + 鉴权控制面。**
|
||||
> **MNote = VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + OpenHub / WeKnora AI + simplemindmap / office 插件 + Wolai 主题 Web 壳 + 鉴权控制面。**
|
||||
|
||||
这意味着:
|
||||
|
||||
@@ -17,9 +19,9 @@
|
||||
- 本地 `.md` 文件是页面正文真相;Page Aggregate、tiptap state、AI context 都是投影或工作副本。
|
||||
- Rust kernel / projection / command 持有树、页面、资源和权限语义。
|
||||
- tiptap 是 Markdown 的前端显示与交互层,不是 agent 的主工作面。
|
||||
- Hermes / Reasonix 默认应像 VSCode 中的 agent 一样,在授权目录白名单内用自身 patch / diff / 文件编辑能力修改文件。
|
||||
- LightRAG 是当前默认知识库 RAG provider,负责资料库 OCR / parse / index / RAG;MNote 负责 source registry、权限、FileTree 灯号、dashboard/status UI 和 citation/open-reference 映射。
|
||||
- Rust SQLite control-plane 是默认 auth、membership、share grants、sync state、AI policy、ACP/Hermes runtime session 控制面;Convex / 服务端不再是默认正文、附件、AI 会话全文主存储,也不再是默认控制面,只保留历史迁移源、显式 cloud source、compat 和 sync replica 边界。
|
||||
- OpenHub / native agent 默认应像 VSCode 中的 agent 一样,在授权目录白名单内用自身 patch / diff / 文件编辑能力修改文件。
|
||||
- WeKnora / OpenHub 是当前默认知识库与 Page AI 融合方向;MNote 负责 source registry、权限、FileTree 灯号、dashboard/status UI 和 citation/open-reference 映射。LightRAG 只保留 legacy fallback / parse 兼容边界。
|
||||
- Rust SQLite 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 属于迁移兼容层。
|
||||
|
||||
上位设计已完成并迁入:
|
||||
|
||||
@@ -56,30 +58,29 @@
|
||||
```text
|
||||
当前页面定位到真实 .md 文件
|
||||
-> MNote 计算登录用户 allowed roots / current file / selection
|
||||
-> Hermes / Reasonix 在白名单目录内运行
|
||||
-> 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`;ACP/Hermes runtime session 默认落到 SQLite control-plane;Convex 只作为显式 legacy/cloud metadata / audit / sync replica 边界。
|
||||
- AI session 全文在 local source 下默认写入 `ai-sessions/private/*.jsonl` 或 `ai-sessions/shared/<share-id>/*.jsonl`;OpenHub scope / AI policy 默认落到 SQLite control-plane;旧 ACP/Hermes runtime session 仅为迁移兼容层;Convex 只作为显式 legacy/cloud metadata / audit / sync replica 边界。
|
||||
|
||||
### 2.5 Knowledge RAG / LightRAG
|
||||
### 2.5 Knowledge RAG / WeKnora
|
||||
|
||||
- 知识库问答、资料 OCR、parse、chunk、vector、graph、rerank、query 统一由 LightRAG 承担;当前模型口径为 `aigc/qwen-3.5`。
|
||||
- MNote 不复制 LightRAG 图谱或 chunk,不把 LightRAG storage 当用户正文真相;原始 source 仍属于 local-folder / Resource Tree。
|
||||
- MNote 维护 `<workspace>/.mnote/index/lightrag-source-registry.json`,用于映射 `workspaceId/rootUri/sourcePath/sourceHash/lightRagDocId/stale/deletedAt/status`。
|
||||
- FileTree 的资料库灯号来自 LightRAG source registry:绿灯已索引、黄灯正在索引或删除提交中、红灯失败 / 过期、无灯未索引或已移除。
|
||||
- 图片源先由 MNote 生成 Markdown wrapper,再交给 LightRAG scan;不能假设 LightRAG 会直接索引原始 `png/jpg`。
|
||||
- MNote 在 ingest / reindex 后用有界 status bridge/backoff 同步 LightRAG 后台完成状态,刷新 registry、资料库面板和 FileTree。
|
||||
- 知识库问答、资料 ingestion / query / citation / open-reference 当前主线转向 WeKnora / OpenHub。
|
||||
- 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、`lightrag-source-registry` 和 MCP bridge 只保留为 legacy fallback;新增能力不得依赖 LightRAG 默认存在。
|
||||
- Agent 只通过 `mnote.knowledge_rag.status/query/open_reference` 访问知识库;旧 LiteParse、OCR sidecar、`mnote.evidence.*` 与本地资料索引工具已退役为历史 / recycle 边界。
|
||||
|
||||
## 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`、`hermes_tools`、local/shared AI session、local-first Convex guard、Convex export fixture、local asset upload smoke、external-change conflict smoke 均已作为 `2-2` 验收证据记录。
|
||||
- `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 源码回流默认控制面。
|
||||
@@ -127,7 +128,7 @@
|
||||
10. **本地轻量搜索与知识库 RAG 边界**
|
||||
- 本地 `.md` workspace 需要独立索引:全文搜索、反链、页面引用、资源引用、标签。
|
||||
- 不能依赖 Convex search 才能搜索本地工作区。
|
||||
- 多资料 OCR / parse / index / RAG 不再由本地 evidence / LiteParse 承担,默认走 LightRAG provider。
|
||||
- 多资料 OCR / parse / index / RAG 不再由本地 evidence / LiteParse 承担,默认走 WeKnora / OpenHub provider;LightRAG 仅 legacy fallback。
|
||||
|
||||
11. **分享与同步闭环**
|
||||
- 需要把 share grants、shared workspace cache、shared AI session、只读/可写权限和冲突处理连成产品级闭环。
|
||||
@@ -156,5 +157,7 @@
|
||||
- “Next App Router / wolai-frontend 是 3000 主运行时。”
|
||||
- “LiteParse / 本地 OCR sidecar / evidence search 仍是资料库 RAG 默认 fallback。”
|
||||
- “MNote 需要为 LightRAG 结果再建一套 RAG 索引真相。”
|
||||
- “LightRAG 是当前默认知识库 provider。”
|
||||
- “Hermes / Reasonix 是当前 Page AI 默认 agent runtime。”
|
||||
|
||||
历史文件如果需要保留这些说法,必须明确标注为 `[recycle]`、legacy、review snapshot 或 compat / cloud source 背景。
|
||||
|
||||
+6
-4
@@ -1,15 +1,17 @@
|
||||
# MNOTE — Reasonix working knowledge
|
||||
# [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 前端编辑器 + Hermes/Reasonix agent + simplemindmap/office 插件 + Wolai 主题 Web 壳 + 鉴权控制面`。
|
||||
- 产品形态固定为:`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、ACP/Hermes runtime session 等控制面;Convex / 服务端不再是默认正文、附件、AI 会话全文主存储,只保留历史迁移源、显式 cloud source、compat 和 sync replica 边界。
|
||||
- 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 当前统一到 LightRAG:LiteParse、旧 OCR sidecar、旧 evidence search / local-index agent tools 不再作为默认 fallback;LightRAG 负责 OCR / parse / index / RAG,MNote 负责 source registry、权限、FileTree 灯号、资料库 UI、dashboard/status 和 citation/open-reference。当前模型口径为 `aigc/qwen-3.5`。
|
||||
- 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
|
||||
|
||||
|
||||
+6
-4
@@ -4,7 +4,9 @@
|
||||
>
|
||||
> 当前状态:`DONE`
|
||||
>
|
||||
> 2026-05-22 口径补充:本文完成的是“local-first workspace + Convex 降级控制面”的阶段性方案;后续 `2-8` 已继续把默认控制面从 Convex 替换为 Rust SQLite `control-plane`。因此本文中“Convex / 服务端控制面”的表述只作为阶段性历史背景理解;当前默认 auth、membership、share grants、sync state、AI policy、ACP/Hermes runtime session 已由 SQLite control-plane 承接,Convex 仅保留历史迁移源、显式 cloud source / compat / sync replica 边界。
|
||||
> 2026-05-22 口径补充:本文完成的是“local-first workspace + Convex 降级控制面”的阶段性方案;后续 `2-8` 已继续把默认控制面从 Convex 替换为 Rust SQLite `control-plane`。因此本文中“Convex / 服务端控制面”的表述只作为阶段性历史背景理解;当前默认 auth、membership、share grants、sync state、AI policy、Page AI runtime session 已由 SQLite control-plane 承接,Convex 仅保留历史迁移源、显式 cloud source / compat / sync replica 边界。
|
||||
>
|
||||
> 2026-06-28 口径补充:Hermes / Reasonix / LightRAG 已退出当前新增主线;当前 Page AI 与知识库融合方向按 OpenHub / opencode / WeKnora 理解,旧名称只作为历史命名、legacy route 或迁移对照。
|
||||
>
|
||||
> 本稿目的:
|
||||
> 1. 固定早期产品形态:10 人以内、用户笔记默认独立、可分享、AI 隔离且可共享。
|
||||
@@ -79,13 +81,13 @@ User
|
||||
|
||||
更准确的产品定义是:
|
||||
|
||||
> **MNote = VSCode 简化版工作区内核 + tiptap markdown 编辑器 + Hermes / Reasonix agent + simplemindmap / office 插件 + Wolai 风格 web 壳 + 鉴权控制面。**
|
||||
> **MNote = VSCode 简化版工作区内核 + tiptap markdown 编辑器 + OpenHub / opencode agent + WeKnora 知识库融合 + simplemindmap / office 插件 + Wolai 风格 web 壳 + 鉴权控制面。**
|
||||
|
||||
拆开看:
|
||||
|
||||
- **VSCode 简化版工作区内核**:本地文件夹、目录树、页面树、资源树、拖拽、重命名、移动、回收站、导入导出。
|
||||
- **tiptap markdown 编辑器**:页面正文的前端显示与交互层,消费本地文件投影,不承担 agent 主编辑面职责。
|
||||
- **Hermes / Reasonix agent**:在授权目录白名单内直接读写本地文件,尽量复用它们已有的权限和文件编辑能力。
|
||||
- **OpenHub / opencode agent**:在 MNote 宿主授权 scope 内处理 Page AI 对话、文件引用和 WeKnora 知识库引用;旧 Hermes / Reasonix 只作为 legacy/debug 对照。
|
||||
- **simplemindmap / office 插件**:作为资源型编辑器或附件打开器存在,不把它们重新降格成 markdown 文本块。
|
||||
- **Wolai 风格 web 壳**:提供统一导航、主题、页面壳、AI 面板、侧边栏和分享入口。
|
||||
- **鉴权控制面**:负责登录、用户隔离、目录授权、分享授权、同步状态和审计,而不是默认正文存储。
|
||||
@@ -898,7 +900,7 @@ local-first 下,AI 的长期主路径不是继续发明一套 MNote 专用编
|
||||
|
||||
#### A. 防走偏护栏与口径同步
|
||||
|
||||
- [x] A1. 固定主路径口径:`MNote = VSCode 简化版工作区 + tiptap markdown 显示/编辑层 + Hermes/Reasonix agent + 插件 + Wolai web 壳 + 鉴权控制面`。
|
||||
- [x] A1. 固定主路径口径:`MNote = VSCode 简化版工作区 + tiptap markdown 显示/编辑层 + OpenHub/opencode agent + WeKnora 知识库融合 + 插件 + Wolai web 壳 + 鉴权控制面`。
|
||||
- 文档:本稿第 2.1、2.4、5、6 节。
|
||||
- 验收:普通 local-first Markdown 编辑不再被描述为必须走 `mnote.block.*`、`mnote.doc.markdown_edit` 或 Convex documents。
|
||||
- [x] A2. 建立 Convex 主存储新增检查。
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# 7-18 [process] local-first agent 文件编辑控制面 v1
|
||||
|
||||
> 2026-06-28 覆盖说明:本文中的 Hermes / Reasonix 主路径口径已退为历史参考。当前 Page AI / agent runtime 主线以 OpenHub / opencode / WeKnora 融合设计为准,见 `7-68-openhub-weknora-mnote-deep-fusion-v1.md` 与 `7-69-weknora-native-embed-mnote-openhub-governance-v1.md`。本文仅保留 local-first 文件授权、watcher 同步和冲突模型的参考价值。
|
||||
|
||||
> 创建时间:2026-05-22
|
||||
>
|
||||
> 当前状态:`PROCESS`
|
||||
|
||||
@@ -245,7 +245,7 @@ PPT:
|
||||
- 必须保存截图并检查 `pageErrors=[]`
|
||||
|
||||
3. Tool API smoke
|
||||
- 通过 `/api/hermes/tools/mnote/call`
|
||||
- 通过 `/api/mnote/tools/call`;旧 `/api/hermes/tools/mnote/call` 只作为 legacy alias 验证
|
||||
- 验证 agent 实际可调用
|
||||
|
||||
完成标准:
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# 7-47 MNote 公共 capability/plugin 注册表设计 v1
|
||||
|
||||
> 2026-06-28 覆盖说明:本文的 Hermes / Reasonix / LightRAG 能力注册口径已退为 legacy 参考。当前能力模型应围绕 OpenHub / opencode / WeKnora,旧 `mnote-knowledge-rag` 与 `mnote_lightrag_bridge` 仅保留兼容映射和迁移对照。
|
||||
|
||||
> 状态:process
|
||||
>
|
||||
> 目标:把当前分裂的 MNote builtin skill、mnote tool manifest、Hermes plugin、Reasonix wrapper 和 Page AI UI 开关收口为同一个“AI 能力”模型。对用户来说 skill / plugin / tool 都是“授予 AI 的能力”,UI 不应暴露实现层分类;实现层再把一个能力映射到说明书、工具、runtime adapter 和权限策略。本轮只整理 MNote 公共能力;Reasonix / Hermes 自带的 skills/plugins 维持现状,不纳入统一注册表迁移范围。
|
||||
@@ -72,8 +74,10 @@
|
||||
|
||||
执行入口:
|
||||
|
||||
- `/api/hermes/tools/mnote/manifest`
|
||||
- `/api/hermes/tools/mnote/call`
|
||||
- 当前中性入口:`/api/mnote/tools/manifest`
|
||||
- 当前中性入口:`/api/mnote/tools/call`
|
||||
- legacy alias:`/api/hermes/tools/mnote/manifest`
|
||||
- legacy alias:`/api/hermes/tools/mnote/call`
|
||||
- `execute_mnote_tool_call()` 统一做认证、profile 禁用检查、workspace 校验、capabilityScope 校验、写入 guard、audit、idempotency。
|
||||
|
||||
问题:
|
||||
@@ -94,7 +98,7 @@
|
||||
- 这是 Hermes 用户插件,不在 mnote repo 内。
|
||||
- `plugin.yaml` 只列出旧批次工具:`mnote_page_get/save/update_title/update_options`、`mnote_doc_*`、`mnote_block_*`、artifact 等。
|
||||
- 没有 `mnote_evidence_*`、`mnote_index_*`、mindmap、onlyoffice live 等新工具。
|
||||
- `__init__.py` 手写 Python wrapper,把 Hermes tool call 转发到 `/api/hermes/tools/mnote/call`。
|
||||
- `__init__.py` 手写 Python wrapper,把 Hermes tool call 转发到 legacy `/api/hermes/tools/mnote/call`;OpenHub/WeKnora 主线应使用 `/api/mnote/tools/call`。
|
||||
|
||||
问题:
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# 7-54 RAG-Anything 对照后的多模态检索设计 v1
|
||||
|
||||
> 2026-06-28 覆盖说明:本文围绕 LightRAG 增强撰写,已被 WeKnora / OpenHub 知识库主线覆盖。保留为多模态检索参考材料,不作为当前实施依据。
|
||||
|
||||
> 创建时间:2026-06-08
|
||||
>
|
||||
> 当前状态:`process`
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# 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-13
|
||||
>
|
||||
> 当前状态:`PROCESS`
|
||||
@@ -490,4 +492,3 @@ def resolve_virtual_path(thread_id, virtual_path, *, uid):
|
||||
- 新增 smoke:`scripts/task561-extensions-settings-smoke.js`(Batch B+C)
|
||||
- 新增 smoke:`scripts/task561-dashboard-smoke.js`(Batch E)
|
||||
- 登录态浏览器验证:settings 扩展 tab、知识库详情页、Dashboard 页面均可正常访问
|
||||
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
# design 设计稿索引
|
||||
|
||||
> 更新时间:2026-05-26
|
||||
> 更新时间:2026-06-28
|
||||
>
|
||||
> 当前产品口径:`VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + Hermes/Reasonix agent + simplemindmap/office 插件 + Wolai 主题 Web 壳 + 鉴权控制面`。
|
||||
> 当前产品口径:`VSCode 简化版工作区 + tiptap 的 Markdown 前端编辑器 + OpenHub/opencode agent + WeKnora 知识库融合 + 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、ACP/Hermes runtime session 控制面;Convex / 服务端只作为历史迁移源、显式 cloud source、compat 和 sync replica。入口设计见:
|
||||
> 当前上位主线: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。入口设计见:
|
||||
> `/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`
|
||||
>
|
||||
|
||||
@@ -1473,7 +1473,7 @@ export const createResourceTabRuntime = (dependencies = {}) => {
|
||||
};
|
||||
|
||||
const knowledgeRagProvider = () => {
|
||||
return 'lightrag';
|
||||
return 'weknora';
|
||||
};
|
||||
|
||||
const setKnowledgeRagStatus = (entry, status, message, job) => {
|
||||
@@ -1521,7 +1521,7 @@ export const createResourceTabRuntime = (dependencies = {}) => {
|
||||
sourceRootRelativePath,
|
||||
rootUri: String(registryEntry.rootUri || rootUri || '').trim(),
|
||||
artifactRootRelativePath: '',
|
||||
provider: 'lightrag',
|
||||
provider: knowledgeRagProvider(),
|
||||
status,
|
||||
stageLabel: status === 'done' ? '资料库已索引' : status === 'failed' ? '资料库需重建' : '资料库索引中',
|
||||
stale: registryEntry.stale === true,
|
||||
@@ -1901,7 +1901,7 @@ export const createResourceTabRuntime = (dependencies = {}) => {
|
||||
};
|
||||
|
||||
const insertRetiredOcrLink = async (entry, job) => {
|
||||
throw new Error('OCR sidecar 已退役,请使用 LightRAG 资料库引用与问答。');
|
||||
throw new Error('OCR sidecar 已退役,请使用知识库引用与问答。');
|
||||
};
|
||||
|
||||
const createKnowledgeRagIngestTask = async (entry) => {
|
||||
@@ -1909,7 +1909,7 @@ export const createResourceTabRuntime = (dependencies = {}) => {
|
||||
const entryRootUri = String(entry.rootUri || '').trim();
|
||||
if (entryRootUri) knowledgeRagTaskState.rootUri = entryRootUri;
|
||||
const startedAt = Date.now();
|
||||
const pendingJob = knowledgeRagTaskSnapshotFromEntry(entry, 'running', 'lightrag', '资料库索引中', startedAt);
|
||||
const pendingJob = knowledgeRagTaskSnapshotFromEntry(entry, 'running', knowledgeRagProvider(), '资料库索引中', startedAt);
|
||||
pendingJob.taskKind = 'knowledge_rag';
|
||||
setKnowledgeRagStatus(entry, 'running', '资料库索引中', pendingJob);
|
||||
updateKnowledgeRagTaskState(pendingJob);
|
||||
@@ -1945,7 +1945,7 @@ export const createResourceTabRuntime = (dependencies = {}) => {
|
||||
const job = knowledgeRagJobFromRegistryEntry(registryEntry, entryRootUri) || {
|
||||
...pendingJob,
|
||||
status: payload.retryRequired ? 'running' : 'done',
|
||||
stageLabel: payload.retryRequired ? 'LightRAG 忙碌,等待重试' : '资料库已提交索引',
|
||||
stageLabel: payload.retryRequired ? '知识库忙碌,等待重试' : '资料库已提交索引',
|
||||
updatedAtMs: Date.now(),
|
||||
finishedAtMs: payload.retryRequired ? null : Date.now(),
|
||||
};
|
||||
|
||||
@@ -212,7 +212,7 @@ mod tests {
|
||||
"dryRun": false
|
||||
},
|
||||
"tool": {
|
||||
"tool": "mnote.knowledge_rag.query",
|
||||
"tool": "search_web",
|
||||
"kind": "query",
|
||||
"mode": "plan",
|
||||
"argsJson": {"query": "Rust Web"},
|
||||
|
||||
@@ -2050,6 +2050,7 @@ fn delete_sqlite_user_access_grant_for_context(
|
||||
"普通用户只能撤销自己创建的文件夹授权",
|
||||
));
|
||||
}
|
||||
let revoked_user_id = grant.user_id.clone();
|
||||
state
|
||||
.control_plane()
|
||||
.revoke_directory_grant(grant_id, None)
|
||||
@@ -2079,6 +2080,7 @@ fn delete_sqlite_user_access_grant_for_context(
|
||||
"ok": true,
|
||||
"controlPlane": "sqlite",
|
||||
"deletedGrantId": grant_id,
|
||||
"revokedUserId": revoked_user_id,
|
||||
"policy": {
|
||||
"grants": state
|
||||
.control_plane()
|
||||
|
||||
@@ -987,6 +987,13 @@ pub fn build_router(state: AppState) -> Router {
|
||||
.route("/mnote/manifest", get(hermes_tools::mnote_manifest))
|
||||
.route("/mnote/call", post(hermes_tools::mnote_call))
|
||||
.route("/mnote/audit", get(hermes_tools::mnote_audit)),
|
||||
)
|
||||
.nest(
|
||||
"/api/mnote/tools",
|
||||
Router::new()
|
||||
.route("/manifest", get(hermes_tools::mnote_manifest))
|
||||
.route("/call", post(hermes_tools::mnote_call))
|
||||
.route("/audit", get(hermes_tools::mnote_audit)),
|
||||
);
|
||||
|
||||
if enable_debug_shell_routes {
|
||||
@@ -1132,6 +1139,34 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn mnote_tools_have_current_alias_and_legacy_hermes_mount() {
|
||||
for (method, path) in [
|
||||
("GET", "/api/mnote/tools/manifest"),
|
||||
("POST", "/api/mnote/tools/call"),
|
||||
("GET", "/api/mnote/tools/audit"),
|
||||
("GET", "/api/hermes/tools/mnote/manifest"),
|
||||
("POST", "/api/hermes/tools/mnote/call"),
|
||||
("GET", "/api/hermes/tools/mnote/audit"),
|
||||
] {
|
||||
let response = app(false)
|
||||
.oneshot(
|
||||
Request::builder()
|
||||
.method(method)
|
||||
.uri(path)
|
||||
.body(Body::empty())
|
||||
.expect("request"),
|
||||
)
|
||||
.await
|
||||
.expect("response");
|
||||
assert_ne!(
|
||||
response.status(),
|
||||
StatusCode::NOT_FOUND,
|
||||
"{method} {path} 应挂到 MNote tool executor;Hermes 路径只作为 legacy alias 保留",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn legacy_media_routes_return_retired_guard() {
|
||||
for (method, path, operation) in [
|
||||
|
||||
@@ -538,7 +538,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn page_layout_exposes_lightrag_knowledge_rag_settings_only() {
|
||||
fn page_layout_exposes_provider_neutral_knowledge_rag_settings_only() {
|
||||
let html = crate::ssr::render_view(leptos::view! {
|
||||
<super::PageLayout current_nav="documents" topbar_title={"个人".to_string()}>
|
||||
<main>"正文"</main>
|
||||
@@ -558,7 +558,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sidebar_settings_runtime_routes_index_and_ocr_to_lightrag_settings() {
|
||||
fn sidebar_settings_runtime_routes_index_and_ocr_to_knowledge_rag_settings() {
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("mnote-knowledge-rag-settings-popover"));
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("/api/knowledge-rag/status?"));
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("/api/knowledge-rag/pipeline-events"));
|
||||
@@ -568,7 +568,7 @@ mod tests {
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("data-knowledge-rag-action=\"prune\""));
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("mnote-knowledge-rag-source-filters"));
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("filter-sources"));
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("LightRAG 未映射"));
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("Provider 未映射"));
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("Rerank"));
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("scheduleKnowledgeRagStatusBridge"));
|
||||
assert!(SIDEBAR_PAGE_SETTINGS_RUNTIME_JS.contains("knowledgeRagStatusHasInFlight"));
|
||||
@@ -719,7 +719,7 @@ mod tests {
|
||||
assert!(SIDEBAR_PAGE_AI_SKILL_RUNTIME_JS.contains("function pageAiSkillPreferenceTable"));
|
||||
assert!(SIDEBAR_PAGE_AI_SKILL_RUNTIME_JS.contains("ai.agent.reasonix.memory_enabled"));
|
||||
assert!(SIDEBAR_PAGE_AI_SESSION_RUNTIME_JS.contains("function pageAiLoadBackendSessions"));
|
||||
assert!(SIDEBAR_PAGE_AI_SESSION_RUNTIME_JS.contains("/api/hermes/client/sessions?"));
|
||||
assert!(SIDEBAR_PAGE_AI_SESSION_RUNTIME_JS.contains("/api/page-ai/sessions?"));
|
||||
assert!(SIDEBAR_PAGE_AI_SESSION_RUNTIME_JS.contains("params.set('source', 'acp')"));
|
||||
assert!(SIDEBAR_PAGE_AI_SESSION_RUNTIME_JS.contains(
|
||||
"var draftSessions = pageAiNormalizeArray(pageUiState.pageAiSessions).filter"
|
||||
@@ -795,8 +795,8 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn page_ai_acp_runtime_defaults_to_reasonix_and_keeps_hermes_switch() {
|
||||
assert!(SIDEBAR_PAGE_AI_RUNTIME_JS.contains("var PAGE_AI_SESSION_STORAGE_VERSION = 3"));
|
||||
fn page_ai_acp_runtime_legacy_selector_contract_is_explicit() {
|
||||
assert!(SIDEBAR_PAGE_AI_RUNTIME_JS.contains("var PAGE_AI_SESSION_STORAGE_VERSION = 4"));
|
||||
assert!(SIDEBAR_PAGE_AI_RUNTIME_JS.contains("function ensurePageAiStateFacade"));
|
||||
assert!(SIDEBAR_PAGE_AI_RUNTIME_JS.contains("pageAiAcpRuntime: 'reasonix'"));
|
||||
assert!(!SIDEBAR_TREE_RUNTIME_JS.contains("pageAiAcpRuntime: 'reasonix'"));
|
||||
|
||||
@@ -217,6 +217,6 @@ mod tests {
|
||||
assert!(MNOTE_CSS.len() > 2000);
|
||||
// CSS 已拆分为模块化文件,通过 concat!(include_str!()) 组装,
|
||||
// 仍保持在可审阅范围内。
|
||||
assert!(MNOTE_CSS.len() < 180000);
|
||||
assert!(MNOTE_CSS.len() < 190000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,15 +28,15 @@ node scripts/task167-local-markdown-title-body-options-no-convex-smoke.js
|
||||
node scripts/task490-runtime-surfaces-smoke.js
|
||||
```
|
||||
|
||||
其中 `task490-runtime-surfaces-smoke.js` 是轻量浏览器 smoke,验证页面设置、Page AI drawer 打开/关闭、Page AI stop-run abort、slash menu、block handle menu 能在当前 leptos-tiptap 文档页工作;它使用 mock run 覆盖停止按钮,不要求真实模型返回,也不替代更重的页面设置、Hermes/Page AI 或编辑器菜单专项脚本。
|
||||
其中 `task490-runtime-surfaces-smoke.js` 是轻量浏览器 smoke,验证页面设置、Page AI drawer 打开/关闭、Page AI stop-run abort、slash menu、block handle menu 能在当前 leptos-tiptap 文档页工作;它使用 mock run 覆盖停止按钮,不要求真实模型返回,也不替代更重的页面设置、OpenHub/Page AI 或编辑器菜单专项脚本。
|
||||
|
||||
### 0.1 当前主链优先脚本
|
||||
|
||||
- 入口与认证:`task114-rust-web-gateway-entry-smoke.js`、`task159-auth-entry-smoke.js`、`task097-homepage-entry-smoke.js`
|
||||
- Rust SSR 文档页 / Page Aggregate:local-first 默认优先 `task167-local-markdown-title-body-options-no-convex-smoke.js`;Page Aggregate browser conversion / compat fallback 改动补跑 `task522-page-aggregate-compat-fallback-contract.js`;cloud/control-plane 文档可补跑 `task110-page-title-single-truth-smoke.js`、`task-page-aggregate-body-sync-smoke.js`、`task-page-aggregate-options-sync-smoke.js`、`task-page-aggregate-refresh-persistence-smoke.js`
|
||||
- leptos-tiptap runtime surface:`task490-runtime-surfaces-smoke.js`;需要验证保存回读可补跑 `task121-rust-web-editor-island-hydration-smoke.js`,但它仍使用 `/api/tree/commands create` 准备文档,不作为无 Convex 默认基线;需要验证浮层互斥和更多菜单状态时再跑 `task158-e30-menu-state-smoke.js`
|
||||
- local-first 本地工作区:`task164-desktop-hot-local-folder-main-entry-smoke.js`、`task166-local-first-managed-workspace-no-convex-smoke.js`、`task167-local-markdown-title-body-options-no-convex-smoke.js`、`task436-local-markdown-open-document-external-change-smoke.js`、`task443-local-markdown-asset-upload-smoke.js`、`task451-local-markdown-conflict-resolution-ui-smoke.js`、`task452-local-search-index-browser-smoke.js`、`task453-local-folder-page-ai-changed-files-smoke.js`;WorkspacePath / ObjectIdentity runtime 消费统一改动补跑 `task524-workspace-object-identity-matrix-smoke.js`。`task452` 只覆盖普通本地搜索、settings API、tag/backlink API 和旧 local-index UI 不复活;资料库问答、PDF/Office/image source ingestion 与引用回跳改跑 LightRAG 脚本。
|
||||
- LightRAG 资料库:`task534-knowledge-rag-source-management-scope-smoke.js` 覆盖本地文件夹 source 加入资料库、registry 状态与范围管理;`task529-knowledge-rag-citation-resource-tab-smoke.js`、`task530-knowledge-rag-page-ai-final-answer-smoke.js` 覆盖资料库引用回到资源页与 Page AI 最终回答。旧 `task526-local-folder-ocr-api-smoke.js` / OCR sidecar 链路已退役并软归档;`/api/search/documents` 不作为 LightRAG、LiteParse、OCR sidecar 或 evidence.sqlite 的资料库问答 fallback。
|
||||
- local-first 本地工作区:`task164-desktop-hot-local-folder-main-entry-smoke.js`、`task166-local-first-managed-workspace-no-convex-smoke.js`、`task167-local-markdown-title-body-options-no-convex-smoke.js`、`task436-local-markdown-open-document-external-change-smoke.js`、`task443-local-markdown-asset-upload-smoke.js`、`task451-local-markdown-conflict-resolution-ui-smoke.js`、`task452-local-search-index-browser-smoke.js`、`task453-local-folder-page-ai-changed-files-smoke.js`;WorkspacePath / ObjectIdentity runtime 消费统一改动补跑 `task524-workspace-object-identity-matrix-smoke.js`。`task452` 只覆盖普通本地搜索、settings API、tag/backlink API 和旧 local-index UI 不复活;资料库问答、PDF/Office/image source ingestion 与引用回跳改跑 WeKnora / provider-neutral knowledge-rag 脚本。
|
||||
- WeKnora / OpenHub 资料库:`task781-knowledge-bases-registry-smoke.js`、`task785-weknora-create-kb-folder-ingest-search-smoke.js`、`task787-weknora-default-lightrag-legacy-smoke.js`、`task772-openhub-weknora-kb-ui-smoke.js` 覆盖默认 provider、知识库列表、摄取、搜索、引用桥接与 legacy LightRAG guard。旧 `task529/530/531/534` LightRAG 脚本只作为 legacy fallback / 历史对照,不进入默认回归。旧 `task526-local-folder-ocr-api-smoke.js` / OCR sidecar 链路已退役并软归档;`/api/search/documents` 不作为 WeKnora、LightRAG legacy、LiteParse、OCR sidecar 或 evidence.sqlite 的资料库问答 fallback。
|
||||
- local Markdown conflict regression:`task510-local-markdown-conflict-regression-group.js` 串联真实冲突、连续上传、新建页面、外部恢复、多 tab CAS 与上传 409 孤儿策略;可用 `MNOTE_CONFLICT_REGRESSION_TASKS=a.js,b.js` 做定点子集。
|
||||
- tree realtime / live cache:`task446-tree-rename-dual-browser-live-smoke.js`、`task447-tree-move-order-dual-browser-live-smoke.js`、`task448-tree-resync-recovery-dual-browser-smoke.js`、`task449-tree-sse-reconnect-snapshot-recovery-smoke.js`
|
||||
- 资源对象与 mindmap:`task455-local-folder-mindmap-clean-smoke.js`、`task456-resource-object-shell-sync-smoke.js`、`task166-mindmap-phase6-block-smoke.js`、`task167-mindmap-kmind-parity-smoke.js`、`task168-mindmap-put-validator-smoke.js`;Page AI mindmap skill / 资源生成改动补跑 `task503-mindmap-skill-capability-smoke.js`,真实 mindmap resource tab / Page AI target 改动补跑 `task525-page-ai-mindmap-resource-target-smoke.js`
|
||||
@@ -122,7 +122,7 @@ node scripts/task490-runtime-surfaces-smoke.js
|
||||
- `task129-wolai-aline-baseline-smoke.js`
|
||||
- `task130` 到 `task137` 一系列 `wolai-aline-*`
|
||||
- `task160-wolai-page-settings-shell-smoke.js`
|
||||
- 页面 AI 旧 `/api/ai-agent/run` 视觉 smoke 已移入本机 gitignored `recycle/scripts/retired-ai-agent-run-smokes/`;当前页面 AI 验证优先使用 Hermes 相关 smoke 与 `task-page-block-ai-tools-smoke.js`
|
||||
- 页面 AI 旧 `/api/ai-agent/run` 视觉 smoke 已移入本机 gitignored `recycle/scripts/retired-ai-agent-run-smokes/`;当前页面 AI 验证优先使用 OpenHub / opencode / Page AI smoke 与 `task-page-block-ai-tools-smoke.js`。Hermes 相关 smoke 只作为 legacy guard / 历史对照。
|
||||
|
||||
这一层最重要的原则不是“文案命中”,而是:
|
||||
|
||||
@@ -185,7 +185,7 @@ node scripts/task097-homepage-entry-smoke.js
|
||||
- local-first:优先使用 `task164-desktop-hot-local-folder-main-entry-smoke.js`、`task166-local-first-managed-workspace-no-convex-smoke.js`、`task167-local-markdown-title-body-options-no-convex-smoke.js`、`task455-local-folder-mindmap-clean-smoke.js`
|
||||
- 页面设置:`task160`、`task164-page-options-visible-effect-smoke.js`
|
||||
- 双栏:`task165`
|
||||
- AI:优先使用 `task-hermes-page-ai-retirement-guard.js`、`task-page-block-ai-tools-smoke.js` 和当前 Hermes 页面 AI smoke;Page AI history / skills / ChatOnly 相关改动补跑 `task503-mindmap-skill-capability-smoke.js`、`task504-page-ai-history-agent-filter-smoke.js`、`task512-chatonly-doubao-sync-smoke.js`、`task513-chatonly-provider-sync-smoke.js`;OnlyOffice live bridge 改动补跑 `task515-onlyoffice-live-scope-http-smoke.js`、`task516-onlyoffice-bridge-multisession-browser-smoke.js`、`task517-onlyoffice-bridge-plugin-direct-smoke.js`、`task518-onlyoffice-real-iframe-session-scope-smoke.js`,其中 `task516/517` 覆盖 bridge session lifecycle 与 `docKey/pageOrigin` 元数据;Page AI 真实 target picker / Office live session 改动补跑 `task523-page-ai-onlyoffice-real-target-session-smoke.js`;`task155`、`task156`、`task161` 等旧 `/api/ai-agent/run` smoke 只保留在本机 gitignored `recycle/scripts/retired-ai-agent-run-smokes/` 做历史对照
|
||||
- AI:优先使用 OpenHub / opencode / Page AI 当前主线 smoke、`task-page-block-ai-tools-smoke.js` 和 `task-hermes-page-ai-retirement-guard.js` 这类 legacy guard;Hermes 页面 AI smoke 只作为历史对照。Page AI history / skills / ChatOnly 相关改动补跑 `task503-mindmap-skill-capability-smoke.js`、`task504-page-ai-history-agent-filter-smoke.js`、`task512-chatonly-doubao-sync-smoke.js`、`task513-chatonly-provider-sync-smoke.js`;OnlyOffice live bridge 改动补跑 `task515-onlyoffice-live-scope-http-smoke.js`、`task516-onlyoffice-bridge-multisession-browser-smoke.js`、`task517-onlyoffice-bridge-plugin-direct-smoke.js`、`task518-onlyoffice-real-iframe-session-scope-smoke.js`,其中 `task516/517` 覆盖 bridge session lifecycle 与 `docKey/pageOrigin` 元数据;Page AI 真实 target picker / Office live session 改动补跑 `task523-page-ai-onlyoffice-real-target-session-smoke.js`;`task155`、`task156`、`task161` 等旧 `/api/ai-agent/run` smoke 只保留在本机 gitignored `recycle/scripts/retired-ai-agent-run-smokes/` 做历史对照
|
||||
|
||||
原则:
|
||||
|
||||
|
||||
@@ -107,7 +107,8 @@ async function main() {
|
||||
"OpenHub backend exposes MNote WeKnora readonly facade endpoint",
|
||||
backendApi.includes("/api/mnote/tools/call") &&
|
||||
backendApi.includes("call_mnote_weknora_tool") &&
|
||||
backendBridge.includes("MNOTE_TOOL_CALL_ENDPOINT = \"/api/hermes/tools/mnote/call\"")
|
||||
backendBridge.includes("MNOTE_TOOL_CALL_ENDPOINT = \"/api/mnote/tools/call\"") &&
|
||||
!backendBridge.includes("MNOTE_TOOL_CALL_ENDPOINT = \"/api/hermes/tools/mnote/call\"")
|
||||
);
|
||||
assertCheck(
|
||||
failures,
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
# MNote knowledge RAG
|
||||
|
||||
使用场景:用户要求“资料库问答”、跨多本书/论文/PDF/Office 附件问答,或明确需要 LightRAG 知识库结果。
|
||||
> 2026-06-28 口径:当前默认知识库主线已切到 WeKnora / OpenHub。本文中的 LightRAG 说明仅适用于 legacy fallback / 历史桥接,不作为默认资料库问答路径。
|
||||
|
||||
使用场景:用户要求“资料库问答”、跨多本书/论文/PDF/Office 附件问答,或明确需要 WeKnora/OpenHub 知识库结果。
|
||||
|
||||
工具使用:
|
||||
|
||||
- 先用 `mnote.knowledge_rag.status` 检查 LightRAG provider 是否可用、当前 root 是否有 source registry。
|
||||
- 用 `mnote.knowledge_rag.query` 提问。默认 `mode=mix`,需要跨资料总结时可用 `global`。指定资料细节时可传 `sourcePaths`,但当前语义是 LightRAG provider 检索后,MNote 只过滤返回的 `references`;不要把 `raw` 当作已被 scope 限制的来源。
|
||||
- 先用 `mnote.knowledge_rag.status` 检查当前知识库 provider 是否可用、当前 root 是否有 source registry。
|
||||
- 用 `mnote.knowledge_rag.query` 提问。指定资料细节时可传 `sourcePaths`,但当前语义是 provider 检索后,MNote 只过滤返回的 `references`;不要把 `raw` 当作已被 scope 限制的来源。
|
||||
- 如果返回 `documentStructureIndex`,它只是一张章节地图。需要阅读某个章节范围时,调用 `mnote.knowledge_rag.section_context`,传 `sourcePath` 以及 `startBlockOrdinal/endBlockOrdinal` 或 `startParagraphOrdinal/endParagraphOrdinal`,并限制 `maxBlocks/maxChars`。
|
||||
- 回答必须引用 `references` 中的来源;优先使用返回的 `citationMarkdown`。
|
||||
- 若需要打开来源,调用 `mnote.knowledge_rag.open_reference`,不要手拼 LightRAG dashboard、`file://` 或 provider 内部路径。
|
||||
- 如果当前 Agent runtime 只有 MCP 入口,优先调用 `mnote_lightrag_bridge.mnote_knowledge_rag_query`;它会转到 MNote `/api/knowledge-rag/query`,保留 source registry、citation contract 和定位信息。`lightrag_native.query_text/query_data` 只用于原生 graph/documents/pipeline 管理或显式调试,不作为普通问答首选。
|
||||
- 引入或变更 LightRAG MCP、`mnote.knowledge_rag.*` 工具、citation 渲染或 open-reference 映射后,必须跑 Reasonix/Page AI 浏览器验收:AI 可见回答包含 citation 链接,点击该链接后 MNote 能打开对应资源并落到 locator。
|
||||
- 若需要打开来源,调用 `mnote.knowledge_rag.open_reference`,不要手拼 provider dashboard、`file://` 或 provider 内部路径。
|
||||
- 如果当前 Agent runtime 只有 MCP 入口,优先调用当前 WeKnora/OpenHub bridge;`mnote_lightrag_bridge.*` 和 `lightrag_native.*` 只用于 legacy fallback 或显式调试,不作为普通问答首选。
|
||||
- 引入或变更 WeKnora/OpenHub bridge、`mnote.knowledge_rag.*` 工具、citation 渲染或 open-reference 映射后,必须跑 Page AI 浏览器验收:AI 可见回答包含 citation 链接,点击该链接后 MNote 能打开对应资源并落到 locator。
|
||||
|
||||
边界:
|
||||
|
||||
- LightRAG 是派生知识库 provider,不是 MNote Markdown 正文真相。
|
||||
- `filePath` 是 LightRAG provider-local 名称;只有 registry 命中的 reference 才能映射回 MNote source。
|
||||
- 知识库 provider 是派生缓存,不是 MNote Markdown 正文真相。
|
||||
- `filePath` 是 provider-local 名称;只有 registry 命中的 reference 才能映射回 MNote source。
|
||||
- 如果返回 `locatorDegraded: true`,可以使用返回的 `citationMarkdown`,但必须明说“来源定位降级”,不要伪造页码、bbox 或 provider 内部路径。
|
||||
- LightRAG 不可用时,不要声称资料库已查到;提示用户启动或检查 LightRAG provider。旧 LiteParse / evidence 检索已退役,不作为 fallback。
|
||||
- 当前 provider 不可用时,不要声称资料库已查到;提示用户启动或检查 WeKnora/OpenHub provider。旧 LightRAG / LiteParse / evidence 检索已退役,不作为默认 fallback。
|
||||
- MNote 的职责不是重排、补召回或再做一套全文搜索;MNote 只做 allowed roots、source registry、结果过滤、有限 section context 和 citation/open-reference 映射。
|
||||
|
||||
@@ -5,6 +5,8 @@ description: Use when an agent must query MNote's LightRAG-backed knowledge libr
|
||||
|
||||
# MNote LightRAG Bridge
|
||||
|
||||
> 2026-06-28 口径:LightRAG bridge 已退为 legacy fallback / 历史调试工具。普通资料库问答默认走 WeKnora / OpenHub,不再优先使用本 skill。
|
||||
|
||||
用途:把 agent 的资料库查询稳定路由到 MNote `knowledge_rag` facade,并把引用映射成 MNote 可点击、可打开、可定位的 locator。
|
||||
|
||||
## 工具分层
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# wolai-backend
|
||||
|
||||
本目录现在只保留轻量 FastAPI 辅助后端。OpenAI Agents 文档代理、Celery/Redis 队列和旧 OCR 占位链路已退役到仓库 `recycle/`,当前 AI 主链统一走 Hermes / Reasonix。
|
||||
本目录现在只保留轻量 FastAPI 辅助后端。OpenAI Agents 文档代理、Celery/Redis 队列和旧 OCR 占位链路已退役到仓库 `recycle/`,当前 AI 主链转向 OpenHub / WeKnora;Hermes / Reasonix 只保留为 legacy/debug 边界。
|
||||
|
||||
当前保留:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user