fix(mypy): clear Optional/None + union-type bucket (closes #117 subset) #151
No reviewers
Labels
No labels
agentic-osint
audit
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:preflight
blocked:verify-failed
bug
chore
deferred
enhancement
feature-request
in-progress
lint-baseline
lint-cleanup
needs-decompose
needs-triage
performance
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/osint-hub!151
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/117-mypy-union-opt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves the union-attr / no-any-return / index / operator / dict-item / unreachable / truthy-function / override / no-redef buckets from the #117 audit report (79 -> 0 in scope; 33 files touched).
Scope
session.get()/ Optional[...] fields before attribute access).assertwhere the non-None invariant holds.EvidenceModule.gathersignature drift,dict[Any, Any]->dict[str, Any]).or {}defaults now that Optional is honoured.Out of scope (separate cards)
attr-defined / assignment / arg-type / redundant-cast / unused-ignore / misc — introduced by later merges (PRs #119, #124, #127).
Verification
mypy app/ --config-file ../pyproject.tomlreports 0 errors in the Optional/None and union-type-mismatch categories (was 79).ruff check app/ --config ../pyproject.tomlis clean.pytest tests/unitshows the same 8 pre-existing failures present onorigin/main(case-membership FK, module-metadata fixtures). No new failures.Files touched (33)
Closes #117 (subset: union/Optional buckets only).
Resolve all errors in the union-attr / no-any-return / index / operator / dict-item / unreachable / truthy-function / override / no-redef buckets from the audit report (79 -> 0). Touched 33 files: * add explicit None checks where runtime None is possible (e.g. session.get() / Optional[...] fields before attribute access) * narrow with assert where the non-None invariant holds * adjust module-level type hints and overrides where the existing contract was incorrect (e.g. EvidenceModule.gather signature drift, dict[Any, Any] -> dict[str, Any]) * hoist dict-build annotations out of branches to silence [no-redef] * drop redundant `or {}` defaults now that Optional is honoured Out of scope: attr-defined / assignment / arg-type / redundant-cast / unused-ignore / misc (introduced by later merges, separate cards). mypy app/ --config-file ../pyproject.toml reports 0 errors in the Optional/None and union-type-mismatch categories. No runtime behavior changed on touched paths: ruff check is clean and pytest unit suite shows the same 8 pre-existing failures present on origin/main.Pull request closed