.mdx file in your project and constructs a project-wide dependency graph that maps the structural and semantic relationships between your specification requirements and your codebase. This graph is the foundation for every analysis command xspec provides: coverage gaps, change impact, review scoping, and arbitrary graph queries all operate on the same underlying data structure stored at .xspec/graph.json.
Nodes
The graph contains three kinds of nodes:
Every spec file automatically contributes a root node even if it contains no
<S> sections. Code locations are registered when TypeScript markers reference them.
Edge Kinds
Edges express how nodes relate to one another. xspec distinguishes four kinds:contains edges represent document structure. The other three — depends, embeds, and references — carry semantic meaning and are used when calculating coverage and impact.
contains edges are intentionally excluded from coverage reachability. A parent requirement being referenced does not automatically make its children covered. Each leaf must be reached independently.Building the Graph
Runxspec build to parse your spec files and write the graph to .xspec/graph.json:
d and {text(...)} references, and emits a type-annotated JSON file you can inspect or version-control.
Using the Graph
Once built, the graph powers a suite of read commands:
The graph model means that any of these views is computed from the same source of truth — you never maintain separate coverage spreadsheets or impact matrices by hand.