111 lines
4.2 KiB
Markdown
111 lines
4.2 KiB
Markdown
# [recycle] mnote 单仓维护边界约定
|
|
|
|
> 更新时间:2026-04-14
|
|
>
|
|
> 主仓:`/mnt/Data1T/mnote`
|
|
>
|
|
> 历史仓:`/mnt/Data1T/mnote-rust`
|
|
|
|
## 1. 主结论
|
|
|
|
- 只保留 `/mnt/Data1T/mnote` 作为启动、规划、保存、验证的唯一主仓。
|
|
- `/mnt/Data1T/mnote-rust` 只作为历史资产来源,不再承担主执行入口。
|
|
- 任何新设计、执行清单、架构说明都优先写入 `/mnt/Data1T/mnote/design/` 或 `/mnt/Data1T/mnote/rust/design/`。
|
|
|
|
## 2. 主仓执行入口
|
|
|
|
- 根目录脚本入口只认 `/mnt/Data1T/mnote/package.json` 与 `/mnt/Data1T/mnote/scripts/`。
|
|
- 当前 `package.json` 仅通过 `node scripts/*.js` 暴露仓库级入口,没有任何脚本要求先进入 `mnote-rust`。
|
|
- 如需调用 Rust,统一使用 `cargo --manifest-path /mnt/Data1T/mnote/rust/Cargo.toml ...`,不从历史仓发起 Cargo 命令。
|
|
- 当前 `scripts/desktop-hot.js` 已固定从主仓根目录解析 `.env.all`,并以 `wolai-frontend/`、`wolai-backend/` 作为唯一联调入口。
|
|
|
|
## 3. `mnote-rust` 历史资料分类
|
|
|
|
### 3.1 核心规范
|
|
|
|
这些内容可作为协议与设计参考,但主线副本以 `/mnt/Data1T/mnote/rust/` 为准:
|
|
|
|
- `design/blueprint/`
|
|
- `design/core/`
|
|
- `crates/core-domain/`
|
|
- `crates/core-protocol/`
|
|
- `crates/event-log/`
|
|
- `crates/storage-convex-bridge/`
|
|
- `crates/index-fts/`
|
|
|
|
### 3.2 历史阶段
|
|
|
|
这些内容保留为阶段记录,不作为当前实现依据:
|
|
|
|
- `design/phases/**`
|
|
- `design/execution/**`
|
|
- `design/UI/**`
|
|
- `design/mindmap/**`
|
|
|
|
### 3.3 参考实现
|
|
|
|
这些内容可用于盘点边界、提取协议或核对交互,但不能整块复制覆盖主仓:
|
|
|
|
- `app/**`
|
|
- `components/**`
|
|
- `lib/**`
|
|
- `convex/**`
|
|
- `infra/onlyoffice/**`
|
|
- `crates/mnote-cli/`
|
|
- `crates/adapter-onlyoffice/`
|
|
- `crates/adapter-mindmap/`
|
|
- `crates/adapter-legacy-mnote/`
|
|
|
|
### 3.4 错误方向
|
|
|
|
以下内容明确不进入主仓主线:
|
|
|
|
- 对象页壳与试验页:`app/page.tsx`、`app/onlyoffice/page.tsx`、`app/documents/**`
|
|
- 第二套导航壳:`components/sidebar/sidebar.tsx`
|
|
- 诊断与构建产物:`.next/diagnostics/**`、`.next/**`、`.tmp/**`
|
|
- 仅用于历史 smoke/夹具的目录:`.tmp/phase7-test-fixtures/**`
|
|
|
|
## 4. 主仓默认不动目录
|
|
|
|
除非当前任务明确要求接线或修复,否则默认不扩写以下目录:
|
|
|
|
- `/mnt/Data1T/mnote/wolai-frontend/`
|
|
- `/mnt/Data1T/mnote/wolai-backend/`
|
|
- `/mnt/Data1T/mnote/infra/convex/`
|
|
- `/mnt/Data1T/mnote/src/components/onlyoffice/`
|
|
- `/mnt/Data1T/mnote/recycle/`
|
|
|
|
## 5. 最小维护约定
|
|
|
|
### 5.1 Workspace 责任面
|
|
|
|
- 入口文件:`/mnt/Data1T/mnote/rust/Cargo.toml`、`/mnt/Data1T/mnote/rust/Cargo.lock`
|
|
- 维护范围:`/mnt/Data1T/mnote/rust/crates/*`
|
|
- 要求:新增 crate、依赖调整、共享协议变更,必须先在主仓 workspace 内完成,不得回写到历史仓再反向复制。
|
|
|
|
### 5.2 Bridge 责任面
|
|
|
|
- 入口文件:`/mnt/Data1T/mnote/wolai-frontend/src/lib/documents/bridge.ts`
|
|
- 相关边界:
|
|
- `/mnt/Data1T/mnote/wolai-frontend/src/lib/documents/metadata-command-adapter.ts`
|
|
- `/mnt/Data1T/mnote/wolai-frontend/src/lib/documents/save-command-adapter.ts`
|
|
- `/mnt/Data1T/mnote/wolai-frontend/src/app/api/documents/**`
|
|
- `/mnt/Data1T/mnote/wolai-frontend/src/app/api/sidebar/route.ts`
|
|
- `/mnt/Data1T/mnote/wolai-frontend/convex/bridgeLogs.ts`
|
|
- 要求:新 command/query 先收口协议边界,再决定是否继续下沉到 Rust crate。
|
|
|
|
### 5.3 接入链责任面
|
|
|
|
- C1 页面元信息:`src/app/(app)/documents/[id]/page.tsx`、`src/components/editor/document-content.tsx`
|
|
- C2 Sidebar 聚合:`src/components/sidebar/**`、`src/hooks/use-convex-sidebar-data.ts`、`src/lib/sidebar-data.ts`
|
|
- C3 正文保存:`src/components/editor/blocknote-editor.tsx`、`src/app/api/documents/save/route.ts`
|
|
- Phase D 边界:`src/components/editor/blocks/MindmapBlock.tsx`、`src/app/onlyoffice/**`、`src/app/api/onlyoffice/**`
|
|
- 要求:优先改主仓现有链路,不复制历史仓页面壳替换现实现。
|
|
|
|
## 6. 禁止误复制清单
|
|
|
|
- 不把 `mnote-rust` 当成新的主执行仓。
|
|
- 不复制第二套 Next 前端壳、对象页壳、diagnostics 页、smoke 页进入主线。
|
|
- 不通过软链接、硬链接、跨仓路径偷接来伪装“已迁移”。
|
|
- 不在主仓根目录散落多个 Rust 源码根。
|