Repository navigation
Description
Problem
pkgs/cold-store-reaper/cold_store.py — put_backup() (lines 993–1027) files a DB dump into Drive and records it as stored, but never verifies what Drive actually received. The bundle path in the same file does verify: upload() (lines 908–930) reads back files.get md5Checksum + size and refuses to mark the bundle verified on a mismatch. put_backup() has no equivalent step:
file_id = self._resumable_upload(src, name, folder_id)(line 1019)- a
transfer_ledgerrowupload / backup-uploadis written immediately (lines 1020–1024) - the result dict is returned as success
That ledger row is load-bearing: _upload_accounting() (lines 497–541) computes the project-budget backup bytes from backup-upload rows, and backup_supabase() / backup_d1() / scripts/export-turso.sh all file through put_backup(). A backup whose stored bytes differ from the local dump (truncated/corrupted server-side assembly, wrong content) is counted as safely filed, and the corruption is only discovered at restore time — for a system whose entire purpose is disaster recovery of the estate's databases (d1, supabase, turso dumps, nightly via scripts/nightly-backup.sh).
Evidence (verified this run)
Laptop probe ~/git/fleet/probe-2026-10-31-laneB-backupverify/probe.py against the real cold_store.py (sha256 fba42e08027514abae2de1602e755854ebfd6a3b578a5eece34b6c0becd39b95, identical on the sandbox and laptop clones, main 357ec7fb):
_resumable_uploadstubbed to return a file id while Drive holds different bytes, andcold_store.http_requestrigged to raise if any verification request is attempted.- Result:
put_backup("d1", dump.sql)returned success ({'db': 'd1', 'name': 'd1-20261031T212413Z-dump.sql', 'drive_file_id': 'file-corrupt-1', 'bytes': 2000}), zerohttp_requestcalls were made during the call, and atransfer_ledgerrowupload / 2000 / backup-uploadwas written for the full source size.
So there is provably no read-back of any kind on the backup path — not md5, not size, not even a files.get.
Why it matters
- The bundle path's verification exists precisely because an unverified upload cannot be trusted; DB backups are at least as critical as bundle objects (they are the recovery source for the estate's databases, and the restore drill in
scripts/restore-drill.shexercises d1 backups). - Budget accounting treats the unverified row as stored bytes, so the failure is invisible in
statusas well. - The fix pattern already exists in the same file (
upload()lines 908–930) and the test fake Drive already servesfiles.getwithmd5Checksum/sizefor the bundle tests.
Acceptance criteria
- After
_resumable_upload,put_backup()reads back the uploaded file'smd5Checksumandsize(Drivefiles.get, fieldsid,md5Checksum,size) and compares them to the local file's md5 (md5_file) and size. - On any mismatch,
put_backup()raisesColdStoreErrornaming the mismatch and writes nobackup-uploadledger row (mirroringupload()'s "bundle NOT marked verified" behaviour). - On match, behaviour is unchanged: same dated name, same ledger row, same result fields.
- A regression test in
pkgs/cold-store-reaper/tests/test_cold_store.pycovers the mismatch case (fake Drive reporting a different md5/size → error, no ledger row) and the existing backup tests still pass (python3 -m unittest discover -s pkgs/cold-store-reaper/tests).
Filed by new-issue-creator-code-b, 2026-10-31. Distinct from #1427 (CI coverage for this package, closed today) — this is a runtime verification gap in put_backup itself.
Activity
dezren39 commentedon Oct 31, 2026
🤖 Agent note · filed
put_backup()(cold_store.py:993-1027) against the bundleupload()verification path (cold_store.py:908-930) and verified the gap with a laptop probe driving the real module (sha256-matched on both clones):_resumable_uploadstubbed to a corrupt Drive copy,http_requestrigged to raise on any verification attempt —put_backupstill returned success, made zero verification calls, and wrote the full-sizebackup-uploadledger row.put_backupfiles DB dumps (d1/supabase/turso, nightly) with no md5/size read-back, while bundleupload()in the same file verifies both and refuses to mark verified on mismatch.48 remaining items
dezren39 commentedon Nov 2, 2026
🤖 Agent note · parked
dezren39 commentedon Nov 2, 2026
agent-note:v1 — picked up
Agent: repo-worker-code (OpenChamber scheduled lane)
Session: ses_e5e63b9e2c2ffeNWcJTcGcVvwB · queue task 5674
Task: Resume verification gate for the existing cold-store backup PR.
Fresh state: #3230 OPEN; PR #4330 OPEN at f4351b8 and authored by dezren39. Required checks remain QUEUED; CodeRabbit skipped. No files or PR content changed.
Next: park pending checks; revalidate PR/checks/review and ownership before any merge action.
dezren39 commentedon Nov 2, 2026
agent-note:v1 — parked
Agent: repo-worker-code (OpenChamber scheduled lane)
Session: ses_e5e63b9e2c2ffeNWcJTcGcVvwB · queue task 5674
Verified: #3230 OPEN; PR #4330 OPEN at f4351b8, authored by dezren39. Checks python: unittest suites and worker: local proof are QUEUED in run 41440146673; CodeRabbit skipped.
Reason: CI pending; PR is Drew-owned and must not be modified or merged by this lane. No files or PR content changed.
Resume: after checks complete, freshly revalidate PR/checks/review and ownership. Queue parked 20 minutes; work/assigned stays set.
dezren39 commentedon Nov 2, 2026
🤖 Agent note · parked
python: unittest suitesandworker: local proofare still QUEUED (runner backlog), CodeRabbit neutral. Resume: when both checks complete green, revalidate ownership/review and merge PR fix(cold-store): verify backup uploads (#3230) #4330, then complete task 5674; if red, fix on branch queue/5674-3230-drive-backup-verification.dezren39 commentedon Nov 2, 2026
🤖 Agent note · state: parked
f4351b8afunchanged. The Codex summary still flags an unresolved finding on this head, so I read the thread and the diff directly: the single Codex P2 (backups left in Drive after verification fails) was fixed inf4351b8afitself — all three verification-failure raises input_backuproute through averification_failedhelper that trashes the uploaded file before raising, with tests asserting the trash — and the fix is replied to on the finding thread. The finding is dispositioned; the unresolved flag is stale (no Codex re-review has marked the thread resolved). Checks (run 41440146673: python unittest suites, worker local proof) are still pending in the runner backlog — recorded suite evidence: 118 tests passed, 1 skipped. Parked 20 min per the CI rule.queue/5674-3230-drive-backup-verificationdezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up for ownership revalidation
dezren39 commentedon Nov 2, 2026
🤖 Agent note · parked — Drew-owned PR remains open
dezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up for ownership revalidation
dezren39 commentedon Nov 2, 2026
🤖 Agent note · parked — Drew-owned PR remains open
Merge pull request #4330 from developing-today/queue/5674-3230-drive-…
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done