/** * Deterministic overlap between a candidate generated domain and existing specs. * * A detected technical domain such as `components` routinely shares files and * symbols with several existing business specs. Silently generating a competing * spec loses that information; so does suppressing the domain by name. This * module reports the overlap as EVIDENCE and decides nothing: no score promotes, * merges, renames, or suppresses a domain — the host agent judges (change * `harden-spec-workflow-lifecycle`, decision ff9d89a3). * * Existing spec footprints come from canonical sources only — the `> Source * files:` header, `**Implementation**:` references, and the exact symbols of the * deterministic link index. Nothing is inferred from spec prose or file naming. */ import type { DependencyGraphResult } from '../analyzer/dependency-graph.js'; import type { SpecLinkIndex } from '../generator/spec-link-index.js'; import type { SpecLinkIndexSpecInput } from '../generator/spec-link-index.js'; /** Shared entries disclosed per existing spec before the list is summarized. */ export declare const MAX_SHARED_ENTRIES = 50; export interface SpecOverlapObservation { /** Existing spec domain that shares footprint with the candidate. */ domain: string; specFile: string; /** Files in both footprints, bounded. */ sharedFiles: string[]; sharedFileTotal: number; /** Exact symbols in both footprints, bounded. Ranked ahead of file-only overlap. */ sharedSymbols: Array<{ name: string; file: string; }>; sharedSymbolTotal: number; /** Where the existing spec's footprint came from. */ basis: Array<'source-header' | 'implementation-reference' | 'link-index-symbol'>; } export interface SpecOverlapResult { observations: SpecOverlapObservation[]; provenance: { /** `available` even when nothing overlaps — an empty result is an observation. */ state: 'available' | 'unavailable'; reason?: string; /** Existing specs actually compared. */ comparedSpecs: number; /** Candidate footprint sizes the comparison ran against. */ candidateFiles: number; candidateSymbols: number; /** False when any compared spec's footprint could not be fully established. */ complete: boolean; basis: string[]; }; } /** * Compute overlap observations for one candidate domain footprint. * * `candidateFiles` is the reconciled domain's file set; `candidateSymbols` are * the exported symbols those files define. Existing specs whose domain equals the * candidate's are skipped — regenerating a domain is not an overlap with itself. */ export declare function computeSpecOverlapObservations(args: { candidateDomain: string; candidateFiles: string[]; graph: DependencyGraphResult; specs: SpecLinkIndexSpecInput[]; linkIndex: SpecLinkIndex | null; }): SpecOverlapResult; //# sourceMappingURL=spec-overlap.d.ts.map