Refresh quota facts after repairing a prior receipt #9684
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 423 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.362
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #9684"
general
weight: 0.35
loopx-agent
Goal and delivered outcome
A malformed prior-Turn receipt can be repaired successfully while the next
quota should-runstill reports a stale canonical source. The receipt repair updates the rollout log, which invalidates the status witness the guard read before the repair.After a committed repair, the guard reloads the canonical status and retries once with the original Turn binding. It uses the same refresh path as an ordinary stale canonical read.
Author declaration
mainat1af849a8a45aebe62fa447ae6f73accf21a4ed6c.| Criterion | Disposition | Implementation and verification |
| --- | --- | --- |
| Reevaluate a stale admission basis for the original Turn | Implemented |
execute_quota_should_runrefreshes the status witness after either a stale read or a successful repair and keeps the original decision arguments. || Preserve the original settlement identity through recovery and replay | Implemented | Tests run both prior-receipt shapes with File and SQLite, including replay and quota debit readback. |
Scope and continuation
The change is limited to quota admission recovery after a prior receipt repair. The test overlap with #9608 is in the same test module. Native host folding and context-delivery qualification continue separately.
Validation
dfb6344e776b9c1ce0079a2aca4ef023ee785e24.finished. Input classsynthetic.| Check kind | Result | Evidence |
| --- | --- | --- |
| Static | Passed | Ruff for both changed files and the local standard premerge check, including its six direct and 18 selected checks. The gate reported an inherited maintainability advisory in
loopx/status.pyandloopx/canary/module_metric_baseline.json. || Integration | Passed | 55 targeted tests for the quota guard and prior-receipt recovery on the tested revision. |
| Real entrypoint and backend | Passed | An isolated wheel ran
quota should-runfor orphaned and rotated prior receipts against both File and SQLite. All four entered prior-Turn recovery, preserved the original settlement and replay identity, and recorded zero quota debits during admission and replay. Independent review then verified that the recovered Turn settles once and the following guard can admit new work. || Regression parity | Passed | A wheel without the repair failed all four prior-receipt scenarios with a stale canonical source after repair. The fixed wheel completed all four. |
The backend matrix covers the two changed recovery paths in local providers. Running a native host or deploying the wheel was outside this validation.
Frontend and visual evidence
UI impact
none. The change is in the CLI admission path.Classification
Bug fix and regression coverage in the control plane. No shared-authority migration or promotion is proposed.
Boundary checklist