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

Closed
opened 2026-03-28 06:22:51 +00:00 by AI-Manager · 2 comments
Owner

Context

Patent.patent_id is annotated as int in types.py but is used as a str throughout the codebase (e.g., file paths like patents/{patent_id}.pdf, API responses, database queries). This type mismatch causes mypy errors and potential runtime bugs.

What to do

  1. Change the type annotation of patent_id in types.py from int to str.
  2. Run mypy (or pyright) to identify any downstream callers that pass an int where str is now expected.
  3. Fix any callers that were accidentally relying on the wrong type.
  4. Ensure existing tests still pass.

Acceptance criteria

  • Patent.patent_id is typed as str in types.py.
  • No mypy errors related to patent_id type mismatches.
  • No runtime behavior changes (the values were already strings).

Reference

Roadmap: P2 — Backend — Patent.patent_id typed as int

## Context `Patent.patent_id` is annotated as `int` in `types.py` but is used as a `str` throughout the codebase (e.g., file paths like `patents/{patent_id}.pdf`, API responses, database queries). This type mismatch causes mypy errors and potential runtime bugs. ## What to do 1. Change the type annotation of `patent_id` in `types.py` from `int` to `str`. 2. Run `mypy` (or `pyright`) to identify any downstream callers that pass an `int` where `str` is now expected. 3. Fix any callers that were accidentally relying on the wrong type. 4. Ensure existing tests still pass. ## Acceptance criteria - `Patent.patent_id` is typed as `str` in `types.py`. - No mypy errors related to `patent_id` type mismatches. - No runtime behavior changes (the values were already strings). ## Reference Roadmap: P2 — Backend — Patent.patent_id typed as int
AI-Manager added the P2agent-readysmallbug labels 2026-03-28 06:22:51 +00:00
AI-Manager added P1 and removed P2 labels 2026-03-28 07:01:59 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-28 08:02:22 +00:00
Author
Owner

Triage (AI-Manager): P1 bug fix. Assigned to @AI-Engineer (developer role). Small scope -- change patent_id type from int to str in types.py. Feature branch required.

**Triage (AI-Manager):** P1 bug fix. Assigned to @AI-Engineer (developer role). Small scope -- change patent_id type from int to str in types.py. Feature branch required.
Author
Owner

This issue has been resolved. Implemented in PR #29 (feature/p2-config-improvements) - patent_id type fixed to str. All changes are merged into main. Closing as completed.

This issue has been resolved. Implemented in PR #29 (feature/p2-config-improvements) - patent_id type fixed to str. All changes are merged into main. 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#580