Repository navigation
fix(fleet-queue): staleness retire no longer eats dispatch/slice packets; retirements visible in history (#14268) - #14292
Merged
Conversation
…ets; retirements visible in history (#14268) Mechanism (verified against the fleet-queue DB, not just the client): all four eaten packets (22913, 22927, 22966, 22984) were retired by the claim-time staleness check (#10626) exactly as designed — result outcome `already_done` with tier-1 evidence and a `staleness_autocomplete` event are on every row. The check keys only on the packet's linked issue/PR state; it cannot tell a task ABOUT an issue from a task whose work ARISES from one: - 22913/22927 (triage): the packet's work was filing five NEW issues from the #5834 design record. #5834 was closed 38 s before the packet was even created — by the lane that then filed the packet with a `dedupe_override` deliberate-parallel reason. - 22966/22984 (feature_slice): the #12428 NixOS handoff slices; their parent issue had been closed (2026-11-22) while the work stayed live under it. Fix, in staleness_verdict (shared by the claim-time and filing-time checks): - A packet carrying a non-empty `dedupe_override` reason is never auto-retired: the override is the filer's recorded assertion that the packet is not the issue's canonical task. (A boolean `true` still parses as no override, matching work_identity.) - A feature slice (CompletionClass::Slice) is never retired on an issue link alone: a slice delivers an artifact and its parent issue's state is not its completion. The slice's own linked PR landing still retires it. The legitimate #10626 behaviour is unchanged: a plain triage / second-pass / fix packet for a verifiably closed issue or merged PR still retires at claim with its result + event paper trail. Visibility (why four lanes all "verified" zero history and no result): both client surfaces that assemble a task's history (cmd_show, cmd_timeline) queried a fixed event-kind list that omitted `staleness_autocomplete` — the one event a retirement writes — and show never surfaces the result column. The retire was therefore invisible through every client read path. Both lists now query the kind, with a source-assertion test beside the #6985 precedent. Oracle: staleness_verdict unit tests with a stubbed landing lookup — the eaten shapes (override triage, parent-closed slice) now claim; the boolean-override and merged-PR slice shapes still retire; the pre-existing #10626/#12966 verdict tests stand unchanged. Full suite: cargo test -p fleet-queue --features client,queue-broker — 641 passed, 0 failed.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
#14268: four queue packets (22913, 22927, 22966, 22984) reached terminal
doneseconds after claim with no deliverables, and every client read path showed zero history events and no result.Mechanism (verified in the fleet-queue DB)
All four were retired by the claim-time staleness check (#10626) exactly as designed — each row carries result
{"outcome":"already_done", staleness:{tier 1, …}}and astaleness_autocompleteevent. The check keys only on the packet's linked issue/PR state; it cannot distinguish a task about an issue from a task whose work arises from one:dedupe_overridedeliberate-parallel reason.And the "zero history / no result" half was a client blind spot:
cmd_showandcmd_timelinequery a fixed event-kind list that omittedstaleness_autocomplete— the one event a retirement writes.Changes (
staleness_verdict, shared by claim-time and filing-time checks)dedupe_overridereason is never auto-retired — the override is the filer's recorded assertion that the packet is not the issue's canonical task. (Booleantruestill parses as no override, matchingwork_identity.)CompletionClass::Slice) is never retired on an issue link alone — a slice delivers an artifact; its parent issue's state is not its completion. The slice's own linked PR landing still retires it.cmd_show/cmd_timelinenow querystaleness_autocomplete, with a source-assertion test beside the queue: task 11164 claimed by two lanes concurrently (code-a and code-x) — claim atomicity violated #6985 precedent.Legitimate #10626 behaviour is unchanged: plain triage / second-pass / fix packets for verifiably closed issues or merged PRs still retire at claim, with the result + event paper trail.
Tests
Oracle:
staleness_verdictunit tests with a stubbed landing lookup — the eaten shapes (override triage against a closed issue; slice against a closed parent) now claim; boolean-override and merged-PR-slice shapes still retire; pre-existing #10626/#12966 verdict tests unchanged. Full suite on the laptop:cargo test -p fleet-queue --features client,queue-broker— 641 passed, 0 failed.Deployment note: broker + client ship in the fleet-static binary; the gates take effect at the next fleet-static pin/broker generation bump (the gen-9 pattern). Until then, handoff/slice packets for closed parent issues should keep carrying
staleness_check: falseor be filed after reopening the parent.{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-24T10:23:36Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": null, "model": null, "lane_start_issues": [], "workspace_ref": null, "auth_subject": "archer", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.