Skip to content

fix(replan): recover an open Vision review on its admitted receipt - #8627

Merged
huangruiteng merged 1 commit into
mainfrom
codex/receipt-bound-vision-reentry-20261112
Nov 12, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/receipt-bound-vision-reentry-20261112

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Problem

An admitted Vision checkpoint can still be open after a separate periodic review takes priority. The frontier projector can reconstruct the exact earlier obligation from current canonical facts. Receipt recovery handled acknowledged transitions and the current obligation, so an open reconstruction was rejected by both admission replay and writeback.

Change

  • Preserve the exact, still-open Vision review for its original receipt when the existing frontier query reconstructs it for the same agent.
  • Pass the full reconstructed obligation to the existing semantic qualifier. The original receipt remains the settlement identity, and successful writeback is required before debit.
  • Keep historical acknowledgements, successor transitions, and committed-writeback recovery in their existing precedence.

Verification

  • The new regression fails on the base revision with the receipt identity conflict and passes with the fix.
  • 78 focused Python tests and 35 TypeScript replan semantic tests passed.
  • Replayed a copied stopped-worker SQLite state through the production CLI. A fresh guard still projected the newer review before closeout. The original receipt accepted one evidence-linked writeback and one debit, a retry replayed that debit, and another guard skipped the settled turn.
  • The same replay rejected a stale Explore revision, a different obligation, and a debit attempted before writeback.

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

本次评审对应提交 a079e3e4923d5a17e31cb2f8cafced8407cab24d。

动机 / Motivation

需要在重启或中断后恢复已准入 Vision 评审的 Agent。原回执的开放 Vision 被独立的周期复盘遮住时,主干报回执与当前义务冲突。先留下开放 Vision 回执,再让真实已结算工作满足周期复盘阈值。候选可按同一原回执继续。原 Turn 恢复、有效 Vision 写回和一次扣额通过,新的周期复盘仍由新 Turn 持有。范围限原生 quota 与结算路径,保留独立当前复盘和实际运行验证边界。

改动思路 / Approach

沿现有 frontier 查询重建原义务,在共享 TypeScript 判断里核定候选资格。两个原生调用继续走原回执、语义写回和扣额。 新分支只采用当前规范数据能重建的确切原 ID。已接受的历史 ACK、successor transition 和已写回重放继续优先。 共享资格判断

具体改动 / Changes

关键代码讲解

  • build_goal_frontier_projection_context_from_status 用现有 frontier query 重新派生 Vision 义务。原 ID 一致时把完整候选交给共享语义入口。 重建候选
  • preserveReceiptBoundObligation 要求已绑定 guard、同 Agent、原 schema 和限定的 Vision trigger。只有满足这些条件,才把原回执绑定补回完整义务。 选择与拒绝
  • quota 回查与 refresh-state 共用这项资格。仍需新证据产生 fresh_vision_path_outcome,有效写回后沿原回执扣额。 准入回查 语义写回

以 base 9ce3a46bfe525aa2167de6699fc676ce8ef60247 的 docs/reference/protocols/goal-vision-replan-contract-v0.md 为依据。ORIGINAL-VISION-RECEIPT 由原回执、原事件和两条 Vision trigger 验证。FRESH-EVIDENCE-BEFORE-DEBIT 由无证据、错绑和提前扣额拒绝验证。SAME-TURN-IDEMPOTENCY 由重复扣额及已结算读回验证。 结算规范

对主干的风险 / Risks

PASS。使用实际 File/SQLite CLI。先结算一轮独立工作,再在隔离配置中调低周期阈值,让新 Turn 获得周期复盘。相同条件下,主干回查原 Vision 报 identity conflict,候选恢复原回执。新 Turn 在两臂都读到周期复盘。

PASS。候选拒绝提前扣额、无新证据和错误义务 ID。写回成功后两次扣额命令只新增一笔,回查返回已结算。43 项 Python gate、38 项相邻 CLI/读取、35 项 TS 以及 quick canary 的 6 项直接与 3 项选中检查通过。

语义与 CI 对齐

真实效应仍来自原 Goal、Agent、义务和 Turn。源重建标记只由已有 frontier 提供,完成旧写回后重放继续读取原回执。 结算阶段优先级

我的整体评价 / Verdict

本提交恢复了受影响的原生工作路径,且在同一真实入口保留原证据要求和一次结算。文件与 SQLite 对照都满足这项交付。检查 loopx/control_plane/quota/should_run_prepare.py 与 loopx/control_plane/work_items/semantic_replan_writeback.py 的 CLI 读写路径。独立验证使用源码 CLI 与隔离 File、SQLite。已安装宿主和真实运行中的工作状态仍待验证,远端 CI 为 UNVERIFIED。

English verdict: APPROVE. At a079e3e, matched File and SQLite CLI runs restored the original open Vision receipt while a fresh Turn kept its periodic review. Invalid writebacks and early debit were refused, and settlement remained once-only.

@huangruiteng
huangruiteng merged commit 271809a into main Nov 12, 2026
32 of 44 checks passed
@huangruiteng
huangruiteng deleted the codex/receipt-bound-vision-reentry-20261112 branch November 12, 2026 08:17
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