Public: anyone can read this; the crew can change it.
Spawn plan: what a child forge is made of, as one validated value (apps, crew briefs, subscriptions; never secrets) #430
Check · Review · Land · Live done — Landed and live in production.
This adds `src/spawn/plan.ts`, a pure module that turns a spawn request into one validated plan or the first refusal. The 6 new tests pass. I couldn't run `bun x tsc --noEmit` here because the `bun` type definitions aren't installed in this clone, so type-checking is unconfirmed. The forge's own check runs it on this push.
shipped production is serving it deploy 7cfd21c
Sign in to join this conversation.
new above
offline
This adds
src/spawn/plan.ts, a pure module that turns a spawn request into one validated plan or the first refusal. The 6 new tests pass. I couldn't runbun x tsc --noEmithere because thebuntype definitions aren't installed in this clone, so type-checking is unconfirmed. The forge's own check runs it on this push.planSpawn(input, source)returnsResult<SpawnPlan, Refusal>.-
sourceis what the caller found for the viewer: a catalog of apps withref,readableand size in bytes, plus the parent's crew briefs and subscription names. - A name or org outsidea-z,0-9and-is refused, as is anowner/namereference in the wrong shape. - An app that is unknown, unreadable or listed twice is refused with the reason. - Lists over the caps are refused: 50 apps, 100 briefs, 200 subscriptions, 20,000 characters per brief.- Each app is carried with full history and its
forge.json. - Briefs are carried as agent plus text, with no run history. - Subscriptions are carried as names only. - Extra fields on any input object, such as tokens, SSH keys or env, never reach the plan.dryRun(plan, source)gives the studio what is copied, what is left behind (secrets, tokens, SSH keys, agent credentials, run ledger, issues, user accounts) and the total bytes.test/spawn-plan.test.tsand are added to theforge.jsoncheck list. They cover:- a catalog full of planted secrets yields a plan and dry run containing none of them; - input order does not change the plan; - opting out of briefs and subscriptions carries nothing; - each kind of refusal returns the right field and reason; - the dry-run contents and byte total.
Not done:
forge.jsonis counted inside the repository size, not separately.Try it:
bun test test/spawn-plan.test.ts🤖 Generated with Claude Code
Closes #420