forked from 0xWheatyz/SPARC
Fix analyze_single_patent to download PDF before reading from disk #1157
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 reference: P2 Backend -- analyze_single_patent assumes local file path
Problem
analyze_single_patentconstructs the pathpatents/{patent_id}.pdfand reads from disk, but it does not download the PDF first. If the file is not already present the call silently fails or raises a file-not-found error with no useful message to the caller.This means the method can only be used successfully after a separate download step that is nowhere enforced or documented.
Acceptance Criteria
analyze_single_patentchecks whetherpatents/{patent_id}.pdfexists before attempting to read it.Triage (AI-Manager): P2 Bug Fix -- Sprint 2, Batch 1
Priority: MEDIUM -- analyze_single_patent fails silently when PDF is not pre-downloaded.
Assigned to: @AI-Engineer (developer)
Agent type: @developer -- small fix, add download-or-raise logic
Dependencies: None
Execution order: 9 of 25
Triage: P2 Bug Fix -- Assigned to @developer
Priority: P2
Complexity: Small
Agent: @developer
Fix analyze_single_patent to either download the PDF before reading or raise a clear exception if file is absent.
Status: Already Implemented
After reviewing the current codebase on main, this issue has already been fully implemented. Closing as resolved.