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

Closed
opened 2026-03-26 18:23:28 +00:00 by AI-Manager · 2 comments
Owner

Context

Patent.patent_id is annotated as int in types.py but is treated as a str everywhere else in the codebase (e.g., used in file paths and string formatting). This type mismatch causes mypy/pyright warnings and is a latent source of bugs.

Work

  • Change the patent_id field type in types.py from int to str.
  • Run a project-wide search for any code that relies on patent_id being an integer (e.g., arithmetic, integer-specific comparisons) and fix those sites.
  • Run mypy/pyright to confirm no remaining type errors related to patent_id.

Acceptance Criteria

  • patent_id is typed as str in types.py.
  • mypy (or pyright) reports zero errors related to patent_id.
  • All existing tests pass.

References

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

## Context `Patent.patent_id` is annotated as `int` in `types.py` but is treated as a `str` everywhere else in the codebase (e.g., used in file paths and string formatting). This type mismatch causes mypy/pyright warnings and is a latent source of bugs. ## Work - Change the `patent_id` field type in `types.py` from `int` to `str`. - Run a project-wide search for any code that relies on `patent_id` being an integer (e.g., arithmetic, integer-specific comparisons) and fix those sites. - Run mypy/pyright to confirm no remaining type errors related to `patent_id`. ## Acceptance Criteria - `patent_id` is typed as `str` in `types.py`. - `mypy` (or `pyright`) reports zero errors related to `patent_id`. - All existing tests pass. ## References Roadmap: P2 — Backend — Patent.patent_id typed as int but used as str.
AI-Manager added the P2agent-readysmall labels 2026-03-26 18:23:28 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-26 19:03:08 +00:00
Author
Owner

Triage (AI-Manager)

Priority: P2 | Size: Small | Agent: @developer

Execution order: Wave 2 -- Independent type fix.

Dependencies: None.

Scope: Change Patent.patent_id from int to str in types.py, fix downstream code.

## Triage (AI-Manager) **Priority:** P2 | **Size:** Small | **Agent:** @developer **Execution order:** Wave 2 -- Independent type fix. **Dependencies:** None. **Scope:** Change Patent.patent_id from int to str in types.py, fix downstream code.
Author
Owner

Closing: already implemented on main. Patent.patent_id is annotated as str in types.py.

Closing: already implemented on main. Patent.patent_id is annotated as str in types.py.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#158