Skip to content

fix(fleet-queue): outbox reconcile must not trust GitHub search absence — live trial 2 created a duplicate (from #3706) #8331

Closed

Description

@dezren39

Fix: outbox reconcile must not trust GitHub search absence (live trial 2 duplicate)

Found by the live trials for the creation outbox pilot (#3706, task 14666, 2026-11-10) against scratch repo dezren39/fleet-outbox-trial-3706.

What happened

Trial 2 (kill/restart): entry ob-1794350127-ac5b929eacf5 was claimed by a drainer that "landed its create then died" (issue #6 on the scratch repo, created manually with the entry's marker, exactly as a crashed drainer's landed create would look). After the 120s lease expired, a fresh drain claimed the row as uncertain (correct) and ran find_by_marker — which searches via the GitHub search API. The search returned nothing for an issue created ~2.5 minutes earlier (search indexing lag), the drainer treated that as proven absence, and re-created: duplicate issue #7 with the same marker. The row resolved done against #7.

Defect

find_by_marker (pkgs/fleet/crates/fleet-queue/src/client.rs) uses GitHub search as its only source. Search is eventually consistent; "not in the index yet" is indistinguishable from "does not exist", so the reconcile path can duplicate precisely in the crash window it exists to protect (a create that landed seconds-to-minutes before the restart).

Fix direction

Before concluding absence, the reconcile must check a strongly consistent source: list the repo's recent issues via the REST list endpoint (issues list is not search-indexed) and scan bodies for the marker — at minimum the most recent N issues / issues created since the entry's lease start. Only if BOTH search and the list scan find nothing may the drainer re-create. Add an oracle test: marker present in list results but absent from search results reconciles, never duplicates.

Evidence

Activity

  1. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 10, 2026
  2. developing-today commented on Nov 10, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    Cross-link: the search leg in find_by_marker is a POST (gh api search/issues -f ...) that returns 404 every time, and a failed lookup is treated as absence — details and repro in #8361. That is the mechanism under this duplicate; index lag may still apply once the call is fixed. Comment-kind reconcile gap: #8363.

  4. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Released to the queue under Drew's 2026-11-13 unblock-all order (main chat, 23:53 CT). Task(s) 15289 moved from blocked/parked to queued in the fleet unblock-all pass (worker main-unblock-all-2026-11-13). Dependency gates still recorded on a task remain recorded — the dependency checker will re-block it if a gate is genuinely unmet.

  5. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged

    Verified against current main (2026-11-14)

    Read pkgs/fleet/crates/fleet-queue/src/client.rs from main directly. find_by_marker (line 4074):

    So the three sibling issues split cleanly: two mechanisms fixed, this one's prescribed leg missing. Triage labels: task/small-fix, priority/normal, effort/m added (the issue had none of kind/priority/effort).

    Routing — MID-SHIFT FALLBACK (backend failure)

  6. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Picked up by repo-worker-any-d — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-any-d posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  7. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 14, 2026
  8. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Progress from repo-worker-any-d: triaged: outcome recorded in agent note 6877322132; releasing done

  9. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Released by repo-worker-any-d (outcome: done). Triaged (queue task 15289, MID-SHIFT FALLBACK after backend failure at enqueue): verified on main client.rs that #8361/#8363 fixes are in but find_by_marker still concludes Absent from search alone; follow-on fix packet fully specified on issue #8331 (note 6877322132) and preserved at goal hidden_files/pending-packet-code-8331-from-task-15289.json — enqueue pending backend recovery (dedupe repo-health:v1:fix:developing-today/code:issue:8331)

  10. 11 remaining items

  11. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 16, 2026
  12. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: picked-up
    task: 16859
    issue: #8331
    lane: code-c (Muse, repo-worker-code)
    stage: claimed

    Picked up task 16859 this shift (2026-11-16T14:21Z); lane assignment row 8564 is direct, so this lane does the work itself. Fresh revalidation: issue #8331 OPEN, no hard-stop labels, already triaged (task/small-fix, priority/normal, effort/m); siblings #8361 and #8363 CLOSED; no open PR for #8331.

    Next: create laptop worktree from current main, re-read find_by_marker in pkgs/fleet/crates/fleet-queue/src/client.rs, implement the REST issues-list scan leg before any Absent conclusion for issue-kind entries (CouldNotCheck on any list failure), and add the oracle tests (list-hit/search-miss -> Found; both-absent -> Absent; list failure -> CouldNotCheck).

  13. added a commit that references this issue on Nov 16, 2026
  14. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: done
    task: 16859
    issue: #8331
    lane: code-c (Muse, repo-worker-code)
    stage: done

    Fixed and merged. PR #10782 (branch queue/16859-8331-outbox-list-scan, commit 6c104c5) merged as 4a80605; this issue closed by the merge.

    What landed: for issue-kind entries, find_by_marker (pkgs/fleet/crates/fleet-queue/src/client.rs) no longer concludes Absent from the search leg alone. A new find_issue_in_recent_list leg pages the REST issues list (repos/{repo}/issues?state=all&sort=created&direction=desc, 100/page, 5-page bound covering the 500 most recent issues) and scans bodies for the entry's fleet-outbox marker: Found on a hit; Absent only when the scan terminates with no marker in either leg; CouldNotCheck on any list failure, misshaped page, or an unterminated listing at the bound (issues_list_unbounded) — the same discipline as #8361/#8363. Comment-kind entries and claim/lease semantics are unchanged.

    Tests: 4 new oracle tests (list-hit/search-miss -> Found; both-absent -> Absent; list failure -> CouldNotCheck; list shape -> CouldNotCheck). The pre-existing checked-absent fixture was split so its stub answers the list call with an empty array; its Absent assertion is unchanged. Verified on the laptop: cargo test -p fleet-queue --all-features — 357 lib tests pass including all #8361/#8363 fixtures, integration suites pass; cargo fmt check clean. Codex review failed to run on this PR (usage limits, zero findings) and CodeRabbit was rate-limited; both dispositioned here.

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

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workepic/fleet-orchestrationReprioritization program epic (2026-11-12)priority/normalOrdinary priority (the default)status:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions