{
  "$defs": {
    "Digest": {
      "properties": {
        "sha256": {
          "description": "Lowercase hex.",
          "pattern": "^[0-9a-f]{64}$",
          "type": "string"
        },
        "sha512": {
          "description": "Lowercase hex, for consumers that want it (electron-updater,\nBalrog, Scoop).",
          "pattern": "^[0-9a-f]{128}$",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "sha256"
      ],
      "type": "object"
    },
    "Evidence": {
      "description": "One thing a repackager or a release list's publisher checked.\nDocumented kinds: `pkgbuild-checksums`, `checksum-file-over-tls`,\n`apt-release-gpg`, `vendor-signature`, `vendor-packslip`,\n`github-attestation`, `provenance-verified`, `scan`, `none`.",
      "properties": {
        "detail": {
          "description": "A key id, URL, or note that lets a reader check the claim: the\nvendor packslip's digest, a scan report's URL.",
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    },
    "Identity": {
      "description": "How the document is signed, so a consumer can check what it pinned\nagainst what it received.",
      "properties": {
        "issuer": {
          "description": "For `sigstore-oidc`, the OIDC issuer that vouched for the identity,\nsuch as `https://token.actions.githubusercontent.com`.",
          "type": [
            "string",
            "null"
          ]
        },
        "key_id": {
          "description": "For `sigstore-oidc`, the certificate's subject identity: the\nworkflow URI for a CI identity, or the email for a human one. For\n`sigstore-key`, the key id in uppercase hex.",
          "type": "string"
        },
        "pin_workflow": {
          "description": "For `sigstore-oidc`, whether a consumer holds later releases to the\nworkflow file that signed this one. `false` asks consumers to hold\nthem to the signing repository instead, for a vendor whose releases\nare signed by more than one workflow of its repository. Absent means\n`true`.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "scheme": {
          "$ref": "#/$defs/Scheme"
        }
      },
      "required": [
        "scheme",
        "key_id"
      ],
      "type": "object"
    },
    "ReleaseList": {
      "description": "The `releases/v1` predicate: which releases a project has, so a\nconsumer can find them without a registry, and cannot be shown a stale\nor truncated view without noticing.",
      "properties": {
        "expires_at": {
          "description": "After this the list is stale and a consumer refuses it, RFC 3339,\nwritten in UTC.",
          "type": "string"
        },
        "extensions": {
          "additionalProperties": true,
          "description": "Vendor- or consumer-defined data about the list. See\n[`Extensions`].",
          "type": "object"
        },
        "generated_at": {
          "description": "When the list was produced, RFC 3339, written in UTC.",
          "type": "string"
        },
        "identity": {
          "$ref": "#/$defs/Identity"
        },
        "latest": {
          "description": "The vendor's recommended default: an exact version in `releases`.\nConsumers still apply all eligibility checks before selecting it.",
          "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
          "type": [
            "string",
            "null"
          ]
        },
        "project": {
          "type": "string"
        },
        "releases": {
          "description": "In any order, and possibly empty; consumers rank by semver\nprecedence.",
          "items": {
            "$ref": "#/$defs/ReleaseRef"
          },
          "type": "array"
        },
        "sequence": {
          "description": "Increases with every list published; a consumer refuses a lower one\nthan it has seen.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "project",
        "generated_at",
        "expires_at",
        "sequence",
        "identity",
        "releases"
      ],
      "type": "object"
    },
    "ReleaseRef": {
      "properties": {
        "evidence": {
          "description": "What the list's publisher checked about this release beyond the\nvendor's own document: a scan, verified provenance. Empty for a\nvendor's own list.",
          "items": {
            "$ref": "#/$defs/Evidence"
          },
          "type": "array"
        },
        "extensions": {
          "additionalProperties": true,
          "description": "Vendor- or consumer-defined data about this release. See\n[`Extensions`].",
          "type": "object"
        },
        "packslip": {
          "description": "URL of the release's `packslip.sigstore.json`. The statement's\nsubject of the same name carries that file's digest.",
          "type": "string"
        },
        "published_at": {
          "description": "RFC 3339, copied from the release's packslip and written in UTC.",
          "format": "date-time",
          "type": "string"
        },
        "security": {
          "description": "The release fixes a vulnerability; a consumer's minimum release age\nmay shorten for it.",
          "type": "boolean"
        },
        "status": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReleaseStatus"
            },
            {
              "type": "null"
            }
          ],
          "description": "Set when the vendor withdrew the release. Consumers never select a\nyanked release and warn when they hold one."
        },
        "status_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "tag": {
          "description": "The vendor's own spelling of the release, copied from the packslip's\n`source.tag`, so a consumer can accept a request in either form.",
          "type": [
            "string",
            "null"
          ]
        },
        "version": {
          "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
          "type": "string"
        }
      },
      "required": [
        "version",
        "published_at",
        "packslip"
      ],
      "type": "object"
    },
    "ReleaseStatus": {
      "enum": [
        "yanked"
      ],
      "type": "string"
    },
    "Scheme": {
      "oneOf": [
        {
          "const": "sigstore-oidc",
          "description": "A sigstore bundle signed keylessly with a workload or human OIDC\nidentity, certified by Fulcio and logged to Rekor.",
          "type": "string"
        },
        {
          "const": "sigstore-key",
          "description": "A sigstore bundle signed with a long-lived Ed25519 key, logged to\nRekor.",
          "type": "string"
        }
      ]
    },
    "Subject": {
      "properties": {
        "digest": {
          "$ref": "#/$defs/Digest"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "digest"
      ],
      "type": "object"
    }
  },
  "$id": "https://packslip.dev/schema/releases-v1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "An in-toto statement carrying predicate `P`.",
  "properties": {
    "_type": {
      "type": "string"
    },
    "predicate": {
      "$ref": "#/$defs/ReleaseList"
    },
    "predicateType": {
      "type": "string"
    },
    "subject": {
      "description": "What the predicate is about, by name and digest.",
      "items": {
        "$ref": "#/$defs/Subject"
      },
      "minItems": 1,
      "type": "array"
    }
  },
  "required": [
    "_type",
    "subject",
    "predicateType",
    "predicate"
  ],
  "title": "Envelope",
  "type": "object"
}
