Add an isolated managed Git workspace service - #1742
Conversation
|
The artifact-owner findings are addressed in
The focused real-Git suite is green: 14/14 tests. A durable verified baseline receipt remains intentionally outside this artifact-lifecycle PR and is the next shared-contract/composition slice. 中文说明
真实 Git focused suite 14/14 通过。Durable verified baseline receipt 仍刻意留在下一张 shared-contract/composition PR,不塞入本 artifact lifecycle PR。 |
|
整体方向认可:repository capability / epoch artifact / instance binding 的职责拆分很清楚,当前也没有接入 Desktop、CLI 或 runtime-host,因此现有运行链路没有直接回归面。不过我本地核对后有两个建议在合并前处理的 correctness / recovery 问题: 1. [blocking] unsafe source config fence 会漏掉 Git 规范化为小写的 key
因此当前正则不会命中 建议把匹配统一为 Git 实际输出的小写形式(或读取后 lowercase 再按 key 判断),并分别补 local/worktree config 的 2. [blocking] quarantine 不是 crash-convergent,公开 API 会进入无法恢复的状态当前 如果进程在
我按这个中间状态做了复现,两个公开恢复入口都失败。如果退出发生在 rename 后、删除 binding 前,也会留下 binding 指向缺失路径的类似问题。 建议为 quarantine 增加 durable transaction/tombstone,使 unlock、move、binding removal、prune 都能识别“已经完成”的阶段并幂等重放,同时补真实子进程在各阶段退出的测试。否则 PR 当前“process-crash convergence”的描述只覆盖 create path,不覆盖 service 所有 artifact lifecycle 操作。 3. [minor] executable verification 与“每次 invocation”描述不完全一致
除上述问题外,现有三层 artifact identity、source re-observation、ref CAS 和 worktree ownership lock 的设计是合理的;focused real-Git 测试我这边也跑到了 18/18 通过。 |
|
Addressed in
Validation:
中文说明已在
验证结果:core/storage build 通过;完整 real-Git workspace service suite 25/25 通过;真实子进程 crash matrix 覆盖 intent、unlock、move、binding removal、prune 五个阶段,均可通过公开 reopen/quarantine API 收敛,重复 quarantine 返回同一个 artifact。 |
likun666661
left a comment
There was a problem hiding this comment.
Re-checked c6aa3af against the three blocking items. The source-config fence now handles Git-normalized lowercase keys with local/worktree regressions; quarantine records a durable intent before unlock and converges through all five real-process crash stages via the public APIs; and importTree verifies the pinned executable before both Git processes. Local @maka/core and @maka/storage builds passed, and the complete real-Git workspace service suite passed 25/25. Approved.
Summary
Introduce a narrow managed Git workspace service that owns only Maka-internal repositories, epoch artifacts, and private worktrees.
Why
Runtime resume needs an isolated workspace artifact owner before a later composition layer can bind canonical RuntimeEvents to Git state. Sharing the user's checkout cannot provide that isolation.
This PR establishes only the artifact lifecycle. It does not write RuntimeEvents, accept a canonical workspace version, or expose the worktree to tools.
Invariant and ownership
The service may create, verify, reopen, quarantine, and clean up artifacts only inside the Maka-owned storage namespace. Once an epoch artifact exists, the source checkout is historical provenance rather than reopen authority.
packages/storagemanaged Git workspace serviceFault model
The current proof covers process-crash convergence. JSON control records fsync the temporary file and, on POSIX, the parent directory. This PR does not claim complete power-loss durability for every Git object/ref write or a full bundled-Git runtime manifest. Those guarantees belong to the bundled Git installation and Baseline Open composition layers.
Scope limits
This PR intentionally does not add:
Validation
npm run build --workspace @maka/storagenode --test packages/storage/dist/__tests__/git-workspace-service.test.js中文说明
概要
新增职责单一的 managed Git workspace service,只管理 Maka 内部 repository、epoch artifact 与 private worktree。
不变量与边界
服务只能在 Maka-owned storage namespace 内创建、验证、reopen、quarantine 和清理 artifact。epoch artifact 一旦存在,source checkout 只保留历史 provenance,不再拥有 reopen authority。
packages/storagemanaged Git workspace service故障模型
当前证明覆盖 process-crash convergence。JSON control record 会 fsync 临时文件,并在 POSIX 上 fsync parent directory;本 PR 不宣称所有 Git object/ref 写入具备完整断电耐久性,也不宣称已经拥有完整 bundled-Git runtime manifest。这两项属于内置 Git 安装层与后续 Baseline Open composition。
明确不包含
验证