Uh oh!
There was an error while loading. Please reload this page.
docs(tooling): re-anchor invoked-as.mjs's enforcement section to the tree it describes - #6260
Conversation
…tree it describes `scripts/invoked-as.mjs`'s header carried a section asserting that `scripts/check-entry-guard.mjs` "has never existed in this repository", that grepping for it yielded ONE hit, that 29 hand-typed guards remained in nine spellings, and that `isEntrypoint` was an unenforced convention "until #6092 lands". All four are false on `main`, in the same direction: the gate exists, is wired as `check:entry-guard`, runs in `lint.yml` before `pnpm install`, and reports `0 file(s) still hand-type one` on a shrink-only ratchet. The section is written to be read INSTEAD of the tree — the header points at it by name, "before concluding otherwise" — so a reader who followed that instruction was told a gated rule is unenforced and a completed sweep is still outstanding. Rewritten rather than deleted. The pointer names the section, so deleting it would leave that pointer dangling at nothing; and the paragraph's own narrative (prose ported from objectstack that stayed put while this tree moved) is self-referentially the failure this file exists to document. It is kept — as history, under the commit it was measured on. Three sentences carried the same claim and all three move together, or the file contradicts itself: - the header line "THIS repository has not been swept, and no gate here enforces the rule", and its pointer at the old section name; - "`check-skills-paths.mjs` carries the no-realpath spelling, as do 27 of its neighbours", now past tense; - the section itself. Measurements re-taken on 2dc4aa7 rather than edited in place, and that commit is named in the text, so the next drift is detectable rather than invisible. Comment-only: 89 changed lines, every one a block-comment body line; the module's runtime is untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe
yinlianghui-tw
commented
Aug 25, 2026
PM review — ACCEPT, and ⭐ the |
Uh oh!
There was an error while loading. Please reload this page.
…e page keeps denying it The label object was re-minted in this repository (auto-created by being applied by name) and is now being read as a mechanism: a triage comment on #6243 instructed a PR to carry it, the developer refused, and the refusal was upheld on PR #6260. A test cannot see GitHub's label data, so it does not try. It pins the two halves that live in the tree: no read of the name under .github/ or scripts/ (option B landing without a decision), and the page keeping its denial plus the alternative to reach for instead. Also corrects a claim on that page that had become false: it reported a point-in-time labels-API reading from 2026-08-08 saying the label did not exist. It does. A reading nothing in the tree can keep true is replaced by the durable invariant, and the third assertion pins that it is not restored.
Fixes#6243
scripts/invoked-as.mjs's header carried a section —## Nothing here enforces this yet -- the rule is a CONVENTION— whose four assertions were all false onmain, all in the same direction, and which the header explicitly instructs the reader to believe over the tree.Every row of the card's table, re-verified before touching anything
Measured in a clean worktree at
origin/main=2dc4aa709.check-entry-guard.mjs"has never existed in this repository"git cat-file -e origin/main:scripts/check-entry-guard.mjs→ rc 0git grep -n 'check-entry-guard'→ ONE hit, this paragraphpackage.json:59,.github/workflows/lint.yml:201-202, two changesets, three tests, three sibling scripts0 file(s) still hand-type one (0 occurrence(s), ⛔ SHRINK-ONLY);git grep -l 'process.argv\[1\]' -- scripts→ 3 files, none of them a guardisEntrypointhere is a convention"git grep -l 'isEntrypoint' -- scripts→ 40 filesThe gate's own verdict line, run here:
The card quoted 46/0/41 at
0409b766d; the tree has gained one script since, and the middle figure — the one the claim rests on — is 0 in both. Every row reproduces. The premise stands.Disposition: rewrite (option 1), not delete
Three reasons, in the order they decided it:
invoked-as.mjsdocuments — and this section already narrates one earlier round of it. Deleting it deletes the only in-tree record of how that happens, right after it happened again.So the section is kept, retitled
## What enforces this, and what it took to get here, and the measured history is kept as history under the commit it was taken on.Measurements re-taken, not edited in place
The
7c96c9420figures are left where they belong — in the history paragraph, attached to that commit. The present-tense figures are new, taken on2dc4aa709, and the section now names that commit and says why:...and closes with the instruction that would have prevented this round: re-take and re-name, never edit the figures in place under the old commit.
Three sentences, not one — they carry the same claim
Rewriting only the section would have left the file contradicting itself two paragraphs later. All three are the same claim, mechanically pinned by the same gate output, in the same file:
check-skills-paths.mjscarries the no-realpath spelling, as do 27 of its neighbours", now past tense (it routes throughisEntrypoint, as do all 29);Nothing else in the diff. Two objectstack-only paths the header names (
scripts/pm/check-governed-merges.mjs,packages/cli/src/utils/invocation.ts) were re-checked as still absent here and are still labelled as objectstack's where they appear.Sibling check — reported, not edited
The
## The siblingssection says "change one, change the others" and names objectstack'spackages/cli/src/utils/invocation.ts. Checked against objectstackorigin/main=497ded780, read-only, no worktree, no edit:packages/cli/src/utils/invocation.ts— not stale. 186 lines, zero occurrences ofcheck-entry-guard,never existed,CONVENTION,Nothing here enforcesorUntil that lands. It never carried this paragraph.scripts/invoked-as.mjs— not stale either, and it is where the ported prose came from. It carries the correct original: "scripts/check-entry-guard.mjsenforces this: aprocess.argv[1]in an entry-guard position anywhere inscripts/**that is not this module is a failure." True in that tree, and true here now.So nothing is owed in objectstack for this defect. One asymmetry is worth a separate look and is listed as an out-of-scope finding rather than fixed here.
Changeset: none, deliberately
check-changeset-presence.mjsexits 0 either way, so it is not deciding this. Its printed verdict on this diff:Read directly: the diff is 89 changed lines, every one a block-comment body line in a
scripts/tool that no package publishes. There is no behaviour for a release note to describe. Precedent from tonight: #6216 and #6212 are tooling PRs that changed real gate behaviour and carried none; a prose-only change is bounded above by those.Verification
All of the below on the final commit,
ca12cb8b, clean tree. Exit codes captured by redirect before any pipe; each line is the gate's own printed verdict.check:entry-guard✓ check:entry-guard: 47 scripts/ file(s) … 0 file(s) still hand-type one (0 occurrence(s), ⛔ SHRINK-ONLY…)— rc 0check-entry-guard.mjs --self-test✓ check-entry-guard self-test: 63 cases pass— rc 0invoked-as.mjs --self-test✓ invoked-as self-test: 12 cases pass (real symlink, different-name symlink, percent-encoding path, and both import directions).— rc 0check-doc-links.mjsLinks are valid across 15 scan roots.— rc 0check:doc-fences✅ check:doc-fences — every TypeScript block in 223 document(s) …— rc 0check:control-bytes✅ check-control-bytes: OK (scanned 5157 tracked text file(s); skipped 85 binary).— rc 0check:shell-escape-residue✅ check-shell-escape-residue: OK (4/4 root(s) resolved …)— rc 0type-check:scripts> tsc -p tsconfig.scripts.json, so it is not a zero-match no-oplint:rootunnarrowed✖ 28 problems (0 errors, 28 warnings), all pre-existingno-explicit-anywarnings ine2e/,vitest.setup.base.tsand twoscripts/__tests__/vite-*files, none touched herevitest run scripts/Test Files 77 passed (77) · Tests 2194 passed (2194)check-node-esm-load.mjs(builds all 43 packages, rc 0),check-pre-install-import-graph.mjs,check-vi-mock-specifiers.mjs,check-eager-closure-budget.mjsOne declared narrowing. The full root suite (
pnpm test) was started under the shared verify lock and was killed by this container's ~10-minute foreground cap (SIGTERM, exit 143) — it is CI's run. Narrowed tovitest run scripts/, and the narrowing is measured rather than assumed:git diff --name-only= 1 file; 89 changed lines, 0 of them outside a block-comment body (git diff -U0 | grep -cvE '^[+-] \*'→ 0), so the module's runtime is byte-identical in behaviour — confirmed independently by its own self-test;git grep -l 'invoked-as' -- '**/*.test.ts' '**/*.test.tsx' '**/*.test.mts'→ 5 files, all underscripts/__tests__/, i.e. entirely inside the narrowed run. Run explicitly as well: 5 passed, 144 tests;entry-guard-wiring.test.tsasserts the wiring and states in its own header that it deliberately pins no counts or header text; the other four only mention the module's path.No test needed updating.
Generated by Claude Code
Generated by Claude Code