Skip to content

The ratchet gate's run-when-main comment carries a second copy of the just-removed "TypeScript scanner" cross-check claim — and names two exports no test imports #1370

Description

@os-steve

Filed by the #1345 dev, from inside its own declared file but outside its declared paragraph (scripts/check-source-token-ratchet.mjs, the stripping-rule paragraph only). Reporting rather than fixing, on the precedent #1345 itself set: the #1335 dev found a same-file, out-of-paragraph correction, reported it, and the PM recorded that as "the right call" because the replacement wording is a choice, not mechanical. Same here.

All readings below measured on origin/main @ c772cbe.

The defect

scripts/check-source-token-ratchet.mjs:527-530, the comment above the run-when-main guard:

// Run only when invoked directly. `stripComments`, `verdict`, `anchor`,
// `BUFFER`, `fmt` and the ceilings are importable so
// `test/source-token-ratchet.test.ts` can cross-check the stripping rule
// against the TypeScript scanner without spawning 300KB fixtures for every
// case ...

"cross-check the stripping rule against the TypeScript scanner" is the same false wiring claim #1345 was filed to remove from the header paragraph 450 lines above — a second copy, in the same file, that #1345's declared scope did not cover. PR for #1345 fixes the header; this line survives it, so the file still tells a reader the cross-check exists.

It is wrong a second way, independently

The comment names six things as "importable so test/source-token-ratchet.test.ts can ..." — but that suite imports four of them, and neither of the two the sentence leads with:

test/source-token-ratchet.test.ts:8   import { anchor, fmt, BUFFER, CEILINGS } from '../scripts/check-source-token-ratchet.mjs';
test/docs-readme-token-figures.test.ts:7  import { BUFFER, CEILINGS } from '../scripts/check-source-token-ratchet.mjs';

Repo-wide, stripComments and verdict are imported by no test at all (grep over test/: 0 importing hits; the 120 raw verdict hits are unrelated prose and other suites' local identifiers). Both are exported from the gate (:248, :361).

⇒ Two separable questions for the fix, which is why this is a card and not a rider:

  1. The false clause — delete "against the TypeScript scanner", or repoint it at what the suite really does (fixtures per hazard class)?
  2. stripComments / verdict — are they exported for a consumer that never arrived, or is the missing coverage the actual bug? A gate's comment-stripping function with no test importing it is worth a decision, not a silent prose edit.

⚠️ Question 2 is the one that makes this non-mechanical. Do not fold it into a wording fix.

Scope

scripts/check-source-token-ratchet.mjs:527-535 (the run-when-main comment). ⛔ Not the header paragraph — #1345 owns that and has landed there. ⛔ Not the guard itself (isMainModule), which is correct and separately pinned by test/script-main-guard.test.ts.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    ci/cdCI plumbing and the verification pipelinedocumentationImprovements or additions to documentationpm:queueReady for the PM dispatch loop

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions