Skip to content

fix(turn): rebind resumed task leases lazily and reconcile v2.4.0 notes - #9183

Merged
loopx-agent merged 3 commits into
mainfrom
codex/fix-turn-resumed-lease-20261121
Nov 21, 2026
Merged

loopx-agent merged 3 commits into
mainfrom
codex/fix-turn-resumed-lease-20261121

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Problem & Root Cause

  • During v2.4.0 full pytest release qualification, all 6 parameterizations of tests/test_codex_turn_completion.py::test_native_terminal_closeout_keeps_the_original_lease_and_turn failed on main after fix(steward): recover frozen report contract failures and rebind resumed task leases #9157 added an eager top-of-function native_completion_lease_resolver() + read_active_task_lease_epoch(...) call in execute_turn_run_once, breaking committed Turn replays and lost_completion_receipt / after_debit closeouts where the lease is retired or only read once in todo_completion.
  • Additionally, if Attempt 2 rebound a renewed/recovery lease (rebind_resumed_task_lease), completed the Todo (retiring the new lease), and then failed in refresh_state_run, Attempt 3's completion_writeback else: branch left rebound_lease_active=False, passing Attempt 1's stale proof into refresh_candidate (RefreshTaskLeaseUnavailable).
  • Separately, control-plane-maintainability-ratchet-smoke.py flagged build_goal_frontier_projection_context_from_status at 61 decision points (max 60) after fix: preserve Vision rearm identity in successor closeout #9118, and docs/product/releases/v2.4.0.md needed an explicit bilingual usage section matching #9182's scoped GitHub PR signal monitor highlight.

Changes

  • loopx/cli_commands/turn_run_once.py:
    • Removed the eager top-of-function resumed-lease lookup in execute_turn_run_once; added memoized resolve_completion_lease() and lazy rebind_resumed_task_lease(*, bind_receipt: bool = True).
    • Executed lazy rebinding only on active paths (on_managed_start_admitted(), writeback() when completion_todo_id is None, completion_writeback() when prior is None), and reused resolve_completion_lease() in todo_completion().
    • In completion_writeback()'s else: (prior is not None) branch, compared retained.prepared_lease against Attempt 1's initial_lease_proof / initial_lease_epoch (prepared_lease_key_sha256 & prepared_lease_epoch) to restore rebound_lease_active = True across secondary post-rebind refresh retries without altering non-rebound lease validation.
  • loopx/control_plane/goals/goal_frontier/semantic_history.py & loopx/control_plane/goals/goal_frontier/__init__.py:
    • Extracted shared acknowledged_replan_obligation_id and resolve_replan_ack_history_state into semantic_history.py, keeping re-exports intact in __init__.py without adding lines or Any tokens.
  • tests/test_codex_turn_completion.py:
    • Expanded test_resumed_turn_rebinds_updated_lease_once_without_rereading_after_retire across [file, sqlite] x [False, True] covering Attempt 2 post-rebind refresh_state_run interruption -> Attempt 3 recovery commit -> Attempt 4 committed replay.
  • docs/product/releases/v2.4.0.md:
    • Reconciled release notes and bilingual contributor credits (@cocolord adding #9047, #9142; @gcl-coder adding #9080) through #9183, and added the bilingual Scoped GitHub PR signal monitors entry (including its non-empty patch update boundary).

Verification

  • pytest tests/test_codex_turn_completion.py tests/test_steward_report_recovery_and_validator.py tests/control_plane/test_replan_history_provider.py tests/control_plane/test_replan_successor_guard_reentry.py: 84 passed
  • control-plane-maintainability-ratchet-smoke.py: ok: true, unreviewed_count: 0, magnitude_regression_count: 0
  • 13-surface release-readiness-doc-smoke.py (including --surface "Scoped GitHub PR signal monitors"), scripts/check_rfc_bilingual.py, ruff check, and repo mypy (17 source files): all passed
  • Goal-bound loopx check, change-quality verify, and canary premerge: executed on exact head

@loopx-agent
loopx-agent force-pushed the codex/fix-turn-resumed-lease-20261121 branch from f50a9d8 to 4876266 Compare November 21, 2026 09:01
@loopx-agent
loopx-agent force-pushed the codex/fix-turn-resumed-lease-20261121 branch from 4876266 to d02b41e Compare November 21, 2026 09:11

@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.

Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, xhigh)

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

当用户恢复一项已经完成或执行中断的管家任务时,LoopX 应保留原 Turn 的验证、写回和扣额。 旧实现会在读取已提交日志以前查找活动租约,Todo 已完成并退役租约时,重放或结案恢复由此失败。 本次修改让已经结案的工作直接读回历史结果,并把仍要写入的工作交给租约校验。两种存储在第二次恢复均返回 refresh_task_lease_unavailable。Todo 已完成,Run 和扣额仍未提交,宿主只执行了一次。 评审使用隔离本地存储与合成宿主。发布和远程宿主操作未执行。 正式安装的 App 与真实 Feishu 未验证。

改动思路 / Approach

修补现有 Turn 与写回所有者之间的续跑交接,使用同一任务、日志和回执。 确认同一 Turn 的 Todo 完成回执后,交给现有写回校验从已退役的租约和已绑定回执推导权限。活动任务继续校验当前租约。 活动任务需要在写入前读取并绑定当前凭证。已完成任务由权威 Todo 的完成回执和原 Turn 日志识别,写回所有者已经可以按该证据读取已退役租约。保留这条恢复路径能在两次中断之间继续推进原任务,避免重跑已经完成的宿主工作。

具体改动 / Changes

精确提交 d02b41e,基线 00ef1c7。5 个文件新增 273 行、删除 76 行,涉及 Turn 调度与结案、Goal frontier 的 ACK 历史、故障回归和双语发布说明。既有 Turn 契约要求保留原始 effect 并在恢复缓存结果时避免重启宿主。terminal-replay 已实现,已提交重放和终态补结算通过。exact-effect-recovery 未达成,未终态的连续中断仍有缺口。release-usage 未达成,作用域监视器的双语使用条目缺失。ACK 提取保持原判定。 Turn 恢复契约

关键代码讲解

  • rebind_resumed_task_lease 把当前租约读取移到活跃需要写入的路径。对已提交日志直接读回时,不再要求活动租约。 重绑定
  • completion_writeback 从同一 Turn 查到已完成的 Todo 时跳过再次完成。随后 refresh_candidate 还可能把执行上下文保存的第一代租约传给 Run 写回。 已完成分支 凭证选择
  • resolve_replan_ack_history_state 使用原来的 ACK、反馈时间和 obligation ID 判定,仍保留旧导入入口。新增回归覆盖一次重绑定及随后成功重放。 ACK 读取 现有回归
  • v2.4.0 发布说明同步了两种语言的恢复描述及贡献者。公开合并元数据确认 #9047、#9142、#9080 的署名。 发布说明

对主干的风险 / Risks

[P2] 重绑定后的完成写回中断,第二次恢复继续携带旧租约。 用 File 或 SQLite 创建两个开放 Todo。在写入第一条 Todo 的完成结果前中断,释放并重新领取该 Todo,沿原 Turn 恢复。让 Todo 原子完成并退役第二代租约,在追加 Run 前再次中断,然后再次重试同一 Turn。 两种存储在第二次恢复均返回 refresh_task_lease_unavailable。Todo 已完成,Run 和扣额仍未提交,宿主只执行了一次。 对照仅在第二次恢复的完成写回清除传入的旧 proof,原写回校验保存同一 Run,计入一次扣额,随后重放成功。 确认同一 Turn 的 Todo 完成回执后,交给现有写回校验从已退役的租约和已绑定回执推导权限。活动任务继续校验当前租约。 建议在 test_resumed_turn_rebinds_updated_lease_once_without_rereading_after_retire 增加完成之后、Run 写回之前的第二次中断,并在 File/SQLite 检查一次宿主执行、一次扣额和可重放。 凭证选择

[P2,发布说明] 新列出的监视器投递缺少可操作的使用节。 发布说明把独立的 GitHub 监视器投递列为亮点,但双语可选能力使用节没有对应的启用、验证、停用和绑定权限说明。 用仓库的 release-readiness-doc-smoke.py 对本文件额外传入 --surface 'Scoped GitHub PR signal monitors',报告缺少标题。当前头另用 SQLite 复现仅修改收件箱范围时返回 Todo update requires a non-empty patch,该行为已随 #9182 进入基线。补齐带版本链接的双语操作节,或暂缓发布这条亮点。范围更新的既有问题应在发布资格中单独列出。 发布亮点 发布用法门

语义与 CI 对齐

74 项针对性 Python 验证通过,基线的 6 个 File/SQLite 终态用例均失败。当前头另有四个独立复现与对照用例通过其各自的结果断言。可维护性检查和本地 quick premerge 通过。发布说明单独列入新监视器的使用节检查失败。托管 CI 未读取。 对照通过原写回所有者验证已提交的完成事实,未绕过租约、Goal 或 Agent 绑定。可维护性收敛没有改变 ACK 事件或状态词汇。正式安装的 App 与真实 Feishu 未验证。

我的整体评价 / Verdict

REQUEST_CHANGES。 现有修复让已提交 Turn 可直接重放,降低了重新启动或人工结算的成本。连续中断仍能把同一任务卡在完成与结算之间。请补测该恢复路径,并把监视器使用边界写进双语发布说明。

English verdict: REQUEST_CHANGES at d02b41e. File and SQLite still strand non-terminal completion after a rebound lease retires. The new scoped-monitor release claim also lacks its bilingual usage entry.

…ries and document scoped monitors

Signed-off-by: LoopX Agent <[email protected]>

@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.

Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, xhigh)

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

中断后继续已验证任务的管家用户需要恢复原 Turn,使用 GitHub 监视器的用户也需要按发布说明可靠停用它。 旧版本在已结案重放时仍找活动租约,重绑定后再次中断也会把过期的第一代租约送进写回。 新提交已恢复连续中断后的原 Turn。两组均轮询一次,Todo 均为 open。保留文件的读回只有 #42,删除后新增本应被筛除的草稿 #43。 复核使用本地 File/SQLite、合成宿主和模拟 GitHub 数据。正式 App 与真实飞书未复验。 发布文档需要按真实 Todo 生命周期改正后重验。

改动思路 / Approach

使用原 Turn 的权威完成事实恢复结算,并把监视器停用说明接到现有 Todo 生命周期。 保留监视器范围,使用现有的暂停或终止动作停用它。 Turn 结案继续验证同一任务、同一回执及退休租约。监视器的配置文件只规定观察内容,执行是否继续由 Todo 状态决定。分别用两种存储验证重试与一次扣额,再用同一输入比较保留与移除范围时的实际监视结果。

具体改动 / Changes

精确提交 c2c7bd7 对基线 00ef1c7,5 个文件新增 380 行、删除 96 行。上次评审在 d02b41e 指出的两项已处理:File/SQLite 连续中断能继续结算,新增两种语言的监视器使用节。按既有规范,terminal-replay 与 exact-effect-recovery 已落实,release-usage 已增加用法栏目但停用步骤仍未达成。 Turn 恢复规范 发布用法要求 上次评审

关键代码讲解

  • rebind_resumed_task_lease 只在实际需要活动租约时读取并绑定它。completion_writeback 读回同一 Turn 的完成事实,并用该 Turn 已记录的 key hash/epoch 选择恢复路径。 重绑定 接续完成
  • resolve_replan_ack_history_state 统一读取当前 ACK、更新的反馈和上一代重开依据,复用原来的 obligation ID 规范化。 ACK 投影
  • 新回归在真正 Todo 退休和 Run 写回之间注入失败。续跑先用第二代租约完成 Todo,再在 Run 写回前中断。下一次同一 Turn 从已完成的权威回执继续,保留一次宿主执行与一次扣额。 回归矩阵
  • 新双语使用节补齐启用、验证、停用和权限。贡献者按 #9047、#9142、#9080 的合并归因核验。 英文用法 中文用法

对主干的风险 / Risks

[P2] 文档把移除过滤配置列为停用方式。 在隔离 SQLite 中通过管家创建仅看非草稿 PR 的监视器。两组输入都包含一条正常 PR 和一条草稿,第二组在空闲时删除作用域文件,再让监视器到期。 两组均轮询一次,Todo 均为 open。保留文件的读回只有 #42,删除后新增本应被筛除的草稿 #43。 当前运行时在配置文件缺失时继续读取 repo,并回到没有该过滤条件的默认观察范围。删除双语说明里的删文件停用步骤,给出管家正常暂停或结束 Todo 的操作和状态读回。 可复验同一个监视器暂停后没有新的到期轮询,配置和历史保留供恢复。 英文停用步骤 中文停用步骤 默认观察分支

语义与 CI 对齐

本地 84 项针对性 Python 测试通过,其中 10 个原 Turn 回放及租约续跑组合均通过。双语发布用法 smoke 与可维护性检查通过。 模拟 GitHub 的两组输入相同,使用实际 Chat 动作、SQLite Todo 与监视器轮询。发布 smoke 检查栏目完整性,运行观察另外验证栏目中的步骤。Monitor 运行时沿用主干。

我的整体评价 / Verdict

REQUEST_CHANGES。 原 Turn 的连续中断已经能恢复,使用节缺失也已关闭。请先修正 v2.4.0 双语停用指引。实际删文件会让仍开放的监视器扩大观察范围。

English verdict: REQUEST_CHANGES at c2c7bd7. The repeated-interruption recovery passes on File and SQLite. The new release notes incorrectly describe removing a scope file as disabling a monitor that stays active and widens its observations.

@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.

Reviewer: model_agent · Gemini · Google · self_reported

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

动机 / Motivation

受影响的是通过 execute_turn_run_once(尤其是由原生宿主传入 native_completion_lease_resolver 并携带 --resume-turn-key 恢复、二次重试或重放的 Turn)推进任务闭环的调用方、依赖 goal-frontier 可维护性护栏的维护者,以及依照 v2.4.0 发布说明启用、验证与停用监控并核对贡献者归属的发布操作者。

修复前,基线 00ef1c79 在 execute_turn_run_once 入口对所有 --resume-turn-key 调用无条件触发 native_completion_lease_resolver() 与 read_active_task_lease_epoch(),导致已提交 Turn 重放与 lost_completion_receipt 结案恢复(租约已随 todo_complete 退役)被直接拒绝,并在 after_debit 恢复时重复读取租约;同时 build_goal_frontier_projection_context_from_status 在 #9118 后达到 61 个决策点触发可维护性红线;早期 head d02b41ee 遗漏 completion_writeback prior is not None 的持久化重绑定识别,而上版 c2c7bd7f 在 v2.4.0.md 中误将删除 steward-monitors/<goal_id>/scopes/<target_key>.json 列为监控停用方式(实测会使 open 监控回退为无过滤默认观察并放行草稿 PR)。当前精确 head 081b8d2f 已在代码侧推迟并记忆化惰性租约重绑定、在 completion_writeback else 分支从持久化 retained.prepared_lease 恢复 rebound_lease_active = True、抽离去重 resolve_replan_ack_history_state / acknowledged_replan_obligation_id,并在 v2.4.0.md 移除删文件停用误导,明确指示通过管家对话(pause/stop)或 CLI 将待办切离 open(--status blocked/deferred/done)停用并警示勿删除活跃监控的作用域文件。

实测基线 00ef1c79 上 test_native_terminal_closeout_keeps_the_original_lease_and_turn 全部 6 组用例失败、goal_frontier 可维护性超限;在精确 head 081b8d2f(代码与 c2c7bd7f 零差异)上,Attempt 3 与 after_debit 独立探针均返回 0 committed lease_reads=[1, 2]、ruff 与 17 源文件 mypy 全绿、release-readiness-doc-smoke.py 全部 13 个 --surface 通过、SQLite 监控控制对比探针验证暂停待办(status=blocked)后 turns_polled=0 且 scope_file_exists=true,loopx check 与 canary premerge --tier quick 通过;同份无差异代码在 c2c7bd7f 上还完成 84 passed 核心/恢复测试、107 passed 棘轮/租约测试、2 passed 通用监控测试与 174 passed TS 控制面测试。

本 PR 不改动 task-lease 权威状态机、不修改 TypeScript todo_terminal_lifecycle 或 settlement_readback 判定规则、不放宽 #9182 仅改 signal_scope 而不改 Todo 本体字段时被 todo update 拒绝空补丁的既有约束(已在发布说明明确披露),也不执行实际发版或标签发布。若保持基线现状,main 上涉及终态恢复与已提交 Turn 重放的原生宿主执行会持续卡在租约校验,控制面可维护性棘轮也会阻断发版门禁,而误导性的删文件停用步骤则会令本应暂停的 GitHub 信号监控继续轮询并扩大观察范围;当前精确 head 081b8d2f 已完整消除上述所有问题,形成可安全合入的完整切片。

改动思路 / Approach

本次改动在保持控制面内核与写回授权所有者不变的前提下,围绕“按需绑定仍需活跃租约的路径并保证跨次恢复同步”、“无副作用拆分并去重 goal_frontier 历史投影”以及“按真实 Todo 生命周期对齐 v2.4.0 发布操作指引”三条主线推进。

在 execute_turn_run_once(loopx/cli_commands/turn_run_once.py)中,调用入口仅记录 initial_lease_proof 与 initial_lease_epoch,不再预先读取活跃租约;当 Turn 为已提交重放或 lost_completion_receipt 终态恢复时,完全不调用 native_completion_lease_resolver() 与 read_active_task_lease_epoch()。只有在 on_managed_start_admitted、writeback(completion_todo_id=None) 与 completion_writeback(prior is None) 等仍需活跃租约的分支才经记忆化的 resolve_completion_lease() 与 rebind_resumed_task_lease() 读取并绑定租约;若非终态 Turn 在先前的重试中已完成重绑定和 todo_completion 但后续 refresh_state_run 失败,再次进入 completion_writeback 的 else(prior is not None)分支时,会用读回的持久化 retained.prepared_lease 对比 prepared_lease_receipt_fields(initial_lease_proof, lease_epoch=initial_epoch_int),一致恢复 rebound_lease_active = True,从而由 refresh_candidate() 传入 refresh_task_lease_proof = None 交由既有持久化回执闭环。在文档侧,c2c7bd7f..081b8d2f 仅改动 docs/product/releases/v2.4.0.md,移除了将删除作用域 JSON 当作停用快捷方式的步骤,明确要求通过管家对话 pause/stop 或 CLI 将 Todo 切离 open 后由 loopx todo list 验证,并清晰说明删文件会回退到无过滤观察。

--resume-turn-key 恢复路径 基线 00ef1c79 精确 head 081b8d2f(代码同 c2c7bd7f)
status == "committed" 重放 入口急切读活跃租约,已退役时拒绝 跳过租约读取,return_existing 成功
lost_completion_receipt 终态恢复 入口读已退役租约,抛出租约已变更错误 直接由 terminal_closeout_resolver 确认完成
after_debit 终态(含续租 epoch 2) 入口多读 1 次,lease_reads 达 3 次 仅 todo_completion 读 1 次,lease_reads=[1, 2]
on_managed_start_admitted 宿主失败恢复 入口重绑定 按需重绑定 bind_receipt=False 后写回执
非终态先重绑定完成、再重试 refresh_state_run(Attempt 3) 入口读已退役租约失败 从 retained.prepared_lease 恢复 rebound_lease_active=True,提交成功

(注:上表基于精确提交 081b8d2f8b77cefedded9317e78bc1bedda5b95d 源码路径与实测矩阵整理,采用 Markdown 表格展示,未渲染 Mermaid。)

将 resolve_completion_lease()、rebind_resumed_task_lease() 与 completion_writeback 的持久化 retained.prepared_lease 一致性判定留在 CLI Turn 适配器 turn_run_once.py,以及将无状态历史读取辅助 resolve_replan_ack_history_state() 与去重后的 acknowledged_replan_obligation_id() 收口至 goal_frontier/semantic_history.py,完全契合既有分层边界而无需上移到控制面内核。当前 PR 范围锁定于 CLI 适配层按需租约重绑定与跨次恢复同步、goal_frontier 复杂度治理与重复逻辑去重,以及 v2.4.0.md 发布说明与贡献者条目对齐;此前 d02b41ee 与 c2c7bd7f 提出的全部发现已在精确 head 081b8d2f 彻底闭环。

具体改动 / Changes

  • 规范依据声明(no_spec): 代码侧修复针对 #9157 回归与 #9118 圈复杂度超限,无独立新增 RFC 或规范文档(spec_basis: no_spec / none);docs/product/releases/v2.4.0.md 对照仓库发布契约 docs/product/release-readiness.md 补全全部 13 个可选能力段,已核对 @cocolord(#9047、#9142)与 @gcl-coder(#9080)的贡献条目,且在 081b8d2f 对中英文 Disable / rollback(停用 / 回退)段修正为真实的 Todo 生命周期停用方式。
  • 变更行分类(5 个文件,+384 / -96): 生产代码 3 处(turn_run_once.py +78/-32、goal_frontier/__init__.py +12/-40、goal_frontier/semantic_history.py +71/-0),测试 1 处(tests/test_codex_turn_completion.py +161/-0),公开文档 1 处(docs/product/releases/v2.4.0.md +62/-24;其中 c2c7bd7f..081b8d2f 仅修订 v2.4.0.md +6/-2)。

关键代码讲解

  1. resolve_completion_lease 与 rebind_resumed_task_lease(turn_run_once.py#L130-L170):在 execute_turn_run_once 入口保存 initial_lease_proof / initial_lease_epoch,移除顶层无条件检查;以 cached_completion_lease 记忆化单次回调解析,仅在需要活跃租约时校验活跃 epoch 并按 bind_receipt 更新心跳回执。
  2. completion_writeback(turn_run_once.py#L514-L590):prior is None 时先执行 rebind_resumed_task_lease(bind_receipt=True) 再调用 todo_completion();else:(prior is not None)读回权威 retained = read_heartbeat_settlement(...) 后,以 prepared_lease_receipt_fields(initial_lease_proof, lease_epoch=initial_epoch_int)(过滤 bool 非法整数)对比 retained.prepared_lease 的 prepared_lease_key_sha256 与 prepared_lease_epoch,不等时恢复 rebound_lease_active = True。
  3. refresh_candidate / writeback / on_managed_start_admitted(turn_run_once.py#L308-L395 与 turn_run_once.py#L857-L862):非 completion 的 writeback 与宿主启动准入回调按需重绑定租约;completion_writeback 同步 rebound_lease_active = True 后,refresh_candidate 将 refresh_task_lease_proof 置为 None,交由 refresh_state_run 通过持久化回执与已退役租约完成幂等写回。
  4. acknowledged_replan_obligation_id 与 resolve_replan_ack_history_state(semantic_history.py#L335-L408 与 goal_frontier/init.py#L1450-L1464):将 ACK、反馈时间戳覆盖与 prior_rearm_ack 合并逻辑单一归口至 semantic_history.py,同时去重 obligation_id 提取并在 __init__.py 保持原有重导出,使 build_goal_frontier_projection_context_from_status 决策点降至 60 阈值以内。
  5. 双语 Scoped GitHub PR signal monitors 停用与回退修订(docs/product/releases/v2.4.0.md#L370-L386 与 docs/product/releases/v2.4.0.md#L759-L776):移除误导性的删作用域文件停用路径,改为管家对话 pause/stop 与 CLI loopx todo update ... --status blocked(或 deferred/done)+ loopx todo list 读回校验,同时保留现有 #9182 空 Todo 补丁更新提示与作用域文件保留说明。

对主干的风险 / Risks

  • 阻塞判定: 无阻塞缺陷(No blocking finding remaining at exact head 081b8d2f8b77cefedded9317e78bc1bedda5b95d)。此前在 d02b41ee 与 c2c7bd7f 发现的全部问题——非终态 completion_writeback 跨重试丢失重绑定标记、goal_frontier 重复提取、v2.4.0.md 缺失第 13 项监视器使用条目以及停用指引误导删作用域 JSON 文件——在精确 head 081b8d2f8b77cefedded9317e78bc1bedda5b95d 均已修复并经独立验证通过。
  • 残余风险与未覆盖边界:
    1. 隔离验证基于 canonical File / SQLite 存储及合成宿主回调完成,未启动线上 Codex App Server 守护进程、PostgreSQL authority store、打包发布包或真实飞书渠道投递。
    2. v2.4.0.md Bash 示例中的 loopx todo update ... --status blocked 为仓库一贯的命令速记写法;实际对已声明 hard_lease 的运行中 Agent Todo 执行写操作时需带 --execute 及租约/角色参数(或直接经由管家对话 pause/stop 自动办理),且仅修改 signal_scope 仍受 #9182 既有 Todo update requires a non-empty patch 约束(两项均属非阻塞既有设计,已在文档与前置测试边界说明)。
    3. turn_run_once.py 在 --follow-imports=silent 下保留 29 处改动前既有旧行 mypy 警告(改动行零新增错误);仓库默认 mypy 严格清单 17 个文件全部通过。
  • 边界与隔离检查: 所有修改文件均为活跃生产、测试与发布文档(scope_fit: fit),未引入默认关闭开关或门控旁路(default_off_isolation: not_applicable),未修改 actor 权限语义(authority_semantics: not_applicable),未新增或修改注册语义词汇或 CI 契约(semantic_alignment: not_applicable,local_only),状态与边界保持 typed 与领域中立(typed_state_rule、domain_neutrality)。

独立本地验证(wait_for_ci: false)

检查项 运行提交 状态 说明
基线 00ef1c79 对照复现(test_native_terminal_closeout_keeps_the_original_lease_and_turn + collect_oversized_decision_functions) 00ef1c79(基线) FAIL(预期复现) 6 组终态用例全败;goal_frontier 报 61 决策点(上限 60)
发布文档 13 入口校验(release-readiness-doc-smoke.py --release-notes docs/product/releases/v2.4.0.md) 081b8d2f(当前 Head) PASS release-readiness-doc-smoke ok(13/13 中英文小节齐全)
SQLite 作用域监控删除 vs 暂停对照探针 081b8d2f(当前 Head) PASS 正常/删文件对比确认删文件导致 turns_polled=1 且接入 #43;暂停(status=blocked)确认 turns_polled=0 且 scope_file_exists=true
独立 SQLite 反例探针(Attempt 3 post-rebind refresh_state_run 中断 & after_debit 续租恢复) 081b8d2f(当前 Head) PASS 均输出 0 committed ... lease_reads=[1, 2]
ruff check & 仓库默认 mypy(17 源文件) 081b8d2f(当前 Head) PASS All checks passed!、Success: no issues found in 17 source files
公开边界扫描与前置门禁(loopx check 5 文件 + loopx canary premerge --tier quick) 081b8d2f(当前 Head) PASS public boundary scan clean: 5 files、canary premerge ok: true, failures: 0(含 check_rfc_bilingual.py、maintainability-ratchet、py_compile 与 3 个 catalog canaries)
核心完成/管家/重规划、棘轮/租约、监控与 TS 控制面完整回归(.py/.ts 与 081b8d2f 字节完全一致) c2c7bd7f(同代码树) PASS pytest 84 passed (215.25s) + 107 passed (206.59s) + 2 passed (12.37s);TS 174 passed, 0 failed;全部 smokes 全绿
远程 GitHub Actions CI — UNVERIFIED 按 Goal 配置 wait_for_ci: false 不查询、不等待远程 CI

我的整体评价 / Verdict

在 problem_context 与 outcome_impact 层面,PR #9183 在精确 head 081b8d2f 完全达成修复目标(goal_achieved):long_horizon 为 improved(恢复 #9157 阻断的已提交重放与终态 closeout 路径,堵住非终态 completion_writeback 跨进程二次重试卡死,并在文档侧杜绝误删作用域 JSON 造成的静默扩大轮询风险);user_experience 为 preserved(本 PR 无前端渲染界面改动,visual_review: not_applicable,v2.4.0.md 13 项可选能力与真实停用/限流边界一致)。

在 observable_semantics、code_volume 与 change_proportionality 层面,基线 00ef1c79 与精确 head 的对照矩阵已完整证明行为变化意图(intentional_change_validated);全量 diff +384 / -96 体量克制、无多余抽象且消除重复(necessary、compatibility_assessment: retain),与修复目标完全相称(proportionate,架构决策 retain);同时确认 semantic_alignment 为 not_applicable(local_only),未变更任何注册语义词汇、协议版本或 CI 策略。所有在先发现已在 081b8d2f8b77cefedded9317e78bc1bedda5b95d 清零,具备批准条件(实际合入仍以维护者授权与 --check-approval-closeout 为准)。

English verdict: APPROVE — At exact head 081b8d2f8b77cefedded9317e78bc1bedda5b95d, only docs/product/releases/v2.4.0.md changed atop the verified c2c7bd7f implementation: it removes the unsafe scope-file deletion shortcut from both English and Chinese Disable / rollback sections, prescribes pausing or stopping the Monitor Todo with loopx todo list readback, and passes all 13 release-readiness-doc-smoke entries alongside local ruff, mypy, public-boundary, and canary premerge validation (wait_for_ci=false).

@loopx-agent
loopx-agent merged commit 23dacd5 into main Nov 21, 2026
20 of 45 checks passed
@loopx-agent
loopx-agent deleted the codex/fix-turn-resumed-lease-20261121 branch November 21, 2026 10:01

@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.

Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, xhigh)

Post-merge audit

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

中断后继续已验证任务的管家用户需要恢复原 Turn,使用 GitHub 监视器的用户也需要按发布说明可靠停用它。 上一头将删除作用域文件列为停用,实际仍观察仓库并扩大范围。新头已纠正这个说明。 在隔离 SQLite 管家 Goal 中创建有 PR 过滤范围的 Agent 监视器,到期前照发布说明执行 todo update 的 blocked、deferred 和 done 三种状态。 CLI 的三种写法都退出失败。blocked 和 deferred 缺绑定 actor,返回 actor_required。done 返回 invalid_coordination_todo_update,并要求使用 todo complete。三个 Todo 仍为 open,到期各发起一次轮询和一次仓库读取。 验证覆盖本地 File/SQLite、隔离的管家控制面和合成 GitHub 响应。正式安装 App、真实飞书和托管检查未复验。

改动思路 / Approach

重试结案基于原 Turn,监视器停用沿用绑定 Todo 生命周期。双语示例改为经验证的绑定所有者暂停命令,注明身份和理由。永久停止如要保留 CLI 示例,应使用既有 todo complete 契约并验证真实角色、租约和读回。 监视器是否继续到期读取由权威 Todo 状态决定。复评在隔离 SQLite 创建有过滤范围且即将到期的监视器,执行发布说明的 CLI 命令,随后读回真实 Todo 和轮询结果。

具体改动 / Changes

精确提交 081b8d2f8b77cefedded9317e78bc1bedda5b95d 对基线 00ef1c79ae5dfed0dfc4681968ee12369b510345 涉及 5 个文件。租约现按需要读取,写回重试复用已验证的原 Turn,ACK 历史计算移到既有历史模块。替代提交只改发布说明,移除了删文件停用步骤。

  • terminal-replay 已验证。已完成的同一 Turn 重放能从已提交结果返回,避免再次要求已经退休的活动租约。
  • exact-effect-recovery 已验证。重绑定后第二次中断,从原完成记录复原正确的租约代际并只记账一次。ACK 历史复用同一 obligation ID 规范化和反馈时序。
  • release-usage 已修改双语说明,新增 CLI 命令仍需修正。本次比较保持原过滤范围、相同到期条件与仓库数据,并以真实 Todo 状态和实际调度作为结果。

结案恢复 Turn envelope 规范 上次评审

对主干的风险 / Risks

[P2] 新的 CLI 停用示例无法更新 Agent 监视器。 CLI 的三种写法都退出失败。blocked 和 deferred 缺绑定 actor,返回 actor_required。done 返回 invalid_coordination_todo_update,并要求使用 todo complete。三个 Todo 仍为 open,到期各发起一次轮询和一次仓库读取。 通过已有绑定所有者生命周期提交带 agent、role、reason 和操作 ID 的暂停后,Todo 读回 blocked,作用域保持,下一次到期零轮询、零仓库读取。 双语示例改为经验证的绑定所有者暂停命令,注明身份和理由。永久停止如要保留 CLI 示例,应使用既有 todo complete 契约并验证真实角色、租约和读回。 Todo 列表能确认状态,零轮询通过实际到期调度验证。 英文停用示例 中文停用示例 绑定身份检查 完成边界

精确头 84 项原 Turn、管家报告与 ACK 回归通过。双语使用节检查通过。真实 CLI 和轮询的 5 个对照均按预期读回,三个照抄示例的分支都未停用。 验证覆盖本地 File/SQLite、隔离的管家控制面和合成 GitHub 响应。正式安装 App、真实飞书和托管检查未复验。

我的整体评价 / Verdict

REQUEST_CHANGES。 合并提交 23dacd5fb449194c6a8d83e9764534cdbdd081b4 的文件树与精确头一致,主干仍含这两处示例。原 Turn 结案与删除作用域文件的说明已修复。请修正双语 CLI 示例,确保停用通过已有身份校验,并复验同一监视器到期后零轮询、作用域文件仍可读。

English verdict: REQUEST_CHANGES at 081b8d2f8b77cefedded9317e78bc1bedda5b95d. The scope-file guidance was corrected. The replacement CLI examples reject all three documented transitions on a bound agent monitor, leaving it open and polling. The existing authorized owner pause stopped the next due poll.

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.

1 participant