Repository navigation
fix(security): scan runner finishes every repository; method docs current - #62
Merged
Merged
Conversation
The published package could not run its Semgrep stage, because Node refuses to strip types under node_modules; the stage now ships as compiled dist/semgrep.js. One failing repository stopped the whole multi-repository run; scan now records the failure, scans the rest and exits 1 at the end. The Semgrep fallback also covers JavaScript files the parser rejects, keeps top-level await, and records a single rule's matching error on one file as a coverage gap. Third-party HTML fixtures are excluded so they no longer time the scan out. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The method, runbook and lessons now name every WireCatLabs repository, the critical-only release gate, zizmor as a report, CodeQL through release-checks with default setup off, the organisation configuration for new repositories, gitleaks from each repository root, and the current command names. CLAUDE.md points at the security policy and states that full tests run on each merge to main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…setup off Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
leemour
force-pushed
the
fix/security-docs-scan-runner
branch
from
October 14, 2026 22:17
5b4073a to
8701ace
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
Bring the security method, runbook and lessons up to the current facts, and make the security scan runner finish a multi-repository run and work from the published package.
Why
METHOD.mdandRUNBOOK.mddescribed an older setup: five repositories under pre-rename names, ahighaudit gate, zizmor as a gate, CodeQL through GitHub default setup, commands that no longer exist (max agent config,pino,diagnose). Runbook step 1 would have turned CodeQL default setup back on, which conflicts with the workflow CodeQL inrelease-checks.yml.scripts/security/scanstopped at the first repository whose scanner failed, so one repository could hide every repository after it..ts/.tsxparse failures.node_modules.What
Runner (
fix(security)):semgrep.tsmoves tosrc/semgrep.tsand ships compiled asdist/semgrep.js.scanruns the source in a checkout and the compiled file from an install.filesno longer lists the.ts.scanrecords a failing tool per repository, scans the remaining repositories, writesSCOPE.md, then exits 1 and names the failed ones on stderr. A failinggh apiread no longer aborts the run either..js,.jsx,.mjs,.cjs,.mtsand.ctstoo, keeps top-level await (--supported:top-level-await=true), and refuses two sources that would compile to the same file.Internal matching error, levelwarn) is recorded ascoverageGapsinsemgrep.jsonand as a gap line inSCOPE.md. This is a judgement call: such an error otherwise fails the repository on every run. Every other scanner error still fails closed: non-zero exit, invalid JSON, timeouts, errors at levelerror, unknown types, and compile or parse failures in the fallback..semgrepignoreexcludesperformance/**/fixtures/. The file replaces Semgrep's built-in list, so it repeats that list (taken from 1.178.0).scanwrites a repository's.semgrepignorepatterns intoSCOPE.md.Documents (
docs(security)):METHOD.md: every WireCatLabs repository, with cli-private through gitleaks only. Steps usecli-testing security scan|socket, plus a gitleaks step run from each repository root. Release gates:pnpm audit --prod --audit-level critical, CodeQL ≥ 9.0, full-history gitleaks, and zizmor as a report (--no-exit-codes). CodeQL runs inrelease-checks.ymlwith default setup off. The settings read-back now expectsnot-configured, plus private reporting, the attached configuration, thenpmenvironment and rulesets. It also shows how to verify that the organisation configurationWireCat publicis the default for new repositories and keeps default setupdisabled. Checklist names are current (max config set permissions,max mcp --permission,max/tg doctor report create, cli-basesrc/logging.ts, the postinstall scripts and Windows installers, and parser dependencies by repository).RUNBOOK.md: removes the default-setup step. Adds private reporting, thenpmenvironment only where a repository publishes, the full repository list through the runner, and gitleaks per repository root.LESSONS.md: CodeQL 2.27 SARIF keeps rules intool.extensions[].rules, so a gate must resolverule.toolComponent.index. A new repository does not inherit settings applied repository by repository. gitleaks reads.gitleaksignorefrom the current folder. A.semgrepignorereplaces the built-in list. Default setup refuses workflow SARIF uploads.CLAUDE.md: points at the security policy, names cli-core, and says this repository's tests run once on each merge tomain(rule 4 and the check budget). The PR template andMONTHLY.mdname cli-core.Merge order
main.yml; until then, theCLAUDE.mdsentence about tests on merge is not yet true.release-checks.ymlCodeQL rule-resolution fix is released, sinceMETHOD.mddescribes that gate as blocking.Testing
pnpm typecheckexit 0;biome check src scriptsexit 0;pnpm docs:checkexit 0.pnpm test:coverage: all tests pass, thresholds met.src/semgrep.test.tscases cover the.mjsfallback mapped back to source, refusal of colliding outputs, a recorded coverage gap, and fail-closed on timeout, error-level matching errors, non-JS syntax errors and a scanner exit 2.scripts/security-scan.test.tsrunsscanwith stub tools against two local repositories. The first fails; the second is still scanned; the exit is 1; andSCOPE.mdcarries the exit codes, gap and ignore lines.pnpm pack, unpacked undernode_modules/@wirecat/cli-testing/, thenscripts/security/scanwith stub tools: exit 0,semgrep.jsonwritten..semgrepignore: the scanned set differs only byperformance/documents/html-readers/fixtures/.🤖 Generated with Claude Code