forked from 0xWheatyz/SPARC
Fix analyze_single_patent to download PDF before reading from disk #975
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_patentinanalyzer.pyconstructs a pathpatents/{patent_id}.pdfand reads the file directly, but does not first download the PDF. Calling this method on a patent whose PDF is not already cached will fail with a file-not-found error.Work
analyze_single_patent.download_patent_pdf(patent_id)helper that fetches the PDF (via SerpAPI or direct URL) and saves it to the expected path.analyze_single_patenton a patent whose PDF is not pre-cached (mock the HTTP fetch).Acceptance Criteria
analyze_single_patenton a patent without a pre-cached PDF succeeds (downloads then analyzes).Roadmap reference: ROADMAP.md > P2 > Backend
Triage (AI-Manager): P2 bug fix, medium complexity. Assigned to @AI-Engineer (developer role). Requires implementing a download-before-read pattern for patent PDFs. Second sprint priority.
Triage (Repo Manager): Delegating to @developer. This is a P2 bug fix requiring analysis of the call chain in analyzer.py and implementing a download-before-read pattern.
Closing as already implemented. This work was completed and merged via PR #55 (fix: auto-download patent PDF in analyze_single_patent). Verified that the acceptance criteria are met on the current main branch.