feat(runtime-host): close managed Write/Edit mutation recovery - #10
Closed
zhiiw wants to merge 9 commits into
Closed
Conversation
zhiiw
force-pushed
the
codex/managed-workspace-write-edit-production-m2-4
branch
from
August 19, 2026 02:33
04ed4fe to
1aea261
Compare
zhiiw
force-pushed
the
codex/managed-workspace-mutation-runtime-admission-m2-3b
branch
from
August 19, 2026 02:33
643f893 to
3825677
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Compose managed Write/Edit from immutable Git base content through a detached worker transform, immutable candidate capture, atomic SQLite successor acceptance, and crash-convergent projection publication.
Primary invariant
A managed Write/Edit is determined by the exact accepted base blob, exact operation, and exact resulting blob. The mutable worktree is only a disposable projection and is never the transform data plane. After durable intent, every observable combination of path, registration, HEAD/index, and lock converges or fails closed; Git porcelain is not treated as an atomic transaction.
What changed
worktree add --no-checkoutregistration from candidate materializationgit worktree move; publication now uses atomic directory rename followed by idempotentgit worktree repairreset/addcannot mutate canonical HEAD/index or the managed refStack position
This is M2.4, the fifth Draft in this review stack.
Base:
codex/managed-workspace-mutation-runtime-admission-m2-3bValidation
git diff --checkpassedDraft limitations
中文说明
概要
本层闭合 managed Write/Edit 的 effect/version seam:transform 不读取或覆盖可变 worktree,而是从 accepted Git base 的不可变内容计算结果;candidate 绑定 exact result blob;SQLite 原子提交成功 T2、successor 与 canonical head。
这轮不再假设
git worktree add/move是原子操作:worktree add --no-checkout把 registration 与 checkout 拆开;git worktree move,目录发布只用同文件系统原子 rename;git worktree repair根据实际存在路径幂等修复 registration;旧 quarantine 与新 canonical projection 仍拥有不同的 per-worktree gitdir、HEAD 与 index,因此从 quarantine 执行
git reset或git add不会改变 canonical projection 或 managed ref;外部用户字节完整保留。当前仍是 API-only Draft,Desktop/CLI 尚未接入。完整对话 continuation 属于 M3;quarantine/partial artifact 的配额、诊断以及先撤销 Git registration 再清理目录的安全 GC 属于 M4。