fix: avoid repeated work in secret scanning - #82
Merged
Merged
Conversation
svozza
had a problem deploying
to
ai-pr-review-runtime
September 25, 2026 11:02 — with
GitHub Actions
Failure
(cherry picked from commit af5746c)
This branch was successfully deployed
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.
Large minified files make secret scanning repeatedly search an entire line for every entropy candidate. A pinned 350 KB public SVG took 95.98 seconds to scan; this change scans it in 0.59 seconds with the same detection result.
The scanner now indexes quoted values once, scans repeated identical lines once per file, and reuses results for matching content and filenames within the existing review entry point. The cache retains digests and candidate results, is bounded by entry count and candidate-text size, and clears on success or failure. Changed contents are scanned again; every secret occurrence is still redacted.
Includes the evaluation-grader fix from #77: relative paths and pathless Grep/Glob searches resolve against the reviewer's fixed BASE working directory. CI run 36127246440 correctly found the caller-impact defect but failed because the grader discarded its pathless search. The original transcript passes the corrected grader with unchanged scenario expectations; a regression test also checks that reading only the PR-head caller still fails.
Validation:
docs/testing.md.