Repository navigation
Description
Symptom
Two yield encodings disagree, and poll.py reads the one the checkpoint verb does not write:
| writer / reader | field |
|---|---|
repo-queue checkpoint (Turso backend, pkgs/fleet/crates/fleet-queue/src/turso_queue.rs:1759) |
progress.last_checkpoint.stage |
poll.py is_candidate() (pm-stack/opencode-claimant/poll.py:123) |
progress.stage |
verb_checkpoint merges {"last_checkpoint": {"stage": <stage>, "at": <ts>}} into progress; it never writes a top-level progress.stage. Every recorded yield therefore lands in last_checkpoint.stage, while the candidate filter reads a field that holds lane work stages (verified, parked, claimed, awaiting_ci, …) and is absent on most rows.
Measured on the laptop, same snapshot, claimed opencode-lane rows with no progress.session_id:
| fire (UTC) | progress.stage ∈ {handed_off, launch_failed} |
last_checkpoint.stage ∈ {handed_off, launch_failed} |
|---|---|---|
| 2026-11-08T12:55Z | 0 | 78 |
| 2026-11-08T13:04Z | 1 | 67 |
| 2026-11-08T13:06Z | 1 | 67 |
| 2026-11-08T13:36Z | 1 | 57 |
Across all non-terminal statuses for lane opencode, 541 rows carry last_checkpoint.stage == "handed_off" and 119 of those also carry a top-level progress.stage == "handed_off"; the other 339 have no progress.stage at all.
Two failure directions
- Under-offer (the standing symptom). A real recorded yield is invisible unless the lane happened to also write a top-level
progress.stage, so the claimant's gate reads 0–1 candidates and ends the fire quietly — on the same snapshot in which ~60–90 tasks are genuinely handed off. This is the mechanism behind opencode-claimant: handed-off tasks are never launched — executed_lane/session_id stay null across repeated claim→handed_off→park cycles #6533. - Unsafe over-offer (the dangerous direction). A stale top-level
progress.stage == "handed_off"keeps a task a candidate after its lane has resumed work. Task 8067 on 2026-11-08:
"stage": "handed_off", // written 2026-11-04T12:39:59Z, never updated
"stage_at": "2026-11-04T12:39:59.900381Z",
"last_checkpoint": {"stage": "verified", "at": "2026-11-08T13:00:32Z"}The lane verified the task four days later; the strict filter still offers it for launch. Launching into a task whose claiming lane is mid-work is exactly the double-execution defect #4490 hardened against. On the 2026-11-08T13:36Z fire the same shape appears on tasks 10501 (parked_awaiting_prereqs), 10606 (probe_lane_check), 12787 (pr_opened) and 12866 (awaiting_ci).
Why this matters now
poll.py's docstring and prompt.md both describe the yield as progress.stage == handed_off; the database never stores it there. Until the two agree, candidate discovery is either blind (today's steady state) or unsafe (when a lane's old progress.stage is stale). This is independent of, and invisible behind, the repo-queue list table defect (#7325 / #7375): even with the transport fixed (which #7673 partially addresses), the filter compares the wrong field.
Suggested fix (pick one, not both)
- A. Read the recorded field.
is_candidate()accepts the yield fromprogress.last_checkpoint.stage(and keeps acceptingprogress.stagefor rows written by older paths), then rejects any row whose liveprogress.stagenames a later work stage that is not itself a yield. Updatetest_poll.py's fixtures to the shape the verb actually writes. - B. Also write the top-level field. Have
checkpoint_taskstampprogress.stagealongsideprogress.last_checkpoint.stage, so one field is authoritative for both writer and reader. This needs a backfill decision for the ~500 existing rows.
A is contained in the claimant and testable offline; B changes the queue contract for every consumer of progress.stage (the lane prompts already read it for resume), so it is the larger change.
Acceptance
- A task whose only yield marker is
last_checkpoint.stage == "handed_off"is a candidate. - A task whose
last_checkpoint.stage == "verified"(or any non-yield stage) is not a candidate even when a staleprogress.stage == "handed_off"is present. - Both directions pinned in
pm-stack/opencode-claimant/test_poll.py.
Evidence
Found 2026-11-08 by the opencode-claimant scheduled fire (shadow mode, #3026 slice 1), while reproducing candidate discovery over the queue-broker /list verb. Also recorded as a comment on #6533 at 2026-11-08T13:22Z. Read-only: no task was claimed, bound, launched, prompted or deleted.
Related: #6533 (parent symptom), #7325 / #7375 (transport read), #5508 (stale ledger binding), #4490 (double-execution guard).
Acceptance criteria
- The claimant poll filter and the checkpoint verb agree on ONE canonical yield encoding (the filter reads the field the verb writes, or the verb writes the field the filter reads — one of the two, documented in code).
- A regression test built from a checkpoint-written task row proves recorded yields (handed_off / launch_failed) are seen by the candidate filter.
- No stale stage is offered as fresh: the filter's staleness behaviour for old yield records is explicit and tested.
- On a live snapshot, the filter's yield count reconciles with the
last_checkpoint.stagecount (the ~60-per-fire discrepancy in the issue is closed).
Activity
developing-today commentedon Nov 8, 2026
CODE-2295
dezren39 commentedon Nov 8, 2026
Intake review
Related: sibling claimant defect #6533 (handed-off tasks never launched — different mechanism, same component; check for interaction before closing either); the checkpoint writer is
pkgs/fleet/crates/fleet-queue/src/turso_queue.rs, the reader ispm-stack/opencode-claimant/poll.pyper the issue's evidence table.Live check: search found no merged PR or closed issue fixing the field mismatch; the issue's own measurements are from today (2026-11-08, four fires).
Notes / risks: highest-leverage small fix in this run's intake set — every invisible yield is a task the claimant re-offers unsafely or never launches. Fix the encoding at one side only and migrate readers; a dual-write without a retirement plan recreates the drift.
Suggested approach: make
poll.pyreadlast_checkpoint.stage(the verb is the fleet-wide writer; many more writers than readers), add the row-shape regression test, then grep for otherprogress.stagereaders and record them on the issue.— fleet monitor (repo-fleet-monitor), 2026-11-08 08:12 CST run: acceptance criteria appended to the body, labels normalized,
meta/enrichedapplied.dezren39 commentedon Nov 8, 2026
🤖 Agent note · design-architect pass 74 — adopted as a phase of design #7770
files/designs/code-claimant-seam-contract.mdin the keep-the-four-repos-healthy goal workspace. Audit at origin/mainb64288a567.dezren39 commentedon Nov 11, 2026
🤖 Agent note · Phase 4 evidence (design #7770 closing audit, issue #7772, task 14782)
pm-stack/opencode-claimant/README.md(PR claimant: #7770 Phase 4 closing audit — seam contract, fire-log unknowns, stub-shape fix (#7772) #8367): queue rows are read via the broker's rich/list(poll.py_broker_post/_fetch_rows,rich: true, limit 500) with the yield lifted fromprogress.last_checkpoint.stageper 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 option A (normalize_rowonly lifts when no live stage is set, so a live later stage vetoes a stale yield).eb1f9987eb), and the CLI still has no JSON list mode (verified live 2026-11-11:listprints the human table). The pin's intent is met; the letter is not — recorded on Act only on a verified read — one seam contract for the opencode-claimant #7770 for the design thread.candidates_seen: null(PR claimant: #7770 Phase 4 closing audit — seam contract, fire-log unknowns, stub-shape fix (#7772) #8367).