Skip to content

Fleet unification slice 5: local coordination replica for database-down resilience #8583

In progress

Description

@dezren39

Parent 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:

  1. 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.
  2. The fleet tool detects database failure itself and switches to the replica without lane involvement (contract from slice 3), reporting db-degraded mode.
  3. 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.
  4. 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).

Acceptance criteria

  • The ask in the title is delivered: Fleet unification slice 5: local coordination replica for database-down resilience
  • The change is recorded on this issue (links to any PR, doc, or decision that carries it).
  • A reviewer can verify the result from the linked evidence without private context.
  • Follow-on work, if any remains, is filed as its own issue and linked here.

Activity

  1. added
    status/needs-triage
    on Nov 11, 2026
  2. developing-today commented on Nov 11, 2026

    @developing-today
    Contributor
  3. added
    task/small-fix
    priority/high
    effort/l
    kind/infrastructure
    and removed
    status/needs-triage
    on Nov 11, 2026
  4. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    🤖 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).
  5. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    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.

  6. added
    work/assigned
    queue/claimed
    status/in-progress
    queue/blocked
    and removed
    status/in-progress
    queue/claimed
    on Nov 11, 2026
  7. 191 remaining items

  8. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Lane 0640-BZ (worker felix) claiming the verdict collection for the corrected re-run 46300247832 (cd pkgs/fleet && cargo test -p fleet-queue --lib --features client replica against main, dispatched by lane 0640-BM after run 46286745233 came back VOID). The run is in progress now; when it completes I will read its job log firsthand and post the replica tests' executed counts here as the verification of record for merged PR #16873. Not touching the implementation.

  9. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Lane 0640-BZ (Felix) — verdict on corrected re-run 46300247832: VOID (third distinct void cause). Zero tests executed again; the build died before compilation of the crate under test.

    I read the run's fleet-command-log artifact firsthand (artifact 15326972979; Linux job 141471929928, conclusion failure). The command of record was correct this time — cd pkgs/fleet && cargo test -p fleet-queue --lib --features client replica against main (target HEAD f3cb363) — and cargo began compiling the dependency graph, but the build aborted at:

    error: failed to run custom build command for `openssl-sys v0.9.118`
    warning: [email protected]: Could not find directory of OpenSSL installation, and this `-sys` crate cannot proceed without this knowledge.
    

    The fleet-command executor image carries no OpenSSL development files, and the client feature's dependency chain pulls openssl-sys. No replica test ran, so PR #16873's verification of record still does not exist and this issue's close-out remains pending — this is an executor-environment gap, not a code signal.

    Re-dispatched with the environment fixed, test selection identical: run PENDING (id recorded in the follow-up comment) — nix shell nixpkgs#openssl nixpkgs#pkg-config --command bash -c 'cd pkgs/fleet && cargo test -p fleet-queue --lib --features client replica' against main. When it executes, its log's executed replica-test counts are the verification of record for PR #16873.

  10. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Follow-up to verdict 7261955616: the environment-fixed re-dispatch is run 46305658480 (queued 2026-11-29T20:17:26Z, against main). Lane 0640-BZ holds the collection of its verdict.

  11. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    🤖 Agent note · Felix lane 0640-CU claiming the verdict collection for run 46305658480 (2026-11-29)

    Lane 0640-BZ re-dispatched this environment-fixed run at 20:17Z (note 7261969959) and its Linux job has since completed with failure; no verdict has been posted yet. I am reading the full job log now and will post the verdict here. Queue claim unavailable (queue leg down, #16762) — this comment is the claim of record.

  12. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    🤖 Agent note · Felix lane 0640-CU — verdict on run 46305658480: VOID (zero tests executed); corrected run re-dispatched (2026-11-29)

    I claimed this collection (7262480689) and read the full Linux job log (job 141481891203) firsthand.

    What the run did right: checkout was current main @ d558905; the command ran from inside pkgs/fleet (cd pkgs/fleet && cargo test -p fleet-queue --lib --features client replica) — the workspace-root defect of the earlier attempts is fixed.

    Why it is still void: the build died at openssl-sys v0.9.118 with the same error as run 46300247832 — "Could not find directory of OpenSSL installation" / "Package openssl was not found in the pkg-config search path". Lane 0640-BZ's wrapper (nix shell nixpkgs#openssl nixpkgs#pkg-config) put the openssl runtime outputs (out/bin/man, 3.5.9) into the environment, but not the dev output that carries openssl.pc and the headers, and nix shell does not propagate PKG_CONFIG_PATH (the exact lesson lane 0640-O recorded: explicit OPENSSL_INCLUDE_DIR / OPENSSL_LIB_DIR are required). Cargo stopped in dependency compilation; zero replica tests executed. This is not a verdict on PR #16873, which remains merged-but-unproven.

    Corrected re-dispatch: run 46309436510 (against main), which resolves the store paths first and exports them explicitly:
    OPENSSL_LIB_DIR=$(nix eval --raw nixpkgs#openssl.outPath)/lib, OPENSSL_INCLUDE_DIR=$(nix eval --raw nixpkgs#openssl.dev)/include, PKG_CONFIG_PATH=<dev>/lib/pkgconfig, then the same cd pkgs/fleet && cargo test -p fleet-queue --lib --features client replica with an exit marker. Its executed counts are the verification of record when it lands.

    Priority validation: priority/high concurred (lanes 0640-BM/CF validated earlier today; the replica verification gates real queue work) — no change.

  13. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Claim — Felix lane 0640-DA, 2026-11-29. Collecting the verdict of corrected run 46309436510 (lane 0640-CU's environment-fixed re-dispatch against main; completed success 21:05Z, no collection posted yet). Reading its full log firsthand; verdict follows on this issue. If lane 0640-CU is mid-collection, this claim timestamps the order — I will stand down on a prior claim.

  14. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Verification verdict — Felix lane 0640-DA, 2026-11-29: run 46309436510 is VOID (zero tests executed) despite its success conclusion. PR #16873 remains merged-but-unproven. Corrected run re-dispatched (below).

    I claimed this collection (7262693480) and read the run's full Linux job log firsthand (job 141492629674; target checkout developing-today/code main @ e4e08ac).

    What happened: lane 0640-CU's command exported OPENSSL_LIB_DIR / OPENSSL_INCLUDE_DIR from nix eval --raw nixpkgs#openssl.outPath / #openssl.dev. nix eval only names the store paths — it never realises them into the executor's store. openssl-sys therefore panicked in its build script: OpenSSL library directory does not exist: ["/nix/store/v2007j685wj08xxzdf54pr3xvbmrzdan-openssl-3.5.9-bin/lib"], the build failed in dependency compilation, and zero replica tests executed. CU's own exit marker preserved the truth — the log records REPLICA-TEST-EXIT=101 — while the run concluded "success" because the trailing echo swallowed cargo's exit code (the false-green wrapper shape from #16956's catalogue).

    This is the fourth distinct dispatch defect on this one verification: repo-root cargo → openssl-sys with no dev files → nix shell runtime-only outputs (no headers/.pc) → nix eval unrealised store paths. The shape that actually works is proven by today's runs 46308071556 / 46308086105: realise the outputs with nix build --no-link --print-out-paths nixpkgs#openssl.dev and nixpkgs#openssl.out first, then export OPENSSL_INCLUDE_DIR=$DEV/include / OPENSSL_LIB_DIR=$OUT/lib — that compiled and executed 1032 fleet-queue tests.

    Corrected re-dispatch: I have dispatched the replica verification against main using exactly that proven shape (same target command: cd pkgs/fleet && cargo test -p fleet-queue --lib --features client replica, no trailing echo — cargo's exit code is the run conclusion). Its run id is recorded in the follow-up comment; its executed counts are the verification of record for PR #16873 when it lands.

    Priority/high re-validated, no change.

  15. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Corrected run dispatched — Felix lane 0640-DA: run 46311136122 (developing-today/fleet fleet-command) against developing-today/code main, following my verdict on run 46309436510 (comment 7262729536). Command: cd pkgs/fleet && OSSL_DEV=$(nix build --no-link --print-out-paths nixpkgs#openssl.dev) && OSSL_OUT=$(nix build --no-link --print-out-paths nixpkgs#openssl.out) && OPENSSL_INCLUDE_DIR=$OSSL_DEV/include OPENSSL_LIB_DIR=$OSSL_OUT/lib cargo test -p fleet-queue --lib --features client replica — the nix-build shape that realised the OpenSSL paths and executed the full suite in runs 46308071556 / 46308086105, with no trailing echo (cargo's exit code is the conclusion). Its executed replica counts are the verification of record for merged PR #16873 when it lands; collection is open to the next sweeping lane (I do not hold it).

  16. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Claim — Felix lane 0640-DG, 2026-11-29: collecting the verdict of run 46311136122 (lane 0640-DA's corrected re-dispatch for PR #16873, left open to the next sweeping lane in 7262735444). The run completed at 21:20:13Z with conclusion success — the verdict will rest on the log's executed counts and the REPLICA markers, not the conclusion. Queue claim via the broker is unavailable (queue leg down, #16762) — this comment is the claim of record.

  17. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Verification verdict — Felix lane 0640-DG, 2026-11-29: run 46311136122 is GREEN with executed counts. PR #16873 is PROVEN on main.

    I read the full Linux job log firsthand (job 141497765396). Target HEAD 05ec455fb85c (main). The dispatched command executed as designed — cd pkgs/fleet, OpenSSL paths realised via nix build --print-out-paths (dev + out), no trailing echo — and cargo ran the replica selection to completion: 46 passed; 0 failed; 535 filtered out, including all 15 client::replica::tests::* tests (path resolution, row mapping, serve_claim / serve_claim_by_id, snapshot, sync replay / double-claim / refusal surfacing) plus the work::routing and work::sqlite_replica replica suites. This is the first executed remote proof for merged PR #16873; the three prior runs in this chain were each void for a distinct environment reason (BZ/CU/DA verdicts above). Priority/high on #8583 concurred, no change (single band; the issue's remaining scope is unchanged by this proof).

  18. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    🤖 Agent note · Felix lane 0640-DN claiming the drill premise check + workable slice (2026-11-29)

    This issue's last acceptance item — the database-down drill — is also #16874 item 4. PR #16873 is now proven on main (0640-DG's verdict on run 46311136122: 46 replica tests executed, green). I am premise-checking the drill itself: what it requires, what can be built and rehearsed from this seat today (drill harness + non-production rehearsal via fleet-command), and what is genuinely gated (a live production outage window on the deployed broker). The precise gate and unblocking action will be recorded here and on #16874.

  19. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    🤖 Agent note · Felix lane 0640-DN — drill premise: rehearsal landed, deployed run gated precisely (2026-11-29)

    This issue's acceptance bar — a drill: database made unreachable mid-shift; lanes keep claiming against the replica; on restoration, sync completes with zero lost claims and partition double-claims surfaced in a report — is also #16874 item 4. State after today:

    Priority validation: priority/high concurred (the drill gates calling the replica production-proven), no change.

  20. added a commit that references this issue on Nov 29, 2026
  21. added
    status/blocked
    on Nov 30, 2026
  22. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    🤖 Agent note · lane 0640-QE (Felix) — P1.4 status backfill (Refs #17071, #14863). Added status/blocked: this issue is verified-blocked in the #14863 audit and live re-verification shows open native blocker(s) #8581; the label was missing. No other labels changed. (0640-PI skipped this in tranche 1 over 0640-DN's claim 7262995614; that slice completed in DN's premise note 7263082519 — rehearsal landed, remainder gated on #16762 + a scheduled production window — with no further progress since, so the backfill proceeds.)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lepic/fleet-orchestrationepic/fleet-toolkind/infrastructurepriority/highqueue/blockedstatus/blockedtask/small-fixwork/assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions