{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/DY-2026/GameDesignOS/main/contracts/experiment-plan.schema.json",
  "title": "GameDesignOS v1 Experiment Plan",
  "type": "object",
  "required": [
    "schema_version",
    "experiment_id",
    "title",
    "target_decision",
    "target_assumptions",
    "hypothesis",
    "method",
    "success_criteria",
    "failure_criteria",
    "result_status"
  ],
  "additionalProperties": false,
  "properties": {
    "schema_version": { "type": "string", "const": "1.0.0" },
    "experiment_id": { "type": "string", "pattern": "^EXP-[A-Z0-9-]{3,}$" },
    "title": { "type": "string", "minLength": 1 },
    "target_decision": { "type": "string", "pattern": "^DEC-[A-Z0-9-]{3,}$" },
    "target_assumptions": {
      "type": "array",
      "items": { "type": "string", "pattern": "^ASM-[A-Z0-9-]{3,}$" },
      "uniqueItems": true
    },
    "hypothesis": { "type": "string", "minLength": 1 },
    "method": { "type": "string", "minLength": 1 },
    "sample_size": { "type": ["integer", "null"], "minimum": 1 },
    "success_criteria": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string", "minLength": 1 }
    },
    "failure_criteria": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string", "minLength": 1 }
    },
    "result_status": {
      "enum": ["planned", "running", "completed", "reviewed", "failed", "inconclusive", "cancelled"]
    },
    "review_status": { "enum": ["draft", "reviewed", "accepted", "rejected"] }
  }
}
