{
  "$defs": {
    "RequiredCheck": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "maxLength": 300,
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "app_id": {
          "exclusiveMinimum": 0,
          "title": "App Id",
          "type": "integer"
        }
      },
      "required": [
        "name",
        "app_id"
      ],
      "title": "RequiredCheck",
      "type": "object"
    },
    "RequirementRule": {
      "additionalProperties": false,
      "properties": {
        "requirement_id": {
          "maxLength": 300,
          "minLength": 1,
          "title": "Requirement Id",
          "type": "string"
        },
        "suite_digest": {
          "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
          "title": "Suite Digest",
          "type": "string"
        },
        "positive_test_ids": {
          "items": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "minItems": 1,
          "title": "Positive Test Ids",
          "type": "array"
        },
        "negative_test_ids": {
          "items": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "minItems": 1,
          "title": "Negative Test Ids",
          "type": "array"
        },
        "reporter_subject": {
          "maxLength": 300,
          "minLength": 1,
          "title": "Reporter Subject",
          "type": "string"
        },
        "reporter_generation": {
          "exclusiveMinimum": 0,
          "title": "Reporter Generation",
          "type": "integer"
        }
      },
      "required": [
        "requirement_id",
        "suite_digest",
        "positive_test_ids",
        "negative_test_ids",
        "reporter_subject",
        "reporter_generation"
      ],
      "title": "RequirementRule",
      "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-policy.v1",
      "default": "pr-policy.v1",
      "title": "Record Type",
      "type": "string"
    },
    "version": {
      "maxLength": 300,
      "minLength": 1,
      "title": "Version",
      "type": "string"
    },
    "scope": {
      "default": "pr_completion",
      "enum": [
        "pr_completion",
        "full_lifecycle"
      ],
      "title": "Scope",
      "type": "string"
    },
    "intent_digest": {
      "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
      "title": "Intent Digest",
      "type": "string"
    },
    "approved_by": {
      "maxLength": 300,
      "minLength": 1,
      "title": "Approved By",
      "type": "string"
    },
    "approved_at": {
      "format": "date-time",
      "title": "Approved At",
      "type": "string"
    },
    "valid_until": {
      "format": "date-time",
      "title": "Valid Until",
      "type": "string"
    },
    "accepted_trust_levels": {
      "items": {
        "const": "enrolled_runner_claim",
        "type": "string"
      },
      "title": "Accepted Trust Levels",
      "type": "array"
    },
    "requirements": {
      "items": {
        "$ref": "#/$defs/RequirementRule"
      },
      "title": "Requirements",
      "type": "array"
    },
    "required_checks": {
      "items": {
        "$ref": "#/$defs/RequiredCheck"
      },
      "title": "Required Checks",
      "type": "array"
    }
  },
  "required": [
    "version",
    "intent_digest",
    "approved_by",
    "approved_at",
    "valid_until",
    "requirements"
  ],
  "title": "PRPolicy",
  "type": "object"
}
