{
  "spec_version": "1.4.0-otel",
  "timestamp": "2026-04-24T00:13:03.355457Z",
  "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
  "span_id": "00f067aa0ba902b7",
  "severity_text": "WARN",
  "severity_number": 13,
  "event_name": "swarm.agent.lifecycle.deprecated",
  "resource": {
    "service.name": "swarm-orchestrator",
    "service.version": "4.2.0",
    "deployment.environment": "production",
    "node.id": "worker-node-aws-us-east-1a-04"
  },
  "attributes": {
    "agent.id": "DataRetrievalAgent",
    "agent.previous_version": "v29.x",
    "agent.target_version": "v30",
    "deprecation.reason": "Transitioning to v30 architecture.",
    "deprecation.action_required": true
  },
  "metrics": {
    "agent.core_logic.function_count": 12,
    "agent.capabilities.count": 0
  },
  "artifacts": {
    "provenance": {
      "repository": "git+ssh://repo/core/agents/data_retrieval_agent.py",
      "commit_sha": "a1b2c3d4e5f6g7h8i9j0",
      "docstring_hash": "sha256:d8c4b12389a..."
    },
    "extracted_capabilities": [],
    "core_logic_signatures": [
      {
        "name": "__init__",
        "ast_hash": "sha256:42e03c7542b80e72",
        "loc": 21,
        "source": "def __init__(self, config: Dict[str, Any], **kwargs):\n        super().__init__(config, **kwargs)\n        self.persona = self.config.get('persona', \"Data Retrieval Specialist\")\n        self.description = self.config.get(\n            'description', \"Retrieves data from various configured sources based on structured requests.\")\n        self.expertise = self.config.get('expertise', [\"data access\", \"file retrieval\", \"knowledge base query\"])\n\n        self.risk_ratings_path = self.config.get('risk_ratings_file_path', 'data/risk_rating_mapping.json')\n        self.market_baseline_path = self.config.get('market_baseline_file_path', 'data/adam_market_baseline.json')\n        \n        if 'knowledge_base' in self.config:\n            self.knowledge_base = self.config['knowledge_base']\n        else:\n            try:\n                self.knowledge_base = KnowledgeBase()\n            except Exception as e:\n                logging.error(f\"Failed to initialize KnowledgeBase in DataRetrievalAgent: {e}\")\n                self.knowledge_base = None\n\n        # Initialize the Live Data Connector\n        self.data_fetcher = DataFetcher()"
      },
      {
        "name": "execute",
        "ast_hash": "sha256:617b6d644f93ce30",
        "loc": 45,
        "source_omitted_for_brevity": true,
        "note": "In a real telemetry pipeline, large functions can be truncated or omitted entirely in favor of the 'ast_hash' to save network bandwidth and storage costs."
      },
      {
        "name": "_get_company_financial_data",
        "ast_hash": "sha256:59bad4d66e389705",
        "loc": 9,
        "source": "def _get_company_financial_data(self, company_id: str) -> Optional[Dict[str, Any]]:\n        \"\"\"\n        Retrieves company financial data. Uses live data if possible, falls back to mock for testing.\n        \"\"\"\n        if company_id == \"ABC_TEST\":\n            return self._get_mock_abc_test_data()\n\n        # Use Live Data Fetcher\n        return self._fetch_real_company_data(company_id)"
      },
      {
        "name": "_fetch_real_company_data",
        "ast_hash": "sha256:89bd5df3405b6b87",
        "loc": 125,
        "source_omitted_for_brevity": true,
        "note": "In a real telemetry pipeline, large functions can be truncated or omitted entirely in favor of the 'ast_hash' to save network bandwidth and storage costs."
      },
      {
        "name": "_get_mock_abc_test_data",
        "ast_hash": "sha256:aa3ed0f59dd533d6",
        "loc": 81,
        "source_omitted_for_brevity": true,
        "note": "In a real telemetry pipeline, large functions can be truncated or omitted entirely in favor of the 'ast_hash' to save network bandwidth and storage costs."
      },
      {
        "name": "get_risk_rating",
        "ast_hash": "sha256:c5ded82ccbc0623b",
        "loc": 22,
        "source": "def get_risk_rating(self, company_id: str) -> Optional[str]:\n        logging.info(f\"Attempting to retrieve risk rating for company_id: {company_id} from {self.risk_ratings_path}\")\n        try:\n            source_config = {'type': 'json', 'path': self.risk_ratings_path}\n            data = load_data(source_config, cache=False)\n            if data and isinstance(data, dict):\n                rating = data.get(company_id)\n                if rating is None:\n                    logging.warning(f\"Risk rating for company_id '{company_id}' not found in {self.risk_ratings_path}.\")\n                    raise DataNotFoundError(data_identifier=company_id, source=self.risk_ratings_path)\n                return rating\n            else:\n                logging.error(f\"Failed to load risk ratings data from {self.risk_ratings_path}\")\n                return None\n        except FileReadError as e:\n            logging.error(f\"FileReadError while reading risk ratings: {e}\")\n            return None\n        except DataNotFoundError:\n            raise\n        except Exception as e:\n            logging.exception(f\"Unexpected error in get_risk_rating for {company_id}: {e}\")\n            return None"
      },
      {
        "name": "get_market_data",
        "ast_hash": "sha256:5b485de49dd9f205",
        "loc": 14,
        "source": "def get_market_data(self) -> Optional[Dict[str, Any]]:\n        logging.info(f\"Attempting to retrieve market data from {self.market_baseline_path}\")\n        try:\n            source_config = {'type': 'json', 'path': self.market_baseline_path}\n            market_data = load_data(source_config, cache=False)\n            if market_data is None:\n                logging.error(f\"Failed to load market data from {self.market_baseline_path}.\")\n            return market_data\n        except FileReadError as e:\n            logging.error(f\"FileReadError while reading market data: {e}\")\n            return None\n        except Exception as e:\n            logging.exception(f\"Unexpected error in get_market_data: {e}\")\n            return None"
      },
      {
        "name": "access_knowledge_base",
        "ast_hash": "sha256:d10571373b2c9760",
        "loc": 11,
        "source": "def access_knowledge_base(self, query: str) -> Optional[str]:\n        if self.knowledge_base:\n            try:\n                logging.info(f\"Querying KnowledgeBase with: {query}\")\n                return self.knowledge_base.query(query)\n            except Exception as e:\n                logging.error(f\"Error accessing Knowledge Base: {e}\")\n                return None\n        else:\n            logging.warning(\"KnowledgeBase is not initialized in DataRetrievalAgent.\")\n            return None"
      },
      {
        "name": "access_knowledge_graph",
        "ast_hash": "sha256:dcc5ed6bfbc77cf1",
        "loc": 3,
        "source": "def access_knowledge_graph(self, query: str) -> str:\n        logging.warning(\"Knowledge Graph access is not yet implemented. Query: {query}\")\n        return \"Knowledge Graph access is not yet implemented.\""
      },
      {
        "name": "receive_message",
        "ast_hash": "sha256:7ed112c4c5ad8722",
        "loc": 3,
        "source": "async def receive_message(self, sender_agent: str, message: Dict[str, Any]) -> Optional[Any]:\n        logging.info(f\"DataRetrievalAgent received message from {sender_agent}: {message}\")\n        return await self.execute(request=message)"
      },
      {
        "name": "_save_to_cache",
        "ast_hash": "sha256:bfd3b7c97bb34eb5",
        "loc": 9,
        "source": "def _save_to_cache(self, company_id: str, data: Dict[str, Any]):\n        try:\n            cache_dir = \"data/cache\"\n            os.makedirs(cache_dir, exist_ok=True)\n            file_path = f\"{cache_dir}/{company_id}_financials.json\"\n            with open(file_path, 'w') as f:\n                json.dump(data, f, indent=2)\n        except Exception as e:\n            logging.warning(f\"Failed to cache data for {company_id}: {e}\")"
      },
      {
        "name": "_load_from_cache",
        "ast_hash": "sha256:cab5b4ee469c11c0",
        "loc": 12,
        "source": "def _load_from_cache(self, company_id: str) -> Optional[Dict[str, Any]]:\n        try:\n            file_path = f\"data/cache/{company_id}_financials.json\"\n            if os.path.exists(file_path):\n                logging.info(f\"Loading cached data for {company_id} from {file_path}\")\n                with open(file_path, 'r') as f:\n                    data = json.load(f)\n                    data['source'] = 'cache'\n                    return data\n        except Exception as e:\n            logging.warning(f\"Failed to load cache for {company_id}: {e}\")\n        return None"
      }
    ]
  }
}