Skip to content

feat(ci): ratchet the Control UI startup JS budget against a committed baseline - #112880

Merged
steipete merged 1 commit into
mainfrom
claude/startup-budget-ratchet
Jul 23, 2026
Merged

steipete merged 1 commit into
mainfrom
claude/startup-budget-ratchet

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Closes #112743. The Control UI startup JS gzip gate is a fixed ceiling that main keeps drifting to within 1–3 KiB of, so the ceiling gets hand-bumped repeatedly (315→317 KiB in the constant's own comment trail) and feature PRs fail all four QA Smoke profiles on main-side drift they didn't cause — #112649 lost two full CI rounds to exactly this.

Why This Change Was Made

scripts/check-control-ui-performance.mjs now enforces ratchet semantics alongside the ceiling, mirroring the max-lines ratchet's philosophy:

  • A committed baseline (config/control-ui-startup-budget-baseline.json, exact bytes + reason + date) with a 512 B tolerance: exceeding baseline+tolerance fails with a message that names actual/baseline/tolerance and the exact command to intentionally raise it.
  • --update-baseline --reason "<why>" rewrites the baseline from current dist metrics, making intentional increases a reviewed one-line diff instead of a silent constant bump.
  • Builds that come in >4 KiB under the baseline print a non-fatal lower-the-baseline hint.
  • Missing or malformed baseline fails closed with the regeneration command.
  • The fixed ceiling (317 KiB) remains as the hard backstop; the known tolerance-creep property (each landed PR may consume up to 512 B) is documented in the script and bounded by that ceiling.

User Impact

CI-only. Feature PRs stop failing on budget noise; real startup regressions still block; budget increases become visible, attributable decisions.

Evidence

  • test/scripts/control-ui-performance.test.ts: 11 tests covering within-tolerance pass, over-tolerance fail, over-ceiling fail regardless of baseline, lighter-build hint, malformed-baseline fail-closed, and --update-baseline writing exact bytes.
  • Live proof: production vite build passes the checker (322,526 B == baseline, tolerance 512 B, ceiling 324,608 B); with the baseline temporarily lowered 10 KiB the checker exits 1 with the ratchet message.
  • pnpm check:script-declarations contract sync green (242 contracts); targeted lint/format clean; Codex autoreview clean (0.94).

…d baseline

The startup JS gzip gate was a fixed ceiling that main drifted to within
1-3 KiB of, forcing repeated hand-bumps (315->317 KiB) and failing
feature PRs on drift they did not cause (#112649 burned two CI rounds).

check-control-ui-performance.mjs now also enforces a committed baseline
(config/control-ui-startup-budget-baseline.json) with a 512 B tolerance:
regressions beyond baseline+tolerance fail with an actionable message,
intentional increases become a reviewed one-line diff via
--update-baseline --reason, meaningfully lighter builds print a
lower-the-baseline hint, and a malformed/missing baseline fails closed.
The fixed ceiling stays as the cumulative-creep backstop.

Closes #112743.
@steipete
steipete marked this pull request as ready for review July 23, 2026 04:05
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Jul 23, 2026
@steipete
steipete merged commit c11f175 into main Jul 23, 2026
159 of 163 checks passed
@steipete
steipete deleted the claude/startup-budget-ratchet branch July 23, 2026 04:19
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Jul 23, 2026
…ytes

All four QA Smoke profiles fail on main since the #112880 ratchet landed:
startup JS gzip ~323,326-323,342 B vs baseline 322,526 + 512 B tolerance.
The overage comes from UI commits that landed after the baseline was
captured (#112859 #112866 #112853 #111861). Local macOS builds measure
~322,535 B; Linux CI is ~800 B larger, so the baseline must track the CI
measurement (max observed across profiles, run 29980596056).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 23, 2026
…d baseline (openclaw#112880)

The startup JS gzip gate was a fixed ceiling that main drifted to within
1-3 KiB of, forcing repeated hand-bumps (315->317 KiB) and failing
feature PRs on drift they did not cause (openclaw#112649 burned two CI rounds).

check-control-ui-performance.mjs now also enforces a committed baseline
(config/control-ui-startup-budget-baseline.json) with a 512 B tolerance:
regressions beyond baseline+tolerance fail with an actionable message,
intentional increases become a reviewed one-line diff via
--update-baseline --reason, meaningfully lighter builds print a
lower-the-baseline hint, and a malformed/missing baseline fails closed.
The fixed ceiling stays as the cumulative-creep backstop.

Closes openclaw#112743.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 23, 2026
…ytes

All four QA Smoke profiles fail on main since the openclaw#112880 ratchet landed:
startup JS gzip ~323,326-323,342 B vs baseline 322,526 + 512 B tolerance.
The overage comes from UI commits that landed after the baseline was
captured (openclaw#112859 openclaw#112866 openclaw#112853 openclaw#111861). Local macOS builds measure
~322,535 B; Linux CI is ~800 B larger, so the baseline must track the CI
measurement (max observed across profiles, run 29980596056).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Ratchet the Control UI startup JS budget against the main baseline

1 participant