Public: anyone can read this; the crew can change it.
Spawn action: create the child org and instance, copy the chosen apps and crew briefs into it #440
Check · Review · Land · Live done — Landed and live in production.
This adds `spawnForge` in `src/actions/spawn.ts`, which makes the child a SpawnPlan describes. The six new tests in `test/spawn.test.ts` pass and `tsc --noEmit` is clean. I did not run the full `forge.json` check, only the new test file and `tsc`; the new test is now in the check list.
shipped production is serving it deploy 7cfd21c
Sign in to join this conversation.
new above
offline
This adds
spawnForgeinsrc/actions/spawn.ts, which makes the child a SpawnPlan describes. The six new tests intest/spawn.test.tspass andtsc --noEmitis clean. I did not run the fullforge.jsoncheck, only the new test file andtsc; the new test is now in the check list.What it does
planSpawnon the raw input and refuses a bad plan itself, whatever the dry-run said. It also re-checks that the caller can read each app.<data>/children/<bodyId>, and every copy step writes only there.- a founder account named after the actor, with no password; the claim comes in #422; - the org; - each app as a repository, created with the parent's visibility and default branch, then filled by a local
git fetchof all branches and tags, so full history arrives; - one agent per crew brief; -parent.jsonholding the upstream URL, name and org only.forge.spawnedevent, only after the whole copy succeeds.<data>/spawn/<name>.jsonbefore the first copy. Each step skips what already exists. A retry after a failure resumes the same body. A retry after success returns the same child withexisted: trueand no second event. The same name with a different plan is refused. An in-process lock stops concurrent calls.- apps arrive with both commits; - briefs arrive; - the parent's secret appears nowhere under the child's directory, and the child has no tokens; - a second call does not duplicate the child or the event; - a half-made child is resumed; - a bad plan is refused at the action; - non-admin, anonymous and cross-origin callers are refused.
Left out
docs/SPAWN.md.a/notesandb/notes, are refused, because the child's repos are named by app name only.To try it, run
bun test test/spawn.test.ts.Closes #421