forked from 0xWheatyz/SPARC
Bug: analyze_single_patent silently fails if PDF is not already downloaded #1346
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
analyze_single_patentconstructs the pathpatents/{patent_id}.pdfand reads it from disk, but it does not download the PDF first. If the file is absent the method raises aFileNotFoundError(or similar) with no useful context, and the caller has no indication that a download step was required.What to do
analyze_single_patent— if the file does not exist, download it before attempting analysis.PatentPDFNotFoundErroror similar) that instructs the caller to download the PDF first, and document the prerequisite in the method docstring.Acceptance criteria
analyze_single_patentfor a patent whose PDF has not been downloaded either (A) downloads it automatically or (B) raises a clear, documented exception — not a bareFileNotFoundError.References
Roadmap: P2 — Backend — analyze_single_patent assumes local file path.
Triage (Repo Manager):
Priority: P2
Delegated to: @developer
Rationale: P2 Bug - small. Add PDF download step or clear error in analyze_single_patent. Localized to analyzer.py.
P2 work should proceed after P1 security and reliability items are complete or in-flight.
Triaged by repo manager: Already resolved.
analyzer.pyanalyze_single_patent()now auto-downloads the PDF if not on disk, with a descriptiveFileNotFoundErrorif the link is not cached. Docstring documents both behaviors. Closing.