Skip to content

Commit ff20f81

Browse files
committed
test(pm): let the self-test name its failing case under ablation
The matcher ablation destructured undefined and crashed, printing no case name — a self-test that dies reports "something is broken" where the value is "this exact case went red". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx
1 parent 4e02b96 commit ff20f81

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

scripts/pm/dispatch-gates.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3925,18 +3925,24 @@ function selfTest() {
39253925
].join('\n');
39263926
const stInvs = extractCheckInvocations(selfTestWf, 'lint.yml');
39273927
const stNames = stInvs.map((i) => i.check);
3928+
// Absent rather than thrown: with the matcher ablated these lookups return
3929+
// nothing, and a self-test that CRASHES instead of naming its failing case
3930+
// reports "something is broken" where the whole value is "this exact case
3931+
// went red". Measured — the first ablation run of this change died on a
3932+
// destructure here and printed no case name at all.
3933+
const stFind = (name) => stInvs.find((i) => i.check === name) ?? { check: '(not discovered)', direct: true };
39283934
t(
39293935
'the gate that shipped the red on PR #11397 is discovered, flag included',
39303936
stNames.includes('scripts/pm/bare-root-worklist.mjs --self-test'),
39313937
);
39323938
t(
39333939
'…as a DIRECT family resolving to the script file, not to the flagged key',
3934-
stInvs.find((i) => i.check === 'scripts/pm/bare-root-worklist.mjs --self-test')?.script
3940+
stFind('scripts/pm/bare-root-worklist.mjs --self-test').script
39353941
=== 'scripts/pm/bare-root-worklist.mjs',
39363942
);
39373943
t(
39383944
'…and it prints as a command a dev can paste, flag included — the bare path exits 0 without testing anything',
3939-
runnableInvocation(stInvs.find((i) => i.check === 'scripts/pm/bare-root-worklist.mjs --self-test'))
3945+
runnableInvocation(stFind('scripts/pm/bare-root-worklist.mjs --self-test'))
39403946
=== 'node scripts/pm/bare-root-worklist.mjs --self-test',
39413947
);
39423948
// The refusal, which is the half that keeps this from being the widening

0 commit comments

Comments
 (0)