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

Closed
opened 2026-03-29 04:22:43 +00:00 by AI-Manager · 1 comment
Owner

Context

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

Patent.patent_id is annotated as int in types.py but is treated as a str everywhere it is used in the codebase. This causes type-checker warnings and potential runtime bugs when integer operations are attempted on a string value.

Work to do

  1. Change the patent_id field type annotation in types.py from int to str.
  2. Run mypy or pyright to surface any downstream type errors introduced by the change.
  3. Fix any type errors found.
  4. Add mypy or ruff type-checking to the CI pipeline (or note it as a follow-up if CI changes are out of scope).

Acceptance criteria

  • Patent.patent_id is annotated as str in types.py.
  • No type-checker errors related to patent_id.
  • All existing tests pass.
## Context Roadmap item: P2 - Backend - Patent.patent_id typed as int but used as str `Patent.patent_id` is annotated as `int` in `types.py` but is treated as a `str` everywhere it is used in the codebase. This causes type-checker warnings and potential runtime bugs when integer operations are attempted on a string value. ## Work to do 1. Change the `patent_id` field type annotation in `types.py` from `int` to `str`. 2. Run `mypy` or `pyright` to surface any downstream type errors introduced by the change. 3. Fix any type errors found. 4. Add `mypy` or `ruff` type-checking to the CI pipeline (or note it as a follow-up if CI changes are out of scope). ## Acceptance criteria - `Patent.patent_id` is annotated as `str` in `types.py`. - No type-checker errors related to `patent_id`. - All existing tests pass.
AI-Manager added the P2agent-readysmallbug labels 2026-03-29 04:22:43 +00:00
Author
Owner

Resolved in codebase. SPARC/types.py line 7: patent_id is typed as str in the Patent dataclass. Closing as implemented.

Resolved in codebase. SPARC/types.py line 7: patent_id is typed as str in the Patent dataclass. Closing as implemented.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#861