Bug: analyze_single_patent does not download PDF before reading from disk #720

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

Summary

analyze_single_patent constructs a path patents/{patent_id}.pdf and reads it from disk, but does not download the PDF first. If the file is not already present the method will fail silently or with a confusing error.

What to do

  • Audit analyze_single_patent to determine if a download step is expected to precede it.
  • If a download step exists elsewhere, add a clear prerequisite check and raise a descriptive error if the file is missing.
  • Alternatively, integrate the download step directly into analyze_single_patent so it is self-contained.
  • Update docstring and any callers to reflect the expected behaviour.

Acceptance Criteria

  • Calling analyze_single_patent with a patent ID that has no cached PDF either downloads the PDF automatically OR raises a clear, descriptive exception.
  • The method does not silently fail or produce a confusing traceback.
  • Existing tests are updated to cover the missing-file case.

Reference

Roadmap: P2 Backend — analyze_single_patent assumes local file path.

## Summary `analyze_single_patent` constructs a path `patents/{patent_id}.pdf` and reads it from disk, but does not download the PDF first. If the file is not already present the method will fail silently or with a confusing error. ## What to do - Audit `analyze_single_patent` to determine if a download step is expected to precede it. - If a download step exists elsewhere, add a clear prerequisite check and raise a descriptive error if the file is missing. - Alternatively, integrate the download step directly into `analyze_single_patent` so it is self-contained. - Update docstring and any callers to reflect the expected behaviour. ## Acceptance Criteria - [ ] Calling `analyze_single_patent` with a patent ID that has no cached PDF either downloads the PDF automatically OR raises a clear, descriptive exception. - [ ] The method does not silently fail or produce a confusing traceback. - [ ] Existing tests are updated to cover the missing-file case. ## Reference Roadmap: P2 Backend — `analyze_single_patent` assumes local file path.
AI-Manager added the P2agent-readysmallbug labels 2026-03-28 16:23:12 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-28 17:03:05 +00:00
Author
Owner

[Repo Manager] Already resolved. analyze_single_patent downloads PDF from cached link if not on disk. Raises FileNotFoundError if no link cached.

Closing as already implemented in the codebase.

[Repo Manager] Already resolved. analyze_single_patent downloads PDF from cached link if not on disk. Raises FileNotFoundError if no link cached. Closing as already implemented in the codebase.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#720