Skip to content

test(batches): rename the two seeded-batch labels that gitleaks reported as secrets - #13729

Merged
diegosouzapw merged 5 commits into
release/v3.8.51from
fix/gitleaks-allowlist-wvxc-labels
Sep 15, 2026
Merged

diegosouzapw merged 5 commits into
release/v3.8.51from
fix/gitleaks-allowlist-wvxc-labels

Conversation

@diegosouzapw

@diegosouzapw diegosouzapw commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Every /omni-code-sec run on a branch touching tests/unit/batches-delete-completed-route-scope.test.ts re-raised two formal blockers from its git-mode gitleaks scan (generic-api-key on the literals "wvxc-route-401" / "wvxc-route-500", LEDGER-2/3 of the 2026-09-14 proof run). They are the label argument of seedCompletedBatch() (the seeded batch's file name), not credentials; the rule fires because the preceding key?.id argument supplies its key keyword and the literal is ≥ 10 chars.

What (after the /omni-code-review battery on this branch — 15 lenses, run 2026-09-15_fix-gitleaks-allowlist-wvxc-labels_vs_release-v3.8.51)

The first version of this PR allowlisted the labels in .gitleaks.toml. The battery found (LEDGER-1, 16 lenses) that the justification comment was factually wrong and (LEDGER-2, 12 lenses) that the repo's allowlist policy requires fixing the cause when it fits in the same PR. Approved plan at P3: rename the labels, no allowlist.

  • tests/unit/batches-delete-completed-route-scope.test.ts: the two seeded-batch labels become route401 / route500 (3 lines) and a docblock above seedCompletedBatch() records the measured rule (10+ chars and Shannon entropy ≥ 3.5 right after a key*.id argument). Test-only change; no production code.
  • .gitleaks.toml: untouched vs the base tip (the allowlist entry from the first revision is gone).
  • changelog.d/maintenance/13729-rename-wvxc-route-test-labels.md: accurate fragment.

Review rounds (/omni-code-review, run 2026-09-15_fix-gitleaks-allowlist-wvxc-labels_vs_release-v3.8.51)

round scope agents findings → ledger outcome
1 first revision (allowlist) 15 (full roster) 43 → 5 LEDGER-2 FIX (rename, no allowlist), LEDGER-4 FIX (fragment); 1/3/5 superseded
2 fix diff, 14 lines 12 (scoped) 17 → 4 LEDGER-6/8 callsite comment, LEDGER-7/9 fragment wording — all FIX
3 fix diff, 6 lines 10 (scoped) 11 → 3 comment stated "10+ chars trips the rule"; the rule also needs entropy ≥ 3.5 — restated once in a docblock above seedCompletedBatch (LEDGER-6/8/10 FIX)

Round cap (3) reached: the round-3 fix (docblock wording) is verified by gitleaks / prettier / eslint / the suite, not by a 4th battery round.

Validation (Hard Rule #18 — RED → GREEN with the tool that reported the defect)

check result
gitleaks 8.30.1 detect --no-git --config .gitleaks.toml --source <test file> before the rename 2 findings
same, after the rename 0 findings
gitleaks git --log-opts="origin/release/v3.8.51..HEAD" (what the security battery runs) 0 leaks
node --import tsx/esm --test tests/unit/batches-delete-completed-route-scope.test.ts 11/11 pass
node scripts/check/check-secrets.mjs secretFindings=1 — unchanged vs the base tip (the CI ratchet scans src/open-sse/bin/electron/scripts, never tests/; the one hit is the pre-existing sk-internal-test-key-12745 label in src/lib/memory/__tests__, out of scope)

⚠️ base-red inherited: #12732 — API Route Typecheck (modelTestRunner.ts TS2741, fix in #13730), env/docs contract, agent-skills-sync dry-run; all reproduce on the base tip c0f92ec9 (see the triage comment below).

Refs #13377 (hygiene bundle), #13684.

The API-key names "wvxc-route-401"/"wvxc-route-500" in
tests/unit/batches-delete-completed-route-scope.test.ts are literal test
labels, not credentials; gitleaks generic-api-key flags them because they
sit on a createApiKey() call. Every /omni-code-sec run on a branch that
touches that file re-raised them as two formal blockers (LEDGER-2/3 of the
2026-09-14 proof run). Allowlisted by regex with the mandatory justification
comment; review at v3.9.0 like the other entries.

Verified: gitleaks 8.30.1 detect --no-git on the test file → 0 findings;
scripts/check/check-secrets.mjs → secretFindings=1 (unchanged vs the base
tip: the remaining hit is the pre-existing sk-internal-test-key-12745 label
in src/lib/memory/__tests__, out of scope here).
@diegosouzapw

Copy link
Copy Markdown
Collaborator Author

CI triage (2026-09-15): the three red checks are all base-reds inherited from release/v3.8.51 (#12732), none is caused by this diff (.gitleaks.toml + a changelog fragment):

check failing step / line inherited from
API Route Typecheck src/lib/api/modelTestRunner.ts TS2741 (baseline 0, live 1) #12732 · fix in flight: #13730
Docs Gates (fast-path) ✗ In code but missing from .env.example: 5 / ✗ In ENVIRONMENT.md but missing from .env.example: 6 #12732 "Docs sync + fabricated-docs (strict)"
Merge integrity (changelog + generated skills) step "Agent-skills generator sync": (dry-run) No files written. Use --apply to write SKILL.md files. (exit 2) #12732 "ci.yml:lint → npm run check:agent-skills-sync"

Green here: Unit Tests ×4, Vitest, Fast Quality, semgrep, Docs Gates, Merge integrity (changelog half), No new.

…tleaks allowlist

Resolves LEDGER-2 and LEDGER-4 of the omni-code-review battery on this
branch (run 2026-09-15_fix-gitleaks-allowlist-wvxc-labels_vs_release-v3.8.51).

The labels "wvxc-route-401"/"wvxc-route-500" are the label argument of
seedCompletedBatch() (batch file name), not API-key names; gitleaks
generic-api-key flagged them because the preceding key?.id argument supplies
the 'key' keyword and the literal is >= 10 chars. Renaming them to route401 /
route500 (8 chars, under the rule's floor) removes the finding at the root,
so the allowlist entry and its inaccurate justification are dropped and
.gitleaks.toml is back to the base tip.

RED → GREEN (gitleaks 8.30.1 detect --no-git on the test file, base config):
2 findings before the rename, 0 after. The suite itself still passes.
@diegosouzapw diegosouzapw changed the title chore(security): allowlist the wvxc-route test labels in gitleaks test(batches): rename the wvxc-route seeded-batch labels so git-mode gitleaks stops flagging them Sep 15, 2026
…hten the fragment

Round 2 of the omni-code-review battery (LEDGER-6..9): the constraint that
route401/route500 must stay under the gitleaks generic-api-key length floor
lived only in the commit message once the allowlist comment was dropped —
now stated at both callsites; the changelog fragment names the exact trigger
(a scan that reads those lines) instead of 'a branch touching that file'.
…seedCompletedBatch

Round 3 of the omni-code-review battery (LEDGER-6/8/10): the callsite comment
claimed that any 10+ char literal after key*.id trips generic-api-key, but the
rule also needs Shannon entropy >= 3.5 — eleven long word-shaped siblings in
this file are clean. The rule is now stated once in a docblock above the
helper (length floor + entropy floor + the key keyword) and both callsites
point at it instead of restating it positionally.
@diegosouzapw diegosouzapw changed the title test(batches): rename the wvxc-route seeded-batch labels so git-mode gitleaks stops flagging them test(batches): rename the two seeded-batch labels that gitleaks reported as secrets Sep 15, 2026
@diegosouzapw

Copy link
Copy Markdown
Collaborator Author

Base-red discriminator for head bcc2365 (merge-gates §3 — every red reproduced on the base tip 3266d16, origin/release/v3.8.51 at 13:20 UTC, in a throwaway worktree with the same node_modules):

red check failing item on base tip verdict
Unit Tests fast-path (1/4…4/4) tests/unit/cli-i18n-catalog.test.ts › en.json contém todas as chaves usadas via t() ✖ identical inherited
Unit Tests fast-path tests/unit/dashboard-request-failed-redaction.test.ts › persistAttemptLogs redacts request.failed… ✖ identical inherited
Unit Tests fast-path tests/unit/attempt-logging-early-keepalive-merge.test.ts (3 cases) ✖ identical (3/3) inherited
Fast Quality Gates → check:mutation-test-coverage --strict tests/unit/noauth-model-lockout.test.ts missing from stryker.conf.json (2 modules) ✗ same file, base has 3 inherited
Fast Quality Gates → check:secrets --ratchet secretFindings=1 > baseline 0 (sk-internal-test-key-12745 in src/lib/memory/__tests__) ✗ identical inherited

None of the five touches the two files of this PR (a test-label rename + a changelog fragment). The three reds of the previous head (API Route Typecheck / Docs Gates / Merge integrity) went green once #13730, #13635 and #13678 landed on the release. Green on this head: API Route Typecheck, CodeQL ×4, Docs Gates, Merge integrity, No new ESLint warnings, Vitest, semgrep ×2, Change Classification.

Merging with --admin over the inherited reds only (merge-gates §4), as validated by the owner at P4.

@diegosouzapw
diegosouzapw merged commit 831b485 into release/v3.8.51 Sep 15, 2026
16 of 21 checks passed
@diegosouzapw
diegosouzapw deleted the fix/gitleaks-allowlist-wvxc-labels branch September 15, 2026 15:43
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…ted as secrets (cheaper-inference#13729)

The labels wvxc-route-401/wvxc-route-500 sat right after a key*.id argument and cleared the gitleaks generic-api-key length and entropy floors; renamed to route401/route500 with a docblock stating the measured rule. Test-only; .gitleaks.toml untouched. Reviewed by 3 rounds of /omni-code-review (37 agents).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant