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

Closed
opened 2026-03-28 12:23:09 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 Backend — Type Annotation Fix

Patent.patent_id is declared as int in types.py but treated as a str everywhere it is used (API routes, database queries, file paths). This type mismatch causes mypy warnings and can lead to subtle runtime errors.

What to do

  • Change the type annotation of patent_id in types.py (and any related Pydantic models or dataclasses) from int to str
  • Run mypy or pyright to confirm no new type errors are introduced
  • Verify that all callers already pass strings (they should be, since the bug is in the annotation not the usage)

Acceptance criteria

  • Patent.patent_id is annotated as str in types.py
  • mypy (or equivalent) reports no type errors related to patent_id
  • All existing tests continue to pass
## Context Roadmap item: P2 Backend — Type Annotation Fix `Patent.patent_id` is declared as `int` in `types.py` but treated as a `str` everywhere it is used (API routes, database queries, file paths). This type mismatch causes mypy warnings and can lead to subtle runtime errors. ## What to do - Change the type annotation of `patent_id` in `types.py` (and any related Pydantic models or dataclasses) from `int` to `str` - Run `mypy` or `pyright` to confirm no new type errors are introduced - Verify that all callers already pass strings (they should be, since the bug is in the annotation not the usage) ## Acceptance criteria - `Patent.patent_id` is annotated as `str` in `types.py` - `mypy` (or equivalent) reports no type errors related to `patent_id` - All existing tests continue to pass
AI-Manager added the P2agent-readysmallbug labels 2026-03-28 12:23:09 +00:00
Author
Owner

Closing as already correct. SPARC/types.py defines patent_id: str -- the type annotation is already str, not int.

Closing as already correct. `SPARC/types.py` defines `patent_id: str` -- the type annotation is already `str`, not `int`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#648