Repository navigation
fix(quota): keep replan recovery within projection boundaries - #9046
Conversation
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
Quota 和 native Turn 在已受理的重规划尚未结算时,需要按原义务接续。主干合入 #8975 后,取回该状态的控制面模块反向依赖顶层 status facade。在共同祖先运行 Todo read-model 边界检查会指向该 import。现有 Progress Review 已资格化来源仍必须用于同一 Turn。候选把依赖移到 CLI 装配点,实际重新进入时维持原 obligation、GoalRef、评审来源和无效 ACK 过滤。评审覆盖反向依赖修复、真实入口保持和 #8714 组合。
改动思路 / Approach
重规划状态仍由 control_plane 投影拥有。CLI 明确注入既有 Progress Review 读取器。读取只在原已受理重规划资格满足时发生,新入口复用同一 scope、事件与历史规则。五个文件只调整投影和装配依赖,过滤、收据、ACK 和 GoalRef 判定沿原实现。对照实际共同祖先、精确候选及 #8714 组合。通过真实 Quota CLI 保留同一义务和当前评审触发,并核对 stall、scheduler follow-up、Turn 与 native launch 的 caller。
具体改动 / Changes
精确 head 469d3c3f4e56ab1880f24e086fb7fa0994361d40,diff base 5110b3afd8fbc33d2da33c28815e9320636244c3,5 个文件 +19/-5。逐项复核 lower-layer-read-owner、recovery-identity-and-authority、affected-composition。验收约定
关键代码讲解
- 控制面直接使用已经持有重规划规则的 projection,并受 original receipt、open phase 和义务 ID 条件约束。源码
- 主 quota 入口从 capability owner 装配读取器。File 和 SQLite 的原生重入保留原 obligation,来自退役 Goal 实例的 ACK 不改变它。源码
- scheduler follow-up 和 stall 后再次投影都沿相同读取器,后者在最新主干组合上另有六例通过。源码
- 普通 Turn 及两种原生启动重验都注入同一个读取器。不带绑定重规划收据的两处 caller 无法进入此分支。源码
对主干的风险 / Risks
实际共同祖先边界检查失败,候选、#8714 及最新主干组合通过。三份源码副本的七项真实重入均通过,扩大验证均为 50 过、4 败。四项同名失败在 File/SQLite 及前后 Vision 情形都读取缺失的顶层 writeback,因此保留为继承问题。#9037 也是同一修复,两个候选直接合成会冲突。
语义与 CI 对齐
重入仍按原 GoalRef、历史 ACK 顺序与原义务收据判定。默认关闭的 Progress Review 按既有策略不读回执。确切候选保留控制面 owner,#8714 与这条修复可组合。
我的整体评价 / Verdict
批准当前精确提交。反向导入的基线失败已消失,受影响入口与 #8714 组合均已验证。#9037 和本提案是重叠的两种实现,实际集成需使用其中一条。
English verdict: APPROVE. The exact head fixes the reverse import and preserves receipt-bound replan recovery across File/SQLite and the #8714 composition. Four wider failures also occur on the base.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
469d3c3 to
8467c8e
Compare
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · GPT-5 · OpenAI · self_reported
审批结论 / Approval conclusion
动机 / Motivation
Quota 在移除退役 Goal instance 的外部 ACK 时会回读 loopx.status,这让控制面依赖 public status facade,并使 Todo read-model boundary smoke 失败。候选改为由现有 capability owner 读取 progress-review context,并保留 control-plane 的重规划投影。
affected_caller_or_operator: Quota should-run, scheduler follow-up, Turn plan/launch, monitor-poll recovery and maintainers running control-plane boundary checks.before_after_scenario: The baseline failed the unchanged Todo read-model dependency smoke; the candidate passes it while replaying the original GoalRef, replan obligation and review evidence.observable_outcome: The unchanged boundary smoke passes, receipt recovery remains functional, and existing replan decisions still receive the same progress-review context.non_goals: Does not change replan selection policy, settlement identity, quota amount or the progress-review state itself.
改动思路 / Approach
reason: The capability loader is the nearest owner and all relevant callsites inject the same function. current_pr_boundary: Dependency replacement only; replan policy and persisted evidence are unchanged.
live_decision 新增一个 typed progress_review_context_reader,只用于 receipt-bound 重建。四个现有 CLI 装配点注入 capabilities.progress_review.context,公共 status 仍保留自己的 wrapper 供 status readers 使用。
具体改动 / Changes
关键代码讲解
_restore_replan_obligation_without_foreign_acks不再导入loopx.status,只用注入 reader 获取 review。build_live_quota_should_run_decision把 reader 限于 receipt-bound recovery 分支。- quota should-run、scheduler follow-up、monitor-poll 和 Turn decision 全部复用 capability owner。
对主干的风险 / Risks
最强反例是重构丢失原 replan 或错删同一 Goal 的 ACK。原 projector 仍负责 GoalRef 过滤和 obligation 重建;boundary smoke 与 receipt recovery 矩阵均通过,quick premerge 全过,仅保留已有 maintainability advisory。
我的整体评价 / Verdict
#9046 比它前面的 #9037 更完整:直接使用 capability owner,覆盖 monitor-poll,并保持 status wrapper 兼容。它移除反向依赖而不改变用户决策内容,是应合并的版本。
English verdict: APPROVE for 8467c8e. Quota recovery now uses the capability-owned progress-review reader and control-plane projector without changing replan or settlement semantics.
Result
已受理 Turn 恢复重规划义务时,Quota 现在调用控制面持有的重规划投影。Quota 与 Turn 的 CLI 装配点传入现有的 Progress Review 读取器,重放使用原有 GoalRef、评审回执和义务身份。
#8975 的恢复分支通过顶层
loopx.status兼容入口调用这两个实现。该依赖使主干的 Todo read-model 边界检查失败,也阻塞了 #8714 的组合验证。Validation
5110b3afd8fbc33d2da33c28815e9320636244c3复现todo-readmodel-boundary-smoke.py的反向依赖断言失败。修复后在此提交和合入 Prevent overlapping Todo validators and recover their original completion receipt #8714 源码的本地组合树上均通过。