auth/audit_emitter.ts view source
AuditEmitterContext Per-request context required by AuditEmitter.emit — just the eager
pending_effects queue. The bound emitter carries its own log
reference inside the closure, so per-call contexts don't need one.
Audit emits are eager-only by design: the bound emitter fires the
pool write immediately and pushes the in-flight Promise<void> here.
They never go through emit_after_commit — pool-routed audit writes
are already rollback-resilient because they run outside the request
transaction, so the post-commit timing the deferred queue provides
would only delay forensic visibility without any safety benefit.
Both RouteContext and ActionContext structurally satisfy this
shape (they each carry pending_effects), so handlers pass route
/ ctx directly.
pending_effects
type Array<Promise<void>>