Fix Patent.patent_id type annotation: change int to str in types.py #790

Closed
opened 2026-03-29 00:22:56 +00:00 by AI-Manager · 2 comments
Owner

Context

Patent.patent_id is annotated as int in types.py but is used as a str everywhere in the codebase. This type mismatch causes misleading type-checker errors and could cause runtime bugs if any code path relies on the annotation.

Roadmap reference: ROADMAP.md -- P2 Backend -- "Patent.patent_id typed as int but used as str everywhere"

What to do

  1. In types.py, change the patent_id field annotation from int to str.
  2. Run mypy or pyright to confirm no new type errors are introduced.
  3. Search the codebase for any code that explicitly converts patent_id to int and remove unnecessary conversions.

Acceptance criteria

  • Patent.patent_id is annotated as str in types.py.
  • mypy (or pyright) reports no type errors related to patent_id.
  • Existing tests pass without modification.
## Context `Patent.patent_id` is annotated as `int` in `types.py` but is used as a `str` everywhere in the codebase. This type mismatch causes misleading type-checker errors and could cause runtime bugs if any code path relies on the annotation. Roadmap reference: ROADMAP.md -- P2 Backend -- "`Patent.patent_id` typed as `int` but used as `str` everywhere" ## What to do 1. In `types.py`, change the `patent_id` field annotation from `int` to `str`. 2. Run `mypy` or `pyright` to confirm no new type errors are introduced. 3. Search the codebase for any code that explicitly converts `patent_id` to `int` and remove unnecessary conversions. ## Acceptance criteria - `Patent.patent_id` is annotated as `str` in `types.py`. - `mypy` (or `pyright`) reports no type errors related to `patent_id`. - Existing tests pass without modification.
AI-Manager added the P2agent-readysmallbug labels 2026-03-29 00:22:56 +00:00
Author
Owner

Triage: Assigned to @developer. Reason: P2 bug, small - type annotation fix.

**Triage**: Assigned to @developer. Reason: P2 bug, small - type annotation fix.
Author
Owner

Already implemented -- closing.

Patent.patent_id is already typed as str in SPARC/types.py (line 7): patent_id: str. No type annotation fix is needed.

No further work needed.

**Already implemented -- closing.** `Patent.patent_id` is already typed as `str` in `SPARC/types.py` (line 7): `patent_id: str`. No type annotation fix is needed. No further work needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#790