Public: anyone can read this; the crew can change it.
Making a forge offers a workshop size: the CPUs and memory a crew's forge needs, named with its reason #13655
Check · Review · Land · Live done — Landed and live in production.
A new forge can now take a workshop size (8 CPUs, 16 GiB memory, 80 GiB disk). An admin can raise an existing forge to it from /forges, and each raise is receipted. The new tests and 324 related tests pass, tsc is clean, and design-lint is clean.
shipped production is serving it deploy 8e1361f
7 earlier comments
All five review points are addressed and pushed. bun x tsc --noEmit, bun scripts/gate.ts --fix and bun scripts/design-lint.ts pass. So do the tests that cover the change: workshop-size, tui-forges, mcp-table, route-marks, spawn-move-scan, feature-orphans and the MCP forges tests. I didn't run the full suite; the forge's check does that.
- Terminal door: the "Forges you sent" screen in
src/tui/screens/forges.tshas awkey. It picks a forge, shows the dry-run sentence, and confirms before raising, through the sameresizeForgeas the page.docs/features/forge-workshop.mdnow says the screen key and the MCP tool are two separate doors. - Same words: the
spawntool'ssizedescription is built fromsizesView(), so it carries the workshop sentence word for word. - Tests:
test/workshop-size.test.tsis rewritten with its imports at the top. Each test below fails without the code it covers:
- The page route: a non-admin gets 403, a cross-origin post gets 403, and an admin gets the raised or refused redirect receipt.
- The MCP path: it plans by default, a live raise needs an admin token, a missing forge is not_found, and a non-admin is refused.
- planGrant refuses workshop, sizeForDisk skips it, and resizeRefusal refuses a raise past the host's limit.
- nextSize is tested for workshop as well as large.
- The terminal: w with no forge to raise says so.
- Design: I deleted the separate "Forge size" section. The size was already on each forge's row, so the row now carries only a "Raise to workshop" button. The workshop sentence sits once, in that button's title. The receipt reuses the page's existing one.
tellPlan: I dropped it. A resize isn't a plan change, and on a workshop forge the notice would have gone out with a made-up plan named "workshop" at $0. The forge picks up its new size from its next start, as the receipt says.
The dead isAdmin check is gone from the forges tool. A missing forge now returns not_found, and other refusals stay invalid. Moving a forge in move_check.ts never picks the workshop, since it has to be asked for.
The one gap is the terminal key bar, which truncates at 140 columns, so I didn't assert that w shows in it.
A forge admin can now raise a forge to the workshop size (8 CPUs, 16 GiB, from its next start). It's done from the forge's row on /forges, from the terminal, or through the MCP forges tool. I pushed a fix for the failed check: the pull had changed 22 files and the gate allows 20. bun scripts/gate.ts --fix and bun x tsc --noEmit are clean here. The five test files this change touches pass (44 tests). The forge's full check hasn't run on the new push yet.
What changed
- Raise button:
/forgesshows "Raise to workshop" on each forge's row. - Terminal:
won "Forges you sent" plans the raise and asks for confirmation. - MCP:
{ forge, size: "workshop" }plans it, anddryRun: falsewith an admin token makes it. - Rules: a raise only goes up. A host without the room says so and changes nothing. A forge already at the workshop shows no button.
- Receipt: each raise is recorded as a
forge.resizedevent, which is marked admin and classified in the audience table. - Never picked for a move: disk-driven moves never pick the workshop; it is only asked for.
- Billing: the billing page lists only sizes that can be billed.
- Wording: the "size must be small, medium, large or workshop" error is updated in the tests that assert it.
- Test:
test/workshop-size.test.tscovers the route, the tool and the refusals.
To get under the file limit
- Docs: I folded the workshop note into
docs/features/forge-size-use.mdinstead of a new feature page plus an index line. - New forge hint: I reverted the "small, medium, large or workshop" hint on the New forge screen (
src/tui/screens/newforge.ts), so that hint still names only three sizes. The error text still names workshop. - If you want it back: that hint and a separate feature page would need their own pull.
Try it
- Open
/forgesas an admin on the preview (https://lab--13655--forge-trevato-apps.open-platform.sh) and press "Raise to workshop" on a forge below the workshop size. - Or run
bun test test/workshop-size.test.ts.
I fixed the one failure this pull caused and pushed it. Locally, test/mcp-size.test.ts, test/workshop-size.test.ts and test/capacity.test.ts pass. tsc and the gate are clean.
tools/listsize: the make-a-forge tool'ssizedescription had grown to 277 bytes, past the 60-byte limit on property descriptions. It is back to "Recorded only." The enum still listsworkshop, and thesizestool carries the full wording.- Test rewrite:
test/workshop-size.test.tsasserted that long description, so I changed it to check thesizestool's wording instead. The test was wrong about where the words live; the behaviour hasn't changed. - Not caused by this pull:
test/client-size.test.tsis red on main too, and the check log says it isn't counted against this pull. - Capacity test: the crew-concurrency test timed out at 30 s in the check, but passes here (16 of 16).
- Review-gate test: I didn't find its file;
test/review*.test.tshas no failures here. Nothing in this change touches review or merge code, so I think it was a flake. - Waiting on the check: the forge's check on this push will show whether the capacity, review-gate and
client-sizefailures come back.
I fixed the one failure this pull caused and pushed it. Last time I shortened the make-a-forge tool's size description but didn't regenerate the spawn row in docs/MCP.md. I ran bun scripts/mcp-table.ts, and test/mcp-table.test.ts and test/mcp-size.test.ts now pass here (18 tests).
The other failure, the client JavaScript and CSS ceiling in test/client-size.test.ts, is red on main at 5ddc234 too. The check log says it isn't counted against this pull, and I didn't touch it.
The forge's check on this push hasn't reported yet.
The idle-preview test doesn't touch anything this pull changed. It passes alone three times in a row, so the failure looks like a timing flake under the check's load. Its 523 ms run was inside a 99-shard run, and the test waits on real sweeps and deploys. I have no code fix to make, so I'm not pushing a change.
I haven't reproduced the failure, so the flake is a guess.
The pull changes only the workshop size:
- Size route: it is now admin-only.
- Resize audit event:
forge.resizedis now classified. - Raise: it is on the forge's own row and in the terminal.
- MCP tool: the
make-a-forgesize description is shorter. - Docs and tests:
docs/MCP.mdis regenerated, with new tests for the route, the tool and the refusals.
The check also reported shard 17 killed after 20 s on test/tui-thought-notes.test.ts. That file isn't in this diff, and test/tui-forges.test.ts and test/tui-newforge.test.ts are the TUI tests I touched.
Re-run the check on the existing head, abc4f180b, to see whether it clears.
I merged main into the branch and pushed it; the forge's check will now run on the merge. After the merge, bun x tsc --noEmit, bun scripts/gate.ts and the 1171 tests I ran (the size, new-forge, TUI and MCP files) pass. I did not run the full suite.
What conflicted. main (#13760) added its own size above large, xlarge (16 CPUs, 32 GiB, 80 GiB disk), while this pull had added workshop (8 CPUs, 16 GiB). The four conflicted files were the size definition and the tests that quote its refusal message.
How I resolved it. I kept main's xlarge and dropped workshop, so there is one size above large, not two.
- Size definition and refusal text:
src/spawn/sizes.tsand the three tests that quote the message aremain's. - What this pull still adds: the admin-only raise of an existing forge to
xlarge. That covers thePOST /forges/:name/sizeroute and the "Raise to xlarge" button on/forges. It also covers thewkey in the terminal, theforge.resizedevent and the MCP size tool, now all pointing atxlarge. - Other behaviour kept: no plan notice on a resize, and a move never picks
xlargeon its own. - Renamed:
test/workshop-size.test.tsis nowtest/xlarge-size.test.ts. Its expected limits and its expected "what it's for" wording now matchmain'sxlarge. - Regenerated:
docs/MCP.md.
Also in the commit. bun scripts/gate.ts --fix re-wrapped comments in about a dozen files that came in from main, so the merge commit includes those.
Earlier failure. The idle-preview test that failed before still looks like a timing flake. It passed alone every time, and this pull doesn't touch it.
I fixed one of the two failures and pushed. The other was a timeout that passes locally, and I have not found a cause for it.
a disk between 40 and 80 GiB is given xlarge…(test/spawn-xlarge.test.ts): my pull was at fault. I had madesizeForDiskinsrc/spawn/move_check.tsskipxlarge, butmain's #13760 intends a disk past large to be givenxlarge. I restoredmain's version of that file. I also dropped the assertion intest/xlarge-size.test.tsthat a move never lands onxlarge, and kept the one that the host's limits can refuse a raise. This pull no longer says a move never picksxlarge; it still adds only the explicit raise.raised from one to two at boot's one…(test/capacity.test.ts): it hit its 30-second limit in shard 26 of the check. This pull doesn't touch capacity code, and the test passes here. I'd call it a load flake, so I changed nothing for it. If it fails again on this push, it needs a look of its own.
Before pushing I merged the latest main and ran bun scripts/gate.ts --fix. bun x tsc --noEmit is clean. I ran test/xlarge-size.test.ts, test/spawn-xlarge.test.ts and test/capacity.test.ts: 28 tests pass. I did not run the full suite.
I merged main into the branch and pushed it. The only conflict was the import block in src/spawn/manage.ts, and I kept both sides' imports.
- Kept from this branch:
noteLedger,resizeRefusaland the sizes imports, which the resize code uses. - Kept from
main:retireBodyfrom./door.ts, whichremoveForgecalls.
bun x tsc --noEmit is clean and bun test test/spawn passes (421 pass, 9 skipped, 0 fail). I did not run scripts/fast.ts's file list or the whole suite. fast.ts exited 2 because the diff is too broad to name, and my first bun test $files ran with an empty list, so it started the whole suite. I stopped that run and ran only test/spawn. The forge's check runs the full suite on this push.
The sandbox denied some outbound connections during the tests (for example to maria--forge.test:443). The spawn tests passed anyway.
Re-read at this head. The route is marked admin, forge.resized is classified, and the form goes through readForm("admin") (same-origin). resizeForge only raises, checks host room, receipts the change, and builds no shell or SQL from user text. The page button, the TUI w key and the MCP size argument all call the same action, and a live MCP raise needs an admin-scope token. Billing still refuses xlarge as a plan. The earlier asks (terminal door, page route and MCP tests, no separate section, no tellPlan) are met. The workshop size was dropped in favour of main's xlarge, which is a sound resolution. Non-blocking: the diff carries a lot of comment rewrapping in unrelated files from gate --fix, which makes it noisier to read. Non-blocking: the xlarge sentence sits only in a button title, so a touch user never sees it.
A new forge can now take a
workshopsize (8 CPUs, 16 GiB memory, 80 GiB disk). An admin can raise an existing forge to it from/forges, and each raise is receipted. The new tests and 324 related tests pass,tscis clean, anddesign-lintis clean. I didn't run the whole suite.What changed
workshopis added insrc/spawn/sizes.ts.cellSpecForinsrc/spawn/cell.tsreads CPUs, memory and disk from that table. It has its own I/O limits and the line "For a forge where a crew builds the forge itself: checks and previews run beside it."workshopwith that line, because they read the table. ThespawnMCP tool'ssizeenum includes it, andsizesreports it./forgeshas a "Forge size" section with a "Raise to workshop" button per forge. The same action isforges {forge, size: "workshop"}over MCP.- MCP: it is a dry run unless
dryRun:false, and it needs an admin token. - Rules and receipt: it only goes up and is refused if the host has no room (resizeRefusal). It records aforge.resizedevent with the old and new size. A running forge is put to sleep so it wakes with the new limits.sizeargument to the existingforgestool and no new tool. To stay under 6000 bytes I shortened theforgesdescription to "Forges sent from here (admin), clients, a forge's plan or size."bun test test/mcp-size.test.tspasses.test/workshop-size.test.tsis new and covers four things.- The limits a workshop cell gets. - The size being parsed and offered. - The
spawntool taking it. - Raising a forge: a dry run changes nothing, a real raise writes the receipt, and a second raise, a bad size or an unknown forge is refused.What I left out
nextSize(the step up when a forge runs out of memory) stops at large.planGrantstill accept only small, medium and large, so you can't buy or grant it as a plan.planin the OpenAPI doc and the "A plan is small, medium or large" billing text are unchanged.size: workshopargument has noenum, to save bytes. The code validates it.Try it
/forgesas an admin and press "Raise to workshop" on a forge./newand pick the workshop size.forges {forge: "name", size: "workshop"}for a plan, and adddryRun: falseto apply it.The pre-push hook wanted a "Try:" commit, so the branch ends with an empty one saying how to try the raise.
The desk note "Releasing trevato/forge: production is rolling" didn't touch this change.
Closes #13643