You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reachability API: reverse reachability (given a sink, find all sources that reach it) #172
Given a sink (a callable or external/library symbol), return all sources that can reach it through the call graph. This is the reverse direction — the originally requested capability — and it answers "who can get here?" for a dangerous operation.
The key point: this needs no new graph data. It is the forward reachability query with the edge direction flipped, so it is purely a query concern over the existing call graph.
All s such that s -CALLS*1..max_depth-> sink, intersected with sources when provided.
Backing implementations
Neo4j:
MATCH (s:Symbol)-[:CALLS*1..]->(t:Symbol{signature:$sink})
WHERE $sourcesISNULLORs.signatureIN $sourcesRETURNDISTINCTs.signatureASsource
Same query as forward reachability, just anchored on the sink and traversing incoming edges.
In-memory (NetworkX): nx.ancestors(G, sink), intersected with sources.
Example use
For a known dangerous sink (e.g. node:child_process.exec), enumerate the entrypoints/route handlers that can reach it — i.e. which externally-triggerable sources put that sink in play.
Acceptance criteria
Method on the backend contract + façade, implemented for the Neo4j and in-memory backends with matching semantics.
sources=None, explicit sources set, and max_depth honored.
Result for a fixture sink equals the set of nodes whose forward-reachable set contains that sink (forward/reverse consistency check).
Works when the sink is an External phantom symbol, not just an internal callable.
Consolidated 2026-07-09 into #215: reachability (forward/reverse/path witnesses) ships once, as the query core's reachable_to/paths() verbs on the 2.1.0 fluent chain, per the Epic B design (see #155). Building it separately on the legacy surface was descoped.
Activity
rahlk commentedon Jul 14, 2026
Consolidated 2026-07-09 into #215: reachability (forward/reverse/path witnesses) ships once, as the query core's reachable_to/paths() verbs on the 2.1.0 fluent chain, per the Epic B design (see #155). Building it separately on the legacy surface was descoped.