{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://torneo.ai/schemas/reproduction_receipt.v1",
  "title": "reproduction_receipt.v1",
  "description": "Detached Ed25519 receipt of a third-party offline re-execution (torneo_platform.reproduction_receipt.make_receipt). The signed subject is bundle_digest, the digest over bundle_digests. Shape only: the signature, the digests against the bundle at hand, freshness and replay are checked by verify_reproduction_receipt.",
  "type": "object",
  "required": [
    "schema",
    "role",
    "subject",
    "key_id",
    "at",
    "nonce",
    "bundle_digests",
    "bundle_digest",
    "environment",
    "environment_digest",
    "verdict",
    "signature"
  ],
  "additionalProperties": false,
  "properties": {
    "schema": {
      "const": "reproduction_receipt.v1"
    },
    "role": {
      "const": "reproduce"
    },
    "subject": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "key_id": {
      "type": "string",
      "minLength": 1
    },
    "at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
    },
    "nonce": {
      "type": "string",
      "pattern": "^[0-9a-f]{32,128}$"
    },
    "bundle_digests": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "type": "string",
        "minLength": 1
      },
      "additionalProperties": {
        "type": "string",
        "pattern": "^[0-9a-f]{64}$"
      }
    },
    "bundle_digest": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "environment": {
      "type": "object",
      "minProperties": 1,
      "properties": {
        "python": {
          "type": "string"
        },
        "implementation": {
          "type": "string"
        },
        "system": {
          "type": "string"
        },
        "machine": {
          "type": "string"
        }
      }
    },
    "environment_digest": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "verdict": {
      "enum": [
        "PASS",
        "FAIL"
      ]
    },
    "signature": {
      "type": "string",
      "pattern": "^[0-9a-f]{128}$"
    }
  }
}
