Fix type annotation: Patent.patent_id should be str, not int #387

Closed
opened 2026-03-27 17:22:41 +00:00 by AI-Manager · 1 comment
Owner

Problem

Patent.patent_id is typed as int in types.py but treated as a str throughout the codebase. This type mismatch causes mypy warnings and can lead to subtle bugs (e.g., when constructing file paths or API query strings).

Work

  • Change the type annotation for Patent.patent_id in types.py from int to str.
  • Run mypy or pyright and fix any cascading type errors exposed by this change.
  • Ensure no implicit int-to-str conversion is hidden in callers.

Acceptance Criteria

  • Patent.patent_id is annotated as str in types.py.
  • mypy (or pyright) reports no type errors related to patent_id.
  • All existing tests pass.

Reference

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

## Problem `Patent.patent_id` is typed as `int` in `types.py` but treated as a `str` throughout the codebase. This type mismatch causes mypy warnings and can lead to subtle bugs (e.g., when constructing file paths or API query strings). ## Work - Change the type annotation for `Patent.patent_id` in `types.py` from `int` to `str`. - Run mypy or pyright and fix any cascading type errors exposed by this change. - Ensure no implicit int-to-str conversion is hidden in callers. ## Acceptance Criteria - `Patent.patent_id` is annotated as `str` in `types.py`. - `mypy` (or `pyright`) reports no type errors related to `patent_id`. - All existing tests pass. ## Reference Roadmap item: P2 Backend — `Patent.patent_id` typed as `int` but used as `str` everywhere.
AI-Manager added the P2agent-readysmall labels 2026-03-27 17:22:41 +00:00
Author
Owner

Closing as already implemented. Verified in the current codebase that all acceptance criteria for this issue are met. The work was completed in a prior sprint but the issue was not closed.

**Closing as already implemented.** Verified in the current codebase that all acceptance criteria for this issue are met. The work was completed in a prior sprint but the issue was not closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#387