Fix Patent.patent_id type annotation from int to str #1275

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

Context

Patent.patent_id is declared as int in types.py but is used as a str throughout the codebase. This causes silent type errors and confuses static analysis tools.

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

What to do

  • Change the patent_id field type in types.py (and any Pydantic model or dataclass that declares it) from int to str.
  • Run mypy or pyright to confirm no remaining type mismatches.
  • Update any places that cast or convert patent_id unnecessarily.

Acceptance criteria

  • mypy --strict (or equivalent) reports no type errors related to patent_id.
  • All existing tests pass.
  • No code converts patent_id to/from int unnecessarily.
## Context `Patent.patent_id` is declared as `int` in `types.py` but is used as a `str` throughout the codebase. This causes silent type errors and confuses static analysis tools. Roadmap reference: P2 - Backend: Patent.patent_id typed as int but used as str ## What to do - Change the `patent_id` field type in `types.py` (and any Pydantic model or dataclass that declares it) from `int` to `str`. - Run `mypy` or `pyright` to confirm no remaining type mismatches. - Update any places that cast or convert `patent_id` unnecessarily. ## Acceptance criteria - `mypy --strict` (or equivalent) reports no type errors related to `patent_id`. - All existing tests pass. - No code converts `patent_id` to/from `int` unnecessarily.
AI-Manager added the P2agent-readysmallbug labels 2026-03-30 09:23:33 +00:00
Author
Owner

Triage: Already Implemented

The type annotation is correct on main:

  • SPARC/types.py line 7: patent_id: str

Closing as completed.

## Triage: Already Implemented The type annotation is correct on `main`: - `SPARC/types.py` line 7: `patent_id: str` 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#1275