- 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
2.3 KiB
2.3 KiB
Reasonix Worker A:SQLite control-plane store 骨架
Project root: /mnt/Data1T/mnote
你不是独自在代码库中工作。其他 worker 可能并行修改 auth、access policy 或迁移脚本。不要还原、覆盖或清理不属于你任务范围的改动。不要提交 git。
背景
上位设计稿:
design/02-convex-rust-long-term-architecture/process/2-8-convex-replace-with-rust-sqlite-control-plane-v1.md
目标是用 Rust + SQLite 完全替换 Convex 控制面。你的任务只负责 SQLite store 骨架,不接运行时 route。
Ownership
允许修改:
- 优先新增
rust/crates/control-plane/** - 必要时修改
rust/Cargo.toml - 必要时新增/修改
rust/crates/mnote-web/Cargo.toml仅用于依赖引用建议
禁止修改:
rust/crates/mnote-web/src/routes/gateway.rsrust/crates/mnote-web/src/routes/local_folder_source.rsrust/crates/mnote-web/src/routes/session.rsrust/crates/mnote-web/src/ssr/**infra/convex/**.env*
如果发现 workspace crate 接入风险过大,先实现为可编译独立 crate;不要跨模块硬接 runtime。
任务
- 新增
control-planeRust crate 或等价最小模块,优先独立 crate。 - 定义核心 model 与
ControlPlaneStoretrait。 - 实现
SqliteControlPlaneStore,支持临时路径 DB。 - 实现 migration v1,包含至少:
usersauth_identitiesauth_sessionsworkspacesworkspace_membersdirectory_grantsshare_linkssync_stateai_policiesaudit_logoutbox_eventslegacy_id_map
- 实现最小 CRUD:
- upsert user
- create/get session
- ensure default workspace
- grant/revoke directory access
- append/drain outbox
- 补单测:migration 幂等、默认 workspace、owner grant、outbox drain。
验收命令
优先运行:
cargo test --manifest-path rust/Cargo.toml -p control-plane -- --nocapture
cargo fmt --check --all
如果没有新增独立 crate,而是放入 mnote-web:
cargo test --manifest-path rust/Cargo.toml -p mnote-web control_plane -- --nocapture
cargo fmt --check --all
最终回复格式
请列出:
- 修改文件
- 新增表和核心 API
- 实际运行过的命令及结果
- 未完成项/风险