Repository navigation
ci: panic budgets move from an inline ci.yml step to scripts/panic-budgets.tsv - #448
Merged
Merged
Conversation
The panic-budget step was 670 lines of bash and budget history inline in ci.yml, so every budget change edited the 1,700-line workflow and collided with unrelated CI changes. The 42 budgets and their comments move verbatim to scripts/panic-budgets.tsv (file, budget, note), the counting logic to scripts/panic-budget.sh, and the step runs the script. ci.yml shrinks by 669 lines. Equivalence: the new script's output is byte-identical to the old step's (75 lines, exit 0) on this tree. A new unwrap over budget, and a row with a space instead of a tab, both fail with an ::error line. A row naming a deleted file is now an error instead of a silent pass.
CLAUDE.md, CI_GATES.md and PANIC_AUDIT.md said the budgets lived in an inline ci.yml step and that there was no local script. Name the data file and scripts/panic-budget.sh instead, and change the lowering procedure to edit the TSV row.
Its full name reached master with #446, so it was added to master's required checks (10 in total, verified via the protection API).
There was a problem hiding this comment.
🟢 Approval recommended
The extracted gate preserves the existing behavior while adding useful validation and consistent documentation.
0 open findings
What changed in this PR
Moves panic-budget enforcement from inline CI YAML into reusable scripts and documents the new source of truth.
Changes:
- Adds TSV-backed panic budgets with validation and fail-closed enforcement.
- Simplifies CI to invoke the standalone script.
- Updates documentation, changelog, and required-check records.
| File | Description |
|---|---|
scripts/panic-budgets.tsv |
Stores per-file budgets and history. |
scripts/panic-budget.sh |
Implements validation and enforcement. |
.github/workflows/ci.yml |
Replaces inline logic with the script. |
docs/PANIC_AUDIT.md |
Documents the new budget location. |
docs/CI_GATES.md |
Updates gate instructions and required checks. |
CLAUDE.md |
Updates contributor guidance. |
CHANGELOG.md |
Records the CI refactor. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item C (second part) of the agent-native plan.
The panic-budget step was 670 lines of bash plus budget history inline in
ci.yml, so every budget bump edited the 1,700-line workflow (15 of the last 300 commits touched ci.yml) and there was no way to run the gate locally except through it.scripts/panic-budgets.tsv: the 42 budgets with their history comments, moved verbatim (generated mechanically from the step body). Format<file>\t<budget>[\t<note>],#lines are history.scripts/panic-budget.sh: the same counting logic and fail-closed sweep; the CI step is nowbash scripts/panic-budget.sh.ci.ymlshrinks by 669 lines.::errorinstead of a silent pass.Equivalence: on this tree the script's output is byte-identical to the old step's (75 lines, exit 0, diffed). Negative tests: an extra
.unwrap()incommdrv.rs→2 > 1error, exit 1; a space instead of a tab → row error, exit 1.scripts/check.shstill resolves theCount panicsstep (--dry-runclean);shellcheckclean.🤖 Generated with Claude Code