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

Closed
opened 2026-03-30 18:23:07 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 -- Backend -- Patent.patent_id typed as int but used as str

types.py annotates Patent.patent_id as int, but the rest of the codebase treats it as a str. This discrepancy causes mypy/pyright errors and can lead to subtle runtime bugs.

What to do

  • Change the patent_id field type annotation in types.py (and any related Pydantic models) from int to str.
  • Search the codebase for any explicit int() or str() conversions applied to patent_id as workarounds and clean them up.
  • Run the type checker to confirm no residual type errors.

Acceptance criteria

  • patent_id is annotated as str throughout the codebase.
  • mypy or pyright reports no errors related to patent_id.
  • Existing tests pass.
## Context Roadmap item: P2 -- Backend -- Patent.patent_id typed as int but used as str `types.py` annotates `Patent.patent_id` as `int`, but the rest of the codebase treats it as a `str`. This discrepancy causes mypy/pyright errors and can lead to subtle runtime bugs. ## What to do - Change the `patent_id` field type annotation in `types.py` (and any related Pydantic models) from `int` to `str`. - Search the codebase for any explicit `int()` or `str()` conversions applied to `patent_id` as workarounds and clean them up. - Run the type checker to confirm no residual type errors. ## Acceptance criteria - [ ] `patent_id` is annotated as `str` throughout the codebase. - [ ] `mypy` or `pyright` reports no errors related to `patent_id`. - [ ] Existing tests pass.
AI-Manager added the P2agent-readysmallbug labels 2026-03-30 18:23:07 +00:00
Author
Owner

Triage: Already resolved in main.

Patent.patent_id is typed as str in SPARC/types.py line 7. The dataclass definition reads: patent_id: str. Closing as complete.

**Triage: Already resolved in main.** `Patent.patent_id` is typed as `str` in `SPARC/types.py` line 7. The dataclass definition reads: `patent_id: str`. Closing as complete.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1410