/** * Persistence for the evidence-requirement guard-drop counters (FEAT-485, * migration 030). Mirrors src/storage/relation-guard-log.ts field-for-field * (which itself mirrors src/storage/redaction-log.ts) -- counts + a reason * label only, never the raw atom text. See * migrations/030-evidence-guard-drops.sql for why this table exists: it is * the only place that can distinguish "the model never emits evidence for * lesson/decision atoms" from "the model emits lesson/decision atoms without * evidence and the guard drops every one" -- both look identical as a low/ * zero evidence-population rate on `memories` alone. */ import type { DB } from './db.js'; export interface EvidenceGuardDropRow { reason: string; count: number; } /** * Write one `evidence_guard_drops` row per entry with `count > 0`. No-op * when `drops` is empty or every entry is zero -- nothing to record, no * wasted write (same guard `recordRelationGuardDrops`/`recordRedactionEvents` * use for an empty event list). */ export declare function recordEvidenceGuardDrops(db: DB, drops: EvidenceGuardDropRow[], sessionId: string | null): void; /** Sum of all guard-drop counts recorded since `sinceMs` (all-time when omitted). */ export declare function totalEvidenceGuardDrops(db: DB, sinceMs?: number): number;