fix(control-plane): bind replan reads by obligation identity - #3144
Conversation
|
Self-review completed against the exact head Review lenses
No actionable review findings remain. The diff contains no new schema/executor, benchmark-specific rule, private state, raw rollout, credentials, or local paths. The visible Validation
The first premerge command exposed the console entrypoint resolving system Python 3.9 and failing on |
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
详细中文评审
精确评审头: 3144@30732774172f73664554c963c46e3501ffe6c47e
动机
修复 #3141:replan 的 required-read 强制此前依赖时间戳顺序,普通前置 replan ACK 可绕过证据日志读取校验。本 PR 把它绑定到当前 obligation identity:只有同一 frontier 上显式 watch_lane_continuation 类型的前置证据才被豁免,其余前置 ACK 必须携带当前 required_read_id 的读取回执。
改动思路
autonomous_replan_ack.py 新增 _ack_is_prior_watch_continuation_for_obligation:前置豁免要求 frontier_identity 完全一致且 delta_contract 含 watch_lane_continuation;validate_replan_required_read_receipt 在存在 projected required_read_id 时以身份匹配为准(弱化时间戳顺序依赖)。测试夹具改为选择当前 quota packet 的精确 evidence-log 命令并验证持久化 evidence_log_read 事件。
具体改动(关键代码讲解)
_ack_is_prior_watch_continuation_for_obligation:把“standing watch”豁免从时间戳语义收窄为 typed delta + exact frontier,杜绝普通 replan ACK 冒充。validate_replan_required_read_receipt:bool(required_read_id) or triggered_at <= recorded_at——有 projected id 时身份优先;无 id 时保留时间顺序校验。行为变更明确、机器强制,不是 guidance。- 测试:
test_replan_evidence_tool_behavior.py与test_replan_required_read_receipts.py重构为义务身份语义(+416/-150 覆盖);此前 clean main 上失败的 9 个 live-model/tool 测试在此 head 全部通过(本次实测 41 passed),即该 PR 同时修复了基线 CI。
对主干的风险
低且方向正确:豁免面收窄(只有精确 watch 续期可前置),强制面收紧(普通前置 ACK 不再绕过读取);watch_lane_continuation 是现有 typed delta kind,无新抽象。唯一注意点是身份匹配要求 frontier_identity 稳定,若有合法前置续期因 id 漂移被拒,会得到显式 required_read_not_executed 回执(fail closed,可诊断)。
我的整体评价
APPROVE(author-owned,以评论记录)。 scope fit 成立(真实 replan 强制路径);行为变更明确披露;修复了 baseline CI 的 replan evidence-tool 失败;41 项聚焦测试通过、py_compile 干净。无阻塞项。
English Verdict
APPROVE — exact head 30732774172f73664554c963c46e3501ffe6c47e (author-owned; formal self-approval blocked by GitHub, recorded as a comment).
Fixes #3141 by binding replan required-read enforcement to obligation identity: only a typed watch_lane_continuation on the exact same frontier may precede the obligation; ordinary pre-trigger ACKs must carry the current required_read_id. Machine-enforced, clearly disclosed behavior change. Verified: 41 focused replan/behavior tests pass at the exact head (including the previously failing live-model/tool tests), py_compile clean. No blockers.
3073277 to
a1b7725
Compare
|
Final guard after rebasing onto
The intervening main change only bumped the release version; it did not touch this control-plane seam. No actionable findings remain, so this exact head is qualified for the authorized admin self-merge. |
#3147) Mark the fresh-project onboarding fixture done (GH-C87, #3093/#3103), bump release docs slices to v0.4.5, and add security-boundary (GH-C90) plus obligation-bound replan/evidence-read (GH-C91) fixtures. Reflect merged security fixes #3137-#3140, PR-review lenses #3123/#3134, replan evidence-log hardening #3100-#3106/#3112/#3135/#3144, and the landed React homepage #3098.
Summary
watch_lane_continuationon the exact same frontierevidence_log_readeventFixes #3141.
Behavior change
A pre-trigger ordinary replan ACK no longer bypasses required-read validation. It is rejected with
required_read_not_executedunless an exact receipt carries the currentrequired_read_id. The only pre-trigger exemption is an explicit watch-lane continuation whose frontier identity matches the current obligation.This is a machine-enforced control-plane obligation, not guidance. Generic evidence-log reads without the projected
--required-read-iddo not satisfy it.Validation
py_compilepassedgit diff --check origin/main...HEADpassedcqr_cf09980a10102a9f6b37The first premerge invocation exposed a host entrypoint using system Python 3.9 (
tomllibunavailable). The same E2E check and then the complete 15-check premerge suite passed through the repository's supported venv Python module entrypoint.Boundaries