Repository navigation
ci: review bundle growth after it lands on main - #1908
Conversation
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]>
Benchmark report🟢 No byte growth, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 60 measured values. Public-import reachability bundles (bytes)No changes across 111 measured values. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Concurrent publishes create duplicate issues
- After creating a new issue, the code now re-checks openIssue() for a lower-numbered canonical issue and closes the duplicate before retrying, ensuring only one rolling issue exists.
Or push these changes by commenting:
@cursor push 6a232f53ce
Preview (6a232f53ce)
diff --git a/benchmarks/size-review.mjs b/benchmarks/size-review.mjs
--- a/benchmarks/size-review.mjs
+++ b/benchmarks/size-review.mjs
@@ -305,6 +305,15 @@
bodyFile,
]).trim();
number = Number(url.split('/').pop());
+ // A concurrent publish may also have created an issue. The canonical
+ // issue is the lowest-numbered open one; close ours if it lost the race
+ // and retry so the next iteration merges into the winner.
+ const canonical = openIssue(repository);
+ if (canonical && canonical.number < number) {
+ run('gh', ['issue', 'close', String(number), '-R', repository]);
+ console.warn(`closed duplicate #${number}; canonical issue is #${canonical.number}`);
+ continue;
+ }
} else {
run('gh', ['issue', 'edit', String(number), '-R', repository, '--body-file', bodyFile]);
}You can send follow-ups to the cloud agent here.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | ccacb2c | Commit Preview URL Branch Preview URL |
Oct 08 2026, 07:23 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | ccacb2c | Commit Preview URL Branch Preview URL |
Oct 08 2026, 07:25 PM |
…review Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Concurrent edits drop review entries
- Added a re-read and re-merge step after the initial write in publishEntry so that entries clobbered by a concurrent stale-body edit are recovered before the verification check, and late duplicate issues are also folded.
- ✅ Fixed: Claude timeout skips growth publish
- Changed the 'Record the review in the size issue' step's condition from
if: steps.growth.outputs.grew == 'true'toif: always() && steps.growth.outputs.grew == 'true'so the step runs even when the Claude step fails due to a timeout or other step-level failure.
- Changed the 'Record the review in the size issue' step's condition from
Or push these changes by commenting:
@cursor push e243dbc55f
Preview (e243dbc55f)
diff --git a/.github/workflows/size-review.yml b/.github/workflows/size-review.yml
--- a/.github/workflows/size-review.yml
+++ b/.github/workflows/size-review.yml
@@ -139,7 +139,7 @@
|| { echo "::warning::Claude review failed; the issue records the growth only"; rm -f "$RESULTS/review/analysis.md"; }
- name: Record the review in the size issue
- if: steps.growth.outputs.grew == 'true'
+ if: always() && steps.growth.outputs.grew == 'true'
env:
GH_TOKEN: ${{ github.token }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
diff --git a/benchmarks/size-review.mjs b/benchmarks/size-review.mjs
--- a/benchmarks/size-review.mjs
+++ b/benchmarks/size-review.mjs
@@ -290,8 +290,23 @@
for (const duplicate of duplicates) {
github.close(duplicate.number, `Folded into #${number}.`);
}
- const [oldest] = github.openIssues();
- if (oldest !== undefined && github.body(oldest.number).includes(entryStart(headSha))) {
+ // Re-read and re-merge so a concurrent publish that edited from a stale
+ // body does not silently lose our entry (or we theirs). Without a
+ // compare-and-swap API the first writer's verify can pass before the
+ // second write lands; re-merging from the post-write body recovers both.
+ const [oldest, ...lateDuplicates] = github.openIssues();
+ if (oldest === undefined) continue;
+ const current = github.body(oldest.number);
+ const settled = mergeIssueBody(
+ [...lateDuplicates.map(({ body }) => body), current],
+ entry,
+ options,
+ );
+ if (settled !== current) github.edit(oldest.number, settled);
+ for (const dup of lateDuplicates) {
+ github.close(dup.number, `Folded into #${oldest.number}.`);
+ }
+ if (settled.includes(entryStart(headSha))) {
return oldest.number;
}
console.warn(
diff --git a/benchmarks/size-review.test.mjs b/benchmarks/size-review.test.mjs
--- a/benchmarks/size-review.test.mjs
+++ b/benchmarks/size-review.test.mjs
@@ -256,6 +256,6 @@
assert.match(claude, /@anthropic-ai\/claude-code@\d+\.\d+\.\d+ /);
assert.doesNotMatch(claude, /GH_TOKEN|github\.token/);
const record = step('Record the review in the size issue');
- assert.match(record, /if: steps\.growth\.outputs\.grew == 'true'\n/);
+ assert.match(record, /if: always\(\) && steps\.growth\.outputs\.grew == 'true'\n/);
assert.doesNotMatch(record, /ANTHROPIC/);
});You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 25dae0d. Configure here.
…imeout 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]>


Summary
This replaces pre-merge byte budgets (removed in #1907) with a post-merge review. After each push to main, a workflow measures every production bundle before and after the push. When bytes went up, Claude reviews the landed diff and records whether the growth was earned or slop, and how the change could have been written smaller, in one rolling GitHub issue.
How it works
.github/workflows/size-review.ymlruns on every push to main that touchespackages/**,benchmarks/**,package.json, orpnpm-lock.yaml, and on manual dispatch withbaseandheadinputs.bench.mjs bundle-size bundle-reachabilityin both trees on one runner, as the PR bench does.size-review.mjs growthgroups each changed Octane bundle's gzip, raw, and brotli deltas. The review continues only when some bundle grew by at least 32 gzip bytes. TheSIZE_REVIEW_MIN_GZIP_BYTESrepository variable overrides that.@anthropic-ai/[email protected]) in--printmode, onclaude-opus-5-5unless theSIZE_REVIEW_MODELvariable overrides it.git diff/log/show. The step has no GitHub token, a 60-turn limit, a $5 spend cap, and a 20-minute timeout.size-review.mjs publishkeeps one rolling "Bundle size review" issue, found by a hidden marker among open issues the Actions bot created.analysis.mdexists only after a clean exit, so the entry then records the growth alone.Without an
ANTHROPIC_API_KEYsecret the workflow still runs. Each entry then records the measured growth, with a note that the review was skipped.Setup needed
ANTHROPIC_API_KEYrepository secret. The repo has none today.SIZE_REVIEW_MODELandSIZE_REVIEW_MIN_GZIP_BYTES.Validation
node --test benchmarks/size-review.test.mjs: 9 pass. It covers:continue-on-error; andanalysis.mdwritten only after a clean exit.pnpm ci:workflow:test: 386 pass, after mergingmain(ci: remove every byte and work-count budget gate #1907 removed the budget tests).bundle-reachabilityresults with a synthetic +120 B growth oncli-spa-starter, against the real rangee989adeb1b..cbc1e8e651(perf(octane): move feature-only Block state to a lazy record #1896).growthandpromptran, the latter resolving perf(octane): move feature-only Block state to a lazy record #1896 throughgh. The rendered issue body looked right.publishwas not run, to avoid creating a real issue.--print,--model,--max-turns,--max-budget-usd, and--allowedTools. Checked locally without credentials.pnpm sync: no drift.pnpm format:files:check: clean.perf-review: not applicable (no runtime, compiler-output, or binding code)Risk / follow-ups
ci:workflow:testconflict kept ci: remove every byte and work-count budget gate #1907's removal ofbudget-raises.test.mjs. The*-budgettarget filter is gone too, since ci: remove every byte and work-count budget gate #1907 and chore(benchmarks): drop the dead *-budget reference targets #1910 removed those targets.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Changes are CI/benchmark tooling and GitHub issue automation only; they do not alter runtime, compiler output, or merge gates.
Overview
Adds post-merge bundle size review on pushes to
main(replacing pre-merge byte gates): a new workflow comparesbundle-sizeandbundle-reachabilityon the parent commit vs the pushed commit, and when any bundle grows by ≥32 gzip bytes (configurable), it optionally runs Claude on the landed diff and records results on a rolling "Bundle size review" GitHub issue.benchmarks/size-review.mjsimplementsgrowth(reusescompareSuitefrompr-report.mjs),prompt(landed commits/PRs + review instructions), andpublish(comment-per-push on one open issue, with duplicate-issue folding and same-commit reruns). The workflow runs benchmarks in parallel via a git worktree, caps Claude with read-only git tools and noGH_TOKEN, and still publishes measured growth if the API key or review step fails.Docs in
benchmarks/README.mdandbenchmarks/size-review.test.mjs(wired intoci:workflow:test) cover grouping, thresholds, concurrent publish behavior, and workflow security contracts.Reviewed by Cursor Bugbot for commit ccacb2c. Bugbot is set up for automated code reviews on this repo. Configure here.