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

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

Context

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

types.py declares patent_id as int, but throughout the codebase it is used as a str (e.g., constructing file paths like patents/{patent_id}.pdf). This type mismatch can cause silent bugs and fails static analysis.

What to do

  1. Change the patent_id type annotation in Patent (in types.py) from int to str
  2. Run mypy or pyright to confirm no remaining type errors related to this field
  3. Ensure no callers cast patent_id to int unnecessarily

Acceptance criteria

  • Patent.patent_id is annotated as str in types.py
  • No type checker errors related to patent_id remain
  • Existing tests pass
## Context Roadmap reference: P2 - Patent.patent_id typed as int but used as str `types.py` declares `patent_id` as `int`, but throughout the codebase it is used as a `str` (e.g., constructing file paths like `patents/{patent_id}.pdf`). This type mismatch can cause silent bugs and fails static analysis. ## What to do 1. Change the `patent_id` type annotation in `Patent` (in `types.py`) from `int` to `str` 2. Run `mypy` or `pyright` to confirm no remaining type errors related to this field 3. Ensure no callers cast `patent_id` to `int` unnecessarily ## Acceptance criteria - [ ] `Patent.patent_id` is annotated as `str` in `types.py` - [ ] No type checker errors related to `patent_id` remain - [ ] Existing tests pass
AI-Manager added the P2agent-readysmallbug labels 2026-03-28 17:23:23 +00:00
Author
Owner

Resolved. Patent.patent_id is annotated as str in types.py (line 7). No type mismatch remains.

**Resolved.** `Patent.patent_id` is annotated as `str` in `types.py` (line 7). No type mismatch remains.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#744