/** * Change-Coupling & Volatility Analysis (spec-22) — mined from local git history. * * Two facts the call graph structurally cannot see: * * 1. Change coupling — "these files almost always change together." The * *invisible* coupling with no import/call edge: the config and the parser * that move in lockstep, the handler and its migration. An agent editing one * is warned about the sibling it would otherwise miss. * 2. Volatility / churn — "this file changed 23 times." A caution flag: high-churn * code is where edits are riskiest. * * Prior art is logical/change coupling (CodeScene), whose own framing is decisive: * change coupling "isn't possible to calculate from code alone — it is mined from * git." Local, deterministic, no network (builds on Spec 18's git ingestion). * * Honest limits: co-change is CORRELATION, not causation; it is statistical and * needs sufficient history; bulk commits (formatting sweeps, mass renames, vendored * drops) manufacture false coupling. So: support/confidence thresholds, a documented * bulk-commit size filter, and presentation as a SIGNAL, never a rule. */ export declare const COUPLING_MAX_COMMITS = 1000; export declare const COUPLING_BULK_THRESHOLD = 25; export declare const COUPLING_MIN_SUPPORT = 3; export declare const COUPLING_MIN_CONFIDENCE = 0.3; export declare const COUPLING_TOP_PAIRS = 5; export declare const VOLATILITY_HIGH = 12; export declare const VOLATILITY_MEDIUM = 5; export interface CoupledFile { file: string; /** Number of commits that changed both files. */ support: number; /** support / churn(thisFile) — P(B changes | A changes), 0..1. */ confidence: number; } export interface ChangeCouplingResult { /** file → number of (non-bulk) commits that touched it. */ churn: Map; /** file → its most-coupled files (above thresholds, capped, sorted). */ coupling: Map; stats: { commitsScanned: number; bulkCommitsFiltered: number; filesTracked: number; }; } /** Per-file change-coupling record as persisted/queried (spec-22). */ export interface FileChangeCoupling { filePath: string; churn: number; coupledWith: CoupledFile[]; } export interface ChangeCouplingOptions { maxCommits?: number; bulkThreshold?: number; minSupport?: number; minConfidence?: number; topPairs?: number; } /** Map a churn count to a volatility level (absolute thresholds over the window). */ export declare function volatilityLevel(churn: number): 'high' | 'medium' | 'low'; /** * Compute co-change coupling + churn from the local git log. Returns empty maps * for a non-git / empty repo — never throws, never blocks analyze. Deterministic * for a fixed git state. */ export declare function analyzeChangeCoupling(rootPath: string, opts?: ChangeCouplingOptions): Promise; //# sourceMappingURL=change-coupling.d.ts.map