Repository navigation
Clear all 8 mypy errors in security_lens.py, plus a leftover spatial_mapper.py fix (#432 session 9) - #452
Merged
Conversation
…mapper.py naming collision (#432 session 9) security_lens.py: five missing local annotations (counts: Dict[str, int], snippets/entropy_snippets/taint_snippets: List[str]-shaped) in scan_content(), and threats: Dict[str, Any] in scan_binary() -- that last one is genuinely heterogeneous (int flags alongside a str "threat_snippet" message under the same dict), confirmed by its consumers (galaxyscope.py, binary_anomaly_detector.py) reading both shapes via .get() generically. spatial_mapper.py: a leftover from session 8 (#450) -- that PR's mypy fix resolved 12 of that file's 13 errors, but my verification grep was piped through `head -20` and silently truncated the file list, so I never noticed 1 remained (harmlessly preserved unchanged in the regenerated baseline the whole time). Now fixed for real: an outer `for b in bins_to_check` loop variable (int, a bin index) was being reused a few lines later for an unrelated quadratic-formula coefficient (float), which is what mypy was actually flagging. Harmless in practice since the two uses don't interact, but a real naming collision worth removing regardless. Renamed the coefficient to `qb`. Baseline: 66 -> 57 unique entries.
Contributor
This was referenced Jul 25, 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.
Summary
Session 9 of the mypy cleanup epic (#432).
security_lens.py (8 errors): five missing local annotations in
scan_content()(counts: Dict[str, int],snippets/entropy_snippets/taint_snippetsasList[str]-shaped), andthreats: Dict[str, Any]inscan_binary()-- that last one is genuinely heterogeneous (int flags alongside a str"threat_snippet"message in the same dict), confirmed against its consumers (galaxyscope.py,binary_anomaly_detector.py), which read both shapes generically via.get().spatial_mapper.py (1 error, incidental): a leftover from session 8 (#450). That PR's fix resolved 12 of that file's 13 errors, but my verification grep was piped through
head -20and silently truncated the file list, so I never noticed 1 remained -- it was harmlessly preserved unchanged in the regenerated baseline the whole time. Now fixed for real: an outerfor b in bins_to_checkloop variable (int, a bin index) was being reused a few lines later for an unrelated quadratic-formula coefficient (float). Harmless in practice since the two uses don't interact, but a real naming collision worth removing. Renamed the coefficient toqb.Baseline: 66 -> 57 unique entries.
Test plan
mypy gitgalaxy/ --ignore-missing-imports(fresh.mypy_cache) in the CI-matching minimal venv: both files' errors resolved, no fan-out regressions elsewherepython tests/mypy_audit.py --ci: passes against the regenerated 57-entry baselineflake8 . --count --select=E9,F63,F7,F82: 0python tests/dead_key_audit.py --ci: no new findingspytest tests/ -qin the full-precision venv: run in progress, will confirm green before merge🤖 Generated with Claude Code