{
  "feature": "websocket-communication",
  "version": "1.0.0",
  "description": "WebSocket protocol for real-time communication",
  "category": "integration",
  "tags": [
    "integration",
    "godot"
  ],
  "actors": [
    {
      "id": "game_engine",
      "name": "Godot Engine",
      "type": "system"
    }
  ],
  "outcomes": {
    "websocket_server": {
      "given": [
        "Listen for connections is requested"
      ],
      "then": [
        {
          "action": "transition_state",
          "field": "status",
          "from": "idle",
          "to": "active"
        }
      ],
      "result": "Listen for connections completed",
      "priority": 1
    },
    "websocket_client": {
      "given": [
        "Connect to server is requested"
      ],
      "then": [
        {
          "action": "transition_state",
          "field": "status",
          "from": "idle",
          "to": "active"
        }
      ],
      "result": "Connect to server completed",
      "priority": 2
    },
    "message_exchange": {
      "given": [
        "Send and receive text/binary data is requested"
      ],
      "then": [
        {
          "action": "transition_state",
          "field": "status",
          "from": "idle",
          "to": "active"
        }
      ],
      "result": "Send and receive text/binary data completed",
      "priority": 3
    }
  },
  "rules": {
    "implementation": {
      "description": "Feature implemented in C++ engine core"
    },
    "platform_agnostic": {
      "description": "Works across desktop, web, mobile platforms"
    }
  },
  "related": [],
  "agi": {
    "goals": [
      {
        "id": "reliable_websocket_communication",
        "description": "WebSocket protocol for real-time communication",
        "success_metrics": [
          {
            "metric": "success_rate",
            "target": ">= 99.5%",
            "measurement": "Successful operations divided by total attempts"
          },
          {
            "metric": "error_recovery_rate",
            "target": ">= 95%",
            "measurement": "Errors that auto-recover without manual intervention"
          }
        ],
        "constraints": [
          {
            "type": "availability",
            "description": "Must degrade gracefully when dependencies are unavailable",
            "negotiable": false
          }
        ]
      }
    ],
    "autonomy": {
      "level": "supervised"
    },
    "safety": {
      "action_permissions": [
        {
          "action": "websocket_server",
          "permission": "autonomous"
        },
        {
          "action": "websocket_client",
          "permission": "autonomous"
        },
        {
          "action": "message_exchange",
          "permission": "supervised"
        }
      ]
    },
    "tradeoffs": [
      {
        "prefer": "reliability",
        "over": "throughput",
        "reason": "integration failures can cascade across systems"
      }
    ]
  },
  "extensions": {
    "tech_stack": {
      "language": "C++",
      "runtime": "Godot 4.x"
    }
  }
}