Skip to content

Impact & Analysis

NestWeaver’s analysis commands help you understand the consequences of changes before you make them. The impact command traces the blast radius of a symbol through the dependency graph with confidence-weighted scoring, while pr-impact analyzes an entire PR’s changed files and assigns a risk level. These are structural analyses based on the graph — no LLM required.

Impact walks back from a symbol to its callers checkout refund processPayment the symbol
checkout and refund call processPayment, so they sit in its blast radius. The walk follows incoming calls, imports, and inheritance.
CommandDescriptionKey Flags
impactTrace blast radius of a symbol--depth, --confidence, --repo, --json
pr-impactPR blast radius with risk scoring--files, --depth, --json
affected-testsSelect tests for changed files--files, --base-ref, --json
dead-codeDetect unreachable symbols--min-confidence, --json
hubsFind most-connected hub nodes--top, --json, --config
bridgesFind architectural chokepoints--top, --json, --config
contractsInspect API contract graph(subcommand)
rankingInspect ranking priorsexplain, rank subcommands
evalOffline retrieval-quality evaluationrun, compare subcommands
exportExport graph to external format--format, --output, --top
clustersDetect community clusters--resolution, --json
Terminal window
# Check what depends on a symbol
nestweaver impact "processPayment" --depth 5
# Filter to a specific repo in a multi-repo setup
nestweaver impact "processPayment" --repo payments-api --json
# Set minimum edge confidence threshold
nestweaver impact "processPayment" --confidence 0.8

impact traverses incoming CALLS, IMPORTS, EXTENDS, and IMPLEMENTS edges from the target symbol. Each affected symbol gets an impact_score that decays multiplicatively through edges — low-confidence paths are pruned automatically. The default depth is 3.

Terminal window
# Auto-detect changed files from git diff
nestweaver pr-impact
# Specify files explicitly
nestweaver pr-impact --files src/auth.rs,src/db.rs
# Deeper analysis
nestweaver pr-impact --depth 5 --json

pr-impact maps changed files to their symbols, runs transitive impact analysis, groups results by cluster, and assigns Low, Medium, High, or Unknown. Unknown means the change was not assessed. When no --files are given, it uses git diff --name-only against the working tree.

Terminal window
# Select tests affected by specific file changes
nestweaver affected-tests --files src/auth.rs,src/db.rs
# Diff against a base branch
nestweaver affected-tests --base-ref main --json

affected-tests performs static, call-graph-based regression test selection. It maps changed files to symbols, reverse-traverses CALLS/IMPORTS to depth 3, and buckets dependent test files into priority tiers. This is a prioritized signal, not a provably safe subset — it misses reflection, DI, codegen, and data-driven tests.

Terminal window
# Find potentially dead code
nestweaver dead-code
# Only high-confidence results
nestweaver dead-code --min-confidence high --json

dead-code walks forward from every entry point following CALLS, IMPORTS, EXTENDS, IMPLEMENTS, and MEMBER_OF edges. Symbols not reached are reported as potentially dead, with confidence levels: low, medium, high. Entry points are determined from manifest files and visibility modifiers.

Terminal window
# Find hub nodes (ranked by total degree: incoming plus outgoing)
nestweaver hubs --top 20
# Find bridge/chokepoint nodes (highest betweenness centrality)
nestweaver bridges --top 20
# Detect community clusters (Louvain-style local moving)
nestweaver clusters --resolution 0.5 --json

Hubs are central abstractions many parts of the codebase depend on. Bridges are architectural chokepoints — many shortest paths pass through them, so changing a bridge has outsized blast radius. Clusters use Louvain-style local moving, not the full Leiden algorithm. Results are cached in a sidecar file. Hubs are ranked by total degree. PageRank is extra metadata, not the sort key.

Terminal window
# Export as Cypher (Neo4j)
nestweaver export --format cypher
# Export as GraphML (Gephi/yEd)
nestweaver export --format graphml --output graph.xml
# Export as Mermaid flowchart (top 30 symbols by PageRank)
nestweaver export --format mermaid --top 30
# Export as MessagePack (for WASM mode)
nestweaver export --format msgpack --output graph.msgpack

Supported formats: Cypher (Neo4j), GraphML (Gephi/yEd), Mermaid, MessagePack.