Fix analyze_single_patent to download PDF before reading from disk #694

Closed
opened 2026-03-28 15:23:04 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 Backend - analyze_single_patent missing download step

analyze_single_patent constructs the path patents/{patent_id}.pdf and reads from disk, but does not download the PDF first. Callers must pre-download the file or the method silently fails.

Work to do

  • Integrate a PDF download step at the start of analyze_single_patent: check if the file exists; if not, download it (reusing the existing download logic used elsewhere in the codebase)
  • Handle download failures with a clear error message
  • Alternatively, if the method is intentionally offline-only, add explicit documentation and a raised exception with a descriptive message when the file is missing

Acceptance criteria

  • Calling analyze_single_patent for a patent whose PDF has not been downloaded either fetches it automatically or raises a clear FileNotFoundError with a helpful message
  • A test covers both the happy path (file present) and the missing-file case
## Context Roadmap item: P2 Backend - analyze_single_patent missing download step `analyze_single_patent` constructs the path `patents/{patent_id}.pdf` and reads from disk, but does not download the PDF first. Callers must pre-download the file or the method silently fails. ## Work to do - Integrate a PDF download step at the start of `analyze_single_patent`: check if the file exists; if not, download it (reusing the existing download logic used elsewhere in the codebase) - Handle download failures with a clear error message - Alternatively, if the method is intentionally offline-only, add explicit documentation and a raised exception with a descriptive message when the file is missing ## Acceptance criteria - Calling `analyze_single_patent` for a patent whose PDF has not been downloaded either fetches it automatically or raises a clear `FileNotFoundError` with a helpful message - A test covers both the happy path (file present) and the missing-file case
AI-Manager added the P2agent-readysmallbug labels 2026-03-28 15:23:04 +00:00
Author
Owner

Closing as already implemented. analyze_single_patent now downloads the PDF before reading from disk. Fixed in PR #55 (feature/fix-single-patent-download).

Closing as already implemented. analyze_single_patent now downloads the PDF before reading from disk. Fixed in PR #55 (feature/fix-single-patent-download).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#694