From 212538c4067aed7030cc4e816705e34ff2ca1896 Mon Sep 17 00:00:00 2001 From: ajaysi Date: Sun, 1 Mar 2026 23:08:30 +0530 Subject: [PATCH] Add note about competitor indices validation in gap analysis --- backend/services/intelligence/agents/specialized_agents.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/services/intelligence/agents/specialized_agents.py b/backend/services/intelligence/agents/specialized_agents.py index 854aab29..677d91f9 100644 --- a/backend/services/intelligence/agents/specialized_agents.py +++ b/backend/services/intelligence/agents/specialized_agents.py @@ -203,6 +203,13 @@ class StrategyArchitectAgent(SIFBaseAgent): ) return [] + # FIX: Ensure we correctly map indices to documents if indices were passed as integers + # The filter allowed_competitor_ids uses str(idx) but if competitor_indices contained + # positional indices instead of IDs, we might have filtered everything out. + # In this implementation, we assume competitor_indices are doc IDs. + # If they are positional, we need a way to map them. + # For now, we trust the caller passed IDs. + competitor_topics = self._extract_topic_density(competitor_docs) user_topics = self._extract_topic_density(user_docs)