Skip to content

fix: regenerate stale app-runtime browser bundle - #82

Closed
SawyerHood wants to merge 1 commit into
mainfrom
fix-stale-app-runtime-bundle
Closed

SawyerHood wants to merge 1 commit into
mainfrom
fix-stale-app-runtime-bundle

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Main's CI (and every open PR) is failing @bb/sdk app-runtime-browser-bundle.test.ts > keeps the committed bundle in sync with the runtime source graph.

f183840 ("fix: seed composer with project execution defaults") added defaultExecutionOptions to projectWithThreadsResponseSchema, which is part of the sdk app-runtime bundle's module graph, without regenerating the committed bundle.

This is just the output of pnpm --filter @bb/sdk generate:app-runtime-browser-bundle — no source changes.

🤖 Generated with Claude Code

f183840 changed projectWithThreadsResponseSchema (part of the sdk
app-runtime bundle graph) without regenerating the committed bundle,
breaking the @bb/sdk codegen sync check on CI for main and every PR.

Regenerated via pnpm --filter @bb/sdk generate:app-runtime-browser-bundle.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@SawyerHood

Copy link
Copy Markdown
Collaborator Author

Superseded by #83 — the bundle is no longer checked in, so the stale copy is deleted rather than regenerated.

SawyerHood added a commit that referenced this pull request Jun 10, 2026
…83)

## Problem

`packages/sdk/src/app-runtime-browser-bundle.generated.ts` (the served
`window.bb` runtime) was checked in and had to be manually regenerated
whenever anything in its module graph changed — sdk, server-contract,
domain, templates. The only enforcement was an after-the-fact CI sync
check, so the failure mode was inevitable: f183840 changed
`projectWithThreadsResponseSchema` without regenerating, breaking CI on
main and every open PR (see #82 for the symptom-level fix).

## Fix: make generation a build step

- **`@bb/sdk#generate:app-runtime-browser-bundle`** is now a cached
turbo task whose output is the generated module. The file is untracked
and gitignored.
- **Dependency edges** from every task that compiles the file: `@bb/sdk`
build/typecheck/test, `@bb/server` build/typecheck/test/dev (the only
importer of `@bb/sdk/app-runtime`), and `@bb/integration-tests` tasks
(they compile server src). `pnpm dev` runs through turbo, so dev
generates it automatically.
- The `--check` mode, `check:` script, and the staleness test are
**deleted** — staleness is structurally impossible now. The remaining
tests (sha integrity, guide-templates-only) run against a freshly
generated bundle.

This mirrors what `@bb/templates` already does (regenerate before its
own tasks), taken one step further by untracking the artifact.

## Verified

- `rm` the generated file → `turbo run build typecheck test
--filter=@bb/sdk --filter=@bb/server`: generate runs first, 7/7 tasks
pass
- Re-run after deleting the file again: cache hit, turbo restores the
file from the task output cache
- `turbo run lint` and `@bb/integration-tests#typecheck` pass
- `turbo run dev --filter=@bb/server --dry=json` →
`['@bb/sdk#generate:app-runtime-browser-bundle', '@bb/server#dev']`

## Notes

- Supersedes #82 (which just regenerates the stale copy); if this lands
first, #82 can be closed. If #82 lands first, this rebases cleanly — the
file gets deleted either way.
- Editor DX on a fresh clone: the import in `src/app-runtime.ts` is
unresolved until the first turbo run generates the file — standard
codegen behavior, same as a missing `dist/`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <[email protected]>
@SawyerHood SawyerHood closed this Jun 10, 2026
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