{
  "$defs": {
    "Artifact": {
      "properties": {
        "arch": {
          "description": "`x86_64`, `aarch64`, `armv7`, `armv6`, `riscv64`, `i686`,\n`powerpc64le`, `s390x`, `loongarch64`. Absent when the artifact\nruns on any architecture.",
          "pattern": "^[a-z0-9][a-z0-9_.-]*$",
          "type": [
            "string",
            "null"
          ]
        },
        "bin": {
          "description": "Executables inside the artifact, as paths relative to the archive\nroot, or the artifact's own name (minus any compression suffix)\nwhen it is a bare executable. A consumer puts these on PATH under\n`name`.",
          "items": {
            "$ref": "#/$defs/Bin"
          },
          "type": "array"
        },
        "extensions": {
          "additionalProperties": true,
          "description": "Vendor- or consumer-defined data about this artifact. See\n[`Extensions`].",
          "type": "object"
        },
        "format": {
          "description": "The archive type (`tar.xz`, `tar.gz`, `tar.zst`, `tar.bz2`, `tgz`,\n`tar`, `zip`, `7z`), a single compressed executable (`gz`, `xz`,\n`zst`, `bz2`), an installer (`deb`, `rpm`, `dmg`, `pkg`, `msi`,\n`msix`, `exe`, `appimage`), or `raw` for a bare executable. Two\nartifacts that differ only in format carry the same build, and a\nconsumer takes whichever it prefers. Required: an artifact whose\nformat is unknown is one no consumer can select.\n\n`Option` so that a document leaving it out still parses and is\nthen refused by `validate`, which can name the artifact. The field\nis not optional: no `serde(default)`, so the schema demands it.",
          "pattern": "^[a-z0-9][a-z0-9_.-]*$",
          "type": "string"
        },
        "libc": {
          "description": "`gnu` or `musl`, for a Linux build. Absent when the artifact does\nnot depend on one.",
          "pattern": "^[a-z0-9][a-z0-9_.-]*$",
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "os": {
          "description": "`linux`, `darwin`, `windows`, `freebsd`, `netbsd`, `openbsd`,\n`illumos`, `android`, `ios`. Absent when the artifact runs on any\nOS.",
          "pattern": "^[a-z0-9][a-z0-9_.-]*$",
          "type": [
            "string",
            "null"
          ]
        },
        "provenance": {
          "description": "URLs of build provenance statements (SLSA) for this artifact.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "requires": {
          "anyOf": [
            {
              "$ref": "#/$defs/Requires"
            },
            {
              "type": "null"
            }
          ],
          "description": "What the artifact needs from the host."
        },
        "size": {
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "url": {
          "type": [
            "string",
            "null"
          ]
        },
        "variant": {
          "description": "Tells apart builds that share os, arch, and libc: `fips`,\n`baseline`, `debug`, `installer`, `source`. A consumer selects only\nartifacts without a variant unless asked for one.",
          "pattern": "^[a-z0-9][a-z0-9_.-]*$",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "size",
        "format"
      ],
      "type": "object"
    },
    "Attestor": {
      "description": "Who signed the claim.",
      "oneOf": [
        {
          "const": "vendor",
          "description": "The project's own publisher.",
          "type": "string"
        },
        {
          "const": "repackager",
          "description": "A repository or mirror describing a vendor's artifacts on the\nvendor's behalf, having checked whatever evidence the vendor gave.",
          "type": "string"
        }
      ]
    },
    "Bin": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "name": {
              "type": "string"
            },
            "path": {
              "type": "string"
            }
          },
          "required": [
            "path",
            "name"
          ],
          "type": "object"
        }
      ],
      "description": "An executable inside an artifact. Serialises as the bare path when the\nPATH name is the file's own name, else as `{ \"path\", \"name\" }`."
    },
    "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"
    },
    "Predicate": {
      "properties": {
        "artifacts": {
          "items": {
            "$ref": "#/$defs/Artifact"
          },
          "type": "array"
        },
        "attested_by": {
          "$ref": "#/$defs/Attestor",
          "description": "Who is making the claim: the vendor itself, or a repackager that\nchecked the vendor's evidence and signed a document about it."
        },
        "evidence": {
          "description": "What a repackager checked before signing.",
          "items": {
            "$ref": "#/$defs/Evidence"
          },
          "type": "array"
        },
        "extensions": {
          "additionalProperties": true,
          "description": "Vendor- or consumer-defined data about the release. See\n[`Extensions`].",
          "type": "object"
        },
        "identity": {
          "$ref": "#/$defs/Identity"
        },
        "notes_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "project": {
          "description": "The project's name: a host path such as `github.com/jdx/mise` or\n`mise.jdx.dev`. The host is where a\nconsumer discovers releases and, for forge hosts, what identity is\nexpected to have signed them. A tool in a monorepo adds a subpath:\n`github.com/oxc-project/oxc/oxlint`.",
          "type": "string"
        },
        "published_at": {
          "description": "RFC 3339. Publishers write UTC with `Z`; consumers accept any offset.",
          "format": "date-time",
          "type": "string"
        },
        "resources": {
          "description": "What ships beyond the executables: completions, man pages, CLI\nspecs, skills, desktop entries, icons, app bundles. Each names its\nkind and one source. See [`Resource`].",
          "items": {
            "$ref": "#/$defs/Resource"
          },
          "type": "array"
        },
        "source": {
          "anyOf": [
            {
              "$ref": "#/$defs/Source"
            },
            {
              "type": "null"
            }
          ]
        },
        "version": {
          "description": "Semver 2.0.0 (calver such as `2026.9.1` qualifies). Its prerelease\npart, if any, marks a prerelease, and the first identifier of that\npart names the channel: see [`channel`]. On a forge, the release\ntag names this version: see [`tag_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": [
        "project",
        "version",
        "published_at",
        "artifacts",
        "identity"
      ],
      "type": "object"
    },
    "RequiredBin": {
      "description": "A command an executable needs on PATH.",
      "properties": {
        "min": {
          "description": "The lowest version that works: an ASCII digit followed by ASCII\nletters, digits, `.`, `-`, and `+`, such as `17` or `3.12`. A\ndocument with any other spelling is invalid. Compared numerically by\ndot-separated components with missing components padded with zero:\n`17` means 17.0.0 and later, including 21. A valid minimum that is\nnot dot-separated numbers, such as `17-ea`, cannot be compared, so\nthe check is unknown and consumers warn.",
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "description": "The name as the executable invokes it, bare: `java`, `python3`,\n`git`. No directory and no `.exe`.",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "Requires": {
      "description": "What the host must already provide, by names the operating system\ndefines, so a consumer can check before installing. Nothing here names\nanother project or where to get it; see the specification's Host\nrequirements section.",
      "properties": {
        "bin": {
          "description": "Commands the executables run and cannot work without, by the bare\nname on PATH, with an optional minimum version. Declared by the\nvendor.",
          "items": {
            "$ref": "#/$defs/RequiredBin"
          },
          "type": "array"
        },
        "glibc_min": {
          "description": "Minimum glibc for a `gnu` Linux build, such as `2.31`.",
          "type": [
            "string",
            "null"
          ]
        },
        "libs": {
          "description": "Shared libraries the executables load from the host, by the name\nthe loader resolves: a soname (`libssl.so.3`), a DLL name\n(`vcruntime140.dll`), or a dylib name (`libssl.3.dylib`). Excludes\nthe C runtime baseline that `libc` and `glibc_min` cover and any\nlibrary the artifact ships itself. `packslip create` reads it from\nthe executables; an empty list means they were read and need\nnothing, an absent one that nothing was checked.",
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "os_min": {
          "description": "Minimum OS version, in the OS's own terms: `12` for macOS Monterey,\n`10.0.17763` for Windows.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "Resource": {
      "description": "Something the release ships besides its executables, and where to get\nit. The kind says what it is; exactly one of `archive`, `asset`,\n`repo`, and `exec` says where it comes from. Documented kinds:\n`completion`, `man`, `cli-spec`, `skill`, `desktop`, `icon`, `app`,\n`sbom`. Consumers ignore kinds they do not know.",
      "properties": {
        "arch": {
          "description": "Likewise for `arch`.",
          "pattern": "^[a-z0-9][a-z0-9_.-]*$",
          "type": [
            "string",
            "null"
          ]
        },
        "archive": {
          "description": "A path inside the selected artifact, relative to the archive root.",
          "type": [
            "string",
            "null"
          ]
        },
        "artifact": {
          "description": "Exact artifact name. More specific than any platform-only scope.",
          "type": [
            "string",
            "null"
          ]
        },
        "asset": {
          "description": "The name of a separate release file, listed in `subject` with its\ndigest.",
          "type": [
            "string",
            "null"
          ]
        },
        "bin": {
          "description": "The executable this entry is for, by its `bin` name. Required for\n`cli-spec`; for `completion` and `man`, required when the release\nhas more than one executable, and meaning that one when it has\none.",
          "type": [
            "string",
            "null"
          ]
        },
        "env": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Environment variables for the `exec` command, with `{shell}`\nsubstituted in values as in the argv. Only with `exec`.",
          "type": "object"
        },
        "exec": {
          "description": "A command whose stdout is the file: an argv whose first element is\na `bin` name. See the specification's Running an exec entry.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "extensions": {
          "additionalProperties": true,
          "description": "Vendor- or consumer-defined data about this resource. See\n[`Extensions`].",
          "type": "object"
        },
        "format": {
          "description": "For `cli-spec`: the spec format, of which `usage` is documented.\nFor `sbom`: `cyclonedx` or `spdx`.",
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "type": "string"
        },
        "libc": {
          "description": "Likewise for `libc`.",
          "pattern": "^[a-z0-9][a-z0-9_.-]*$",
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "description": "For `skill`: the skill's name.",
          "type": [
            "string",
            "null"
          ]
        },
        "os": {
          "description": "Limits the entry to artifacts of this `os`, when layouts differ by\nplatform. Absent means any artifact. See [`resource_fits`].",
          "pattern": "^[a-z0-9][a-z0-9_.-]*$",
          "type": [
            "string",
            "null"
          ]
        },
        "repo": {
          "description": "A path in the source repository at `source.commit`.",
          "type": [
            "string",
            "null"
          ]
        },
        "shell": {
          "description": "For `completion` with a static source: the shell, such as `bash`,\n`zsh`, `fish`, `powershell`, `nushell`, `elvish`.",
          "type": [
            "string",
            "null"
          ]
        },
        "shells": {
          "description": "For `completion` with an `exec` source: every shell the command\ngenerates, substituted for `{shell}` in the argv.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "url": {
          "description": "Download URL of the asset, when the source is `asset`.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    },
    "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"
        }
      ]
    },
    "Source": {
      "properties": {
        "commit": {
          "type": [
            "string",
            "null"
          ]
        },
        "repo": {
          "type": "string"
        },
        "tag": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "repo"
      ],
      "type": "object"
    },
    "Subject": {
      "properties": {
        "digest": {
          "$ref": "#/$defs/Digest"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "digest"
      ],
      "type": "object"
    }
  },
  "$id": "https://packslip.dev/schema/release-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/Predicate"
    },
    "predicateType": {
      "type": "string"
    },
    "subject": {
      "description": "What the predicate is about, by name and digest.",
      "items": {
        "$ref": "#/$defs/Subject"
      },
      "type": "array"
    }
  },
  "required": [
    "_type",
    "subject",
    "predicateType",
    "predicate"
  ],
  "title": "Envelope",
  "type": "object"
}
