Public: anyone can read this; the crew can change it.

Recovery you can print on a notecard: a restore drill from a real snapshot every week, the passphrase carried, the snapshot store off the box, and the runbook short enough for a safe #1941

Parked opened this in answer to
Closed without merging

This pull covers the notecard, the drill's counts and the Backups page's recoverable line. It leaves out the off-box store, the mirror-age and stale-snapshot alerts, the weekly scheduler and the standby backup lane. The type check is clean.

Notes

stopped parked by the crew deploy b883d0d

opened this

This pull covers the notecard, the drill's counts and the Backups page's recoverable line. It leaves out the off-box store, the mirror-age and stale-snapshot alerts, the weekly scheduler and the standby backup lane. The type check is clean. The 79 covering tests I ran give 77 passes and 2 failures, and the same 2 fail on main. I did not get a full bun test result, because the full suite ran past the 10-minute limit.

What changed

  • docs/RECOVERY.md is now the one-page notecard: the five commands that bring a forge back from nothing, and where the passphrase and bucket credentials live.
  • test/recovery-doc.test.ts reads the doc and checks that those commands are the ones the drill runs, so the card can't drift from the drill.
  • The drill in src/snapshot/drill.ts and src/snapshot/drills.ts now returns counts of users, pulls and apps, alongside the existing ones. A stamped migration (20261014000000-what-a-drill-counted.ts) records them.
  • src/snapshot/recoverable.ts and src/snapshot/standing.ts produce a single "recoverable now" line: store reachable, newest snapshot age, key carried, last drill result. The Backups page shows it. Before any drill has run, the line says so calmly rather than raising an alarm.
  • forge recovery in the terminal prints that line, admin-gated, through new routes in src/http/api.ts and src/cli/.
  • New tests: drill-counts, recoverable and recovery-terminal, plus the extended recovery-doc and the Backups page test.

The two failing tests

  • Both are in test/snapshot-destination.test.ts: the failed test-connection one and the "snapshot is being taken" page one.
  • They fail the same way on main. The sandbox denies the loopback connection to port 1 that they rely on, so I treated them as a sandbox limit, not a regression. The forge's own check will show whether they pass there.

Left out

  • Moving the snapshot store off the box, or mirroring it. That is configuration on the operator's side.
  • The alert on a missed snapshot or a stale mirror.
  • The scheduler that runs the drill every week, and the standby backup lane in the operator's repository.
  • The manual tarball path from the issue's comments is not on the card yet.

Try it

  • Run bun test test/recovery-doc.test.ts test/recoverable.test.ts test/drill-counts.test.ts test/recovery-terminal.test.ts.
  • Open /backups to see the recoverable line, or run forge recovery in the terminal.

🤖 Generated with Claude Code

Closes #1147

commented

Parked by the crew: the check failed ("/boards > a panel keeps its chart and series: chosen in the form, saved in the file, drawn on the board") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs