{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Minecraft Ops Training Example",
  "type": "object",
  "required": ["id", "source", "category", "input", "output"],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier (UUID or sequential)"
    },
    "source": {
      "type": "string",
      "enum": ["repair_pattern", "prayer_log", "sudo_log", "bug_report", "session_history", "manual", "synthetic"],
      "description": "Where this example was extracted from"
    },
    "category": {
      "type": "string",
      "enum": ["command_gen", "troubleshoot", "info", "safety", "negative"],
      "description": "Task category for evaluation bucketing"
    },
    "input": {
      "type": "object",
      "required": ["user_message"],
      "properties": {
        "user_message": {
          "type": "string",
          "description": "The player request or prompt"
        },
        "server_context": {
          "type": "object",
          "properties": {
            "server_type": { "type": "string", "enum": ["vanilla", "paper"] },
            "version": { "type": "string" },
            "online_players": { "type": "array", "items": { "type": "string" } },
            "player_position": {
              "type": "object",
              "properties": {
                "x": { "type": "number" },
                "y": { "type": "number" },
                "z": { "type": "number" }
              }
            },
            "recent_log_lines": { "type": "array", "items": { "type": "string" } }
          }
        }
      }
    },
    "output": {
      "type": "object",
      "required": ["commands"],
      "properties": {
        "reasoning": {
          "type": "string",
          "description": "Chain-of-thought explanation of why these commands are correct"
        },
        "commands": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Correct RCON commands (no leading slash)"
        },
        "message": {
          "type": "string",
          "description": "Response text to player (for god mode; empty for sudo)"
        },
        "safety_flags": {
          "type": "array",
          "items": { "type": "string", "enum": ["destructive", "teleport", "op_required", "affects_all_players"] },
          "description": "Safety annotations for command validation"
        }
      }
    },
    "negative_output": {
      "type": "object",
      "description": "What the model ACTUALLY produced (wrong). Present only in negative/repair examples.",
      "properties": {
        "commands": {
          "type": "array",
          "items": { "type": "string" }
        },
        "error": {
          "type": "string",
          "description": "Why the original output was wrong"
        }
      }
    },
    "metadata": {
      "type": "object",
      "properties": {
        "difficulty": { "type": "string", "enum": ["easy", "medium", "hard"] },
        "validated": { "type": "boolean" },
        "extracted_from": { "type": "string", "description": "Source file and line/function reference" },
        "risk_level": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5,
          "description": "Command risk gradient: 0=blocked (server crash/privesc), 1=refuse (mass harm), 2=warn+allow (self-destructive/risky), 3=normal (standard commands), 4=generous (creative/admin), 5=unrestricted (raw passthrough)"
        },
        "scoring_mode": {
          "type": "string",
          "enum": ["strict", "soft"],
          "description": "Eval scoring mode: strict for sudo (exact match), soft for pray/god (category match, in-character)"
        }
      }
    }
  }
}
