forked from 0xWheatyz/SPARC
Document patent PDF volume mount requirement and fix analyze_single_patent download step #455
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: Patent PDF storage and analyze_single_patent assumption
Two related issues exist with patent PDF handling:
analyze_single_patentconstructs a pathpatents/{patent_id}.pdfand reads from disk without first downloading the PDF, which silently fails if the file is not present.patents/local directory is not documented as a required volume mount for containerized deployments.What to do
analyze_single_patent, add a check: if the PDF file does not exist at the expected path, trigger the download step before attempting to parse it. Alternatively, document clearly (with a raised exception and message) that the caller must download first.docker-compose.yml, add a named volume or bind mount for thepatents/directory.PATENT_STORAGE_PATHenvironment variable to make the storage path configurable.Acceptance criteria
analyze_single_patentfor a patent whose PDF has not been downloaded either auto-downloads it or raises a clear, descriptive error (not a silentFileNotFoundError).patents/directory is documented as a required persistent volume in deployment docs.docker-compose.ymlmounts the directory correctly.Reference: ROADMAP.md - P2 Backend
[Repo Manager Triage] P2 Backend/Docs issue - medium complexity. Assigned to @AI-Engineer. Delegating to @developer agent. Will be worked after P1 issues are complete.
[Repo Manager] Closing as already implemented.
Already implemented:
analyzer.py:133-141auto-downloads PDFs from cached links if not on disk, raises descriptiveFileNotFoundErrorif unavailable.docker-compose.yml:52mounts./patents:/app/patents. README documents the volume mount requirement under 'Patent PDF Storage'.