Files
orca/config
Brennan Benson 76876aaf28 fix(orchestration): decide queued mail by batch membership, not sequence
The queued-mail probe asked whether an unread row existed with a sequence
above the outstanding Delivery's highest. Mailbox routing moves rows with
`UPDATE ... SET to_handle` and never rewrites `sequence`, so mail released
from a settled Dispatch, or from a deferred direct handle, enters the Run
mailbox carrying an older sequence. Such a row is unread, not a member of
the replayed batch, and genuinely queued behind it -- but the probe reported
`queuedMatchingMessages: false`, which renders as no warning at all. A
coordinator waiting on a `worker_done` saw a replayed batch and no reason to
suspect the message it was waiting for was one ack away.

Test membership against the batch's own message ids instead. That is
sequence-independent and therefore routing-independent. Both `EXPLAIN QUERY
PLAN`s remain indexed SEARCHes, and the id list is bounded by the 50-row
batch cap. An empty batch now reports any unread matching mail as queued
rather than asserting `false`.

Also:
- `formatDeliveryAction` renders silence only for an observed `false`; every
  other value renders "unavailable", matching `formatDeliveryStatus`'s
  polarity so an off-contract value cannot read as "nothing is queued".
- Queued mail is not necessarily newer, so say "Other messages" rather than
  "Newer messages" in the CLI output, the skill guide, the command spec, and
  the reliability gate. The old wording restated the assumption that caused
  the defect.
2026-08-28 04:00:46 -07:00
..