fix(ci): ship serve-web.ts's import into the web runtime image - #3837
Merged
Merged
Conversation
Every Release on main since #3815 has failed its staging health check with `service web is not running: web restarting`, on both staging-cloud and staging-selfhosted. #3815 gave serve-web.ts its first import, the COMPRESSIBLE_STATIC_TYPES map shared with build.ts's precompress writer. Both web Dockerfiles copy named files into the runtime stage rather than the tree, and neither copies that file, so `bun self-host/serve-web.ts` exits on error: Cannot find module '../packages/web/compressible-static-types' before Bun.serve is reached. The image builds green and the container restart-loops. Reproduced by running serve-web.ts against a directory holding only the files the runtime stage copies. Both Dockerfiles now copy the map alongside the server. Verified the same layout plus the map boots and answers 200 on / and /index.html. The guard goes in check-agent-constraints, not next to the Dockerfiles: self-host/*.test.ts is matched by no test:* scan root and by no test-unit.yml step, so nothing there runs in CI, which is why this shipped. The new runtime-copy rule resolves each relative import in serve-web.ts and requires a matching runtime-stage COPY in both web Dockerfiles, so `bun lint` fails the next one too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YKNwtBmST6KpA4seeJGiSC
tyler-dane
enabled auto-merge
September 16, 2026 14:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Every
Release on mainrun since #3815 has failed its staging health check withservice web is not running: web restarting, on bothstaging-cloudandstaging-selfhosted(latest run).#3815 gave
self-host/serve-web.tsits first import: theCOMPRESSIBLE_STATIC_TYPESmap it shares withbuild.ts's precompress writer. Both web Dockerfiles copy named files into their runtime stage rather than the tree, and neither copies that file, sobun self-host/serve-web.tsexits witherror: Cannot find module '../packages/web/compressible-static-types'beforeBun.serveis reached. The image builds green and the container restart-loops. Reproduced by runningserve-web.tsagainst a directory holding only the files the runtime stage copies; verified that the same layout plus the map boots and answers 200 on/and/index.html.Both Dockerfiles now copy the map alongside the server.
The guard goes in
check-agent-constraintsrather than next to the Dockerfiles:self-host/*.test.tsis matched by notest:*scan root and by notest-unit.ymlstep, so nothing in that directory runs in CI, which is why this shipped past a green build. The newruntime-copyrule resolves each relative import inserve-web.tsand requires a matching runtime-stageCOPYin both web Dockerfiles, sobun lintfails the next one too.Two things this deliberately does not touch, both reported in the session rather than fixed here:
Performance budgetis separately red on main: desktop script transfer is 1,068,905 bytes against the 1,060,000 budget. That is a real accumulated regression, and [agent] performance v1 WP-14: drop zod locales, devtools, rrule, bson from boot #3766 is the work that removes ~100 KB from the boot path. Raising the budget to go green would weaken the gate, so it is left alone.self-host/docker-compose.test.tshas a stale assertion (expect(workflow).not.toContain("base64")now trips on an unrelatedopenssl rand -base64 32help string). It fails on cleanmaintoday but is invisible because CI never runs the file. Wiring that directory into CI is a larger change than this hotfix should carry.Verify
🤖 Generated with Claude Code
https://claude.ai/code/session_01YKNwtBmST6KpA4seeJGiSC
Generated by Claude Code