/** * Persistence for consolidation run telemetry (P2.1 stabilization, * migration 050). One append-only row per real `runConsolidation()` call * (`ASTRA_SKIP_CONSOLIDATE=1` short-circuits before this write — see * src/consolidate/consolidate.ts). Mirrors * src/storage/consolidation-judge-log.ts's shape (append-only counters, one * doctor canary reads the latest row), but tracks the SCAN itself rather * than the judge sub-pass. * * Closes the reviewer MEDIUM finding (20260715T1640Z * review-stabilization-plan-architect-reviewer.md): `groupsSkipped` used to * be computed by `runConsolidation` and read nowhere — an oversized * (repo,type) group got ZERO consolidation coverage forever with no * operator-visible signal. `doctor`'s "Consolidation group coverage" check * (src/doctor/checks/consolidation-run.ts) reads the latest row here. */ import type { DB } from './db.js'; export interface ConsolidationRunLogStats { candidateSelection: 'full' | 'knn'; groupsScanned: number; groupsSkippedCount: number; groupsSkippedAtoms: number; mergedCount: number; proposedCount: number; } export declare function recordConsolidationRun(db: DB, stats: ConsolidationRunLogStats): void; export interface ConsolidationRunLogRow extends ConsolidationRunLogStats { createdAt: number; } /** Most recent row, or `null` if consolidation has never run. */ export declare function latestConsolidationRun(db: DB): ConsolidationRunLogRow | null;