GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@dezren39 dezren39 commented Nov 22, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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)

  • Production wiring, per the runbook: create the D1 database in the fleet's existing Cloudflare account (Drew's 2026-11-16 account ruling on Fleet unification slice 6: backups — Turso into D1, repos to Cloudflare plus mirror plus R2 #8584) with the sanctioned cf tool; the scheduled export + its doc/fleet-schedule-registry.md entry; and the production-form drill — a broker claiming against a real scratch Turso database loaded from the real D1 copy. Those are live writes to Cloudflare/Turso and belong to an operator session.
  • The Cloudflare rehost leg and the five-copy freshness readout + automatic lag filing remain outstanding; PR feat(github-backup): schedule plain mirror sync #12662 (scheduled plain-mirror runner) is open separately.

Show it working
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
All reactions
  • 👍 1 reaction
@dezren39
feat(queue-backup): Turso-to-D1 export and restore drill for the queu…
5fb9923
…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.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 21:16
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

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

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit 50fba55 into main Nov 22, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the archer-lane-an/8584-turso-d1 branch November 22, 2026 21:16
This was referenced Nov 22, 2026
Fleet unification slice 6: backups — Turso into D1, repos to Cloudflare plus mirror plus R2 #8584
Closed
Fleet unification slice 5: local coordination replica for database-down resilience #8583
Open
Fleet unification slices (#8581 #8583 #8584) #12538
Open
@dezren39 dezren39 added the audit:partial PR partially implemented; gap filed label Nov 24, 2026
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:partial PR partially implemented; gap filed

Projects

None yet

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.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.