GeezerVison is showing github.com — feat(queue-backup): Turso-to-D1 export and restore drill for the queue store (#8584) by dezren39 · Pull Request #12685 · developing-today/code
Conversation
dezren39
commented
Nov 22, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Leg 3 (Turso -> D1) of #8584, the tooling half. Refs #8584 — the issue stays open on the remaining legs.
What lands
infra/queue-backup/, sibling to infra/github-backup:
bin/export_d1.py — a queue-store SQLite file (local replica / scratch copy of the Turso store, opened read-only) -> a D1-loadable SQL dump + manifest (per-table counts, schema fingerprint, dump SHA-256). Nothing is written until the dump loads into a fresh vanilla SQLite database with identical counts and schema; that load is the D1-fidelity check.
bin/restore_drill.py — the restore drill: dump/manifest integrity, D1-copy load, restore into a scratch store, count + schema re-checks, then a claim check running the queue's claim shape (the conditional UPDATE of turso_queue/claim.rs, queued branch, plus its leases row): exactly the first claimable task, exactly once.
bin/queue_backup_common.py — shared counts / schema-fingerprint / dump helpers.
docs/RUNBOOK.md — the operating path and the production wiring that remains.
Verification
- Failing-first: both suites failed on the missing modules before the implementation existed.
python3 -I infra/queue-backup/tests/test_export_d1.py — 4/4 OK. Fixture is built from the queue DDL of record (turso_queue/core.rs SCHEMA + merge_intent.rs DDL); oracles: identical counts + schema fingerprint after a vanilla-SQLite load, manifest hashes match the written bytes, no-clobber without --force, non-database source rejected.
python3 -I infra/queue-backup/tests/test_restore_drill.py — 4/4 OK. Oracles: the priority-90 queued task is the one claimed (attempts 0 -> 1, worker + lease stamped, other tasks untouched); tampered manifest and tampered dump are both rejected; a store with no claimable task fails unless --allow-empty.
- End-to-end CLI drill on the laptop: export reported 10 tables / 12 rows; the drill restored and claimed task 1 (
"ok": true).
py_compile clean on all six Python files.
Deliberately not in this PR (named remainders on #8584)

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
…e store (#8584)
Leg 3 of the fleet unification backups slice: the tooling half.
- bin/export_d1.py: queue-store SQLite file -> D1-loadable SQL dump +
manifest (per-table counts, schema fingerprint, dump SHA-256). The
export is written only after the dump loads into a fresh vanilla
SQLite database with identical counts and schema.
- bin/restore_drill.py: verifies dump/manifest integrity, loads the D1
copy, restores into a scratch store, re-checks counts and schema,
then claims exactly the first claimable task using the claim shape
of turso_queue/claim.rs (queued branch) plus its leases row.
- tests: fixture built from the queue DDL of record (turso_queue
core.rs SCHEMA + merge_intent DDL); export 4/4, drill 4/4, plus an
end-to-end CLI drill (10 tables, 12 rows, task 1 claimed).
- docs/RUNBOOK.md: the operating path and the production wiring that
remains (D1 creation in the existing Cloudflare account, scheduled
export + registry entry, broker-mediated claim against a scratch
Turso database) as an operator session. No live infrastructure is
changed by this PR.
Refs #8584.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 48 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b173f86a-1967-4caa-90b4-d6c9d0afbac7
Commits
-
Reviewing files that changed from the base of the PR and between 82adcbc and 5fb9923.
Files selected for processing: 7
-
infra/queue-backup/README.md
infra/queue-backup/bin/export_d1.py
infra/queue-backup/bin/queue_backup_common.py
infra/queue-backup/bin/restore_drill.py
infra/queue-backup/docs/RUNBOOK.md
infra/queue-backup/tests/test_export_d1.py
infra/queue-backup/tests/test_restore_drill.py
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-22T21:17:59.443798Z |
5fb9923 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 22, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|