Repository navigation
feat(fleet-queue): define database-leg routing and replica interface - #12638
Conversation
|
Warning Review limit reachedYou'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 26 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5325e3a64
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…plica leases, model-based replica coverage - Preserve caller lane identity in replica lease operations: heartbeat and checkpoint now take the caller's lane alongside the worker, and require_held enforces (worker, lane) jointly, so a foreign lane sharing repo-worker-code can no longer extend the owning lane's lease or overwrite its checkpoint. Mirrors the cloud boundary enforced via claimed_by / foreign_lane_claim in turso_queue/lifecycle.rs. Covered by memory_replica_heartbeat_and_checkpoint_require_the_owning_lane. - Cover replica invariants with generated operation sequences: a ModelReplica oracle steps in lockstep with MemoryReplica over generated claim/heartbeat/checkpoint/sync_up/cloud-inject/clock-move sequences, comparing every outcome plus a final reconciliation, so single-writer, lease-expiry, lane-isolation, and reconciliation invariants are checked against an explicit model. proptest 1.12 is already a fleet-queue dev-dependency. Verified in this seat by rustfmt parse (no new formatting diffs beyond the file's pre-existing ones); no local rustc here, so CI is the first compile/test run.
|
Codex review round answered (2026-11-22 ~12:50 CST): both open threads are fixed in 7d3cb42 and resolved.
Remaining merge blockers: none from review threads (0 unresolved). CI is the first compile/test run for the new Rust code (no local rustc in this seat); checks pending on the new head. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d3cb42d0b
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Pure routing contract for the database leg, closing the gap PR #12601
left open: it defines the route order and the replica interface the
#8583 Turso replica must satisfy, so the replica can be built against
a settled boundary instead of an invented one.
work::routing::DbRoute+ROUTE_ORDER:cloud→local-replica→github-markers, with stable route labels sharedwith the feat(fleet-queue): define degraded mode contract #12601
ModeLine.route_for(LegAvailability) -> (Mode, DbRoute): pure selection.Database up keeps the cloud route and names the constraining GitHub
leg; database down selects the replica, then the markers.
mode_line(verb, legs): the machine-readable mode line naming theroute actually used (Fleet unification slice 3: fleet verb contract v2 — routes and degraded modes in the tool #8581 acceptance).
CoordinationReplicatrait:claim/heartbeat/checkpoint/sync_upwithReconcileReport(synced_claims,lost_claims,double_claims). A claim honored locally is honored globally;partition double-claims are reported, never silently merged.
MemoryReplica: in-memory reference implementation + drill stand-in,with a caller-supplied clock so lease expiry is deterministic.
Decision recorded (FDR-0013; #12601 left multi-leg precedence open):
for coordination verbs the database leg dominates the GitHub legs — a
verb routed through the replica reports
db-degradedeven when aGitHub leg is also down — and among GitHub legs, writes dominate reads.
No adapters are wired and no Turso code is added here; the next slice
implements
CoordinationReplicafor the embedded replica and routesthe claim/lease/heartbeat verbs through
route_for.Refs #8581 #8583. Task 21043 (combined #8581/#8583/#8584) is parked;
no competing PR covers this slice.
Evidence
pkgs/fleet/crates/fleet-queue/src/work/routing.rs(16,837 bytes, sha256
18c07fefa9c59686178c46800e3233f453725b2b979216cbc8ccb84d71df5296)plus one
pub mod routing;line inwork/mod.rs. 10 tests inwork::routing::tests: route-order matrix, precedence, mode-lineJSON, replica claim/heartbeat/checkpoint/sync, second-claim
conflict, expired-lease reclaim, double-claim surfacing.
time (broker tunnel to the laptop 100.99.113.103:4799 returned
HTTP 502, ~17:40Z), so this relies on CI for the first
compile/test run. The command the next lane runs on the laptop is:
cargo test --manifest-path pkgs/fleet/Cargo.toml -p fleet-queue --lib --features client,queue-broker work::routing::tests(same shape as feat(fleet-queue): define degraded mode contract #12601's verification), plus
cargo fmt --manifest-path pkgs/fleet/Cargo.toml --package fleet-queue --checkand
git diff --check.Merge Danger
Pure additive module plus one module-registration line; nothing calls
it yet, so no behavior changes. Revert-safe.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.