{
  "$defs": {
    "ArtifactReference": {
      "additionalProperties": false,
      "properties": {
        "artifact_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Artifact Id",
          "type": "string"
        },
        "media_type": {
          "maxLength": 128,
          "minLength": 3,
          "title": "Media Type",
          "type": "string"
        },
        "relative_path": {
          "maxLength": 512,
          "minLength": 1,
          "title": "Relative Path",
          "type": "string"
        },
        "sha256": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Sha256",
          "type": "string"
        },
        "size_bytes": {
          "minimum": 0,
          "title": "Size Bytes",
          "type": "integer"
        }
      },
      "required": [
        "artifact_id",
        "media_type",
        "relative_path",
        "sha256",
        "size_bytes"
      ],
      "title": "ArtifactReference",
      "type": "object"
    },
    "EvaluationPolicyReference": {
      "additionalProperties": false,
      "properties": {
        "policy_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Policy Id",
          "type": "string"
        },
        "sha256": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Sha256",
          "type": "string"
        },
        "version": {
          "const": "1.0.0",
          "default": "1.0.0",
          "title": "Version",
          "type": "string"
        }
      },
      "required": [
        "policy_id",
        "sha256"
      ],
      "title": "EvaluationPolicyReference",
      "type": "object"
    },
    "EvaluationSource": {
      "additionalProperties": false,
      "properties": {
        "artifact_index_sha256": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Artifact Index Sha256",
          "type": "string"
        },
        "candidate_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Candidate Id",
          "type": "string"
        },
        "contract_version": {
          "const": "1.0.0",
          "default": "1.0.0",
          "title": "Contract Version",
          "type": "string"
        },
        "input_snapshot_sha256": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Input Snapshot Sha256",
          "type": "string"
        },
        "manifest_sha256": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Manifest Sha256",
          "type": "string"
        },
        "result_index_sha256": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Result Index Sha256",
          "type": "string"
        },
        "run_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Run Id",
          "type": "string"
        }
      },
      "required": [
        "candidate_id",
        "run_id",
        "manifest_sha256",
        "input_snapshot_sha256",
        "result_index_sha256",
        "artifact_index_sha256"
      ],
      "title": "EvaluationSource",
      "type": "object"
    },
    "ProducerIdentity": {
      "additionalProperties": false,
      "properties": {
        "build_revision": {
          "anyOf": [
            {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Build Revision"
        },
        "producer_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Producer Id",
          "type": "string"
        },
        "producer_version": {
          "maxLength": 64,
          "minLength": 1,
          "title": "Producer Version",
          "type": "string"
        }
      },
      "required": [
        "producer_id",
        "producer_version"
      ],
      "title": "ProducerIdentity",
      "type": "object"
    }
  },
  "$id": "urn:sindri:contracts:1.0.0:evaluation-manifest",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "created_at": {
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "evaluation_id": {
      "maxLength": 128,
      "minLength": 1,
      "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
      "title": "Evaluation Id",
      "type": "string"
    },
    "outputs": {
      "items": {
        "$ref": "#/$defs/ArtifactReference"
      },
      "minItems": 3,
      "title": "Outputs",
      "type": "array"
    },
    "policy": {
      "$ref": "#/$defs/EvaluationPolicyReference"
    },
    "producer": {
      "$ref": "#/$defs/ProducerIdentity"
    },
    "schema_kind": {
      "const": "evaluation_manifest",
      "default": "evaluation_manifest",
      "title": "Schema Kind",
      "type": "string"
    },
    "schema_version": {
      "const": "1.0.0",
      "default": "1.0.0",
      "title": "Schema Version",
      "type": "string"
    },
    "sources": {
      "items": {
        "$ref": "#/$defs/EvaluationSource"
      },
      "maxItems": 100,
      "minItems": 1,
      "title": "Sources",
      "type": "array"
    },
    "timings_seconds": {
      "additionalProperties": {
        "minimum": 0,
        "type": "number"
      },
      "title": "Timings Seconds",
      "type": "object"
    }
  },
  "required": [
    "evaluation_id",
    "created_at",
    "producer",
    "policy",
    "sources",
    "outputs"
  ],
  "title": "EvaluationManifest",
  "type": "object",
  "x-sindri-contract-suite": "sindri.contracts",
  "x-sindri-contract-version": "1.0.0"
}
