Skip to content

[finding] measure-self-test-floor's DISPATCH criterion matches only includes()/has(), so six scripts that dispatch --self-test by equality are outside the census — pnpm-filter-targets among them #15421

Description

@claude

Found while flooring scripts/workspace-enumerator.mjs for #15375. Filed unassigned, out of that card's scope.

The reading

scripts/measure-self-test-floor.mjs selects its population on a --self-test dispatch, and spells that criterion as an argv-membership test:

/** A `--self-test` DISPATCH: argv membership tested, not a literal passed to a child. */
const DISPATCH = /(?:includes|has)\(\s*['"`]--self-test['"`]\s*\)/;

Only includes(...) and has(...) match. A script that dispatches by equality on an already-extracted flag does not:

// scripts/pnpm-filter-targets.mjs:695
if (flag === '--self-test') process.exit(await selfTest());

That is a real dispatch with a real CI invocation — check:pnpm-filter-targets runs node scripts/pnpm-filter-targets.mjs --self-test in lint.yml — and the census still cannot see the file. Measured on b3cc2cd57: the instrument reports 170 files and pnpm-filter-targets.mjs is not among them, under any classification.

Scope, measured

Six tracked scripts/** files dispatch on --self-test by equality and match neither arm of DISPATCH:

  • scripts/check-closing-keyword-parity.mjs
  • scripts/check-pnpm-filter-targets.mjs
  • scripts/check-settings-bind-window.mjs
  • scripts/check-step-collectors.mjs
  • scripts/measure-durability-swallow-family.mjs
  • scripts/pnpm-filter-targets.mjs

Their absence from the census is not a clearance — as with #15375, it is a set of files the criterion cannot reach, so no batch of #13799 will be dispatched against them and nothing records that they were never floored.

Boundary — what this is NOT

This is a different hole from #15375, which reports a module with no dispatch at all and whose header argues it must never acquire one. These six DO dispatch, and five of the six are gates CI already invokes with --self-test; only the criterion's spelling keeps them out. It is also distinct from #15153 (dispatch routed through a MODES table) and from #15339 (PRODUCES_FAILURE and a ternary process.exit), both of which are about other predicates in the same instrument.

Whether the repair is to widen DISPATCH, to add these as ENTRY_BY_HAND rows, or to leave the criterion alone and record the six as a known blind spot is the instrument's own question — the same standing question as #15391 / #15371 / #14963. Not chosen here.

Reproduce

node scripts/measure-self-test-floor.mjs --json | python3 -c "import json,sys; d=json.load(sys.stdin); print(len(d)); print([r for r in d if 'pnpm-filter-targets' in r['file']])"
grep -n "flag === '--self-test'" scripts/pnpm-filter-targets.mjs

Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions