Skip to main content

Module relational

Module relational 

Source
Expand description

Relational (call-graph / impact) retrieval over the code graph.

Glyph’s lexical retrieval is node-local: “what calls X” returns X itself. But the graph already encodes who-references-what as edges (A --references--> B), so the callers/dependents of a symbol are just its REVERSE edges. These traversals surface that. They are deterministic graph facts — confidence is Exact, not a similarity guess.

Enums§

RelMode

Functions§

callers
Direct callers/users of a node: reverse references edges (+ implements when the node is a trait). Prefers function nodes — a containing type that only references the target through one of its methods is dropped in favor of the method.
detect_relational_intent
Detect a call-graph/impact query and extract its subject symbol. Returns None for ordinary lexical queries (so the caller falls through to normal grounding).
impact
Transitive dependent closure: BFS over REVERSE references/implements edges from node_id up to depth hops. Also seeds the node’s contains children (changing a type affects users of its own methods). Excludes the subject itself. Answers “what breaks if I change X”.
kind_intent
Map a generic, language-agnostic KIND word in the query to a node Kind. Used to bias retrieval toward the structural shape the user asked for (“the struct that…” → Type). Vocabulary only — no project- or language-specific names.
rerank_by_kind
Stable re-rank: hits whose node is of target kind move ahead of the rest, preserving the lexical order within each group. Generic — promotes the asked-for shape without touching scores.
resolve_symbol
Resolve a symbol NAME (e.g. verify_password, Task) to a concrete node id.