Problem
The blast-radius command currently calls /v1/graphs/supermodel, gets a generic graph, and does naive reverse BFS on import edges in Go. This misses the API's real impact analysis which includes:
- Call graph + dependency graph reachability (not just imports)
- Risk scoring (low/medium/high/critical) with risk factors
- Affected functions with distance and relationship type (direct_caller/transitive_caller)
- Affected entry points (route handlers, module exports, event handlers)
- Diff-based analysis (auto-extract targets from
git diff)
- Global coupling map when no targets specified
- Cross-domain impact detection
The API already exposes all of this at POST /v1/analysis/impact.
Solution
Wire the CLI's blast-radius command to the dedicated endpoint:
- Add
Impact() method to api.Client that POSTs to /v1/analysis/impact with async polling
- Add response types (
ImpactResult, BlastRadius, AffectedFunction, AffectedFile, etc.)
- Rewrite
internal/blastradius/handler.go to call the new endpoint
- Support
--targets query param and --diff file upload
- Surface risk scores, affected functions, and entry points in output
Three modes
supermodel blast-radius <file> — target a specific file (maps to ?targets=<file>)
supermodel blast-radius --diff changes.diff — analyze from a diff
supermodel blast-radius (no args) — global coupling map
References
- API spec:
POST /v1/analysis/impact in openapi.yaml
- Current CLI handler:
internal/blastradius/handler.go (naive import BFS)
- Pattern:
internal/deadcode/handler.go (already wired to dedicated endpoint)
Problem
The
blast-radiuscommand currently calls/v1/graphs/supermodel, gets a generic graph, and does naive reverse BFS on import edges in Go. This misses the API's real impact analysis which includes:git diff)The API already exposes all of this at
POST /v1/analysis/impact.Solution
Wire the CLI's
blast-radiuscommand to the dedicated endpoint:Impact()method toapi.Clientthat POSTs to/v1/analysis/impactwith async pollingImpactResult,BlastRadius,AffectedFunction,AffectedFile, etc.)internal/blastradius/handler.goto call the new endpoint--targetsquery param and--difffile uploadThree modes
supermodel blast-radius <file>— target a specific file (maps to?targets=<file>)supermodel blast-radius --diff changes.diff— analyze from a diffsupermodel blast-radius(no args) — global coupling mapReferences
POST /v1/analysis/impactin openapi.yamlinternal/blastradius/handler.go(naive import BFS)internal/deadcode/handler.go(already wired to dedicated endpoint)