Repository navigation
Clear all remaining 24 mypy errors -- baseline reaches 0 (#432 final session) - #467
Merged
Merged
Conversation
…session) Final cleanup session of the mypy epic (#432), covering the 16 remaining files (mostly 1-2 errors each) in a single PR per user request, now that the epic is down to its long tail. Baseline goes from 24 to 0 -- all 228 originally-seeded errors are now resolved. Same recurring root causes as every prior session, applied file by file: - Untyped dict/list/set accumulators needing an explicit annotation (Dict[str, Any], List[str], Set[str], etc.) because mypy had nothing to infer from an empty literal or a mixed-type dict literal: cobol_agent_task_forge.py's file_anomalies, aperture.py's indent_counts, gpu_recorder.py's excluded_artifacts/inbound_edges, cobol_refractor_controller.py's ram_ir, network_risk_sensor.py's coverage_map, chronometer.py's valid_files_seen, sarif_recorder.py's sarif_payload, cobol_jcl_forge.py's intent, cobol_system_limits_ reporter.py's/full_api_network_map.py's module-level config dicts (SYSTEM_LIMIT_RULES, FRAMEWORK_SIGNATURES), and gitgalaxy_config.py's GUIDESTAR_CONFIG (which also fan-out-fixed guidestar_lens.py's 2 errors, the same schema-widening shape as LENS_CONFIG/PRISM_CONFIG in earlier sessions). - Three signatures declared to return a bare dict but that legitimately return None on a "not found" / "parse failed" path, each confirmed safe against every real caller before widening to Optional[dict]: cobol_graveyard_finder.py's x_ray_dead_code, cobol_dag_architect.py's extract_lineage, and cobol_agent_task_forge.py's generate_agent_ticket parameter (ir_state). - Two max(d, key=d.get) overload-ambiguity fixes in statistical_auditor.py, same shape as the language_lens.py fix in session 4: rewritten as max(d, key=lambda k: d[k]). - cobol_etl_unpacker.py's row_data needed List[Any] -- it's a genuinely mixed CSV row (numeric COMP-3/zoned fields alongside text fields). - chronometer.py's subprocess.Popen(..., stdout=PIPE).stdout is typed IO[Any] | None by the stdlib stub regardless of the PIPE argument; added an assert documenting the real invariant instead of silencing the check. Baseline: 24 -> 0 unique entries. The mypy-audit CI gate (#430) now has an empty baseline going forward -- any new type error introduced by a future PR will fail CI immediately rather than needing to be tracked as a "pre-existing" entry.
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
Final cleanup session of the mypy epic (#432). Covers the 16 remaining files (mostly 1-2 errors each) in a single PR per explicit request, now that the epic is down to its long tail. Baseline goes from 24 to 0 -- all 228 originally-seeded errors are now resolved.
Same recurring root causes as every prior session, applied file by file:
Untyped dict/list/set accumulators needing an explicit annotation because mypy had nothing to infer from an empty literal or a mixed-type dict literal:
cobol_agent_task_forge.py'sfile_anomalies,aperture.py'sindent_counts,gpu_recorder.py'sexcluded_artifacts/inbound_edges,cobol_refractor_controller.py'sram_ir,network_risk_sensor.py'scoverage_map,chronometer.py'svalid_files_seen,sarif_recorder.py'ssarif_payload,cobol_jcl_forge.py'sintent,cobol_system_limits_reporter.py's/full_api_network_map.py's module-level config dicts (SYSTEM_LIMIT_RULES,FRAMEWORK_SIGNATURES), andgitgalaxy_config.py'sGUIDESTAR_CONFIG(which also fan-out-fixedguidestar_lens.py's 2 errors -- same schema-widening shape asLENS_CONFIG/PRISM_CONFIGin earlier sessions).Three signatures declared to return a bare
dictbut that legitimately returnNoneon a "not found" / "parse failed" path, each confirmed safe against every real caller before widening toOptional[dict]:cobol_graveyard_finder.py'sx_ray_dead_code,cobol_dag_architect.py'sextract_lineage, andcobol_agent_task_forge.py'sgenerate_agent_ticketparameter (ir_state).Two
max(d, key=d.get)overload-ambiguity fixes instatistical_auditor.py, same shape as thelanguage_lens.pyfix in session 4: rewritten asmax(d, key=lambda k: d[k]).cobol_etl_unpacker.py'srow_dataneededList[Any]-- it's a genuinely mixed CSV row (numeric COMP-3/zoned fields alongside text fields).chronometer.py'ssubprocess.Popen(..., stdout=PIPE).stdoutis typedIO[Any] | Noneby the stdlib stub regardless of thePIPEargument; added anassertdocumenting the real invariant instead of silencing the check.The
mypy-auditCI gate (#430) now has an empty baseline going forward -- any new type error introduced by a future PR will fail CI immediately rather than needing to be tracked as a "pre-existing" entry.Test plan
mypy gitgalaxy/ --ignore-missing-imports(fresh.mypy_cache) in the CI-matching minimal venv:Success: no issues found in 65 source filespython tests/mypy_audit.py --ci: passes against the now-empty 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