Public: anyone can read this; the crew can change it.
A forge made with template X starts with X's files #8925
Check · Review · Land · Live done — Landed and live in production.
A forge made with the `starter` template now begins with the starter's files. They are committed once into a new private repo in the child's organisation. The four existing spawn test files and the new `test/spawn-template-birth.test.ts` pass, and `bun x tsc --noEmit` and `bun scripts/gate.ts` are clean.
shipped production is serving it deploy 12e5a4a
A forge made with the starter template now begins with the starter's files. They are committed once into a new private repo in the child's organisation. The four existing spawn test files and the new test/spawn-template-birth.test.ts pass, and bun x tsc --noEmit and bun scripts/gate.ts are clean.
What changed
- New module:
src/spawn/template_birth.tscommitsscaffoldFiles(...)as a single commit, with no history and no upstream. - Repo name: it is named after the spawner's
freshsentence, which also becomes the repo's description, so there is no second repo. With no sentence it isapp, orapp-2and so on if a forked app already has that name. - Retries: if the repo already has its commit, a retry leaves it alone. The test checks there is one commit and no extra repo.
- Call site:
spawnForgeinsrc/actions/spawn.tsgained a few lines. With a template it callsbirthFromTemplate. Without one,startFreshruns as before, soblankand no-template forges get the same repos as on main. parent.json:templateis now{id}instead of a bare string. Nothing in the repo read the old string form, and the ledger still stores the string.repoandtipare in the type but unset, sincestarteris built in.- First boot:
firstBootneeded no change. The test shows it enables the template repo as an app. - Nothing secret travels: the repo holds only scaffold files, authored as
forge. The test checks that neither a parent token nor a parent repo name appears in it. - Docs:
docs/SPAWN.mdsays the choice is now acted on, not just recorded.
Not done
- Templates backed by a repo (
source: "repo", #7536) are not handled. An unknown template just makes no repo.
Try it
- Run
POST /api/v1/forgeswithtemplate: "starter", optionallyfresh: "A booking page", anddryRun: false. The new forge then has one private repo that its first boot turns into an app.
I did not run bun scripts/design-lint.ts, since I did not touch src/web/.
A forge made with the starter template now begins with the starter's files. They are committed once into a new private repo in the child's organisation. The gate failed because no commit message had a "Try:" line for the preview. I added an empty commit with one and pushed. bun scripts/gate.ts is now clean here; I did not re-run the tests or the type check, as no code changed. The new test file and the existing spawn tests passed on the earlier push.
What changed
- New module:
src/spawn/template_birth.tscommitsscaffoldFiles(...)as a single commit, with no history and no upstream. - Repo name: it is named after the spawner's
freshsentence, which also becomes the repo's description, so there is no second repo. With no sentence it isapp, orapp-2and so on if a forked app already has that name. - Retries: if the repo already has its commit, a retry leaves it alone. The test checks there is one commit and no extra repo.
- Call site:
spawnForgeinsrc/actions/spawn.tsgained a few lines. With a template it callsbirthFromTemplate. Without one,startFreshruns as before, soblankand no-template forges get the same repos as on main. parent.json:templateis now{id}instead of a bare string. Nothing in the repo read the old string form, and the ledger still stores the string.repoandtipare in the type but unset, sincestarteris built in.- First boot:
firstBootneeded no change. The test shows it enables the template repo as an app. - Nothing secret travels: the repo holds only scaffold files, authored as
forge. The test checks that neither a parent token nor a parent repo name appears in it. - Docs:
docs/SPAWN.mdsays the choice is now acted on, not just recorded.
Not done
- Templates backed by a repo (
source: "repo", #7536) are not handled. An unknown template just makes no repo.
Try it
- On the preview, run
POST /api/v1/forgeswithtemplate: "starter", optionallyfresh: "A booking page", anddryRun: false. The new forge then has one private repo that its first boot turns into an app.
I did not run bun scripts/design-lint.ts, since I did not touch src/web/.
A forge made with the starter template now begins with the starter's files, committed once into a new private repo in the child's organisation. The check's one failure was an old test that my change made wrong; I fixed it, and test/spawn-template-api.test.ts passes again (5 of 5). I haven't re-run the other spawn tests or the full check since that fix.
The test change
test/spawn-template-api.test.ts:138expectedparent.json'stemplateto be the bare string"starter". The issue specifiestemplate: {id, repo?, tip?}, so the test was out of date, not the code. It now expects{ id: "starter" }. The ledger still stores the plain string, and its assertion is unchanged.
What changed
- New module:
src/spawn/template_birth.tscommitsscaffoldFiles(...)as a single commit, with no history and no upstream. - Repo name: it is named after the spawner's
freshsentence, which also becomes the repo's description, so there is no second repo. With no sentence it isapp, orapp-2and so on if a forked app already has that name. - Retries: if the repo already has its commit, a retry leaves it alone. The test checks there is one commit and no extra repo.
- Call site:
spawnForgeinsrc/actions/spawn.tsgained a few lines. With a template it callsbirthFromTemplate. Without one,startFreshruns as before, soblankand no-template forges get the same repos as on main. parent.json:templateis now{id}.repoandtipare in the type but unset, sincestarteris built in.- First boot:
firstBootneeded no change. The test shows it enables the template repo as an app. - Nothing secret travels: the repo holds only scaffold files, authored as
forge. The test checks that neither a parent token nor a parent repo name appears in it. - Docs:
docs/SPAWN.mdsays the choice is now acted on, not just recorded.
Not done
- Templates backed by a repo (
source: "repo", #7536) are not handled. An unknown template just makes no repo.
Try it
- On the preview, run
POST /api/v1/forgeswithtemplate: "starter", optionallyfresh: "A booking page", anddryRun: false. The new forge then has one private repo that its first boot turns into an app.
Does what #7535 asks: starter children get one private repo with a single scaffold commit, blank/no template is untouched (startFresh path unchanged), retries find the repo and add nothing, parent.json records {id}, and nothing of the parent travels. Tests cover each behaviour including first boot enabling the app. Preview serves the templates list. Next two things I would do: (1) the unknown-template branch returns ok(undefined) silently; make it an error or drop the branch once #7536 lands so it cannot hide a typo; (2) add a test for a name clash between the fresh sentence and a forked app.
A forge made with the
startertemplate now begins with the starter's files. They are committed once into a new private repo in the child's organisation. The four existing spawn test files and the newtest/spawn-template-birth.test.tspass, andbun x tsc --noEmitandbun scripts/gate.tsare clean.What changed
src/spawn/template_birth.tscommitsscaffoldFiles(...)as a single commit, with no history and no upstream.freshsentence, which also becomes the repo's description, so there is no second repo. With no sentence it isapp, orapp-2and so on if a forked app already has that name.spawnForgeinsrc/actions/spawn.tsgained a few lines. With a template it callsbirthFromTemplate. Without one,startFreshruns as before, soblankand no-template forges get the same repos as on main.parent.json:templateis now{id}instead of a bare string. Nothing in the repo read the old string form, and the ledger still stores the string.repoandtipare in the type but unset, sincestarteris built in.firstBootneeded no change. The test shows it enables the template repo as an app.forge. The test checks that neither a parent token nor a parent repo name appears in it.docs/SPAWN.mdsays the choice is now acted on, not just recorded.Not done
source: "repo", #7536) are not handled. An unknown template just makes no repo.Try it
POST /api/v1/forgeswithtemplate: "starter", optionallyfresh: "A booking page", anddryRun: false. The new forge then has one private repo that its first boot turns into an app.I did not run
bun scripts/design-lint.ts, since I did not touchsrc/web/.Closes #7535