-
Notifications
You must be signed in to change notification settings - Fork 1
systems graph and impact
Active contributors: Bryan
The graph system connects parsed file-local facts into repository-wide relationships. src/lode/graph.py resolves imports, calls, inheritance, and blast-radius traversal over nodes persisted by src/lode/storage.py.
src/lode/graph.py # graph resolution, traversal, impact reports
src/lode/indexer.py # parser facts consumed by graph resolution
tests/test_graph.py # graph correctness tests
| Name | File | Description |
|---|---|---|
resolve_graph() |
src/lode/graph.py |
Rebuilds resolved edges for a repository. |
resolve_python_module() |
src/lode/graph.py |
Maps Python module names to indexed paths. |
resolve_js_module() |
src/lode/graph.py |
Maps TS/JS import paths to indexed paths. |
impact_targets() |
src/lode/graph.py |
Resolves a user target to one or more nodes. |
impact_report() |
src/lode/graph.py |
Returns direct callers, callees, files, entrypoints, and blast radius. |
blast_radius() |
src/lode/graph.py |
Performs bounded upstream, downstream, or bidirectional BFS. |
resolve_graph() loads file nodes, import bindings, local definitions, and unresolved parser facts from SQLite. It deletes old resolved edges, then writes current IMPORTS, CALLS, and EXTENDS edges with resolved confidence where a unique local target exists.
graph TD
Parsed[(parser facts)] --> Imports[resolve imports]
Parsed --> Calls[resolve calls]
Parsed --> Extends[resolve inheritance]
Imports --> Edges[(resolved edges)]
Calls --> Edges
Extends --> Edges
Edges --> Impact[impact_report]
Impact --> Blast[blast_radius]
The traversal edge kinds are CALLS, EXTENDS, HANDLES, CONTAINS, and IMPORTS. blast_radius() limits exploration with neighbor_limit, optional depth, and max_nodes, then ranks by edge confidence and distance.
-
src/lode/indexer.pyemits unresolved call and import facts. -
src/lode/storage.pystores node and edge rows and returns direct neighbors. -
src/lode/cli.pyexposeslode impactandlode neighbors. -
src/lode/daemon.pyexposes/impact.
Change resolution rules inside resolve_target(), resolve_via_imports(), and module resolver helpers in src/lode/graph.py. When changing traversal semantics, add tests in tests/test_graph.py that assert JSON output shape and de-duplication behavior.
| File | Purpose |
|---|---|
src/lode/graph.py |
Import, call, inheritance, impact, and blast-radius logic. |
src/lode/indexer.py |
Unresolved facts used by graph resolution. |
src/lode/storage.py |
Node and edge queries. |
tests/test_graph.py |
Graph regression tests. |