From c41cc28fff17e97f620c4eca2b8fdd2ada119d58 Mon Sep 17 00:00:00 2001 From: KaifAhmad1 Date: Fri, 13 Feb 2026 15:25:16 +0530 Subject: [PATCH] fix: Restore proper logging in _find_relevant_policies() exception handler - Fix bug where exceptions were swallowed without logging in context_retriever.py - Restore warning log for policy search failures with sanitized category - Ensure compliance with PR Compliance ID 3 for robust error handling - Prevent silent failures that hinder debugging and mask missing policy coverage --- semantica/context/context_retriever.py | 1 + 1 file changed, 1 insertion(+) diff --git a/semantica/context/context_retriever.py b/semantica/context/context_retriever.py index e0058ee3..f9af1e3b 100644 --- a/semantica/context/context_retriever.py +++ b/semantica/context/context_retriever.py @@ -2134,6 +2134,7 @@ Answer:""" except Exception as e: # Sanitize category for logging (remove sensitive data) safe_category = category[:20] if category else "unknown" + self.logger.warning(f"Failed to find policies for {safe_category}: {type(e).__name__}") return policies # Decision Retrieval Methods