{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thehiveryiq.com/.well-known/schemas/usap-howler-v2.json",
  "title": "Howler v1",
  "description": "Checks supplied scores against declared thresholds. It does not prove that observations are complete or that an external escalation service acted.",
  "type": "object",
  "required": [
    "receipt_id",
    "payload_sha256",
    "sig_b64u",
    "key_id",
    "algorithm",
    "ts",
    "signed_body"
  ],
  "additionalProperties": false,
  "properties": {
    "receipt_id": {
      "type": "string",
      "pattern": "^r_usap\\.howler_[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",
        "probe_id",
        "evidence_digest_sha256",
        "recorded_at",
        "verdict",
        "boundary",
        "probe_policy_sha256",
        "policy_committed_at",
        "signal_definitions",
        "signal_observations",
        "severity_bands",
        "recorded_dispositions",
        "threshold_relations",
        "triggered_signals",
        "derived_severity",
        "required_dispositions",
        "disposition_coverage",
        "elements",
        "outcome"
      ],
      "additionalProperties": false,
      "properties": {
        "receipt_type": {
          "type": "string",
          "const": "usap.howler"
        },
        "schema": {
          "type": "string",
          "const": "r2.0.0"
        },
        "probe_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": [
            "outcome"
          ],
          "additionalProperties": false,
          "properties": {
            "outcome": {
              "type": "string",
              "enum": [
                "no_signal",
                "escalation_satisfied",
                "escalation_incomplete"
              ]
            }
          }
        },
        "boundary": {
          "type": "string",
          "const": "Checks supplied scores against declared thresholds. It does not prove that observations are complete or that an external escalation service acted."
        },
        "probe_policy_sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "policy_committed_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$"
        },
        "signal_definitions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "threshold",
              "severity_weight"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._:/]+$"
              },
              "threshold": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "severity_weight": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              }
            }
          },
          "minItems": 1,
          "maxItems": 128
        },
        "signal_observations": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "score",
              "observed_at"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._:/]+$"
              },
              "score": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "observed_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$"
              }
            }
          },
          "minItems": 1,
          "maxItems": 128
        },
        "severity_bands": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "minimum_weight",
              "required_dispositions"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._:/]+$"
              },
              "minimum_weight": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000000
              },
              "required_dispositions": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9._:/]+$"
                },
                "minItems": 0,
                "maxItems": 64
              }
            }
          },
          "minItems": 1,
          "maxItems": 32
        },
        "recorded_dispositions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9._:/]+$"
          },
          "minItems": 0,
          "maxItems": 128
        },
        "threshold_relations": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "score",
              "threshold",
              "relation"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._:/]+$"
              },
              "score": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "threshold": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "relation": {
                "type": "string",
                "enum": [
                  "below_threshold",
                  "threshold_crossed"
                ]
              }
            }
          },
          "minItems": 1,
          "maxItems": 128
        },
        "triggered_signals": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9._:/]+$"
          },
          "minItems": 0,
          "maxItems": 128
        },
        "derived_severity": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "required_dispositions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9._:/]+$"
          },
          "minItems": 0,
          "maxItems": 64
        },
        "disposition_coverage": {
          "type": "string",
          "enum": [
            "complete",
            "incomplete"
          ]
        },
        "elements": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "signal_threshold_crossed",
              "required_disposition_missing"
            ]
          },
          "minItems": 0,
          "maxItems": 2
        },
        "outcome": {
          "type": "string",
          "enum": [
            "no_signal",
            "escalation_satisfied",
            "escalation_incomplete"
          ]
        }
      }
    }
  }
}
