Skip to main content
Version: Current

AuditFinding

@rotorsoft/act-root


@rotorsoft/act-root / act/src / AuditFinding

Type Alias: AuditFinding

AuditFinding = { category: "schema"; event_id: number; name: string; reason: "unknown_event_name" | "schema_validation_failed"; stream: string; zod_error?: unknown; } | { category: "close-candidate"; idle_days?: number; last_event_at: string; reason: "terminal" | "idle"; restart_supported: boolean; stream: string; } | { category: "restart-candidate"; count: number; snaps: number; stream: string; } | { category: "deprecated-load"; current_version: string; name: string; top_streams: object[]; total: number; } | { category: "reaction-health"; reason: string; retry: number; status: "blocked" | "near-block" | "stuck-backoff"; stream: string; } | { category: "snapshot-drift"; events_since_snap: number; snap_at?: number; stream: string; } | { category: "routing-health"; lane?: string; reason: "unknown-lane" | "unrouted"; stream: string; } | { category: "correlation-gaps"; event_id: number; reason: "orphan-parent" | "missing-correlation"; stream: string; } | { category: "clock-anomalies"; event_id: number; reason: "future-created" | "out-of-order"; stream: string; } | { category: "unreadable-events"; error: unknown; event_id: number; reason: "pii_decrypt_failed"; stream: string; }

Defined in: libs/act/src/types/audit.ts:86

Discriminated union of audit findings. Each shape carries enough context for the operator to act on the finding directly โ€” stream name, event id, suggested remediation hints.

Union Membersโ€‹

Type Literalโ€‹

{ category: "schema"; event_id: number; name: string; reason: "unknown_event_name" | "schema_validation_failed"; stream: string; zod_error?: unknown; }


Type Literalโ€‹

{ category: "close-candidate"; idle_days?: number; last_event_at: string; reason: "terminal" | "idle"; restart_supported: boolean; stream: string; }

categoryโ€‹

category: "close-candidate"

idle_days?โ€‹

optional idle_days?: number

last_event_atโ€‹

last_event_at: string

reasonโ€‹

reason: "terminal" | "idle"

restart_supportedโ€‹

restart_supported: boolean

True when the state has a snapshot patch (close({restart: true}) would work).

streamโ€‹

stream: string


Type Literalโ€‹

{ category: "restart-candidate"; count: number; snaps: number; stream: string; }


Type Literalโ€‹

{ category: "deprecated-load"; current_version: string; name: string; top_streams: object[]; total: number; }


Type Literalโ€‹

{ category: "reaction-health"; reason: string; retry: number; status: "blocked" | "near-block" | "stuck-backoff"; stream: string; }


Type Literalโ€‹

{ category: "snapshot-drift"; events_since_snap: number; snap_at?: number; stream: string; }


Type Literalโ€‹

{ category: "routing-health"; lane?: string; reason: "unknown-lane" | "unrouted"; stream: string; }


Type Literalโ€‹

{ category: "correlation-gaps"; event_id: number; reason: "orphan-parent" | "missing-correlation"; stream: string; }


Type Literalโ€‹

{ category: "clock-anomalies"; event_id: number; reason: "future-created" | "out-of-order"; stream: string; }


Type Literalโ€‹

{ category: "unreadable-events"; error: unknown; event_id: number; reason: "pii_decrypt_failed"; stream: string; }

categoryโ€‹

category: "unreadable-events"

An event the store could not hand back at all โ€” currently only a pii payload the configured key cannot decrypt (corrupt ciphertext, bit-rot, a partial restore, or a rotation that outran a stream's correlate checkpoint).

Every other finding describes an event the audit could read. This one names the row that stopped it being read, which the failing read alone does not give: the scan aborts, nothing reports the stream, and blocked_streams() is empty because nothing is blocked.

errorโ€‹

error: unknown

The underlying adapter error, for operators who log it.

event_idโ€‹

event_id: number

reasonโ€‹

reason: "pii_decrypt_failed"

streamโ€‹

stream: string