Repository navigation
fleet-queue: verb routing through the client replica + sync_up broker adapter (#16874) - #16912
Conversation
…ica (#16874) Items 1-3 of #16874 (the #8583 follow-on), decisions recorded on the issue per FDR-0013: - Verb routing: on a store-down outcome (transport failure or an ok:false envelope, via the new transport::call_routed), claim, heartbeat, and checkpoint get their chance to serve through the client replica before the #6741 fallback switch. Claim serves the shapes the replica can honor (unscoped pick in production order; single by-id claim); batch/bind/transfer/ handoff/filter/pool/budget shapes and queue-scoped picks keep the switch. Replica-served outputs carry the honest mode line (db-degraded / local-replica) via the new mode_report::legs_store_down_replica. - Snapshot population trigger: an unscoped, unfiltered full list refreshes the client replica's snapshot from the rows it already fetched - no verb gains a broker round trip. - sync_up broker adapter: the cloud view is built from the broker (scoped rich /list read per locally held task id), unheld claims replay through claim-by-id, and the ReconcileReport is surfaced as replica_sync on the first broker-served claim/heartbeat/checkpoint that reconciles anything. Double-claims are reported, never replayed over; refused replays are resolved by one re-read and reported lost when no holder exists. SqliteReplica gains local_claims() so the adapter can enumerate the claims it reconciles. Item 4 (the deployed drill) is #8583's last acceptance item and is not in this slice.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Agent note · lane 1137-B (alpha DRIVE landings, 2026-11-29) — merging under standing authority. Verification (firsthand, this lane): full diff read (+~890/-~60, 8 files) against the PR purpose and #16874 items 1–3 — non-exiting |
Refs #16874 — items 1–3 (the serving half of the #8583 client replica). Item 4 (the deployed-environment drill) remains open on #16874 and is #8583's last acceptance item, so this PR does not close the issue.
Design decisions (production claim selection; population/refresh semantics and cadence; sync adapter reconciliation semantics) are recorded on #16874 per FDR-0013: #16874 (comment)
What lands
1. Verb routing through the replica. On a store-down outcome (transport failure or an
ok:falseenvelope — the new non-exitingtransport::call_routed), claim / heartbeat / checkpoint give the local replica its chance to serve before the #6741 fallback switch:pickin the production order, or a single--taskby-id claim (the dispatch path). Batch,--bind,--handoff,--from-session,--manual-override,--filter,--pool,--remaining-budget-minutes, and queue-scoped picks keep the fallback switch untouched — serving them from the snapshot would silently drop broker-side predicates.require_rowcode) as a machine-readable envelope.mode_report::legs_store_down_replica(db-degraded/local-replica); the fallback switch keeps reportinggithub-markers, the route it actually hands work to.mode_report's leg-honesty docs are updated to match.2. Snapshot population trigger. An unscoped, unfiltered full
listrefreshes the replica snapshot from the rows it already fetched (refresh_client_snapshot) — no verb gains a broker round trip, and a scoped/filtered listing never replaces the snapshot with a partial view.3. sync_up broker adapter. Reconciliation against the real broker, written against a narrow seam (
BrokerClaims: row read + claim-by-id) so it is unit-testable with a fake broker; the production seam uses the plain transport. The cloud view is one scoped rich/listread per locally held task id; unheld claims replay through claim-by-id (/claimwithtask_id); refusals are resolved by one re-read. Double-claims are reported and never replayed over; a claim that did not survive is reported inlost_claims, never hidden. The report surfaces asreplica_syncon the first broker-served claim/heartbeat/checkpoint that reconciles anything, best-effort (a sync failure never fails the verb).SqliteReplicagains an additivelocal_claims()accessor (itssync_upnow uses it too) so the adapter can enumerate the claims it reconciles.Tests
New tests name their oracles: production pick order + honest mode line on a replica-served claim; by-id exactness and the held-task no-claim; the unservable-shape pass table (Decision 1); heartbeat/checkpoint against the local lease incl. the foreign-lane refusal; the adapter's replay-with-zero-lost, double-claim-never-replayed-over, already-honored-without-replay, and refusal→lost / race→double-claim resolutions;
local_claimsenumeration. Verification: fleet-command dispatch of the fleet-queue test suite against this branch (run id recorded on #16874 when dispatched).Left unmerged for Felix.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-29T17:39:32Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "010b47d1c4cecdcd1b7d6ea260b7c9b0a61fb89e" }, "auth_subject": "felix", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.