/**
 * FailureAnalyzer — the pattern layer (spec §4.4).
 *
 * Deterministic core: groups attributed failures by category, and emits an
 * InsightRecord only when a cluster crosses the support + SOURCE-DIVERSITY gate
 * (≥ minSupport records AND ≥ minDistinctSessions distinct filers AND
 * ≥ minDistinctCauseCommits distinct cause-commits). The diversity gate is what
 * stops a single misbehaving session — or a flaky/flapping source — from
 * manufacturing a "pattern" (§4.4 M4/M5). Diversity is computed conservatively
 * from the deduped records (one filer/cause per dedupeKey), so it UNDERcounts —
 * biasing toward NOT firing, which is the safe direction for a process-change
 * recommendation.
 *
 * Recommendations are TEMPLATE-KEYED on the detected category (spec §4.4 / BL-3):
 * never free-LLM prose piped into an auto-opened item. The §4.4 Tier-1 LLM
 * supervisor (declared on the analyzer job) sanity-checks the rendered finding
 * before any push surface; this module is the deterministic substrate it wraps.
 *
 * Signal-only: discovers + records insights; it never opens tracked items,
 * blocks, or grades. The closed-loop step is the FailureLoopDriver.
 */
import type { FailureLedger, InsightRecord } from './FailureLedger.js';
export interface AnalyzerGates {
    minSupport: number;
    minDistinctSessions: number;
    minDistinctCauseCommits: number;
    /** Only consider failures within this many days (0/undefined = all). */
    windowDays?: number;
}
export declare const DEFAULT_GATES: AnalyzerGates;
export interface AnalyzeResult {
    insightsDiscovered: InsightRecord[];
    clustersConsidered: number;
    clustersBelowThreshold: number;
}
export declare class FailureAnalyzer {
    private readonly ledger;
    private readonly gates;
    constructor(ledger: FailureLedger, gates?: AnalyzerGates);
    /**
     * Scan attributed failures, detect category clusters that cross the gate, and
     * upsert an InsightRecord for each. Returns the insights touched. Re-running
     * is idempotent (upsert on a content-stable identityKey).
     */
    analyze(): AnalyzeResult;
}
//# sourceMappingURL=FailureAnalyzer.d.ts.map