|
| 1 | +--- |
| 2 | +name: raysense-impact |
| 3 | +description: Use before refactoring, deleting, moving, or substantially modifying a file to compute its blast radius, coupling profile, and cycle exposure. Lets the agent edit with awareness of downstream effects rather than discovering them after the fact. |
| 4 | +--- |
| 5 | + |
| 6 | +# Raysense Impact |
| 7 | + |
| 8 | +Call this *before* a non-trivial edit (deletion, rename, signature |
| 9 | +change, extraction, file move). It tells the agent what depends on the |
| 10 | +target and what the target depends on, so the edit plan can account |
| 11 | +for the blast radius up front. |
| 12 | + |
| 13 | +All tools take a `path` argument (absolute, current repo root) plus |
| 14 | +the target file path relative to that root. |
| 15 | + |
| 16 | +## Steps |
| 17 | + |
| 18 | +1. **Blast radius** — call `raysense_blast_radius` with `path: <cwd>` |
| 19 | + and `file: <target>`. Returns the set of files reachable downstream |
| 20 | + under the active edge filter. A blast radius >20 files is a strong |
| 21 | + signal to break the change into smaller commits. |
| 22 | +2. **Coupling profile** — call `raysense_coupling`. Look up the |
| 23 | + target's module in the response: afferent (incoming) and efferent |
| 24 | + (outgoing) counts, plus main-sequence distance. High-afferent |
| 25 | + modules are stable foundations — breaking changes there cascade |
| 26 | + widely. |
| 27 | +3. **Cycle exposure** — call `raysense_cycles`. If the target appears |
| 28 | + in any reported cycle, call |
| 29 | + `raysense_break_cycle_recommendations` for ranked candidate edges |
| 30 | + to remove. The recommended edge is often *not* the obvious one. |
| 31 | +4. **Optional simulation** — when the planned change is mechanical |
| 32 | + (file removal, edge removal), call `raysense_what_if` to preview |
| 33 | + the health delta without touching the working tree. |
| 34 | + |
| 35 | +## What to keep in working memory |
| 36 | + |
| 37 | +- Number of files in the blast radius — quote it back to the user |
| 38 | + before starting an edit that exceeds 20. |
| 39 | +- Whether the target is on any cycle — informs whether the edit is |
| 40 | + likely to introduce or break a cycle. |
| 41 | +- The `instability` score — a value near 1.0 means the file is |
| 42 | + expected to depend on stable foundations, not be one. |
| 43 | + |
| 44 | +## When to skip |
| 45 | + |
| 46 | +- Local-only edit inside one file with no signature changes (typo |
| 47 | + fix, comment, internal rename). No downstream effect, no need. |
| 48 | +- Brand-new file. Nothing depends on it yet. |
0 commit comments