{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.gerra.com/evaluation-kit/release-manifest.schema.json",
  "title": "Gerra example release manifest",
  "description": "A public starting structure for agreeing a delivery. The example flag separates a structural illustration from a material release. This schema does not grant rights to source material.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "release_id",
    "example_only",
    "program",
    "records"
  ],
  "properties": {
    "release_id": {
      "type": "string",
      "minLength": 1
    },
    "example_only": {
      "type": "boolean"
    },
    "program": {
      "enum": [
        "professional-work",
        "software",
        "workflow"
      ]
    },
    "notes": {
      "type": "string"
    },
    "records": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/record"
      }
    }
  },
  "$defs": {
    "record": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "record_id",
        "file",
        "source",
        "preparation",
        "review"
      ],
      "properties": {
        "record_id": {
          "type": "string",
          "minLength": 1
        },
        "file": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "path",
            "format",
            "sha256"
          ],
          "properties": {
            "path": {
              "type": "string"
            },
            "format": {
              "type": "string"
            },
            "sha256": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[a-f0-9]{64}$"
            }
          }
        },
        "source": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "source_class",
            "evidence_reference",
            "permitted_use"
          ],
          "properties": {
            "source_class": {
              "type": "string"
            },
            "evidence_reference": {
              "type": [
                "string",
                "null"
              ]
            },
            "permitted_use": {
              "type": "string"
            },
            "authorship_context": {
              "type": "string"
            }
          }
        },
        "preparation": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "identity_scope",
            "change_record"
          ],
          "properties": {
            "identity_scope": {
              "enum": [
                "document_local",
                "connected_workflow",
                "not_applicable"
              ]
            },
            "change_record": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "review": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "state",
            "evidence_reference",
            "limits"
          ],
          "properties": {
            "state": {
              "enum": [
                "example_only",
                "under_review",
                "accepted_for_release"
              ]
            },
            "evidence_reference": {
              "type": [
                "string",
                "null"
              ]
            },
            "limits": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
