{
  "$comment": "All four model ID arrays are equal and each action is derived from its durable MSSQL outcome.",
  "$id": "https://dpone.dev/schemas/dpone.semantic-refresh-workflow-replacement-plan.v1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "expected_model_outcome_ids": {
      "items": {
        "minLength": 1,
        "type": "string"
      },
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "model_operation_plan_ids": {
      "items": {
        "minLength": 1,
        "type": "string"
      },
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "predecessor_workflow_execution_binding_sha256": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "type": "string"
    },
    "predecessor_workflow_execution_id": {
      "minLength": 1,
      "type": "string"
    },
    "predecessor_workflow_summary_sha256": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "type": "string"
    },
    "recovery_plan_digest": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "type": "string"
    },
    "replacement_action_ids": {
      "items": {
        "minLength": 1,
        "type": "string"
      },
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "replacement_actions": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "enum": [
              "RESTORE_THEN_REBUILD",
              "BUILD_FRESH",
              "BLOCK"
            ],
            "type": "string"
          },
          "action_id": {
            "minLength": 1,
            "type": "string"
          },
          "outcome": {
            "enum": [
              "NOT_INVOKED",
              "ROLLED_BACK",
              "COMMITTED_WITH_IMAGES",
              "COMMIT_UNKNOWN"
            ],
            "type": "string"
          }
        },
        "required": [
          "action",
          "action_id",
          "outcome"
        ],
        "type": "object"
      },
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "schema": {
      "const": "dpone.semantic-refresh-workflow-replacement-plan.v1"
    },
    "selected_mutating_node_ids": {
      "items": {
        "minLength": 1,
        "type": "string"
      },
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "workflow_mode": {
      "const": "failed_precommit_replacement"
    },
    "workflow_plan_sha256": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "type": "string"
    },
    "workflow_replacement_plan_sha256": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "type": "string"
    }
  },
  "required": [
    "expected_model_outcome_ids",
    "model_operation_plan_ids",
    "predecessor_workflow_execution_binding_sha256",
    "predecessor_workflow_execution_id",
    "predecessor_workflow_summary_sha256",
    "recovery_plan_digest",
    "replacement_action_ids",
    "replacement_actions",
    "schema",
    "selected_mutating_node_ids",
    "workflow_mode",
    "workflow_plan_sha256",
    "workflow_replacement_plan_sha256"
  ],
  "type": "object"
}
