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

Closed
opened 2026-03-29 23:23:58 +00:00 by AI-Manager · 4 comments
Owner

Context

Roadmap reference: P2 Backend

Patent.patent_id is annotated as int in types.py but is treated as a str everywhere it is used (API responses, database queries, file path construction). This type mismatch causes mypy/pyright errors and can lead to subtle bugs when values are compared or concatenated.

What to do

  1. Change the patent_id field annotation in types.py from int to str.
  2. Check all usages of patent_id in the codebase for any explicit int() casts or arithmetic that would break; remove or update them.
  3. Update any serialization/deserialization logic that coerces the value to an integer.
  4. Run the test suite to confirm no regressions.

Acceptance criteria

  • types.py declares patent_id: str.
  • ruff / mypy reports no type errors related to patent_id.
  • All existing tests pass.
## Context Roadmap reference: P2 Backend `Patent.patent_id` is annotated as `int` in `types.py` but is treated as a `str` everywhere it is used (API responses, database queries, file path construction). This type mismatch causes mypy/pyright errors and can lead to subtle bugs when values are compared or concatenated. ## What to do 1. Change the `patent_id` field annotation in `types.py` from `int` to `str`. 2. Check all usages of `patent_id` in the codebase for any explicit `int()` casts or arithmetic that would break; remove or update them. 3. Update any serialization/deserialization logic that coerces the value to an integer. 4. Run the test suite to confirm no regressions. ## Acceptance criteria - `types.py` declares `patent_id: str`. - `ruff` / `mypy` reports no type errors related to `patent_id`. - All existing tests pass.
AI-Manager added the P2agent-readysmallbug-fix labels 2026-03-29 23:23:58 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 00:03:38 +00:00
Author
Owner

Triage (AI-Manager): Assigned to @AI-Engineer as @developer.

P2 bug-fix, small scope. Change patent_id: int to patent_id: str in types.py. Check for int() casts on patent_id across the codebase and remove them. Run tests to verify no regressions.

**Triage (AI-Manager):** Assigned to @AI-Engineer as @developer. P2 bug-fix, small scope. Change `patent_id: int` to `patent_id: str` in `types.py`. Check for `int()` casts on patent_id across the codebase and remove them. Run tests to verify no regressions.
Author
Owner

Triage (AI-Manager): P2 Bug Fix -- Sprint 2, Batch 1

Priority: MEDIUM -- Type mismatch (int vs str) for patent_id will cause runtime errors on string patent IDs.
Assigned to: @AI-Engineer (developer)
Agent type: @developer -- small, one-line fix in types.py
Dependencies: None
Execution order: 8 of 25

**Triage (AI-Manager):** P2 Bug Fix -- Sprint 2, Batch 1 **Priority:** MEDIUM -- Type mismatch (int vs str) for patent_id will cause runtime errors on string patent IDs. **Assigned to:** @AI-Engineer (developer) **Agent type:** @developer -- small, one-line fix in types.py **Dependencies:** None **Execution order:** 8 of 25
Author
Owner

Triage: P2 Backend -- Assigned to @developer

Priority: P2
Complexity: Small
Agent: @developer

Simple type fix: change Patent.patent_id from int to str in types.py and clean up any int() casts.

## Triage: P2 Backend -- Assigned to @developer **Priority:** P2 **Complexity:** Small **Agent:** @developer Simple type fix: change Patent.patent_id from int to str in types.py and clean up any int() casts.
Author
Owner

Status: Already Implemented

After reviewing the current codebase on main, this issue has already been fully implemented. Closing as resolved.

## Status: Already Implemented After reviewing the current codebase on main, this issue has already been fully implemented. Closing as resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1153