Repository navigation
ci(lockdown): freeze max_size in every check_*_size.yml + add lint enforcement - #3303
Conversation
…forcement
Three-pronged lockdown to stop agents from "fixing" red size-check
workflows by raising the threshold ceiling instead of fixing the
underlying regression:
1. **Lockdown banner** added to all 10 .github/workflows/check_*_size.yml
files (bluepill, esp32, teensy30/31/32/35/36/41/lc, uno) right above
the max_size lines. Tells the reader the value is mirror-locked.
2. **New lint check** ci/lint/check_size_thresholds.py with a frozen
FROZEN_THRESHOLDS dict. Validates every max_size{,_apa102} value in
every check_*_size.yml against the dict. Wired into `bash lint` as
stage `size_thresholds_locked` — ERROR mode by design (no warn-only
escape hatch). Changing a YAML value without updating the dict in the
same PR fails lint. Adding a new check_*_size.yml without registering
it also fails lint.
3. **CodeRabbit rule** on `.github/workflows/check_*_size.yml` (and on
the lint script itself) flags any threshold raise as HIGH severity
and requires an explicit issue ref + maintainer sign-off.
**Reverts the recent esp32 700KB cap back to 330KB.** The 700KB bump was
the band-aid from PR #3295 to make CI green while #3298 (fbuild not
propagating board-level build_flags/build_unflags) is unfixed. CI on
check_esp32_size.yml will be red until #3298 is fixed — that is the
correct state: the red signal is what forces the underlying fbuild bug
to be addressed.
teensy41 apa102 (165000) is preserved at its bumped value with an
explanatory comment — the real ceiling is 88000 once #2802 fl::ifstream
over-link is fixed.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. Warning Ignoring CodeRabbit configuration file changes. For security, only the configuration from the base branch is applied for open source repositories. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthroughIntroduces ChangesFrozen Binary-Size Threshold Enforcement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… vs. band-aids (#3305) (#3307) Follow-up to PR #3303's defensive lockdown. Walks every check_*_size.yml workflow's git history, classifies each currently frozen max_size / max_size_apa102 value as either a "real ceiling" or a "band-aid for a known regression", and ties every band-aid to a tracking issue. Audit findings: | Board | Frozen value(s) | Status | |----------|----------------------------|---------------------------------| | uno | 11000 / 9300 (-1 sentinel) | real ceiling | | bluepill | 55000 / 45000 | real ceiling | | esp32dev | 330000 / 330000 | real ceiling (RED on #3298) | | teensy30 | 60000 / 50000 | real ceiling | | teensy31 | 80000 / 65000 | real ceiling | | teensy32 | 80000 / 65000 | real ceiling | | teensy35 | 100000 / 85000 | real ceiling | | teensy36 | 120000 / 100000 | real ceiling | | teensy41 | 120000 / **165000** | apa102 band-aid (#2802; real=88000) | | teensylc | 35000 / 30000 | real ceiling | Only one current band-aid: teensy41 max_size_apa102=165000 (PR #2804, closes #2802). The real ceiling is 88000 once fl::ifstream / fl::posix_filebuf / fl::strerror / fl::AsyncLog* are kept out of the Apa102 link. esp32dev's 330000 is a real ceiling but CI is currently RED until #3298 (fbuild dropping ESP32 board-level build_flags / build_unflags) is fixed. The 700K bumps in PR #2790 and PR #3295 were band-aids; both already reverted by PR #3303. Changes: - New `docs/SIZE_THRESHOLD_HISTORY.md` with the per-board classification table, the historical bump catalogue for esp32dev and teensy41 (the two workflows with non-trivial bump histories), and instructions for how to change a frozen value (issue + YAML + lint script + this doc). - `ci/lint/check_size_thresholds.py` — extended the existing teensy41 band-aid comment pattern to every other entry, tagging each value as "real ceiling" or "band-aid (#NNNN)" so the lockdown lint script documents the audit it enforces. - `agents/docs/binary-size-analysis.md` — single-line cross-reference to the new doc so agents discover it from the bloat workflow. No frozen values changed; the lockdown lint still passes (size_thresholds_locked stage: green). Out of scope (per the issue): - Actually fixing #2802 or #3298. - Stretch goal `bash ci/audit-size-thresholds.py` automation. Closes #3305 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Three-pronged lockdown to stop CI agents from "fixing" red size-check workflows by raising the threshold ceiling instead of fixing the underlying regression. Same pattern as the root
./platformio.inilockdown (PR #3280) but applied to.github/workflows/check_*_size.yml.What lands
1. Lockdown banner in all 10 size-check workflows
.github/workflows/check_*_size.yml(bluepill, esp32, teensy30/31/32/35/36/41/lc, uno) all gain a comment block above themax_sizelines telling the reader the value is mirror-locked byci/lint/check_size_thresholds.py.2. New lint check (
ci/lint/check_size_thresholds.py)FROZEN_THRESHOLDSdict — single source of truth for all canonical ceilings.max_size{,_apa102}value in everycheck_*_size.ymlagainst the dict.bash lintas stagesize_thresholds_locked.max_sizelines, newcheck_*_size.ymlworkflows added without registration in the frozen dict.3. CodeRabbit rule
New
.coderabbit.yamlentries on.github/workflows/check_*_size.ymland on the lint script itself. Flags any threshold raise as HIGH severity and requires explicit issue reference + maintainer sign-off.Threshold revert
This PR reverts the recent esp32 700KB cap back to 330KB. The 700KB bump was the band-aid from PR #3295 to make CI green while #3298 (fbuild not propagating ESP32 board-level
build_flags/build_unflagsto the toolchain) is unfixed. CI oncheck_esp32_size.ymlwill be RED until #3298 is fixed — that is the correct state: the red signal is what forces the underlying fbuild bug to be addressed.teensy41 apa102 (165000) is preserved at its bumped value with an explanatory comment — the real ceiling is 88000 once #2802
fl::ifstreamover-link is fixed.Frozen values
Verification
Failure-mode test: temporarily bumping
check_esp32_size.ymlfrom 330000 → 700000 (without updating the lint dict) fails:Out of scope (deferred to follow-up issues filed alongside this PR)
build_flags) — that's what would actually allow esp32 CI to pass at 330KB.fl::ifstream/fl::AsyncLog*).Note on python_pipeline lint
bash lintshowspython_pipeline FAILED— that's pre-existing on master (9 ty diagnostics aboutos.systemsoft-deprecation, unrelated to this PR). Verified by runningty check ci/on master directly.Test plan
bash lint—size_thresholds_lockedstage cleanSummary by CodeRabbit