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

The docs and the spawn tool's own words stop saying a forge's size "limits nothing": they say what the cell is given #15306

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The docs and the MCP spawn tool no longer say a forge's size "limits nothing"; they now say what the cell is given. test/mcp-size.test.ts and the new test pass, and tsc is clean. scripts/gate.ts --fix printed nothing and changed no files.

Notes

shipped production is serving it deploy b0d7e95

opened this

The docs and the MCP spawn tool no longer say a forge's size "limits nothing"; they now say what the cell is given. test/mcp-size.test.ts and the new test pass, and tsc is clean. scripts/gate.ts --fix printed nothing and changed no files. I did not run any other tests, nor scripts/design-lint.ts (no src/web/ change).

What the code enforces today

  • Memory, CPU and disk: src/spawn/cell.ts gives the child's cell its size's CPU, memory and disk from src/spawn/sizes.ts. Memory is a cap the kernel holds. CPU is a quota on the cell's cores. Disk is a file-size limit plus a watch that stops a child whose data passes its size.
  • Disk bandwidth: SIZE_IO also holds reads and writes per second by size.
  • Host quota: src/actions/spawn.ts refuses a spawn when quotaRefusal finds the size would pass a host child quota the operator declared, and no quota is applied when none is declared.
  • Not enforced: a hosted child, which has no cell, is not held to these limits. The table's figures are provisional.

What changed

  • docs/SPAWN.md: the POST /api/v1/forges and size paragraphs now say this. They also now list xlarge, which the code already accepted.
  • docs/MCP.md: the spawn.size line says the same.
  • MCP spawn tool: the size description is "The cell's CPU, memory, disk; see sizes." It stays under the 60-byte argument limit.
  • sizes tool, src/http/api/forges.ts and the terminal form hint: none of them repeated the old claim, so they are unchanged.
  • test/size-words.test.ts: new. It reads the docs, the API file, the terminal screen and both tool definitions, and fails if any says size is unenforced, "limits nothing" or "recorded only". It also checks that cell.ts still applies cellLimits(input.size) and that the spawn action still calls quotaRefusal. It fails against the old docs.

What I left alone: no tool added and no ceiling raised.

The forge's pre-push hook asked for a commit with a "Try:" line, so there is an empty commit carrying one. To try it, run bun test test/size-words.test.ts test/mcp-size.test.ts, or read the size paragraphs in docs/SPAWN.md.

Closes #15304

commented

The docs and the MCP spawn tool no longer say a forge's size "limits nothing"; they now say what the cell is given. test/mcp-size.test.ts and the new test pass, and tsc is clean. scripts/gate.ts --fix printed nothing and changed no files. I did not run any other tests, nor scripts/design-lint.ts (no src/web/ change).

What the code enforces today

  • Memory, CPU and disk: src/spawn/cell.ts gives the child's cell its size's CPU, memory and disk from src/spawn/sizes.ts. Memory is a cap the kernel holds. CPU is a quota on the cell's cores. Disk is a file-size limit plus a watch that stops a child whose data passes its size.
  • Disk bandwidth: SIZE_IO also holds reads and writes per second by size.
  • Host quota: src/actions/spawn.ts refuses a spawn when quotaRefusal finds the size would pass a host child quota the operator declared, and no quota is applied when none is declared.
  • Not enforced: a hosted child, which has no cell, is not held to these limits. The table's figures are provisional.

What changed

  • docs/SPAWN.md: the POST /api/v1/forges and size paragraphs now say this. They also now list xlarge, which the code already accepted.
  • docs/MCP.md: the spawn.size line says the same.
  • MCP spawn tool: the size description is "The cell's CPU, memory, disk; see sizes." It stays under the 60-byte argument limit.
  • sizes tool, src/http/api/forges.ts and the terminal form hint: none of them repeated the old claim, so they are unchanged.
  • test/size-words.test.ts: new. It reads the docs, the API file, the terminal screen and both tool definitions, and fails if any says size is unenforced, "limits nothing" or "recorded only". It also checks that cell.ts still applies cellLimits(input.size) and that the spawn action still calls quotaRefusal. It fails against the old docs.

What I left alone: no tool added and no ceiling raised.

The forge's pre-push hook asked for a commit with a "Try:" line, so there is an empty commit carrying one. To try it, run bun test test/size-words.test.ts test/mcp-size.test.ts, or read the size paragraphs in docs/SPAWN.md.

commented

The "both doors" check failed because this pull touched the MCP spawn tool but nothing under src/tui/. I've pushed a fix: the terminal's New forge size hint in src/tui/screens/newforge.ts now says what the cell is given. It reads "small (default), medium, large or xlarge: the cell gets that CPU, memory and disk. Left and right choose."

scripts/gate.ts now passes, and tsc is clean. The five test files covering the terminal form, the size words and the MCP size ceilings pass: test/tui-newforge-size.test.ts, test/tui-newforge.test.ts, test/new-forge-language.test.ts, test/size-words.test.ts and test/mcp-size.test.ts. scripts/fast.ts named 3,311 test files, too many to run here, so I ran only those five. The forge's full check on this push is the remaining test of everything else.

Pull description

The docs, the MCP spawn tool and the terminal's New forge size hint stop saying a forge's size "limits nothing". They say what the cell is given.

What the code does. src/spawn/cell.ts gives the child's cell its size's CPU, memory and disk from src/spawn/sizes.ts:

  • Memory: a cap the kernel holds.
  • CPU: a quota on the cell's cores.
  • Disk: a file-size limit plus a watch that stops a child whose data passes its size.
  • Disk bandwidth: reads and writes per second, held by size.
  • Host quota: src/actions/spawn.ts refuses a spawn that would pass a host child quota the operator declared.

Still only recorded or unenforced: a hosted child has no cell, so these limits don't apply to it. The table's figures are provisional.

What changed

  • docs/SPAWN.md (the POST /api/v1/forges and size paragraphs) and docs/MCP.md (spawn.size) say the above. They also now list xlarge, which the code already accepted.
  • The spawn tool's size description is "The cell's CPU, memory, disk; see sizes." It stays under the 60-byte argument limit.
  • The terminal hint in src/tui/screens/newforge.ts says the same.
  • test/size-words.test.ts is new. It reads the docs, the API file, the terminal screen and both tool definitions, and fails if any says size is unenforced, "limits nothing" or "recorded only". It also checks that cell.ts still applies cellLimits(input.size) and that the spawn action still calls quotaRefusal. It fails against the old docs.
  • The sizes tool and src/http/api/forges.ts never repeated the old claim, so they are unchanged.

Not done: no tool added, no ceiling raised, no limit changed.

To try it: run bun test test/size-words.test.ts test/mcp-size.test.ts, or open GET /api/v1/forges/sizes and the New forge screen in the terminal. One commit is an empty "Try:" commit the forge's pre-push hook required.

🤖 Generated with Claude Code

Approved

Clean. Docs, spawn tool description and TUI hint now say what the cell is given; the claims match cell.ts (cellLimits, SIZE_IO) and quotaRefusal. xlarge added to docs. The new test reads sources, fails on the old words, and also pins the cell facts. No tool added, no ceiling raised. Note: docs/SPAWN.md says contain.ts enforces disk/CPU; I only spot-checked cell.ts and sizes.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs