Skip to content

primitives repository fact graph

Bryan edited this page Jun 13, 2026 · 1 revision

Repository fact graph

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.

Purpose

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.

Node kinds

Common node kinds include File, Function, Method, Class, Route, DocSection, ConfigFile, ExternalSymbol, and ExternalDependency. The dataclass is defined in src/lode/model.py.

Edge kinds

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.

How facts flow

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]
Loading

Key source files

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.

Related pages

Clone this wiki locally