Repository navigation
Open
Labels
app/fleetpkgs/fleet multicall binary + platform cratespkgs/fleet multicall binary + platform crateseffort/lLarge: multi-day or open-ended; expect staged check-insLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestNew feature or capability requestpriority/normalOrdinary priority (the default)Ordinary priority (the default)task/small-fixQueue packet kind: bounded fix with reproduction and targeted testsQueue packet kind: bounded fix with reproduction and targeted tests
Description
Measured waste this attacks
From the outcome-taxonomy measurement (2026-11-16,
outcome-taxonomy-2026-11-16.md; trailing 7d, fleet-queue Turso +
GitHub closedAt/mergedAt vs first-claim times):
- 652 of 2,344 non-triage completions (27.8%) were pre-done: the
linked issue was already closed / the linked PR already merged
before the task was claimed. No work remained when a lane picked
the task up. - 625 of the 652 were already done before the task was created.
Sampled packets carrypayload.issue.state_checked_atof
2026-10-25 — the filing pipeline emitted tasks from a ~3-week-old
state snapshot and nothing re-checked issue state at enqueue or
at claim. Median creation→claim wait is ~0h, so a claim-time
check catches essentially the whole class regardless of which
side (filing or queueing) introduced the staleness. - Cost shape: median disposition is ~1 minute (a session still
spawns, verifies, and closes the task), 85.9% close <5 min after
claim — and 72 tasks burned ≥30 minutes (max ~78h across park
cycles) on work that no longer existed. - A further 155 completions (6.6%) were sibling_done — the work
landed while the task ran. A claim-time check cannot catch
in-flight races, but re-checking at claim (not at filing) shrinks
the exposure window to the run itself.
Proposed mechanism
In the queue claim path (broker claim verb, before a task is
handed to a lane):
- Resolve the task's linked work from its packet:
payload.issue(repo + number) andpayload.prs[]/
result.prwhere present. - One GitHub read for state: issue
state/closedAt, PR
state/mergedAt. (The work-failures recompute already
maintains exactly this data in a landing-times cache —
landing-times-cache.json, GraphQL batches of 50, terminal
facts cached permanently, open items refreshed at 24h. Reuse
the pattern; do not build a second fetcher.) - If the issue is closed or a linked PR is merged with a
timestamp at or before the task's creation time (strongest
signal) — and in a second, separately-flagged tier, at or
before claim time — complete the task immediately:- outcome
already_done, with evidence recorded on the result
(closed_at / merged_at, source ref, checked_at); - a dedicated event (e.g.
staleness_autocomplete) so the
daily measurement can count interceptions; - no session is bound, no lane slot is consumed.
- outcome
- Fail open, always: any lookup error, timeout, rate limit, or
missing linkage → the claim proceeds exactly as today. A failed
or stale read never blocks or idles work (standing rule,
2026-10-30). Bound the check with a short timeout and the cache
so claim latency is unaffected in the common case. - Apply the same state re-check at filing time for packet
generators: a packet whosestate_checked_atis older than a
small bound (proposal: 1h) must re-verify issue state at enqueue
or be stamped so the claim path checks it first. (The claim-path
check in step 3 is the safety net and ships first; this step
stops the stale-snapshot class at its source.)
Out of scope: tasks with no linked issue/PR (nothing to check —
they claim as today), and any change to what counts as a valid
packet (that is #5444's territory; this check runs on packets that
already pass validation).
Relation to existing issues
- code#9178 (fleet queue: resume-by-session, claim-any-task,
and manual-only items) — this is a claim-path behavior and
belongs with its claim-semantics work: the staleness check is a
pre-dispatch gate inside the same verb family, and its
auto-complete outcome must compose with fleet queue: resume-by-session, claim-any-task, and manual-only items #9178's claim/override
semantics (an owner override must be able to force-claim a
staleness-completed task's successor deliberately). - code#5444 (packet-validation quarantine) — related only as
the other large source of wasted claims (447 tasks currently
frozen; 322 completions in 7d passed through a freeze). The two
fixes are independent: repo-queue: claim can hand out a payload-null task, and list views cannot recover a live claim by lane #5444 rejects malformed packets, this
check retires well-formed packets whose work is gone. Neither
should be gated on the other.
Acceptance criteria
- A task filed for an issue that is already closed (or whose
linked PR is already merged) completes via the staleness path:
status done, outcomealready_donewith evidence fields, a
staleness_autocompleteevent, and nolane_session_bound
event and no session attached to the task. - A task whose issue closes between filing and claim is caught at
claim (tier-2), with the same evidence trail. - With GitHub unreachable or the lookup erroring, the same tasks
claim and run normally (fail-open test). - A task on a live, open issue claims byte-for-byte as today.
- Claim latency: p95 added latency < 2s with a warm cache; the
check times out open rather than queueing behind GitHub. - Measured effect: within 7 days of deployment, the daily
work-failures recompute shows pre_done completions for tasks
created after the fix trending to ~0, replaced by
staleness_autocompleteevents that consumed no session.
Metadata
Metadata
Assignees
Labels
app/fleetpkgs/fleet multicall binary + platform cratespkgs/fleet multicall binary + platform crateseffort/lLarge: multi-day or open-ended; expect staged check-insLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestNew feature or capability requestpriority/normalOrdinary priority (the default)Ordinary priority (the default)task/small-fixQueue packet kind: bounded fix with reproduction and targeted testsQueue packet kind: bounded fix with reproduction and targeted tests
Activity
developing-today commentedon Nov 16, 2026
CODE-3856
dezren39 commentedon Nov 17, 2026
🤖 Agent note · picked up + triaged
pkgs/fleet/crates/fleet-queue(client.rs and the broker claim flow).task/small-fix(label added) · priority/normal · effort/l (both kept) — plus status/triaged and queue/queued for the follow-on.staleness_autocompleteevent + no session, tier-2 behind its flag, fail-open always with the latency bound, and the fleet queue: resume-by-session, claim-any-task, and manual-only items #9178 override interaction recorded. The filing-time re-check (step 5) is either implemented or filed as a follow-on issue by the claimer — the packet names it so it cannot evaporate.repo-health:v1:fix:developing-today/code:issue:10626→ enqueued as task 20661 (queue repo-health-code-pilot, status queued, priority 30; packet file hidden_files/19330-fix-packet-10626.json).dezren39 commentedon Nov 18, 2026
Fresh revalidation — 2026-11-18: #10626 remains OPEN, and no matching open PR was found. The packet is a Rust queue claim-path implementation with cache reuse, fail-open latency behavior, event/no-session semantics, and an acceptance suite; its own timebox is 45 minutes. This requires a dedicated implementation session/worktree, so task 20661 is parked rather than started in the scheduled lane. backlog_updated: false.
4 remaining items
dezren39 commentedon Nov 18, 2026
agent-note:v1
state: picked_up
task: 20661
lane: oc-code-06 (OpenChamber scheduled lane, worker repo-worker-code)
stage: claimed -> verified
Claimed task 20661 via the one-queue atomic claim (filter repo = code). Fresh GitHub verification: #10626 is OPEN; no matching open implementation PR found in the current issue history/current cross-repo search. No hard-stop labels (held, user/owned, do-not-merge, do-not-auto-edit). The issue is assigned to Drew; this task remains explicitly assigned in the queue, and I will not touch any Drew-owned PR. Resuming prior checkpoint: claim path files were located, landing-times fetcher was not; no branch/worktree was recorded. Next: locate prior work/branch and the landing-times cache, then proceed only if within the task lease.
dezren39 commentedon Nov 18, 2026
agent-note:v1
state: done
task: 20661
lane: oc-code-06 (OpenChamber scheduled lane, worker repo-worker-code)
stage: verified -> already_done
Fresh terminal verification: issue #10626 remains OPEN; PR #11799 is MERGED at dcee647. Its merged implementation covers the claim-path staleness check, tier behavior, fail-open semantics, tests and #9178 override interaction. No code or competing PR was created by this lane. Important remaining scope: #11799 explicitly says the filing-time re-check (mechanism step 5) is not included; the follow-on issue required by task 20661 has not been located. Completing task 20661 as already_done based on the merged claim-path implementation; this remaining filing-time phase should be tracked separately.
dezren39 commentedon Nov 21, 2026
Builder's Advocate live evidence — 2026-11-20 23:00 CST
Conductor session
ses_e5e0386387affeulDO3uKn9rUZfound repo-queue task 20859 stillqueued(priority 20; age 1d 09:49) fordeveloping-today/code#12063, while #12063 had already closed asstatus:doneat 2026-11-21T04:08:40Z and its fix PR #12064 is merged. The conductor explicitly skipped dispatch rather than spend a session on the stale task. At 23:02 CST the task remained queued (age 1d 09:53). This directly reproduces the pre-claim staleness gap tracked here; no duplicate filed.Acceptance from this issue: before claim, auto-complete or otherwise make unclaimable a queued task whose linked issue is closed or whose linked fix PR is merged, without launching a session.
dezren39 commentedon Nov 22, 2026
Merged work, still open. Every pull request that references this issue has merged (#11799, #11802) and none is open, but the issue kept
status:in-review. Tasks that name it as a blocker have been waiting on it.status:in-reviewis removed. Whoever takes this next: run the issue's done check against main. Close the issue if it passes; if not, list what is left here and carry on with it (AGENTS.md, "Finishing work").By: Claude, 2026-11-22 flow review.
Generated by Claude Code
dezren39 commentedon Nov 23, 2026
🤖 Agent note · claim (verification/reconciliation pass)
staleness.rs), yet the issue is still open.staleness_autocompleteevidence, then close with evidence or name the precise remainder.dezren39 commentedon Nov 23, 2026
🤖 Agent note · verification record (lane GG, archer)
Premise verdict: implementation landed via PR #11799 (merged 2026-11-18,
dcee6477911) —pkgs/fleet/crates/fleet-queue/src/turso_queue/staleness.rs, wired into the claim path atlifecycle.rs(stale_pick→retire_stalebefore binding). Issue was still open with merged work (the 2026-11-22 note), so the open remainder was verification, not code.Acceptance criteria, verified on main @
867f9cb71a3:already_donewith evidence (closed_at/merged_at, tier, checked_at), onestaleness_autocompleteevent, no session bound — testclosed_before_creation_is_tier_one+claim_path_checks_before_binding_and_only_on_the_default_pick.closed_between_filing_and_claim_is_tier_two; tier recorded separately in evidence;FLEET_STALENESS_TIER2=0disables it.a_failed_lookup_stands_the_check_down,probes_without_landing_support_fail_open,no_probe_means_no_check.open_unknown_or_unlinked_claims_as_before.landed_facts_are_cached); the broker probe is bounded so a claim never queues behind GitHub (queue_broker.rs). p95 latency not independently measured in this pass.Test run (laptop worktree off origin/main):
cargo test -p fleet-queue --features queue-broker staleness— 11 passed / 0 failed.Remainders → #12966: (a) proposal step 5, the filing-time
state_checked_atre-check — generators write the stamp, nothing reads it; the claim-path net covers the class, so this is source-side hygiene; (b) the criterion-6 measurement, after which this issue can close.#10626 stays open on criterion 6 only; its implementation criteria (1–5) are verified landed.