# Cross-repo blast radius

Cross-repo blast radius walks the system graph against its edges to show which downstream services and repos a change can break, ranked by impact score.

Blast radius answers a single question: **if I change this service, what
downstream services and repos break?** It walks the
[system graph](https://docs.repowise.dev/multi-repo/system-map) *against* its edge direction
(a `consumer → provider` edge means changing the provider impacts the
consumer) and returns every reachable service ranked by an impact score.

## Structural vs behavioral impact

Two edge classes are weighted and labelled distinctly:

- **Structural** edges (http, grpc, event, package, db) assert a real
  dependency, a contract or an import. They propagate impact at full
  weight and surface as **will break**.
- **Behavioral** co-change edges only assert that two files historically
  *changed together*. That is correlation, not a call, so they propagate
  at half weight and surface as **may drift**.

Each impacted service carries its `distance` (hops from the change) and
`score` (0-1, with distance decay and the behavioral weighting baked
in). Nearer, structural impact ranks highest.

## Three ways to use it

### REST

```text
GET /api/workspace/blast-radius?target=<node-id-or-repo>&max_depth=3&include_behavioral=true
```

`target` is a node id (`repo` or `repo::service/path`) or a repo alias
(which expands to all of its services).

### MCP

The [`get_blast_radius`](https://docs.repowise.dev/multi-repo/workspace-mcp) tool (workspace
mode) gives an agent the impacted set before it touches a high-fan-out
provider. The [`get_risk`](https://docs.repowise.dev/mcp/get-risk) PR-mode directive also
carries `will_break_consumers` and `missing_cross_repo_cochanges`, so a
diff in one repo flags its cross-repo fallout.

### System Map

Pick a service in the **Blast radius** control above the
[System Map](https://docs.repowise.dev/multi-repo/system-map). The reachable set
ripples (highlighted, the rest dimmed, with badges grading intensity),
and a side panel lists the impacted services. Click any impacted service
to walk the impact outward from there.

> **Note**
>
> Structural impact (`will break`) outweighs behavioral co-change
> (`may drift`). When both appear for the same change, fix the structural
> consumers before you ship, and treat the co-change set as a checklist to
> review.
