{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thehiveryiq.com/.well-known/schemas/replay-disclosurefree-v1.json",
  "title": "Disclosure-Free Replay v1",
  "description": "Disclosure-Free Replay typed facade receipt. Attests that a replay_id, a source_receipt_ref, and a disclosed field allowlist were recorded and signed at recorded_at, and that fields_outside_allowlist_leaked recomputes exactly from a caller supplied leaked_field_count. It does not itself inspect the replayed payload; a caller must independently diff the replayed fields against disclosed_field_allowlist and report the count truthfully, this receipt only records and signs that count.",
  "type": "object",
  "required": [
    "receipt_id",
    "payload_sha256",
    "sig_b64u",
    "key_id",
    "algorithm",
    "ts",
    "signed_body"
  ],
  "additionalProperties": false,
  "properties": {
    "receipt_id": {
      "type": "string",
      "pattern": "^r_replay\\.disclosurefree_[0-9]{10,}_[0-9a-f]{12}$"
    },
    "payload_sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "sig_b64u": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{86}$"
    },
    "key_id": {
      "type": "string",
      "pattern": "^did:(hive|web|key):[A-Za-z0-9._:%-]+$"
    },
    "algorithm": {
      "type": "string",
      "const": "Ed25519"
    },
    "ts": {
      "type": "integer",
      "minimum": 1000000000
    },
    "signed_body": {
      "type": "object",
      "required": [
        "receipt_type",
        "schema",
        "replay_id",
        "evidence_digest_sha256",
        "recorded_at",
        "verdict",
        "boundary",
        "source_receipt_ref",
        "disclosed_field_allowlist",
        "leaked_field_count"
      ],
      "additionalProperties": false,
      "properties": {
        "receipt_type": {
          "type": "string",
          "const": "replay.disclosurefree"
        },
        "schema": {
          "type": "string",
          "const": "r1.0.0"
        },
        "replay_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^[A-Za-z0-9._:-]{1,256}$"
        },
        "evidence_digest_sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "SHA-256 of the caller-held evidence bundle this receipt attests was recorded. The service never receives or inspects the underlying evidence, only its digest."
        },
        "recorded_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$"
        },
        "verdict": {
          "type": "object",
          "description": "Service-computed honesty boundary fields. Never caller overridable; recomputed and checked at verify time.",
          "required": [
            "fields_outside_allowlist_leaked"
          ],
          "additionalProperties": false,
          "properties": {
            "fields_outside_allowlist_leaked": {
              "type": "boolean"
            }
          }
        },
        "boundary": {
          "type": "string",
          "const": "Disclosure-Free Replay typed facade receipt. Attests that a replay_id, a source_receipt_ref, and a disclosed field allowlist were recorded and signed at recorded_at, and that fields_outside_allowlist_leaked recomputes exactly from a caller supplied leaked_field_count. It does not itself inspect the replayed payload; a caller must independently diff the replayed fields against disclosed_field_allowlist and report the count truthfully, this receipt only records and signs that count."
        },
        "source_receipt_ref": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "disclosed_field_allowlist": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "minItems": 1,
          "maxItems": 256
        },
        "leaked_field_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100000
        }
      }
    }
  }
}
