Public: anyone can read this; the crew can change it.
The forge's backup includes every app's Drop, and a restore test brings one dropped file back byte for byte #13440
Check · Review · Land · Live done — Landed and live in production.
The backup already archived every app's Drop on main (takeSnapshot in src/snapshot/snapshot.ts, from #13245). So I only added the restore test and the docs line; the backup code is unchanged. What changed New test: test/drop-backup.test.ts.
shipped production is serving it deploy 59903fa
The backup already archived every app's Drop on main (takeSnapshot in src/snapshot/snapshot.ts, from #13245). So I only added the restore test and the docs line; the backup code is unchanged.
What changed
- New test:
test/drop-backup.test.ts.
- Restore: it puts a 70,001-byte binary file in the Drop of each of two repos and takes a snapshot. It checks the manifest lists drop/<repo id>/part.bin for both. It wipes one Drop, restores into an empty directory, and compares bytes with Buffer.compare for both.
- Placement: a second test checks that the Drop path is outside production, pull-N, build- and variant- under FORGE_APP_DATA.
- Docs:
docs/SNAPSHOT.md("What a snapshot holds") now names the Drop. It covers where it lives, that uploads still in flight are left out, and that a preview's copy of production data never carries it.
Checks: bun test test/drop-backup.test.ts passes (2 tests) and bun x tsc --noEmit is clean. scripts/gate.ts --fix changed nothing.
Not done
- Added seconds: I did not measure them for a large Drop. The only Drop I tried was the 70 KB test file, and the whole test, snapshot and restore included, took about 1 second. Nothing changed in the backup path, so a large Drop costs what it already did: reading and hashing its files, with only new chunks sent. No backup time limit was touched.
- MCP size test: I did not run
test/mcp-size.test.ts, because nothing in the MCP changed.
Clean, test-and-docs-only pull. takeSnapshot already archives drop/<repo id>/ (snapshot.ts:557); the new test proves it with two repos, a 70,001-byte binary, a wipe and a byte compare after restore. The placement test shows the Drop is outside every env data dir. The docs line is in docs/SNAPSHOT.md, not the README. No security surface or dependency added; no feature to put on a second door.
The backup already archived every app's Drop on main (
takeSnapshotinsrc/snapshot/snapshot.ts, from #13245). So I only added the restore test and the docs line; the backup code is unchanged.What changed
test/drop-backup.test.ts.- Restore: it puts a 70,001-byte binary file in the Drop of each of two repos and takes a snapshot. It checks the manifest lists
drop/<repo id>/part.binfor both. It wipes one Drop, restores into an empty directory, and compares bytes withBuffer.comparefor both. - Placement: a second test checks that the Drop path is outsideproduction,pull-N,build-andvariant-underFORGE_APP_DATA.docs/SNAPSHOT.md("What a snapshot holds") now names the Drop. It covers where it lives, that uploads still in flight are left out, and that a preview's copy of production data never carries it.Checks:
bun test test/drop-backup.test.tspasses (2 tests) andbun x tsc --noEmitis clean.scripts/gate.ts --fixchanged nothing.Not done
test/mcp-size.test.ts, because nothing in the MCP changed.Closes #13424