topology_impact
Assess the blast radius of a symbol before refactoring with bidirectional dependency analysis, revealing what it depends on and what depends on it.
Instructions
Bidirectional BFS blast-radius analysis around a named symbol. Returns two sections: 'depends on' (outward — what the symbol depends on) and 'depended on by' (inward — what depends on this symbol). Primary use: assess blast radius before a refactor. Source is 'topology' (approximate); the topology call graph is intra-file, so for a function/method the inward section is augmented with a 'cross-file callers' block resolved via the language server (source=lsp) when one is available. mode="reachability" switches to entry-point reachability. The default package granularity follows production import edges from package-main roots plus candidate-seeded topology_routes roots; Go _test.go importers are excluded, and unsupported/polyglot workspaces are refused rather than reported as falsely unreachable. Set granularity="function" for the additive Go-only admitted partial static call graph: it uses exact callable roots, production callers, durable derived cross-file edges, and the full reachable closure. Unresolved receiver/dynamic calls, test callers, unsupported languages, and unindexed roots remain outside that lower-bound answer. Each granularity supports the default summary, path_to (one shortest root-to-target chain), and layers (SCC condensation; import cycles for package or recursion cycles for function). All outputs disclose their scope and known limitations, and responses are byte-capped. Returns a clear message when topology is disabled or the symbol is not in the index.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Optional node kind to disambiguate a shared name: function, method, type, class, constant, variable, field, … | |
| mode | No | Optional. "reachability" switches from the default single-symbol blast-radius analysis to entry-point reachability. Go-only for now; roots/path_to/layers require this mode. | |
| name | No | Symbol name or qualified name to analyse. Must exist in the topology index. Required unless mode="reachability". | |
| path | No | Optional file-path substring to disambiguate when several indexed symbols share this name (case-insensitive). | |
| depth | No | BFS depth for both traversals. Default 3, max 4. | |
| roots | No | Requires mode="reachability". package granularity accepts package directories or "main". function granularity accepts exact file.go#Symbol selectors or "main"; omit for defaults (package main roots plus candidate-seeded topology_routes roots). | |
| layers | No | Requires mode="reachability". When true, the response is an SCC condensation of the reachable subgraph — package import cycles or function recursion depending on granularity — instead of the summary. | |
| path_to | No | Requires mode="reachability". When set, the response is the single shortest root -> target chain; use a package directory for package granularity or file.go#Symbol for function granularity. | |
| max_bytes | No | Approximate byte budget per direction. Default 30000, max 100000. | |
| max_nodes | No | Maximum neighbour nodes per direction. Default 100, max 200. | |
| edge_kinds | No | Optional filter on edge kinds: calls, imports, contains, defines, inherits, implements. Defaults to imports, calls. | |
| granularity | No | Requires mode="reachability". Default package follows production import edges. function follows the admitted Go call graph outward from exact callable roots; test-file callers are excluded and unresolved/dynamic calls are disclosed. | package |