Independent review of the first version reproduced a final-result loss with
real dispatch, SQLite claims and the delivery consumers: the interim notice
carried the batch's delegation_id and every consumer claims and acknowledges
durable rows by that id alone. A busy parent that drained the notice first
acknowledged the FINAL result's row; the consolidated result could then
never be claimed, and would not replay after restart. The gateway's
in-memory dedup keyed on (type, delegation_id) and suppressed the final
(and every sibling notice) the same way.
The notice is now recognised as a non-durable event at both boundaries:
claim_event_delivery returns the empty token for it (is_interim_delegation_event),
the gateway preflight does not claim the durable row for it, and the
gateway dedup identity carries the task index so notices are distinct from
the final and from each other (the TUI key already did).
Reviewer's own probe re-run on this head: gateway receives
['notice', 'notice', 'final'] (was ['notice']); busy-parent case: the notice
takes no claim token, the final's claim succeeds and its row stays pending
until delivered (was: final claim None, row 'delivered' with an undelivered
result inside).
Tests (2 new): the notice is non-durable at the claim boundary; the gateway
identity separates two notices and the final into three.
Batches join on the slowest sibling before ONE consolidated block re-enters
(the design: one results block per fan-out). Failure is the case that
should not wait. In the 1,393-agent refactor run every wave-1 child died in
the 08:29 401 storm; the parent learned of it at 09:36, when the batch's
"unknown outcome" block finally arrived: 66 minutes of a dead wave with
nothing running, the single largest idle gap of the run.
_run_children_parallel, for DETACHED batches only (the sync path prints a
completion line the parent is already watching), pushes ONE
type="async_delegation" event with task_failure_notice=True and a
single-entry results list when a child ends in a failure status while
siblings are still pending. Same event shape and routing fields as the
batch result, so every drain/ownership/format path treats it identically;
the batch record is not finalized and its consolidated result still
arrives unchanged. The formatter renders
"[ASYNC DELEGATION TASK FAILED — <id>, task i/n]" with the task, status,
error and live transcript path, and says the batch result is still coming.
The TUI dedup key distinguishes a notice from the final result and from a
sibling's notice.
Live through the real detached dispatch (3 children, one fails at 0.1 s,
two succeed at 8 s): notice drained at t+0.3 s, batch final at t+8.4 s. On
main the parent hears nothing until t+8.4 s.
Tests (2): the notice reaches the queue with the record's routing fields
while the record stays running, and formats as an early warning; no notice
for a finished batch; dedup key differs from the final result.
Delegation/registry/notification suites (129 files) 1,344 passed.