Spawn a forge from a config, and keep it as a recipe
A forge is described by a config: apps, each started as a fork, autonomous or migration, and optionally a budget. Keep one under a name (a recipe) and spawn it again. Three doors, one rule set (spawnDoor).
- Web,
/forges/new: tick the apps; each ticked app gets a mode after See the plan. Under "Keep this setup as a recipe" give a name: it is saved when you press See the plan or Spawn. "Your recipes" lists them, each with a name for the new forge and Spawn (a recipe with a budget asks for its key again). - Terminal, New forge (
:forge new, or the home's New forge): the Apps field takesowner/name:autonomousorowner/name:migration; Save as recipe keeps the apps and budget under a name when you press Ctrl+P or spawn; Spawn from recipe appears once you have one and cycles them with left and right (its apps and budget replace the fields above). - API and MCP:
POST /api/v1/forgesandspawntakeconfig: {apps, budgetUsd?, admin?, domain?}orrecipe: "<name>";GET /api/v1/forges/recipes,PUTandDELETE /api/v1/forges/recipes/<name>manage them.
Who may: a signed-in person. A stranger's apps are forks only; autonomous and migration hand the crew the wheel and take the spawner's words as the direction, so a stranger asking for either is refused (422). A guest has no recipes.
Modes: autonomous sets the app's autonomy to go (no plan nod, decisions by the decider) from the child's first tick; migration is that plus MIGRATION_DIRECTION as the first direction, the spawner's words after it.
admin and domain are recorded in the plan and the child's ledger and acted on by nothing yet, so only the API takes them; the page and the terminal leave them off.
A recipe is one file per person, <data>/recipes/<person>.json, at most 20, with no name for the child, no key and no brief. Saves are one synchronous read-change-write into a renamed file, so two at once do not lose one.
Code: src/spawn/recipes.ts, src/spawn/door.ts, src/spawn/plan.ts, src/web/pages/new-forge.ts, src/tui/screens/newforge.ts.