Skip to content

[REFACTOR] Fix mypy type errors in the core parsing engine #432

Closed

Description

@squid-protocol

🎯 Objective

Work down the mypy baseline (#430) for the five files that account for ~80% of the 235 errors measured in #429:

File Errors (pre-#431 root-cause fixes)
`gitgalaxy/metrics/signal_processor.py` 60
`gitgalaxy/recorders/record_keeper.py` 48
`gitgalaxy/standards/language_lens.py` 27
`gitgalaxy/core/prism.py` 27
`gitgalaxy/core/detector.py` 27

Should do #431 (root-cause fan-out fixes) first -- re-measure counts here afterward, since several of these will already be resolved.

🛠️ Approach

Parent: #429

Activity

  1. added
    python
    refactor
    core-engine
    on Jul 25, 2026
  2. squid-protocol commented on Jul 25, 2026

    @squid-protocol
    OwnerAuthor

    Progress: 2 of the 5 target files fully cleared.

    File Original errors Status
    `record_keeper.py` 48 (16 after #431's `RECORDING_SCHEMAS` fix) ✅ 0 -- cleared
    `language_lens.py` 27 ✅ 0 -- cleared (found and fixed a second root cause along the way, `LENS_CONFIG`, same class as #431's `RECORDING_SCHEMAS`)
    `signal_processor.py` 60 (22 remaining) Open
    `detector.py` 27 (18 remaining) Open
    `prism.py` 27 (8 remaining) Open

    Remaining total across these three: 48 of the 126 currently-baselined errors. `spatial_mapper.py` (13 errors) wasn't in this issue's original file list but is in the same `gitgalaxy/core/` neighborhood as `detector.py`/`prism.py` -- worth folding into this issue's scope rather than #433's when it's picked up.

  3. squid-protocol commented on Jul 25, 2026

    @squid-protocol
    OwnerAuthor

    Done -- baseline for this scope reached 0. Completed in file-sized PRs as planned:

    File Errors PR
    prism.py 8 (23 incl. overload notes) #448
    spatial_mapper.py 13 (+1 caught in #452) #450, #452
    detector.py 18 #446
    signal_processor.py 22 #444
    language_lens.py 27 #442

    A few of these turned out to be genuine (if mostly latent) bugs rather than pure annotation work, called out in each PR: a _find_balanced_end float/range() TypeError risk, an importlib.util implicit-dependency fragility, and a for b in ... / quadratic-coefficient b variable-name collision in spatial_mapper.py that mypy only surfaced after the file's other errors were cleared.

    Full epic (including #433's tools/recorders scope) wrapped up in #467 -- see #429 for the final summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-enginepythonrefactor

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions