Skip to main content

Module resolve

Module resolve 

Source
Expand description

Best-effort name resolution over an assembled view (ticket G).

The base graph is a heuristic call graph: references match a target by name, so callers_of("foo") returns callers of any foo. This layer resolves each reference to the specific defining path it most likely means, disambiguating same-named symbols across files:

  1. Local — a definition of the name in the reference’s own file wins.
  2. Unique global — otherwise, the sole definition across the view.
  3. Ambiguous — multiple definitions and none local: left unresolved.
  4. Unresolved — no definition in the view (honest dangling, ADR 0012).

Resolution is file-scoped (not yet import-aware); it is a pure function of a GraphStore’s query methods, so it works over any backend and adds no trait surface. Import-following resolution is a further step.

Structs§

ImpactNode
One symbol reached by an impact closure, identified by the path that defines it rather than by name alone.
ImpactReport
The result of a resolution-gated impact walk.
ResolvedReference
A reference resolved (best-effort) to the path of the symbol it refers to.

Enums§

Resolution
How a reference was resolved to a definition.

Functions§

resolve_references_to
Resolve every reference to name to a defining path (see the module docs for the strategy).
resolved_callers_of
Enclosing functions that call the name defined at defining_path — the precision refinement of GraphStore::callers_of, which returns callers of any same-named symbol. Sorted and deduped.
resolved_impact
The transitive closure of callers of name, following only edges that resolve to a specific definition.