ci: add strict mypy type checking - #207
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. 🙌
|
Current
|
|
An adversarial AI-assisted review of the merge resolution found three concrete contract defects, fixed in
The first two failures were reproduced with strict consumer checks, and the third with failing Ollama adapter regressions before the fix. The new head passes Ruff, strict MyPy (57 source files), and the full Python 3.12 offline suite: 636 passed, 2 live-AWS skips, with 2 optional-SciPy fallback warnings. This includes all 15 real LlamaIndex filter tests; reinstalling the same Pillow version repaired the previous local collection failure. Hosted CI is rerunning. No live-AWS or human manual testing is claimed. |
# Conflicts: # src/dynavec/client.py # src/dynavec/stores/dynamodb.py
# Conflicts: # src/dynavec/cache.py # src/dynavec/client.py # src/dynavec/embeddings/bedrock.py # src/dynavec/namespace.py
|
Resolved the new upstream conflict in |
Kaap10
left a comment
There was a problem hiding this comment.
Thank you @be-student for the comprehensive strict MyPy integration across the entire codebase, the thorough type annotations, and for maintaining the branch against recent upstream changes. All CI checks and typecheck suites look solid. Merging now.

This adds strict MyPy checking to the package,
make check/make run-ci, and a dedicated Python 3.12 CI job. Thetypecheckextra installs the real LangChain, LlamaIndex, DSPy, and Haystack adapters; only the untyped DSPy boundary uses narrow local stubs.The branch now includes current
developmentthroughacfd80eat head43c108a2b9938b7a913579fd2e7f98fa448a5ef2. The merge preserves namespace cache invalidation, optimistic DynamoDB updates, graph shortest paths, OpenAI retry handling, and the new namespace batch-search API while retaining strict annotations.Namespace
search_manyoverloads describe plain, explained, and runtime-Boolean result shapes. Consumer fixtures and runtime tests cover return types, namespace isolation, input ordering, explained results, and empty batches. OpenAI retries forward the same typed request parameters on every attempt; the actual Haystack dependency supplies typed component decorators. Contributor documentation records the typecheck dependencies and consumer checks.Earlier contract corrections remain: direct and batch explained-search result shapes agree with runtime behavior, namespace searches accept dynamic Boolean flags, and
CachedEmbedder.dimensiondelegates to the inner embedder rather than retaining a stale snapshot.Validation at
43c108aon macOS/Python 3.11.15:developmentpasses whitespace checks. Upstream's unrelated tracked files and existing whitespace were preserved rather than silently cleaned up.OpenAI Codex and Sol subagents assisted with implementation, integration review, and automated tests. No human-review or manual-testing claim is made. Maintainer adoption and merge remain pending.
Closes #112.