Expand description
Deterministic, language-tagged code topology built from one snapshot-bound symbol-resolution result.
The graph separates three relations a consumer would otherwise have to reconstruct itself: logical containment, source association, and certainty-carrying reference and dependency edges. It consumes already validated in-memory facts and widens nothing: it loads no project, reads no file, parses no source, invokes no build tool, and evaluates no policy.
The snapshot must be the one the resolution was validated against, and a
successful build serializes to the compact version-1 JSON described below
through serde_json::to_string.
pedant_graph::build_rust_graph(snapshot, resolution)§The version-1 shape
One object with six keys, in this order:
schema_version: the integerCodeGraph::SCHEMA_VERSION.tier:"syntactic"or"semantic", taken from the supplied report.nodes:id,language,name,kind,location.kindis tagged bycategory;locationisnullor tagged bykindasfileorspan.containment:parentandchild, sorted by child then parent.references:id,source,language,kind,text,span,gaps,edges, in mint order.edges:id,source,target,kind,certainty,origin, in mint order.originis tagged bykindasreferenceordependency.
Every identity is an integer equal to the record’s position in its own slice, and every graph-owned enum is one lower-snake-case string. No key states a coordinate, a size, a color, or any other layout choice.
Structs§
- Code
Graph - One deterministic, language-tagged code topology.
- Containment
Edge - One logical-ownership edge between a parent node and the node it owns.
- Dependency
Evidence - What one build-unit dependency edge retained from its declaration.
- Edge
IdKind - Marker distinguishing edge identities from the other identity kinds.
- Graph
Edge - One directed relation between two graph nodes.
- GraphId
- One dense
u32position whose marker fixes the collection it addresses. - Graph
Limits - How many nodes, reference records, and edges one build may produce.
- Graph
Node - One structural entity of a code graph.
- Graph
Reference - One naming site, its copied evidence, and the edges its candidates produced.
- Node
IdKind - Marker distinguishing node identities from the other identity kinds.
- Reference
IdKind - Marker distinguishing reference identities from the other identity kinds.
Enums§
- Graph
Build Error - A refusal taken while projecting one resolution into a graph.
- Graph
Certainty - How much an edge is known.
- Graph
Collection - Which graph collection a ceiling addresses.
- Graph
Dependency Kind - Which dependency table declared a build-unit edge.
- Graph
Edge Kind - What relation an edge states.
- Graph
Edge Origin - Why an edge exists. No edge exists without one of these.
- Graph
Node Kind - What kind of entity a node is.
- Graph
Node Location - Where a node’s bytes sit, when it has any.
- Graph
Reference Kind - What a naming site denotes at the graph layer.
Functions§
- build_
rust_ graph - Project one snapshot-bound Rust resolution under the default ceilings.
- build_
rust_ graph_ with_ limits - Project one snapshot-bound Rust resolution under caller-chosen ceilings.
Type Aliases§
- Graph
Edge Id - An edge’s dense identity within one
crate::CodeGraph. - Graph
Node Id - A node’s dense identity within one
crate::CodeGraph. - Graph
Reference Id - A reference record’s dense identity within one
crate::CodeGraph.