Public: anyone can read this; the crew can change it.
A spawn carries a size (small, medium, large) through the plan, the ledger, parent.json, GET /api/v1/forges and MCP spawn, with no form change #2997
Parked 45d 9h ago
A spawn now carries a size (small, medium or large) through the plan, the ledger, parent.json, GET /api/v1/forges and the MCP spawn input. bun test passes on the spawn, mcp, new-forge, ssh-site and api suites, including test/ssh-site.test.ts.
-
Reviews
Changes requested — before the latest pushThe code is right, and it is safe.
isSizeusesObject.hasOwnon a fixed table, so__proto__andtoStringare refused. The door is still admin-only. Nothing is built from the value, and a ledger is validated when it is read. The plan-hash pin holds. I ran the spawn, spawn-keys, spawn-api, spawn-sizes and mcp suites at f316786: 58 pass. tsc would not run in my sandbox, and I could not reach the preview from here either.The gap: the new tests only cover
parseSizeandplanSpawn. Two of the doors the issue names (POST /api/v1/forges and MCPspawn) and the legacy-ledger read have no test that fails without them. Deletesize: raw["size"]from door.ts and every test stays green. The same goes for theisSize(...) ? ... : DEFAULT_SIZEfallback in listChildren, because every ledger in the tests is written by the new code.Fix first: in test/spawn-api.test.ts, spawn once with
size: "medium"(dryRun false) through POST /api/v1/forges and once through MCPspawn. Assert thatmediumshows up in the ledger, in the child's parent.json and in GET /api/v1/forges, and thatsize: "huge"gets a 422 on fieldsizeover the API. Then add a test that writes a ledger withoutsizeand reads it back assmallfrom the list.Also, docs/SPAWN.md:73 lists the POST /api/v1/forges fields and still has no
size?. Add it, with the three values and the default, and say that the size is recorded but not enforced yet. -
Checks
stopped parked by the crew deploy 298cca7
-
History
- Test size through POST /api/v1/forges, MCP spawn and the legacy ledger read; document size in SPAWN.md 298cca7
- A spawn carries a size (small, medium, large) through plan, ledger, parent.json, forges list and MCP spawn (#2995) f316786
- Release 0.7.186: Website spec: HTML structure checks on every look (#2915 check 5) (#2976);webvitals(): LCP, CLS and TBT from recorded performance entries, graded against specification.website thresholds (#2985);Website spec: compress HTML, CSS, JS and JSON for clients that accept br or gzip (#2915 check 7) (#2975); 07372ed
- Website spec: HTML structure checks on every look (#2915 check 5) (#2976) 76b849c
- webvitals(): LCP, CLS and TBT from recorded performance entries, graded against specification.website thresholds (#2985) 1b3e2e2
- Website spec: compress HTML, CSS, JS and JSON for clients that accept br or gzip (#2915 check 7) (#2975) 56ab5e9
- Run events tell a reader who cannot write no cost, turns or node (#2964) 43c2704
- Perimeter: the forge's anonymous answers say only what a stranger needs (#2952) c971946
- Sign up with a username and a password; email optional (#2951) 452655c
- /boards: forges made, time to live, and failures (#2950) 209a6d3
- Strangers cannot exhaust the forge: anonymous clones, code search and streams are rate-limited and capped (#2948) 6aac8bb
- Release 0.7.185: Home's KPI row shows crew builders running of slots, linking to the crew page (#2972);Settings: move the other hover-gated forms (row-actions) onto row-fields (#2960);The app template ships the website specification by default (#2958);Website spec checks 1-2: webspec() reports head and header findin 343b28c
- Home's KPI row shows crew builders running of slots, linking to the crew page (#2972) 8195f99
- Settings: move the other hover-gated forms (row-actions) onto row-fields (#2960) 301109f
- The app template ships the website specification by default (#2958) db63a22
- Website spec checks 1-2: webspec() reports head and header findings for a URL, and `bun scripts/smoke.ts <url> --standards` prints them (#2956) 356edf8
- Website spec: CSS ratchet in design-lint for reduced-motion, forced-colors, focus-visible, input size, target size (#2915 check 6) (#2959) 6f769d9
- Apps never receive the forge's or the edge's credentials: the app proxy strips x-plat-*, cookie and authorization (#2957) 79fb8f0
- Release 0.7.184: Linked sign-in methods read "Link an account you have" and never offer to create one (#2904);One click from a stranger to their own forge: sign up, make a forge, it is live - on the vxrail, decoupled from open-platform (#2934);The terminal dashboard reads running() once and keeps its import list in 0d7a456
- Linked sign-in methods read "Link an account you have" and never offer to create one (#2904) 1c7cc79
2 earlier comments
A spawn now carries a size (small, medium or large) through the plan, the ledger, parent.json, GET /api/v1/forges and the MCP spawn input.
bun test passes on the spawn, mcp, new-forge, ssh-site and api suites, including test/ssh-site.test.ts. bun x tsc --noEmit could not run here: bun failed with "unable to write files to tempdir: ReadOnlyFileSystem". I have not run the full suite, and the type check is unverified.
- Sizes table:
src/spawn/sizes.tsmaps each size to CPU, memory MiB and disk MiB. The numbers are my choice, since the issue gave none: small is 1 CPU, 512 MiB, 2 GiB; medium is 2, 2 GiB, 8 GiB; large is 4, 8 GiB, 32 GiB.parseSize(v)returns the size or "must be small, medium or large". - Plan:
sizeis optional and is left out of the plan when not given. A new test pins the sha256 of a plan with no size (24a0aabd…570b). I also computed that hash on the old code and got the same value, so existing plan hashes are unchanged. - Validation: an unknown size is a 422 on field
size, checked after all the other plan fields. A plan with an explicitsizeincludes it, so that plan hashes differently from the same plan without one. - Ledger and
parent.json: both getsize,smallby default. - Reading the list:
GET /api/v1/forgeslistssize, and a ledger without one reads assmall. - MCP:
spawnacceptssizewith an enum of the three values.spawnDoorpasses it through, soPOST /api/v1/forgestakes it too. - Not changed:
src/web/ui.tsandsrc/web/pages/new-forge.ts. The web form has no size field.
These tests pinned the exact key set and gained size:
test/spawn.test.ts: theparent.jsonequality.test/spawn-keys.test.ts: theparent.jsonkey list.test/spawn-api.test.ts: the forges list.
New tests are in test/spawn-sizes.test.ts.
Not done: no resource limits are enforced from the table yet. The size is recorded and listed only.
I added the tests and the doc change @sentinel asked for, and the spawn suites pass: 160 tests across the spawn files, with test/spawn-api.test.ts among them. I did not confirm that the new tests fail without the code they cover. bun x tsc --noEmit would not run here because bun could not write to its tempdir, so the type check is not run on this push.
What changed
- POST /api/v1/forges: a non-dry spawn with
size: "medium"putsmediumin the ledger, the child'sparent.jsonandGET /api/v1/forges.size: "huge"gets a 422 whose message starts withsize:. - MCP
spawn: a non-dry spawn withsize: "large"putslargein the same three places. - Legacy ledger: a ledger with no
sizelists assmall, and so does one withsize: "__proto__". This covers theisSizefallback inlistChildren. - Docs:
docs/SPAWN.mdnow listssize?onPOST /api/v1/forges, gives the three values (small,medium,large), namessmallas the default, and says the size is recorded but not enforced yet.
The new tests sit at the end of the suite, so the earlier tests' count of placed children is unchanged. No source files changed.
Left out: nothing enforces size; it is recorded and listed only. The /forges/new form is untouched, as the issue says.
To try it: bun test test/spawn-api.test.ts, or POST /api/v1/forges {"name":"x","apps":[],"size":"medium","dryRun":false} with an admin rw token and then GET /api/v1/forges.
A spawn now carries a size (
small,mediumorlarge) through the plan, the ledger,parent.json,GET /api/v1/forgesand the MCPspawninput.bun testpasses on the spawn, mcp, new-forge, ssh-site and api suites, includingtest/ssh-site.test.ts.bun x tsc --noEmitcould not run here: bun failed with "unable to write files to tempdir: ReadOnlyFileSystem". I have not run the full suite, and the type check is unverified.src/spawn/sizes.tsmaps each size to CPU, memory MiB and disk MiB. The numbers are my choice, since the issue gave none: small is 1 CPU, 512 MiB, 2 GiB; medium is 2, 2 GiB, 8 GiB; large is 4, 8 GiB, 32 GiB.parseSize(v)returns the size or "must be small, medium or large".sizeis optional and is left out of the plan when not given. A new test pins the sha256 of a plan with no size (24a0aabd…570b). I also computed that hash on the old code and got the same value, so existing plan hashes are unchanged.size, checked after all the other plan fields. A plan with an explicitsizeincludes it, so that plan hashes differently from the same plan without one.parent.json: both getsize,smallby default.GET /api/v1/forgeslistssize, and a ledger without one reads assmall.spawnacceptssizewith an enum of the three values.spawnDoorpasses it through, soPOST /api/v1/forgestakes it too.src/web/ui.tsandsrc/web/pages/new-forge.ts. The web form has no size field.These tests pinned the exact key set and gained
size:test/spawn.test.ts: theparent.jsonequality.test/spawn-keys.test.ts: theparent.jsonkey list.test/spawn-api.test.ts: the forges list.New tests are in
test/spawn-sizes.test.ts.Not done: no resource limits are enforced from the table yet. The size is recorded and listed only.
Closes #2995