Expand description
Graph builder trait.
Language integrations implement this trait to populate the unified
CodeGraph using tree-sitter ASTs. Builders operate on mutable references
to StagingGraph buffers, which are per-file and can be built in parallel
without synchronisation. After building, staging buffers are merged into
the main graph.
§Architecture
The build pipeline uses a transactional staging pattern:
- Each file gets its own
StagingGraph(thread-local) - Builders populate the staging buffer via mutable reference
- After all files are processed, staging buffers are committed atomically
This enables parallel builds while maintaining correctness guarantees.
Traits§
- Graph
Builder - Trait implemented by all language-specific graph builders.