Repository navigation
Clear all 13 mypy errors in spatial_mapper.py (#432 session 8) - #450
Merged
Merged
Conversation
sector_stats (map_repository) was an untyped list accumulating dict literals with mixed str/list/float values, so mypy widened it to List[Dict[str, object]] -- every downstream read of sec["radius"], sec["name"], and sec["nodes"] then failed (arithmetic, string concat, indexing, iteration) because "object" supports none of those operations. One annotation (List[Dict[str, Any]]) at the accumulator's declaration fixes the entire fan-out. spatial_grid needed its own List[List[int]] annotation for the same reason (empty list literals give mypy nothing to infer from). Baseline: 78 -> 66 unique entries.
Contributor
5 tasks done
squid-protocol
added a commit
that referenced
this pull request
Jul 25, 2026
…mapper.py naming collision (#432 session 9) (#452) 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. Co-authored-by: Joe Esquibel <[email protected]>
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 8 of the mypy cleanup epic (#432).
sector_statsinmap_repositorywas an untyped[]accumulating dict literals with mixed str/list/float values, so mypy widened it toList[Dict[str, object]]. Every downstream read ofsec["radius"],sec["name"], andsec["nodes"]then failed type-checking (arithmetic, string concat, indexing, iteration all rejectobject). A singleList[Dict[str, Any]]annotation at the accumulator's declaration resolves the entire 13-error fan-out -- this is the same shape of root cause as theRECORDING_SCHEMAS/LENS_CONFIG/PRISM_CONFIGfixes in earlier sessions, just on a local variable instead of a module constant.spatial_grid = [[] for _ in range(NUM_BINS)]needed its ownList[List[int]]annotation -- empty list literals give mypy nothing to infer element type from.Baseline: 78 -> 66 unique entries.
Test plan
mypy gitgalaxy/ --ignore-missing-importsin the CI-matching minimal venv: all 13spatial_mapper.pyerrors resolved, no fan-out regressions elsewherepython tests/mypy_audit.py --ci: passes against the regenerated 66-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