Skip to content

Commit 9224204

Browse files
baozhoutaoclaude
andauthored
fix(scripts): derive the dispatch-gates declaration case count in check-skill-compatibility-version's self-test (#17414)
The self-test's success line hand-transcribed "7 dispatch-gates declaration cases" while the declFailures block registers 6 decl(...) calls, so the printed count overstated the real population by one and could drift again the moment a decl() call is added or removed. decl() now increments a declCases counter and the success line prints ${declCases} instead of the literal, mirroring check-skill-frame-sync.mjs's popCases/pop() pattern. Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU Co-authored-by: Claude <noreply@anthropic.com>
1 parent 00ac1c8 commit 9224204

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/check-skill-compatibility-version.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,8 @@ function selfTest() {
777777
// state what it reads. If that refusal ever changes, this line moves with it.
778778
const unseeable = (r) => !r.includes('/') && !r.startsWith('.');
779779
const declFailures = [];
780-
const decl = (label, ok) => { if (!ok) declFailures.push(label); };
780+
let declCases = 0;
781+
const decl = (label, ok) => { declCases += 1; if (!ok) declFailures.push(label); };
781782
decl('SKILLS_DIR is invisible to the derivation, which is why it needs a declaration at all',
782783
unseeable(SKILLS_DIR));
783784
decl('and it declares exactly that root, in the subtree spelling',
@@ -864,7 +865,7 @@ function selfTest() {
864865
console.error(`\n✗ check-skill-compatibility-version self-test: ${failed} failure(s) (cases and floor).`);
865866
process.exit(1);
866867
}
867-
console.log(`\n✓ check-skill-compatibility-version self-test: ${cases.length} cases pass, plus 7 dispatch-gates declaration cases.`);
868+
console.log(`\n✓ check-skill-compatibility-version self-test: ${cases.length} cases pass, plus ${declCases} dispatch-gates declaration cases.`);
868869
selfTestReachedVerdict = true;
869870
}
870871

0 commit comments

Comments
 (0)