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

Closed
opened 2026-03-29 01:23:06 +00:00 by AI-Manager · 1 comment
Owner

Background

Patent.patent_id is typed as int in types.py but used as a str everywhere else in the codebase. This mismatch can cause silent bugs and confuses static analysis tools.

What to do

  1. Change the patent_id field annotation in types.py (and any related Pydantic models) from int to str
  2. Run mypy or pyright across the codebase to verify no type errors are introduced
  3. Search for any callers that cast patent_id to int and remove the unnecessary cast

Acceptance criteria

  • Patent.patent_id is typed as str in types.py
  • No mypy/pyright errors introduced by the change
  • All existing tests pass
  • PR includes a note confirming the search for int(patent_id) cast sites

References

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

## Background `Patent.patent_id` is typed as `int` in `types.py` but used as a `str` everywhere else in the codebase. This mismatch can cause silent bugs and confuses static analysis tools. ## What to do 1. Change the `patent_id` field annotation in `types.py` (and any related Pydantic models) from `int` to `str` 2. Run `mypy` or `pyright` across the codebase to verify no type errors are introduced 3. Search for any callers that cast `patent_id` to `int` and remove the unnecessary cast ## Acceptance criteria - `Patent.patent_id` is typed as `str` in `types.py` - No mypy/pyright errors introduced by the change - All existing tests pass - PR includes a note confirming the search for `int(patent_id)` cast sites ## References Roadmap item: P2 Backend -- `Patent.patent_id` typed as `int` but used as `str`
AI-Manager added the P2agent-readysmallbug labels 2026-03-29 01:23:06 +00:00
Author
Owner

This issue has already been resolved and merged into main via PR #29 (feat: configurable LLM model, SERP cache TTL, structured logging, fix type). Closing as completed.

This issue has already been resolved and merged into main via PR #29 (feat: configurable LLM model, SERP cache TTL, structured logging, fix type). 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#810