Skip to main content

Module trace_chain

Module trace_chain 

Source
Expand description

Symbol-level call chains (fallow trace <symbol> --callers --callees).

Best-effort, syntactic (ADR-001), EXPLICITLY OFF the ranked path. This walk NEVER feeds the focus map / ranking (verified by a dedicated test in the CLI crate). It reports resolved-vs-unresolved callees HONESTLY: a referenced callee that the syntactic walk cannot resolve to an import-symbol edge is surfaced in SymbolChainTrace::unresolved_callees, never silently dropped.

§What “resolved” means (honest scoping)

The graph models import-symbol edges: module A imports binding foo from module B. From those edges this walk reconstructs:

  • Callers (UP): for a symbol S defined in module M, every module that imports S from M (via ModuleGraph::importers_of + the per-edge ImportedSymbol set), recursed through the importer’s own binding up to depth.
  • Callees (DOWN): the import-symbol edges OUT of M (resolved callees, each a (local, imported, target_module) triple), recursed into the target module’s exports up to depth, PLUS the call sites in M (ModuleInfo.callee_uses) whose leading identifier is bound to no import (unresolved callees: locals, globals, dynamic dispatch, re-bound callees).

NOT resolved (reported as unresolved or absent, the same class of limits the security taint walk carries): computed-member calls, dynamic dispatch, re-bound callees, methods reached only through type inference, and any callee with no import-symbol edge. The walk is MODULE-scoped, not per-function: a true intra-function dataflow is beyond ADR-001 syntactic scope.

Structs§

ChainHop
One hop in a caller / callee chain.
SymbolChainQuery
Target and traversal parameters for a symbol-chain trace.
SymbolChainTrace
The result of a symbol-level call-chain trace. Its own surface (kind: "trace"), NOT folded into the ranked brief.
TraceDirections
Which directions to walk.
UnresolvedCallee
A callee referenced at a call site that did not resolve to an import-symbol edge. Surfaced so a missing callee is never silently dropped.

Enums§

UnresolvedReason
Best-effort classification of why a callee did not resolve to an edge.

Constants§

DEFAULT_TRACE_DEPTH
Default chain depth when --depth is unset.

Functions§

trace_symbol_chain
Trace the symbol-level call chain for query.symbol in query.file.