Repository navigation
feat(rust): migrate wire, identity and atomic SQLite metadata storage - #235
Conversation
…ration Keep Python CLI/admin/tooling and existing production daemon unchanged. Add bounded native core, Ed25519 primitives and request envelope handling, with Python-source differential conformance CI and explicit cutover gates.
Apply the cloud rustfmt patch, commit Cargo's resolved lock, enforce locked builds, and include the Python harness in the existing Ruff style checks. Native tests and Clippy passed on the initial cloud build.
Apply the cloud Ruff patch and use non-mutating style checks. Record the exact source/toolchain and exercise the same Python parity corpus against debug and optimized native binaries. No Python runtime entry points change.
Add native current-state credential, certificate, delegation, OAuth binding and recovery checks; distinguish committed-result replay from fresh identity. Read Python-created SQLite databases through bounded read-only snapshots. Keep Python CLI/server/deployment unchanged. Full resource authorization, write transactions, native serve/HTTP/MCP and worker remain cutover gates. Validated exact tree 8f31a96 locally: 14 unit tests, 1 compile-fail doc test, fmt/Ruff/Clippy; both debug/release wire parity 18,447 and authority parity 61,734 (61,440 simple mode decisions). Remove temporary offline-editor export workflow; extend independent Rust CI.
Port resource/revision/result/event/audit/settings writes into private native transactions over the existing Python-created WAL schema. Keep the Python flock fence through rollback compensation, isolate savepoints, fail closed on ignored writes and ambiguous commit outcomes, and compare real Python/Rust rows plus process-kill/retry behavior. Preserve Python CLI and live services. Remove the temporary writer-dependency export workflow. No merge or cutover.
Implement streamed native content storage, verified range reads, compatible pins and immutable revision graphs. Preserve binary hardlinks and fence publication behind digest checks, fsync and no-clobber installation. Add 14 native tests and 170 bidirectional Python/Rust content checks per profile, including real process interruption cases. Keep production Python unchanged, remove temporary preparation workflows, and record the fixed migration acceptance checklist (completed/remaining: 5/6). Validated source tree: 94c6c50 Local Rust 1.85.0 / Python 3.15.0rc3 checks passed; fresh cloud CI required. This is a storage primitive, not a complete daemon or deployment.
|
当前 head 已核对 recovery job 的实际堆栈: 正文的“本批提交”与验收表仍指向 |
|
补充 10 月 9 日的核对结果:main 已推进到 2d89b331,10 月 8 日的 Issue recovery regressions 和 Rewrite contracts 均已通过,不能再沿用上一条评论中“当前 main 同样失败”的状态。 本 PR 仍停在 fead32f,落后 main 9 个提交。直接核对 recovery-state-schema.json,PR 分支的 catalog 仍缺少 main 已补齐的 login_bindings 表、约束和索引。目前没有包含该修复后的 PR 验收证据。建议更新分支后,在新 head 上重跑 recovery、rewrite 和 Rust conformance,再同步正文中的提交与验收链接;现阶段继续保留 draft。 以上结论来自当前远端代码和已完成的 CI 记录,没有新增运行或修改分支。 |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
Blocking against current main (
The native migration is not merged or included in the deployment. Existing signing chains were preserved; no CA or credential scope was expanded to bypass a failed test. |
|
正在修复当前 main 兼容性:已移除 native OAuth 模块,换为 key-approved browser/API binding;SQLite/PostgreSQL authority store 使用 credential_states;加入恢复旧 t_oauth_/t_browser_ 权限仍拒绝的差分用例,以及关闭 browser、循环/过深 session source 的失败关闭单元测试。Rust 1.85.0 全部 unit、doc、clippy 已通过;identity 差分 61,726 个比较无差异,其中 61,440 是模式权限组合,不是独立身份情景。其余 SQLite/PostgreSQL/process/content 差分验收进行中,完成后推送、取消 draft 并合并。native 服务切换仍未实现,不会将此库合并描述为生产 Rust 服务。MSG 父任务引用受 credential_ceiling 限制,仅在此记录脱敏代码进展。 |
|
兼容性修复已推送至 08c87c1。Rust 1.85.0 fmt、unit/all-targets、doc、clippy -D warnings 通过;Debug 与 Release 两个 profile 的 wire/identity/SQLite storage/content/authorization/PostgreSQL/process 全部 8 组本机验收通过。identity 为 61,726 个比较(含 61,440 个简单模式组合);另有关闭 browser、循环/过深 source 的失败关闭单元覆盖。使用当前 Python 参考,不复活 OAuth/Bearer模块;当前 schema credential_states 在 SQLite/PostgreSQL 均验证。没有远程自动 CI 重跑。此 PR 只完成 native 基础库,不含 Rust serve/worker/生产流量切换;下一步合并,并部署 main 的 Python 服务和已验收的 PR243 功能。 |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
第三批已落地:原生 SQLite 写事务;独立 Rust CI 已通过
保持 Draft,不合并、不部署。Python 保留
msgCLI、管理/迁移脚本与开发工具。没有修改运行中的 Python 源码、入口、生产数据库、配置、路由或部署文件;没有通过 Rust 调用 Python 冒充迁移。本批提交:
fffea47606cf4db999ecf915910bdbe372360bb5。精确源码树:
265e8a8c294c920df39246aa55437deb8417c628。上传文件的 Git blob SHA、最终远端树和云端测试归档中的源码树均与本地通过测试的树一致。本批原生实现
SqliteWriter单独打开已由 Python 迁移的 WAL 数据库,不创建数据库、不修改表结构。检查所需表、列、主键、唯一约束、外键、唯一根目录索引、只追加审计保护;拒绝危险链接及数据库文件替换。.writer.lock/ flock 跨进程写入锁。锁覆盖 SQLite 回滚和全部逆序补偿,防止另一进程在补偿期间插入写入。这些是受信任的内部存储接口,不是完整资源授权或业务执行器。
save_result不签发回执、不负责秘密脱敏。测试中的once仅用于验证原子存储边界,不含身份校验,绝不能开放为网络接口。已验证的本批证据
精确提交的独立 Rust wire compatibility / push run 37259212454 已完成,结论 success。本地与云端都是 Rust 1.85.0 / Python 3.15.0rc2,依赖固定。
-D warnings身份测试的 61,734 项中,61,440 为简单权限组合,其余 294 为其他检查。容量测试使用 100,000 行,但只计一个场景,不扩大用例数。
已下载并核对 原始证据 artifact 11323892841:六份 JSON 报告、原生及编译拒绝测试日志、源码 SHA/源码树、工具链版本和 Cargo.lock。锁文件与提交逐字节一致。ZIP SHA-256:
3a7c910943e9af9fe916e8120cf2dcc6801e0e6ed4e121f41da77a18ea79bd58。存储对照直接使用实际 Python
SqliteMetadataStore创建临时数据库,比较完整记录、规范化字节、结果、补偿顺序和未修改的表结构。真实进程检查覆盖:提交前 SIGKILL 后无半写;提交后丢失响应再试不重复提交;并发同请求只产生一个结果/审计;Python 与 Rust 双向互斥;SQL 回滚后补偿完成前仍保留写锁。提交不确定情况是确定性错误注入,不是物理磁盘故障实验。本批累计补丁以第二批
78e8d5d44cbbe49078a1e6eb4bb8e079eea3db72为基线,已在独立 Git 索引中检查并实际应用,所得树与本次提交一致。中间依赖导出工作流在基线和最终树中均不存在。临时 writer 依赖导出工作流已删除。PR 的 Python quality、FUSE mount 已通过;其余完整回归及合并基线上的 Rust run 在本次最终核对时仍在运行。不宣称整个 PR 已完成验收,不自动合并或部署。
前两批保留
第一批
91d8d3209d09f04269b4d9807793d6a0a8da7eba:原生 canonical-v1、ID、Ed25519、请求与签名字节。通过证据 run 37246877514。第二批
78e8d5d44cbbe49078a1e6eb4bb8e079eea3db72:身份/凭据/证书校验、当前撤销和恢复版本、实时委托、OAuth/MCP 目标服务及恢复绑定、只读 SQLite。通过证据 run 37252150014。旧提交的通过状态不能代替本批验收。Admission::Fresh仅表示身份已验证,不表示资源授权。Admission::Replay仅携带符合条件的已提交结果,不产生可执行新操作的 Principal。OAuth 目前是绑定校验,不是完整签发/刷新服务。尚未完成 / 切换门槛
msgd serve、HTTP/MCP、msgd worker、打包、隔离部署与回滚演练。兼容差异写入
rust/README.md:输入体积/深度、时间别名、固定宽度模型整数、错误码、历史 Ed25519、十六进制 ID 别名及完整 Unicode 标签规范化等仍是切换门槛。现有测试不证明全部 Python 输入兼容。未做等价负载内存/吞吐实测,不承诺降幅。已读仓库 AGENTS、入口技能及部署
/AGENTS.md。编辑环境没有选定已有 MSG 签名身份,因此未创建生产身份、私有协作线程或公开协调帖;本次进度记录在现有分支/PR。