Repository navigation
fix(ci): ratchet env budget to actual and enforce pre-merge - #125189
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 5:29 AM ET / 09:29 UTC. ClawSweeper reviewWhat this changesThis PR adds the existing environment-variable budget check to the pre-merge baseline-ratchet entrypoint and documents and tests that CI coverage. Merge readinessNo blocking correctness finding: the change forwards the same base/staged snapshot into the existing environment-budget guard, and its exact-head baseline-ratchet CI check passed. This maintainer-labeled PR remains open for normal exact-head CI completion and maintainer merge handling. Priority: P3 Review scores
Verification
How this fits togetherThe fast CI baseline lane checks repository budgets against one frozen pull-request base before merge. Its ratchet script now passes that same base or staged snapshot to the environment-variable budget guard, producing a CI pass or failure before the assertion-safety check runs. flowchart LR
A[Pull request merge tree] --> B[Frozen base reference]
B --> C[Baseline ratchet entrypoint]
C --> D[Max-lines budget]
C --> E[Environment-variable budget]
D --> F[Pre-merge CI result]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceTests +5, Docs 0, Other +22. Total +27 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one frozen base reference for all three ratchets and land after the combined guard passes on the final mergeable head. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main's baseline-ratchet task omits the environment-budget command, while the PR head's successful baseline-ratchet CI run exercises the added path. Is this the best way to solve the issue? Yes: reusing the existing CI-invoked ratchet entrypoint preserves the frozen base and delegates policy to the established environment-budget guard instead of duplicating its logic in the workflow. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1df264d3f510. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper's P1 is technical merge drift only. Exact-head CI completed green on |
|
Merged via squash.
|
What Problem This Solves
Resolves a CI gap where pull requests could change the counted production environment-variable surface without running the environment-budget ratchet in the pre-merge baseline lane. The mismatch would otherwise first surface on
main.Why This Change Was Made
The existing environment gate requires the committed budget to equal the actual distinct
OPENCLAW_*count, rejects stale headroom, and permits only named owner-approved growth relative to the branch fork. Cleanup may therefore ratchet the budget down, but ordinary changes cannot silently raise it.PR #124812 (
a917c99e92c) moved the internalOPENCLAW_PROCESS_NODE_VERSION_CHECKhelper out of the scanned production roots, dropping the counted set from 502 to 501. PR #125185 (87a0493ae27) restored the budget to that actual count. This follow-up closes the remaining timing gap.PR #124720 established
checks-fast-baseline-ratchetsas the owner of one frozen fork-point ref. Instead of changing the workflow again, its existing max-lines script entry now chains the environment-budget gate with the same forwarded--baseor--stagedsnapshot before the assertion-safety check. This preserves the exact-tree semantics and avoids a workflow-file authorization dependency.User Impact
No user-visible product behavior changes. Maintainers now get environment-budget failures on the pull request that introduces them rather than after merge.
Evidence
Autoreview reported no accepted or actionable findings and classified the patch as correct with 0.99 confidence.