Skip to content

features impact analysis

Bryan edited this page Jun 13, 2026 · 1 revision

Impact analysis

Active contributors: Bryan

Impact analysis answers "what might break if I touch this?" It resolves a target symbol or node, finds direct callers and callees, and traverses a bounded blast radius through the graph.

Purpose

The feature is implemented in src/lode/graph.py and exposed through lode impact in src/lode/cli.py plus /impact in src/lode/daemon.py.

Directory layout

src/lode/graph.py  # impact_targets, impact_report, blast_radius
src/lode/cli.py    # impact command
src/lode/daemon.py # /impact endpoint
tests/test_graph.py

How it works

graph TD
    Target[User target] --> Resolve[impact_targets]
    Resolve --> Direct[direct callers and callees]
    Resolve --> Blast[blast_radius BFS]
    Blast --> Files[affected files]
    Blast --> Entry[affected entrypoints]
    Direct --> Report[impact_report JSON]
    Files --> Report
    Entry --> Report
Loading

impact_report() includes direct relationships, affected files, affected entrypoints, traversal direction, depth, max-node safety caps, and scoped blast-radius entries. Shadowed external placeholders are filtered so local definitions do not get drowned out by unresolved external symbols.

Key source files

File Purpose
src/lode/graph.py Impact and blast-radius implementation.
src/lode/cli.py lode impact handler.
src/lode/daemon.py /impact endpoint.
tests/test_graph.py Impact regression tests.

Entry points for modification

Change the traversal edge set in TRAVERSAL_EDGE_KINDS in src/lode/graph.py. Change output shape in impact_report(), then update CLI, daemon, and tests together.

Related pages

Clone this wiki locally