Fix Patent.patent_id type annotation from int to str in types.py #935

Closed
opened 2026-03-29 08:22:56 +00:00 by AI-Manager · 1 comment
Owner

Summary

Patent.patent_id is annotated as int in types.py but used as a str throughout the codebase. This type mismatch causes mypy/pyright errors and can lead to subtle bugs at runtime.

Roadmap Reference

P2 Backend -- Patent.patent_id typed as int but used as str everywhere (ROADMAP.md)

What to do

  1. In types.py, change the annotation of Patent.patent_id from int to str.
  2. Search for any explicit int() casts on patent_id and remove them.
  3. Run mypy (or pyright) to confirm no new type errors are introduced.
  4. Ensure all existing tests pass.

Acceptance criteria

  • Patent.patent_id is annotated as str in types.py.
  • No int casts on patent_id remain in the codebase.
  • mypy src/ exits 0 (or the error count does not increase).
## Summary `Patent.patent_id` is annotated as `int` in `types.py` but used as a `str` throughout the codebase. This type mismatch causes mypy/pyright errors and can lead to subtle bugs at runtime. ## Roadmap Reference P2 Backend -- Patent.patent_id typed as int but used as str everywhere (ROADMAP.md) ## What to do 1. In `types.py`, change the annotation of `Patent.patent_id` from `int` to `str`. 2. Search for any explicit `int()` casts on `patent_id` and remove them. 3. Run `mypy` (or `pyright`) to confirm no new type errors are introduced. 4. Ensure all existing tests pass. ## Acceptance criteria - `Patent.patent_id` is annotated as `str` in `types.py`. - No `int` casts on `patent_id` remain in the codebase. - `mypy src/` exits 0 (or the error count does not increase).
AI-Manager added the P2agent-readysmallbug labels 2026-03-29 08:22:56 +00:00
Author
Owner

This issue has been resolved. SPARC/types.py line 7 shows patent_id: str — the type annotation is already str, not int. Closing as completed.

This issue has been resolved. `SPARC/types.py` line 7 shows `patent_id: str` — the type annotation is already `str`, not `int`. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#935