From 1ff34227bf4ba7d69dd67767f43de8a85a238f5f Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Wed, 6 May 2026 14:57:30 +0200 Subject: [PATCH] debug: Add logging to RAG check integration Co-Authored-By: Claude Opus 4.6 (1M context) --- backend-compliance/compliance/api/agent_doc_check_routes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend-compliance/compliance/api/agent_doc_check_routes.py b/backend-compliance/compliance/api/agent_doc_check_routes.py index 95a5acc..fe33e5f 100644 --- a/backend-compliance/compliance/api/agent_doc_check_routes.py +++ b/backend-compliance/compliance/api/agent_doc_check_routes.py @@ -202,9 +202,11 @@ async def _check_single_document(entry: DocCheckEntry) -> list[DocCheckResult]: # RAG-based deep check (semantic verification against Control Library) try: from compliance.services.rag_document_checker import check_document_with_rag + logger.info("Starting RAG check for '%s'...", entry.label) rag_checks = await check_document_with_rag( doc_text, entry.doc_type, entry.label, entry.url, ) + logger.info("RAG check returned %d results for '%s'", len(rag_checks) if rag_checks else 0, entry.label) if rag_checks: for rc in rag_checks: main_result.checks.append(CheckItem( @@ -214,7 +216,7 @@ async def _check_single_document(entry: DocCheckEntry) -> list[DocCheckResult]: if not rc["passed"]: main_result.findings_count += 1 except Exception as e: - logger.warning("RAG check failed for %s: %s", entry.label, e) + logger.warning("RAG check failed for %s: %s %s", entry.label, type(e).__name__, e) all_results.append(main_result)