Skip to content

invoked-as.mjs's "Nothing here enforces this yet" section is stale in both halves — the gate landed and the sweep completed, but the header still tells readers neither exists #6243

Description

@yinlianghui-tw

Found while implementing #6230 (unrelated card — the eager-closure budget comment). Filed unassigned, observation class. Nothing is broken at runtime; the defect is that a header written to be the authoritative answer now asserts four things that are false, and explicitly instructs the reader to believe it over the tree.

What the header says

scripts/invoked-as.mjs, section ## Nothing here enforces this yet -- the rule is a CONVENTION:

An earlier version of this paragraph said scripts/check-entry-guard.mjs enforces the rule [...]. It does not. That file has never existed in this repository.

git grep -n 'check-entry-guard' -> ONE hit: this paragraph
git grep -l 'process.argv[1]' -- scripts -> 30 files

The 30 files are this one plus TWENTY-NINE hand-typed guards [...] in NINE textually distinct spellings and not one carrying a realpath leg

Both halves -- the gate and the sweep -- are tracked in #6092. Until that lands, isEntrypoint here is a convention [...] do not read this file as evidence that the tree already has.

Line 17 of the same header points at this section as the thing to read before concluding otherwise:

read "## Nothing here enforces this yet" below before concluding otherwise

What is actually on origin/main

#6092 — the issue the header names as tracking both halves — is closed. Both halves landed:

✓ check:entry-guard: 46 scripts/ file(s) — no entry guard outside the baseline;
0 file(s) still hand-type one (0 occurrence(s), ⛔ SHRINK-ONLY, objectui#6092);
41 export bindings, 41 of them inert on import (0 known-unsafe, ⛔ SHRINK-ONLY).

So all four claims are now wrong, and in the same direction:

Header claimReality on origin/main
the file "has never existed in this repository"it exists and is a wired gate
git grep 'check-entry-guard' → one hit, this paragraphat minimum the script, the package.json script entry, and the gate's own output
29 hand-typed guards remain, in nine spellings0 file(s) still hand-type one, shrink-only ratcheted at 0
"Until that lands, isEntrypoint here is a convention"it lands; the convention is enforced

Why it is worth a card rather than nothing

This is not ordinary comment rot. The header is written as the single authoritative answer to "was this module run, or imported?", and this section exists specifically to stop a reader from over-trusting it — so a reader who follows its instruction is now actively told that a rule with a blocking gate behind it is unenforced, and that a sweep which completed is still outstanding. The cheapest wrong conclusion available is "nothing stops a thirtieth spelling from being typed next week", which is exactly what the shrink-only ratchet now does stop.

It is also self-referentially the failure this file documents: prose ported from objectstack, describing objectstack's tree, that stayed put while this tree changed underneath it — the same mechanism that produced the earlier wrong version of this very paragraph, which the paragraph itself narrates.

Disposition

Not choosing between these; both are cheap:

  1. Rewrite the section to describe the tree as it is — the gate exists, the sweep is done, the ratchet is shrink-only at 0 — and keep the measured history as history rather than as present tense.
  2. Delete the section. Its whole purpose was to prevent readers assuming an enforcement that did not exist; that enforcement now exists, so the warning has nothing left to do.

Either way the measurements should be re-taken rather than edited in place: the 7c96c9420 figures are a snapshot, and re-anchoring them to a current commit is what stops the next round of this.

⚠️ Not verified by me: whether the sibling copies this header binds together (packages/cli/src/utils/invocation.ts in objectstack, per the "## The siblings" section) carry the same stale paragraph. Worth checking in the same pass, since that section says "change one, change the others".

Refs: #5984 (the port that brought the prose) · #6078 · #6092 (closed — the gate and the sweep) · #6156 (last touched the gate).

Generated by Claude Code

Metadata

Metadata

Labels

domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repopm:queue

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions