Skip to content

Bind interrupted checkpoints to the original complete Turn mode - #8535

Merged
huangruiteng merged 2 commits into
mainfrom
codex/complete-turn-checkpoint-binding-20261111
Nov 11, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/complete-turn-checkpoint-binding-20261111

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A benchmark heartbeat can explicitly select --complete-turn for the shared settlement route introduced in #8489. Interrupted checkpoint readback matched the legacy envelope flag but ignored this opt-in. A pending command with the same Goal, Agent, Turn and capture route could therefore pass as the original after changing that flag.

The worker now seals its original mode with the existing interrupted guard metadata. The native history reader compares both mode flags through the existing CLI parser. A mismatch fails before a checkpoint is published. Old ordinary and envelope records retain their existing defaults; a checkpoint with no complete-mode binding cannot qualify an explicit complete command.

Author Declaration

Validation

The tested shared head is cd8290d09a3eb37544e9101d3ff818ba07001354. The local C1 composition is 310ccec90dcf78ff2812e7f5699da09f9a52b92c. Fixtures use a local deterministic provider.

Check kind Result Evidence
Regression parity Passed On current main, 14 assertions caught a missing rejection of an invalid mode or field type and two sealed records lacked the complete-mode field. The shared branch and local C1 composition both pass all 16 cases.
Worker sealing with fixed native history Passed File and SQLite use the real renderer, guard, rendezvous and artifact store. A matching pending command seals its original identity and mode. A mode replacement is refused before publication. Each case records one guard and zero quota debits.
integration passed benchmark/tests/test_native_checkpoint.py, benchmark/tests/test_checkpoint_handoff.py, and benchmark/tests/test_checkpoint_binding_observation.py: 127 passed, 18 platform or explicitly opt-in cases skipped.
Packages Passed The original shared wheel passed 10 worker cases with fixed native history. A wheel built from the current C1 composition exercised the actual macOS refusal and same-session recovery.
static passed Scoped Ruff, configured mypy, diff and bilingual checks, and four-file public boundary scan.
macOS native processes Passed refusal and source recovery In 10 isolated CLI and App Server cases, retained history returned the user message but omitted the pending command execution item. The reader refused to seal it. The five CLI conditions resumed with the original receipt. In the C1 wheel, the same-session fixture provider received all 53,995 bytes of the original complete Turn. Each case admitted one guard and spent zero quota.
Linux interruption Pending Positive sealing from a real Linux native history remains to be validated.

Local premerge ran six direct and nine selected checks with zero failures. The benchmark maintainer review is still required. The change is confined to the checkpoint worker and reader.

Scope And Continuation

This slice closes the missing mode check in the checkpoint adapter. It can be reviewed and reverted independently of #8266. C1 adoption, model costs, and full benchmark outcomes remain outside this validation.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max

评审提交:51d91efb8924c2acd71ec3f40964736583123e29

动机 / Motivation

受影响的是恢复未释放 benchmark guard 检查点的操作者。同一未释放的中断 guard 使用普通模式或 complete-turn 模式,主干只检查 envelope,互换模式后仍会封存。候选从原 worker receipt 绑定 complete_turn,再核验最后一条原生命令。独立 File/SQLite 的八组对照显示,主干接受两种模式互换,候选只封存匹配模式并记录原始布尔值;不匹配时没有检查点目录。保留原决策字节,一次准入、零扣费、零 fork 请求。这次只修中断检查点的模式绑定。原生进程的实际中断和 fork、安装采用、C1 全链路成果及成本另行验收。真实原生中断恢复资格仍未完成,Darwin 拒绝保持。C1 单会话成果和成本不能由合成历史推定。

改动思路 / Approach

原 worker receipt 记录模式,现有 CLI parser 比对原生命令;没有新增解释器或恢复 owner。只补中断检查点的模式绑定,不创建新 Turn、执行 grant 或结算路线。 我使用完全相同的合成输入类别,在精确主干与候选运行实际源代码 CLI 和隔离 File/SQLite;没有重复执行生产 guard 或付费实验。

具体改动 / Changes

关键代码讲解

CheckpointWake._capture 从原 receipt 写入 complete_turn;_verify_interrupted_guard 先严格检查两种模式为布尔值且不冲突,再以既有 CLI parser 比较最后一条命令。历史缺失 complete 标志按 False,缺失旧 envelope 标志保留历史 True。原模式来源,模式核验。四文件 +149/-10。

规范依据:benchmark/runtime/RUNTIME.md @ b89a574b05a3e7d5920a8e7184476dfb7b041790。original-held-mode 对应 Checkpoint history must match the original held guard's identity, routes and original Turn mode.;pre-seal-refusal 对应 An altered final command cannot seal a checkpoint or start a new guard/fork.;legacy-and-platform 对应 Legacy ordinary/envelope meaning and the Darwin native-interruption refusal remain.。

对主干的风险 / Risks

未发现这次切片的新增阻塞问题。独立 File/SQLite 的八组对照显示,主干接受两种模式互换,候选只封存匹配模式并记录原始布尔值;不匹配时没有检查点目录。保留原决策字节,一次准入、零扣费、零 fork 请求。 这次只修中断检查点的模式绑定。原生进程的实际中断和 fork、安装采用、C1 全链路成果及成本另行验收。

语义与 CI 对齐

独立检查:127 项 checkpoint/handoff/binding 通过,18项真实原生 opt-in 或 Linux 场景跳过;另有主干和候选各八项实际 held-socket 对照。Ruff、mypy及 premerge 的6项直接、9项定向检查通过。主干和候选共同有两项 TS digest、一项 Python digest、两项旧 Steward fixture 失败。benchmark 手动复核仍保留。这些失败没有由本次差异引入,受影响的不变量已独立验证;必需检查仍为失败,Change Quality 不通过,不能据此合并。未查询远程 CI。

我的整体评价 / Verdict

赞成这个边界明确的增量。长程连续性与原 Turn 的恢复/扣费边界保持;受影响的 CLI 体验有所改善。真实原生中断恢复资格仍未完成,Darwin 拒绝保持。C1 单会话成果和成本不能由合成历史推定。既有 benchmark/CLI 中断恢复路径,没有界面或首屏变更。原生历史使用固定合成记录,guard socket 与存储是真实的;实际原生进程中断和 fork 未验证。

English verdict: APPROVE. Bind the checkpoint to the original complete-turn mode; paired real held-socket tests reject substitutions without new admission or debit. Native process qualification and merge validation remain held.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@huangruiteng
huangruiteng merged commit 0dad3f8 into main Nov 11, 2026
18 of 41 checks passed
@huangruiteng
huangruiteng deleted the codex/complete-turn-checkpoint-binding-20261111 branch November 11, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants