{
  "feature": "gamepad-input",
  "version": "1.0.0",
  "description": "Joystick/gamepad input and haptic feedback",
  "category": "integration",
  "tags": [
    "integration",
    "godot"
  ],
  "actors": [
    {
      "id": "game_engine",
      "name": "Godot Engine",
      "type": "system"
    }
  ],
  "outcomes": {
    "device_detection": {
      "given": [
        "Enumerate connected gamepads is requested"
      ],
      "then": [
        {
          "action": "transition_state",
          "field": "status",
          "from": "idle",
          "to": "active"
        }
      ],
      "result": "Enumerate connected gamepads completed",
      "priority": 1
    },
    "axis_input": {
      "given": [
        "Read analog stick/trigger values is requested"
      ],
      "then": [
        {
          "action": "transition_state",
          "field": "status",
          "from": "idle",
          "to": "active"
        }
      ],
      "result": "Read analog stick/trigger values completed",
      "priority": 2
    },
    "button_input": {
      "given": [
        "Detect gamepad button presses is requested"
      ],
      "then": [
        {
          "action": "transition_state",
          "field": "status",
          "from": "idle",
          "to": "active"
        }
      ],
      "result": "Detect gamepad button presses completed",
      "priority": 3
    },
    "vibration": {
      "given": [
        "Send haptic feedback to device is requested"
      ],
      "then": [
        {
          "action": "transition_state",
          "field": "status",
          "from": "idle",
          "to": "active"
        }
      ],
      "result": "Send haptic feedback to device completed",
      "priority": 4
    },
    "device_mapping": {
      "given": [
        "Standardized input mapping is requested"
      ],
      "then": [
        {
          "action": "transition_state",
          "field": "status",
          "from": "idle",
          "to": "active"
        }
      ],
      "result": "Standardized input mapping completed",
      "priority": 5
    }
  },
  "rules": {
    "implementation": {
      "description": "Feature implemented in C++ engine core"
    },
    "platform_agnostic": {
      "description": "Works across desktop, web, mobile platforms"
    }
  },
  "related": [],
  "agi": {
    "goals": [
      {
        "id": "reliable_gamepad_input",
        "description": "Joystick/gamepad input and haptic feedback",
        "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": "device_detection",
          "permission": "autonomous"
        },
        {
          "action": "axis_input",
          "permission": "autonomous"
        },
        {
          "action": "button_input",
          "permission": "autonomous"
        },
        {
          "action": "vibration",
          "permission": "autonomous"
        },
        {
          "action": "device_mapping",
          "permission": "autonomous"
        }
      ]
    },
    "tradeoffs": [
      {
        "prefer": "reliability",
        "over": "throughput",
        "reason": "integration failures can cascade across systems"
      }
    ]
  },
  "extensions": {
    "tech_stack": {
      "language": "C++",
      "runtime": "Godot 4.x"
    }
  }
}