ci: add strict mypy type checking - #207
be-student wants to merge 7 commits into
Conversation
|
Thanks @be-student — this is a valuable type-safety sweep: a Two things before it can land:
Once rebased, ping me and Ill re-verify the mypy job + full suite before it goes to @codeforstartups for the click. Really nice to see strict typing come in. 🙌 |
009062f to
33dcdf7
Compare
|
@codeforstartups Rebased directly onto current Exact-head local terminal evidence is attached:
|
33dcdf7 to
27b9013
Compare
|
Rebased this branch onto current The new head is |
codeforstartups
left a comment
There was a problem hiding this comment.
Really well done, @be-student — and thanks for rebasing onto current development. This is a disciplined strict-mypy adoption: a dedicated typecheck CI job, zero # type: ignore (real annotations throughout, refined aliases like RescoreSpec = dict[str, float], dspy stubs under typings/), and no runtime-logic changes. CI green (4/4).
Two notes:
- This is a maintainer policy decision, @codeforstartups — merging it means every future PR must pass strict mypy in CI. Given the contributor churn weve had, that raises the bar (good for quality, slightly higher for newcomers). Your call.
- I cant merge it from automation — it edits
.github/workflows/ci.yml(the new typecheck job), which needs theworkflowOAuth scope my token lacks. Its a clean one-click UI merge once you decide to adopt it.
Approved on quality — the adoption decision + merge are yours. 🙌

What
make checkandmake run-ci.Why
The package had no enforced static type-checking gate. Running strict MyPy against the original source reported 135 errors across 29 files, including ambiguous optional values, incomplete collection types, and untyped integration boundaries.
How
strict = truefor allsrc/dynavecmodules and a checked consumer fixture.typecheckextra for LangChain, LlamaIndex, and DSPy so CI and the documentedmake installpath check adapters against their real framework bases.py.typed, so a narrow local stub models the publicRetrieve(Parameter)state and retrieval API used by Dynavec and the consumer fixture.development(e5da8f9) and preserve its cross-encoder reranking, graph deletion, item-size validation, eval-trend, and embedding-cache behavior while resolving the overlapping strict types.Testing
Predictionobjects and its state round-trip passed.Risks / Impact
Most source changes are annotation precision and explicit narrowing. The rebase resolution was compared with the previous PR range and retains the newly merged runtime features. Local full runtime suites pass in clean Python 3.9 and 3.11 environments; hosted Python 3.12 is also green.
Docs / Follow-ups
Contributor and Makefile help describe the integration extras required for strict type checking.
Implemented and tested with AI assistance, followed by independent context-free Sol review. No human manual or live-AWS testing is claimed.
Closes #112