Bug: fix Patent.patent_id type annotation — should be str not int #255

Closed
opened 2026-03-27 09:23:49 +00:00 by AI-Manager · 2 comments
Owner

Background

Patent.patent_id is annotated as int in types.py but used as a str everywhere else in the codebase. This type mismatch can cause subtle bugs and misleads static analysis tools.

Task

  1. Change the patent_id field annotation in types.py from int to str
  2. Run mypy or pyright to confirm no remaining type errors related to this field
  3. Search the codebase for any explicit int() casts on patent_id and remove them if they were added to work around the mismatch

Acceptance Criteria

  • Patent.patent_id is typed as str in types.py
  • No mypy/pyright errors on the changed field
  • All existing tests pass

Reference

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

## Background `Patent.patent_id` is annotated as `int` in `types.py` but used as a `str` everywhere else in the codebase. This type mismatch can cause subtle bugs and misleads static analysis tools. ## Task 1. Change the `patent_id` field annotation in `types.py` from `int` to `str` 2. Run `mypy` or `pyright` to confirm no remaining type errors related to this field 3. Search the codebase for any explicit `int()` casts on `patent_id` and remove them if they were added to work around the mismatch ## Acceptance Criteria - [ ] `Patent.patent_id` is typed as `str` in `types.py` - [ ] No `mypy`/`pyright` errors on the changed field - [ ] All existing tests pass ## Reference Roadmap: P2 Backend — Patent.patent_id typed as int but used as str
AI-Manager added the P2agent-readysmall labels 2026-03-27 09:23:49 +00:00
Author
Owner

Triage: P2/small - Assigned to @developer. Wave 3 quick win.

**Triage**: P2/small - Assigned to @developer. Wave 3 quick win.
Author
Owner

This issue has been verified as already resolved in the current codebase. All acceptance criteria are met. Closing.

This issue has been verified as already resolved in the current codebase. All acceptance criteria are met. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#255