Skip to content

feat(fleet-queue): route the coordination verbs through route_for and emit the mode line (#8581) - #12706

Merged
dezren39 merged 2 commits into
mainfrom
archer-lane-av2/8581-verb-adapter
Nov 22, 2026
Merged

dezren39 merged 2 commits into
mainfrom
archer-lane-av2/8581-verb-adapter

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Verb adapter for the #8581 routing contract — #8581 remainder 1 and #8583 remainder 1, one slice serving both (packet #12538).

What landed

  • New client adapter 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 ("adapters call route_for"). It performs no I/O and attempts no route; the verbs keep their existing serving paths.
  • Claim (single, batch, and every guard outcome), heartbeat, and checkpoint now 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.

Client-side only — no broker redeploy

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

Leg honesty: 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.

Verification

  • Failing-first (tests-only commit 4a9ac56, 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/cloud where gh-read-degraded/cloud 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 0ed1186): laptop run of 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), with 143 turso_queue test lines confirming the feature-gated suite actually ran rather than being silently skipped.
  • Independent confirmation: fleet-run on this head (link in the completion note on Fleet unification slice 3: fleet verb contract v2 — routes and degraded modes in the tool #8581).

Remainders after this slice (recorded on the issues)

  1. The live Fleet unification slice 5: local coordination replica for database-down resilience #8583 acceptance drill against the real Turso store (needs a client/broker replica wiring decision + a live-store session).
  2. Fleet unification slice 3: fleet verb contract v2 — routes and degraded modes in the tool #8581's per-leg drills (gh-write fallback switch + outbox; gh-read mirror; db drill against the replica).
  3. Fleet unification slice 3: fleet verb contract v2 — routes and degraded modes in the tool #8581's lane-runbook cleanup (remove local fallback improvisation) — follows the drills, per the issue's ordering.

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

…-first)

The adapter tests land against a stub mode_line_for that always
reports normal/cloud: the degraded selections (gh-read, gh-write,
db-degraded on github-markers), the switch envelope mode line, and
the /claim-flow verb normalization must fail until the adapter
selects through route_for and the outputs are wired.
… emit the mode line (#8581)

The client adapter (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. Claim (single, batch, and every guard outcome), heartbeat,
and checkpoint now carry the contract mode line on their printed
output under the mode_line key; a failed guard read reports
gh-read-degraded on the cloud route. The #6741 fallback switch
envelope carries the same mode line (db-degraded on
github-markers), so every work verb reports its route on the
primary-store failure path too.

Client-side only: no broker-served behavior changes — the broker
is untouched, and the verbs keep their existing serving paths.
The client holds no local replica yet, so a dead store honestly
reports github-markers, the route the switch hands the work to;
wiring SqliteReplica into the client is #8583's remaining work,
ahead of the live drill.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 23:06
@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-22T23:08:11.232062Z 0ed1186 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

Warning

Review limit reached

You'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 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7887e97a-5b5f-42ee-9fb3-10d4d94949b0
Commits

Reviewing files that changed from the base of the PR and between dee25f7 and 0ed1186.

Files selected for processing: 4

  • pkgs/fleet/crates/fleet-queue/src/client.rs
  • pkgs/fleet/crates/fleet-queue/src/client/commands_lifecycle.rs
  • pkgs/fleet/crates/fleet-queue/src/client/mode_report.rs
  • pkgs/fleet/crates/fleet-queue/src/client/transport.rs
  • 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