Conversation
Signed-off-by: song <22676124+songoow@users.noreply.github.com>
…replay-construction Signed-off-by: song <22676124+songoow@users.noreply.github.com>
…pair-pr4783-ci Signed-off-by: song <22676124+songoow@users.noreply.github.com>
Move the existing diagnostic projection helpers into a private quota module used by both active and settled packet construction. Keep settled replay construction and monitor precedence unchanged. Pass preparation fields directly into the run decision instead of aliasing and then overwriting them. The packet falls from 1592 to 1452 lines and the route from 92 to 86 AST statements without changing budgets, exceptions, or semantic producers. Validation: 251 focused tests, 4 real CLI settlement regressions, and 236 maintainability/semantic checks pass. All 40 base/head packets are equal and the five moved helper bodies retain identical ASTs. Add independent gate notification, command suppression, and goal-scoped reward diagnostics tests. Signed-off-by: song <22676124+songoow@users.noreply.github.com>
songoow
left a comment
There was a problem hiding this comment.
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
动机
PR-07 要消除 settled heartbeat 的“先构造正常动作、再覆盖 route、再清理 payload”三重维护点。问题来源明确:同一个 settled 事实原来需要同步维护二十余个字段,新增权限字段时容易漏关。exact head d29d43b308a9e1f91c077900bcc260bc5dff57e8 选择在 receipt、身份和绑定验证完成后直接构造 settled 输出,方向正确且范围合适。
改动思路
权威输入仍是 typed ReceiptBoundReplayPhase.SETTLED。quota owner 在 successor/replan 构造前选择 settled route,再由专用 payload constructor 生成无执行、无花费、无 successor 的结果。诊断投影与执行权限分开保留,独立 capability intent 可以通过自己的 typed projection 接管。既有 EffectiveAction、interaction、scheduler 和 receipt owner 被复用,没有新增 capability/provider/schema。
具体改动
settled_replay_fields成为 settled authority 字段的单一构造点,替代两套覆盖函数。_resolve_quota_should_run_route在构造 agent lane、successor 与 replan 前返回 settled route。_build_settled_quota_payload直接生成 settled payload,只保留 scoped readback、诊断和 Goal context。_attach_quota_supporting_projections同时服务 active/settled,settled 调用关闭 gate 通知和 agent command。- 私有 supporting-projection 模块使 packet 文件回到预算内;完整 packet parity、semantic drift 和 required CI 均通过。
对主干的风险
P1 blocker:settled 当前 Turn 仍会进入 prior-turn recovery 并被重新授权。 当当前 receipt 已解析为 SETTLED、同一 Goal/Agent 还存在更早未结算 host Turn 时,build_live_quota_should_run_decision 构造 heartbeat_settled_skip 后仍无条件调用 apply_unsettled_host_turn_recovery_if_required。后者会把 payload 改成 should_run=true、must_attempt_work=true、effective_action=unsettled_host_turn_recovery,违反“当前 settled 身份只能结束”的核心约束。
最小修复是在 receipt_bound_replay_phase is SETTLED 时跳过 prior-turn recovery;#4764 已包含同一 guard。修复后需覆盖“当前 settled + 旧 unsettled Turn”组合,并重跑 settled construction、identity、independent capability 和真实 CLI settlement。
我的整体评价
REQUEST_CHANGES。 直接构造、旧 cleanup 删除、supporting projection 拆分和独立 capability 保留都实现扎实,但 late recovery 仍可重开已 settled Turn,属于运行时 authority 顺序问题,不能由其他绿测覆盖。
English verdict: REQUEST_CHANGES — exact head d29d43b directly constructs settled output, but late prior-turn recovery can reopen a settled Turn; add the settled guard and rerun live/identity/recovery tests.
Signed-off-by: song <22676124+songoow@users.noreply.github.com>
Signed-off-by: song <22676124+songoow@users.noreply.github.com> # Conflicts: # loopx/control_plane/quota/live_decision.py # tests/control_plane/test_effect_turn_live_quota_decision.py
Signed-off-by: song <22676124+songoow@users.noreply.github.com>
Signed-off-by: song <22676124+songoow@users.noreply.github.com>
Signed-off-by: song <22676124+songoow@users.noreply.github.com>
Signed-off-by: song <22676124+songoow@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
动机
PR-07 要修掉 settled heartbeat 的“先构造可执行动作,再覆盖 route,再清理 payload”多重维护点。这个目标是必要的:settled receipt 已经决定当前 Turn 只能结束,successor、replan、repair 或 spend 都不应先被构造出来,再依赖字段清单把它们删干净。
当前 exact head 41e9de612a0ccb5b21162a924af7851e312350b2 已经修复我上轮指出的 late prior-turn recovery 问题:ReceiptBoundReplayPhase.SETTLED 时不会再调用旧 Turn recovery。分支自身方向正确,但它还不能与最新 main 组成一个可执行、可验证的整体,因此本轮不能批准。
改动思路
权威输入仍是 settlement readback 产生的 typed ReceiptBoundReplayPhase。_build_quota_should_run_payload 在 common projections 之前选择 active 或 settled constructor;settled 分支只生成 no-work/no-spend authority 与必要观察,随后复用 interaction、scheduler、cooldown 等公共投影。这样 TypeScript/receipt owner 仍决定 settlement 事实,Python quota owner 只做 host projection,没有出现第二套状态机。
旧的两套 settled overwrite 函数被 settled_replay_fields 单点构造替代;diagnostic/supporting projections 抽到私有模块供 active/settled 两条路径复用。这个边界比继续扩充 cleanup key 列表更可维护。
具体改动
关键代码讲解
should_run_packet._build_quota_should_run_payload在SETTLED时直接调用_build_settled_quota_payload,不会进入 active successor/replan construction。settlement_precedence.settled_replay_fields一次性固定should_run=false、全部 delivery/repair/actionability=false、must_attempt_work=false与 no-spend 语义,替代事后逐字段覆盖。live_decision.build_live_quota_should_run_decision新增SETTLEDguard,使较早的 unsettled host Turn 只能由后续 fresh Turn 恢复,不能覆盖当前 settled identity。_supporting_projections.py承接五组诊断投影;它们仍是观察数据,不取得 action authority。
我在分支 head 上运行了 settled construction、supporting projections、live decision、quota settlement 与 settlement driver 的聚焦组:99 passed in 14.78s;Ruff、semantic-vocabulary drift smoke 和 git diff --check 也通过。分支内的 ratchet 为 17/39/10,没有放宽预算。
对主干的风险
[P1] 当前 head 尚未完成与最新 main 的 authority 组合
git merge-tree 在以下位置产生真实冲突:
loopx/control_plane/quota/live_decision.pytests/control_plane/test_effect_turn_live_quota_decision.pyexamples/semantic-vocabulary-drift-smoke.pyloopx/semantics/vocabulary_v0.json
最新 main 在同一 live composition chain 加入 retained-action-selection reentry。若直接取 PR 一侧,可能丢失 retained Todo/replan continuity;若直接取 main 一侧,则可能丢掉本 PR 的 settled guard,让旧 Turn recovery 再次重开当前 settled Turn。semantic smoke/registry 冲突也必须基于合并后的真实 inventory 重算,不能任选一个 ratchet 值。
最小修复是:rebase 到最新 main,同时保留 retained-selection reentry 和 SETTLED prior-recovery guard;增加一个真实 runtime history 用例,写入较早 unsettled event 与当前 settled receipt,断言当前 Turn 仍为 heartbeat_settled_skip,只有 fresh Turn 才恢复旧事件;随后重跑上述 99-test 组、semantic drift 与 current-main merge-tree。
现有新回归用 monkeypatch 证明 guard 不会调用 recovery,能锁住代码顺序,但还没有覆盖冲突解决后的真实 receipt/event 组合。考虑到本 PR 改的是 quota authority,这个集成证据不能由 branch-local 绿测替代。
语义与 CI 对齐
本 PR 复用既有 ReceiptBoundReplayPhase、EffectiveAction.HEARTBEAT_SETTLED_SKIP 与 settlement identity,没有创建新 vocabulary。分支 semantic smoke 通过;当前阻塞是最新 main 上 producer inventory 和 live owner 的组合尚未完成,而不是需要提高预算或新增例外。
我的整体评价
REQUEST_CHANGES。 直接构造、旧 cleanup 删除、late-recovery guard 与 supporting projection 拆分都做得对,且分支内验证扎实;但 exact head 当前不可合并,冲突又正好位于 settled/reentry authority 路径。请先完成语义 rebase 和真实组合回归,再按新 head 复审。
English verdict: REQUEST_CHANGES — exact head 41e9de6 fixes late recovery and passes 99 focused tests, but it conflicts with current main in the live authority path; rebase while preserving retained-selection reentry and the SETTLED guard, then prove a real settled-plus-prior-unsettled history case.
Signed-off-by: song <22676124+songoow@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
动机
PR-07 的目标成立:settled heartbeat 已经由 receipt-bound phase 证明当前 Turn 完成,quota 不应先构造 successor/replan/repair 权限,再依赖二十余个 overwrite/cleanup 字段把它们删掉。当前 exact head f25b22de7d3a486f02714beda78941d2e0fa6255 已经完成上一轮要求的 current-main 语义合并,并补上“当前 settled、较早 Turn 未 settle”的真实 CLI 回归。
架构方向现在是对的,但 exact head 仍有一个确定性的 required local failure,因此本轮不能批准。
改动思路
权威输入仍是 typed ReceiptBoundReplayPhase.SETTLED。_resolve_quota_should_run_route 在 action selection 之前返回 closed route,_build_settled_quota_payload 只组合 no-work/no-spend authority 与 observation-only diagnostics;interaction/scheduler/protocol projection 在 closed payload 上统一生成。
较早的 unfinished host Turn 不再覆盖当前 settled receipt identity:live composition 在当前 phase 为 SETTLED 时跳过 recovery,而下一个 fresh Turn 才运行 TypeScript preflight、扫描历史并投影 exact prior-Turn recovery。pending capability intent 保持独立,不用 blanket early-return 误删另一条 receipt lane。
这保持了正确的 ownership:TypeScript receipt/effect boundary 决定 settlement/history,Python quota 只做 host projection;没有新增第二套 phase 或 prose heuristic。
具体改动
关键代码讲解
settlement_precedence.settled_replay_fields一次性构造should_run=false、全部 delivery/repair false、must_attempt_work=false与 no-spend 语义,删除旧的 route/payload overwrite 函数。should_run_packet._resolve_quota_should_run_route在ReceiptBoundReplayPhase.SETTLED时不会进入 agent-lane successor/replan construction。should_run_packet._build_settled_quota_payload保留 frontier、agent identity、Todo summaries、诊断 warning 与 scoped fallback readback,但这些字段不能恢复执行权限。live_decision.build_live_quota_should_run_decision的 SETTLED guard 让 older unsettled history 只在 fresh Turn 恢复;新增真实 CLI fixture 覆盖了 current-settled/prior-unsettled 的组合。_supporting_projections.py把 active/settled 共同诊断从大模块提取出来;这是同域、可逆且有 focused parity coverage 的合理重构。
对主干的风险
[P1] PR 自己修改后的标准 settlement CLI 回归稳定失败
在 tests/control_plane/test_quota_settlement_cli.py:1549-1554,binding 被改成只包含 --agent-id 与 --turn-instance-id;随后 complete_args 在第 1584 行继续复用这个 binding,却没有另外传 --todo-id。真实 CLI 因此返回:
todo complete requires --todo-id
精确复现命令:
.venv/bin/python -m pytest -q \
tests/control_plane/test_quota_settlement_cli.py::test_standard_codex_app_settlement_is_receipted_and_idempotent结果是 1 failed,且失败发生在 todo complete,后续 validation receipt、successor、idempotent replay、refresh/spend 断言都没有执行。当前 main 的 public CLI 仍明确要求 todo complete --todo-id;本 PR 没有引入、说明或验证任何 receipt-bound Todo inference,因此不能把这个红测解释为新契约。
最小修复:拆开 guard selection args 与 settlement mutation binding,确保 todo complete(以及后续需要 exact binding 的命令)继续携带 TODO_ID;然后完整重跑 tests/control_plane/test_quota_settlement_cli.py,不能只跑新增 case。
验证与整体评价
已通过:
- direct settled construction、supporting projections、live decision 与新增真实 history case:
46 passed in 31.18s; - native TypeScript
unsettled_host_turn_recovery.test.ts:20 passed; - focused Ruff、
git diff --check; git merge-tree --write-tree --messages origin/main HEAD成功,上一轮 current-main conflict 已消失。
未通过:完整 focused run 在中止前为 67 passed, 1 failed;失败单测单独复现仍稳定失败。按本轮 capability 的 wait_for_ci=false,未读取或等待 remote CI;本地 required failure 本身已经阻塞批准,也没有用 remote green 替代它。
未来向检查结论:direct constructor 和 shared diagnostic boundary 值得保留,不应为了修测试恢复 cleanup 设计。修复只需要恢复 exact Todo binding,并以完整 settlement CLI 套件证明现有 public journey 没被测试改写掩盖。
REQUEST_CHANGES。 上轮的语义 rebase、retained-selection/settled guard 组合与 real history 回归都已补齐;现在只剩一个很具体但必须关闭的 exact-head 交付缺口。
English verdict: REQUEST_CHANGES — exact head f25b22de7d3a486f02714beda78941d2e0fa6255 fixes the prior main-integration and recovery-order blockers, but its edited standard settlement test drops --todo-id, making the real todo complete flow fail deterministically; restore the exact settlement binding and rerun the full settlement CLI suite.
Signed-off-by: song <22676124+songoow@users.noreply.github.com>
songoow
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
本次复审绑定 exact head 969e94f8bbad4a33ee5307eb7516f097478a35ff。PR-07 要让 settled heartbeat 从已结算 receipt 直接构造允许的结果,删除“先构造 active route、再覆盖字段、再清扫 action”的多重维护链。旧设计每新增一个执行字段,都要在多个 settled override 中同步关闭,漏项会重新授予工作、交付或花费。
改动思路
权威输入仍是 typed ReceiptBoundReplayPhase。当前 receipt 为 SETTLED 时,quota 在 successor/replan 之前选择 settled route,专用 constructor 只生成 closed payload;supporting projections 继续提供诊断,但不能扩大权限。live 入口跳过当前 settled Turn 的 prior-turn recovery。
复审又验证了另一半顺序:新的 Turn 必须能恢复更早的未结算 Turn。typed preflight 现在按持久化的 newest-first 顺序跳过已经验证结算的候选,继续找到第一个缺 closeout 的旧 Turn。这样“当前 settled 不被重开”和“fresh Turn 不漏掉旧债务”同时成立。
具体改动
关键代码讲解
_resolve_quota_should_run_route在SETTLED时直接返回 settled route,不构造 successor/replan 再覆盖。_build_settled_quota_payload直接生成无 delivery、spend、successor 和 stale command 的结果。_attach_quota_supporting_projections成为 active/settled 共用的私有诊断边界;旧的两层 settled overwrite 和 wrapper 已删除。build_live_quota_should_run_decision在当前 phase 为SETTLED时不运行 prior-turn recovery。preflightPriorHostTurnCloseout不再因最新候选已结算就提前返回;它继续扫描到首个未结算候选。- 真实 CLI 历史回归证明同一 settled Turn 保持 closed,而 fresh Turn 恢复准确的旧 Turn/Todo binding。
对主干的风险
主要风险是 quota/receipt 顺序漂移。维护者上一轮指出的 late recovery P1 已闭合;新回归还覆盖“较新的 settled 候选遮住较老 unsettled 候选”的反例。标准 Codex App settlement 保留确切 Todo identity,并继续 idempotent。
本地验证包括 99 个 settled/live/supporting/settlement 场景、20 个原生 TypeScript recovery 测试、TypeScript typecheck、semantic drift、Ruff 和 git diff --check。最终 exact head 的 26 项 GitHub checks 全部成功,包括 PostgreSQL、Node minimum/forward、四个 Python shards、Windows、E2E、mutation、installed、kernel static 和 merge-gate。
语义与 CI 对齐
该 PR 复用 ReceiptBoundReplayPhase.SETTLED、既有 receipt identity 和 action/interaction vocabulary,没有新增状态名、capability 或第二套 authority。registry 只把 producer 指向实际 constructor;删除的旧 override symbol 不再获得维护信用。
我的整体评价
APPROVE conclusion。 direct settled construction 已删除重复维护职责,当前 Turn 与历史 Turn 的 recovery 顺序都有真实路径证据,最新主干冲突已解决,exact-head CI 全绿。合并仍由维护者决定;head 再变化需要重新评审。
English verdict: APPROVE — exact head 969e94f8bbad4a33ee5307eb7516f097478a35ff directly constructs settled replay, keeps the current settled Turn closed, lets a fresh Turn recover the first older unsettled candidate, and passes all 26 exact-head checks.
huangruiteng
left a comment
There was a problem hiding this comment.
动机
本次复审绑定 exact head 969e94f8bbad4a33ee5307eb7516f097478a35ff。PR-07 的目标成立:settled receipt 已经证明当前 Turn 完成,quota 不应先构造 successor/replan/repair 权限,再靠多层 overwrite/cleanup 清掉。旧设计把同一 no-work/no-spend 事实分散到 route、payload 和 action-projection 清单,任何新增 authority 字段漏清理,都可能让已结算 identity 再次做事或花费。
上一轮的确定性 todo complete --todo-id 回归已经由本 head 修复;标准 settlement/idempotent replay 流重新通过。current-main 组合、late prior-turn recovery 与“较新的 settled receipt 不能遮住更老的 unsettled debt”也已有真实路径覆盖。
但本轮从 installed heartbeat consumer 反查 payload 后发现一个新的 P1:settled scoped-gate fallback 仍投影了可执行的 safe_bypass_allowed=true。因此当前结论仍是 REQUEST_CHANGES。
改动思路
正确的 ownership 是:typed ReceiptBoundReplayPhase.SETTLED 决定当前 Turn 只能 closed;Python quota 只投影这个事实。_resolve_quota_should_run_route 在 successor/replan 之前返回 closed route,_build_settled_quota_payload 直接组合 no-work/no-spend authority 与 observation-only diagnostics。旧的两层 settled overwrite 被删除,这个方向比继续维护 cleanup key list 更可靠。
older unsettled history 的另一条路径也合理:当前 SETTLED 不运行 prior-turn recovery;新的 Turn 才由 TypeScript preflight 按 newest-first 扫描,跳过已结算候选,找到第一个缺 closeout 的旧 Turn。这同时满足“当前 settled 不重开”和“fresh Turn 不漏旧债”。
问题发生在这个直接构造之后:prepared.scoped_user_gate_fallback 虽然可以作为诊断被保留,但 scoped_user_gate_fallback_fields() 返回的不是纯诊断,它包含 safe_bypass_allowed=true、kind 和 policy;这些字段是 heartbeat prompt 与诊断/记账表面实际消费的权限信号。
具体改动
关键代码讲解
settlement_precedence.settled_replay_fields成为 settled authority 的单一构造点,固定should_run=false、delivery/repair/actionability=false、must_attempt_work=false和 no-spend。should_run_packet._resolve_quota_should_run_route在SETTLED时不会进入 agent-lane successor/replan construction。should_run_packet._build_settled_quota_payload只保留 frontier、identity、Todo summary 和诊断信息;interaction/scheduler/protocol 都从这个 closed payload 派生。live_decision的 SETTLED guard 防止 older Turn recovery 覆盖当前 receipt identity;fresh Turn 再恢复旧债务。unsettled_host_turn_recovery.ts::preflightPriorHostTurnCloseout会跳过较新的已结算候选,继续寻找首个真正未结算的旧 Turn。- 最后一个 commit 把
TODO_ID恢复到标准 settlement binding,上一轮本地 required failure 已关闭。
本地验证:
- settled/live/supporting/settlement/真实 CLI 组:
164 passed in 570.22s; - 原生 TypeScript prior-turn recovery:
20 passed; npm run typecheck:control-plane、focused Ruff、semantic-vocabulary drift、git diff --check:全部通过。
对主干的风险
[P1] settled payload 重新授予了 safe-bypass 权限
触发条件是当前 receipt phase 已为 SETTLED,同时 prepared.scoped_user_gate_fallback 非空。
具体顺序:
_build_settled_quota_payload先通过settled_replay_fields()把safe_bypass_allowed关闭;should_run_packet.py:1445-1446随后调用scoped_user_gate_fallback_fields(),把它覆盖成true;- 最终 packet 同时出现:
effective_action=heartbeat_settled_skipshould_run=falseexecution_obligation.must_attempt_work=falsesafe_bypass_allowed=true
- installed
heartbeat/task_body.py对should_run=false + safe_bypass_allowed=true的明确解释是:允许做一个 validated bounded safe-bypass step,write back,并 spend 一次。
因此,这不是“只保留 fallback readback”。safe_bypass_allowed 是实际的 action grant;它与 SETTLED no-work/no-spend obligation 冲突。当前新增的 test_settled_fallback_readback_cannot_reopen_execution 反而断言该字段为 true,只检查 interaction delivery/spend flag,没有检查自动加载的 heartbeat guidance,所以 164 个测试全绿仍不能证明当前 Turn 不会执行。
最小修复:
- SETTLED 下保持
safe_bypass_allowed=false,并移除/置空safe_bypass_kind、safe_bypass_policy; - 如果确实需要展示 fallback 上下文,把它放进一个明确 observation-only、不会被 task body/spend admission 解释为权限的字段;
- fallback 是否可执行由下一次 fresh Turn 重新计算,不能沿用已 settled identity;
- 修改 settled fallback 回归,断言 raw packet、TurnEnvelope/interaction 与生成的 heartbeat guidance 都没有 safe-bypass action 或 spend 指令。
建议重跑:上述 164-test 组、20 个 TS recovery tests、typecheck、semantic drift、Ruff 和 diff check。
语义与 CI 对齐
该 PR 没有新增 vocabulary,复用了 ReceiptBoundReplayPhase.SETTLED 与 heartbeat_settled_skip,这一点正确。当前 blocker 不是命名或 CI 预算问题,而是既有 safe_bypass_allowed 语义被错误地当成 observation:它在 task body 中是执行指令,在诊断表面也是 immediate agent-delivery signal。请复用既有 settled no-work/no-spend contract,不要为 settled readback发明一个“true 但不可执行”的第二解释。
我的整体评价
REQUEST_CHANGES。 direct constructor、旧 cleanup 删除、fresh-Turn recovery 顺序、current-main 组合和标准 Todo binding 都已经做扎实;宽验证也通过。剩余问题很集中,但位于 settlement authority 边界:当前代码与测试把 safe_bypass_allowed=true 当作无害诊断,而真实 heartbeat consumer 会据此工作和记账。把 fallback readback 与 execution grant 分离后,这个 PR 的架构方向可以保留,不需要退回旧 cleanup 设计。
English verdict: REQUEST_CHANGES — exact head 969e94f8bbad4a33ee5307eb7516f097478a35ff fixes the prior Todo-binding and recovery-order blockers and passes broad local validation, but a SETTLED packet with a scoped-gate fallback still overwrites safe_bypass_allowed to true. The installed heartbeat task body treats that field as permission to execute and spend, contradicting the settled no-work/no-spend contract. Keep the grant false until a fresh Turn and retain only non-authoritative fallback diagnostics.
A settled receipt proves the current Turn is finished, so the payload carried a no-work/no-spend obligation. But when a scoped user-gate fallback was prepared, the settled payload projected the fallback readback, which set safe_bypass_allowed=true with a policy that ends "spend only after validated writeback". The installed heartbeat task body reads should_run=false together with safe_bypass_allowed=true as permission to run one bounded safe-bypass step, write back and spend once, and the quota markdown surfaced both the settled no-spend policy and the fallback spend policy at the same time. The grant, not the readback, is the problem: it is an action authority, not a diagnostic. Construct the closed safe bypass in settled_replay_fields(), which is already the single construction point for settled authority, and stop re-granting it from the fallback readback. A fresh Turn still computes its own fallback, so the scoped-gate path keeps working; only the already-settled identity is denied. The monitor-only branch no longer needs to reset the same three fields. The regression asserted the old grant. It now pins the raw packet, the interaction contract, the heartbeat recommendation and the rendered guidance, so a settled Turn cannot carry a second, executable reading. Signed-off-by: song <22676124+songoow@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: song <22676124+songoow@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
动机
本次复审绑定 exact head 2076d0ff80c55c1de2bf22964177eeedb485edbf。PR-07 的目标成立:当 receipt 已经把当前 Turn 证明为 SETTLED,quota 应直接构造唯一允许的 closed/no-work/no-spend 结果,而不是先构造 successor、replan、repair 等 active authority,再依赖多层 overwrite/cleanup 把它们删掉。旧设计的维护成本会随每个新增 authority 字段增长;任何一处漏清理,都可能让已经结算的 identity 再做一次工作或花费。
前几轮发现的 blocker 已逐项闭合:late prior-Turn recovery 不再覆盖当前 settled identity,current-main retained-selection 组合完成,标准 todo complete --todo-id journey 恢复,且上一轮最细微但最危险的 safe_bypass_allowed=true 泄漏也在当前 head 关闭。
改动思路
权威输入仍是 receipt/effect boundary 产生的 typed ReceiptBoundReplayPhase.SETTLED。_resolve_quota_should_run_route 在 agent-lane successor/replan construction 之前选择 closed route;_build_settled_quota_payload 再把这组 authority 与 observation-only diagnostics 组合。这样 TypeScript/receipt owner 决定 settlement/history,Python quota 只投影 host result,没有第二套 phase 状态机。
older unsettled history 使用另一条明确的生命周期:当前 SETTLED Turn 不执行 prior-turn recovery;下一次 fresh Turn 才由 TypeScript preflight 跳过已结算候选并选择第一个真正未结算的旧 Turn。这同时保证“当前 settled 不重开”和“fresh Turn 不漏旧债”。
针对上一轮 blocker,当前 head 不再把 scoped-gate fallback 的 executable fields 加回 settled payload。fallback 的存在只是未来 fresh Turn 可重新评估的上下文,不能成为当前 identity 的 safe_bypass grant。
具体改动
关键代码讲解
settlement_precedence.settled_replay_fields成为 settled authority 的单一构造点,固定should_run=false、所有 delivery/repair=false、must_attempt_work=false、safe_bypass_allowed=false与 no-spend 语义。should_run_packet._resolve_quota_should_run_route在SETTLED时直接返回 closed route,不进入 successor/replan/action selection construction。should_run_packet._build_settled_quota_payload只组合 identity、compact summaries 与 supporting diagnostics;当前 head 删除了 latescoped_user_gate_fallback_fields()覆盖,因此 raw packet、interaction 和最终 heartbeat guidance 不再出现可执行 bypass。_supporting_projections.py承接 active/settled 共用的 diagnostics。这些 warning/readback 不取得 action authority;focused parity coverage 锁住抽取后的行为。live_decision.build_live_quota_should_run_decision在当前 phase 为SETTLED时不运行 prior-turn recovery;fresh Turn 才恢复旧债。unsettled_host_turn_recovery.ts::preflightPriorHostTurnCloseout会跳过较新的已结算候选,继续寻找首个未结算候选,且保持 exact Turn/Todo binding。
对主干的风险
主要风险在 quota composition path 较宽:direct constructor、diagnostic extraction、retained selection、scoped fallback、interaction rendering 与 prior-history recovery 必须继续遵守同一 authority 顺序。为避免只验证一个布尔值,我沿真实消费链检查了三层结果:raw payload、interaction_contract 和 rendered heartbeat guidance。
当前 exact head 的验证结果:
- settled construction、supporting projections、live decision:
45 passed; - 标准 Codex App settlement/idempotent journey 与 current-settled/prior-unsettled real CLI:
2 passed; - native TypeScript prior-turn recovery:
20 passed; typecheck:control-plane、focused Ruff、semantic-vocabulary drift、git diff --check:全部通过;- current-main
merge-tree成功,无冲突。
上一轮 969e94f 的 164-test evidence 没有被直接继承为 approval:我先检查了 last-review-to-head 的三文件 delta,再重跑最能使旧结论失效的 fallback consumer、真实 CLI 与 native recovery probes。当前回归会在旧 head 上失败,因为旧 head 的 raw bypass/guidance 仍是 executable。
语义与 CI 对齐
本 PR 复用既有 ReceiptBoundReplayPhase.SETTLED、EffectiveAction.HEARTBEAT_SETTLED_SKIP、receipt identity 与 safe-bypass vocabulary,没有新增第二套语义。semantic drift smoke 与 registry owner coverage 通过;本轮按 review contract 未获取、轮询或等待 remote CI,本地 required evidence 已完整通过。
未发现 blocking finding。剩余风险是没有在本地重跑整个 repository suite,但本次复审覆盖了最可能推翻结论的 exact delta、真实 CLI boundary、prompt consumer 与 current-main integration。
我的整体评价
APPROVE。 direct construction 现在真正做到 creation-time closure:当前 settled Turn 不再通过 successor、replan、prior recovery 或 scoped fallback 获得新 authority;fresh Turn 仍能准确恢复旧债。前几轮暴露的细微语义差异已被转成 consumer-level regression,而不是只补一条实现内断言。
未来向检查结论:_supporting_projections.py 的同域抽取值得保留,它降低了 packet hot module 的维护负担;无需再引入新的 abstraction 或 cleanup framework。后续新增 authority-bearing field 时,应继续把 SETTLED 默认值放进 settled_replay_fields,并为 raw/interaction/guidance 三层增加对应反例。
English verdict: APPROVE — exact head 2076d0ff80c55c1de2bf22964177eeedb485edbf now constructs SETTLED as a closed no-work/no-spend result, keeps scoped fallback authority false through the rendered heartbeat guidance, defers prior-Turn recovery to a fresh identity, and passes the focused real CLI, native TypeScript, semantic and static validation.
A settled heartbeat previously built an active route, overwrote its route fields, assembled action projections and swept the payload again. PR-07 from discussion #4738 requires the settled receipt fact to construct only the closed result it permits.
This branch now:
ReceiptBoundReplayPhase.SETTLEDbefore successor/replan construction;Current exact head:
969e94f8bbad4a33ee5307eb7516f097478a35ffonmain@09f10c4e3.Validation:
git diff --check: passed;No new capability, public schema, persisted state model or frontend setting is introduced. The receipt phase remains the authority; a current settled Turn stays closed, while recovery of an older unsettled Turn waits for a fresh identity. Runtime/control-plane change; maintainer review and merge are required.