Persist accepted-world identity for hermetic managed tests - #67
Draft
zhiiw wants to merge 1 commit into
Draft
Conversation
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
This change gives hermetic managed test observations a durable Runtime boundary. Before T1, the dispatch now freezes the exact accepted Git world, workspace epoch, explicit test-file identities, verified toolchain identity, execution profile, and replay-safe effect class. Runtime owns a linear one-shot operation capability and one bounded immutable provider-result snapshot; the Host cannot replace the live result or retain the operation past terminal settlement.
No SQLite schema or second projection is introduced. Existing
commitToolPrepared()andcommitToolOutcome()remain the only T1/T2 writers, and reopen/rebuild continue through the strict RuntimeEvent decoder and tool-ledger scanner.Primary invariant
Ownership and atomic boundary
Failures before T1 leave no durable tool operation. Failures after T1 settle through an error T2 or the later exact-boundary recovery owner; immutable RuntimeEvents are never deleted as rollback. Malformed identity or causal order fails closed.
Verification
git diff --check: passedThe full Runtime typecheck still reports the pre-existing mixed Zod v3/v4 resolution errors in
archive-read-tool.ts,builtin-tools.ts, andshell-tools.ts; this change adds no new Runtime TypeScript diagnostic.This remains Draft until Host admission, a real production consumer, production-shaped helper/Host kill-and-reopen coverage, and enforcing Linux/macOS/Windows sandbox evidence land.
中文说明
摘要
本提交为 hermetic managed test observation 建立 durable Runtime 边界。T1 以前,dispatch 会冻结 exact accepted Git world、workspace epoch、显式测试文件 identity、经过验证的 toolchain identity、execution profile 和 replay-safe effect class。Runtime 独占一次性的线性 operation capability 和唯一一份有界 immutable provider result;Host 不能替换实时结果,也不能在终态后继续调用 operation。
没有新增 SQLite schema 或第二套 projection。现有
commitToolPrepared()/commitToolOutcome()仍是唯一 T1/T2 writer;reopen/rebuild 继续经过 strict RuntimeEvent decoder 和 tool-ledger scanner。主要不变量
Owner 与原子边界
T1 前失败不留下 durable tool operation。T1 后失败只能写 error T2,或由后续 exact-boundary recovery owner 收敛;不能删除 immutable RuntimeEvents 伪装回滚。任何 identity 或因果顺序损坏都 fail closed。
验证
git diff --check:通过Runtime 全量 typecheck 仍只有既有的 Zod v3/v4 混装问题,位于
archive-read-tool.ts、builtin-tools.ts和shell-tools.ts;本提交没有新增 Runtime TypeScript 错误。在 Host admission、真实生产 consumer、production-shaped helper/Host kill-and-reopen,以及 Linux/macOS/Windows enforcing sandbox 证据完成前,本 PR 保持 Draft。