Skip to content

feat(fleet-queue): durable SQLite coordination replica for #8583 - #12692

Merged
dezren39 merged 2 commits into
mainfrom
archer-lane-ap/8583-sqlite-replica
Nov 22, 2026
Merged

dezren39 merged 2 commits into
mainfrom
archer-lane-ap/8583-sqlite-replica

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

What

Implements the #8583 local coordination replica against the CoordinationReplica interface settled by #12638: work::sqlite_replica::SqliteReplica, a CoordinationReplica backed by a local SQLite file (rusqlite, bundled — the stack atlas-core already pins), gated on the queue-broker feature alongside turso_queue.

  • claim / heartbeat / checkpoint with the contract's semantics: single-writer, lease expiry against a caller-supplied clock, (worker, lane) identity — a foreign lane cannot heartbeat or checkpoint another lane's claim even under the shared repo-worker-code worker id.
  • sync_up reconciles against an attached cloud store: a local claim is applied to the cloud store (honored locally → honored globally); a task the cloud view holds for a different (worker, lane) surfaces in double_claims, never silently merged; lost_claims stays empty by construction.
  • The store holds coordination only (claims, leases, checkpoints) — the wipe test passes by construction.

Oracle

Every automated test names its oracle: the explicit ModelReplica state machine in the module's tests (the same model MemoryReplica is checked against in work/routing.rs), exercised over generated operation sequences with proptest — single-writer, expiry crossings, lane isolation, repeated syncs compared on every step. Example tests pin the exact contract error strings, the double-claim report shape, and the one property the in-memory reference cannot offer: a claim recorded before the store closes is still held after it reopens.

Failing-first: commit a463302 landed the tests against a stub returning Unavailable (fleet-run evidence in the #8583 completion record); this PR's head implements the trait.

Scope

One slice of #8583. Not in this PR (recorded on #8583, in order): (1) routing the claim/lease/heartbeat verbs through route_for with mode_line on their outputs (#8581 remainder 1 — the adapter that will call this replica); (2) the live database-down drill against the real Turso store; (3) Turso-native embedded-replica sync if store-level reconciliation proves insufficient — the trait is the boundary either way.

No broker-served behavior changes: this is a new library module behind the existing feature; nothing calls it yet, so no redeploy is needed.

Refs #8583, #12538.


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

archer added 2 commits November 22, 2026 22:22
…stubbed

Failing-first: the CoordinationReplica contract tests for the durable
SQLite-backed replica (model-oracle proptest mirroring work/routing.rs,
plus reopen durability) land before the implementation; every trait
method returns Unavailable in this commit.
SqliteReplica implements the CoordinationReplica contract from
work::routing over a local SQLite store (rusqlite, bundled): claims,
leases, and checkpoints persist across restarts; sync_up applies
local claims to the attached cloud store and surfaces partition
double-claims in the ReconcileReport, never silently merging them.
Semantics match MemoryReplica exactly (caller-supplied clock,
(worker, lane) identity, injected cloud view consumed by sync),
checked by the model-oracle proptest landed in the previous commit.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 22:28
@dezren39
dezren39 merged commit fc72fad into main Nov 22, 2026
1 check passed
@dezren39
dezren39 deleted the archer-lane-ap/8583-sqlite-replica branch November 22, 2026 22:28
@chatgpt-codex-connector

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

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-22T22:30:03.031651Z d284da8 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.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant