Skip to content

Commit 11007fa

Browse files
committed
conformance-matrix: list over-accepts grouped by directory
The FP (over-accept) set is the path to 100% bidirectional. Group it by directory so the categories to tighten are visible at a glance; pass `fp` to also list every file under each group.
1 parent 94941b2 commit 11007fa

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

test/conformance-matrix.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,19 @@ console.log('');
4646
console.log(` Valid-code coverage : ${(TP / (TP + FN) * 100).toFixed(2)}% (${TP}/${TP + FN}) ← parses every valid file when FN=0`);
4747
console.log(` Bidirectional agree : ${((TP + TN) / total * 100).toFixed(2)}% (${TP + TN}/${total})`);
4848
if (fns.length) console.log(`\n MISSED valid (real gaps):\n${fns.map(x => ' - ' + x).join('\n')}`);
49+
50+
// Over-accepts grouped by directory → the over-acceptance *categories* to tighten.
51+
// Run `node test/conformance-matrix.ts fp` to also list every file under each group.
52+
const showFiles = process.argv.includes('fp');
53+
const byDir = new Map<string, string[]>();
54+
for (const f of fps) {
55+
const dir = f.split('/').slice(0, -1).join('/');
56+
(byDir.get(dir) ?? byDir.set(dir, []).get(dir)!).push(f);
57+
}
58+
const groups = [...byDir.entries()].sort((a, b) => b[1].length - a[1].length);
59+
console.log(`\n OVER-ACCEPTS by directory (${FP} files, ${groups.length} dirs) — these are the categories to tighten:`);
60+
for (const [dir, files] of groups) {
61+
console.log(` ${String(files.length).padStart(3)} ${dir}`);
62+
if (showFiles) for (const f of files) console.log(` ${f.split('/').pop()}`);
63+
}
64+
if (!showFiles) console.log(`\n (re-run with \`fp\` to list every file: node test/conformance-matrix.ts fp)`);

0 commit comments

Comments
 (0)