fix(explore): accurately resolve query file paths and find camelCase symbols

Previously, `codegraph_explore` queries explicitly naming files by path (e.g., `src/routes/m/projects/[id]/runs/[runId]/+page.svelte`) were shredded. Bracketed path segments exploded into "named symbol" seeds, and FTS on fragments like `page` or `runs` admitted every sibling file, starving the user's intended target.

This change introduces:
- **Query path pinning:** File paths named in a query are now resolved against the index, "pinned," and stripped from the query. Pinned files are guaranteed inclusion, top ranking, and fair allocation. Unresolvable path-like spans are reported.
- **Segment vocabulary supplement:** Natural language query terms (e.g., "auto-scroll to bottom") can now reach camelCase identifiers (e.g., `pinFeedIfNearBottom`, `feedAtBottom`) by matching against their constituent segments.
- **Variable seeding:** `variable` and `constant` node kinds are now included in identifier seeding, improving recall for `$state`-style variables common in frameworks like Svelte.
This commit is contained in:
Colby McHenry
2026-08-20 09:10:07 -07:00
parent c6aaa20358
commit 238dbc5cec
15 changed files with 905 additions and 31 deletions
+9
View File
@@ -688,4 +688,13 @@ export interface FindRelevantContextOptions {
/** Node types to include */
nodeKinds?: NodeKind[];
/**
* Extra symbol names to merge in as exact-name search candidates, at a
* dampened score. Fed by the segment-vocabulary supplement (CodeGraph.
* findRelevantContext): word-level query terms can't reach camelCase names
* through FTS — `pinFeedIfNearBottom` is one FTS token — so names whose
* SEGMENTS the query's words name are seeded here instead.
*/
seedNames?: string[];
}