Files
mnote/.codex/reasonix-tasks/2026-05-22-sqlite-control-plane-worker-d-migration-guard.md
T
lix-2026 5f97800489 chore: align local-first control plane and editor fixes
- wire SQLite control-plane access/session paths into Rust web local-folder routes

- preserve local Markdown attachment semantics across upload, reload, and secondary-pane resource tabs

- refresh design governance docs, Reasonix task templates, and bug records

- retire root .mcp.json local MCP config
2026-05-23 23:38:42 +08:00

63 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Reasonix Worker D:迁移工具与 Convex 下线 guard
Project root: `/mnt/Data1T/mnote`
你不是独自在代码库中工作。其他 worker 可能并行修改 Rust control-plane、auth/session 或 access policy。不要还原、覆盖或清理不属于你任务范围的改动。不要提交 git。
## 背景
上位设计稿:
`design/02-convex-rust-long-term-architecture/process/2-8-convex-replace-with-rust-sqlite-control-plane-v1.md`
目标是给完全替换 Convex 准备迁移 dry-run 工具和 guard,不执行真实破坏性迁移。
## Ownership
允许修改:
- 新增 `scripts/migrate-control-plane-to-sqlite.js`
- 修改 `scripts/check-local-first-convex-guard.js` 仅限增加 SQLite 迁移期 guard 规则或建议输出
- 可新增 `scripts/task*-sqlite-control-plane-*.js` focused smoke
- 可向设计稿 `2-8` 追加“执行记录”,不得改设计结论
禁止修改:
- `rust/crates/**`
- `infra/convex/docker-compose.yml`
- `.env*`
- 不删除任何 Convex 数据、Docker volume 或本地数据文件
## 任务
1. 实现 dry-run 迁移工具:
- 读取 `/mnt/Data1T/Mnote_data/control-plane/access-policy.json`,路径可用参数覆盖。
- 扫描 `/mnt/Data1T/Mnote_data/users/*/workspaces/*/.mnote/workspace.json`,路径可用参数覆盖。
- 生成 `migration-report.json`,包含 users/workspaces/grants/legacy_id_map 建议,不写 DB。
2. 支持命令:
```bash
node scripts/migrate-control-plane-to-sqlite.js --dry-run --out /tmp/mnote-control-plane-migration-report.json
```
3. 更新 guard 或输出建议:新增 Convex 控制面代码应被标记为禁止或迁移例外。
4. 补最小 node smoke,断言 dry-run report 可生成。
## 验收命令
```bash
node scripts/migrate-control-plane-to-sqlite.js --dry-run --out /tmp/mnote-control-plane-migration-report.json
npm run check:local-first-convex-guard
```
如新增 smoke
```bash
node scripts/<new-smoke>.js
```
## 最终回复格式
请列出:
- 修改文件
- dry-run report 字段
- 实际运行过的命令及结果
- 未完成项/风险