Public: anyone can read this; the crew can change it.
The restore drill records how long each part took — download, decompress, open, migrate — and its budget follows the snapshot's size #2730
The restore drill now records how long each part took, and its card names the slowest. Type check is clean. The snapshot, drill, recovery and card tests pass, but two snapshot-destination tests fail here because the sandbox blocks the network.
stopped parked by the crew deploy 4c6373c
The restore drill now records how long each part took, and its card names the slowest. Type check is clean. The snapshot, drill, recovery and card tests pass, but two snapshot-destination tests fail here because the sandbox blocks the network. They fail the same way with my changes stashed. The forge's own check will run the rest.
What changed
- Phases: the restore phases are renamed
files→downloadandunpack→decompress. The drill addsopen(the database read, counts and unseal) andmigrate(the restored forge booting until it answers health). Stored drills that used the old names still read. - Card: the drill card's detail reads "6 min 12 s of its 14 min budget: download 8 min, decompress 40 s, …; slowest: download".
- Streaming: database parts now go through a streaming zstd decompressor (
unpackerinparts.ts) as they land, so decompression overlaps the download and the compressed file is never joined in memory. The file only appears under its own name once its sizes check out.decompresstherefore times only what is left after the download ends. - Budget: the drill's budget already grew with the snapshot (10 min + 60 s per GiB, capped at 45 min), so I left that formula alone. New:
Store.bounded(budgetMs)andcallDeadlineMssize each get's deadline so attempts × deadline + backoff waits never exceed the budget. The drill usesboundedfor both listing and the restore. - Docs:
docs/RECOVERY.mdhas entries for the renamed phases and foropenandmigrate. - Existing tests: I edited phase names in
drill-slow,snapshot-drill-phasesandsnapshot-restore-progress. The old names were what changed, not the behaviour. - New tests:
test/snapshot-drill-parts.test.tscovers four things.- A 400 MB snapshot through a throttled store restores inside its budget and its card names the slowest part.
- Parts fed out of order unpack correctly.
- A short part is refused and leaves no file.
- The deadline arithmetic holds, and a bounded get gives up inside the budget.
Left out
Store.getstill returns a whole part, 16 MiB at most, so this streams part by part rather than byte by byte. Streaming inside a part would mean changing the store interface.- The 400 MB test uses a zero-padded database so it runs in about a second. It exercises the budget and the timings, not real throughput.
Try it: run bun test test/snapshot-drill-parts.test.ts, or run a drill from Settings → Backups and read the timing line.
🤖 Generated with Claude Code
Parked by the crew: the check failed ("(unnamed)") and the decider saw no point in another try
The restore drill now records how long each part took, and its card names the slowest. Type check is clean. The snapshot, drill, recovery and card tests pass, but two
snapshot-destinationtests fail here because the sandbox blocks the network. They fail the same way with my changes stashed. The forge's own check will run the rest.What changed
files→downloadandunpack→decompress. The drill addsopen(the database read, counts and unseal) andmigrate(the restored forge booting until it answers health). Stored drills that used the old names still read.unpackerinparts.ts) as they land, so decompression overlaps the download and the compressed file is never joined in memory. The file only appears under its own name once its sizes check out.decompresstherefore times only what is left after the download ends.Store.bounded(budgetMs)andcallDeadlineMssize each get's deadline so attempts × deadline + backoff waits never exceed the budget. The drill usesboundedfor both listing and the restore.docs/RECOVERY.mdhas entries for the renamed phases and foropenandmigrate.drill-slow,snapshot-drill-phasesandsnapshot-restore-progress. The old names were what changed, not the behaviour.test/snapshot-drill-parts.test.tscovers four things.Left out
Store.getstill returns a whole part, 16 MiB at most, so this streams part by part rather than byte by byte. Streaming inside a part would mean changing the store interface.Try it: run
bun test test/snapshot-drill-parts.test.ts, or run a drill from Settings → Backups and read the timing line.🤖 Generated with Claude Code
Closes #2719