Fail loudly when PasHub truncates the evidence list 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-22 12:57:25 +00:00
parent d8f673a31f
commit c95d3b20dc

View file

@ -192,7 +192,17 @@ class PashubClient:
r.raise_for_status()
results = r.json().get("results", [])
payload: Dict[str, Any] = r.json()
results: List[Dict[str, Any]] = payload.get("results", [])
total: int = payload.get("totalItemCount", len(results))
if len(results) < total:
raise TruncatedEvidenceListError(
f"PasHub returned {len(results)} of {total} evidence files for job "
f"{job_id} - the response was truncated and the evidence set is "
f"incomplete. Increase _EVIDENCE_PAGE_SIZE in pashub_client.py "
f"above {total} and re-run."
)
return [EvidenceFileData.from_api(item) for item in results]