Repository navigation
ci(codeql): separate production scans from test fixtures - #8450
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge with its documented administrator activation step. SummaryAdds a production-only CodeQL configuration and an administrator-gated workflow for JavaScript/TypeScript, Python, and Actions.
Acknowledged by Review checks were source-based. Live supersession status could not be checked because GitHub authentication was unavailable. Reviews (1) · Last reviewed commit: "ci(codeql): separate production scans fr..." · Reviewed by Greptile |
Take main a6caa79 (morluto#8441, morluto#8450). The one conflict was an import in tests/boundary/providers/hopper/hopperAnalysisProfile.test.ts: main moved HOPPER_PROVIDER_IDENTITY to HopperProviderMetadata.js, and this branch added the rawLoadAtEntry fixture import; both are kept.
Summary
CodeQL currently extracts test programs and fixtures into the production analysis, generating security alerts for intentional negative inputs and allowing test-only data flows to reach production helpers. Add an extraction scope that excludes
tests/,scripts/fixtures/,*.test.*,*.fixture.*,test_*.py, and*_test.pywhile retaining production source, bridges, shipped scripts, release controllers, and Actions.The default queries and existing
localthreat model are preserved. Behavioral test selection is unchanged. CI classification now runs the semantic guards for changes to the workflow or its configuration, without selecting provider/package runs for configuration-only edits.Activation and scope
The new workflow is deliberately gated by
REA_CODEQL_ADVANCED=true. A repository administrator must disable default setup first, then set that Actions variable and dispatch CodeQL production on main. Default setup rejects advanced CodeQL uploads. The supplied contributor account has push access but no administration access, so this PR does not claim that the server-side scope has already changed. Existing default scanning continues until activation.Each language uses two threads and a 4096 MiB CodeQL budget; matrix jobs run sequentially. Full SARIF evidence is retained for seven days. JavaScript/TypeScript, Python, and Actions coverage is preserved; shell, Java, and Swift remain under their existing checks. No CLI/MCP, provider, target-authority, package, or Evidence contracts change. New capability scope approval: not applicable. This focused configuration change follows the requested audit; no separate issue was opened.
Validation performed
localthreat model: JS 12 → 4 alerts; Python 8 → 2. Every production path/command injection control remains detected; test/fixture controls are excluded. Fixture programs were analyzed, not executed.node scripts/run-exact-tests.mjs run tests/boundary/filesystem/ciCodeqlScope.test.ts tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/workflowActionPinning.test.ts— 391 tests passed. After adding the colocated fixture case, the scope file passed again with 29 tests.npm run check:fast -- --concurrency=1, actionlint, changed-file formatting, test discovery, architecture guards, production reachability, and typed lint passed on Node 24.22.1 / npm 11.16.0. Typed lint reports advisory warnings, with no errors.npm run checkfails at the existing unusedDarwinHelperCachetype (src/process/DarwinHelperCache.ts:465); the identical finding was reproduced in an immutable copy of basee18594b24. No unrelated cleanup is included.e18594b24754ab95ebd119311cc32a1d1ad6fa13, with identical bundle, query metadata, andlocalthreat model. JS/TS: 553 → 303 alerts; Python: 97 → 35; Actions: 5 → 5. Total: 655 → 343 (47.6% fewer), with no new alert locations. Sanitization alerts: 35 → 3; the three retained alerts are in verification scripts.+- Actual JS extraction diagnostics: 6,265 → 2,938 repository inputs, zero extraction errors in both runs. All 3,327 removed inputs match the test/fixture exclusions; no excluded inputs remain and no unexpected baseline inputs are lost. CodeQL's pre-existing expected-file coverage gap for
docs/.vitepress/config.tsis present in both runs; this change does not establish coverage of that file.+| Scope | Alerts | Extract + analyze elapsed | CPU time | Peak sampled process-group RSS |
+| --- | ---: | ---: | ---: | ---: |
+| Complete baseline | 655 | 1597.427 s | 2743.112 s | 4.260 GiB |
+| Production scope | 343 | 598.569 s | 1046.824 s | 3.281 GiB |
+
+These are single sequential pairs on a shared busy host, with fresh databases and result caches. OS/tool caches were not cleared; bundled precompiled queries are reused. Summed RSS was sampled every 0.5 seconds, may double-count shared pages, and may miss short peaks. These observations do not establish a controlled cold/warm speedup. Agent tokens and hosted runner CPU/memory were not measured. Raw SARIF, commands, source inventories, and measurements are retained locally in
/tmp/rea-codeql-scope-validation/.+
+- Hosted CI 41283247085 passed for head
d4d260a0b97c52e0b3c0979e8e56c2844daec489, including all eight portable-test shards and the native package baseline. Existing default CodeQL checks passed. The new production job is intentionally skipped until administrator activation.+- Codex review completed with no findings; Greptile completed with confidence 5/5 and no actionable findings.
The separate PR readiness status fails because the human declarations below remain unchecked. The production workflow cannot be activated with the contributor's current permissions. No real-provider behavior changes are claimed.
Author readiness
Human owner: @gensokyo-dev