/** * Escalation Ledger - Persistent record of escalation decisions * * Appends each escalation decision to .valora/escalations.jsonl (one JSON record * per line), modeled on `SpendingTracker` (`utils/spending-tracker.ts`). This is * the durable, retrospective half of confidence-reliability: it doesn't verify a * confidence number in real time, but lets a later report empirically check * whether stated confidence correlates with what a human actually decided. * * Deliberately excludes free-text fields (reasoning, proposed_action) — only * bounded, structured fields are persisted, to avoid unbounded LLM-generated * content accumulating on disk indefinitely. The full text remains available via * `ReasoningTraceRecorder`'s per-stage trace files if ever needed. */ import type { EscalationDecisionType, EscalationRiskLevel } from '../types/escalation.types.js'; export interface EscalationLedgerRecord { confidence: number; confidenceSource: 'defaulted' | 'reported'; /** Absent until the human decision is known (a "triggered" event precedes the "resolved" one). */ decision?: EscalationDecisionType; riskLevel: EscalationRiskLevel; sessionId?: string; stage: string; timestamp: string; triggeredCriteria: string[]; } export interface GetEscalationRecordsOptions { since?: string; stage?: string; } export declare class EscalationLedger { private readonly dataDir?; constructor(dataDir?: string | undefined); /** * Append an escalation record to the JSONL file. Non-fatal: a disk failure here * should never break the pipeline it's observing. */ record(r: EscalationLedgerRecord): void; /** * Read all records, optionally filtered by stage and/or date. Skips individual * unparseable lines rather than discarding the whole file — a single corrupted * append (e.g. a partial write) shouldn't erase every other recorded decision. */ getRecords(opts?: GetEscalationRecordsOptions): EscalationLedgerRecord[]; } export declare function getEscalationLedger(): EscalationLedger; export declare function resetEscalationLedger(): void; //# sourceMappingURL=escalation-ledger.d.ts.map