You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(devx): give the last four --self-test dispatches a verdict handshake (#15729)
The four remaining DEFEATED rows of the self-test floor census discard the
self-test's completion, so an early `return` yields `undefined`,
`process.exit(undefined)` is exit 0, and the run prints zero bytes — "40
assertions held" and "the 40 assertions never ran" are the same green to a CI
wrapper that reads only the status.
All four now carry the one spelling the other 165 already do: a module-level
`selfTestReachedVerdict` flag set once a verdict is printed, read at the
dispatch, which refuses to exit 0 without it. The flag is set on the FAILURE
path too, so the refusal fires only when neither verdict was printed and a
genuine red keeps its own message.
No assertion is changed: all four unmutated verdict lines are byte-identical
before and after.
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: scripts/check-closing-keyword-parity.mjs
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -413,6 +413,15 @@ const MUTATIONS = [
413
413
},
414
414
];
415
415
416
+
// Set by `selfTest()` only after a verdict is printed -- either verdict -- and
417
+
// read at the dispatch below: a `return` that leaves the function above those
418
+
// lines prints nothing and still exits 0, so a self-test that never finished
419
+
// reports as one that passed. The self-test's own exit code stays load-bearing,
420
+
// so the handshake is a flag rather than a returned sentinel. The failure path
421
+
// sets it too: the refusal below must fire only when NEITHER verdict was
422
+
// printed, never on a genuine red that already said what failed.
423
+
letselfTestReachedVerdict=false;
424
+
416
425
functionselfTest(){
417
426
constroot=repoRoot();
418
427
constfailures=[];
@@ -465,16 +474,28 @@ function selfTest() {
465
474
466
475
if(failures.length===0){
467
476
console.log(`✓ check-closing-keyword-parity --self-test: ${checked} assertions, ${MUTATIONS.length} mutations of the shipped parsers each driven to red.`);
0 commit comments