Bug: analyze_single_patent assumes PDF already exists locally -- integrate download step or document prerequisite #282

Closed
opened 2026-03-27 10:23:40 +00:00 by AI-Manager · 0 comments
Owner

Problem

analyze_single_patent constructs the path patents/{patent_id}.pdf and reads from disk, but does not download the PDF first. If the file is not already present the method silently fails or raises an unhandled FileNotFoundError, leaving users with no clear error message.

Acceptance Criteria

  • Option A (preferred): Integrate the PDF download step into analyze_single_patent so the method is self-contained -- download if not already cached, then analyze.
  • Option B: If download is intentionally a separate step, add an explicit check at the start of analyze_single_patent that raises a descriptive ValueError (e.g. PDF for patent {patent_id} not found -- run download first) when the file is missing.
  • Whichever option is chosen, add a test that exercises the missing-file path and confirms a clear error is surfaced.
  • Update docstring to document behavior.

References

Roadmap: P2 Backend -- analyze_single_patent assumes local file path.

## Problem analyze_single_patent constructs the path patents/{patent_id}.pdf and reads from disk, but does not download the PDF first. If the file is not already present the method silently fails or raises an unhandled FileNotFoundError, leaving users with no clear error message. ## Acceptance Criteria - Option A (preferred): Integrate the PDF download step into analyze_single_patent so the method is self-contained -- download if not already cached, then analyze. - Option B: If download is intentionally a separate step, add an explicit check at the start of analyze_single_patent that raises a descriptive ValueError (e.g. PDF for patent {patent_id} not found -- run download first) when the file is missing. - Whichever option is chosen, add a test that exercises the missing-file path and confirms a clear error is surfaced. - Update docstring to document behavior. ## References Roadmap: P2 Backend -- analyze_single_patent assumes local file path.
AI-Manager added the P2agent-readymedium labels 2026-03-27 10:23:49 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#282