/**
 * Finding-enrichment adapter — attaches graph context (module
 * membership + blast radius + enclosing symbol) to analyzer findings
 * that carry a `file` (+ optional `line`). Consumed by the detailed
 * report builders for the `vuln` / `test-gaps` / `quality` commands
 * when the user passes `--graph-context`.
 *
 * Per CLAUDE.md Rule 12 this is the only layer (alongside the context
 * hook + dashboard adapter) that loads the graph for finding
 * enrichment; analyzers receive the pre-built `DetailedGraphContext`
 * and never touch graph.json themselves. All graph math stays in
 * `queries.ts:findingContextQuery`.
 *
 * THE CONTRACT IS FAIL-OPEN + ADDITIVE, like the context hook: a
 * missing / corrupt / stale graph degrades to `undefined` (no
 * enrichment), never an error. Findings render exactly as they do
 * today whenever the graph is absent.
 */
import { type FindingContext } from './queries';
/** A finding's location — the enrichment key. `line` optional (file-level findings). */
export interface FindingLocation {
    file: string;
    line?: number;
}
/**
 * The enrichment payload stored on a detailed report. `generatedAt` +
 * `truncated` carry the graph.json provenance so a reader can detect a
 * stale enrichment (the graph predates the analyzed commit) without
 * re-loading the artifact. `contexts` is keyed by `locationKey` and
 * holds only `found: true` entries — files absent from the graph
 * produce no key (the renderer treats a missing key as "no context").
 */
export interface DetailedGraphContext {
    generatedAt: string;
    truncated: boolean;
    contexts: Record<string, FindingContext>;
}
export interface BuildFindingContextOpts {
    /** Budget cap: only the first N unique locations are enriched (bloat guard). */
    maxFindings?: number;
    /** Sample size of caller files surfaced per finding. */
    topCallerFiles?: number;
}
/** Stable lookup key for a finding location. */
export declare function locationKey(file: string, line?: number): string;
/**
 * Build per-finding graph context for a list of finding locations.
 * Fail-open: returns `undefined` when the graph can't be loaded.
 *
 * Dedupes identical locations (same file:line surfaced by multiple
 * tools) and budget-caps the work at `maxFindings` unique locations.
 * Only `found: true` contexts are stored — a finding in a file the
 * graph never parsed contributes no key, keeping the payload lean on
 * repos where graphify covers only part of the tree.
 */
export declare function buildFindingContextMap(cwd: string, locations: ReadonlyArray<FindingLocation>, opts?: BuildFindingContextOpts): DetailedGraphContext | undefined;
/**
 * Compact one-cell rendering for a markdown table: `role · N caller
 * files`. Returns `—` when there's no context for the location (file
 * not in the graph). Used by the detailed report renderers.
 */
export declare function formatGraphContextCell(ctx: FindingContext | undefined): string;
/**
 * Provenance + honesty line printed above an enriched section so the
 * reader knows the context is a structural hint tied to a specific
 * graph snapshot (and that graphify can conflate same-name symbols).
 */
export declare function graphContextProvenanceLine(gc: DetailedGraphContext): string;
//# sourceMappingURL=finding-context.d.ts.map