You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: the wiring permission assertions must read executable lines only
Found by this gate's own ablation sweep. Revoking `contents: read` from
the guard workflow -- which would kill the job in its checkout step,
before the gate judges anything -- left the self-test GREEN, because the
comment explaining why that scope is needed contains those same two
words and the assertion scanned the whole file.
A phantom check: green because of the prose describing the thing it was
meant to verify. Both permission assertions now scan the comment-stripped
workflow, as the package-manager assertion beside them already did, and
the ablation reddens with the string still present in the file.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqDQYVU5smx29ts9pAErja
t(`the wiring subscribes to '${activity}' (a collision only exists while both PRs are open)`,newRegExp(`types:\\s*\\[[^\\]]*\\b${activity}\\b[^\\]]*\\]`).test(wiring),true);
510
511
}
511
-
t('the wiring can read pull requests',/pull-requests:\s*read/.test(wiring),true);
512
+
// Both permission assertions read the COMMENT-STRIPPED workflow, and that
513
+
// is not tidiness — it is a hole this file's own ablation sweep found. The
514
+
// header comment above the permissions block has to be able to say the
515
+
// words contents read to explain why the scope is there, and a naive scan
516
+
// of the whole file therefore passed with the real grant DELETED: a phantom
517
+
// check, green because of the prose describing it. Only executable lines
518
+
// are scanned.
519
+
t('the wiring can read pull requests',/pull-requests:\s*read/.test(wiringLines),true);
512
520
// Naming a permissions block sets every unlisted scope to none, and this
513
521
// job checks the repo out to reach this script. Without the contents scope
514
522
// it dies in checkout, before judging anything.
515
-
t('the wiring can read contents, which its checkout step requires',/contents:\s*read/.test(wiring),true);
516
-
t('the guard job invokes no package manager (it needs node and nothing else)',/\b(pnpm|corepack|yarn|npm)\b/.test(wiring.split('\n').filter((l)=>!/^\s*#/.test(l)).join('\n')),false);
523
+
t('the wiring can read contents, which its checkout step requires',/contents:\s*read/.test(wiringLines),true);
524
+
t('the guard job invokes no package manager (it needs node and nothing else)',/\b(pnpm|corepack|yarn|npm)\b/.test(wiringLines),false);
517
525
518
526
// --- The older gate must still be there, unweakened. This gate ADDS a
519
527
// second question; it does not replace the card-keyed one.
0 commit comments