{
  "$defs": {
    "EvidenceReference": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "maxLength": 300,
          "minLength": 1,
          "title": "Id",
          "type": "string"
        },
        "digest": {
          "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
          "title": "Digest",
          "type": "string"
        },
        "kind": {
          "enum": [
            "pr-validation.v1",
            "github-check"
          ],
          "title": "Kind",
          "type": "string"
        },
        "trust_level": {
          "enum": [
            "enrolled_runner_claim",
            "provider_readback"
          ],
          "title": "Trust Level",
          "type": "string"
        },
        "authority_reference": {
          "maxLength": 300,
          "minLength": 1,
          "title": "Authority Reference",
          "type": "string"
        },
        "valid_until": {
          "format": "date-time",
          "title": "Valid Until",
          "type": "string"
        }
      },
      "required": [
        "id",
        "digest",
        "kind",
        "trust_level",
        "authority_reference",
        "valid_until"
      ],
      "title": "EvidenceReference",
      "type": "object"
    },
    "Finding": {
      "additionalProperties": false,
      "properties": {
        "rule_id": {
          "maxLength": 300,
          "minLength": 1,
          "title": "Rule Id",
          "type": "string"
        },
        "severity": {
          "enum": [
            "info",
            "warning",
            "error"
          ],
          "title": "Severity",
          "type": "string"
        },
        "message": {
          "maxLength": 2000,
          "minLength": 1,
          "title": "Message",
          "type": "string"
        },
        "path": {
          "anyOf": [
            {
              "maxLength": 500,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Path"
        },
        "line": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Line"
        },
        "evidence_references": {
          "items": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "title": "Evidence References",
          "type": "array"
        }
      },
      "required": [
        "rule_id",
        "severity",
        "message"
      ],
      "title": "Finding",
      "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"
    },
    "RequirementOutcome": {
      "additionalProperties": false,
      "properties": {
        "requirement_id": {
          "maxLength": 300,
          "minLength": 1,
          "title": "Requirement Id",
          "type": "string"
        },
        "state": {
          "enum": [
            "satisfied",
            "violated",
            "unknown",
            "stale"
          ],
          "title": "State",
          "type": "string"
        },
        "reason_codes": {
          "items": {
            "type": "string"
          },
          "title": "Reason Codes",
          "type": "array"
        },
        "evidence_references": {
          "items": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "title": "Evidence References",
          "type": "array"
        },
        "assessed_test_ids": {
          "items": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "title": "Assessed Test Ids",
          "type": "array"
        },
        "omitted_test_ids": {
          "items": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "title": "Omitted Test Ids",
          "type": "array"
        }
      },
      "required": [
        "requirement_id",
        "state",
        "reason_codes",
        "evidence_references",
        "assessed_test_ids",
        "omitted_test_ids"
      ],
      "title": "RequirementOutcome",
      "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": "verification-record.v1",
      "default": "verification-record.v1",
      "title": "Record Type",
      "type": "string"
    },
    "record_id": {
      "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
      "title": "Record Id",
      "type": "string"
    },
    "request_id": {
      "maxLength": 300,
      "minLength": 1,
      "title": "Request Id",
      "type": "string"
    },
    "run_id": {
      "maxLength": 300,
      "minLength": 1,
      "title": "Run Id",
      "type": "string"
    },
    "subject": {
      "$ref": "#/$defs/PRSubject"
    },
    "scope": {
      "enum": [
        "pr_completion",
        "full_lifecycle"
      ],
      "title": "Scope",
      "type": "string"
    },
    "intent_digest": {
      "anyOf": [
        {
          "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Intent Digest"
    },
    "policy_digest": {
      "anyOf": [
        {
          "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Policy Digest"
    },
    "policy_version": {
      "anyOf": [
        {
          "maxLength": 300,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Policy Version"
    },
    "evidence_set_digest": {
      "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
      "title": "Evidence Set Digest",
      "type": "string"
    },
    "evaluator_versions": {
      "additionalProperties": {
        "type": "string"
      },
      "title": "Evaluator Versions",
      "type": "object"
    },
    "evaluated_at": {
      "format": "date-time",
      "title": "Evaluated At",
      "type": "string"
    },
    "valid_until": {
      "format": "date-time",
      "title": "Valid Until",
      "type": "string"
    },
    "currentness_token": {
      "pattern": "^sha256:[a-f0-9]{64}(?![\\s\\S])",
      "title": "Currentness Token",
      "type": "string"
    },
    "currentness": {
      "enum": [
        "current",
        "stale",
        "historical",
        "unconfirmed"
      ],
      "title": "Currentness",
      "type": "string"
    },
    "provenance_mode": {
      "enum": [
        "current_evaluation",
        "historical_replay",
        "re_evaluation"
      ],
      "title": "Provenance Mode",
      "type": "string"
    },
    "state": {
      "enum": [
        "satisfied",
        "violated",
        "unknown",
        "stale"
      ],
      "title": "State",
      "type": "string"
    },
    "reason_codes": {
      "items": {
        "type": "string"
      },
      "title": "Reason Codes",
      "type": "array"
    },
    "next_actions": {
      "items": {
        "type": "string"
      },
      "title": "Next Actions",
      "type": "array"
    },
    "requirements": {
      "items": {
        "$ref": "#/$defs/RequirementOutcome"
      },
      "title": "Requirements",
      "type": "array"
    },
    "evidence": {
      "items": {
        "$ref": "#/$defs/EvidenceReference"
      },
      "title": "Evidence",
      "type": "array"
    },
    "assessed_coverage": {
      "items": {
        "maxLength": 300,
        "minLength": 1,
        "type": "string"
      },
      "title": "Assessed Coverage",
      "type": "array"
    },
    "omitted_coverage": {
      "items": {
        "maxLength": 300,
        "minLength": 1,
        "type": "string"
      },
      "title": "Omitted Coverage",
      "type": "array"
    },
    "gaps": {
      "items": {
        "type": "string"
      },
      "title": "Gaps",
      "type": "array"
    },
    "findings": {
      "items": {
        "$ref": "#/$defs/Finding"
      },
      "title": "Findings",
      "type": "array"
    }
  },
  "required": [
    "record_id",
    "request_id",
    "run_id",
    "subject",
    "scope",
    "intent_digest",
    "policy_digest",
    "policy_version",
    "evidence_set_digest",
    "evaluator_versions",
    "evaluated_at",
    "valid_until",
    "currentness_token",
    "currentness",
    "provenance_mode",
    "state",
    "reason_codes",
    "next_actions",
    "requirements",
    "evidence",
    "assessed_coverage",
    "omitted_coverage",
    "gaps",
    "findings"
  ],
  "title": "VerificationRecord",
  "type": "object"
}
