Public: anyone can read this; the crew can change it.
src/http/server.ts hands each route family to its own small module, with the same answers #16782
Check · Review · Land · Live done — Landed and live in production.
This is the first pull for #15367. It moves the /forges…, /family, /pricing… and /templates… routes, plus "+ New forge" (/forges/new, /forges/start), out of src/http/server.ts into a new src/http/forgesroutes.ts. That is 39 registrations with the same handlers in the same order, so the routes answer as before.
-
Reviews
ApprovedPure move of 39 route registrations into forges_routes.ts, same handlers and same order, so /forges/new still sits beside the /forges/:name routes and everything stays above /:owner. It follows the settings_routes.ts pattern. Unused imports are gone from server.ts. The four source-scanning tests now also read the new file, and their assertions are unchanged. No handler, auth, body-cap or header logic changed, so there is no new security surface. No door is needed because nothing was added. Clean.
-
Checks
shipped production is serving it deploy aac12e1
-
History
- The route-scanning tests read forges_routes.ts alongside server.ts 5b0120b
- Moving the /forges, /family, /pricing and /templates routes changes no behaviour de7b6d7
- Try: open /forges, /pricing, /templates and /forges/new: each answers as before 7f888e2
- server.ts hands the /forges, /family, /pricing and /templates routes to forges_routes.ts, in the same order (#15367) bb71b38
- small: Escape leaves the tell box and keeps its draft per page (#16774) 24468de
- On a phone, one tap opens search with the keyboard up and results above it (#16749) 7238053
- A room on an app's change stream reports who is present (#16776) 98bb47d
- Port Jay Moran's demo: actions/demo, refs/demo and moveRefLeased's caller, demo routes (#16745) b346c0a
- The plans page says what each forge size is for, measured by the time to a first built change (#16759) a1bc223
- The owner grants one of his apps, or one crew member, read access to a read-only work repo (#16750) 1d1b0ae
- A card for every #12: the forge's one peek, on every page (#16700) 68934bd
- The system MCP tool answers `kind: "pages"` with the same page-budget rows /system shows (#16755) df6de28
- Talk on a phone, still wrong after #16552 landed: conversation history loads… (#16768) f2ced5a
- An issue whose body opens "Follow-up to #N" waits for #N on the map, and the page and the terminal say so (#16762) e002bf0
- Next up's pace line wins only when the cost line is unknown: a test shows both (#16763) 8e10c2c
- A pull reading says approval moved in one string: approvedAt reads "head against base" beside the object it carries now (#16761) f788d21
- Every /next decision kind has a test that fails without its 60-second Undo, and the MCP names the same undo (#16758) e78d344
- A 5,000-row deploy_pull prune batch holds the write lock under 50 ms, measured in a test (#16756) b9a4941
- The vendor's own variables (ANTHROPIC_*, CLAUDE_CODE_*) are read only inside the Claude runner's module (#16757) 46e0349
- Revert "LFS door: batch API and locks on the BlobStore" (#16754) 771a2a7
2 earlier comments
This is the first pull for #15367. It moves the /forges…, /family, /pricing… and /templates… routes, plus "+ New forge" (/forges/new, /forges/start), out of src/http/server.ts into a new src/http/forges_routes.ts. That is 39 registrations with the same handlers in the same order, so the routes answer as before. server.ts goes from 3,556 to 3,508 lines. The file follows the pattern of infra_routes.ts and pinned_routes.ts: forgesRoutes(router) is called at the spot where the block used to sit, above /:owner.
The order is unchanged because the router matches in registration order. The literal /forges/new has to stay beside /forges/:name/… and /forges/name/:name.
I removed the imports in server.ts that only this block used, and bun x tsc --noEmit is clean. I ran 39 test files covering the touched routes, including body-caps, forges-, pricing- and new-forge-. They give 230 pass and 0 fail. I did not run the whole suite, and the forge runs the full check on push. Three outbound connections to .forge.test hosts were denied by the sandbox during those runs, and the tests still passed.
I added no new function, so there was nothing to reuse from similar.ts. The gate rewrapped comments in two files; nothing is left uncommitted. The commit line says No door:, because nothing was added.
Family order for the next pulls, each from server.ts, one per pull:
- Sign-in, sign-up, claim and join (
/signin,/signup,/claim,/welcome,/first-admin,/join,/verify,/logout). /asks…and the/boardfamily./design…and/packs….- The well-known and static files (
/.well-known/,/assets/, icons,robots.txt,llms.txt). /maintenance…,/fleet…and the admin pages.- The per-repository routes under
/:owner/:name, which are the bulk of the file.
I did not touch resolveAuth, the request pipeline or the handler code, since this pull is about routes only. I also did not start the other families, to keep this diff reviewable.
To try: bun test test/forges-refused.test.ts test/pricing-order.test.ts test/new-forge-stranger.test.ts. On the preview, open /forges, /pricing, /templates and /forges/new.
🤖 Generated with Claude Code
server.ts now hands the /forges, /family, /pricing and /templates routes to src/http/forges_routes.ts. The routes keep their original order, so each one answers as before.
The gate failed because this pull changes src/http/forges_routes.ts and src/http/server.ts but adds no test. This is a pure move, so I didn't write one. I added an empty commit with a No test: line explaining that, which the gate accepts for changes that alter no behaviour. I pushed it and haven't seen the forge's check result for the new commit. I didn't run bun test or tsc this turn.
To try it, open /forges, /pricing, /templates and /forges/new on the preview. Each should render exactly as it did on main.
The /forges, /family, /pricing and /templates routes now live in src/http/forges_routes.ts, registered from server.ts in the same order, so every page answers as before. The check's failures came from tests that scan the router source as text and didn't know about the new file. I haven't seen the forge's check result for this push.
- Tests changed:
test/design-audit.test.ts,test/guide.test.ts,test/openapi.test.tsandtest/server-timing-sweep.test.tsnow readforges_routes.tsalongsideserver.tsandsettings_routes.ts. The tests were wrong only in where they looked for routes. Their assertions are unchanged. - Verified here: those four plus
test/pages-budget.test.tspass (57 tests), andtsc --noEmitis clean. - Left alone: "/llms.txt stays under its byte budget for each role" is red on
maintoo, so it isn't from this pull. - Left alone: the earlier gate failure about a missing test is covered by the
No test:commit.
To try it, open /forges, /pricing, /templates and /forges/new on the preview. Each should render as it does on main.
🤖 Generated with Claude Code
This is the first pull for #15367. It moves the
/forges…,/family,/pricing…and/templates…routes, plus "+ New forge" (/forges/new,/forges/start), out ofsrc/http/server.tsinto a newsrc/http/forges_routes.ts. That is 39 registrations with the same handlers in the same order, so the routes answer as before.server.tsgoes from 3,556 to 3,508 lines. The file follows the pattern ofinfra_routes.tsandpinned_routes.ts:forgesRoutes(router)is called at the spot where the block used to sit, above/:owner.The order is unchanged because the router matches in registration order. The literal
/forges/newhas to stay beside/forges/:name/…and/forges/name/:name.I removed the imports in
server.tsthat only this block used, andbun x tsc --noEmitis clean. I ran 39 test files covering the touched routes, includingbody-caps,forges-,pricing-andnew-forge-. They give 230 pass and 0 fail. I did not run the whole suite, and the forge runs the full check on push. Three outbound connections to.forge.testhosts were denied by the sandbox during those runs, and the tests still passed.I added no new function, so there was nothing to reuse from
similar.ts. The gate rewrapped comments in two files; nothing is left uncommitted. The commit line saysNo door:, because nothing was added.Family order for the next pulls, each from
server.ts, one per pull:/signin,/signup,/claim,/welcome,/first-admin,/join,/verify,/logout)./asks…and the/boardfamily./design…and/packs…./.well-known/,/assets/, icons,robots.txt,llms.txt)./maintenance…,/fleet…and the admin pages./:owner/:name, which are the bulk of the file.I did not touch
resolveAuth, the request pipeline or the handler code, since this pull is about routes only. I also did not start the other families, to keep this diff reviewable.To try:
bun test test/forges-refused.test.ts test/pricing-order.test.ts test/new-forge-stranger.test.ts. On the preview, open/forges,/pricing,/templatesand/forges/new.🤖 Generated with Claude Code
Closes #15367