{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aslice.sh/schematics/json/archive-catalog.schema.json",
  "title": "Currently authorized historical objects",
  "description": "Normative structure; semantics and authorization: docs/STATE-AND-RECOVERY.md.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "catalog_version": {
      "const": 1
    },
    "repository": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]*$"
    },
    "identity": {
      "type": "string",
      "minLength": 1
    },
    "environment": {
      "type": "string",
      "enum": [
        "dev",
        "staging",
        "prod"
      ]
    },
    "objects": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "digest": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$"
          },
          "length": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "kind": {
            "type": "string",
            "enum": [
              "index",
              "recipe",
              "manifest",
              "blob"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "available",
              "revoked",
              "unavailable"
            ]
          }
        },
        "required": [
          "digest",
          "length",
          "kind",
          "status"
        ]
      }
    }
  },
  "required": [
    "catalog_version",
    "repository",
    "identity",
    "environment",
    "objects"
  ]
}
