Repository navigation
Keep historical ACK admission on the original heartbeat receipt - #8907
Conversation
A same-Turn review_guard_upgrade or work requalify appends a later quota_should_run for the same settlement identity. The effective receipt still has to be that later event. The historical ACK fence and writeback order were taking its recorded_at, so an ACK written after the original admission and before the upgrade was rejected. Use the first bound quota_should_run for that Turn and identity as the admission clock and log index. Signed-off-by: Duang777 <duangjl007@gmail.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google · self_reported
动机 / Motivation
需要在历史确认回执(historical ACK)恢复路径中判定 Turn 准入时钟与日志顺序、并对同 Turn 进行 review_guard_upgrade 或 work_requalify 升级的 LoopX 控制面维护者与运行时调用方。
修改前,当同一 Turn 在 T0 绑定初始 settlement identity、后续于 T2 追加 review_guard_upgrade 或 work_admission 修正回执时,selectEffectiveHeartbeatReceipt 仅保留最后一条升级事件,导致 settlement_readback.heartbeat_receipt.recorded_at 漂移为 T2,进而把 T0 与 T2 之间的合法历史 ACK 误判为迟于新时钟而拒绝或冲突;修改后,PR 在 Python 侧新增 first_bound_heartbeat_receipt 与 heartbeat_admission_recorded_at 并更新 live_decision、state_refresh 与 _admission_event_index 使用首个绑定回执的时间戳和日志索引,虽使同目录无 goal_ref 场景的 225 项 Python 测试与 41 项 TS 语义测试通过,但新增辅助函数完全漏掉 goal_ref 实例隔离并在已读取过 TS settlement_readback 后重复从磁盘读取整份 rollout 日志、平行复制 Python 身份归约逻辑。
在精确头 d1898ca 上,PR 自带的 ruff 检查、225 项控制面 pytest(含 File/SQLite 集成用例)、12 项 heartbeat_receipt pytest、41 项 replan_semantics.test.ts、156 项 quota_settlement_readback.test.ts 与 control-plane tsc --noEmit 均在本地通过;然而独立 Python 复现证实,当 rollout_events.jsonl 中存在已退役 goal_instance_id(旧 GoalRef)与当前实例复用同一 (goal_id, agent_id, turn_instance_id) 时,find_heartbeat_receipt(..., goal_ref=new_ref) 正确隔离,而新增 heartbeat_admission_recorded_at 因忽略 goal_ref 触发绑定冲突返回 None 并静默回退到 T2 升级时间戳,同时 live_decision 与 state_refresh 都在已获得 TS settlement_readback 后重复执行整份 JSONL 扫描。
本 PR 范围限定于修复同 Turn 回执升级后的历史 ACK 准入时间戳与写回日志顺序判定,不改变 blocked_wait.ts 中 runnableTimerAtAdmission 的既有行为、不修改 replan_semantics.ts 的时间比较符,也不处理基于旧基线 c526242 的远端 CI 失败与 BEHIND 合入同步。
改动思路 / Approach
入口位于 live_decision.py:786-801、state_refresh.py:1141-1171 与 autonomous_replan_ack.py:275-311,上游权威状态源是 rollout_events.jsonl 中的 quota_should_run 回执流以及 TypeScript 单一决策归约器 selectEffectiveHeartbeatReceipt(loopx/control_plane/quota/heartbeat_receipt_identity.ts:178-197)与 effectiveHeartbeatReceipt(loopx/control_plane/quota/settlement_readback.ts:730-745)。正向路径上,当 Turn 先在 T0 写入首条带绑定 quota_should_run、随后因 review_guard_upgrade 或 work_admission 于 T2 追加同绑定新事件时,selectEffectiveHeartbeatReceipt 内 Map.set(binding.identity_key, entry.value) 覆盖前序条目使 heartbeat_receipt 保留最新内容;将准入锚点回退到首条绑定事件(T0 及其日志序号)的直觉方向是真实的。然而从单一所有权与最小边界权衡来看,本 PR 存在明显归属错位:两个调用方此前刚刚调用过 TS 单一所有者 read_heartbeat_settlement(...)(已在 TS 中读取、按 quotaOwnerOwnsProjection(owner, event.goal_ref) 过滤并遍历同一 Turn 全部 quota_should_run 事件),与其直接在 TS settlement_readback.ts / heartbeat_receipt_identity.ts 顺手投影 admission_recorded_at(及可选 admission_event_id),PR 却在 Python 侧重造了平行身份归约函数,既多做了一次全量日志 I/O,又漏掉了 goal_ref 过滤。
架构判断:PR #8907 adds a duplicate Python settlement-identity scanner (first_bound_heartbeat_receipt / heartbeat_admission_recorded_at) and re-reads rollout_events.jsonl on disk after live_decision.py and state_refresh.py have already invoked the TS single owner read_heartbeat_settlement, while dropping GoalRef isolation.
当前边界:Modifies heartbeat_receipt.py, live_decision.py, state_refresh.py, autonomous_replan_ack.py and two pytest files without updating TS settlement_readback.ts / heartbeat_receipt_identity.ts to project admission_recorded_at directly.
具体改动 / Changes
- 规范来源:无独立成文外部规范(
no_spec),以 PR 问题陈述及代码库既有的 TS 结算身份单一所有权(heartbeat_receipt_identity.ts:1-11)和GoalRef实例隔离不变量(settlement_readback.ts:1372-1374、heartbeat_receipt.py:25-57)为评审基准。- 同 Turn 升级后保持历史 ACK 准入时钟为首条绑定回执 -> 在无
goal_ref的同实例合成场景下已实现,但因遗漏goal_ref隔离且平行复制 Python 归约器导致阻塞缺陷 F1 与 F2 尚待修复。
- 同 Turn 升级后保持历史 ACK 准入时钟为首条绑定回执 -> 在无
关键代码讲解
first_bound_heartbeat_receipt与heartbeat_admission_recorded_at(loopx/control_plane/quota/heartbeat_receipt.py:181-245):顺序扫描quota_should_run事件,利用_receipt_settlement_identity跳过无绑定事件并在遇到首个绑定事件时锁定identity与(index, event);但若后续再次看到不同bound != identity则静默返回None(由heartbeat_admission_recorded_at退回fallback,即升级后的T2时间戳),与同文件_effective_heartbeat_receipt(L171-175)遇到多绑定直接抛出HeartbeatReceiptIdentityConflictError的 fail-closed 语义不一致,且函数签名与过滤条件完全缺失同文件_heartbeat_receipt_events(L25-57)严格执行的goal_ref校验。live_decision.py:789-801与state_refresh.py:1141-1171:两者均已先调用 TSread_heartbeat_settlement(..., goal_ref=goal_ref)拿回settlement_readback,却紧接着在未传入goal_ref的情况下调用heartbeat_admission_recorded_at(runtime_root, ...)再次从磁盘读取整份rollout_events.jsonl。_admission_event_index(loopx/control_plane/work_items/autonomous_replan_ack.py:275-311):改用first_bound_heartbeat_receipt返回首条绑定事件下标,修复此前按recorded_at取最后匹配位置的缺陷,但在回退路径和主路径中同样未按goal_ref过滤跨实例事件。
对主干的风险 / Risks
当前精确头 d1898ca81363345e283b6aa2dcf547a77575c164 存在两项阻塞主干合入的具体风险(与基础单测全过不矛盾):
- [F1 · P1 阻塞]
first_bound_heartbeat_receipt、heartbeat_admission_recorded_at与_admission_event_index遗漏goal_ref(goal_instance_id)实例隔离:- 触发路径与实证复现:当同一
goal_id发生重建/重注册并在同一rollout_events.jsonl中遗留旧实例ginst_aaaa...与现行实例ginst_bbbb...共享(goal_id, agent_id, turn_instance_id)的quota_should_run记录时,我们在精确头d1898ca81363345e283b6aa2dcf547a77575c164实跑复现脚本确认:find_heartbeat_receipt(..., goal_ref=new_ref)正确隔离到ginst_bbbb...(02:00:00Z升级事件),而heartbeat_admission_recorded_at因忽略goal_ref读到了已退役ginst_aaaa...的旧 Todo 绑定,触发bound != identity返回None并静默fallback到02:00:00Z升级时钟,直接使本 PR 要修复的 ACK 准入防御重新失效;若前序已退役事件未触发冲突过滤,则会错误采用已退役 Goal 实例的过期时间戳或日志下标。作者在 PR 正文“Remaining readers”也自述未覆盖该GoalRef场景。
- 触发路径与实证复现:当同一
- [F2 · P1 阻塞] 违背 TS 单一所有权并在热路径引入双份日志 I/O 与平行 Python 身份归约:
- TS
heartbeat_receipt_identity.ts:1-11与settlement_readback.ts:730-745,1372-1378已作为单一所有者完成quotaOwnerOwnsProjection(owner, event.goal_ref)过滤并逐条遍历同一 Turn 的quota_should_run事件;只需在selectEffectiveHeartbeatReceipt/settlement_readback.ts一并保存首个绑定条目的admission_recorded_at(及admission_event_id供写回顺序定位)并透传至QuotaSettlementReadback,即可彻底避免 Python 侧重造身份扫描逻辑、None静默回退分叉与双倍 JSONL 磁盘解析开销。
- TS
- 最小修复方案:将首条绑定准入时间戳与
event_id收敛至 TSheartbeat_receipt_identity.ts/settlement_readback.ts(复用意图已加载并经quotaOwnerOwnsProjection过滤的事件流)并删去heartbeat_admission_recorded_at的二次整文件读盘;若 Python 端保留基于已读取events列表的索引定位(_admission_event_index),则须强制传递并校对goal_ref(或直接匹配 TS 返回的admission_event_id)且补充跨goal_instance_id复用turn_instance_id的负向测试。另有非阻塞观察:PR 当前MERGE_STATE=BEHIND(基于旧基线c526242254),远端存在 7 项 CI 失败与 6 项 pending,未单独重跑全量基线归因但与本 PR 内部结构缺陷相互独立。
| 验证项 | 状态 | 实跑结果(exact head d1898ca81363345e283b6aa2dcf547a77575c164) |
|---|---|---|
ruff check(6 个改动文件) |
PASS | All checks passed! |
pytest test_autonomous_replan_ack.py test_quota_settlement_cli.py |
PASS | 225 passed in 449.79s(无 goal_ref 冲突场景下通过) |
pytest test_heartbeat_receipt.py |
PASS | 12 passed in 10.50s |
tsc --project tsconfig.control-plane.json --noEmit & TS 单测 |
PASS | tsc 通过;replan_semantics.test.ts 41 passed;quota_settlement_readback.test.ts 156 passed |
精确头 GoalRef 跨实例反例复现脚本(Python) |
FAIL(暴露 F1) | find_heartbeat_receipt(goal_ref=new_ref) 隔离至新实例,而 heartbeat_admission_recorded_at 扫到 ginst_aaaa... 冲突退回 02:00:00Z |
远端 GitHub CI(旧基线 c526242254) |
FAIL(未合入重跑) | 28 pass / 7 fail(build, kernel-contracts, typescript-core (2/3), browser (3/3) 等)/ 6 pending test-shard(1..6) |
我的整体评价 / Verdict
Inspected all 6 changed files in PR #8907 (4 Python control-plane files and 2 pytest suites); internal quota/replan recovery backend logic only, with zero rendered UI surface. unverified_scope: none.
问题本身真实且关键(runnableTimerAtAdmission 仅覆盖未带 semantic_replan_obligation_id 的 todo 定时器且不会受 autonomous_replan 的 review_guard_upgrade 影响,非当前阻塞),但精确头 d1898ca81363345e283b6aa2dcf547a77575c164 采取了“在 Python 侧复制身份归约并在 read_heartbeat_settlement 后二次读取全量 rollout 日志”的实现路线,不仅带来可避免的性能与维护成本(unjustified_duplication / simplify_now),更在实际带 goal_ref 的多实例 Goal 生命周期下暴露 first_bound_heartbeat_receipt 越界读取已退役 goal_instance_id 并静默退回升级时间戳的正确性缺陷(overbroad / unintended_drift)。未新增独立词汇表(local_only / 未改 RFC 或词汇注册表)。因此本轮判定 REQUEST_CHANGES:请由 TS heartbeat_receipt_identity.ts / settlement_readback.ts 单一所有者直接在已过滤 goal_ref 的读回链路上输出 admission_recorded_at(与供顺序比对的 admission_event_id),移除 Python 重复扫描与二次全日志读取,并补充跨 goal_instance_id 反例回归测试后提交重审。
English verdict: REQUEST_CHANGES
The first bound receipt is selected in the TypeScript settlement readback after GoalRef filtering. Python uses that recorded_at and event id instead of scanning the rollout log again. Signed-off-by: Duang777 <duangjl007@gmail.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; declaration_source=runtime_reported
REQUEST_CHANGES:原历史ACK恢复及上一轮两项P1已修复;仍有一项本PR引入、经base/head确认的维护性门回归。
动机 / Motivation
需要恢复已准入回合的合法历史确认的 LoopX 控制面调用方。 同一Turn先在T0准入、之后在T2升级内容回执时,旧实现把准入时钟移到T2,使两者之间的合法ACK被误拒;本头将准入锚点留在首条绑定回执,同时继续读取最新内容。 同一公开CLI探针在File和SQLite的基线均出现identity conflict,当前头均完成原身份写回、一次扣额及重复扣额请求的幂等读回。 本次修复历史ACK的时钟和日志位置,不更换Goal/Turn/settlement身份,不授权新工作,不改timer策略或C1安装默认。 剩余差距:本PR使既有维护性ratchet从base通过变为head失败:主决策函数60→63 decision points,现行上限60。
改动思路 / Approach
TS身份与GoalRef owner的修复合理;准入时钟适配已经有_receipt_bound_guard_fields,外置重复投影让主决策函数越过现行复杂度门。本PR保留历史ACK恢复修复,并在现有adapter内完成有界整理;不要求重写整个quota主函数或完成父级C1。
原生readback先按GoalRef过滤,再同时派生“最新内容”和“最初准入”。两者应分开:内容升级可以保持新状态,合法ACK的时钟却不能被倒改。上一轮Python重复整文件扫描已删除,没有再造第二个身份owner;新增两个可空字段只是派生投影,没有新手工状态、命令或权限。末端应让已有guard adapter直接表达准入来源,减少同一字段先赋最新时间再在大函数覆盖的维护成本。
具体改动 / Changes
本头 5f77b5002fa3db6cea71f383709ee25c0c9cc39e,实际PR基线 c52624225411d1e91ec0b06f4cd9d84596eed39b;完整差异10文件 +340/-9,其中7生产 +117/-8,3测试 +223/-1。相对旧d189方案重新检查了全部消费者和边界,没有继承旧REQUEST_CHANGES的缺陷判断。本次时钟修复无独立成文规格,按已复现回归及原有identity/GoalRef契约验收(no_spec);另按固定版本的原生维护性policy验收质量门,没有新造RFC/枚举或要求无关迁移。
关键代码讲解
- selectAdmissionHeartbeatReceipt 在同一绑定中保留首条事件;多绑定冲突仍fail closed。
selectEffectiveHeartbeatReceipt继续保留最新内容,不以旧clock替换当前内容。 - readQuotaSettlementFromRequest 先执行
quotaOwnerOwnsProjection,因此退役实例复用同Turn id也不会成为admission。admission_recorded_at和admission_event_id从同一现有快照派生,Python不再第二次读整份日志。 - _admission_event_index 有event-id时按原事件定位日志位置,避免升级事件或退役实例改变先后;无id的历史输入仍保留原回退。
- live decision新增适配 在已有
_receipt_bound_guard_fields之后又覆盖clock,并为id加条件分支。功能正确性已测,但这些分支把主函数decision points从60推到63;同一policy上限60,statement count为84→86,低于90。问题不是行数或117行是否“够小”,而是既有责任边界与实际必需门。
对主干的风险 / Risks
[P2] 在既有guard adapter内收敛准入适配。 本PR使既有维护性ratchet从base通过变为head失败:主决策函数60→63 decision points,现行上限60。 使用完全相同的uv run --extra test python examples/control_plane/control-plane-maintainability-ratchet-smoke.py --format json,基线exit0、unreviewed0,当前exit1、unreviewed1;唯一新增对象是build_live_quota_should_run_decision。把admission时钟与可空event-id的适配收敛到已有receipt-bound guard adapter,移除大主函数中的重复字段投影分支,并保留原身份/权限/回放语义;或按现有预算流程提交有证据的取舍,而非仅提高阈值或新增例外。 这是一处相邻、可逆的整理,不要求大型重构;修后保持已有真实恢复和拒绝测试。
功能对照PASS:同一修正后的公开CLI探针在File/SQLite的base均返回完整的“heartbeat receipt settlement identity conflicts with the current autonomous replan obligation”,当前均得到historical_ack_recorded,读取的内容事件仍是upgrade,原identity不变,随后原refresh-state写回、扣额0→1,重放扣额命令仍为1。TS的同Turn退役实例不同/相同binding两臂也通过。初次review探针在base漏导入导致的NameError已排除,未用作产品回归证据;最终比较使用相同探针和依赖。
PASS:29项Python、198项TS、control-plane typecheck、改动Python的ruff和直接diff/compile/RFC检查。标准premerge外层在240秒窗口终止;它已输出的完整原生报表列18项选中检查已执行、2失败,不能记为通过。其一就是已确认的ratchet回归。另一项quota-plan-smoke.py:33的ModuleNotFoundError: quota_plan_fixtures在本轮PYTHONSAFEPATH=1环境中,两头相同命令、相同模块/行/异常;相关脚本和fixture未被PR改动,按pre_existing_unrelated保留,不要求本PR修旧导入入口。没有查询或等待远端CI,也没有为凑绿延长窗口或修改断言。
语义与 CI 对齐
当前复用既有身份/GoalRef词汇,扩展readback的两个派生字段,不新增状态枚举或迁移日志。受影响的现行质量契约是control_plane_maintainability_report_v0的oversized_decision_function,max_decision_points=60;触发、观测与返审命令如上。应恢复该门,或按仓库预算流程给出可审取舍;不是因CI未完成而阻塞。
我的整体评价 / Verdict
恢复功能是有价值且相称的增量:long_horizon和CLI user_experience在该有界恢复范围内improved,原权限/身份和一次effect保持;没有把恢复回执当作长期净收益或实际solver成果。兼容性保留有现实依据:旧日志必须可读,而派生字段无需新写入版本;旧Pythonscanner不必保留。整个方案无default-off声明,不需要虚构开关矩阵,也没有新增工作授权。
只改内部quota/settlement读取和CLI恢复,未修改任何渲染组件;不需要页面截图。 仍未验证自然时间长期模型收益、所有宿主安装及父级C1资格,本PR不作这些声明。主要剩余门是已实测的63/60复杂度回归;在原adapter内整理、保持现有功能回归并重跑ratchet后即可有界返审,无需新建跟踪任务。
English verdict: REQUEST_CHANGES — original ACK recovery and GoalRef isolation are verified; this head introduces a reproducible maintainability-ratchet regression.
The live decision function was projecting the admission time and event id after the existing guard adapter, which pushed it over the decision-point budget. The adapter now owns that projection. Signed-off-by: Duang777 <duangjl007@gmail.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; declaration_source=runtime_reported
APPROVE:当前头完成有界历史ACK恢复,先前两项P1及本轮P2均已验证解决;标准premerge仍有一项基线等价的旧导入失败,保留独立合并门。
动机 / Motivation
需要恢复已准入回合的合法历史确认的 LoopX 控制面调用方。 同一Turn先在T0准入、之后在T2升级内容回执时,旧实现把准入时钟移到T2,使两者之间的合法ACK被误拒;本头将准入锚点留在首条绑定回执,同时继续读取最新内容。 同一公开CLI探针在File和SQLite的基线均出现identity conflict,20e16头均完成原身份写回、一次扣额及重复扣额请求的幂等读回。 本次修复历史ACK的时钟和日志位置,不更换Goal/Turn/settlement身份,不授权新工作,不改timer策略或C1安装默认。 剩余范围:未把有界历史ACK恢复等同父级C1全部宿主安装、实际长期效果和完整成本资格;这些不属于本PR的验收声明。
改动思路 / Approach
TS身份与GoalRef owner派生原准入事实;20e16将clock/event-id投影收敛到已有guard adapter,主函数回到60点且真实恢复语义保持,当前机制与成本相称。 本PR交付现有公开CLI的合法原回合恢复及一次结算;不要求重写quota主函数或完成父级C1。
TS readback复用原GoalRef过滤和身份归约,在同一事件快照上分开最新内容与首条绑定准入。Python不再扫描第二份日志,只消费原生投影。20e16把clock选择和可空event-id一起放回原guard adapter,调用方取出内部临时项后再构造TS guard请求;没有把本地辅助字段扩成公共schema。这个整理同时消除了重复赋值和大函数新增决策分支,未提高预算或添加例外。
具体改动 / Changes
当前精确头 20e16d72ff7860d7f5edc359c642dee975dd01a7,实际PR基线 c52624225411d1e91ec0b06f4cd9d84596eed39b。完整差异11文件 +352/-10,其中7生产 +117/-9、4测试 +235/-1。相对5f只改guard adapter和对应12行回归,但本次判断重新核对完整PR的原问题、两个生产消费者、兼容和权限边界,没有继承旧结论。最新已查main未含等价准入修复。没有独立规定该时钟来源的成文规格(no_spec),按已复现回归与既有identity/GoalRef契约验收。
关键代码讲解
- selectAdmissionHeartbeatReceipt 保留首条bound事件;原effective reducer仍保留最新内容,冲突身份继续fail closed。
- readQuotaSettlementFromRequest 先按GoalRef过滤再归约,退役实例即使复用同一Turn及binding也不能改变当前clock;两个新增可空字段是现有事实的只读派生。
- _receipt_bound_guard_fields 现在统一选择原admission clock或legacy fallback,并提供内部event-id。大主函数移除外置clock覆盖和条件分支,decision points从旧5f的63恢复为60,statements为85。
- _admission_event_index 按原事件id定位准入序号;无id的旧输入保留既有回退。quota与refresh两个消费者共同沿原identity完成历史确认,不产生新授权。
对主干的风险 / Risks
PASS:20e16当前67项Python;同一v2公开CLI探针在File与SQLite均完成历史ACK、原refresh-state写回、扣额0→1及重复扣额仍1。对照固定base使用同fixture均因原identity conflict失败;初次探针漏import产生的NameError已排除,不用于产品归因。新的adapter断言覆盖旧无准入字段与显式准入clock/id两种输入。
PASS:当前维护性ratchet unreviewed/stale/magnitude均0;quota-work-lane、autonomous-replan smokes、当前改动Python ruff和native直接检查。198项TS及control-plane typecheck在5f通过;本次明确复用的前提是所有TS、bridge、ACK-index、state_refresh及依赖/policy blob未变,当前Python和实际CLI再次覆盖改变的adapter,不把旧批准当成新头证据。全11改动文件的独立public-boundary扫描通过。
标准premerge在当前头完整执行结束,exit1、160.780秒:6项direct通过,18项自动检查执行、17通过。唯一失败为quota-plan-smoke.py:33的ModuleNotFoundError: quota_plan_fixtures。该脚本、fixture、导入路径未变,已测base和5f在相同命令、相同继承PYTHONSAFEPATH=1环境下同模块/行/异常,当前20e16亦完全相同;属于严格归因的pre-existing failure。未改断言、缩小扫描、提高限额或伪称premerge全绿。旧5f的外层240秒终止和ratchet失败保留为历史观测,不冒充当前结果。未查询或等待远端CI。
语义与 CI 对齐
原身份、GoalRef及时间顺序仍为机器约束,新增readback字段不扩大scope,也不创造手工状态或新持久化版本。当前共享质量契约oversized_decision_function的60点上限保持,当前实测通过。历史格式兼容有真实回放义务,当前两个消费者共部署但仍不能丢弃旧日志;沿单一TS owner派生比维持第二Python scanner更简洁。无opt-in/default-off声明,不虚构关闭矩阵或默认激活变化。
我的整体评价 / Verdict
这是对真实恢复误拒的相称修复:long_horizon和CLI user_experience只在有界原回合恢复范围内improved,未把回执存在等同长期净收益或模型任务成果。前两项P1的重复scanner与GoalRef问题已解决,本轮P2亦由原adapter整理和当前60点ratchet、真实回放共同验证,未发现当前阻塞项。当前无需继续拆分owner或扩大本PR。
只改内部quota/settlement读取和CLI恢复,未修改任何渲染组件;不需要页面截图。 原d189两项P1和本会话5f的P2均在当前头有独立验证。标准premerge保留唯一base等价quota-plan导入失败;并非全绿。合并授权与readiness独立,未查询CI、未执行merge/install或宣称长期资格。
English verdict: APPROVE — head 20e16d7 fixes original ACK recovery and resolves the prior findings; current real File/SQLite replay and ratchet pass. The unchanged quota-smoke import failure remains a separate merge hold.
Goal And Delivered Outcome
guard_recorded_at. A later same-Turn receipt upgrade or work requalify writes anotherquota_should_runwith a newrecorded_at. The effective receipt stays that later event. The admission clock now stays on the first bound receipt for the same Turn and settlement identity, selected from the GoalRef-filtered settlement readback.quota should-runreturnedheartbeat_receipt_identity_conflictinstead ofhistorical_ack_recorded. After, the decision ishistorical_ack_recorded, the generated refresh-state writeback and spend-slot succeed, and the upgrade event remains the effective receipt. A retired Goal instance that reuses the Turn id does not supply the admission clock.main. This does not close fix(replan): accept a same-second whole-second historical ACK #8804 or any other issue.Author Declaration
Implemented against
quota_should_runselectAdmissionHeartbeatReceipt;_receipt_bound_guard_fieldsadmissionHeartbeatReceiptreceipt upgrade admission stays on the admitted Goal instanceselectEffectiveHeartbeatReceiptunchangedevent_idandrecorded_at_receipt_bound_guard_fieldsexamples/control_plane/control-plane-maintainability-ratchet-smoke.py --format jsonbuild_live_quota_should_run_decisionand re-ran the ratchet.historicalAckDeltaoperators were not changed.Scope And Continuation
Validation
20e16d72ff7860d7f5edc359c642dee975dd01a7integrationpasseduv run --extra test python -m pytest tests/control_plane/test_quota_settlement_cli.py::test_same_turn_receipt_upgrade_keeps_historical_ack_admission tests/control_plane/test_autonomous_replan_ack.py::test_same_turn_receipt_upgrade_keeps_writeback_after_original_admission tests/control_plane/test_effect_turn_live_quota_decision.py::test_receipt_guard_fields_use_the_typed_identity_and_guard -q --tb=line. 6 passed, File and SQLite included.staticpasseduv run --extra test python examples/control_plane/control-plane-maintainability-ratchet-smoke.py --format json.oktrue,unreviewed_count0. The live decision function is no longer an oversized finding.unitpassed5f77b5002:quota_settlement_readback.test.ts157 passed, including the retired Goal instance. That readback selection was not changed on this head.staticpassedruff checkon the two files changed in this head.git diff --check.runnableTimerAtAdmissionstill uses the effective receipt time. The publicheartbeat_receipt.recorded_atstill reports the latest content event.See validation disclosure guidance.
Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses, or no paired RFC changed.none.Signed-off-bytrailer (git commit -s).Remaining readers
runnableTimerAtAdmissioninloopx/control_plane/quota/blocked_wait.tsstill treats the effective receiptrecorded_atas the timer admission time. The public should-runheartbeat_receipt.recorded_atstill reports the latest content event.