Skip to content

Set app bundle budgets to 10% headroom - #2081

Merged
ymichael merged 1 commit into
mainfrom
bb/explain-bundle-budget-test-thr_zbj3vdsny6
Aug 20, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/explain-bundle-budget-test-thr_zbj3vdsny6

Conversation

@ymichael

@ymichael ymichael commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

What was wrong

The app bundle ratchets were set only 3% above a measured production build, leaving too little room for normal feature work and build variation. The intended policy is 10% headroom for both the boot payload and the first-paint thread-route closure.

What changed

  • Recalculate the boot raw/Brotli ceilings at exactly 10% above the current production measurements: 1,566,924 / 435,515 bytes measured and 1,723,617 / 479,067 bytes budgeted.
  • Recalculate the SplitWorkspaceRoute raw/Brotli ceilings the same way: 2,303,167 / 610,510 bytes measured and 2,533,484 / 671,561 bytes budgeted.
  • Update the in-file policy explanation from 3% to 10%.
  • Rebase onto current main. Remove unreachable ask-agent git failure flow #2080 removed the unreachable git-failure prompt flow and its Handlebars dependency entirely, so this PR drops the now-redundant lazy-loading change and calibrates the budgets after that cleanup.
  • No wire-protocol, CLI, guide, or host-daemon behavior changed.

How you verified

  • pnpm exec turbo run build typecheck --filter=@bb/app --cache-dir=.turbo/cache --output-logs=new-only
  • pnpm exec turbo run test --filter=@bb/app --cache-dir=.turbo/cache --output-logs=new-only — 404 files and 3,122 tests passed; 3 skipped.
  • node apps/app/scripts/check-bundle-budget.mjs — both measured closures pass their exact 10% ratchets.
  • git diff --check

Fixes: N/A — performance maintenance requested directly.

AGENT GENERATED: by GPT-5

@bb-slop-cop

bb-slop-cop Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · review

I am the Slop Cop. I am reviewing this pull request for security, code quality, performance, architecture, and user behavior.

@ymichael
ymichael force-pushed the bb/explain-bundle-budget-test-thr_zbj3vdsny6 branch from eb73e7a to 43aab9e Compare August 20, 2026 21:56
@ymichael ymichael changed the title Lazy-load git failure prompts and add bundle headroom Set app bundle budgets to 10% headroom Aug 20, 2026
@ymichael
ymichael merged commit 9d758c2 into main Aug 20, 2026
13 checks passed
@ymichael
ymichael deleted the bb/explain-bundle-budget-test-thr_zbj3vdsny6 branch August 20, 2026 22:01

@bb-slop-cop bb-slop-cop Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 SLOP COP 🚨 · review

Plain-English summary

This pull request first moved an expensive failure prompt out of the normal thread load.

The author replaced that change during this review. The merged version only gives the app bundle more size headroom.

Finding

Medium — The 10% bundle limit weakens the size check.

The prior 3% rule would stop bundle growth sooner. The new rule permits about 110 KB more boot code and 161 KB more route code.

The named package rules do not catch an unlisted large package or steady general growth.

Please keep the 3% limit. Another option is a separate check that limits each pull request's bundle increase.

Other review results

I found no security issue.

The replaced prompt code had two medium issues. It held the error toast and Git queue while the optional module loaded.

It also loaded Handlebars for workspace_unavailable, which cannot create an agent prompt. The force-push removed both issues.

The architecture scan found no duplicate production prompt loader. It found no stale prompt names or stale 3% text in the requested revision.

Verification

  • I reviewed requested SHA eb73e7a8c73886b9937312955a01be8f490dbcc6.
  • The app type check passed.
  • The production build passed.
  • The bundle check passed at 1,530.6 KB boot raw and 2,251.6 KB route raw.
  • Eight focused bundle tests passed.
  • git diff --check passed.
  • GitHub CI passed.
  • The full local app run passed 3,112 tests and failed 10 tests under heavy machine load. GitHub passed the same full suite.
  • A doobie browser test forced a signed commit failure. The error appeared after 2.4 seconds and showed no agent action.

The browser response omitted structured failure details. Thus, the old lazy prompt module did not load. The merged revision removed that unreachable flow.

GitHub changed the head to 43aab9e8d35f638ccdd6c6556f8e9248afa6d797 and merged it during this review. The bundle finding also applies to that revision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant