{
  "$defs": {
    "NamedTestOutcome": {
      "additionalProperties": false,
      "properties": {
        "test_id": {
          "maxLength": 300,
          "minLength": 1,
          "title": "Test Id",
          "type": "string"
        },
        "outcome": {
          "enum": [
            "passed",
            "failed",
            "skipped",
            "error"
          ],
          "title": "Outcome",
          "type": "string"
        }
      },
      "required": [
        "test_id",
        "outcome"
      ],
      "title": "NamedTestOutcome",
      "type": "object"
    },
    "PRSubject": {
      "additionalProperties": false,
      "properties": {
        "record_type": {
          "const": "pr-subject.v1",
          "default": "pr-subject.v1",
          "title": "Record Type",
          "type": "string"
        },
        "repository_id": {
          "maxLength": 300,
          "minLength": 1,
          "title": "Repository Id",
          "type": "string"
        },
        "repository": {
          "maxLength": 300,
          "minLength": 1,
          "title": "Repository",
          "type": "string"
        },
        "pr_number": {
          "exclusiveMinimum": 0,
          "title": "Pr Number",
          "type": "integer"
        },
        "head_sha": {
          "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})(?![\\s\\S])",
          "title": "Head Sha",
          "type": "string"
        },
        "base_sha": {
          "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})(?![\\s\\S])",
          "title": "Base Sha",
          "type": "string"
        },
        "comparison_sha": {
          "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})(?![\\s\\S])",
          "title": "Comparison Sha",
          "type": "string"
        },
        "merge_base_sha": {
          "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})(?![\\s\\S])",
          "title": "Merge Base Sha",
          "type": "string"
        }
      },
      "required": [
        "repository_id",
        "repository",
        "pr_number",
        "head_sha",
        "base_sha",
        "comparison_sha",
        "merge_base_sha"
      ],
      "title": "PRSubject",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "extensions": {
      "additionalProperties": false,
      "patternProperties": {
        "^[a-z0-9]+(?:[.-][a-z0-9]+)+:[A-Za-z0-9_.-]+(?![\\s\\S])": {}
      },
      "title": "Extensions",
      "type": "object"
    },
    "record_type": {
      "const": "pr-validation.v1",
      "default": "pr-validation.v1",
      "title": "Record Type",
      "type": "string"
    },
    "id": {
      "maxLength": 300,
      "minLength": 1,
      "title": "Id",
      "type": "string"
    },
    "subject": {
      "$ref": "#/$defs/PRSubject"
    },
    "intent_digest": {
      "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
      "title": "Intent Digest",
      "type": "string"
    },
    "policy_digest": {
      "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
      "title": "Policy Digest",
      "type": "string"
    },
    "suite_digest": {
      "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
      "title": "Suite Digest",
      "type": "string"
    },
    "reporter_subject": {
      "maxLength": 300,
      "minLength": 1,
      "title": "Reporter Subject",
      "type": "string"
    },
    "reporter_generation": {
      "exclusiveMinimum": 0,
      "title": "Reporter Generation",
      "type": "integer"
    },
    "started_at": {
      "format": "date-time",
      "title": "Started At",
      "type": "string"
    },
    "ended_at": {
      "format": "date-time",
      "title": "Ended At",
      "type": "string"
    },
    "valid_until": {
      "format": "date-time",
      "title": "Valid Until",
      "type": "string"
    },
    "tests": {
      "items": {
        "$ref": "#/$defs/NamedTestOutcome"
      },
      "title": "Tests",
      "type": "array"
    }
  },
  "required": [
    "id",
    "subject",
    "intent_digest",
    "policy_digest",
    "suite_digest",
    "reporter_subject",
    "reporter_generation",
    "started_at",
    "ended_at",
    "valid_until",
    "tests"
  ],
  "title": "PRValidationReceipt",
  "type": "object"
}
