{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://nmdvcell.com/resource/api/v2/experiment_plan.schema.json",
  "title": "NMD-VCell Experiment Plan Object",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "plan_id",
    "version",
    "lifecycle_track",
    "overall_state",
    "source_answer_id",
    "source_answer_sha256",
    "study_card_id",
    "study_card_path",
    "study_card_source_sha256",
    "question",
    "execution_authorized",
    "registration_ready",
    "prediction_required",
    "gate_summary",
    "gates",
    "design_contract",
    "unresolved_decisions",
    "outcome_slot",
    "claim_ceiling",
    "does_not_imply",
    "generated_by",
    "is_new_scientific_claim",
    "experiment_plan_sha256"
  ],
  "properties": {
    "plan_id": {
      "type": "string",
      "pattern": "^EXPERIMENT-PLAN:"
    },
    "version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
    },
    "lifecycle_track": {
      "const": "TRUTH_GENERATION"
    },
    "overall_state": {
      "const": "DRAFT_BLOCKED_OPEN_NUMERIC_AND_AUTHORITY_GATES"
    },
    "source_answer_id": {
      "type": "string",
      "pattern": "^ANSWER:"
    },
    "source_answer_sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "study_card_id": {
      "type": "string",
      "pattern": "^SC:"
    },
    "study_card_path": {
      "type": "string",
      "pattern": "^/resource/study-card/"
    },
    "study_card_source_sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "question": {
      "type": "object"
    },
    "execution_authorized": {
      "const": false
    },
    "registration_ready": {
      "const": false
    },
    "prediction_required": {
      "const": false
    },
    "gate_summary": {
      "type": "object",
      "required": [
        "ready",
        "partial",
        "open",
        "total"
      ],
      "properties": {
        "ready": {
          "type": "integer",
          "minimum": 0
        },
        "partial": {
          "type": "integer",
          "minimum": 0
        },
        "open": {
          "type": "integer",
          "minimum": 0
        },
        "total": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "gates": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "gate_id",
          "label",
          "class",
          "state",
          "source",
          "requirement"
        ],
        "properties": {
          "gate_id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "class": {
            "enum": [
              "READY",
              "PARTIAL",
              "OPEN"
            ]
          },
          "state": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "requirement": {
            "type": "string"
          }
        }
      }
    },
    "design_contract": {
      "type": "object"
    },
    "unresolved_decisions": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "outcome_slot": {
      "type": "object",
      "required": [
        "ledger_path",
        "state",
        "measured_outcome_count"
      ]
    },
    "claim_ceiling": {
      "const": "EXPERIMENT_DESIGN_ONLY"
    },
    "does_not_imply": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "generated_by": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "is_new_scientific_claim": {
      "const": false
    },
    "experiment_plan_sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    }
  }
}
