From 72761d60668714da548c94e014b2c22133b73354 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Tue, 5 May 2026 14:08:04 +0200 Subject: [PATCH] debug: Log DSI text lengths to diagnose 0% completeness bug Co-Authored-By: Claude Opus 4.6 (1M context) --- backend-compliance/compliance/api/agent_scan_routes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend-compliance/compliance/api/agent_scan_routes.py b/backend-compliance/compliance/api/agent_scan_routes.py index 510c992..3b0d80f 100644 --- a/backend-compliance/compliance/api/agent_scan_routes.py +++ b/backend-compliance/compliance/api/agent_scan_routes.py @@ -242,6 +242,9 @@ async def _execute_scan(req: ScanRequest, scan_id: str = "") -> ScanResponse: for doc in dsi_data.get("documents", []): doc_type = classify_document_type(doc["title"], doc["url"]) doc_text = doc.get("full_text", "") or doc.get("text_preview", "") + logger.info("DSI check: '%s' type=%s text_len=%d full_text_len=%d preview_len=%d", + doc["title"][:50], doc_type, len(doc_text), + len(doc.get("full_text", "")), len(doc.get("text_preview", ""))) doc_findings = check_document_completeness( doc_text, doc_type, doc["title"], doc["url"], )