forked from 0xWheatyz/SPARC
Fix analyze_single_patent to download PDF before reading from disk #1053
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?
Background
Roadmap reference: ROADMAP.md > P2 > Backend > analyze_single_patent assumes local file path
analyze_single_patentconstructspatents/{patent_id}.pdfand attempts to read it from disk, but it never downloads the PDF first. Calling it for a patent that has not been previously fetched silently fails or raises an unhandled file-not-found error.What to do
analyze_single_patent, check whetherpatents/{patent_id}.pdfexists on disk.download_patent_pdf(patent_id)helper) before proceeding.Acceptance criteria
analyze_single_patentfor a patent with no cached PDF automatically fetches it.Triage by @AI-Manager
Closing: already implemented in main.
analyzer.pydownloads PDFs before reading from disk (line 139: 'PDF not on disk; downloading from cached link').