/** * Symbol candidate resolver. * * Builds a single name → SymbolId[] inventory across all active language * adapters, then resolves each extraction candidate by exact name match. * Dotted-candidate resolution (e.g. `Class.method`) is intentionally NOT * implemented in MVP — the pre-scaffolding validation showed ~95% of * candidates are plain identifiers, and speculative resolution logic * adds risk without evidence of return. Revisit if benchmarks warrant. * * When a candidate matches symbols across multiple languages, we link * to all of them but log the crossover at debug level — useful signal * for benchmark analysis ("is the model hallucinating or is this a real * multi-language symbol?"). */ import type { LanguageAdapter, LanguageCode, Symbol as AtlasSymbol, SymbolId } from "../types.js"; import type { SourceFile } from "./file-walker.js"; export interface SymbolInventory { byName: Map; allSymbols: AtlasSymbol[]; } export interface ResolverStats { resolved: number; unresolvedCandidates: string[]; crossLanguageMatches: number; } /** * Build an inventory of all symbols across every active adapter. * For each source file found by walkSourceFiles, asks the corresponding * adapter (by extension) to enumerate its symbols, and stamps each * result with the file's SHA. */ export declare function buildSymbolInventory(adapters: ReadonlyMap, files: readonly SourceFile[]): Promise; /** * Resolve a single candidate name to zero or more canonical symbol IDs. * Returns an empty array if no match. Logs cross-language matches at * debug level. */ export declare function resolveCandidate(inventory: SymbolInventory, candidate: string): SymbolId[]; /** * Resolve every candidate in a list, returning the deduplicated set of * symbol IDs plus the unresolved candidates (for diagnostics / logging). */ export declare function resolveCandidates(inventory: SymbolInventory, candidates: readonly string[]): { symbolIds: SymbolId[]; unresolved: string[]; }; /** * Expand a raw Skill-produced symbol candidate string into the ordered * list of name variants to try against the LSP-derived symbol * inventory (R8 name-form normalization per v0.7 Step 2.3.a.1). * * Skill-side reasoning produces candidates in heterogeneous forms: * - `Console` — bare identifier (resolver MVP target form) * - `rich/console.py:Console` — canonical file-path-symbol form * (produced when reference-context substrate guides LLM toward * ContextAtlas's canonical reference style per Step 2.2.b.ii * observation) * - `rich.console.Console` — Python dotted notation (Python * standard import path style; produced under cold-start without * reference context per Step 2.2.b.i observation; surfaced FO-10) * - `Console.print` — method-on-class dotted form (catches the * method; class lookup deferred to LSP follow-on if warranted) * * Returns variants in priority order; the resolver tries each variant * against the LSP inventory; first match wins. If no variant matches, * the raw candidate goes to the unresolved bucket per existing * resolveCandidates() contract. * * Empty strings + whitespace-only candidates return an empty array * (caller treats as unresolved). Variants are deduplicated. */ export declare function expandCandidateForms(raw: string): string[]; /** * Resolve every candidate in a list using R8 name-form normalization * variants (v0.7 Step 2.3.a.1 — Skill→LSP symbol-resolution bridge). * * For each raw candidate, expands into the ordered list of name * variants via expandCandidateForms(); tries each variant against the * LSP-derived inventory; the first variant that resolves to one or * more SymbolIds wins. If no variant resolves, the raw candidate goes * to the unresolved bucket (preserved in atlas.json's * claims[].symbol_candidates field per R11 honest-scope- * acknowledgment discipline). * * Cross-language matches surface via the existing resolveCandidate() * debug log; this wrapper does not change cross-language behavior. */ export declare function resolveCandidatesWithNormalization(inventory: SymbolInventory, candidates: readonly string[]): { symbolIds: SymbolId[]; unresolved: string[]; }; //# sourceMappingURL=resolver.d.ts.map