{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mail.hsimc.tech/schemas/mail-reality.schema.json",
  "title": "HSIMC Mail Reality",
  "type": "object",
  "required": [
    "mail_reality_id",
    "received_at",
    "source_transport",
    "recipient_address_ref",
    "privacy_scope",
    "message_fingerprint",
    "work_state",
    "authority_state",
    "state"
  ],
  "properties": {
    "mail_reality_id": {
      "type": "string"
    },
    "received_at": {
      "type": "string"
    },
    "source_transport": {
      "type": "string"
    },
    "message_fingerprint": {
      "type": "string",
      "description": "Hash/idempotency reference, not the raw secret/content."
    },
    "sender_ref": {
      "type": [
        "string",
        "null"
      ]
    },
    "recipient_address_ref": {
      "type": "string"
    },
    "work_ref": {
      "type": [
        "string",
        "null"
      ]
    },
    "privacy_scope": {
      "enum": [
        "PRIVATE_WORK_INPUT",
        "SUBJECT_HELD_POINTER",
        "BOUNDED_PROCESSING",
        "PUBLIC_EXPLICITLY_AUTHORIZED"
      ]
    },
    "content_pointer": {
      "type": [
        "string",
        "null"
      ]
    },
    "body_retention": {
      "type": "string"
    },
    "attachment_policy": {
      "type": "string"
    },
    "work_state": {
      "enum": [
        "MAIL_REALITY_ONLY",
        "WORK_CANDIDATE",
        "CONTINUED_AS_WORK"
      ]
    },
    "authority_state": {
      "const": "UNRESOLVED_AT_INGRESS"
    },
    "loop_guard": {
      "type": "object"
    },
    "state": {
      "type": "string"
    }
  }
}
