Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

Dispatch engine: capture event payload, render trigger, record tower.dispatch audit trail.

When the supervisor (F3) surfaces a FiredEvent, the dispatch engine:

  1. Snapshots the context ring (recent matching events for the rule) and inserts the current event, bounding context to context_window entries.
  2. Records a dispatch intent into scryer before invoking the trigger — idempotency: a mid-fire crash leaves a Dispatched record without a corresponding action; operator reconciles manually.
  3. Calls the TriggerHandler (F5 implementations) to render and fire the trigger.
  4. On handler failure, records a Failed audit event with the structured cause. The matched event is NOT consumed; the supervisor can re-fire after the rule is fixed.

Architecture: .yah/docs/architecture/A052-yah-tower.md

Structs§

DispatchAuditEvent
Structured audit record written into scryer’s tower.dispatch scope.
DispatchContext
Context handed to a TriggerHandler when a rule fires.
DispatchEngine
Dispatch engine: accepts FiredEvents from the supervisor and orchestrates context capture, audit recording, and trigger invocation.
NoopTriggerHandler
No-op trigger handler: accepts all dispatches without taking action.

Enums§

DispatchError
Error returned by a TriggerHandler.
DispatchOutcome
Whether the dispatch succeeded or failed.
TriggerKind
Which of the three trigger families is being dispatched.

Traits§

DispatchRecorder
Writes DispatchAuditEvents into scryer’s tower.dispatch scope.
TriggerHandler
Renders and fires a trigger. Implemented per trigger family (F5).