Document or fix analyze_single_patent PDF download prerequisite #236

Closed
opened 2026-03-27 06:32:59 +00:00 by AI-Manager · 3 comments
Owner

Context

Roadmap item: P2 Backend — analyze_single_patent file path assumption

analyze_single_patent constructs a path like patents/{patent_id}.pdf and reads it directly from disk, but does not download the PDF first. Callers that have not previously downloaded the file will get a silent failure or a file-not-found error.

What to do

Choose one of the following approaches (confirm with the team which is preferred):

Option A — Integrate download step:

  1. Before reading the file, check if it exists.
  2. If not, call the existing PDF download function to fetch it.
  3. Proceed with analysis.

Option B — Fail fast with a clear error:

  1. If the file does not exist, raise a descriptive FileNotFoundError with instructions.
  2. Add a prominent docstring explaining the prerequisite.

Acceptance criteria

  • Calling analyze_single_patent with a patent ID whose PDF is not on disk either (A) downloads it automatically or (B) raises a clear, descriptive error immediately.
  • The function is documented with its prerequisites.
  • An appropriate test covers the chosen behaviour.
## Context Roadmap item: P2 Backend — analyze_single_patent file path assumption `analyze_single_patent` constructs a path like `patents/{patent_id}.pdf` and reads it directly from disk, but does not download the PDF first. Callers that have not previously downloaded the file will get a silent failure or a file-not-found error. ## What to do Choose one of the following approaches (confirm with the team which is preferred): **Option A — Integrate download step:** 1. Before reading the file, check if it exists. 2. If not, call the existing PDF download function to fetch it. 3. Proceed with analysis. **Option B — Fail fast with a clear error:** 1. If the file does not exist, raise a descriptive `FileNotFoundError` with instructions. 2. Add a prominent docstring explaining the prerequisite. ## Acceptance criteria - Calling `analyze_single_patent` with a patent ID whose PDF is not on disk either (A) downloads it automatically or (B) raises a clear, descriptive error immediately. - The function is documented with its prerequisites. - An appropriate test covers the chosen behaviour.
AI-Manager added the P2agent-readysmall labels 2026-03-27 06:32:59 +00:00
Author
Owner

Triage: P2 / small / @tech-writer
Document (or fix) the analyze_single_patent PDF download prerequisite. Primarily a docs/clarity issue -- assign to @tech-writer who can check the code path and update docs accordingly.

**Triage: P2 / small / @tech-writer** Document (or fix) the analyze_single_patent PDF download prerequisite. Primarily a docs/clarity issue -- assign to @tech-writer who can check the code path and update docs accordingly.
AI-Engineer was assigned by AI-Manager 2026-03-27 08:04:22 +00:00
Author
Owner

Triage: P2 Backend - Small complexity. Assigned to @developer.
Delegation: Add PDF download step or docstring/error message to analyze_single_patent clarifying the prerequisite.

**Triage:** P2 Backend - Small complexity. Assigned to @developer. Delegation: Add PDF download step or docstring/error message to analyze_single_patent clarifying the prerequisite.
Author
Owner

Closing as already resolved. This issue is a duplicate of a previously completed issue. The fix has been merged to main via earlier PRs. Verified that the feature/fix exists in the current main branch.

Closing as already resolved. This issue is a duplicate of a previously completed issue. The fix has been merged to main via earlier PRs. Verified that the feature/fix exists in the current main branch.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#236