Repository navigation
Description
Summary
Canary B-02 ("no queued without slots-full") has no notion of pull mode. Its premise is that a queued row with free slots and a stale drain tick means the backend's drain pipeline has stalled — but on a pull-pilot agent the backend deliberately does not drain. A row sits queued until a worker claims it, and the drain tick is irrelevant to it.
So B-02 fires critical on a perfectly healthy pilot whenever the canary snapshot lands in the window between enqueue and claim while the drain tick happens to be ≥60s old.
Observed on eu2 / cornelius-oracle (the #1766 soak pilot), 2026-09-09:
signal_query: agent cornelius-oracle: queued=1, slots=0/3 (free=3), drain_tick_age=60s > 60s
observed_state: {"agent_name": "cornelius-oracle", "queued_count": 1, "slot_count": 0,
"max_parallel_tasks": 3, "effective_max_parallel_tasks": 3, "free_slots": 3,
"drain_tick_at": 1788934006.8633769, "drain_tick_age_seconds": 60,
"drain_tick_grace_seconds": 60,
"snapshot_time": "2026-09-09T06:07:29.866400Z"}
The queue was empty moments later and the pilot's M4 (lost/phantom) has been clean across every hourly sample. Nothing was wrong.
Cause
canary/invariants/b02_no_queued_without_slots_full.py allows exactly two legitimate reasons for a queued row, and both are push-shaped:
- slots are at the cap — irrelevant to a pilot, whose admission is the worker pool, not the ZSET;
canary:drain_tick_atis fresh — irrelevant to a pilot, becauseCapacityManager.run_maintenance()will never drain that row.pull_owns_dispatchmakes the pilot flag a true either/or (fix(pull): make the pilot flag a true either/or + soak measurement set (#1766) #1982): "the backend neither pushes them nor drains them."
Neither holds for a pilot, so any queued row observed at the wrong instant is a critical violation.
This is the same class as the two lease-awareness gaps already closed — E-05 (by #1766) and E-01 (by #1990) — plus S-01's leased-row exclusion. B-02 was missed in that sweep. Confirming the gap is general: grep -rl 'pull_pilot\|PULL_MODE_PILOT\|pull_owns_dispatch' src/backend/canary/ returns nothing. No invariant knows pull exists.
lease_expires_at is stamped at claim; a row that is still queued has no lease. The offending row is pre-claim by construction, so excluding leased rows changes nothing here.
Why it matters beyond one false positive
- It contaminates the Production soak-test of pull/work-stealing coordination (#1081) before default-on #1766 acceptance criterion. That issue requires "canary green throughout", and the one B-02 firing in the table lands on the soak pilot. Any window has to argue this away rather than report it clean.
- Exposure grows with the pilot set. Two more pilots were added on
eu2on 2026-09-15 (oracle-6-science,oracle-7-ai-semi), both cron-driven, so there are now three agents whose queued rows can be caught mid-flight instead of one. - It is not retired by Phase 5. feat: pull / work-stealing coordination (push→pull dispatch) #1081's Phase 5 deletes canary S-01/S-02/S-03. B-02 is not on that list, so at default-ON — when every agent's rows pass through
queuedon the way to being claimed — B-02 as written becomes permanently and universally wrong, not occasionally wrong.
Frequency
Rare, because it needs the 5-minute canary snapshot to coincide with a sub-second enqueue→claim window and a ≥60s-stale drain tick. On eu2, exactly 1 firing in 38 days of canary_violations history (2026-08-04 → 2026-09-11) — against 30,060 E-06, 2,737 S-03, 244 R-01 and 23 S-01 in the same period. Low volume; wrong verdict; critical severity.
Suggested fix
Make B-02 pull-aware rather than skipping pilots outright — skipping would open a real coverage hole. If a pilot's workers all die, its rows sit queued forever with no lease, so E-01's grace-bounded lease check never sees them either (no lease to be overdue) and nothing fires at all. Today M4 is that scenario's only owner, and M4 is a manual soak query, not an invariant.
The shape that keeps the coverage: for an agent where pull_owns_dispatch is true, replace the drain-tick condition with a queue-age condition — a row queued longer than some multiple of the worker long-poll interval is the genuine violation, because a healthy pilot with a free worker claims within one poll. That catches "the workers stopped polling", which is the pull-mode equivalent of "the drain stalled", and it ignores the instantaneous enqueue→claim window that produces the false positive.
Acceptance criteria
- B-02 does not fire on a pilot agent whose queued row is claimed within a normal poll interval
- B-02 does fire when a pilot's workers stop claiming (rows age in
queuedwith no lease) — verified, not assumed - Push-path behaviour unchanged
- The Phase-5 disposition of B-02 is stated (it is currently absent from feat: pull / work-stealing coordination (push→pull dispatch) #1081's deletion list)
- A test covers the pilot case, so the next invariant sweep does not miss it again
Notes
- Parent: feat: pull / work-stealing coordination (push→pull dispatch) #1081. Relevant to Production soak-test of pull/work-stealing coordination (#1081) before default-on #1766's "canary green throughout" AC.
- Found while adding two cron-driven pilot arms on
eu2for the Production soak-test of pull/work-stealing coordination (#1081) before default-on #1766 soak.
Activity
obasilakis commentedon Sep 16, 2026
Operator decision, 2026-09-16 (@obasilakis): Open Question 7 resolves to the edge adapter — human-interactive chat goes on the durable queue, and the push coordination path is deleted rather than kept alongside. Full record on #1989; work created as #2842 and #2843.
This changes the fix for this issue. Under one queue, every agent's rows pass through
queuedon the way to being claimed, so B-02 as written is not occasionally wrong — it is universally wrong. Making it pull-aware would be building a detector for a condition that is about to become the normal state.Revised disposition: retire B-02 alongside S-01/S-02/S-03 in Phase 5 rather than teach it about pull. The interim question is only whether it is worth a stop-gap carve-out for pilot agents in the meantime, given it has fired exactly once in 38 days on
eu2— I would say no, and instead treat its firings as expected noise on pilots until Phase 5 removes it.The coverage gap noted in the body still needs an owner either way: if a pilot's workers stop claiming, its rows sit
queuedwith no lease, and nothing fires. That belongs to whatever replaces the slot/backlog invariants, not to B-02.obasilakis commentedon Sep 25, 2026
/claim
github-actions commentedon Sep 25, 2026
Claimed by @obasilakis. Label
status-in-progressadded.Next steps:
feature/2840-<short-slug>Fixes #2840obasilakis commentedon Sep 28, 2026
Operator decision (@obasilakis): B-02 is repurposed, not retired. This supersedes the 2026-09-16 comment above. B-02 now checks that work meant to be pulled is being pulled, and it survives Phase 5 as that check; its push arm is deleted with the slot ZSET. Implemented in #3048.
docs/planning/PULL_MIGRATION_STATUS.md.fix(canary): B-02 judges pull pilots by their own worker pool, and B-…
fix(canary): B-08 owns every pull-pool state that lasts until an oper…
fix(canary): B-02 judges pull pilots by their own worker pool; B-08 c…