Skip to content

fix(queue): parked-handoff stage source mismatch — broker reads progress.stage, claimant poll reads last_checkpoint.stage #8192

Closed

Description

@dezren39

fix(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):

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.

Activity

  1. developing-today commented on Nov 10, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions