Context
@neo-opus-grace found this in her review of PR #18906 (2026-09-18). I measured it the same day and sent a defect-note. The engine's buildScripts guards run their CLI block only when process.argv[1] names the module itself. Node resolves symlinks in the entry module's import.meta.url, but not in process.argv[1]. So a guard run through a symlinked path skips its CLI block and exits 0: a checkout under macOS /tmp or /var, or any absolute path through a link.
The Problem
Measured at dev@02e48cf441, running each guard once through its real path and once through a symlink to the same checkout. A guard whose CLI block ran prints a report; one whose block never ran prints nothing and exits 0.
| guard |
entry check |
output, real path |
output, symlinked path |
check-fixed-sleeps |
path.resolve(process.argv[1]) === fileURLToPath(import.meta.url) |
306 bytes |
0 |
check-file-sizes |
path.resolve(process.argv[1]) === __filename |
423 bytes |
0 |
check-guard-ci-parity |
path.resolve(process.argv[1]) === __filename |
74 bytes |
0 |
check-jsdoc-types |
path.resolve(process.argv[1]) === __filename |
126 bytes |
0 |
check-engine-brain-boundary |
import.meta.url === `file://${process.argv[1]}` |
183 bytes |
0 |
That is a false green from the very command a person or agent runs to check their own change. lint-staged and CI invoke the guards by relative path, so the hook and CI are not affected.
check-class-module-scope.mjs:248-253 tells readers the path.resolve form is the fix for symlinks. It is not. Its own spec, the CLI entry predicate survives a checkout path containing a space, realpaths the tmpdir precisely because "BOTH predicates" fail through /tmp.
The Architectural Reality
- Every entry check lives in its guard, in about ten spellings. 32 files outside specs in
buildScripts/ and test/playwright/ gate a CLI block on process.argv[1].
- The
endsWith('<name>.mjs') spelling (check-spec-retirement, e2eCiSelection, flickerCensus) survives a symlink, but it matches any file of that name.
- The fix is already written elsewhere. The published guards in neo-agent-skills (
check-npm-overrides, check-substrate-size, check-ticket-archaeology, check-secrets) compare realpathSync() on both sides. They are tested through the installed bin symlink and under --preserve-symlinks-main.
The Fix
buildScripts/util/isEntryModule.mjs: isEntryModule(import.meta.url). It realpaths both sides, and returns false when process.argv[1] is missing or unreadable.
- Every entry check in
buildScripts/ and test/playwright/ calls it, so git grep 'process.argv\[1\]' finds only the helper and the specs that probe it.
check-class-module-scope's comment and its entry-predicate arms follow.
Acceptance Criteria
Out of Scope
buildScripts/util/check-secrets.mjs, which retires in #18929.
.claude/hooks/rgReplaceGuardHook.mjs: harness substrate that the harness invokes by its real path.
Related
#18906 (where it was found) · #18929 · neomjs/neo-agent-skills#91 (the published pattern)
Live latest-open sweep: latest 20 open issues at 2026-09-18T16:55Z, plus an all-state search for symlink / argv realpath: no equivalent. The nearest closed is #17783 (guards with no caller). A2A sweep: only my own defect-note, 2026-09-18T15:57Z. Own open assignments: #18929 (the one guard excluded above).
Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59
Retrieval Hint: "guard symlinked path exits 0 process.argv realpath isEntryModule"
Context
@neo-opus-grace found this in her review of PR #18906 (2026-09-18). I measured it the same day and sent a defect-note. The engine's
buildScriptsguards run their CLI block only whenprocess.argv[1]names the module itself. Node resolves symlinks in the entry module'simport.meta.url, but not inprocess.argv[1]. So a guard run through a symlinked path skips its CLI block and exits 0: a checkout under macOS/tmpor/var, or any absolute path through a link.The Problem
Measured at
dev@02e48cf441, running each guard once through its real path and once through a symlink to the same checkout. A guard whose CLI block ran prints a report; one whose block never ran prints nothing and exits 0.check-fixed-sleepspath.resolve(process.argv[1]) === fileURLToPath(import.meta.url)check-file-sizespath.resolve(process.argv[1]) === __filenamecheck-guard-ci-paritypath.resolve(process.argv[1]) === __filenamecheck-jsdoc-typespath.resolve(process.argv[1]) === __filenamecheck-engine-brain-boundaryimport.meta.url === `file://${process.argv[1]}`That is a false green from the very command a person or agent runs to check their own change.
lint-stagedand CI invoke the guards by relative path, so the hook and CI are not affected.check-class-module-scope.mjs:248-253tells readers thepath.resolveform is the fix for symlinks. It is not. Its own spec,the CLI entry predicate survives a checkout path containing a space, realpaths the tmpdir precisely because "BOTH predicates" fail through/tmp.The Architectural Reality
buildScripts/andtest/playwright/gate a CLI block onprocess.argv[1].endsWith('<name>.mjs')spelling (check-spec-retirement,e2eCiSelection,flickerCensus) survives a symlink, but it matches any file of that name.check-npm-overrides,check-substrate-size,check-ticket-archaeology,check-secrets) comparerealpathSync()on both sides. They are tested through the installedbinsymlink and under--preserve-symlinks-main.The Fix
buildScripts/util/isEntryModule.mjs:isEntryModule(import.meta.url). It realpaths both sides, and returns false whenprocess.argv[1]is missing or unreadable.buildScripts/andtest/playwright/calls it, sogit grep 'process.argv\[1\]'finds only the helper and the specs that probe it.check-class-module-scope's comment and its entry-predicate arms follow.Acceptance Criteria
--preserve-symlinks-main, a probe's block runs. Imported by another module, and with noprocess.argv[1], it does not.dev, where it prints nothing.git grep -n 'process.argv\[1\]' -- buildScripts test/playwrightfinds only the helper and specs.Out of Scope
buildScripts/util/check-secrets.mjs, which retires in #18929..claude/hooks/rgReplaceGuardHook.mjs: harness substrate that the harness invokes by its real path.Related
#18906 (where it was found) · #18929 · neomjs/neo-agent-skills#91 (the published pattern)
Live latest-open sweep: latest 20 open issues at 2026-09-18T16:55Z, plus an all-state search for symlink / argv realpath: no equivalent. The nearest closed is #17783 (guards with no caller). A2A sweep: only my own defect-note, 2026-09-18T15:57Z. Own open assignments: #18929 (the one guard excluded above).
Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59
Retrieval Hint: "guard symlinked path exits 0 process.argv realpath isEntryModule"