/** * Risk Audit Log: append-only JSONL log for risk gate decisions. * Files live in `/{address}/risk-guard/audit.jsonl` (per-wallet directory convention). */ import type { RiskSource, RiskFailureKind } from "../health/types.js"; export interface RiskAuditEntry { ts: string; event: "gate_check"; address: string; source: RiskSource; evaluations?: Array<{ guardrail: string; result: "pass" | "CLOSED" | "COOLDOWN"; reason?: string; evaluationOk?: boolean; fallbackApplied?: boolean; failureKind?: RiskFailureKind; }>; meta?: Record; } export interface RiskAuditLog { append(entry: RiskAuditEntry): Promise; } /** * Read the most recent `limit` audit entries for an address, oldest-first. * Reads only the trailing `MAX_TAIL_BYTES` of the file, drops a possibly * truncated leading line, and skips malformed JSON. Returns `[]` when the * file does not exist (no gate checks have run yet). */ export declare function readRiskAuditEntries(stateDir: string, address: string, limit: number): Promise; export declare function createRiskAuditLog(stateDir: string): RiskAuditLog; //# sourceMappingURL=risk-audit-log.d.ts.map