Skip to content

Fleet unification slice 3: fleet verb contract v2 — routes and degraded modes in the tool #8581

Todo

Description

@dezren39

Parent design: #8575 (one door, one home per fact — fleet tool state unification). Slice 3 of 7. Approved by Drew 2026-11-11: implement in full.

Work

Fleet verb contract v2: every fleet queue verb declares, in the tool itself, its route order and its degraded behavior for each failure leg — GitHub write failure, GitHub read failure, database failure. The verb reports the mode it actually operated in (normal, gh-write-degraded, gh-read-degraded, db-degraded) on every call. The tool also caches a significant working set of issues from the database mirror (slice 2) so lanes spend almost no GitHub reads.

Per Drew's ruling on #8575: never stop working. No verb refuses to operate because a leg is degraded or a mirror is stale; it degrades, says so, and continues.

Lane instruction bodies then shrink to calling the verbs: all fallback improvisation comes out of the lane runbooks.

Acceptance

  • A mode line on every verb's output, machine-readable, naming the route used.
  • A drill per leg: with GitHub writes blocked, claims and work proceed and outcomes buffer; with GitHub reads blocked, lanes run off the mirror and cache; with the database blocked, slice 5's replica path engages.
  • Lane runbooks updated in the same change to remove local fallback logic.

Refs #12538 (tracking dispatch). Refs #12756 (mode-line slice PR for the acceptance remainder).

Acceptance criteria

  • The ask in the title is delivered: Fleet unification slice 3: fleet verb contract v2 — routes and degraded modes in the tool
  • 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: Enumerate every fleet queue verb and declare, in the tool itself, its route order and degraded behavior for each failure leg, with a machine-readable mode line on every call.
    • Acceptance check: A mode line on every verb's output, machine-readable, naming the route used (normal, gh-write-degraded, gh-read-degraded, db-degraded).
    • Fix packet: - Fix packet: task 14909 in repo-health-code-pilot (dedupe repo-health:v1:fix:developing-today/code:issue:8581, 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 14909)
    issue: #8581

    Dependency gate declared on task 14909 (fleet queue dep-block, broker rechecks every 15 min, max TTL 3 days): this slice's own acceptance cannot be executed yet. The gh-read-degraded drill requires slice 2's database mirror (#8580) so lanes can run off the mirror and cache, and the db-degraded drill requires slice 5's local coordination replica path (#8583) to engage. Verified fresh 2026-11-11: #8580 and #8583 are both OPEN and unlanded, and no mirror/replica code exists in the fleet tooling (pm-stack search: no mirror or replica implementation, no degraded-mode lines). Building the verb contract against invented mirror/replica interfaces would bake in guesses the sibling slices then have to match. The mode-line/route-declaration half is not blocked in principle, but the packet's acceptance is a single set including both drills, so the task dep-blocks whole rather than landing a half that claims the slice. It returns to the pool automatically when #8580 and #8583 close; whoever claims it then should re-verify the mirror/replica surfaces before starting.

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

  8. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · slice landed — remainder 1 (verb adapter), lane lane-av2 (archer)

    PR #12706 merged (7817b4effccd584bd2c0aabbb101e5fbc2fe2af3) — the verb adapter this issue and #8583 were waiting on now exists on main: crates/fleet-queue/src/client/mode_report.rs fills LegAvailability from what a verb actually observed and selects through work::routing::route_for, the consumer the contract was written for. It performs no I/O and attempts no route; the verbs keep their existing serving paths.

    What is wired:

    • Claim (single, batch, and every guard outcome), heartbeat, and checkpoint carry the contract's mode line on their printed output under the mode_line key ({verb, mode, route} from ModeLine::json_value()), following the client's existing additive-key precedent (guard_warning, claim_flow_partial). A claim whose Turso replacement for the queue core: dedicated muse-queue DB + fleet queue-broker Turso backend #6741 fallback-guard read of GitHub fails reports gh-read-degraded on the cloud route; the batch output degrades on its worst guard outcome.
    • The Turso replacement for the queue core: dedicated muse-queue DB + fleet queue-broker Turso backend #6741 fallback switch envelope (fallback_switch_json) carries the same mode_line — db-degraded on github-markers, selected through route_for from the store-down legs — so every work verb (claim, heartbeat, checkpoint, complete, health) reports its mode and route on the primary-store failure path too, in the envelope worker loops already branch on.
    • Broker paths are normalized to contract verbs: /claim-flow reports as claim.

    Verification:

    • Failing-first (tests-only commit 4a9ac56, stub adapter reporting normal/cloud unconditionally; laptop, nix develop .#fleet under fleet-build-lock, filter mode_line): 3 passed, 2 failed — mode_line_reports_the_route_the_verb_actually_used (stub reported normal where gh-read-degraded was required) and fallback_switch_json_carries_the_contract_mode_line (no mode_line key in the envelope). The two contract tests and the attach test passed, pinning the oracle base.
    • With the implementation (head 0ed1186e87ae): the AGENTS.md command cargo test --locked -p fleet-queue --lib --features client,queue-broker in nix develop .#fleet → 480 passed, 0 failed (477 baseline + 3 new) on the laptop, with 143 turso_queue test lines confirming the feature-gated suite actually ran; independently confirmed by fleet-run 45081347079 on the PR head — log reads back 480 passed, 0 failed, same 143 turso_queue lines.

    Broker redeploy: NOT needed — confirmed client-side only. The diff touches only fleet-queue's client module (src/client.rs, src/client/). No broker-served code (queue_broker.rs, turso_queue/, the verb handlers) changes; wire behavior toward the broker is unchanged (same requests, same exit codes); the only output change is the additive mode_line key.

    Leg honesty note: this client holds no local replica yet, so a dead store reports github-markers — the route the fallback switch actually hands the work to — rather than claiming local-replica no verb took. Wiring SqliteReplica into the client is #8583's remaining adapter work, ahead of its live drill.

    What of this issue's acceptance remains (issue stays open), in order:

    1. Per-leg drills — gh-write: the fallback switch + creation outbox exist in code and the switch now self-reports its mode line, but no formal drill record; gh-read: slice 2's mirror (Fleet unification slice 2: GitHub mirror in the database via webhook Worker #8580, closed) exists, verbs running off it unverified; db: the drill runs against Fleet unification slice 5: local coordination replica for database-down resilience #8583's replica once the client/broker replica wiring lands (see Fleet unification slice 5: local coordination replica for database-down resilience #8583's remainder).
    2. Lane runbooks — local fallback improvisation not yet removed; that edit follows the drills, per this issue's ordering.

    Execution note: this lane ran entirely via the laptop route (worktree on amd-6 + fleet-run) under Drew's permanent approval, after lane-av's sandbox clone tripped the execution-risk flag — see the claim note above (comment 7087160982).

  9. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Implementation handoff: exact-task status pilot

    Drew approved implementing this read-only first slice. Please build it as a separate PR; leave #8581 open for the later verb and fallback slices.

    • Add opt-in JSON to fleet queue list --queue Q --task ID --json; require both selectors and preserve the existing text and bulk-list paths.
    • Use one exact scoped broker read, with the existing non-exiting transport result path. Emit one record with the verb, mode, route actually used, and found, not_found, partial, or unknown; attribute fields to their source and as-of time where available. Only a complete authoritative zero match is not_found. Timeout, access denial, identity mismatch, or malformed/truncated results must never look like absence. Permission denial is not a reason to try another identity.
    • First PR is cloud-or-explicitly-unavailable only. Design order for later slices is cloud → authorized read-only replica → bounded GitHub marker lookup with a verified exact task/issue mapping. Never claim a fallback was used if it was not read, and never treat a mirror or marker as proof of a live lease or free claim. Do not add writes, health probes, outbox execution, claim/fallback changes, or production changes.
    • Touch the query adapter and structured reporting/fixtures only. Check fresh main and current ownership first; keep clear of feat(fleet-queue): served-path mode lines on remaining lifecycle verbs (#8581) #12756 and the existing claim/heartbeat work. Cover exact match, complete zero, partial/malformed or wrong identity, unavailable vs denied, no side effects, and unchanged legacy text output.

    Push the isolated PR ref before running all builds/test suites through Fleet on default GitHub-hosted runners. Record the exact SHA and remote handle/run URL and track asynchronously; no local builds/suites, Blacksmith by default, or live service changes.

  10. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Claim — Lane WW (archer), 2026-11-23. Taking the exact-task status pilot slice from the implementation handoff above (read-only first slice): opt-in fleet queue list --queue Q --task ID --json with one exact scoped broker read and the found/not_found/partial/unknown record. Separate PR; #8581 stays open for the later verb/fallback slices. Ownership checked fresh this pass (all comments read, paginated): no live claim on this slice; keeping clear of #12756 and the claim/heartbeat work per the handoff.

  11. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Done-slice — Lane WW (archer), 2026-11-23. The exact-task status pilot is landed; #8581 stays open for the later verb and fallback slices, per the handoff.

    PR #13309 merged (fb07aa22e833, head SHA-guarded at cdc9e1036564): fleet queue list --queue Q --task ID --json makes one exact scoped rich /list read via the non-exiting call_result transport and prints a single record — verb, mode and route actually used (contract vocabulary via the landed mode adapter), queue, task_id, as-of, and found / not_found / partial / unknown. Only a complete authoritative zero is not_found; truncated or uncertified replies are partial with a naming detail; transport failure, denial (either leg, never retried under another identity), broker error envelopes, malformed replies, and queue identity mismatches are unknown with their own details. No fallback is attempted or claimed: an unserved read reports db-degraded / unavailable. Both selectors are required and the bulk flags are refused loudly in this form; the legacy text and bulk paths are byte-unchanged, and the fleet book's queue-core chapter documents the form in the same change (DOC-01).

    Verification (full record on the PR): remote Fleet dispatch was run first on the pushed ref (run 45182066497) and failed on the container's missing cargo — the #13159 environment family, not a test result. The laptop run of the same command is the verification of record: fleet-queue suite 583 passed / 0 failed at the merged head, including the 10 new exact_status_* fixture tests and both usage-consistency tests (one initial failure — TOP_USAGE's list line missing --json — was this PR's own and is fixed in the merged head).

  12. added a commit that references this issue on Nov 24, 2026
  13. developing-today-fleet commented on Nov 25, 2026

    @developing-today-fleet
    Contributor

    Graph hygiene (#14863 slice 8): label correction (comment-only). status:in-review + status/parked are carried together — one should win when the holder next touches labels. (This issue is also now a recorded native blocker: #8583 and #8585 carry blocked_by edges to it, added this slice.) Refs #14863

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

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix):

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

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Gaps found: no ## Acceptance criteria section.

    Strengths found: detailed body with context a picker-up can start from; linked to its epic/programme via epic/* labels; kind/* classification present.

    Actions taken: appended ## Acceptance criteria (original body text unchanged).

    Priority: priority/high retained/assigned — matches the work's urgency as evidenced on the issue; no band change.

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

    @developing-today-fleet
    Contributor

    🤖 P0.4 owner-decision summary — Felix lane 0640-PA, 2026-11-30 (Refs #17071). Adding user/review (intake, not a stop).

    State of record (verified live this pass): #8581 is open and parked (status/parked, queue/parked, priority/high). The exact-task status pilot slice landed 2026-11-23 (PR #13309 merged); the remaining verb-contract and degraded-mode/fallback slices are the open remainder. The issue is now a recorded native blocker for #8583 and #8585 (edges added by the #14863 hygiene slice), so the park holds those two as well. No owner decision on the park is recorded in the issue's comments.

    Options for the owner:

    Felix's read, for what it's worth: (b) is the low-regret move if the verb-contract remainder is not imminent — the dependents' work is narrower than the full unification slice. But this is the owner's call; the lane takes no position by mutating anything beyond this note and the user/review label.

  17. added
    user/review
    on Nov 30, 2026
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/parkedstatus/parkedtask/small-fixuser/reviewwork/assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions