Repository navigation
Commit 81bba6c
chore(scripts): delete 11 root scripts nothing reaches; --self-test for check-node-version, check-release-notes and check-service-providers (#26235)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9RdxrKhQwWyCt2rysjANPQa)_
Part of #26091 — Wanted 1 and Wanted 3 only. Wanted 2 (one invocation
spelling) stays on the card: it edits `.github/workflows/**` and the
root alias map, held this round. #26091 remains open.
Clause-②: no
Metadata-protocol: none
## What changed
**Wanted 1 — 11 root scripts nothing reaches are deleted; 9 of the
card's 20 stay because something does reach them.**
Census: for each of the card's 20 entry points, `git grep -l -F <file
stem>` over the whole tree at `7111e14ac9` (every root, `ui/` included),
with `scripts/check-nul-bytes.mjs` as the positive control (32 files hit
it, among them `package.json` and `lint.yml`). Every hit was read and
classified.
Deleted — each hit was only a `docs/audits` reading, a release-owned
`CHANGELOG.md` entry, a self-test fixture string or a comment:
| Script | What named it |
|---|---|
| `scripts/audits/14096-tenancy-ledger-namespace-regexp-census.mjs` |
its `docs/audits` reading |
| `scripts/audits/14423-c3-c4-keyed-mechanism-probe.mjs` | its
`docs/audits` reading |
| `scripts/audits/14423-databaseloader-cost-probe.mjs` | its
`docs/audits` reading |
| `scripts/audits/14423-filesystemloader-cost-probe.mjs` | its
`docs/audits` reading |
| `scripts/audits/14423-unbound-declarations-before-count.mjs` | its
`docs/audits` reading |
| `scripts/audits/14744-before-update-per-row-value-probe.mjs` | its
`docs/audits` reading |
| `scripts/bench/permission-bench.mts` | 4 `CHANGELOG.md` entries only |
| `scripts/bench/runtime-publish-gate.bench.mts` | a path string in
`dispatch-gates.self-test.mjs` fed to the pure predicate
`isInRootTsProgram` (no disk read) |
| `scripts/measure-markdown-ts-blocks.mjs` | 20 `CHANGELOG.md` entries
only |
| `scripts/measure-reserved-identity-name-census.mjs` | 1 `CHANGELOG.md`
entry only |
| `scripts/pm/measurement-claim-triage.mjs` | one historical census row
in a `dispatch-gates.mjs` docblock |
Every `docs/audits` "re-run" citation and comment that named a deleted
script now names commit `7111e14ac9`, which holds it, with the `git
worktree add --detach` line to re-run it from there (3 audit files and
one `scripts/pm/dispatch-gates.mjs` docblock line). `CHANGELOG.md`
entries are release-owned and stay as they shipped. No `archive/`
folder.
Kept — a real caller exists:
| Script | Caller |
|---|---|
| `scripts/ablation-replace.mjs` | the ablation procedure in
`.claude/agents/os-dev.md` and `packages/qa/dogfood/README.md` tells
agents to run it |
| `scripts/audits/14744-before-update-per-row-value-census.mjs` | a
`COMPOUND_ANCHOR_LEDGER` row in `scripts/pm/dispatch-gates.data.mjs`,
which `check:pm-dispatch-gates` reconciles against the live tree in both
directions (deleting it needs that row and the docblock counts moved — a
ledger edit outside this card's file surface) |
| `scripts/codemod/view-to-viewitem.mjs` | ADR-0017 offers it to teams
as the migration codemod; repointing that needs an ADR edit (Tier H) |
| `scripts/measure-return-propagating-durability-seams.mjs` | AGENTS.md
(durability section) tells authors to read the population from it;
`check-durability-degradation-log-level.mjs` names it as the instrument
|
| `scripts/measure-partial-retirement-annotation.mjs` | the slow tier of
`check:pm-dispatch-gates` (`dispatch-gates.self-test.mjs`, the
`seamCard` block) spawns the CLI against this path; deleting it reds 16
cases there — measured, see Acceptance notes |
| `scripts/measure-self-test-floor.mjs` | AGENTS.md "Writing a
--self-test" names it as the probe |
| `scripts/pm/fleet-git-credential.sh` | `scripts/pm/with-fleet.sh`
executes it and installs it as the git credential helper |
| `scripts/pm/fleet-roster.mjs` | the maintainer-ordered generator of
the pinned fleet roster issue (landed three days before this census);
the roster body's marker names it |
| `scripts/qa/qa-rollup.mjs` | `docs/qa/platform-checklist/RUNNER.md`
tells runners to run it after filing |
**Wanted 3 — `--self-test` for three of the five `check-*` scripts.**
`scripts/check-node-version.mjs`, `scripts/check-release-notes.mjs` and
`scripts/check-service-providers.mjs`:
- each rule moves into a pure function over its inputs
(`auditSetupNodeSteps` + `lifecycleVerdict`, `findProblems`,
`findProblems` + `parseTable`); `main()` keeps the tree read and prints
the same bytes. Proof: old and new copies run side by side on a fixture
tree, green path and every red path (missing page + unlisted page +
unreachable section; provider typo + missing slot; one mismatched step;
EOL, unknown and empty pins) — stdout, stderr and exit identical in all
9 runs;
- each self-test follows AGENTS.md "Writing a --self-test", copied from
`check-agent-model-declared.mjs`: a literal row roster floored per label
(10 / 11 / 14 rows), the roster size pinned, and a
`selfTestReachedVerdict` handshake the dispatch refuses to run without.
Negative controls are rows that must go RED (a missing page, a
non-workspace provider, a mismatched or missing Node pin, an
expression-resolved version, an EOL pin, a parser fed a source with no
table). Problems now carry a `kind` and subject, so the cases assert
what was found, never the message wording;
- the three root aliases CI already calls (`pnpm check:X` in `lint.yml`,
and `check:release-notes` in `release.yml`) now run `--self-test` first
— the house spelling — so `check:self-test-wired` sees each self-test
run.
`scripts/check-changeset-fixed.mjs` and
`scripts/docs-audit/check-drift-comment.mjs` stay without one this
round: both are run by direct `node` lines in workflows (`cut-rc.yml`,
`release.yml`, `validate-deps.yml`; `docs-drift-check.yml`), so a
self-test there is unwired — `check:self-test-wired` reds it, and its
`SELF_TEST_RUN_OTHERWISE` ledger forbids a row for that — until a
workflow step runs it. That wiring lands with Wanted 2, which edits
those workflows anyway.
## Acceptance
- Card loop `for f in scripts/check-*.mjs; do grep -q -- --self-test $f
|| echo $f; done` → `scripts/check-changeset-fixed.mjs` (one line, the
deferred one above; was four).
- Census re-run on the head: the 11 deleted files have 0 callers.
Remaining textual hits are the commit-pinned `docs/audits` citations,
the `isInRootTsProgram` fixture string and the one historical
`dispatch-gates.mjs` docblock row; `CHANGELOG.md` entries excluded.
- `pnpm check:pm-skill-ratchet` → exit 0.
- Derived gate families (`dispatch-gates --commands`): 54 derived at
`2e05d6c9a`, 54 run, every exit 0; `dispatch-gates --ran` → "54 run, 0
NOT-MEASURED". Includes `check:self-test-wired`,
`check:self-test-workflow-commands`, `check:entry-guard`,
`check:watch-hint-literal`, `check:node-version`, `check:release-notes`,
`check:service-providers` and `check:type-check-debt` (root program
still 26 errors, none above its record; the two deleted `.mts` files
carried none).
- `check:pm-dispatch-gates` slow tier (CI runs it on push to main, not
on this PR): `node scripts/pm/check-dispatch-gates.mjs --self-test &&
node scripts/pm/check-dispatch-gates.mjs --slow` at `2e05d6c9a` →
"dispatch-gates self-test: 2182 cases pass", both tiers, exit 0.
## Acceptance notes
- **Changed lines: +838 / −4,370 = 5,208, over the 3,000 human-merge
threshold** (AGENTS.md, Multi-agent discipline §7 (c)) — almost all of
it the deleted files. This PR lands by an authorized approval or a human
merge, not by the queue on green alone.
- The first head deleted
`scripts/measure-partial-retirement-annotation.mjs` too. The slow tier
of `check:pm-dispatch-gates` — which CI runs on push to `main` and on
the schedule, not on a PR — then failed 16 cases, all in its `seamCard`
block (`the seam card still derives at all` first: the CLI answers exit
3, absent path). The script was restored at `2e05d6c9a` and listed as
kept; the slow tier was re-run on that head (see Acceptance).
- Census correction: the card's list read
`measure-markdown-ts-blocks.mjs`,
`measure-reserved-identity-name-census.mjs` and `permission-bench.mts`
as referenced nowhere; all three are named in shipped `CHANGELOG.md`
entries (history, not callers). `fleet-roster.mjs` is named only by a
comment, but it is a live maintainer tool, so it stays.
Generated by Claude Code, session `session_01LbdJFR3AmcKLZKQafYE1tN`, in
a card thread for devx seat 2.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01LbdJFR3AmcKLZKQafYE1tN)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01LbdJFR3AmcKLZKQafYE1tN
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a1477de commit 81bba6c
14 files changed
Lines changed: 836 additions & 1428 deletions
File tree
- docs/audits
- scripts
- audits
- bench
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
289 | 290 | | |
290 | 291 | | |
291 | 292 | | |
| 293 | + | |
| 294 | + | |
292 | 295 | | |
293 | 296 | | |
294 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
| 286 | + | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
0 commit comments