Skip to content

Clear all remaining 24 mypy errors -- baseline reaches 0 (#432 final session) - #467

Merged
squid-protocol merged 1 commit into
mainfrom
fix/432-final-cleanup
Jul 25, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/432-final-cleanup

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

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'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 -- 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.

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.

Test plan

  • mypy gitgalaxy/ --ignore-missing-imports (fresh .mypy_cache) in the CI-matching minimal venv: Success: no issues found in 65 source files
  • python tests/mypy_audit.py --ci: passes against the now-empty baseline
  • flake8 . --count --select=E9,F63,F7,F82: 0
  • python tests/dead_key_audit.py --ci: no new findings
  • Full pytest tests/ -q in the full-precision venv: run in progress, will confirm green before merge

🤖 Generated with Claude Code

…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.
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit b1c403b into main Jul 25, 2026
26 checks passed
@squid-protocol
squid-protocol deleted the fix/432-final-cleanup branch July 25, 2026 20:03
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