{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:awoooi:agent-candidate-replay-result-v1",
  "title": "AWOOOI Agent Candidate Replay Result (v1)",
  "type": "object",
  "required": [
    "schema_version",
    "run_id",
    "incident_id",
    "candidate_id",
    "proposed_action",
    "risk_level",
    "requires_human_approval",
    "trace_complete",
    "trace_events",
    "latency_ms",
    "cost_usd"
  ],
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "agent_candidate_replay_result_v1"
    },
    "run_id": {
      "type": "string",
      "minLength": 1
    },
    "incident_id": {
      "type": "string",
      "minLength": 1
    },
    "candidate_id": {
      "type": "string",
      "minLength": 1
    },
    "candidate_role": {
      "type": "string"
    },
    "proposed_action": {
      "type": "string"
    },
    "action_plan": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "risk_level": {
      "type": "string",
      "enum": ["low", "medium", "high", "critical"]
    },
    "requires_human_approval": {
      "type": "boolean"
    },
    "blocked_by_policy": {
      "type": "boolean",
      "default": false
    },
    "fallback_used": {
      "type": "boolean",
      "default": false
    },
    "trace_complete": {
      "type": "boolean"
    },
    "trace_events": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "rca_correct": {
      "type": ["boolean", "null"]
    },
    "tool_dry_run_pass": {
      "type": ["boolean", "null"]
    },
    "repair_success": {
      "type": ["boolean", "null"]
    },
    "false_repair": {
      "type": "boolean",
      "default": false
    },
    "latency_ms": {
      "type": "number",
      "minimum": 0
    },
    "cost_usd": {
      "type": "number",
      "minimum": 0
    },
    "error": {
      "type": ["string", "null"]
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    }
  },
  "additionalProperties": false
}
