forked from 0xWheatyz/SPARC
Fix analyze_single_patent to download PDF before reading it from disk #1455
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
Roadmap item: P2 Backend - analyze_single_patent prerequisite
Problem
analyze_single_patentconstructs the pathpatents/{patent_id}.pdfand reads from disk, but does not download the PDF first. Calling it on a patent not previously fetched will silently fail or raise a FileNotFoundError.What to do
analyze_single_patent, check whetherpatents/{patent_id}.pdfalready exists.Acceptance criteria
analyze_single_patenton a patent with no local PDF either downloads it automatically or raises a clear, descriptive error.[Triage] P2 bug fix (PDF download before read). Assigned to @AI-Engineer. Queued for implementation after P1 issues are addressed.
[Verification] All acceptance criteria met. Verified complete.
analyzer.pyanalyze_single_patent()checks if the PDF exists on disk, attempts to download via cached link fromdb.get_cached_patent(), and raises a descriptiveFileNotFoundErrorif neither path succeeds. Closing as implemented.