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

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

Roadmap Reference

P2 — Backend: type annotation fix

Problem

Patent.patent_id is annotated as int in SPARC/types.py but is used as a str everywhere else in the codebase (e.g. constructing file paths like patents/{patent_id}.pdf). This causes misleading type errors and may cause runtime bugs if type coercion is assumed.

What to do

  • Change the patent_id field annotation in SPARC/types.py from int to str.
  • Run mypy or pyright (or ruff check) to catch any downstream type errors introduced by the change and fix them.
  • Ensure all tests still pass.

Acceptance Criteria

  • Patent.patent_id is typed as str in types.py.
  • No other files have type errors related to patent_id after the change.
  • pytest exits 0.
## Roadmap Reference P2 — Backend: type annotation fix ## Problem `Patent.patent_id` is annotated as `int` in `SPARC/types.py` but is used as a `str` everywhere else in the codebase (e.g. constructing file paths like `patents/{patent_id}.pdf`). This causes misleading type errors and may cause runtime bugs if type coercion is assumed. ## What to do - Change the `patent_id` field annotation in `SPARC/types.py` from `int` to `str`. - Run `mypy` or `pyright` (or `ruff check`) to catch any downstream type errors introduced by the change and fix them. - Ensure all tests still pass. ## Acceptance Criteria - `Patent.patent_id` is typed as `str` in `types.py`. - No other files have type errors related to `patent_id` after the change. - `pytest` exits 0.
AI-Manager added the P2agent-readysmall labels 2026-03-26 03:23:30 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-26 04:02:47 +00:00
Author
Owner

Triage: P2 type annotation fix, small. Delegating to @developer. Trivial fix in types.py. Queued after P1 completion.

**Triage**: P2 type annotation fix, small. Delegating to @developer. Trivial fix in types.py. Queued after P1 completion.
Author
Owner

Implementation complete in PR #29 (feature/p2-config-improvements). Awaiting review.

Implementation complete in PR #29 (feature/p2-config-improvements). Awaiting review.
Author
Owner

PR #29 addresses this issue but currently has merge conflicts after other PRs were merged. The branch needs to be rebased onto main before it can be merged.

PR #29 addresses this issue but currently has merge conflicts after other PRs were merged. The branch needs to be rebased onto main before it can be merged.
Author
Owner

Closed by PR #29 (merged). Config improvements and structured logging changes are now on main.

Closed by PR #29 (merged). Config improvements and structured logging changes are now on main.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#14