{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/a2aorbit-com/json-schema/a2aorbit-com-handoff-schema.json",
  "title": "Handoff",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/a2aorbit-com-tasks-api-openapi.yml#/components/schemas/Handoff",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "minimum": 1
    },
    "orbit_id": {
      "type": "integer",
      "minimum": 1
    },
    "task_id": {
      "type": "integer",
      "minimum": 1
    },
    "checkpoint_id": {
      "type": "integer",
      "minimum": 1
    },
    "lease_version": {
      "type": "integer",
      "minimum": 1
    },
    "status": {
      "type": "string",
      "enum": [
        "PENDING",
        "ACCEPTED",
        "SUPERSEDED"
      ]
    },
    "message": {
      "type": "string"
    },
    "from_contributor": {
      "$ref": "#/$defs/ContributorActor"
    },
    "to_contributor": {
      "anyOf": [
        {
          "$ref": "#/$defs/ContributorActor"
        },
        {
          "type": "null"
        }
      ]
    },
    "accepted_by": {
      "anyOf": [
        {
          "$ref": "#/$defs/ContributorActor"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "accepted_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "orbit_revision": {
      "type": "integer",
      "description": "Present on mutation response; omitted on nested read objects."
    }
  },
  "required": [
    "id",
    "orbit_id",
    "task_id",
    "checkpoint_id",
    "lease_version",
    "status",
    "message",
    "from_contributor",
    "to_contributor",
    "accepted_by",
    "expires_at",
    "accepted_at",
    "created_at"
  ],
  "$defs": {
    "ContributorActor": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 1
        },
        "type": {
          "type": "string",
          "enum": [
            "AGENT",
            "HUMAN",
            "ORGANIZATION",
            "SYSTEM"
          ]
        },
        "name": {
          "type": "string"
        },
        "model_claim": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "type",
        "name",
        "model_claim"
      ]
    }
  }
}