Repository navigation
fix: fail instruction-budget when a surface grows past its declared count - #267
Conversation
|
@cubic-dev-ai review this PR |
@inkatze cubic can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 40,041 of the 40,000 allowed lines of code this month. Reviews resume on 2 December 2026 (in 19 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews. To help optimise your usage, you can tune cubic to get the most out of your usage limits:
|
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
PR-Agent run 43645495058.1 on 2243101: success |
|
Not an issue: the threshold arithmetic already forces base 10 with |
What
instruction-budget.shnow fails when a surface's measured word count is greater than its declaredn, naming the path, both numbers and the--countcommand that re-derives the row. Previously only the thresholds and the measured count were checked, so a row left one word behind (7250 declared, 7251 measured) passed.Why growth-only, not exact equality
The header asks a change that grows a surface to re-derive its row. Other commits shrink surfaces without touching the guard, and failing those would force a row edit nobody asked for and block unrelated prose trims. A shrunk surface stays allowed; its row only goes stale-high, which the thresholds still cover.
Rows behind
--counton mainChecked every row against
--counton main: one was behind. RootCLAUDE.mddeclared 1703 and measures 1717; re-derived to 1717. By the rule the thresholds stay 2000/2500, so no ceiling moved.Main moved while this was open (its bot-review row went to 7251 in the same file); the merge keeps that row beside
CLAUDE.md1717, and the guard passes on the merged tree.Tests
Fail-first: the new fixtures were added before the fix and run against the unfixed script, which failed 3 cases (
warn-range,growth-past-declared,growth-names-command). With the fix all cases pass. New fixtures: growth pastnfails, a row behind the measured count fails, a zero-paddednpasses, a shrink belownpasses. Because any count past the warn threshold is also growth pastn, the warn tier no longer appears without an error;warn-rangenow expects the failure.Bot review
cubic refused on quota ("reached its free monthly review limit", reviews resume 2 December 2026), so PR-Agent is the counted bot review. Its one finding (leading-zero handling in the threshold arithmetic) was declined with proof:
instruction-budget.sh:111already uses10#$n, unchanged from main, and theleading-zero-countfixture passes.Step records
Steps at
convergence(run000001)Ended on
ad990d449217.Steps at
pre-implementation(run000001)Ended on
ad990d449217.Steps at
pre-ci(run000001)Ended on
ad990d449217.Steps at
pre-pr(run000001)Ended on
ad990d449217.Steps at
post-pr(run000001)Ended on
2243101ec8a0.Summary by cubic
Makes
instruction-budget.shfail when a surface's measured word count exceeds its declaredn, so a row left one word behind no longer passes. The error names the path, both numbers, and the runnable--countcommand to re-derive the row. Shrinking belownstays allowed, since only growth must re-derive the row.Also corrects the root
CLAUDE.mdrow from 1703 to 1717 and adds tests for growth pastn, a count behind the declared row, a zero-paddedn, and a shrink that stays within budget.Written for commit 2243101. Summary will update on new commits.