{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://iarpg.com/evidence-packet.schema.json",
  "title": "IARPG Evidence Packet",
  "type": "object",
  "required": [
    "packet_id",
    "mission_id",
    "standard_version",
    "created_utc",
    "items",
    "relationships"
  ],
  "properties": {
    "packet_id": {
      "type": "string",
      "minLength": 3
    },
    "mission_id": {
      "type": "string",
      "minLength": 3
    },
    "standard_version": {
      "const": "IARPG-OPS-2"
    },
    "created_utc": {
      "type": "string",
      "format": "date-time"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "type",
          "origin",
          "timestamp_utc",
          "provenance",
          "review_status",
          "reason_code"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "enum": [
              "observation",
              "source_report",
              "document",
              "sensor_event",
              "interpretation",
              "hypothesis",
              "assessment",
              "decision",
              "contradiction",
              "corroboration",
              "chain_of_custody"
            ]
          },
          "origin": {
            "type": "string"
          },
          "timestamp_utc": {
            "type": "string",
            "format": "date-time"
          },
          "reliability": {},
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "provenance": {
            "type": "string"
          },
          "jurisdiction": {
            "type": "string"
          },
          "review_status": {
            "type": "string"
          },
          "reason_code": {
            "type": "string"
          }
        }
      }
    },
    "relationships": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "from",
          "type",
          "to"
        ],
        "properties": {
          "from": {
            "type": "string"
          },
          "type": {
            "enum": [
              "supports",
              "contradicts",
              "derived_from",
              "custody_transfer",
              "corroborates"
            ]
          },
          "to": {
            "type": "string"
          }
        }
      }
    }
  }
}
