fix(goal): bind no-follow-up ACKs to lifecycle truth - #3270
Conversation
Signed-off-by: huangrt01 <huangrt01@163.com>
Signed-off-by: huangrt01 <huangrt01@163.com>
Signed-off-by: huangrt01 <huangrt01@163.com>
Summary
Why this is separate from #3261#3261 makes Todo completion continuation explicit and provides the narrow same-Turn recovery seam. This PR closes the cross-contract gap where progress/vision ACK state could still claim terminality without that durable Todo settlement. Validation
Closes #3264. |
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
精确评审头(Exact Head): 3270@152acda4ba4d7bcd49d10ce6de761b583bd34654
Base: main | 类型: no-follow-up ACK 绑定 Todo 生命周期真相(13 files, +~300)
作者: huangruiteng(owner)
详细中文评审
动机
关闭 #3264:此前 refresh-state 可接受 coverage-backed result_class=no_followup,但同一 writeback 保留 open vision / continuing path,语义 ACK 能清掉 completed-without-successor 义务却没有结构化 Todo no_followup=true,导致投影裂缝与合成 user gate。本 PR 把“语义 ACK”与“Todo 生命周期结算”彻底分开。
改动思路
三处收口:(1) semantic_delta_from_writeback 只在 agent_vision.state=no_followup 且 path_delta.outcome=stop 时接受 coverage_backed_no_followup;(2) qualify_replan_writeback 在存在 Todo succession gap 时拒绝 coverage-backed no-followup,并给出 loopx todo complete --no-follow-up 修复指引;(3) ack_policy 在 succession gap 打开时只接受 new_runnable_successor outcome。写/读共用同一 typed todo_succession_gap_items(reason-code 归一)。
具体改动
progress_observation.py:no-followup 一致性校验(reason_codeno_followup_vision_path_inconsistent)。semantic_replan_writeback.py:Todo gap 打开时拒绝并给修复命令(reason_codetodo_no_followup_settlement_required),enforce_open_replan_writeback对带 reason_code 的拒绝直接抛带指引的 ValueError。ack_policy.py/goal_frontier/__init__.py:gap 打开时 outcome 集合收窄到new_runnable_successor;提示文案明确 “do not invent a user gate”。succession_warning.py/todo_summary.py:consolidatetodo_succession_gap_items与 reason code,recommended_action 指向todo complete --no-follow-up。- 文档:project-agent-todo-contract 与 goal-vision-replan-contract 明确“coverage evidence ≠ lifecycle settlement”。
- 测试:vision/path 一致性参数化、语义 ACK 不能替代生命周期结算(含持久化 ACK 回归)、ack policy successor-only、structured terminal settlement 不再触发 stale Next Action repair。
关键内容讲解
- 一致终态才接受:
no_followupACK 必须同时满足 visionstate=no_followup与 pathoutcome=stop,否则 outcome 被移除且accepted=False。 - Todo 优先:只要 completed-without-successor gap 仍打开,任何 coverage-backed no-followup 都不能 ACK replan 义务;必须先
todo complete --no-follow-up或加真实 successor。 - 禁止合成 gate:修复文案与 projection 都明确“不要为压制 succession warning 而伪造 user gate”——正是 #3264 的核心验收项。
对主干的风险
无阻断项。改动集中在 goal-frontier/replan writeback 判定面,行为收紧符合 #3264 验收;不改变 benchmark 评分/任务语义。CI:Sign-off、build ×2、dependency-review 均 SUCCESS,pytest IN_PROGRESS(无失败)。
验证矩阵(exact head 实测)
| 场景 | 结果 |
|---|---|
test_goal_terminal_no_followup / test_progress_observation / test_refresh_state_replan_gate / test_replan_novelty_policy |
59 passed |
test_goal_frontier_replan_rules / test_replan_semantic_action_behavior / test_replan_host_context_projection / test_visible_goal_terminal_settlement |
52 passed |
| 作者 canary premerge | 18/18 selected checks,无 manual holds |
| ruff / maintainability ratchet(作者) | PASS |
| CI:Sign-off / build ×2 / dependency-review | SUCCESS |
| pytest(CI) | IN_PROGRESS(评审时刻) |
我的整体评价
精准命中 #3264 的三个验收项(拒绝不一致 no-followup、语义 ACK 不能替代 Todo 结算、修复指引不造 user gate),读/写共用同一 typed gap 真相,111 个相关测试在 exact head 全绿。结论:APPROVE(author-owned PR,以 COMMENTED 记录批准结论;合并前确认 CI pytest 绿)。
English Verdict
Verdict: APPROVE (author-owned PR; recorded as COMMENTED because GitHub blocks formal self-approval). This change closes #3264 exactly: coverage-backed no-follow-up is accepted only when vision closes (state=no_followup) and the path stops, a semantic ACK can no longer retire a completed-without-successor gap without durable todo complete --no-follow-up settlement, and repair guidance explicitly forbids inventing a user gate. 111 focused goal-frontier/replan/terminal tests pass at the exact head; Sign-off, builds, and dependency-review are green, and CI pytest was still in progress at review time.
Summary
loopx todo complete --no-follow-upand explicitly reject synthetic user gates.Why this is separate from #3261
#3261 makes Todo completion continuation explicit and provides the narrow same-Turn recovery seam. This PR closes the cross-contract gap where progress/vision ACK state could still claim terminality without that durable Todo settlement.
Validation
loopx canary premerge --from-git-diff: 18/18 selected checks passed, no manual holds.Closes #3264.