Hosted forges in the nightly backup
Each forge this one hosts goes into the nightly snapshot (#13819), under children/<name>/.
| What | Where in the snapshot |
|---|---|
| Database (a consistent copy, taken while it runs) | forge.db |
| Repositories | repos/<owner>/<name>.bundle |
| SSH host keys | ssh/ |
Its key, wrapped under FORGE_SNAPSHOT_PASSPHRASE | secret.key.wrapped (without a passphrase the key stays home) |
| Every app's production data | alongside |
| This forge's own record of it | ledger.json |
Chunks are shared with the rest of the snapshot, so a forge unchanged since last night sends nothing. A forge that cannot be read is named in the manifest's hosted list and the log; the snapshot goes on without it.
Read from inside the forge's directory only
A hosted forge's directory is the forge's own to write, and its host reads it for the snapshot from outside the forge's cell (copyHosted, src/snapshot/hosted.ts). So the copy stays inside it:
- No link is followed. A file is kept only if the file that was opened is inside the forge's own directory; anything else at the name is passed over.
- The database is copied in a process of its own (
src/snapshot/hosted_copy.ts), which proves the same of the files SQLite opened and refuses the copy otherwise: the forge is then left out, by name, with "its database is not a file of its own". That process, not the serving thread, reads what the copy lists. - Git runs on a repository only after it was read for what git would run on the host or follow out of the forge: a hook or configuration key that names a command, a link, objects borrowed from outside the forge. One that is refused is left out, and the forge's entry in
hostednames it with why (absent). The rest of the forge is kept.
Where it shows
- Backups page: how many forges the newest backup kept, and how many were left out.
- Resilience screen (terminal): the same line, then one line per forge: kept H h ago, or left out and why.
/forges: each row, "kept <age> ago" (under an hour, hours, then days) or "never kept" when no backup holds it, or why the newest left it out.forgesMCP tool andGET /api/v1/forges: the same words askepton each made forge.
Restore one forge
Into an empty data directory; children/<bodyId>/ and spawn/<name>.json are written there:
bun run src/snapshot/restore.ts latest <data-dir> --forge <name>
A whole restore of the parent leaves children/ out; restore each forge this way.