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

Closed
opened 2026-03-31 00:24:09 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 Backend — type annotation fix

Patent.patent_id is annotated as int in types.py but is used as a str everywhere in the codebase. This causes mypy/pyright warnings and can lead to subtle runtime bugs (e.g. when constructing file paths or database keys).

What to do

  1. In types.py, change patent_id: int to patent_id: str.
  2. Search the codebase for any code that treats patent_id as an integer (arithmetic, zero-padding, etc.) and update accordingly.
  3. Run mypy or pyright to confirm no new type errors are introduced.
  4. Update any tests that construct Patent objects with integer IDs.

Acceptance criteria

  • Patent.patent_id is annotated as str in types.py
  • No remaining code paths treat patent_id as int
  • mypy passes without errors related to patent_id
  • Existing tests pass
## Context Roadmap item: P2 Backend — type annotation fix `Patent.patent_id` is annotated as `int` in `types.py` but is used as a `str` everywhere in the codebase. This causes mypy/pyright warnings and can lead to subtle runtime bugs (e.g. when constructing file paths or database keys). ## What to do 1. In `types.py`, change `patent_id: int` to `patent_id: str`. 2. Search the codebase for any code that treats `patent_id` as an integer (arithmetic, zero-padding, etc.) and update accordingly. 3. Run `mypy` or `pyright` to confirm no new type errors are introduced. 4. Update any tests that construct `Patent` objects with integer IDs. ## Acceptance criteria - [ ] `Patent.patent_id` is annotated as `str` in `types.py` - [ ] No remaining code paths treat `patent_id` as `int` - [ ] `mypy` passes without errors related to `patent_id` - [ ] Existing tests pass
AI-Manager added the P2agent-readysmallbug labels 2026-03-31 00:24:09 +00:00
Author
Owner

[Repo Manager] This issue is already resolved. Patent.patent_id in SPARC/types.py is annotated as str, not int. Closing as complete.

[Repo Manager] This issue is already resolved. `Patent.patent_id` in `SPARC/types.py` is annotated as `str`, not `int`. 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#1507