{
  "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": "AdaptiveAlgoTradingAgent",
    "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": 4,
    "agent.capabilities.count": 0
  },
  "artifacts": {
    "provenance": {
      "repository": "git+ssh://repo/core/agents/adaptive_algo_agent.py",
      "commit_sha": "a1b2c3d4e5f6g7h8i9j0",
      "docstring_hash": "sha256:d8c4b12389a..."
    },
    "extracted_capabilities": [],
    "core_logic_signatures": [
      {
        "name": "__init__",
        "ast_hash": "sha256:9a8dadcb23ee4013",
        "loc": 21,
        "source": "def __init__(self, data: pd.DataFrame, strategies=None, initial_balance=10000,\n                 learning_rate=0.1, discount_factor=0.95, epsilon=1.0):\n        super().__init__({\"strategies\": strategies, \"initial_balance\": initial_balance})\n        self.data = data\n\n        # Define actions: 0=Momentum, 1=Mean Reversion, 2=Arbitrage (simulated)\n        self.action_space = len(self.strategies)\n\n        # Define state space size (e.g., 3 regimes: Low/Med/High Volatility)\n        # Simplified: We map market volatility to an integer state.\n        self.state_space = 3\n\n        self.learner = QLearningAgent(\n            state_size=self.state_space,\n            action_size=self.action_space,\n            learning_rate=learning_rate,\n            discount_factor=discount_factor,\n            exploration_rate=epsilon\n        )\n        self.memory = LearningMemory()\n        self.episode_rewards = []"
      },
      {
        "name": "get_market_state",
        "ast_hash": "sha256:d78f62bb2054c0fb",
        "loc": 21,
        "source": "def get_market_state(self, current_idx: int, lookback: int = 20) -> int:\n        \"\"\"\n        Discretize market state based on recent volatility.\n        Returns:\n            0: Low Volatility (Stable)\n            1: Medium Volatility (Normal)\n            2: High Volatility (Choppy)\n        \"\"\"\n        if current_idx < lookback:\n            return 1 # Default to Normal\n\n        recent_prices = self.data['Close'][current_idx-lookback:current_idx]\n        volatility = recent_prices.std()\n\n        # Simple thresholds (these should be tuned or dynamic in a real system)\n        if volatility < 2.0:\n            return 0\n        elif volatility < 5.0:\n            return 1\n        else:\n            return 2"
      },
      {
        "name": "run_adaptive_simulation",
        "ast_hash": "sha256:510500216cfc1b66",
        "loc": 72,
        "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_optimal_strategy",
        "ast_hash": "sha256:76db19ce822c4f85",
        "loc": 4,
        "source": "def get_optimal_strategy(self, current_volatility_state: int) -> str:\n        \"\"\"Returns the learned best strategy for a given volatility state.\"\"\"\n        action = np.argmax(self.learner.get_q_values(current_volatility_state))\n        return self.strategies[action]"
      }
    ]
  }
}