Skip to main content

Module graph

Module graph 

Source
Expand description

Dependency-graph queries (C-049, spec/graph.md).

Pure functions over the IR DAG (Module.graph, edges dependency → dependent): impact/why traversals, node labels, and Mermaid/DOT/JSON renderings. Labels are names only — values (and secrets) never appear in graph output.

Functions§

impact_paths
Sorted dotted paths of a node’s transitive dependents, excluding the node itself and table nodes: a changed leaf trivially rebuilds its parents, which would otherwise put every table and the root in every answer. Patch and value nodes stay — those are the consumers that matter.
node_label
Display label for a node: dotted path, binding name, or node{id} for unmapped internals.
resolve_key
Resolve a user key like the evaluator does: table fields win ties, single segments also see let bindings.
to_dot
DOT digraph of the full graph (deterministic; labels escaped).
to_graph_json
JSON model of the full graph: nodes with labels, edges as id pairs (deterministic).
to_mermaid
Mermaid flowchart of the full graph (deterministic).
transitive_dependencies
Transitive dependencies of a node (incoming edges), excluding the node itself, in first-visit order.
transitive_dependents
Transitive dependents of a node (outgoing edges), excluding the node itself, in first-visit order. Cycles terminate via the visited set (queries never evaluate, so cyclic graphs answer).
why_paths
Sorted dotted paths of a node’s transitive dependencies.