{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://iarpg.com/handoff-contract.schema.json",
  "title": "IARPG Browser-Local Tool Handoff",
  "type": "object",
  "required": [
    "handoff_id",
    "protocol_version",
    "artifact_type",
    "artifact_version",
    "source_tool",
    "destination_tool",
    "handoff_utc",
    "record_id",
    "digest",
    "unknown_field_policy",
    "recovery_behavior",
    "payload"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "handoff_id": {
      "type": "string"
    },
    "protocol_version": {
      "const": "1.0.0"
    },
    "artifact_type": {
      "type": "string"
    },
    "artifact_version": {
      "type": "string"
    },
    "source_tool": {
      "type": "string"
    },
    "destination_tool": {
      "type": "string"
    },
    "handoff_utc": {
      "type": "string",
      "pattern": "Z$"
    },
    "record_id": {
      "type": "string"
    },
    "digest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "unknown_field_policy": {
      "enum": [
        "preserve",
        "quarantine",
        "reject-with-source-untouched"
      ]
    },
    "recovery_behavior": {
      "type": "string"
    },
    "payload": {},
    "extensions": {
      "type": "object"
    }
  },
  "additionalProperties": false
}
