GeezerVison is showing github.com — fix(queue): broker never re-serves condition parks or completed work (#13091) by dezren39 · Pull Request #13143 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
What
Fixes the broker double-serve behind the five 2026-11-23 incidents: tasks that were already parked with a recorded stand-down, or completed with a verified disposition, were served to lanes again.
Closes #13091
Root cause — two broker-local holes
-
Condition parks were timer-released by the pick. verb_park stamps a not_before on every park (default +1200s), and default_pick_predicate's parked branch released every park on that timer — including parks whose recorded term is a broker-owned condition (task_terminal / task_status / event_seen, which the park-revalidation sweeper in core.rs exists to release) or a person's answer (person_answer, releasable only via /wake when the person acts). Task 21123's ~23-minute re-serve cycle is exactly the default park timer. Genuine waits (time/ci/review/capacity/triage/external) keep timer release — for them, claim-at-not_before is the designed release path (FDR-0008), and no automated /wake caller exists.
-
Completed work was re-served through enqueue. A done row itself is unservable in every claim path, but a re-filing for the same work manufactured a fresh servable row: revive-on-enqueue (fleet-queue (turso): no revive/requeue verb — dead-at-cap tasks can only be reset via direct SQL; enqueue dedupe ignores status #6838) fired for any terminal predecessor, and the fleet queue: duplicate-task suppression at filing time on the (repo, issue, kind) work identity #10627 work-identity rule ignores terminal holders by design, leaving detection to the claim-time staleness probe — which fails open by standing rule. Task 21296 (duplicate of completed 17123 for Separate historical signature validity, current key status and local trust #10283) is this shape.
Fix
claim.rs: new PARKED_TERM_EXCLUSION constant (ready_condition.kind NOT IN ('task_terminal','task_status','event_seen','person_answer'), literals only — the predicate's pinned placeholder count is unchanged), ANDed into the parked branch of default_pick_predicate, so the pick SELECT and the claim UPDATE re-check both carry it. Mirrored in the two documented diagnostic mirrors (budget_skip_sql, no_claim_counts_sql parked_due) in lifecycle.rs. Expired-claim re-serve (expire_leases) is untouched.
claim.rs verb_enqueue: a done predecessor on the same dedupe key is now a dedupe hit (the completed row is returned; no INSERT, no revive) unless the packet declares dedupe_override. Failed/cancelled predecessors still revive.
work_identity.rs + claim.rs: new done_identity_holder — a completed holder of the packet's work identity absorbs a differently-keyed filing the same way a live holder does, with work_identity_collision.rule = "done_work_identity". Module doc updated: failed/cancelled never block; completion does, because the broker knows its own completions locally (no probe, nothing to fail open).
Tests
Five regression tests in turso_queue.rs (fail-before verified: the same-key test reproduced the incident exactly — the broker returned a fresh task with revived_from: {task_id: 4242, status: "done"}; the pick test showed a task_terminal park servable):
enqueue_after_completion_on_the_same_key_files_no_new_task_13091
enqueue_after_completion_under_another_key_files_no_new_task_13091 (dispatch-suffixed key)
enqueue_done_predecessor_with_override_files_a_deliberate_parallel_13091 (control)
enqueue_failed_predecessor_still_revives_13091 (control)
claim_pick_never_serves_broker_or_person_condition_parks_13091 (the pick predicate evaluated per-row in rusqlite: queued/timed/ci-condition/legacy parks stay servable; task_terminal/person_answer/event_seen parks and done rows do not)
Full crate suite: 540 passed / 0 failed (cargo test -p fleet-queue --features queue-broker --lib), run in the sandbox before the remote-only directive landed; clippy (1.99) reports no warnings in the new code.
Remote verification — dispatch attempted, blocked by tooling
Per the remote-only build directive I attempted dispatch three ways; all three are blocked outside this change:
fleet queue dispatch --repo developing-today/code --ref xaltha/13091-broker-double-serve --command 'cd pkgs/fleet && cargo test -p fleet-queue --features queue-broker --lib' --dispatch --json — the installed fleet build's internal GitHub client fails from this sandbox (FLEET_GH_RAW=1: invalid peer certificate: UnknownIssuer on the direct leg; without it, the pre-fix(fleet): parse the personal token on the cache-daemon path too #12500 hosts-yml token bug: failed to parse header value).
gh workflow run fleet-command.yml --repo developing-today/fleet … — GitHub API rate limit for the dispatching identity (403 at 2026-11-23 09:08–09:09 UTC, request IDs in the progress note on fix(queue): broker re-serves parked and completed tasks (double-serve) #13091).
fleet shell --target actions — not present in this build.
This PR's own CI is the remote run of record until the dispatch path clears; the dispatch command above can be re-run verbatim by any lane to reproduce it.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…13091)
Two serve-path holes let the broker hand out work that was
already dispositioned, five times on 2026-11-23:
- verb_park stamps a (possibly default) not_before on every park,
and the default pick released every park on that timer —
including parks whose recorded term is a broker-owned condition
(task_terminal/task_status/event_seen, released by the
park-revalidation sweeper) or a person's answer (person_answer,
released by /wake). Lanes receiving those rows could only
re-park them. The pick predicate now ANDs PARKED_TERM_EXCLUSION
into the parked branch (mirrored in the budget-skip and
no-claim-count diagnostics); all other parks keep timer release,
and expired-claim re-serve is untouched.
- A done row is unservable, but a re-filing for the same work
manufactured a fresh servable row: revive-on-enqueue fired for
any terminal predecessor, and the #10627 work-identity rule
ignored terminal holders, leaving detection to the fail-open
claim-time staleness probe. Enqueue now treats a completed
predecessor (same key) and a completed identity holder (any
key) as dedupe hits, exactly like live ones. Failed/cancelled
predecessors still revive, and dedupe_override still files a
deliberate parallel.
Regression tests pin both halves: enqueue after completion on
the same key and under a dispatch key files no new task, the
override and failed-predecessor controls still file, and the
pick predicate evaluated per-row never serves broker/person
condition parks or a completed row.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 58 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8d9a9eed-d06b-4ce6-8bcd-09c543fa6df5
Commits
-
Reviewing files that changed from the base of the PR and between 1d2cfed and f7f45d6.
Files selected for processing: 4
-
pkgs/fleet/crates/fleet-queue/src/turso_queue.rs
pkgs/fleet/crates/fleet-queue/src/turso_queue/claim.rs
pkgs/fleet/crates/fleet-queue/src/turso_queue/lifecycle.rs
pkgs/fleet/crates/fleet-queue/src/turso_queue/work_identity.rs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-23T09:13:10.002086Z |
f7f45d6 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7f45d6792
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+114
to
+118
|
|
if let Some(row) = terminal
|
|
|
.as_ref()
|
|
|
.filter(|r| r.get("status").and_then(|v| v.as_str()) == Some("done"))
|
|
|
{
|
|
|
return Ok((row.clone(), None, None));
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve triage recovery when its fix follow-on fails
When a triage task completes and its fix follow-on later fails or is cancelled while the issue remains open, this returns the completed triage instead of restoring live coverage. admin.rs explicitly treats triage completion as unfinished issue work and creates the follow-on; /coverage excludes completed tasks, and scripts/fleet/queue-reconcile/check_coverage.py files uncovered issues using the original triage key without dedupe_override. Every subsequent reconciliation therefore succeeds without creating claimable work. Preserve this recovery path in both the key-level and completed-identity checks rather than treating completed triage as completed issue work.
AGENTS.md reference: AGENTS.md:L69-L71
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+2215
to
+2216
|
|
pub(crate) const PARKED_TERM_EXCLUSION: &str = "COALESCE(json_extract(ready_condition, '$.kind'), 'time') \
|
|
|
NOT IN ('task_terminal', 'task_status', 'event_seen', 'person_answer')";
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable condition release before removing the timer fallback
With the repository's default sweeper configuration, these condition parks now remain parked even after their conditions are satisfied. home/common/default.nix configures fleet-queue-sweeper to send observe_only=true unless an external revalidator-mode file contains enabled, and core.rs::revalidate_parked explicitly skips task mutations in that mode. Removing claim-time eligibility therefore removes the only automatic release path in the default configuration. Enable mutating revalidation as part of this change, or otherwise provide a condition-aware release path before excluding these rows from picks.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 23, 2026
This was referenced Nov 27, 2026
This was referenced Nov 27, 2026
developing-today-fleet Bot
added a commit
that referenced
this pull request
Nov 27, 2026
…s fail (#16007)
A completed triage task is not completed issue work: it completes
by filing its fix follow-on (#7016). PR #13143 (#13091) made
completed rows absorb re-filings for every kind, so when a triage
follow-on later failed or was cancelled, reconciliation's re-filing
of the standard triage key returned the old done triage row in both
the dedupe-key terminal check and the done work-identity check,
/coverage excludes completed rows, and the still-open issue stayed
uncovered with no claimable task (PR #13143 review finding
4663760252).
verb_enqueue now consults triage_recovery_filing in both
absorption paths: for a triage filing, when no live or completed
fix follow-on covers the issue (every follow-on failed/cancelled,
or none landed), the filing falls through and creates a fresh
claimable triage task — the same-key path keeps the revive
bookkeeping that links it to its completed predecessor, so the
/coverage read-back afterwards sees a live task for the issue.
Completed non-triage work still absorbs duplicate filings, a live
or completed follow-on still absorbs a triage re-filing, and
dedupe_override still permits deliberate parallel work.
Regression oracles (#16007): triage_recovery_needed covers failed
and cancelled follow-ons, live/completed coverage, and the
no-follow-on state; a wiring oracle asserts both done-absorption
paths in verb_enqueue check triage recovery (same-key and
same-work-identity re-filings).
Lane 0252-K (agent work loop bravo SUSTAIN).
developing-today-fleet Bot
pushed a commit
that referenced
this pull request
Nov 27, 2026
The scheduled revalidator ran observe-only by default (C3 landing
mode), so satisfied task_terminal / task_status / event_seen parks
stayed parked even though the #13143 pick exclusion keeps them out
of timer-serve. Live observe sweep confirmed the strand: 2 parks
would release but stay parked.
- verb_sweep observe_only default true -> false (opt-in dry run
with observe_only=true); doc comments updated.
- fleet-queue-sweeper defaults to mutating; write "observe" to
~/.config/queue-broker/revalidator-mode for a dry run.
- Regression oracle: default sweep (no observe_only flag)
releases satisfied broker-condition parks, stamps unsatisfied
ones, and never releases person_answer parks.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|