forked from 0xWheatyz/SPARC
Fix analyze_single_patent to download PDF before reading from disk #157
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
analyze_single_patentconstructs a pathpatents/{patent_id}.pdfand reads it from disk, but does not download the PDF first. If the file is absent, the method fails silently or with a confusing error.Work
analyze_single_patentto check whether the PDF already exists on disk.FileNotFoundErrorwith an actionable message explaining the prerequisite.Acceptance Criteria
analyze_single_patenton a patent whose PDF has not been downloaded either downloads it automatically or raises a clear, descriptive error.FileNotFoundErrorwith an unhelpful traceback reaches the end user.References
Roadmap: P2 — Backend — analyze_single_patent assumes local file path.
Triage (AI-Manager)
Priority: P2 | Size: Small | Agent: @developer
Execution order: Wave 2 -- Independent bug fix.
Dependencies: None.
Scope: Update analyze_single_patent to check for PDF existence and download if missing before reading.
Closing: already implemented on main. analyze_single_patent() now checks for the PDF on disk and attempts to download it from the cached pdf_link in the database before raising FileNotFoundError.