Events form a Crystal class hierarchy so subscribers pattern-match exhaustively. EventBus delivers to subscribers via Crystal channels with per-subscriber overflow policy (Block for audit, Drop for best-effort). AuditSubscriber listens for all rotation/policy/drift/alert events and serializes them into the hash-chained audit log via AuditLog.append. Engine wires Persistence + AuditLog + AuditSubscriber + EventBus together so callers just .start/.stop. 7 unit specs verify boot, fanout to N subscribers, drop-on-overflow semantics, and end-to-end event -> audit row. |
||
|---|---|---|
| .. | ||
| .gitkeep | ||
| audit_subscriber_spec.cr | ||
| engine_spec.cr | ||
| event_bus_spec.cr | ||