Code graph

Indexing builds a per-repository graph of definitions, imports and calls. Review retrieval, the agentic reviewer's get_related_files tool and context hints all use it.

Languages

LanguageParserImport resolution
TypeScript / JavaScriptTypeScript compilerRelative modules (with extension inference)
Pythontree-sitterRelative (from .x import y), absolute packages (root, src/, lib/, app/), submodules
Gotree-sitterImport path suffix → package directory
Java, Kotlintree-sitterFully qualified class → file; package / top-level function → package directory
Rusttree-sittercrate::, super::, self:: → x.rs / x/mod.rs
Rubytree-sitterrequire_relative, require (lib/, suffix match)
PHPtree-sitterPSR-4 style (App\X\Y → app/X/Y.php, src/X/Y.php)
C, C++tree-sitterQuoted #include relative to the file, include/, suffix match
C#, Swifttree-sitterDefinitions and calls; namespaces and modules are not file-resolvable

Other files use a regex fallback for definitions and imports. The fallback also runs if a grammar cannot load, so indexing never fails because of the parser.

Calls resolve to repository files when the callee is defined in the same file, imported by name, or qualified by an imported module or class (billing.Total(), Totals::total()). Resolved edges carry resolved: true and the called symbol. Unresolved calls keep the raw callee text with resolved: false and are never traversed. Package targets end with / and expand to the files in that directory.

Multi-hop traversal

context.neighborhood (convex/context.ts) walks resolved edges in both directions, so it finds callers as well as callees. It runs 1–3 hops (default 2) and ranks neighbours by edge weight and hop decay (src/engine/graph.ts). Reviews add the top 30 two-hop neighbours to their retrieved sources, and the agent's get_related_files tool returns the top 40. Every visited node costs a bounded number of index lookups.

Runtime (WASM)

Changing extraction bumps INDEX_GRAPH_VERSION (src/engine/index-version.ts), which makes the next index job reparse unchanged files.