(symbol: string, impact: Subgraph)
| 9088 | } |
| 9089 | |
| 9090 | private formatImpact(symbol: string, impact: Subgraph): string { |
| 9091 | const nodeCount = impact.nodes.size; |
| 9092 | |
| 9093 | // Compact format: just list affected symbols grouped by file |
| 9094 | const lines: string[] = [ |
| 9095 | `**Impact: "${symbol}" affects ${nodeCount} symbols${impact.truncated ? ' (truncated at safety limit)' : ''}**`, |
| 9096 | '', |
| 9097 | ]; |
| 9098 | if (impact.truncated) { |
| 9099 | lines.push('> Result truncated to protect the MCP process on a high-fanout graph. Narrow with `file` or reduce `depth`.', ''); |
| 9100 | } |
| 9101 | |
| 9102 | // Group by file |
| 9103 | const byFile = new Map<string, Node[]>(); |
| 9104 | for (const node of impact.nodes.values()) { |
| 9105 | const existing = byFile.get(node.filePath) || []; |
| 9106 | existing.push(node); |
| 9107 | byFile.set(node.filePath, existing); |
| 9108 | } |
| 9109 | |
| 9110 | for (const [file, nodes] of byFile) { |
| 9111 | lines.push(`**${file}:**`); |
| 9112 | // Compact: inline list |
| 9113 | const nodeList = nodes.map(n => `${n.name}:${n.startLine}`).join(', '); |
| 9114 | lines.push(nodeList); |
| 9115 | lines.push(''); |
| 9116 | } |
| 9117 | |
| 9118 | return lines.join('\n'); |
| 9119 | } |
| 9120 | |
| 9121 | /** |
| 9122 | * Build a compact structural outline of a container symbol from its |
no test coverage detected