feat(jobs): push background-job completion notifications via per-context queue

- add NotificationQueue/SystemNotification: every context owns a fresh
  queue (children never inherit the parent's, avoiding first-drainer-wins
  races between transcripts)
- job tasks push job_completed/job_failed events on completion, failure,
  and timeout; a panic skips the push and is surfaced by the guardrail's
  finished-handle enumeration and collect's JoinError mapping instead
- events for jobs already collected or cancelled are dropped at drain time
  by filtering against live supervisor registration
- replace inject_escalation_notification with single-pass
  merge_system_channel: pending_escalations (root-only) ordered before
  system_notifications (any depth) on the last tool result of a batch;
  byte-identical output when notifications are empty, proven by the
  unmodified pre-merger characterization tests
This commit is contained in:
Dark-Alex-17 committed 2026-08-25 17:50:28 -06:00
1 parent 6a694d10db
commit 2d874f1d7c
5 files changed
+571 -27

No files matched your search

+1
View File
@@ -1,5 +1,6 @@
pub mod escalation;
pub mod mailbox;
pub mod notification;
pub mod taskqueue;
use crate::function::jobs::RingBuf;