Public: anyone can read this; the crew can change it.

Spawn sizes: small, medium, large in the plan, the ledger and parent.json, with a quota #2978

Parked opened this
Closed without merging

Spawn sizes (small, medium, large) are in the plan, the ledger, parent.json, GET /api/v1/forges and the MCP spawn input. This push also fixes what I think made the last check fail. I couldn't reproduce that failure here, so the cause is a guess.

Notes

stopped parked by the crew deploy aa8231d

opened this

Spawn sizes (small, medium, large) are in the plan, the ledger, parent.json, GET /api/v1/forges and the MCP spawn input. This push also fixes what I think made the last check fail. I couldn't reproduce that failure here, so the cause is a guess. All 145 spawn tests pass locally. The type check printed only a tempdir write error from the sandbox, so I can't say it ran clean, and I did not run the whole suite.

What changed

  • spawn/sizes.ts holds the preset table and the quota. The quota comes from FORGE_CHILD_CPUS, FORGE_CHILD_MEMORY_MIB and FORGE_CHILD_DISK_MIB, with the machine's figures as defaults.
  • A spawn that would push the children past the quota is refused with one sentence (409 refused). room() checks it, so the form says so before anyone fills it in.
  • size is left out of the plan when it isn't given, so older plan hashes stay the same.
  • The web form and the terminal's new-forge screen both choose a size.

What I think broke the earlier check

  • The cause: the default quota came straight from the host's memory, CPUs and the free disk space where the data lives. On the check's smaller cell, that could be less than one small forge. Then even the first spawn was refused, and the plan page showed the refusal instead of the plan. That would explain why "the plan names the fresh app" failed.
  • The fix: the machine-derived default quota is now never below one small forge, so an empty host always has room for the default child. Values set through FORGE_CHILD_* are still honoured exactly, so an operator can set a lower quota. A new test covers it.

Left out

  • Nothing enforces the declared resources on a running child; size is recorded and counted against the quota only.
  • The web form always posts a size, so every plan made through it carries small unless another is chosen. Only plans made without a size (API, MCP) stay hash-identical to the old ones.

Try it

  • Open /forges/new and pick a size.
  • Set FORGE_CHILD_CPUS=1 and choose large. You get the one-sentence refusal.
  • Run bun test test/spawn.

🤖 Generated with Claude Code

Closes #2925

commented

Spawn sizes (small, medium, large) are in the plan, the ledger, parent.json, GET /api/v1/forges and the MCP spawn input. This push also fixes what I think made the last check fail. I couldn't reproduce that failure here, so the cause is a guess. All 145 spawn tests pass locally. The type check printed only a tempdir write error from the sandbox, so I can't say it ran clean, and I did not run the whole suite.

What changed

  • spawn/sizes.ts holds the preset table and the quota. The quota comes from FORGE_CHILD_CPUS, FORGE_CHILD_MEMORY_MIB and FORGE_CHILD_DISK_MIB, with the machine's figures as defaults.
  • A spawn that would push the children past the quota is refused with one sentence (409 refused). room() checks it, so the form says so before anyone fills it in.
  • size is left out of the plan when it isn't given, so older plan hashes stay the same.
  • The web form and the terminal's new-forge screen both choose a size.

What I think broke the earlier check

  • The cause: the default quota came straight from the host's memory, CPUs and the free disk space where the data lives. On the check's smaller cell, that could be less than one small forge. Then even the first spawn was refused, and the plan page showed the refusal instead of the plan. That would explain why "the plan names the fresh app" failed.
  • The fix: the machine-derived default quota is now never below one small forge, so an empty host always has room for the default child. Values set through FORGE_CHILD_* are still honoured exactly, so an operator can set a lower quota. A new test covers it.

Left out

  • Nothing enforces the declared resources on a running child; size is recorded and counted against the quota only.
  • The web form always posts a size, so every plan made through it carries small unless another is chosen. Only plans made without a size (API, MCP) stay hash-identical to the old ones.

Try it

  • Open /forges/new and pick a size.
  • Set FORGE_CHILD_CPUS=1 and choose large. You get the one-sentence refusal.
  • Run bun test test/spawn.

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("+ New forge > an error is shown beside the field that caused it") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs