Repository navigation
aperture: virtualenvs by marker, prose comment lines exempt from saturation (#4542, #4543) - #4550
Merged
Merged
Conversation
…ration (#4542, #4543) #4542: `env`, `.env` and `virtualenv` leave IGNORED_DIRECTORIES. A directory with one of those names is excluded only when it carries a virtualenv's markers (pyvenv.cfg, bin/activate, Scripts/activate, lib/python*/site-packages, Lib/site-packages, conda-meta). `venv` / `.venv` stay excluded by name. The GuideStar doc walk and the chronometer's fallback walk prune the same way. #4543: Gate 4.1 no longer counts a long line that is wholly a comment in the file's own syntax (line token, or inside / one whole block comment, by lexical family; an extension shared by languages gets only the tokens they all agree on), as long as it reads as prose and is within MAX_COMMENT_LINE_LENGTH (5000). Minified code, a comment glued to code, base64 / inline source maps and table literals stay blocked. Real scans: room4doom gameplay/src/env/*.rs (10 files) and 7 of the 8 editor files now scanned (wgpu.rs is now caught by Gate 4.3 on a "generated by" doc comment, a separate bug); crispy-doom src/hexen/p_map.c scanned; og_trig_tables.rs stays blocked. Closes #4542 Closes #4543 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
Contributor
LEXICAL_FAMILY_HEURISTICS is inferred as dict[str, object]; read it through an explicit dict[str, Any], annotate the per-language syntax tuple, and stop reusing tuple-typed names for frozensets. No behaviour change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
5 tasks
| """ | ||
| families: dict[str, Any] = dict(LEXICAL_FAMILY_HEURISTICS.get("lexical_families", {})) | ||
| per_lang: dict[str, list[str]] = families.get("line_exclusive", {}).get("language_delimiters", {}) | ||
| Syntax = tuple[frozenset[str], frozenset[tuple[str, str]]] |
squid-protocol
marked this pull request as ready for review
October 6, 2026 07:43
This was referenced Oct 6, 2026
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.
Closes #4542
Closes #4543
What
#4542, virtualenvs by marker.
env,.envandvirtualenvare removed fromIGNORED_DIRECTORIES. A directory with one of those names is excluded only whenaperture.looks_like_virtualenvfinds markers:pyvenv.cfg,bin/activate,Scripts/activate(.bat),lib/python*/site-packages,Lib/site-packagesorconda-meta.venvand.venvstay excluded by name: they are a convention, and nobody names a source directory that.virtualenvis marker-gated because pypa/virtualenv's own package issrc/virtualenv/. The GuideStar doc-coverage walk and the chronometer's fallback mtime walk prune in the same way. The other name-only entries (build,out,target, ...) are out of scope here and unchanged.#4543, comment lines and the saturation gate. Gate 4.1 no longer counts a line over
MAX_LINE_LENGTHwhen that line is wholly a comment in the file's own syntax. That means a line-comment token, or a line inside a block comment, or one complete block comment, judged bylexical_family. When several languages claim an extension, it gets only the tokens they all agree on, so C's#defineis never read as a comment. Two more conditions apply: the line must read as prose (spaced words, nobase64,or inlinesourceMappingURL=data:), and it must be no longer than the newMAX_COMMENT_LINE_LENGTH(5000). These stay blocked: minified code, a license comment glued to code (/*! x */!function...), a block comment closed mid-line with code after it, a table literal on one line, and base64 in a comment.Evidence
I ran real scans with this branch and diffed
excluded_artifactsagainst the doom-study scans:gameplay/src/env/*.rsfiles are scanned now, and 7 of the 8 editor files.math/src/og_trig_tables.rsis a data payload and stays blocked.tools/editor/src/render/wgpu.rsis now blocked by Gate 4.3 instead, because its line 28 is a doc comment saying "...thresholds are generated bysurface_wgsl". That is a separate false positive and needs its own follow-up issue.src/hexen/p_map.cis scanned (2,343 LOC, 32 functions). Nothing else moved.tests/core_engine/test_scan_exclusions_4542_4543.py. They cover env, virtualenv and venv directories, each virtualenv marker, long comments in Rust, C, C++,.hand Python, plus minified JS and CSS and the payload cases.Gates
pr_gates.py: 7/7 pass (lint, audits, secrets, xray, gauntlet, golden, suite).--ratchets: port-surface, estate, fact-crosscheck, completeness and ground-truth pass.portswas skipped because this box has no cics-crucible checkout. The golden masters pass on both legs with no drift, so I did not bless anything. After that run I merged origin/main, which only had det-only changes (#4540, #4541).🤖 Generated with Claude Code
https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR