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.
Command reference
Section titled “Command reference”| Command | Description | Key Flags |
|---|---|---|
impact | Trace blast radius of a symbol | --depth, --confidence, --min-score, --limit, --repo, --json |
pr-impact | PR blast radius with risk scoring | --files, --base, --repo, --depth, --strict, --sarif, --json |
affected-tests | Select tests for changed files | --files, --base-ref, --repo, --json |
dead-code | Review unreachable symbols | --min-confidence, --repo, --limit, --offset, --generation, --page-token, --json |
hubs | Find most-connected hub nodes | --top, --repo, --json, --config |
bridges | Find architectural chokepoints | --top, --repo, --json, --config |
contracts | Inspect API contract graph | list, drift, diff subcommands |
ranking | Inspect ranking priors | explain, rank subcommands |
eval | Offline retrieval-quality evaluation | run, compare subcommands |
export | Export graph to external format | --format, --scope, --output, --top |
clusters | Detect community clusters | --resolution, --repo, --limit, --members, --json |
Blast radius analysis
Section titled “Blast radius analysis”# Check what depends on a symbolnestweaver impact "processPayment" --depth 5
# Filter to a specific repo in a multi-repo setupnestweaver impact "processPayment" --repo payments-api --json
# Set minimum edge confidence thresholdnestweaver impact "processPayment" --confidence 0.8impact 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, and the pruning is disclosed (--min-score 0 opts out). The default depth is 3 (range 1–15) and the default --limit is 50 (range 1–1000).
Name a symbol by UID, by name, or qualified as path::name, Class::method or path::Class::method. path::<module> names a file’s top-level code. A miss exits 2 with a Did you mean: line; an ambiguous name exits 3 and lists candidates with their file paths. A --repo that names no indexed repo exits 2 and an ambiguous one exits 3. An empty or malformed --repo is not handled the same way everywhere yet: --repo '' exits 64 on hubs, dead-code, affected-tests and clusters but is ignored by impact, flow-trace and pr-impact, which then match every repo, and a malformed selector such as repo::: names no repo and exits 2. A selector over 512 bytes exits 64. Pass a repo name, root path or UID from nestweaver list-repos.
PR impact analysis
Section titled “PR impact analysis”# Auto-detect changed files from git diffnestweaver pr-impact
# Specify files explicitly, in a named reponestweaver pr-impact --files src/auth.rs,src/db.rs --repo payments-api
# Diff against a base ref (a merge-base SHA gives the PR's own changes)nestweaver pr-impact --base "$(git merge-base origin/main HEAD)"
# Gate CI on contract-verified breaking changes, or emit SARIFnestweaver pr-impact --base origin/main --strictnestweaver pr-impact --base origin/main --sarif > nestweaver.sarifpr-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 neither --files nor --base is given, it uses git diff --name-only against the working tree.
pr-impact reviews one repo: the indexed repo checked out at the working directory’s git root, or the one --repo <name or UID> names. Repo-relative --files paths resolve in that repo only. --strict exits 2 on a contract-verified breaking change; what it blocks on is set by [pr_impact] in the instance config. A degraded or incomplete run never blocks.
Test selection
Section titled “Test selection”# Select tests affected by specific file changesnestweaver affected-tests --files src/auth.rs,src/db.rs
# Name the repo when the database holds more than onenestweaver affected-tests --files src/auth.rs --repo my-service
# Diff against a base branchnestweaver affected-tests --base-ref main --jsonPass --files or --base-ref, not both. The selection covers one repository. With --base-ref, that is the indexed repo checked out at the working directory’s git root. With --files, it is the only indexed repo; when the database holds more than one, --repo is required and the command exits 64 without it. Repo-relative paths resolve in that repo only, and --json names the repo. --base-ref runs git diff --name-only <ref>, which compares the ref with your working tree: it includes uncommitted edits and is not the merge-base diff, so pass a merge-base SHA when that is what you want.
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.
Dead code detection
Section titled “Dead code detection”# Review unreachable symbolsnestweaver dead-code
# Only high-confidence candidates in one reponestweaver dead-code --min-confidence high --repo my-service --jsondead-code walks forward from every entry point (and every file’s top-level <module> code) following CALLS, IMPORTS, EXTENDS, IMPLEMENTS, and MEMBER_OF edges. Symbols the walk does not reach are review candidates, not a deletion list: a reference the parser does not capture looks the same as no reference. Every confidence tier (low, medium, high) is a candidate to check by hand. Entry points come from manifest files, language-specific rules and visibility modifiers.
On a graph built by an older resolver generation, dead-code refuses and exits 2 with the nestweaver index --repo <path> --force commands to run, because a missing edge would move live code onto the list. coverage: "degraded" means the walk had no roots or could not read its inputs. --limit is 1–1000 (default 50); page with --offset, or with --page-token and --generation from the previous page.
Graph topology
Section titled “Graph topology”# 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 --jsonHubs 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.
Graph export
Section titled “Graph export”# 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.msgpackSupported formats: Cypher (Neo4j), GraphML (Gephi/yEd), Mermaid, MessagePack. --scope picks all (default), code or vault; cypher, mermaid and msgpack are code-only. An invalid --format or --scope value exits 64, while a valid but unsupported combination (such as --format cypher --scope vault) exits 1.
Contract diff
Section titled “Contract diff”nestweaver contracts diff --base openapi-v1.yaml --head openapi-v2.yaml --fail-on-breakingcontracts diff compares two OpenAPI spec files at the endpoint, request/response field and type level, including request parameters and response statuses, and classifies each change as BREAKING or INFO. --fail-on-breaking exits non-zero on any BREAKING change, so a breaking parameter or status change now fails it too.