| 5539 | // with (score, graph mass, term hits, flags) — not just what it cost. |
| 5540 | if (diag) { |
| 5541 | const kindMix = (nodes: Node[]): string => { |
| 5542 | const counts = new Map<string, number>(); |
| 5543 | for (const n of nodes) counts.set(n.kind, (counts.get(n.kind) ?? 0) + 1); |
| 5544 | return [...counts.entries()] |
| 5545 | .sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])) |
| 5546 | .map(([k, c]) => `${k}:${c}`) |
| 5547 | .join(' '); |
| 5548 | }; |
| 5549 | sortedFiles.forEach(([fp, group], i) => { |
| 5550 | diag.noteCandidate(fp, { |
| 5551 | rank: i + 1, |