Repository navigation
Conversation
zhiiw
force-pushed
the
codex/gitoxide-write-edit-recovery-v1
branch
from
August 30, 2026 14:15
b5d5e5d to
4dd9676
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
Add the Gitoxide recovery half of managed Write/Edit on top of the managed mutation acceptance kernel.
This stacked PR proves one primary invariant:
Ownership
Recovery states
gitoxide_managed_mutation_replay_required; never reportalready_current.already_current.Important correction
The earlier implementation reconstructed the result by reading the parent tree and calling the current pure transform again. That made post-T2 recovery depend on current code and created a second result derivation path. This PR removes that path. Post-T2 recovery now validates immutable call/dispatch/outcome evidence and directly reopens the already-persisted candidate receipt.
Pre-T2 process loss may still deterministically recompute the pure transform under the same durable operation. The safety guarantee is at-most-one accepted successor, not exactly-once invocation of a pure function.
Test and delivery notes
upstream/main.git range-diffpreserves all fifteen extracted commits exactly.workspaceVersionIdis not accidentally embedded in the strict epoch payload.git diff --checkpasses.This is a stacked Draft for review. After the kernel PR merges, it can be retargeted/rebuilt directly onto the new
mainwithout changing the recovery contract.中文说明
摘要
本 stacked PR 在 managed mutation kernel 之上补齐 Gitoxide recovery,证明一个主要不变量:
Owner 与恢复状态
active reservation 存在时返回
gitoxide_managed_mutation_replay_required,禁止报告already_current。durable successor 已存在且 ref 仍停在精确 parent 时,直接重开 receipt、精确 replay SQLite successor 以重签 projection capability,再执行 ref CAS。ref 是第三值时 fail closed。超时、取消、helper corruption 等非 exact target mismatch 错误原样上抛,不能被误判成可修复 drift。关键修正
旧实现会重新读取 parent tree 并调用当前 pure transform,这让 post-T2 recovery 依赖当前代码,并形成第二条 result derivation path。现在该路径已经删除:post-T2 只验证 immutable call/dispatch/outcome evidence,然后直接重开已持久化 candidate receipt。
T2 前进程退出后,同一 durable operation 仍可确定性重算纯 transform;安全保证是“最多一个 successor 被接受”,不是“纯函数调用 exactly once”。
验证
本分支以六提交 kernel 为基座,在最新
upstream/main上增加九个提交;15 个 extraction commits 经range-diff全部精确保留。修复了 crash fixture 把workspaceVersionId误塞进 strict epoch payload 的问题;新增 active reservation 与 receipt reopen/tamper 回归。四个 workspace 构建通过;定向套件 81 pass、1 个真实 helper 用例本地明确 skip,三平台 helper workflow 仍是发布 gate;git diff --check通过。