| 5595 | // with (score, graph mass, term hits, flags) — not just what it cost. |
| 5596 | if (diag) { |
| 5597 | const kindMix = (nodes: Node[]): string => { |
| 5598 | const counts = new Map<string, number>(); |
| 5599 | for (const n of nodes) counts.set(n.kind, (counts.get(n.kind) ?? 0) + 1); |
| 5600 | return [...counts.entries()] |
| 5601 | .sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])) |
| 5602 | .map(([k, c]) => `${k}:${c}`) |
| 5603 | .join(' '); |
| 5604 | }; |
| 5605 | sortedFiles.forEach(([fp, group], i) => { |
| 5606 | diag.noteCandidate(fp, { |
| 5607 | rank: i + 1, |