What is wrong
website/scripts/check-*.mjs are Node ESM scripts, but they are runnable-looking as
bash scripts/check-content-completeness.mjs - and that form fails in a way that reads as success
in the most common usage.
$ bash website/scripts/check-content-completeness.mjs
website/scripts/check-content-completeness.mjs: line 2: //: is a directory
website/scripts/check-content-completeness.mjs: line 3: //: is a directory
$ echo $?
2
The script itself fails loudly. The trap is the pipeline: bash script.mjs | grep … reports
grep's status (1 for "no matches"), so a caller checking the exit code of the pipeline sees "no
issues found" - a green that never ran the check. Three agents hit exactly this in one session and
two of them reported the completeness gate as green before realising.
Evidence
bash website/scripts/check-content-completeness.mjs → exit 2, //: is a directory
node website/scripts/check-content-completeness.mjs → exit 0, [content] total 176 files scanned, 0 issues
- the same shape applies to
check-translation-drift.mjs and check-dead-links.mjs
Fix options
- Add a
#!/usr/bin/env node-aware guard is not possible in bash - the practical fixes are:
- a one-line note next to each documented invocation (docs/ and AGENTS.md) that the runner is
node, and
- make the scripts refuse to be interpreted by anything but Node is not feasible; instead, prefer
wiring the common ones into npm scripts (npm run check:content), so the invocation people copy
is already correct.
Option 3 removes the failure mode instead of warning about it.
Revisit trigger
Act if a review or CI summary reports one of these checks green while the underlying command was
bash. The two are indistinguishable in every summary format we use today.
What is wrong
website/scripts/check-*.mjsare Node ESM scripts, but they are runnable-looking asbash scripts/check-content-completeness.mjs- and that form fails in a way that reads as successin the most common usage.
The script itself fails loudly. The trap is the pipeline:
bash script.mjs | grep …reportsgrep's status (1 for "no matches"), so a caller checking the exit code of the pipeline sees "no
issues found" - a green that never ran the check. Three agents hit exactly this in one session and
two of them reported the completeness gate as green before realising.
Evidence
bash website/scripts/check-content-completeness.mjs→ exit 2,//: is a directorynode website/scripts/check-content-completeness.mjs→ exit 0,[content] total 176 files scanned, 0 issuescheck-translation-drift.mjsandcheck-dead-links.mjsFix options
#!/usr/bin/env node-aware guard is not possible in bash - the practical fixes are:node, andwiring the common ones into npm scripts (
npm run check:content), so the invocation people copyis already correct.
Option 3 removes the failure mode instead of warning about it.
Revisit trigger
Act if a review or CI summary reports one of these checks green while the underlying command was
bash. The two are indistinguishable in every summary format we use today.