From 44dff9d45410bcc9b459414d8e1e89addb08a620 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 10 Sep 2026 12:43:40 +0000 Subject: [PATCH] fix(scripts): derive the dispatch-gates declaration case count in check-skill-compatibility-version's self-test 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. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU --- scripts/check-skill-compatibility-version.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/check-skill-compatibility-version.mjs b/scripts/check-skill-compatibility-version.mjs index de6afa3f9f6..580021263f7 100644 --- a/scripts/check-skill-compatibility-version.mjs +++ b/scripts/check-skill-compatibility-version.mjs @@ -777,7 +777,8 @@ function selfTest() { // state what it reads. If that refusal ever changes, this line moves with it. const unseeable = (r) => !r.includes('/') && !r.startsWith('.'); const declFailures = []; - const decl = (label, ok) => { if (!ok) declFailures.push(label); }; + let declCases = 0; + const decl = (label, ok) => { declCases += 1; if (!ok) declFailures.push(label); }; decl('SKILLS_DIR is invisible to the derivation, which is why it needs a declaration at all', unseeable(SKILLS_DIR)); decl('and it declares exactly that root, in the subtree spelling', @@ -864,7 +865,7 @@ function selfTest() { console.error(`\n✗ check-skill-compatibility-version self-test: ${failed} failure(s) (cases and floor).`); process.exit(1); } - console.log(`\n✓ check-skill-compatibility-version self-test: ${cases.length} cases pass, plus 7 dispatch-gates declaration cases.`); + console.log(`\n✓ check-skill-compatibility-version self-test: ${cases.length} cases pass, plus ${declCases} dispatch-gates declaration cases.`); selfTestReachedVerdict = true; }