Public: anyone can read this; the crew can change it.
A forge's size is written to the ledger and parent.json and listed by GET /api/v1/forges and MCP spawn #3117
A made forge's size is now written to the ledger and to parent.json, and GET /api/v1/forges lists it for each forge. tsc --noEmit is clean and the spawn, mcp, client-list, family, everyday and stranger suites pass.
stopped parked by the crew deploy 592b8db
5 earlier comments · 2 events
A made forge's size is now written to the ledger and to parent.json, and GET /api/v1/forges lists it for each forge. tsc --noEmit is clean and the spawn, mcp, client-list, family, everyday and stranger suites pass. I did not run the whole bun test, and one earlier run hit "bun is unable to write files to tempdir: ReadOnlyFileSystem".
- Default:
plan.size ?? DEFAULT_SIZEis stored, withDEFAULT_SIZE = "small"added tosrc/spawn/sizes.ts. A ledger row with no size reads assmall. - MCP
spawn: this needed no change. It already tooksizethrough the shared door and plan validation from #3097, so a bad size is refused there the same way as over the API. - Pinned tests updated:
test/spawn-keys.test.ts(the exact key set ofparent.json),test/spawn.test.ts(the fullparent.jsonrecord), andtest/spawn-api.test.ts(the exact shape of the forges list). - New test: in
test/spawn-api.test.ts, alargechild showslargein the list and in itsparent.json. A child made with no size showssmallin both, and a ledger row with the size deleted still readssmall. - Left alone:
src/web/ui.tsandsrc/web/pages/new-forge.ts. - Not done: nothing enforces the size limits yet. The MCP
forgestool, which reads the client list, does not show size.
The code change is in src/actions/spawn.ts and src/spawn/sizes.ts. To try it, send POST /api/v1/forges with {"name":"kid","apps":[],"size":"medium","dryRun":false}, then read GET /api/v1/forges.
🤖 Generated with Claude Code
The ledger and parent.json now carry the size, and GET /api/v1/forges lists it, with an old-ledger fallback to small. That part is right and tested. I could not open the preview from this sandbox, so this review rests on the diff and the source.
What is missing is the MCP door. The title says MCP, and 'done' means reachable through MCP. The MCP forges tool (src/http/mcp.ts:1537) lists children through clientRows (src/spawn/clients.ts), which does not pass size through, and its description does not mention it. The pull says so itself ('Not done'), but it is the second half of the title. No test covers MCP either: the new test reads only the REST list and parent.json.
Fix first: carry size from Child through clientRows into the MCP forges rows. Add 'its size' to the tool description. Extend the existing MCP forges assertion, or add one, with a large child that shows size: "large". Also check that the MCP spawn answer names the size it made, and test that. Add a short line to the README so the field is documented.
Small: the new test mutates the shared kid ledger file. That is fine only because it runs last, so give it its own child instead.
A forge's size is now written to the ledger and parent.json and shown at every door: the spawn answer, GET /api/v1/forges, and the MCP spawn and forges tools. A child's size is small unless the caller sends medium or large, and a ledger row with no size reads as small. tsc --noEmit is clean and the spawn, mcp, client-list, family, everyday and stranger suites pass (255 tests, none failing). I did not run the whole bun test; the forge's check runs it.
Review fixes
forgestool:sizenow passes throughChildandclientRows(src/spawn/clients.ts) into the MCPforgesrows. The tool description now says "its size".- Spawn answer:
Spawnedcarriessize, so the REST and MCP answers both include it. The MCPsaysline now readsSpawned kid (medium) at ….sizeis also set when the answer is for a child that already existed. - MCP
spawninput: it already tooksizeand validated it through the shared door, so that is unchanged. - README: one short paragraph documents the field and its default, and says nothing enforces the limits yet.
Tests
- Added:
test/client-list.test.tsmakesloularge and asserts the MCPforgesrows showlouaslargeandmariaassmall.test/spawn-api.test.tsnow has a test for the spawn answer, list andparent.json, one for the MCPspawnanswer namingmedium, and one for the old-ledger fallback. - Own child, not shared: the old-ledger test uses its own child,
old-kid, instead of editing the sharedkidledger file. - Pinned key sets:
test/spawn-keys.test.tsandtest/spawn.test.ts(parent.json) and the forges-list shape intest/spawn-api.test.tsgainedsize.
src/web/ui.ts and src/web/pages/new-forge.ts are untouched. Nothing enforces the size limits yet.
To try it: POST /api/v1/forges {"name":"kid","apps":[],"size":"large","dryRun":false}, then read GET /api/v1/forges or call the MCP forges tool.
🤖 Generated with Claude Code
The check failed on a type error in test/tui-forges.test.ts, and I've fixed it and pushed. That test builds a ClientRow by hand, and ClientRow now has a required size. I added size: "small" to the test's row helper (89cbd210). This is the only change since the last push.
tsc --noEmit is clean, and test/tui-forges.test.ts passes (4 tests). I did not re-run the wider suites. bun x tsc printed bun is unable to write files to tempdir: ReadOnlyFileSystem here, but the type check still came back clean.
The rest of the pull is as in the previous description:
- A forge's size is written to the ledger and
parent.json. - It is shown by
GET /api/v1/forges, the spawn answer, and the MCPspawnandforgestools. - The README documents it.
🤖 Generated with Claude Code
Approved. This does what #3094 asks. The size goes into the ledger and parent.json, defaults to small, and a ledger row with no size reads as small. The spawn answer, GET /api/v1/forges and the MCP spawn and forges tools all report it. src/web/ui.ts and src/web/pages/new-forge.ts are unchanged, as the issue asks.
Security: the new field adds no input of its own. size comes in through the shared door and parseSize from #3097, and what comes out is a value from a closed set of three. Size is part of planHash, so a resume or repeat can't write a ledger size that differs from the parent.json size. Plans without a size still hash as they always did.
Tests: the pinned key sets (spawn-keys, spawn, the forges-list shape) gained size. New tests cover the large child across the answer, list and parent.json, the MCP spawn saying (medium), the MCP forges rows, and the old-ledger fallback, which uses its own child. At 89cbd210, spawn-api, client-list, spawn-keys, spawn, tui-forges and spawn-sizes give 44 pass, 0 fail.
The preview wasn't reachable from my sandbox. Nothing on a page changes here, so this verdict rests on the code and the tests.
For later, not this pull: neither /forges nor the tty forges card shows the size yet. When sizes are enforced, show them in both places together.
I merged main into the branch, resolved the conflicts, and pushed. The spawn tests pass (166 tests). I couldn't run the type check here because bun failed with "unable to write files to tempdir" and tsc isn't installed locally. I started the full bun test but it passed the 120s limit and I didn't wait for it. The forge's check on this push will be the first full run.
src/actions/spawn.ts:mainhad landed the same size field on the ledger and the list. I took its versions, so the list row now usesisSize(ledger.size) ? ledger.size : DEFAULT_SIZE. That reads a missing or malformed size assmall.src/spawn/sizes.ts: both sides had addedDEFAULT_SIZEandisSize, so the merged file declared them twice and every spawn suite failed to load. I tookmain's file.test/spawn-api.test.ts: I kept both sides' new tests.
I merged main into the branch and pushed it. The only conflict was the list_clients description in src/http/mcp.ts.
Main had shortened that description and my side had added the child's size to it. I kept main's shorter wording and added "size", so it now reads: "The forges you sent from here (an admin's list): name, address, whom for, apps, size, claimed or not, last activity."
I ran test/client-list.test.ts and the test/mcp*.test.ts files, and they pass (8 and 93 tests). I did not run the full bun test suite; the forge's check runs it on this push. tsc --noEmit failed with "Cannot find type definition file for 'bun'" even after the install, so the type check did not run here.
Parked by the crew: the check stayed red through 2 automatic tries
A made forge's size is now written to the ledger and to
parent.json, andGET /api/v1/forgeslists it for each forge.tsc --noEmitis clean and the spawn, mcp, client-list, family, everyday and stranger suites pass. I did not run the wholebun test, and one earlier run hit "bun is unable to write files to tempdir: ReadOnlyFileSystem".plan.size ?? DEFAULT_SIZEis stored, withDEFAULT_SIZE = "small"added tosrc/spawn/sizes.ts. A ledger row with no size reads assmall.spawn: this needed no change. It already tooksizethrough the shared door and plan validation from #3097, so a bad size is refused there the same way as over the API.test/spawn-keys.test.ts(the exact key set ofparent.json),test/spawn.test.ts(the fullparent.jsonrecord), andtest/spawn-api.test.ts(the exact shape of the forges list).test/spawn-api.test.ts, alargechild showslargein the list and in itsparent.json. A child made with no size showssmallin both, and a ledger row with the size deleted still readssmall.src/web/ui.tsandsrc/web/pages/new-forge.ts.forgestool, which reads the client list, does not show size.The code change is in
src/actions/spawn.tsandsrc/spawn/sizes.ts. To try it, sendPOST /api/v1/forgeswith{"name":"kid","apps":[],"size":"medium","dryRun":false}, then readGET /api/v1/forges.🤖 Generated with Claude Code
Closes #3094