(symbol: string, impact: Subgraph)
| 9235 | } |
| 9236 | |
| 9237 | private formatImpact(symbol: string, impact: Subgraph): string { |
| 9238 | const nodeCount = impact.nodes.size; |
| 9239 | |
| 9240 | // Compact format: just list affected symbols grouped by file |
| 9241 | const lines: string[] = [ |
| 9242 | `**Impact: "${symbol}" affects ${nodeCount} symbols${impact.truncated ? ' (truncated at safety limit)' : ''}**`, |
| 9243 | '', |
| 9244 | ]; |
| 9245 | if (impact.truncated) { |
| 9246 | lines.push('> Result truncated to protect the MCP process on a high-fanout graph. Narrow with `file` or reduce `depth`.', ''); |
| 9247 | } |
| 9248 | |
| 9249 | // Group by file |
| 9250 | const byFile = new Map<string, Node[]>(); |
| 9251 | for (const node of impact.nodes.values()) { |
| 9252 | const existing = byFile.get(node.filePath) || []; |
| 9253 | existing.push(node); |
| 9254 | byFile.set(node.filePath, existing); |
| 9255 | } |
| 9256 | |
| 9257 | for (const [file, nodes] of byFile) { |
| 9258 | lines.push(`**${file}:**`); |
| 9259 | // Compact: inline list |
| 9260 | const nodeList = nodes.map(n => `${n.name}:${n.startLine}`).join(', '); |
| 9261 | lines.push(nodeList); |
| 9262 | lines.push(''); |
| 9263 | } |
| 9264 | |
| 9265 | return lines.join('\n'); |
| 9266 | } |
| 9267 | |
| 9268 | /** |
| 9269 | * Build a compact structural outline of a container symbol from its |
no test coverage detected