Skip to content

Derive the dispatch-gates declaration case count in check-skill-compatibility-version's self-test - #17414

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-15291-derive-decl-case-count
Sep 10, 2026
Merged

baozhoutao merged 1 commit into
mainfrom
claude/issue-15291-derive-decl-case-count

Conversation

@baozhoutao

@baozhoutao baozhoutao commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #15291

What changed

check-skill-compatibility-version.mjs's self-test success line hand-transcribed
plus 7 dispatch-gates declaration cases, while the declFailures block it
describes registers only 6 decl(...) calls — a count accurate on the day it was
written, wrong the moment a 7th decl() is added or one is removed. Mirroring the
existing precedent in check-skill-frame-sync.mjs (popCases / pop()), decl()
now increments a declCases counter and the success line prints ${declCases}
instead of the literal.

-  const decl = (label, ok) => { if (!ok) declFailures.push(label); };
+  let declCases = 0;
+  const decl = (label, ok) => { declCases += 1; if (!ok) declFailures.push(label); };
...
-  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.`);

Before / after green line

Before (origin/main 572c33a2c4):

✓ check-skill-compatibility-version self-test: 18 cases pass, plus 7 dispatch-gates declaration cases.

After (this PR):

✓ check-skill-compatibility-version self-test: 18 cases pass, plus 6 dispatch-gates declaration cases.

The line moving from 7 to 6 is the expected, correct behaviour change — the
decl(...) block really registers 6 cases today. This is exactly why the issue was
not folded into #15288 (batch 7a), whose proof depended on the self-test's success
line staying byte-identical to main.

Verification — both legs

  1. Adding a decl(...) call moves the number. A probe decl('leg-1 probe: an added decl() call must move declCases', true); appended after the existing
    block moved the printed count from 6 to 7:
    ✓ check-skill-compatibility-version self-test: 18 cases pass, plus 7 dispatch-gates declaration cases.
    
  2. An unrelated edit does not move the number. Adding an unrelated comment line
    at the top of the file (outside selfTest()) left the printed count at 6:
    ✓ check-skill-compatibility-version self-test: 18 cases pass, plus 6 dispatch-gates declaration cases.
    
    Both probes were reverted before this commit; the working tree diff is exactly
    the two-line fix shown above (git diff confirmed clean before committing).

decl( count in the declFailures block on origin/main 572c33a2c4: 6
(lines 796, 798, 800, 808, 812, 817).

Scope

Only scripts/check-skill-compatibility-version.mjs touched. check-skill-frame-sync.mjs
(the model for this fix) is untouched. This is not assertion-floor work (#13799) —
the derived value is not pinned as a floor, only printed.

Clause-②: no


Generated by Claude Code

…ck-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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU
@claude claude Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 10, 2026
@baozhoutao
baozhoutao marked this pull request as ready for review September 10, 2026 12:57
@baozhoutao
baozhoutao added this pull request to the merge queue Sep 10, 2026
Merged via the queue into main with commit 9224204 Sep 10, 2026
42 checks passed
@baozhoutao
baozhoutao deleted the claude/issue-15291-derive-decl-case-count branch September 10, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants