forked from 0xWheatyz/SPARC
Fix analyze_single_patent to download PDF before attempting local file read #934
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 it from disk, but does not first download the PDF. If the file is absent the method fails silently or throws an unhelpful error.Roadmap Reference
P2 Backend -- analyze_single_patent assumes local file path (ROADMAP.md)
What to do
patents/{patent_id}.pdf, check whether the file exists.FileNotFoundErrorwith an explanatory message directing the caller to run the download step first.Acceptance criteria
analyze_single_patentfor a patent whose PDF is not yet downloaded either downloads it automatically or raises a descriptive error (not a rawFileNotFoundErrorwith no context).This issue has been resolved. PR #55 ("fix: auto-download patent PDF in analyze_single_patent") was merged into main. Closing as completed.