{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:aiws:handoff:1",
  "title": "AIWS handoff/1 — M1 candidate, not a released SDK wire schema",
  "oneOf": [
    {
      "$ref": "#/$defs/Manifest"
    },
    {
      "$ref": "#/$defs/Delivery"
    },
    {
      "$ref": "#/$defs/Consumption"
    },
    {
      "$ref": "#/$defs/Hold"
    },
    {
      "$ref": "#/$defs/Summary"
    },
    {
      "$ref": "#/$defs/Command"
    },
    {
      "$ref": "#/$defs/Invalidation"
    }
  ],
  "$defs": {
    "Id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "UInt": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]{0,99})$"
    },
    "Positive": {
      "type": "string",
      "pattern": "^[1-9][0-9]{0,99}$"
    },
    "Digest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "Ref": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "revision": {
          "$ref": "#/$defs/UInt"
        }
      },
      "required": [
        "id",
        "revision"
      ],
      "additionalProperties": false
    },
    "HandoffRef": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "required": [
        "id",
        "digest"
      ],
      "additionalProperties": false
    },
    "OperationRef": {
      "type": "object",
      "properties": {
        "operationId": {
          "$ref": "#/$defs/Id"
        },
        "attemptId": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "operationId",
        "attemptId"
      ],
      "additionalProperties": false
    },
    "DeliveryRef": {
      "type": "object",
      "properties": {
        "deliveryId": {
          "$ref": "#/$defs/Id"
        },
        "handoff": {
          "$ref": "#/$defs/HandoffRef"
        }
      },
      "required": [
        "deliveryId",
        "handoff"
      ],
      "additionalProperties": false
    },
    "Basis": {
      "type": "object",
      "properties": {
        "revision": {
          "$ref": "#/$defs/UInt"
        },
        "eventHash": {
          "$ref": "#/$defs/Digest"
        }
      },
      "required": [
        "revision",
        "eventHash"
      ],
      "additionalProperties": false
    },
    "Producer": {
      "type": "object",
      "properties": {
        "missionId": {
          "$ref": "#/$defs/Id"
        },
        "runId": {
          "$ref": "#/$defs/Id"
        },
        "nodeId": {
          "$ref": "#/$defs/Id"
        },
        "activationId": {
          "$ref": "#/$defs/Id"
        },
        "graph": {
          "$ref": "#/$defs/Ref"
        },
        "plan": {
          "$ref": "#/$defs/Ref"
        },
        "operations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OperationRef"
          },
          "minItems": 0
        }
      },
      "required": [
        "missionId",
        "runId",
        "nodeId",
        "activationId",
        "graph",
        "plan",
        "operations"
      ],
      "additionalProperties": false
    },
    "Recipient": {
      "type": "object",
      "properties": {
        "deliveryId": {
          "$ref": "#/$defs/Id"
        },
        "nodeId": {
          "$ref": "#/$defs/Id"
        },
        "activationId": {
          "$ref": "#/$defs/Id"
        },
        "inputPort": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "deliveryId",
        "nodeId",
        "activationId",
        "inputPort"
      ],
      "additionalProperties": false
    },
    "Artifact": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "locator": {
          "$ref": "#/$defs/Id"
        },
        "version": {
          "$ref": "#/$defs/Id"
        },
        "sha256": {
          "$ref": "#/$defs/Digest"
        },
        "sizeBytes": {
          "$ref": "#/$defs/UInt"
        },
        "mediaType": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "schema": {
          "anyOf": [
            {
              "$ref": "#/$defs/HandoffRef"
            },
            {
              "type": "null"
            }
          ]
        },
        "retentionOwner": {
          "$ref": "#/$defs/Id"
        },
        "retainUntilMs": {
          "$ref": "#/$defs/UInt"
        }
      },
      "required": [
        "id",
        "locator",
        "version",
        "sha256",
        "sizeBytes",
        "mediaType",
        "schema",
        "retentionOwner",
        "retainUntilMs"
      ],
      "additionalProperties": false
    },
    "Blocker": {
      "type": "object",
      "properties": {
        "code": {
          "enum": [
            "UNCERTAIN_EFFECT",
            "ATTEMPT_LIMIT",
            "COST_LIMIT",
            "TIME_LIMIT",
            "ARTIFACT_UNAVAILABLE",
            "ARTIFACT_MISMATCH",
            "INPUT_INCOMPATIBLE",
            "BASIS_STALE",
            "INVALIDATED",
            "MANUAL",
            "RESTART_APPROVAL"
          ]
        },
        "subjectId": {
          "$ref": "#/$defs/Id"
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Ref"
          },
          "minItems": 0
        }
      },
      "required": [
        "code",
        "subjectId",
        "evidenceRefs"
      ],
      "additionalProperties": false
    },
    "Controls": {
      "type": "object",
      "properties": {
        "policy": {
          "$ref": "#/$defs/Ref"
        },
        "approvals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Ref"
          },
          "minItems": 0
        },
        "accounting": {
          "$ref": "#/$defs/Ref"
        }
      },
      "required": [
        "policy",
        "approvals",
        "accounting"
      ],
      "additionalProperties": false
    },
    "Scope": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "revision": {
          "$ref": "#/$defs/UInt"
        },
        "kind": {
          "enum": [
            "RUN",
            "BRANCH",
            "WORK_ORDER"
          ]
        }
      },
      "required": [
        "id",
        "revision",
        "kind"
      ],
      "additionalProperties": false
    },
    "Member": {
      "type": "object",
      "properties": {
        "missionId": {
          "$ref": "#/$defs/Id"
        },
        "runId": {
          "$ref": "#/$defs/Id"
        },
        "coverage": {
          "enum": [
            "ALL_NODES",
            "NODE_SET"
          ]
        },
        "nodeIds": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          },
          "minItems": 0,
          "uniqueItems": true
        }
      },
      "required": [
        "missionId",
        "runId",
        "coverage",
        "nodeIds"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "coverage": {
                "const": "ALL_NODES"
              }
            }
          },
          "then": {
            "properties": {
              "nodeIds": {
                "maxItems": 0
              }
            }
          },
          "else": {
            "properties": {
              "nodeIds": {
                "minItems": 1
              }
            }
          }
        }
      ]
    },
    "Decision": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "actorId": {
          "$ref": "#/$defs/Id"
        },
        "actorKind": {
          "enum": [
            "HUMAN",
            "RULE"
          ]
        },
        "policy": {
          "$ref": "#/$defs/Ref"
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Ref"
          },
          "minItems": 1
        },
        "atMs": {
          "$ref": "#/$defs/UInt"
        }
      },
      "required": [
        "id",
        "actorId",
        "actorKind",
        "policy",
        "evidenceRefs",
        "atMs"
      ],
      "additionalProperties": false
    },
    "Manifest": {
      "type": "object",
      "properties": {
        "protocol": {
          "const": "aiws-handoff/1"
        },
        "handoffId": {
          "$ref": "#/$defs/Id"
        },
        "checkpointId": {
          "$ref": "#/$defs/Id"
        },
        "basis": {
          "$ref": "#/$defs/Basis"
        },
        "producer": {
          "$ref": "#/$defs/Producer"
        },
        "outcome": {
          "enum": [
            "COMPLETED",
            "SKIPPED",
            "BLOCKED",
            "FAILED",
            "CANCELED"
          ]
        },
        "result": {
          "type": "object"
        },
        "inputs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DeliveryRef"
          },
          "minItems": 0
        },
        "recipients": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Recipient"
          },
          "minItems": 0
        },
        "artifacts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Artifact"
          },
          "minItems": 0
        },
        "criterionRefs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Ref"
          },
          "minItems": 0
        },
        "outstandingEffects": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OperationRef"
          },
          "minItems": 0
        },
        "blockers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Blocker"
          },
          "minItems": 0
        },
        "controls": {
          "$ref": "#/$defs/Controls"
        },
        "resume": {
          "type": "object",
          "properties": {
            "checkpointRef": {
              "$ref": "#/$defs/Ref"
            },
            "eligibleNodeIds": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Id"
              },
              "minItems": 0,
              "uniqueItems": true
            },
            "requiredChecks": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Id"
              },
              "minItems": 1,
              "uniqueItems": true
            }
          },
          "required": [
            "checkpointRef",
            "eligibleNodeIds",
            "requiredChecks"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "protocol",
        "handoffId",
        "checkpointId",
        "basis",
        "producer",
        "outcome",
        "result",
        "inputs",
        "recipients",
        "artifacts",
        "criterionRefs",
        "outstandingEffects",
        "blockers",
        "controls",
        "resume"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "outcome": {
                "const": "BLOCKED"
              }
            }
          },
          "then": {
            "properties": {
              "blockers": {
                "minItems": 1
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "outcome": {
                "const": "COMPLETED"
              }
            }
          },
          "then": {
            "properties": {
              "outstandingEffects": {
                "maxItems": 0
              },
              "blockers": {
                "maxItems": 0
              }
            }
          }
        }
      ]
    },
    "Claim": {
      "type": "object",
      "properties": {
        "actorId": {
          "$ref": "#/$defs/Id"
        },
        "tokenHash": {
          "$ref": "#/$defs/Digest"
        },
        "generation": {
          "$ref": "#/$defs/Positive"
        },
        "ownerEpoch": {
          "$ref": "#/$defs/UInt"
        },
        "expiresAtMs": {
          "$ref": "#/$defs/UInt"
        }
      },
      "required": [
        "actorId",
        "tokenHash",
        "generation",
        "ownerEpoch",
        "expiresAtMs"
      ],
      "additionalProperties": false
    },
    "Delivery": {
      "type": "object",
      "properties": {
        "protocol": {
          "const": "aiws-handoff/1"
        },
        "deliveryId": {
          "$ref": "#/$defs/Id"
        },
        "handoff": {
          "$ref": "#/$defs/HandoffRef"
        },
        "missionId": {
          "$ref": "#/$defs/Id"
        },
        "runId": {
          "$ref": "#/$defs/Id"
        },
        "recipient": {
          "$ref": "#/$defs/Recipient"
        },
        "revision": {
          "$ref": "#/$defs/UInt"
        },
        "state": {
          "enum": [
            "PENDING",
            "CLAIMED",
            "ACKNOWLEDGED",
            "EXCLUDED",
            "INVALIDATED"
          ]
        },
        "generation": {
          "$ref": "#/$defs/UInt"
        },
        "claim": {
          "anyOf": [
            {
              "$ref": "#/$defs/Claim"
            },
            {
              "type": "null"
            }
          ]
        },
        "receiptRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/Ref"
            },
            {
              "type": "null"
            }
          ]
        },
        "invalidationRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/Ref"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "protocol",
        "deliveryId",
        "handoff",
        "missionId",
        "runId",
        "recipient",
        "revision",
        "state",
        "generation",
        "claim",
        "receiptRef",
        "invalidationRef"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "state": {
                "enum": [
                  "CLAIMED",
                  "ACKNOWLEDGED"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "claim": {
                "$ref": "#/$defs/Claim"
              },
              "generation": {
                "$ref": "#/$defs/Positive"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "state": {
                "const": "ACKNOWLEDGED"
              }
            }
          },
          "then": {
            "properties": {
              "receiptRef": {
                "$ref": "#/$defs/Ref"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "state": {
                "const": "INVALIDATED"
              }
            }
          },
          "then": {
            "properties": {
              "invalidationRef": {
                "$ref": "#/$defs/Ref"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "state": {
                "enum": [
                  "PENDING",
                  "CLAIMED",
                  "EXCLUDED"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "receiptRef": {
                "type": "null"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "state": {
                "const": "PENDING"
              }
            }
          },
          "then": {
            "properties": {
              "claim": {
                "type": "null"
              }
            }
          }
        }
      ]
    },
    "Consumption": {
      "type": "object",
      "properties": {
        "protocol": {
          "const": "aiws-handoff/1"
        },
        "consumptionId": {
          "$ref": "#/$defs/Id"
        },
        "missionId": {
          "$ref": "#/$defs/Id"
        },
        "runId": {
          "$ref": "#/$defs/Id"
        },
        "nodeId": {
          "$ref": "#/$defs/Id"
        },
        "activationId": {
          "$ref": "#/$defs/Id"
        },
        "graph": {
          "$ref": "#/$defs/Ref"
        },
        "plan": {
          "$ref": "#/$defs/Ref"
        },
        "inputs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DeliveryRef"
          },
          "minItems": 0
        },
        "operationId": {
          "anyOf": [
            {
              "$ref": "#/$defs/Id"
            },
            {
              "type": "null"
            }
          ]
        },
        "admissionRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/Ref"
            },
            {
              "type": "null"
            }
          ]
        },
        "ownerEpoch": {
          "$ref": "#/$defs/UInt"
        },
        "revision": {
          "$ref": "#/$defs/UInt"
        }
      },
      "required": [
        "protocol",
        "consumptionId",
        "missionId",
        "runId",
        "nodeId",
        "activationId",
        "graph",
        "plan",
        "inputs",
        "operationId",
        "admissionRef",
        "ownerEpoch",
        "revision"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "operationId": {
                "type": "null"
              }
            }
          },
          "then": {
            "properties": {
              "admissionRef": {
                "type": "null"
              }
            }
          },
          "else": {
            "properties": {
              "admissionRef": {
                "$ref": "#/$defs/Ref"
              }
            }
          }
        }
      ]
    },
    "Hold": {
      "type": "object",
      "properties": {
        "protocol": {
          "const": "aiws-handoff/1"
        },
        "holdId": {
          "$ref": "#/$defs/Id"
        },
        "scope": {
          "$ref": "#/$defs/Scope"
        },
        "resolver": {
          "$ref": "#/$defs/Ref"
        },
        "members": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Member"
          },
          "minItems": 1
        },
        "ownerId": {
          "$ref": "#/$defs/Id"
        },
        "state": {
          "enum": [
            "OPEN",
            "RELEASED",
            "CANCELED"
          ]
        },
        "revision": {
          "$ref": "#/$defs/UInt"
        },
        "reason": {
          "$ref": "#/$defs/Blocker"
        },
        "blockers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Blocker"
          },
          "minItems": 1
        },
        "outstandingEffects": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OperationRef"
          },
          "minItems": 0
        },
        "allowedDecisions": {
          "type": "array",
          "items": {
            "enum": [
              "RECHECK",
              "CANCEL"
            ]
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "resolution": {
          "anyOf": [
            {
              "$ref": "#/$defs/Decision"
            },
            {
              "type": "null"
            }
          ]
        },
        "controls": {
          "$ref": "#/$defs/Controls"
        },
        "openedAtMs": {
          "$ref": "#/$defs/UInt"
        }
      },
      "required": [
        "protocol",
        "holdId",
        "scope",
        "resolver",
        "members",
        "ownerId",
        "state",
        "revision",
        "reason",
        "blockers",
        "outstandingEffects",
        "allowedDecisions",
        "resolution",
        "controls",
        "openedAtMs"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "state": {
                "const": "OPEN"
              }
            }
          },
          "then": {
            "properties": {
              "resolution": {
                "type": "null"
              }
            }
          },
          "else": {
            "properties": {
              "resolution": {
                "$ref": "#/$defs/Decision"
              }
            }
          }
        }
      ]
    },
    "Summary": {
      "type": "object",
      "properties": {
        "protocol": {
          "const": "aiws-handoff/1"
        },
        "summaryId": {
          "$ref": "#/$defs/Id"
        },
        "basis": {
          "$ref": "#/$defs/HandoffRef"
        },
        "authorId": {
          "$ref": "#/$defs/Id"
        },
        "generationKind": {
          "enum": [
            "DETERMINISTIC",
            "HUMAN",
            "MODEL"
          ]
        },
        "text": {
          "type": "string",
          "maxLength": 8192
        },
        "operationRef": {
          "anyOf": [
            {
              "$ref": "#/$defs/OperationRef"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "protocol",
        "summaryId",
        "basis",
        "authorId",
        "generationKind",
        "text",
        "operationRef"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "generationKind": {
                "const": "MODEL"
              }
            }
          },
          "then": {
            "properties": {
              "operationRef": {
                "$ref": "#/$defs/OperationRef"
              }
            }
          }
        }
      ]
    },
    "CommandBody": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "commitBoundary"
            },
            "manifest": {
              "$ref": "#/$defs/Manifest"
            },
            "hold": {
              "anyOf": [
                {
                  "$ref": "#/$defs/Hold"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "type",
            "manifest",
            "hold"
          ],
          "additionalProperties": false,
          "allOf": [
            {
              "if": {
                "properties": {
                  "manifest": {
                    "properties": {
                      "outcome": {
                        "const": "BLOCKED"
                      }
                    }
                  }
                }
              },
              "then": {
                "properties": {
                  "hold": {
                    "$ref": "#/$defs/Hold"
                  }
                }
              },
              "else": {
                "properties": {
                  "hold": {
                    "type": "null"
                  }
                }
              }
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "claimDelivery"
            },
            "deliveryId": {
              "$ref": "#/$defs/Id"
            },
            "leaseMs": {
              "$ref": "#/$defs/Positive"
            }
          },
          "required": [
            "type",
            "deliveryId",
            "leaseMs"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "acknowledgeDelivery"
            },
            "deliveryId": {
              "$ref": "#/$defs/Id"
            },
            "generation": {
              "$ref": "#/$defs/Positive"
            },
            "claimToken": {
              "$ref": "#/$defs/Id"
            },
            "handoff": {
              "$ref": "#/$defs/HandoffRef"
            },
            "materialEvidence": {
              "$ref": "#/$defs/Ref"
            }
          },
          "required": [
            "type",
            "deliveryId",
            "generation",
            "claimToken",
            "handoff",
            "materialEvidence"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "releaseDelivery"
            },
            "deliveryId": {
              "$ref": "#/$defs/Id"
            },
            "generation": {
              "$ref": "#/$defs/Positive"
            },
            "claimToken": {
              "$ref": "#/$defs/Id"
            }
          },
          "required": [
            "type",
            "deliveryId",
            "generation",
            "claimToken"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "admitConsumer"
            },
            "consumption": {
              "$ref": "#/$defs/Consumption"
            }
          },
          "required": [
            "type",
            "consumption"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "invalidateHandoff"
            },
            "handoff": {
              "$ref": "#/$defs/HandoffRef"
            },
            "reason": {
              "$ref": "#/$defs/Blocker"
            },
            "evidenceRefs": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Ref"
              },
              "minItems": 1
            },
            "hold": {
              "$ref": "#/$defs/Hold"
            }
          },
          "required": [
            "type",
            "handoff",
            "reason",
            "evidenceRefs",
            "hold"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "placeHold"
            },
            "hold": {
              "$ref": "#/$defs/Hold"
            }
          },
          "required": [
            "type",
            "hold"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "resolveHold"
            },
            "holdId": {
              "$ref": "#/$defs/Id"
            },
            "decision": {
              "enum": [
                "RECHECK",
                "CANCEL"
              ]
            },
            "authorization": {
              "$ref": "#/$defs/Decision"
            }
          },
          "required": [
            "type",
            "holdId",
            "decision",
            "authorization"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "recoverOwnership"
            },
            "restartPolicy": {
              "$ref": "#/$defs/Ref"
            }
          },
          "required": [
            "type",
            "restartPolicy"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "recordSummary"
            },
            "summary": {
              "$ref": "#/$defs/Summary"
            }
          },
          "required": [
            "type",
            "summary"
          ],
          "additionalProperties": false
        }
      ]
    },
    "Command": {
      "type": "object",
      "properties": {
        "protocol": {
          "const": "aiws-handoff/1"
        },
        "requestId": {
          "$ref": "#/$defs/Id"
        },
        "expectedRevision": {
          "$ref": "#/$defs/UInt"
        },
        "missionId": {
          "$ref": "#/$defs/Id"
        },
        "runId": {
          "$ref": "#/$defs/Id"
        },
        "ownerEpoch": {
          "$ref": "#/$defs/UInt"
        },
        "body": {
          "$ref": "#/$defs/CommandBody"
        }
      },
      "required": [
        "protocol",
        "requestId",
        "expectedRevision",
        "missionId",
        "runId",
        "ownerEpoch",
        "body"
      ],
      "additionalProperties": false
    },
    "Invalidation": {
      "type": "object",
      "properties": {
        "protocol": {
          "const": "aiws-handoff/1"
        },
        "invalidationId": {
          "$ref": "#/$defs/Id"
        },
        "handoff": {
          "$ref": "#/$defs/HandoffRef"
        },
        "reason": {
          "$ref": "#/$defs/Blocker"
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Ref"
          },
          "minItems": 1
        },
        "affectedConsumptionIds": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          },
          "minItems": 0,
          "uniqueItems": true
        },
        "holdId": {
          "$ref": "#/$defs/Id"
        },
        "revision": {
          "$ref": "#/$defs/UInt"
        }
      },
      "required": [
        "protocol",
        "invalidationId",
        "handoff",
        "reason",
        "evidenceRefs",
        "affectedConsumptionIds",
        "holdId",
        "revision"
      ],
      "additionalProperties": false
    }
  }
}
