import type { SnapshotHeader } from "./snapshot.js"; export type AlertKind = "band-drop" | "count-delta" | "score-overall-drop" | "schema-drift" | "extractor-error" | "no-prior-snapshot"; export type AlertSeverity = "info" | "warn" | "fail"; export interface Alert { readonly raisedAt: string; readonly brand: string; readonly industry: string; readonly kind: AlertKind; readonly severity: AlertSeverity; readonly message: string; readonly currRunAt: string; readonly prevRunAt: string | null; readonly details: Record; } export interface EvaluateAlertsInput { readonly curr: SnapshotHeader; readonly prev?: SnapshotHeader | null; /** Sample of curr records (used for schema-drift check). */ readonly currSample?: readonly object[]; /** Sample of prev records (used for schema-drift check). */ readonly prevSample?: readonly object[]; /** Caller passes this if the extractor failed during the run. */ readonly extractorError?: { message: string; stack?: string; } | null; /** Override now() — used in tests. */ readonly clock?: () => Date; /** Defaults to 20 (%). */ readonly countDeltaPct?: number; /** Defaults to 10 (points on a 0-100 scale). */ readonly overallDropThreshold?: number; } /** * Pure alert evaluation. Returns 0+ alerts. */ export declare function evaluateAlerts(input: EvaluateAlertsInput): readonly Alert[]; /** * Append alerts to the JSONL sinks. Idempotent: caller chooses when to call. */ export declare function appendAlerts(alerts: readonly Alert[], options?: { root?: string; }): { monthlyPath: string; latestPath: string; written: number; };