Treat non-string research summaries as low quality

Filter malformed non-string research summaries instead of letting the broad exception path classify them as usable, with regression coverage.
This commit is contained in:
Afonso Coutinho
2026-06-03 05:42:24 +01:00
committed by GitHub
parent a880b17624
commit 28dbd5346c
2 changed files with 17 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ LOW_QUALITY_MARKERS = [
def is_low_quality(summary: str) -> bool:
"""Check if a finding summary indicates useless or irrelevant content."""
try:
if not summary:
if not isinstance(summary, str) or not summary:
return True
low = summary.lower()
return any(marker in low for marker in LOW_QUALITY_MARKERS)