import type { WatchdogReport, WatchdogRoleStatus } from './report.js'; import type { WatchManifest } from './briefing.js'; /** * Severity ordering, lowest to highest (must match the briefing contract's alert-rules * sentence verbatim, src/watchdog/briefing.ts): healthy = idle (0) < unknown (1) < stale (2) * < blocked = unreachable (3) < off_briefing (4). */ export declare const WATCHDOG_STATUS_RANK: Record; export interface OpenFinding { role: string; status: WatchdogRoleStatus; since: string; lastAlertedAt: string | null; } export interface AlertLedger { version: 1; open: Record; heldDownAlerted: boolean; } /** Missing or corrupt ledger file yields a clean empty ledger rather than throwing. */ export declare function readLedger(name: string): AlertLedger; export declare function writeLedger(name: string, l: AlertLedger): void; /** * An `error`-status report carries no role evidence, so the ledger * is returned unchanged. For each finding with rank > 0: an existing open entry keeps its * `since` and updates `status` on escalation/de-escalation; a new one opens with `since = now`. * Any role reported `healthy`/`idle` closes (deletes) its open entry. Every role named in * `report.alerts` gets `lastAlertedAt = now`. Roles absent from the report keep their entries — * a watchdog with a narrowed `watch:` set doesn't silently resolve findings it never inspected. * Never mutates `l` — always returns a new ledger object. */ export declare function reconcileLedger(l: AlertLedger, report: WatchdogReport, now: Date): AlertLedger; /** Ledger open findings and cooldown in the shape carried by watch.json's `digest` field. */ export declare function computeDigest(l: AlertLedger, cooldownMs: number, now: Date): WatchManifest['digest'];