Skip to content

primitives node and edge records

Bryan edited this page Jun 13, 2026 · 1 revision

Node and edge records

Active contributors: Bryan

Node and edge records are the data structures that carry facts from parsers to SQLite. They are defined as dataclasses in src/lode/model.py.

Purpose

The model layer keeps fact shape simple and serializable. Node describes one indexed thing, Edge describes one relationship, and FileIndex groups all facts from one file.

Key abstractions

Name File Description
Node src/lode/model.py Graph node with ID, kind, name, qualified name, path, line range, signature, doc, confidence, content hash, and extra metadata.
Edge src/lode/model.py Relationship with source, destination, kind, confidence, and detail.
FileIndex src/lode/model.py Per-file package of metadata, nodes, and edges.

How IDs are created

make_node() in src/lode/indexer.py hashes the node kind, qualified name, path, and start line to create stable node IDs. Repository IDs are derived from resolved root paths in src/lode/config.py.

Integration points

  • src/lode/indexer.py creates records.
  • src/lode/storage.py serializes records into SQLite and FTS rows.
  • src/lode/graph.py reads records to resolve relationships.
  • src/lode/context.py and src/lode/cli.py expose records in compact JSON.

Key source files

File Purpose
src/lode/model.py Dataclass definitions.
src/lode/indexer.py Node ID generation and parser output.
src/lode/storage.py Serialization into SQLite.
src/lode/config.py Repository ID helper.

Related pages

Clone this wiki locally