import { z } from "zod"; /** * Content-anchored identity of one analyzer lead — the join key that lets * remediation's close-verify draw ask "does this exact lead still fire?" * mechanically (item C of `spec/mechanical-analyzer-layer-design.md`). * * Anchored on the NORMALIZED flagged snippet, never line numbers: edits shift * lines, but an untouched clone/violation re-hashes identically wherever it * moves within its file. Optional everywhere it is carried — a lead whose * snippet cannot be read simply carries no provenance and is exempt from * mechanical verification. */ export declare const AnalyzerLeadProvenanceSchema: z.ZodObject<{ /** Candidate id that produced the lead (e.g. "jscpd", "gitleaks"). */ analyzer_id: z.ZodString; /** Analyzer-native rule id, when the tool reports one. */ rule: z.ZodOptional; /** Repo-relative path of the flagged file. */ path: z.ZodString; /** `hashAnalyzerSnippet` digest of the normalized flagged span. */ snippet_hash: z.ZodString; }, "strict", z.ZodTypeAny, { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; }, { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; }>; export type AnalyzerLeadProvenance = z.infer; /** * Normalize a flagged source span so the hash survives cosmetic movement: * per-line trim, internal whitespace runs collapsed to one space, empty lines * dropped. A whitespace-only reformat therefore re-hashes identically (the * lead's identity is its content, not its layout), while any real edit to the * flagged code changes the digest. */ export declare function normalizeAnalyzerSnippet(snippet: string): string; /** * Hash the 1-based inclusive line span `[lineStart, lineEnd ?? lineStart]` of * `source` after {@link normalizeAnalyzerSnippet}. Returns undefined when the * span is empty after normalization or lies wholly outside the file — callers * then attach no provenance rather than a meaningless digest. */ export declare function hashAnalyzerSnippet(source: string, lineStart: number, lineEnd?: number): string | undefined; /** * Stable string key of a provenance identity, for set membership at the * close-verify draw (`analyzer_id`+`rule`+`path`+`snippet_hash`; `rule` folds * in as "" when absent so the same lead keys identically on both sides). */ export declare function analyzerProvenanceKey(p: AnalyzerLeadProvenance): string; //# sourceMappingURL=provenance.d.ts.map