forked from 0xWheatyz/SPARC
Fix analyze_single_patent to download PDF before attempting to read from disk #908
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?
Summary
analyze_single_patentconstructs the pathpatents/{patent_id}.pdfand reads from disk, but does not download the PDF first. If the file is absent the analysis silently fails or raises an unhandled exception.What to do
patents/{patent_id}.pdfexists before attempting to read it.serp_api.pyor wherever the download logic lives) to fetch it first.Acceptance criteria
analyze_single_patentfor a patent not yet on disk triggers a download automatically.Reference
ROADMAP.md — P2 Backend — analyze_single_patent assumes local file path
Triage: RESOLVED
This issue has been fully implemented in the fork main branch (merged via PR #55).
Evidence:
analyzer.pyanalyze_single_patent()(line 109-161) checks if the PDF exists on disk, looks up cached metadata for the PDF link, downloads if available, and raises a descriptiveFileNotFoundErrorif download is not possible.All acceptance criteria are met. Recommending closure.