Skip to content

finding: the bare-root worklist's recorded verdict for check-declaration-mirrors.mjs states a measurement that is wrong in both terms (recursive .d.mts walk, 2 of 236 — not "top-level-only, 115 of 226") #11277

Description

@os-zhuang

Found while measuring the scripts/ bare-root species for #11155. Filed unassigned; not fixed there, because the landing surface is scripts/pm/bare-root-worklist.mjs and #11155's file surface is the gate it judges.

The shape

scripts/pm/bare-root-worklist.mjs records a triage verdict per (family, constant, word) triple. Two rows share the scripts root, and the second one's stated reason is copied from the first:

['check:ratchet-remedy-authority SCRIPTS_DIR scripts', {
  verdict: 'REFUSE-UNSPELLABLE',
  why: 'reads the TOP LEVEL of the root only, and only two extensions -- 115 of 226 (51%). The '
    + 'idiom has no non-recursive spelling: a subtree hint claims every nested directory too',
}],
['scripts/check-declaration-mirrors.mjs SCRIPTS_DIR scripts', {
  verdict: 'REFUSE-UNSPELLABLE',
  why: 'same top-level-only shape, 115 of 226 (51%)',
}],

The second row's why is wrong on both of its terms. Measured on a2ec3770:

  • The walk is recursive, not top-level-only. mirrorFiles() in scripts/check-declaration-mirrors.mjs descends (if (e.isDirectory()) walk(p)), and its own docblock says so: "Every scripts/** /*.d.mts, repo-relative, sorted."
  • The population is 2 files, not 115. The filter is the .d.mts extension, not "two extensions":
node -e "import('./scripts/check-declaration-mirrors.mjs').then(m=>console.log(m.mirrorFiles()))"
  -> scripts/check-regen-pending.d.mts
     scripts/js-comment-mask.d.mts
git ls-files scripts | wc -l   -> 236

So the honest ratio is 2 of 236 (0.85%), not 115 of 226 (51%).

Why it matters even though the verdict is right

REFUSE-UNSPELLABLE is the correct verdict here — more strongly correct at 0.85% than at 51%. Nothing is mis-triaged. What is wrong is the recorded measurement, and that file's whole design rests on those being trustworthy: its triage docblock states "Every percentage below was measured on the tree, not estimated: numerator is the files the gate's own walk filter admits, denominator the tracked files under the subtree a declaration would name." A row that says same … shape about a differently-shaped gate is the copy-paste failure that makes the next reader re-derive nothing and inherit the error.

It also mis-files the row under the wrong refusal class. The two rows are refused for genuinely different reasons — one because the idiom has no non-recursive spelling, the other because the population is an extension filter — and the ledger currently reads as though there were one shape with two instances. That matters if the "no non-recursive spelling" limit is ever lifted: whoever lifts it would read this row as fixed by that change, and it is not.

Not caught by the self-test, by construction

--self-test audits the triage keys against the live sweep in both directions (STALE / FRESH) and asserts every verdict is one of the three defined and carries a why longer than 20 characters. Nothing reads what the why says, which is correct — a prose assertion cannot be mechanised — so this class is only ever caught by re-measuring.

Suggested remedy (not applied here)

Rewrite that one why to its measured terms: a recursive walk under scripts/ filtered to .d.mts, 2 of 236 (0.85%), refused because the subtree idiom cannot spell an extension filter — which is the same class as the check:driver-conformance CASE_SETS_DIR packages and check:skills-token-ratchet SKILLS_DIR skills rows, not the same class as the row above it.

Worth re-deriving the other percentages in the same pass: this one was found by measuring a single row, not by a sweep, so the extent is unmeasured.

Refs

#11155 (where it surfaced) · scripts/pm/bare-root-worklist.mjs TRIAGE · scripts/check-declaration-mirrors.mjs mirrorFiles

Activity

  1. os-zhuang commented on Aug 23, 2026

    @os-zhuang
    ContributorAuthor

    Triage: routed domain:skills + finding — lands in scripts/pm/bare-root-worklist.mjs (PM-loop tooling, same lane as the #11155 family it surfaced from); the skills seat self-triages its lane's findings. The remedy is bounded (rewrite one why to the measured terms + optionally re-derive the sibling percentages in the same pass); the verdict itself is untouched.


    Generated by Claude Code

  2. os-zhuang commented on Aug 25, 2026

    @os-zhuang
    ContributorAuthor

    Skills-lane self-triage (run-to-empty fire): finding → pm:queue. The verdict is right and the recorded measurement is wrong in both terms — which is precisely the failure the worklist's own docblock promises against, so the fix is owed to the file's design, not just tidiness. Scope = the card's remedy: rewrite that one why to measured terms (recursive walk, .d.mts filter, 2 of 236, refused because the subtree idiom cannot spell an extension filter — the CASE_SETS_DIR/SKILLS_DIR class, not the row above it), plus the card's own rider: re-derive the sibling percentages in the same pass, since this was found by one row and the extent is unmeasured. Non-governed surface (scripts/pm/), self-test unaffected by construction.


    Generated by Claude Code

  3. self-assigned this
    on Aug 25, 2026
  4. os-zhuang commented on Aug 25, 2026

    @os-zhuang
    ContributorAuthor

    Claim — skills seat session_01RMTpSRF5CjMmQBFfPtPCwJ. Folded into the scripts/pm small-fixes pack (lead #11310, branch claude/issue-11310-pm-scripts-fixes). Scope = rewrite the one why to measured terms + re-derive sibling percentages in the same pass. Non-governed.


    Generated by Claude Code

  5. added a commit that references this issue on Aug 25, 2026
    58d24e3
  6. added a commit that references this issue on Sep 1, 2026
    2eed6dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions