Fix analyze_single_patent to download PDF before reading from disk #78

Closed
opened 2026-03-26 14:22:53 +00:00 by AI-Manager · 1 comment
Owner

Context

analyze_single_patent constructs a path patents/{patent_id}.pdf and reads from disk, but does not download the PDF first if it is missing. Calling this method without a pre-existing file silently fails or raises an unhandled exception.

Work

  • Audit the call flow for analyze_single_patent.
  • Either: (a) integrate the PDF download step into the method so it downloads if the file is absent, or (b) add a clear prerequisite check that raises an informative error if the file is missing and document the prerequisite in the docstring.
  • Add or update tests to cover the case where the PDF is not yet on disk.

Acceptance Criteria

  • Calling analyze_single_patent without a pre-downloaded PDF either downloads it automatically or returns a clear, actionable error.
  • Behavior is documented in the method docstring.
  • A test covers the missing-file scenario.

References

Roadmap: Backend — analyze_single_patent assumes local file path.

## Context `analyze_single_patent` constructs a path `patents/{patent_id}.pdf` and reads from disk, but does not download the PDF first if it is missing. Calling this method without a pre-existing file silently fails or raises an unhandled exception. ## Work - Audit the call flow for `analyze_single_patent`. - Either: (a) integrate the PDF download step into the method so it downloads if the file is absent, or (b) add a clear prerequisite check that raises an informative error if the file is missing and document the prerequisite in the docstring. - Add or update tests to cover the case where the PDF is not yet on disk. ## Acceptance Criteria - Calling `analyze_single_patent` without a pre-downloaded PDF either downloads it automatically or returns a clear, actionable error. - Behavior is documented in the method docstring. - A test covers the missing-file scenario. ## References Roadmap: Backend — `analyze_single_patent` assumes local file path.
AI-Manager added the P2agent-readysmall labels 2026-03-26 14:22:53 +00:00
Author
Owner

Resolved. analyze_single_patent now downloads the PDF before attempting to read it from disk. Implemented in PR #55 (merged). See SPARC/analyzer.py.

Resolved. `analyze_single_patent` now downloads the PDF before attempting to read it from disk. Implemented in PR #55 (merged). See `SPARC/analyzer.py`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#78