{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "evidence/envelope@1",
  "title": "evidence/envelope@1: the sealed artifact envelope",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "format",
    "kind",
    "id",
    "body",
    "parents",
    "producer",
    "time",
    "key_id",
    "digest",
    "signature"
  ],
  "properties": {
    "format": {
      "const": "evidence/envelope@1"
    },
    "kind": {
      "type": "string",
      "pattern": "^[^/@]+/[^/@]+@[0-9]+$"
    },
    "id": {
      "type": "string"
    },
    "body": {},
    "parents": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/digest"
      }
    },
    "producer": {
      "type": "string"
    },
    "time": {
      "type": "integer",
      "minimum": 0
    },
    "key_id": {
      "type": "string"
    },
    "meta": {
      "description": "Stamped by code at seal time; part of the digest. Absent when empty. Its canonical JSON is at most 4096 bytes. A value is a string, a number or a boolean.",
      "type": "object",
      "minProperties": 1,
      "additionalProperties": {
        "type": [
          "string",
          "integer",
          "boolean"
        ]
      },
      "propertyNames": {
        "pattern": "^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"
      }
    },
    "digest": {
      "$ref": "#/$defs/digest"
    },
    "signature": {
      "type": "string",
      "pattern": "^[0-9a-f]{128}$"
    }
  },
  "$defs": {
    "digest": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    }
  }
}
