Repository navigation
Verify Turn recovery against live work and its original receipt - #8837
Conversation
Exercise matching and changed live Todo recovery through the real CLI. Read the Steward terminal delivery at the accepted recovery presentation key. Preserve the core recovery expectations also covered by the broader C1 integration. Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent / gpt-6.1-sol / OpenAI / runtime_reported / reasoning effort max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
维护主干恢复测试的开发者、以及需要在 Host 中断后继续原工作的操作者受这两类回归影响。旧测试保存了原捕获,却要求在当前 Todo 仍被编辑时重启 Host。Steward 的旧断言又把回执固定到一个已过时的版本。主干的正确行为因此会触发测试失败。修订后分别验证当前 Todo 恢复才可重试、仍有改动时拒绝且零效果,以及 Steward 从已接受的 presentation key 读取一次原终态回复。本 PR 交付现有两条恢复测试的修订。真实模型和飞书服务采用仍需独立验收。
改动思路
两处复用现有集成夹具。Turn 固定原捕获,依据眼下的权威 Todo 决定重试。Steward 按本次接纳的恢复键读回终态,继续对真实发送及重放作断言。主干重试契约
具体改动
launch-matches-live-work已实现。File 和 SQLite 矩阵覆盖已提交回放、恢复原工作后重试、仍有改动时拒绝,并对照原捕获、Host 读回和扣额。Turn 恢复矩阵original-terminal-receipt已实现。以已接纳的presentation_key读取已验证消息,核对原终态、会话、发送者和重放零新增发送。Steward 回执
规范 docs/reference/protocols/turn-envelope-v0.md @ f7e3f427197bab6c66ab535e26613a7f9c2fdbe0。Steward 沿现有 private_progress 回执选择。回执键
关键代码讲解
test_real_host_reads_original_capture_after_source_change 通过真实 CLI 改临时 Todo,调用原恢复命令,并核对效果记录。test_restarted_codex_steward_gets_one_original_read_only_answer 从已接纳的恢复取键,到 provider 按消息引用验证交付。旧固定键在已有交付时仍报 KeyError。
语义与 CI 对齐
同条件基线有 4 项错误期待成功的重试和 12 项硬编码键的 Steward KeyError。现头增加四个带 live edit 的明确拒绝用例。精确头两文件共 304 项通过。File 和 SQLite 分别验证原捕获、current_turn_work_changed、恢复同一原轮及一次扣额。Steward 回读合成 provider 已验证消息,核对原终态保留和重放零新增发送。SHA-256 owner 检查在基线与现头各 243 通过、1 项同位置失败。两处恢复测试不触及该 guard 扫描的表达式。摘要所有者守卫
对主干的风险
当前修改覆盖源代码的恢复、拒绝和重复结算。作者另有 Native Stop 夹具的既有失败记录。独立复验的 SHA-256 owner 栅栏在基线与现头同时失败,定位到同三处表达式,由 #8836 跟进。真实模型和飞书服务采用属于后续资格。
我的整体评价
精确提交 9eb2bacaedc03b377a4d855ea39d86b9a7a60922 可以批准。两个现有测试真实跨进程或回执边界,并验证三种恢复结果,不靠固定版本号认定交付。
English verdict: APPROVE | Exact head 9eb2bacaedc03b377a4d855ea39d86b9a7a60922. The two test updates restore live-work and original-delivery recovery coverage. The independent digest-owner failure reproduces on both revisions.
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Codex · OpenAI · self_reported
动机 / Motivation
Turn 恢复测试需要证明宿主决策来自仍然存活的工作和原始投递回执,而不是测试里一份已被替换或已经过期的本地快照。此前两个用例的生产约束没有用独立输入固定下来,容易在恢复路径退化时继续通过。
改动思路 / Approach
本 PR 只修改测试,不改变生产行为。测试夹具改为保留真实工作状态、原 Turn receipt 与决策捕获之间的绑定关系,然后用反例证明工作被替换、回执丢失或原始投递无法确认时不能进入成功恢复。
具体改动 / Changes
当前 head 9eb2bacaedc03b377a4d855ea39d86b9a7a60922 更新 test_turn_host_decision_capture.py 与 test_steward_interrupted_answer.py。前者恢复 live-work 与原始 decision receipt 的独立断言,后者保持 interrupted answer 恢复顺序。改动没有产品 runtime、持久化格式、权限或 CLI 契约变化,也不会为真实失败增加重试或替代成功路径。
对主干的风险 / Risks
无阻断发现;产品行为不变,风险仅在测试是否真正覆盖原约束。两个文件共 304 个聚焦用例通过。该 PR 的既有 CI digest 失败由已合并的 #8836 修复,不属于本测试改动;安装态和实时模型采用仍不在本 PR 范围。
我的整体评价 / Verdict
APPROVE。测试恢复了对 live work 和 original receipt 的验证,能够重新发现之前被弱化夹具掩盖的恢复退化;改动边界小,回滚只恢复两个测试文件。
English verdict: APPROVE at 9eb2bac. The two test updates restore live-work and original-receipt recovery coverage without changing production behavior, and all 304 focused cases pass.
Goal and delivered outcome
Two recovery tests on
mainfailed after their production contracts changed. The external Turn fixture restored the original decision capture but left a later Todo edit in live state. The CLI correctly refused to resume. The restarted Steward test looked under a fixed recovery version even though the original terminal response was delivered at the accepted presentation key.Related to #8828 and #8266. Base branch
mainatf7e3f427197bab6c66ab535e26613a7f9c2fdbe0.Author declaration
Written by
model_agent(OpenAI Codex). Based on the retry contract in Turn Envelope v0 and the original terminal recovery receipt contract exercised by the Steward fixture.tests/control_plane/test_turn_host_decision_capture.pytests/test_steward_interrupted_answer.pyScope and continuation
This PR restores the recovery coverage on current
main. #8266 carries the broader C1 integration coverage, including the separate Native task stop fixture.Validation
Tested revision
9eb2bacaedc03b377a4d855ea39d86b9a7a60922. Local runs finished with synthetic work, model and messaging fixtures. The affected production entrypoints and storage run locally against those fixtures.Required local validation still holds the change-quality receipt. GitHub CI and independent review are pending at submission.
Frontend and visual evidence
UI impact
none.Type and area
Shared-authority RFC fixture impact is N/A for these recovery tests.
Boundary checklist