(symbol: string, impact: Subgraph)
| 9261 | } |
| 9262 | |
| 9263 | private formatImpact(symbol: string, impact: Subgraph): string { |
| 9264 | const nodeCount = impact.nodes.size; |
| 9265 | |
| 9266 | // Compact format: just list affected symbols grouped by file |
| 9267 | const lines: string[] = [ |
| 9268 | `**Impact: "${symbol}" affects ${nodeCount} symbols${impact.truncated ? ' (truncated at safety limit)' : ''}**`, |
| 9269 | '', |
| 9270 | ]; |
| 9271 | if (impact.truncated) { |
| 9272 | lines.push('> Result truncated to protect the MCP process on a high-fanout graph. Narrow with `file` or reduce `depth`.', ''); |
| 9273 | } |
| 9274 | |
| 9275 | // Group by file |
| 9276 | const byFile = new Map<string, Node[]>(); |
| 9277 | for (const node of impact.nodes.values()) { |
| 9278 | const existing = byFile.get(node.filePath) || []; |
| 9279 | existing.push(node); |
| 9280 | byFile.set(node.filePath, existing); |
| 9281 | } |
| 9282 | |
| 9283 | for (const [file, nodes] of byFile) { |
| 9284 | lines.push(`**${file}:**`); |
| 9285 | // Compact: inline list |
| 9286 | const nodeList = nodes.map(n => `${n.name}:${n.startLine}`).join(', '); |
| 9287 | lines.push(nodeList); |
| 9288 | lines.push(''); |
| 9289 | } |
| 9290 | |
| 9291 | return lines.join('\n'); |
| 9292 | } |
| 9293 | |
| 9294 | /** |
| 9295 | * Build a compact structural outline of a container symbol from its |
no test coverage detected