GeezerVison is showing github.com — fix(queue): parked-handoff stage source mismatch — broker reads progress.stage, claimant poll reads last_checkpoint.stage · Issue #8192 · developing-today/code
fix(queue): parked-handoff stage source mismatch — broker reads progress.stage, claimant poll reads last_checkpoint.stage #8192Descriptionfix(queue): parked-handoff stage source mismatch — broker reads progress.stage, claimant poll reads last_checkpoint.stage
Found during #8187 acceptance (2026-11-10T19:12Z), task 10995 (repo-health-code-pilot, issue #5538):
- Row state: status=parked, progress.lane='opencode', session_id null, progress.stage='awaiting_triage', progress.last_checkpoint.stage='handed_off' (at 2026-11-10T18:51:16Z).
- Broker: PARKED_HANDOFF_SQL (turso_queue.rs) computes stage as COALESCE(progress.stage, progress.last_checkpoint.stage) — top-level stage wins — so the row is NOT a parked handoff: by-id claim returns 'no claimable task', and the fix(queue): single-session by default — direct lane assignment, sink drain (#8187) #8189 default-pick sink branch (same SQL) cannot serve it to a lane either.
- Claimant: poll.py normalize_row lifts stage from progress.last_checkpoint.stage (the opencode-claimant(poll): candidate filter reads progress.stage, but the checkpoint verb writes progress.last_checkpoint.stage — ~60 recorded yields invisible per fire, stale stages offered unsafely #7706 fix), so the same row IS a launch candidate in the claimant's view.
The two components disagree about the same row's stage: the claimant can see work the broker will not release. Any row whose top-level progress.stage was overwritten after its handed_off checkpoint (e.g. by a later awaiting_triage park) is stranded in the gap.
Fix direction: one stage source of truth — make the broker's handoff predicate read the stage the same way poll.py does (last_checkpoint.stage preferred), or stop writing a divergent top-level progress.stage on park. Add a regression test with a row carrying stage='awaiting_triage' + last_checkpoint.stage='handed_off' proving by-id claim and the pick sink branch both take it.
Refs #8187, #7706. Activitydeveloping-today commented on Nov 10, 2026 dezren39 commented on Nov 10, 2026 Folded into #8234 and fixed there, with credit to this report for naming the disagreement precisely.
Since PR #8263 (merged eb97de1, deployed 2026-11-10), sink membership is the STATUS ('handed_off') on both sides of the wire: neither the broker's pick SQL (HANDOFF_SQL) nor the claimant poll (is_handoff_waiting) reads a progress stage — top-level or last_checkpoint — to decide whether a resting row is in the sink. The stage source question therefore no longer exists for sink rows. (For CLAIMED rows the claimant's recorded-yield stage check stays: there it is the launch-safety contract, not a membership test.)
Regression coverage: broker test by_id_claim_takes_a_parked_recorded_handoff includes a handed_off row whose top-level stage ('working') and last_checkpoint stage ('handed_off') disagree — claimable either way; claimant test test_stage_source_disagreement_is_still_candidate pins the same shape on the poll side.
Task 10995's shape (recorded handoff that later took a genuine triage wait) stays 'parked' by design: the migration classifier and the park verb both let a caller-attached genuine wait win over the handoff shape, and a 'parked' row is never a sink row.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|