Skip to content

ci: remove every byte and work-count budget gate - #1907

Merged
trueadm merged 1 commit into
mainfrom
fix/remove-budget-gates
Oct 8, 2026
Merged

trueadm merged 1 commit into
mainfrom
fix/remove-budget-gates

Conversation

@trueadm

@trueadm trueadm commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This removes every committed budget gate from CI: bundle byte budgets, the downward ratchet, the rule that a raise lands alone, and the weekly work-count and Lynx byte budgets. Bytes are still measured and reported on every PR. They just never fail a check.

Why

  • The budget system made every size-moving PR a two-PR dance: a budget-only raise had to land first, then the feature.
  • Main went red whenever those two landed out of order, or when another PR merged between them. Budget-only commits to main became routine (ratchet … down one byte, set main's budgets to its measured bytes after #1892).
  • A follow-up PR replaces the gate with a post-merge review. On each push to main it measures the size change. When bytes grow, Claude reviews the landed diff, judges whether the growth is earned or slop and how it could be smaller, and records that in one rolling GitHub issue, which it edits in place while open.

Changes

PR-blocking gates removed

  • bundle-size.yml:
    • Drops the "Check that byte budget raises land alone" step, the --budgets --ratchet ceilings, and fetch-depth: 0.
    • The job, still bundle size / bundle size checks, keeps every non-byte gate: reachability scenarios must execute and retain only what they import, compiled apps must keep __createVoidRoot specialization, and client-only bundles must have no hydration code.
  • pr-report.mjs and pr-bench.yml: byte changes are listed but never fail the check. The js-framework work-counter gate is unchanged, and so is the rule that a suite failing on the merge commit fails the check.

Weekly Bench gates removed

  • benchmarks/baselines/ratios.json: deletes all 366 guards whose reference was a committed *-budget peer. That is 165 byte guards and 201 work-count guards across hooks-runtime, client-hot-paths, ssr-final-replay, and others. A patience diff shows pure deletion. The 835 remaining guards, including cross-framework size ratios, are untouched.
  • lynx-bundle-size: drops the frozen inventory byte budgets and the no-worklet main-thread/background caps. The 90% attribution-coverage check and the preview/IFR background-identity check stay. The controlled-size ledger moves to controlled-ledger.json.

Deleted

  • minimal-budgets.json, app-budgets.json, jsx-budgets.json, inventory-budgets.json.
  • budget-raises.mjs and its test.
  • The --budgets, --write-budgets, and --ratchet modes.
  • The octane-*-budget and *-budget peer targets in the bundle suites, and in the local bundle-size baseline.

Docs

  • CONTRIBUTING's "Size budgets" section is now "Bundle size".
  • Updated the benchmarks README, the Lynx README, and the performance-audit skill (regenerated with pnpm rules:generate).

Validation

  • pnpm ci:workflow:test: 377 pass
  • node --test benchmarks/pr-report.test.mjs benchmarks/bundle-size/minimal-gates.test.mjs: 16 pass
  • node benchmarks/bundle-size/run-minimal.mjs root-static behavior-root cli-spa-starter: reachability passes, and the emitted JSON has no -budget targets
  • node benchmarks/bundle-size/run.mjs octane-jsx: builds, and the void-root verdict still runs
  • node --check on both Lynx scripts. They were not executed, because the Rspeedy toolchain build was not run locally.
  • pnpm sync: no generated drift. pnpm format:files:check on the changed files: clean.
  • pnpm format:check / pnpm typecheck / pnpm test: not run locally. This change touches no package source or typed files, so CI covers them.
  • perf-review: not applicable (no runtime, compiler-output, or binding code)

Risk / follow-ups

  • Size growth no longer blocks a merge. The PR bench comment still lists every byte change, and the follow-up post-merge size-review PR adds the review.
  • The weekly work-count suites still publish their reference values as *-budget targets, but nothing compares against them now. Removing those peer targets from about 15 benchmark scripts is mechanical cleanup, deferred to keep this PR to the gates.
  • pnpm context:budget:check (CLAUDE.md line/byte and skill-description limits) is a different kind of budget and is left in place.

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Medium Risk
Merge no longer blocks on bundle byte growth; only reporting and non-byte gates (reachability, hydration-free, js-framework work counters) remain, so size regressions depend on review discipline and follow-up automation.

Overview
Removes automated merge-blocking on bundle bytes while keeping measurement and semantic bundle checks.

Committed ceilings (minimal-budgets.json, app-budgets.json, jsx-budgets.json, Lynx inventory-budgets.json) and the budget-raises policy are deleted, along with --budgets, --write-budgets, and --ratchet on run-minimal.mjs / run.mjs. Harnesses still build scenarios and emit raw/gzip/brotli totals, but no longer publish *-budget peer targets or fail on overages.

CI behavior: bundle-size.yml runs reachability and app builds without byte ratchets or the budget-raise step (and drops fetch-depth: 0). pr-report.mjs lists byte deltas but never fails for growth; PR bench still fails on js-framework work-counter increases and suite failures. Lynx inventory/run scripts drop frozen byte caps; attribution coverage and preview/IFR identity checks remain, with the controlled ledger moved to controlled-ledger.json.

Docs and agents: CONTRIBUTING, benchmarks/README.md, Lynx README, and regenerated performance-audit skills describe report-only bytes and PR-description justification instead of budget-only PRs.

Reviewed by Cursor Bugbot for commit c8281b3. Bugbot is set up for automated code reviews on this repo. Configure here.

Committed budgets made every size-moving PR a two-PR dance (a raise that
lands alone, then the feature) and turned main red whenever the two landed
out of order. Remove them all:

- bundle-size job: drop the raise-alone policy, the ceilings, and the
  downward ratchet. The job still gates reachability, app-root
  specialization, and hydration-free clients.
- PR bench: byte changes are reported, never a failure. The js-framework
  work-counter gate stays.
- Weekly Bench: drop every ratio guard that compared a measurement with a
  committed `-budget` peer (366), and the Lynx inventory and no-worklet
  byte caps. Cross-framework ratio guards stay.
- Delete minimal/app/jsx budget JSON, budget-raises.mjs, and the
  --budgets / --write-budgets / --ratchet modes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent ci PR: CI or build pipeline labels Oct 8, 2026
@trueadm
trueadm marked this pull request as ready for review October 8, 2026 15:39
@trueadm
trueadm merged commit 385d6ab into main Oct 8, 2026
39 of 49 checks passed
@trueadm
trueadm deleted the fix/remove-budget-gates branch October 8, 2026 15:48
trueadm added a commit that referenced this pull request Oct 8, 2026
#1907 removed every ratio guard whose reference was a committed `*-budget`
peer, so the fixed reference values those scripts still published had no
reader. Stop emitting them, drop them from the checked-in result files, and
update the READMEs that described the removed guards.

In-script assertions stay: spread.mjs, wave.mjs, refs.mjs and
effect-cleanup.mjs still check their own limits. stream-budget-* and
passive-scheduling's `budget` stay because live ratio guards reference them.

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 8, 2026
Two pushes that publish at once could each find no open review issue and
open one apiece, splitting the rolling log (Bugbot). Each publish attempt
now writes to the oldest open review issue, folds in the entries of any
newer review issue and closes it, then confirms its entry is in the oldest
open issue. An issue the run just opened stays in view even if the issue
listing lags behind.

The GitHub calls sit behind a small adapter so a test can replay the race:
one publish runs start to finish between the other's read and its create,
and both entries end up in the surviving issue.

Also drop the `*-budget` target filter: #1907 and #1910 removed those
targets, so nothing produces them any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 8, 2026
* ci: review bundle growth after it lands on main

Replaces pre-merge byte budgets with a post-merge review. Each push to main
builds the bundle-size and reachability scenarios before and after the push.
When a bundle grew by at least 32 gzip bytes, Claude reads the landed diff
with read-only tools and judges whether the growth is earned or slop and how
the change could have been written smaller. benchmarks/size-review.mjs records
that in one rolling "Bundle size review" issue: an open one is edited in
place, newest entry first, and a new one opens only when none is open.

Claude runs only when the ANTHROPIC_API_KEY secret is set; without it the
issue records the measured growth alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ci): converge concurrent size-review publishes on one issue

Two pushes that publish at once could each find no open review issue and
open one apiece, splitting the rolling log (Bugbot). Each publish attempt
now writes to the oldest open review issue, folds in the entries of any
newer review issue and closes it, then confirms its entry is in the oldest
open issue. An issue the run just opened stays in view even if the issue
listing lags behind.

The GitHub calls sit behind a small adapter so a test can replay the race:
one publish runs start to finish between the other's read and its create,
and both entries end up in the surviving issue.

Also drop the `*-budget` target filter: #1907 and #1910 removed those
targets, so nothing produces them any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ci): record size reviews as issue comments and survive a Claude timeout

Two publishes that read the same open issue body and edited it could
overwrite each other: the later write still held its own entry and
returned, so the earlier review vanished (Bugbot). Each entry is now its
own comment on the rolling issue. Runs only add comments, so nothing a
concurrent run writes can be lost. A rerun for the same commit edits its
own comment, and the workflow's per-commit concurrency group serializes
reruns. The issue body is a fixed header. Duplicate issues from two runs
that both found none still fold into the oldest one and close.

A 20-minute timeout killed the Claude step before its `||` fallback, so the
job counted as failed and the record step was skipped (Bugbot). The step is
now `continue-on-error`. It writes to analysis.partial.md and moves that to
analysis.md only after a clean exit, so a killed review can't leak a partial
analysis into the issue.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 8, 2026
…he trace-retention guard (#1916)

#1907 removed every committed budget gate but missed one. The chromium
browser lane runs view-transitions/effect-cleanup.mjs on every PR, and it
failed when total or idle-extra function calls exceeded
effect-cleanup-budget.json (measured + 32 calls). Delete that file and both
ceiling checks. The run still requires zero stageTeardown entries, the
shared lifecycle snapshots, completed native primers and unchanged
provenance hashes, and it still reports total_calls and idle_extra_calls.

#1907 also deleted the scoped-signals-trace guard (wrapped-max-budget over
unfilled-max-budget, trace_event, 1.5x) only because its reference name
ends in -budget. That name refers to the 10,000-event trace retention
limit; the guard compares two configurations timed in the same run.
Restore it verbatim.

run-trace.mjs has not produced numbers since #1851, because it built
ScopeImpl with the old (key, options) constructor and #1851 installs trace
recording and inspect() only through createScope. Build scopes through
createScope so the suite runs and the restored guard is evaluated again.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent ci PR: CI or build pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant