Repository navigation
Description
Blocked by: #8811 (same lib/publish-gate.mjs functions: land #8811 first, or ship both in one PR).
Problem
lib/publish-gate.mjs checks each line on its own: firstHit splits the text on /\r?\n/ (lib/publish-gate.mjs:68-71). A credential split across two lines, with a line break inside the value, matches no pattern. The gate misses it, and so does fix-ci's leak-scan, which reads the same pattern list.
(Lines moved: normalize is now at :66-73 and firstHit at :75. The leak-scan loads lib/publish-gate.mjs from the default branch, .github/workflows/pr-run-activity-read.yml:1865, so a lib/ change covers it with no .github change.)
Proposal
Also scan a copy of the normalized text with each line break between two adjacent lines folded out, so a credential broken by one newline still matches. Apply only single-token secret patterns to the folded copy. The hex-pair alternatives of the R2 key pair pattern (lib/publish-gate.mjs:42, \b[0-9a-f]{32}\b.*\b[0-9a-f]{64}\b and its reverse) stay on per-line scanning: on a folded copy they would pair an md5 on one line with a sha256 on the next. That means splitting the R2 key pair regex so its keyed access_key_id/secret_access_key alternative can still run on the folded copy. Leave MACHINE_PATTERNS unfolded. Measure false positives against the tracked tree and the test fixtures before blocking on that copy.
Context
A known residual for the fix-ci leak-scan, accepted at review because it is a gap shared with the gate. To be weighed in the #8282 review.
Done when
-
lib/publish-gate.mjsalso scans the normalized text with line breaks folded out. Check: the PR's CI runslib/publish-gate.test.shand it passes. -
lib/publish-gate.test.mjshas a case with a line break inside a credential that is detected, and fails before the change. Check: as above. - A control case of a 32-hex value on one line and a 64-hex value on the next raises no hit. Check: as above.
- A control case of plain prose with line breaks and a home path split across lines raises no false hit. Check: as above.
- False positives are measured before blocking, as a committed test: every file in
git ls-filesoutside the test-fixture paths thatfindSecretandfindMachinepass today still passes with the folded copy. A pattern list whose folded copy adds a hit there is left on per-line scanning, with the reason in the PR body. Check: the PR's CI runslib/publish-gate.test.shand it passes. -
scripts/sync-shared-copies.shregeneratesplugins/review/lib/publish-gate.mjsandplugins/visualization/lib/publish-gate.mjs(scripts/shared-copies.txt:455-456), with fragments fromscripts/new-changelog-fragment.sh --carriers-of lib/publish-gate.mjs patch. Check: the PR's CI runs the shared-copy sync check andscripts/check-changelog-fragments.sh --check, and both pass.
Activity
github-actions commentedon Oct 21, 2026
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Small
Complexity: Medium
Uncertainty: Known
Flags: none
Blocked by: #8811
#8806 (comment)
That decision settles the open questions. I understand the request as follows:
lib/publish-gate.mjsshould also scan text with the line break folded out, and leave out the OpenAI key and R2 key pair patterns. It needs the listed control cases, a committed false-positive measurement, and regenerated shared copies. It should land after #8811 or in the same PR. I found no duplicates.Automated triage, applied by the lanes App.
kyle-sexton commentedon Oct 31, 2026
Decision recorded.
The gap is still on origin/main in the publish gate:
publishGateandhostedGatereadfindSecret(lib/publish-gate.mjs:236,243), andfirstHitscans line by line (:75-82), so a credential broken by a line break passes the gate. The body's "and so does fix-ci's leak-scan" no longer holds:scanLeak(:192-199) runsdeeperLeak, whosestraddles(:151-160) joins adjacent lines for every blocking pattern but two. That gate decides what a view may publish (lib/publish-gate.mjs:2-6), so this is a secret-leak gap, not hardening deferred under §10. It lands after #8811 or in the same PR. Agents decided this on evidence under standing direction §1.Done when
lib/publish-gate.mjsalso scans the normalized text with the line break between adjacent lines folded out, leaving out the OpenAI key and R2 key pair patterns asstraddlesdoes (lib/publish-gate.mjs:145-147,154). Check: the PR's CI runslib/publish-gate.test.shand it passes.lib/publish-gate.test.mjshas a case with a line break inside a credential that is detected, and fails before the change. Check: as above.sk-word ending one line and a word starting the next raises no hit. Check: as above.git ls-filesoutside the test-fixture paths thatfindSecretandfindMachinepass today still passes with the folded copy. A pattern list whose folded copy adds a hit there is left on per-line scanning, with the reason in the PR body. Check: as above.scripts/sync-shared-copies.shregeneratesplugins/review/lib/publish-gate.mjsandplugins/visualization/lib/publish-gate.mjs, with fragments fromscripts/new-changelog-fragment.sh --carriers-of lib/publish-gate.mjs patch. Check: the PR's CI runs the shared-copy sync check andscripts/check-changelog-fragments.sh --check, and both pass.melodic-automation-lanes commentedon Oct 31, 2026
Not admitted to the issue lane yet: blocker #8811 is not closed by a listed human or a merge.
github-actions commentedon Oct 31, 2026
github-actions commentedon Oct 31, 2026