Context
Successor of #18832, which PR #18906 resolved. @neo-opus-grace found this in her review of #18906 (review 5249734191). Measured at dev@3bd9c46e8f.
The Problem
check-secrets lets a line keep a credential-shaped literal if the line carries secret-scan-ok: <reason>. A marker without a reason is reported as allow-marker-without-reason (#18832, AC-5). The guard takes everything after the marker, up to the end of the line, as the reason. So a comment's own closing token counts as one.
findSecrets on a synthetic key-shaped line:
| Marker on the key's line |
Result |
// secret-scan-ok: |
allow-marker-without-reason |
<!-- secret-scan-ok: --> |
nothing: the key is excused |
/* secret-scan-ok: */ |
nothing |
{/* secret-scan-ok: */} |
nothing |
<!-- secret-scan-ok: a revoked sample --> |
nothing (correct) |
The incident behind #18832 was in a Markdown file. There, an HTML comment is exactly the form a marker takes.
The Architectural Reality
buildScripts/util/check-secrets.mjs: allowRE = /secret-scan-ok:\s*(\S.*)?$/. findSecrets accepts any captured text as a reason.
- The marker is read on every line, before the patterns and independently of them. The guard's own
export const ALLOW_MARKER = 'secret-scan-ok:'; line carries it, followed by ';. A rule that only demands a letter would therefore report that line (Grace's second point).
- No other tracked file uses the marker (
git grep, outside the guard and its spec).
The Fix
- A reason is text with at least one letter or digit. Closers and punctuation (
-->, */, */}, ';) are not a reason.
- Read the marker only on a line that carries a credential-shaped match. There, a marker with a reason excuses the line, and one without a reason is
allow-marker-without-reason. On any other line a marker excuses nothing, so there is nothing to report. That also leaves the definition line alone.
- Spec additions:
- one row per closer: a finding;
- a closed comment with a reason: excused;
- a reasonless marker on a credential-free line: no finding.
Acceptance Criteria
Out of Scope
- A guard run through a symlinked path exits 0.
node <symlinked checkout>/buildScripts/util/check-secrets.mjs <file with a key> exits 0 silently, while the same file through the real path exits 1 (measured). The CLI block compares process.argv[1] with fileURLToPath(import.meta.url) without resolving symlinks, and sibling guards use equivalent comparisons. lint-staged and CI invoke the guard by a relative path. This is captured as a defect-note, and gets its own ticket if promoted.
- Whether a one-word reason is an honest one. A reviewer reads the reason in the diff, as #18832 designed.
Related
#18832 · PR #18906
Live latest-open sweep: latest 20 open issues at 2026-09-18T15:57Z, plus an all-state search for secret-scan-ok / check-secrets / "allow marker": no equivalent. A2A sweep (latest 15, all read-states): no claim on this scope. Memory Core: no prior decision. Own open assignments: none on this guard.
Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59
Retrieval Hint: "secret-scan-ok marker comment closer reason check-secrets"
Context
Successor of #18832, which PR #18906 resolved. @neo-opus-grace found this in her review of #18906 (review 5249734191). Measured at
dev@3bd9c46e8f.The Problem
check-secretslets a line keep a credential-shaped literal if the line carriessecret-scan-ok: <reason>. A marker without a reason is reported asallow-marker-without-reason(#18832, AC-5). The guard takes everything after the marker, up to the end of the line, as the reason. So a comment's own closing token counts as one.findSecretson a synthetic key-shaped line:// secret-scan-ok:allow-marker-without-reason<!-- secret-scan-ok: -->/* secret-scan-ok: */{/* secret-scan-ok: */}<!-- secret-scan-ok: a revoked sample -->The incident behind #18832 was in a Markdown file. There, an HTML comment is exactly the form a marker takes.
The Architectural Reality
buildScripts/util/check-secrets.mjs:allowRE = /secret-scan-ok:\s*(\S.*)?$/.findSecretsaccepts any captured text as a reason.export const ALLOW_MARKER = 'secret-scan-ok:';line carries it, followed by';. A rule that only demands a letter would therefore report that line (Grace's second point).git grep, outside the guard and its spec).The Fix
-->,*/,*/},';) are not a reason.allow-marker-without-reason. On any other line a marker excuses nothing, so there is nothing to report. That also leaves the definition line alone.Acceptance Criteria
<!-- secret-scan-ok: -->,/* secret-scan-ok: */and{/* secret-scan-ok: */}on a key's line each reportallow-marker-without-reason. Each arm is red ondev.// secret-scan-ok:still reports.--allover the tracked tree stays clean, the guard's own source included.Out of Scope
node <symlinked checkout>/buildScripts/util/check-secrets.mjs <file with a key>exits 0 silently, while the same file through the real path exits 1 (measured). The CLI block comparesprocess.argv[1]withfileURLToPath(import.meta.url)without resolving symlinks, and sibling guards use equivalent comparisons.lint-stagedand CI invoke the guard by a relative path. This is captured as a defect-note, and gets its own ticket if promoted.Related
#18832 · PR #18906
Live latest-open sweep: latest 20 open issues at 2026-09-18T15:57Z, plus an all-state search for
secret-scan-ok/check-secrets/ "allow marker": no equivalent. A2A sweep (latest 15, all read-states): no claim on this scope. Memory Core: no prior decision. Own open assignments: none on this guard.Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59
Retrieval Hint: "secret-scan-ok marker comment closer reason check-secrets"