/** * `locate_symbol_span` MCP handler (change: add-symbol-span-locator). * * The read-only, staleness-checked edit LOCATION an agent can trust. OpenLore * already resolves a task to a precise symbol (`suggest_insertion_points` names * the function; tree-sitter gives byte-exact spans; `find_clones`-style * `name::path` addressing disambiguates). But when the agent goes to APPLY an * edit, it re-locates that span by string-matching a fresh read — the one step * where the substrate's knowledge is thrown away and replaced by guesswork * (wrong-overload hits, duplicated snippets, whitespace drift), with no signal * that the index it is trusting is even current. * * This tool closes that gap without giving OpenLore a write face: it returns the * indexed symbol's span (byte + line) plus a freshness VERDICT, and the host * applies the edit with its own tool. It adds precision and a freshness * guarantee, not write authority. * * Freshness (fail-safe toward distrust, matching `FreshnessFailsSafeTowardDistrust`): * - `fresh` — the substrate can vouch that the recorded offsets still point at * the indexed symbol: either the file's content hash still matches * the hash the index recorded (authoritative), or — when the full * analyze recorded no per-file hash — the file has not been written * since the index artifact was produced. * - `stale` — the file changed since analysis (content hash differs, or it was * written after the index). The offsets are NOT trustworthy; the * tool returns a re-analyze hint instead of a location. * - `ambiguous` / `not-found` — a bare name matching several / no symbols → the * `name::path` candidate list, never a fuzzy guess. * * Computed live from the cached call graph + a re-read of the one file the symbol * spans (no new persisted artifact). Read-only: the handler never writes, moves, * or deletes any file. */ export interface LocateSymbolSpanInput { directory: string; /** The symbol to locate: its name, or `name::path` to disambiguate. */ symbol?: string; } /** * Pure freshness resolver — the whole trust decision, extracted so every branch * is unit-tested without touching disk. Content-hash is AUTHORITATIVE when the * index recorded a per-file baseline (the watcher records one on every edit); the * full-analyze path records none, so the fallback is the artifact-vs-source mtime: * a file that has not been written since the index artifact was produced still * carries the offsets the index recorded. Both paths fail safe toward `stale` — * any later write, or an unreadable baseline, biases away from a false `fresh`. */ export declare function resolveFreshness(params: { baselineFileHash: string | null; currentFileHash: string; sourceMtimeMs: number; artifactMtimeMs: number; }): 'fresh' | 'stale'; /** * Locate a symbol's edit span with a freshness verdict. Read-only, deterministic, * offline. Returns `unknown` (additive-by-cast), conclusion-shaped — a single * verdict + location or a candidate list, never a graph. */ export declare function handleLocateSymbolSpan(input: LocateSymbolSpanInput): Promise; //# sourceMappingURL=symbol-span.d.ts.map