GeezerVison is showing github.com — Fleet unification slice 5: local coordination replica for database-down resilience · Issue #8583 · developing-today/code
Fleet unification slice 5: local coordination replica for database-down resilience #8583DescriptionParent design: #8575 (one door, one home per fact — fleet tool state unification). Slice 5 of 7. Approved by Drew 2026-11-11: implement in full.
Work
Database-down resilience for coordination:
- Run a Turso embedded replica of the coordination tables on the laptop, so claims, leases, and heartbeats continue against the local copy when the cloud database or the broker path is unreachable.
- The fleet tool detects database failure itself and switches to the replica without lane involvement (contract from slice 3), reporting db-degraded mode.
- On recovery, the replica syncs back up; any claims made locally are reconciled against the cloud store — a claim honored locally is honored globally, and double-claims across the partition are detected and reported, never silently merged.
- Behind the replica, the existing GitHub-marker fallback mode remains the last resort.
Acceptance
- A drill: database made unreachable mid-shift; lanes keep claiming and working against the replica; on restoration, sync completes with zero lost claims and any partition double-claims surfaced in a report.
- The replica's data passes the wipe test by construction: it holds coordination only (per slice 1's classification).
Activitydeveloping-today commented on Nov 11, 2026 dezren39 commented on Nov 11, 2026
🤖 Agent note · triaged
- Agent: triage-step
- State: triaged
- Work kind: task/small-fix - a bounded implementation slice of the Drew-approved fleet unification program (parent Design: one door, one home per fact — the fleet tool owns every route and every fallback #8575); not a PR-shepherd or CI-investigation item.
- Priority: priority/high - Priorities brief line 1 (keep the fleet itself able to work: a dead queue/broker path outranks feature work) and line 4 (Drew's named programs: the four repos healthy). This slice is part of Drew-approved (2026-11-11) fleet unification parent Design: one door, one home per fact — the fleet tool owns every route and every fallback #8575, the queue/broker resilience program.
- Effort: effort/l - multi-day implementation slice.
- Kind: kind/infrastructure (added this triage).
- First concrete step: Stand up a Turso embedded replica of the coordination tables on the laptop so claims, leases, and heartbeats continue against the local copy when the cloud database is unreachable.
- Acceptance check: A drill: database made unreachable mid-shift; lanes keep claiming and working against the replica; on restoration, sync completes with zero lost claims and any partition double-claims surfaced in a report.
- Fix packet: - Fix packet: task 14911 in repo-health-code-pilot (dedupe repo-health:v1:fix:developing-today/code:issue:8583, priority 20, kind small_fix, queued; signal refreshed).
dezren39 commented on Nov 11, 2026 agent-note:v1
state: blocked (dependency)
lane: code-c (task 14911)
issue: #8583
Dependency gate declared on task 14911 (fleet queue dep-block, broker rechecks every 15 min, max TTL 3 days). Slice 5's own text names its two unlanded inputs: item 2 switches to the replica 'without lane involvement (contract from slice 3)' — slice 3 is #8581, itself dep-blocked today (task 14909) on slices 2 and 5 — and the acceptance holds the replica to 'coordination only (per slice 1's classification)' — slice 1 is #8579, the wipe-test schema audit, also OPEN and unlanded (verified fresh 2026-11-11: all seven #8575 slices open, no mirror/replica/contract code in the fleet tooling). The replica's table set is exactly what slice 1 classifies, and its failover surface is exactly what slice 3 declares; building either half against guesses would force rework across three slices. Note the interlock is circular by construction (#8581 lists this slice as an input too): the program order that unblocks everything is slice 1 first, then slices 2/3/5 against its classification. This task returns to the pool automatically when #8579 and #8581 close. dezren39 commented on Nov 22, 2026
🤖 Agent note · remainder 1 (verb adapter) landed — lane lane-av2 (archer)
PR #12706 merged (7817b4effccd584bd2c0aabbb101e5fbc2fe2af3). The adapter now routes the coordination verbs through route_for and emits mode_line on their outputs: claim (single/batch/guard outcomes), heartbeat, and checkpoint carry {verb, mode, route} on the cloud path, and the #6741 fallback switch envelope carries db-degraded / github-markers on the primary-store failure path — a verb now reports the route it actually used, itself, without lane involvement. Full record, verification (failing-first 3 passed / 2 failed against the stub; 480 passed / 0 failed on the laptop and independently in fleet-run 45081347079), and the client-side-only confirmation are on #8581: (see lane-av2's completion note there).
One boundary of this slice, stated plainly: nothing calls SqliteReplica from the client yet, and this slice did not change that — the client holds no local replica, so on a dead store the selected route is honestly github-markers, the route the fallback switch hands the work to. Serving verbs from the replica is the remaining adapter work and is a precondition of the live drill below.
What of this issue's acceptance remains (issue stays open), in order:
- Client/broker replica wiring — decide where
SqliteReplica is served from (client-held store vs broker-side) and wire the coordination verbs to land on it when the database leg fails, so the reported route becomes local-replica in fact.
- The live drill — the acceptance drill (database made unreachable mid-shift; lanes keep claiming against the replica; on restoration sync completes with zero lost claims and partition double-claims in a report) needs (1) plus a live-store session against the real Turso database.
- Turso-native embedded sync — only if store-level reconciliation proves insufficient in the drill; the trait is the boundary either way.
Broker redeploy: not needed for this slice — client-side only, confirmed on #8581's record. dezren39 commented on Nov 23, 2026 Block lifted — stale-block sweep, 2026-11-23 (Survey B, archer).
Named blocker of record: the slice-3 contract from #8581 (fleet verb contract v2 / coordination-replica interface), which this slice's implementation waited on.
Evidence the gating contract landed, verified first-hand via gh GraphQL this sweep:
Action: queue/blocked removed, queue/queued added. #8581 remains open for its own remaining scope, but the contract this slice was blocked on is on main and this slice's core deliverables have landed; any remainders are this issue's own work. dezren39 commented on Nov 23, 2026
Claim — Lane PR (archer), 2026-11-23. Taking the next slice of #8583: the replica operations the 2026-11-22 packet-defect note found missing from the merged CoordinationReplica surface — task discovery/pick against the local replica, the initial coordination-only seed/snapshot from the cloud store, and cloud-to-replica refresh — so the database-down drill in the acceptance criteria can actually run against the replica. SqliteReplica (PR #12692) and the verb adapter (PR #12706) are already on main; this slice builds on them in pkgs/fleet/crates/fleet-queue. Scope is this slice only; the live drill itself and any #8584 remainder stay separate. dezren39 commented on Nov 23, 2026 Done record — replica discovery slice (Lane PR, claim 7096623596).
Landed: PR #13180, merged 859ca99b2d9fe7378fe526dd2bb9090de3966b8d.
The three operations the 2026-11-22 packet-defect note found missing from CoordinationReplica are now in pkgs/fleet/crates/fleet-queue/src/work/routing.rs and implemented for both replicas:
ReplicaTask — coordination-only snapshot row (priority, created_unix, not_before_unix).
refresh_snapshot(tasks) — seed and refresh as one operation; replaces the snapshot wholesale, never drops a locally held claim.
pick(worker, lane, lease_seconds) — production pick order (priority ascending, NULL last; then created_at; task id tie-break), skipping parked-not-due tasks and tasks held under a live local lease; claims through the existing claim path.
SqliteReplica (work/sqlite_replica.rs) gains the replica_tasks table; refresh is a single transaction, pick is one ordered query. The verb adapter and live wiring stay with their owning slices, same shape as #12692 / #12706.
Verification: cargo test -p fleet-queue --features client,queue-broker — 544 passed, 0 failed (full crate suite at the PR head's tree; the work:: subset re-run 58/58 after a final one-line tidy). New tests pin the pick order and parked-timer gate on both implementations, claim survival across refresh, snapshot persistence across reopen, and a proptest driving both implementations through identical seed/pick/refresh scripts with MemoryReplica as oracle. No compiler warnings reference the changed files.
This issue stays open: the live database-down drill (queue task 14911, parked) and the #8584 remainders are separate slices, untouched here. developing-today-fleet commented on Nov 25, 2026 Graph hygiene (#14863 slice 8): remaining work (the database-down drill and the failover switch) consumes slice 3's contract, which the body names but no edge recorded. Native blocked_by edge added and verified via the dependencies API: #8583 -> #8581 (slice 3, OPEN, parked). Verified-blocked on that contract. Label note (comment-only): status:in-review + status/blocked are carried together, and queue/queued sits alongside the blocked posture — one status should win when the holder next touches labels. Refs #14863 developing-today-fleet commented on Nov 27, 2026
Fresh revalidation (2026-11-27, task 14911): the prior packet-defect gate is cleared. PRs #12692 (durable SQLite replica), #12706 (route/mode adapter), and #13180 (snapshot refresh + pick) are merged; #8579 is closed. #8583 remains OPEN, #8581 remains OPEN/blocked on the database-down drill, and there is no open implementation PR for #8583. Main still documents that the CLI client holds no local replica (pkgs/fleet/crates/fleet-queue/src/client/mode_report.rs) and marks the replica leg unavailable; the live outage/recovery drill is still absent. The previously recorded worktree /home/user/git/fleet/14911 and branch queue/14911-8583-local-coordination-replica are not present in this checkout. I started a clean task worktree on oc-code-01/8583-live-replica-wiring and am proceeding against the merged contract, not the stale packet-defect premise. developing-today-fleet commented on Nov 27, 2026 agent-note:v1
state: picked-up
task: 14911
worker: repo-worker-code
lane: oc-code-02
origin: openchamber-scheduled-lane
Fresh revalidation (2026-11-27): #8583 remains OPEN; #8581 remains OPEN/blocked; #8579 is CLOSED. Merged #12638, #12692, #12706 and #13180 establish the route/replica/pick/snapshot contracts; the remaining database-outage drill and CLI client wiring are not in an open PR. The latest issue note says lane oc-code-01 started oc-code-01/8583-live-replica-wiring; that worktree is currently clean at main with no branch-only commits. To avoid parallel work on the same slice, I am parking this claim briefly and will resume after that lane publishes/releases its work or its ownership is otherwise cleared. No source changes. developing-today-fleet commented on Nov 27, 2026
Recheck — task 14911 (code-i, 2026-11-27 ~10:15Z). On current origin/main (1a321346f85): mode_report.rs still documents the CLI client holds no local replica (replica leg hardcoded false), and SqliteReplica::sync_up still requires an attached SQLite cloud store — no broker adapter exists for cloud snapshot seed/refresh or replay/report of locally held claims. Both overlap branches (oc-code-01 and oc-code-08 8583-live-replica-wiring) remain 0 commits ahead of main with no open PR; oc-code-01s pick-up is now ~6.5h old with nothing published. #8581 stays OPEN/parked. No code changes: the client-held wiring plus live drill remain effort/l design-careful work with no safe 45-minute slice, and inventing the boundary here risks the recorded packet-defect failure mode. One new datum for the next lane: from a laptop-seated lane the laptop shell target is reachable, so the live database-down drill environment is available once the wiring lands. Re-parked with a timer; resume when a concrete client-to-live-queue adapter is defined/tested or branch ownership is cleared. developing-today-fleet commented on Nov 28, 2026 \n\n**Recheck — lane oc-code-01, 2026-11-28 ~03:50Z, task 14911. Verdict unchanged: keep open/blocked, no safe slice this pass.**\n\n- #8583 OPEN (status/in-review + status/blocked); parent #8575 OPEN.\n- Blocker unchanged: #8581 (slice 3 contract) OPEN since 2026-11-25.\n- Landed: PRs #12692 (SQLite replica), #12706 (route/mode adapter), #13180 (snapshot refresh) all MERGED; #8579 CLOSED.\n- Fresh check on current main: `mode_report.rs` still hardcodes `replica: false` (client holds no local replica); both `oc-code-01` and `oc-code-08` `8583-live-replica-wiring` branches 0 commits ahead of main, no open PR.\n- Remaining work (client-held wiring + live database-down drill) is effort/l design-careful with no safe 45-min slice; inventing the boundary risks the recorded packet-defect mode.\n- Task 14911 parked; resume when #8581 contract lands or branch ownership publishes a concrete client-to-live-queue adapter.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|