-
Notifications
You must be signed in to change notification settings - Fork 1
primitives repository fact graph
Bryan edited this page Jun 13, 2026
·
1 revision
Active contributors: Bryan
The repository fact graph is Lode's shared mental model: source files become nodes, relationships become edges, and higher-level workflows read that graph through SQLite.
The graph lets Lode answer both lookup questions and change-risk questions. src/lode/indexer.py creates initial facts, src/lode/storage.py stores them, and src/lode/graph.py resolves and traverses relationships.
Common node kinds include File, Function, Method, Class, Route, DocSection, ConfigFile, ExternalSymbol, and ExternalDependency. The dataclass is defined in src/lode/model.py.
Common edge kinds include CONTAINS, CALLS, IMPORTS, EXTENDS, and HANDLES. The traversal subset in src/lode/graph.py is CALLS, EXTENDS, HANDLES, CONTAINS, and IMPORTS.
graph LR
Parser[src/lode/indexer.py] --> Nodes[Node records]
Parser --> Edges[Edge records]
Nodes --> SQLite[src/lode/storage.py]
Edges --> SQLite
SQLite --> Resolver[src/lode/graph.py]
Resolver --> Impact[impact reports]
SQLite --> Context[src/lode/context.py]
| File | Purpose |
|---|---|
src/lode/model.py |
Node, Edge, and FileIndex dataclasses. |
src/lode/indexer.py |
Fact creation. |
src/lode/storage.py |
Fact persistence. |
src/lode/graph.py |
Graph resolution and traversal. |