{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "$id": "https://miruntime.com/downloads/miruntime-run-lifecycle.schema.json",
  "title": "MiRuntime Run Lifecycle",
  "description": "Conceptual closed contract for durable run identity, lifecycle state, sequence, concurrency, and UTC update time.",
  "x-miruntime": {
    "artifactVersion": "2.8.1",
    "editorialStatus": "Conceptual reference",
    "reviewedAtUtc": "2026-06-24T00:00:00Z",
    "disclaimer": "Conceptual MiRuntime editorial reference. This is not a product SDK, certification profile, or industry standard.",
    "description": "Conceptual closed contract for durable run identity, lifecycle state, sequence, concurrency, and UTC update time."
  },
  "required": [
    "schemaVersion",
    "editorialStatus",
    "description",
    "reviewedAtUtc",
    "disclaimer",
    "runId",
    "state",
    "sequence",
    "updatedAtUtc",
    "concurrencyToken"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0"
    },
    "editorialStatus": {
      "type": "string",
      "const": "Conceptual reference"
    },
    "description": {
      "type": "string",
      "minLength": 1
    },
    "reviewedAtUtc": {
      "type": "string",
      "format": "date-time",
      "pattern": "Z$"
    },
    "disclaimer": {
      "type": "string",
      "minLength": 1
    },
    "runId": {
      "type": "string",
      "minLength": 1
    },
    "state": {
      "type": "string",
      "enum": [
        "created",
        "provisioning",
        "running",
        "awaiting_approval",
        "recovering",
        "completed",
        "failed",
        "terminated"
      ]
    },
    "sequence": {
      "type": "integer",
      "minimum": 0
    },
    "updatedAtUtc": {
      "type": "string",
      "format": "date-time",
      "pattern": "Z$"
    },
    "concurrencyToken": {
      "type": "string",
      "minLength": 1
    },
    "objective": {
      "type": "string",
      "minLength": 1
    },
    "checkpointId": {
      "type": [
        "string",
        "null"
      ]
    },
    "terminalReason": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}
