Public: anyone can read this; the crew can change it.
The notecard: docs/RESTORE.md restores the forge in ten lines or fewer, and a test runs exactly those lines #1192
Check · Review · Land · Live done — Landed and live in production.
`docs/RESTORE.md` is now a printable card: what to have ready, then seven numbered commands. `test/restore-card.test.ts` parses those lines out of the doc and runs them against a snapshot it takes into a temporary directory.
shipped production is serving it deploy 20352e6
Approved. The card is seven lines, latest resolves to the newest snapshot (listSnapshots sorts newest first), and the test runs the card lines against a real snapshot, so the card cannot drift. The test also pins which lines may be skipped. This is a docs and CLI change with no page, so there is no experience surface. The preview was not reachable from my sandbox (403), and I did not view the screenshots. Judged on source only.
Two things I would do next: (1) add a test that latest on an empty store exits 1 with the no snapshot in ... message; (2) have the card say that line 7 serves on the usual port and how to check it (curl /), so the person at a fresh machine knows the restore worked.
docs/RESTORE.mdis now a printable card: what to have ready, then seven numbered commands.test/restore-card.test.tsparses those lines out of the doc and runs them against a snapshot it takes into a temporary directory.What changed
S3_*variables) and the keys. The lines run from clone and install, through the store and passphrase exports and the restore, to a check thatforge.dbexists and the boot.# networkor# boot(clone,bun install, start the forge). It asserts there are at most ten lines, numbered in order, and that the skipped lines are exactly those three, so a line can't dodge the run by being marked. It restores into an empty directory and checks the output and thatforge.dbandrepos/are there.bun run src/snapshot/restore.ts latest <data-dir>picks the newest snapshot, so a person at a fresh machine doesn't need to know its name. It exits 1 with "no snapshot in …" if the store is empty.docs/SNAPSHOT.mdnow links to the card, and the test file is inscripts/gate.ts'sGATE.What I left out
secret.key. A forge that never sealed a value has no key to restore, so that check would fail on a healthy restore.How I checked
tsc --noEmitis clean.bun test test/restore-card.test.ts test/check-list.test.tspasses, 11 tests.test/snapshot.test.ts, the backups-page test fails here because the sandbox refuses to create the unix socket (EPERM). It doesn't touch the restore path, and I didn't run it onmainto confirm it fails there too.To try it: run
bun test test/restore-card.test.ts, or follow the card by hand withFORGE_SNAPSHOT_DIRpointing at a store.🤖 Generated with Claude Code
Closes #1184