/** * Persistence for entity-relation extraction guard-drop counters (FEAT-481 * SLICE-430, migration 029). Mirrors src/storage/redaction-log.ts field-for- * field (reasons instead of redaction types) -- counts + a reason label * only, never the raw subject/predicate/object text. See * migrations/029-relation-guard-drops.sql for why this table exists: it is * the only place that can distinguish "the model never emits a relation" * from "the model emits relations but the guard drops every one" -- both * look identical as a zero `entity_relations` row count. */ import type { DB } from './db.js'; export interface RelationGuardDropRow { reason: string; count: number; } /** * Write one `relation_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 `recordRedactionEvents` uses for an empty event * list). */ export declare function recordRelationGuardDrops(db: DB, drops: RelationGuardDropRow[], sessionId: string | null): void; /** Sum of all guard-drop counts recorded since `sinceMs` (all-time when omitted). */ export declare function totalRelationGuardDrops(db: DB, sinceMs?: number): number;