Repository navigation
fix: report outcome gaps immediately and correct terminal recovery - #7941
Conversation
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: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max.
动机 / Motivation
通过 refresh-state 收尾工作、再从 quota 接续的 Agent 和维护者。 以前 checkpoint 已满足的回执仍可能缺少成果路径或证据,调用者下一次 quota 才看到缺口;现在这份回执立即给出同一个缺口,终态恢复同时指向原完成身份。 File/SQLite 的成果资格缺口在当前回执与后续 quota 完全一致;合法原身份收口后,独立等待、后续工作和各自的准入条件继续保留。 不改变等待合法性、终态 writer、完成身份、scheduler、工作准入或一次结算规则;不宣称真实模型采用、科学成果或长程净收益。 用户继续使用已有收尾/接续入口,不需要重新输入已知需求或增加一次确认;当前缺口仍须以实际证据修正,诊断本身不是完成验收。
改动思路 / Approach
立即反馈复用历史读取原有的 checkpoint 投影和资格函数;生命周期提示复用现有 TS reentry owner,没有第二套验收或终态 writer。 本 PR 交付即时资格解释和可执行的既有终态收口指引;实际决策、合法等待、依赖和执行权仍由原 owner 判断。 这比新增验收规则、第二套恢复器或自动改写 Todo 更小,也避免了“回执 satisfied 就算目标完成”的错误。一个当前记录同时提供历史与即时解释,机器状态和提示文本分别保留各自 owner;失败时仍通过原流程回读和修复。
| 场景 | base | 本 head |
|---|---|---|
| 缺 path/refs/claim 或 wait | 当前回执无 gap,下一次 quota 才出现 | 当前回执立即给出与下一次 quota 相同的 gap |
| 已完成 Todo 的后继 | 文字建议给终态加链接,writer 拒绝 | 保留原完成身份,关闭该范围;真实依赖仅写在合法可变一侧 |
| 独立等待或后续工作 | 由原 canonical/guard 处理 | 状态、原等待和实际准入判断保留 |
具体改动 / Changes
完整评审 7941@95f7d8e889b1165bce5f167b03912eb94adf3959 的 9 路径、+169/-110;其中生产 5 路径 +85/-49,测试 4 路径 +84/-61。先读的 specification 是 docs/reference/protocols/goal-vision-replan-contract-v0.md,revision 107e9e32e8f3df29f63b94524250f4044cc01a80:material closeout 要求验收声明、证据和合法路径;Completed Todo lifecycle reentry 保留原完成身份和独立后续范围;Semantic History Continuity 要求 same-run、同 Agent 的资格事实。三项均由当前源码和下面真实入口验证映射为 implemented,没有把作者 counts 当独立证据。
关键代码讲解
outcome_vision_checkpoint_from_run:130从原 history loop 提取既有投影,保留 Agent、material trigger、continuity basis 和 same-run qualification vision;不新增资格规则。refresh_state_run:1367在原 record 提交前调用同一投影和acceptance_gaps_from_outcome_checkpoint,仅附加诊断,既不代替原 write gate,也不自动修复或接受 outcome。projectTodoLifecycleSettlementReentry:100保留原完成键、命令参数与 shell quoting,说明终态不能加链接;真实依赖须符合 mutable successor 的实际 readiness,独立 deferral/claim/gate 不能被替换。render_state_refresh_markdown:503从已有 component_checks 列出当前缺口;interaction contract 和 Goal frontier 的生命周期文案同步,未增加强制执行 flag。
独立六个完整 Python 模块 137 PASS,两个完整 TS 模块 35 PASS,typecheck/Ruff 通过;原两个真实生命周期例单独复跑仍 PASS,未重复计入 137。相同 fixture 在 File/SQLite、immutable base/head 各跑 16 个完整 CLI 场景:后续 quota 都有 10 个资格缺口,当前回执从 base 的 0 个变为 head 的 10 个;六项 component_checks 与后续结果逐项一致,Todo 和 provider revision 未被诊断改写。
生命周期配对在两个真实 provider、两版源码各执行四条原完成身份收口命令。错误身份和给终态重连后继均拒绝,Todo/provider 不变;正确命令成功后,独立 deferred Todo 的完整 canonical 行仅有已校验的派生观察时间差,status、claim、原 resume 条件及其他字段保持。再创建其他 Agent 和同 Agent 的后续工作,实际 quota 均为 normal_run;这证明关闭的是旧范围,并非 Goal 或未来工作。注册、命令或 guard 成功仍不意味着已经执行新业务。
对主干的风险 / Risks
新增 acceptance_gaps 会随原 record 持久保存,但读取方仍使用既有资格函数重新判断,不能把诊断字段当授权或新的 truth store。提示允许 genuine dependency,不允许为了让 gate 变绿去替换合法等待、伪造依赖或制造 filler Todo。原 lease、完成身份、终态不可变和一次结算 owner 均未改;#7942 的 deferred resume renderer 是另一个待评审切片,这份批准不覆盖它。
独立 standard premerge:6 direct PASS;18 selected 中 17 PASS、1 inherited maintainability advisory,零 blocking/manual hold。完整 semantic、diff/RFC gate、编译通过;另以隔离空 registry/runtime 完成 9 路径公开边界扫描,boundary clean(空 fixture runtime 不存在提示单列)。原 raw renderer ratchet 仍 FAIL,base/head 完整 393 bytes stdout/空 stderr 相同、因果 whole file 未改。
原 strict 配置 mypy 仍 FAIL:786 errors/125 files,两端原 17 入口和相同 Python/mypy/config/uv.lock。完整 119,338 bytes 诊断仅有 6 处行号移动;逐条映射到两个 changed 文件中完全未变的源码表达式后,全部错误/note 内容及 multiplicity 相同,其余 123 个报错文件 whole blob 相同。没有过滤错误、修改阈值、删断言或把失败改记通过;独立当前 invariant 由上面的真实配对覆盖。没有查询、轮询或等待 CI,未知 CI 不是本次批准的缺证据项,也不清除单独质量/合并门。
语义与 CI 对齐
五个 changed source paths 的 bounded vocabulary advisory 没有发现支持类型的新 carrier;这不证明动态语义安全,完整 diff、现有定义/消费者和 full semantic 也已核对。共用现有 OutcomeCheckpointReason、component_checks、生命周期 schema 和 canonical writer,没有字符串关键词推断、第二份状态或 domain-specific generic obligation。适用的同源读取、原完成/错误身份、独立等待与未来主体反例保持了生产边界。
我的整体评价 / Verdict
对 7941@95f7d8e889b1165bce5f167b03912eb94adf3959 的结论为 APPROVE,未发现当前改动 blocker。立即反馈复用历史读取原有的 checkpoint 投影和资格函数;生命周期提示复用现有 TS reentry owner,没有第二套验收或终态 writer。 本 PR 交付即时资格解释和可执行的既有终态收口指引;实际决策、合法等待、依赖和执行权仍由原 owner 判断。 原契约所要求的真实诊断与可执行收口已交付;没有要求新的配置、用户确认或整个父路线完成。已检查 refresh-state 的 JSON/Markdown 和现有设置/Chat 调用入口;没有页面、首屏、布局或新的独立 capability editor 变更。 未做安装版或真实模型视觉/采用资格;本评审没有把未渲染的截图当成证据。 本次只资格 source 和隔离真实 CLI/provider 路径,实际模型采用、安装与完整长程净收益仍未知;原质量红项、讨论和当前 merge readiness/owner 权限继续单独判断。
English verdict: APPROVE 7941@95f7d8e889b1165bce5f167b03912eb94adf3959: independent File/SQLite and TypeScript evidence covers immediate qualification and original-identity lifecycle recovery; inherited quality failures and unverified adoption remain disclosed, with no merge authority granted.
Material closeouts could return a satisfied vision checkpoint while missing the path/evidence needed for outcome qualification; callers only saw that gap on a later quota read. Terminal recovery also suggested adding a successor link to an already completed Todo, which the terminal writer rejects.
This change returns the existing qualification diagnosis immediately in refresh-state JSON and Markdown, using the same checkpoint projection and acceptance rule as quota/history. It also corrects lifecycle recovery guidance: preserve terminal links, use the original completion identity for scoped no-follow-up, and preserve independent deferred work and its gates. A real dependency may be authored on a mutable successor only when it matches that work's readiness condition.
Validation on
95f7d8e889b1165bce5f167b03912eb94adf3959:machine_section_projection.render_canonical_todo_sections; reproduced identically at base107e9e32e8. The first premerge also failed because TypeScript dependencies were absent; after installing declared dependencies the full gate passed.The changes add feedback, not acceptance or execution authority. Legal wait writes, terminal immutability, completion receipts, scheduler gates and qualification rules remain intact. The checkpoint projection extraction shares existing read logic; it adds no new decision owner. No new frontend capability or provider lifecycle is introduced. End-to-end token savings and scientific outcome improvement remain unmeasured; running experiments are not changed by this proposal.
Independent exact-head review and merge readiness remain pending.