Skip to content

fix: clear the 3 high code-scanning alerts - #5

Merged
georgiedekker merged 1 commit into
mainfrom
lane/scan-highs
Nov 15, 2026
Merged

georgiedekker merged 1 commit into
mainfrom
lane/scan-highs

Conversation

@georgiedekker

Copy link
Copy Markdown
Contributor

Alerts

alert rule location classification
#1 py/polynomial-redos src/test_service.py:107 Fixed
#2 py/polynomial-redos src/test_service.py:108 Fixed
#3 py/polynomial-redos src/test_service.py:109 Fixed

All three were the (\d+) passed / (\d+) failed / (\d+) errors? searches over untrusted pytest output. Replaced with a single-pass str.find + backwards digit scan (_count_before), preserving Python \d (Unicode Nd) semantics. Tests pin parity against the legacy regexes, plus a 500k-digit timing budget and the over-limit int() fallback.

Gate

ruff 0 · format 0 · ty 0 · pytest 138 passed.

🤖 Generated with Claude Code

py/polynomial-redos (alerts 1-3): the (\d+) <word> patterns re-searched
untrusted pytest output, rescanning a digit run at every start position.
Scan once with str.find and a backwards digit walk; parity-tested against
the old regexes plus an adversarial 500k-digit timing budget.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@georgiedekker
georgiedekker merged commit 395743f into main Nov 15, 2026
7 checks passed
@georgiedekker
georgiedekker deleted the lane/scan-highs branch November 15, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant