/** * Findings Baseline — the accepted-debt ledger (.memoire/baseline.json, * committed) that makes gates adoptable on existing codebases: accepted * findings stop gating, only NEW findings fail the build. * * Fingerprints are line-number-independent: ruleId + repo-relative file + * normalized evidence excerpt + occurrence index. Two granularities: * * - File-anchored findings (evidenceLocations present) fingerprint per * location; an issue is suppressed only when ALL its locations are * accepted, and resurfaces the moment any new location appears. * - Aggregate rules (whole-tree stats like type.scale-wide, no per-file * anchor) fingerprint on the rule id alone. Accepting one accepts the * rule's presence — worsening aggregate debt is caught by score * regression gates, not per-file blame (fingerprinting the count would * just resurface on every ±1 drift). * * Suppression is never silent: every consumer receives suppressed counts * and must surface them. */ import type { AppQualityIssue } from "./engine.js"; export interface BaselineEntry { fingerprint: string; ruleId: string; file?: string; note?: string; } export interface BaselineFile { schemaVersion: 1; acceptedAt: string; /** Policy hash at acceptance time — a different active policy is flagged, not fatal. */ policyHash?: string; entries: BaselineEntry[]; } export interface BaselineFilterResult { /** Issues that still gate (have at least one non-accepted fingerprint). */ active: AppQualityIssue[]; /** Issues fully covered by the baseline — excluded from gating, never from visibility. */ suppressed: AppQualityIssue[]; /** Accepted fingerprints that no longer occur — candidates for cleanup. */ staleFingerprints: BaselineEntry[]; } export declare const BASELINE_FILE_RELATIVE: string; export declare function baselinePath(projectRoot: string): string; /** Compute the stable fingerprints for one issue (one per evidence location, or one rule-level). */ export declare function fingerprintIssue(issue: AppQualityIssue): BaselineEntry[]; export declare function readBaseline(projectRoot: string): Promise; export declare function writeBaseline(projectRoot: string, baseline: BaselineFile): Promise; /** Build a baseline accepting every current finding. */ export declare function buildBaseline(issues: AppQualityIssue[], options: { policyHash?: string; acceptedAt?: string; note?: string; }): BaselineFile; /** * Split issues into active (gate) vs suppressed (accepted debt), and report * stale accepted fingerprints that no longer occur. */ export declare function filterWithBaseline(issues: AppQualityIssue[], baseline: BaselineFile): BaselineFilterResult;