Expand description
Graph persistence layer using sqlitegraph
§Position Conventions
Symbol and reference spans in the graph use tree-sitter position conventions:
- Line positions: 1-indexed (line 1 is the first line)
- Column positions: 0-indexed (column 0 is the first character in a line)
- Byte offsets: 0-indexed from file start (byte 0 is the first byte)
See MANUAL.md for detailed documentation.
§:memory: Database Limitation
CodeGraph uses SQLite Shared connections via sqlitegraph and opens a separate
shared connection for ChunkStore. These Shared connections don’t work with
:memory: databases because each thread would get its own separate in-memory
database instance.
Workaround: Use file-based databases for CodeGraph operations. See MANUAL.md for details.
Re-exports§
pub use metrics::BackfillResult;pub use algorithms::CondensationGraph;pub use algorithms::CondensationResult;pub use algorithms::Cycle;pub use algorithms::CycleKind;pub use algorithms::CycleReport;pub use algorithms::DeadSymbol;pub use algorithms::ExecutionPath;pub use algorithms::PathEnumerationResult;pub use algorithms::PathStatistics;pub use algorithms::ProgramSlice;pub use algorithms::SliceDirection;pub use algorithms::SliceResult;pub use algorithms::SliceStatistics;pub use algorithms::Supernode;pub use algorithms::SymbolInfo;pub use export::ExportConfig;pub use export::ExportFormat;
Modules§
- algorithms
- Graph algorithms for code analysis
- ambiguity
- Ambiguity tracking for CodeGraph
- canonical_
fqn - Fully-Qualified Name builder for canonical and display FQN computation
- crate_
name - Crate name detection for Rust projects
- export
- Export functionality for CodeGraph
- filter
- File filtering for gitignore-style rules and CLI include/exclude globs.
- metrics
- Metrics operations for CodeGraph
- query
- Query operations for CodeGraph
- scan
- Directory scanning operations for CodeGraph
- test_
helpers - Test-only helpers for delete operation testing.
- validation
- Graph validation module
Structs§
- AstNode
- AST node extracted from source code
- AstNode
With Text - AST node with optional source text snippet
- Cache
Stats - Cache statistics for monitoring effectiveness
- Call
Node - Call node payload stored in sqlitegraph
- Code
Graph - Graph database wrapper for Magellan
- Delete
Result - Deletion statistics returned by delete_file_facts()
- File
Node - File node payload stored in sqlitegraph
- Freshness
Status - Freshness status of the database
- Reference
Node - Reference node payload stored in sqlitegraph
- Symbol
Node - Symbol node payload stored in sqlitegraph
Enums§
- Reconcile
Outcome - Deterministic reconcile outcome.
Constants§
- MAGELLAN_
SCHEMA_ VERSION - Magellan-owned schema version for side tables (e.g.
magellan_meta). - STALE_
THRESHOLD_ SECS - Staleness threshold in seconds (5 minutes)
Functions§
- check_
freshness - Check database freshness
- ensure_
ast_ schema - Ensure ast_nodes table exists for Phase 36
- extract_
ast_ nodes - Extract AST nodes from a tree-sitter tree
- generate_
symbol_ id - Generate a stable symbol ID from (language, fqn, span_id)
- is_
structural_ kind - Check if a node kind is a structural node (should be stored)
- language_
from_ path - Detect the programming language from a file extension
- normalize_
node_ kind - Normalize a tree-sitter node kind to a language-agnostic kind
Type Aliases§
- Scan
Progress - Progress callback for scan_directory