Skip to content

[finding] check-dispatch-gates.mjs's header understates the self-test's live-tree contact — the file lint.yml defers to as authoritative names one workflow and "the packages tree", measured at 28 workflows, 200 script sources and 4 temporary git repos #12983

Description

@os-elon

scripts/pm/check-dispatch-gates.mjs's header describes what the tool's --self-test touches on the real tree:

That self-test is not fixture-only either: it reads the real pr-automation.yml and walks the real packages tree in the cases where a fixture cannot prove the point, so the derivation's contact with reality is covered by this gate too.

Measured on 7349a760a6 by instrumenting fs.readFileSync / fs.openSync / child_process around node scripts/pm/dispatch-gates.mjs --self-test, with a null control through the same instrument in the same run (node -e 0 reported 0 for every counter):

readingself-testnull control
self-test cases834 passn/a
distinct workflow files opened280
distinct scripts/** sources opened2000
distinct repo files opened54160
mkdtempSync scratch roots40
child processes (of which git)169 (158)0
git init / git clone / git ls-files4 / 2 / 340

So "the real pr-automation.yml" is 28 workflow files, "walks the real packages tree" omits that the live-tree cases open the source of every gate the discovery finds, build real temporary git repositories and drive changedPathsFromGit against them, and sweep the tracked corpus.

Why this is worth a card rather than a shrug

⚠️ The direction of the error is the mild one — the header under-sells a decision that is correct, rather than endorsing a wrong one — so this is a smaller defect than the one it neighbours. It is filed anyway for two reasons.

First, it is the same defect class as the lint.yml cost note repaired in #12831 / PR #12982: a stale description of this self-test's live-tree contact, written when the self-test was small and never re-read as it grew.

Second, and specific to this file: .github/workflows/lint.ymldefers to this header as the authority, in the same paragraph the #12831 repair touched —

Why the gate is its own file rather than pointing check:pm-dispatch-gates straight at the tool is measured and argued in scripts/pm/check-dispatch-gates.mjs's header

— so a reader sent from the workflow to this header for the measured argument arrives at a description of a much smaller self-test than the one CI runs. #12831's repair deliberately made the workflow comment qualitative and count-free so it cannot rot again; this header still carries the older, narrower spelling.

Suggested shape, not a prescription

The repair that does not re-rot is the same one #12831 took: describe the shape of the contact rather than an enumeration that goes stale ("it runs the same discovery the tool does — every workflow file, then the source of every discovered gate — builds temporary git repositories, and sweeps the tracked corpus"). ⛔ Note that any concrete figure written here inherits the same rot; the numbers above are evidence on a named commit, not proposed wording.

Scope note

⛔ Deliberately left out of PR #12982. Triage on #12831 pinned that card's landing site to .github/workflows/lint.yml and its scope to "delete the number, do not replace it", and editing a gate script would have added a verification surface that card does not carry. Filed rather than folded in.

Duplicate check

One targeted search_issues call scoped to this repo (the bare REST search endpoint is not reachable from this session — every repo-scoped REST read returns 403, and gh is absent). The result set is its own positive control: 122 total, 25 returned, including #12831 itself and this tool's own history (#11150, #11404, #11511, #12500, #12797), so it is not a silent zero. Nearest neighbour is #12934 — the same class (a gate script's header carrying a stale self-description) on a different file, cross-package-test-inputs.mjs, so not a duplicate. ⛔ No open card covers this site. ⚠️ Not exhaustively deduped outside this query.

Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions