Repository navigation
perf(security): scan one line per distinct shape of a repetitive directive table (Part of #3188) - #5441
Merged
Conversation
…ctive table (Part of #3188) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…rt (Part of #3188) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Owner
Author
|
No description provided. |
squid-protocol
marked this pull request as ready for review
October 18, 2026 09:05
Contributor
Owner
Author
|
No description provided. |
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.
Part of #3188
What
A generated-file fast lane for the Security Lens. A large (>= 256 KB), ASCII, C/C++/Objective-C file whose non-blank lines are >= 95% bare preprocessor directives and which has few distinct line shapes (digit runs collapsed; <= 25% of lines) gets the REAL lens run once per distinct shape instead of over the whole text. The result is used only if it is clean (all counts zero); any finding keeps the file on the full lane. The gate is bounded and linear (possessive regex), so it is ReDoS-proof.
Wired in
_process_file_worker(about 23 lines ingalaxyscope.py); logic lives in the newgitgalaxy/core/generated_fastlane.py. The payload gainsfast_lane: "directive_table"only when the lane was taken.Class table
AvailabilityInternal.h-style version tablesAvailability*.h, winerror-style#definetables, errno / enum tablesNo burned mainframe estate contains such a file, so none was needed for evidence.
Plan change
The plan skipped the detector as well. That dropped the file:
statistical_auditorremoves an ambiguous-extension (.h) file with zero structure ("Unresolved Ambiguity (No Retainable Structure)"), and the detector's signals feed risk scores. So the lane is Security-Lens-only. No config key was added (avoids the #5438 overlap and the dead-key audit), and the architecture brief was not touched.Evidence
Synthetic 1.95 MB table (
/tmp, outside the repo): wall time 3.93 s -> 2.92 s (~1 s of lens saved),file_databyte-identical on and off.Gates
pr_gates --fast6/6,--ratchets8 passgolden-lock.sh crucible_check.py(language-crucible v1.7.0): full_precision PASS, zero_dependency PASS, no bless neededaudit_check.py: ruff, mypy, dead-key, ast-accuracy all cleartests/core_engine/test_generated_fastlane_3188.pyCross-repo
None. Companion PRs: none. Textual overlap only with #5435 (galaxyscope.py) and #5438; this change is small there and branch is 0 behind main.
Sibling gaps / remaining slices
Lessons for agents
.hfile gets the file banished bystatistical_auditor(zero structure), and changes risk signals. Skip only the Security Lens, with the real lens on a sample.tests/tools/audit_check.pyneeds~/.cache/gitgalaxy/mypy-2.4.0/binon PATH, andgolden-lock.shneedspython3, notpython.LANGUAGE_CRUCIBLE_PATHis set to/srv/storage_16tb/projects/gitgalaxy/language-crucibleon the owner's box.🤖 Generated with Claude Code