{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "Manifest": {
      "properties": {
        "scope": {
          "$ref": "#/$defs/Space"
        },
        "max_depth": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "spaces": {
          "items": {
            "$ref": "#/$defs/ManifestSpace"
          },
          "type": "array"
        }
      },
      "type": "object",
      "required": [
        "scope",
        "max_depth",
        "spaces"
      ],
      "description": "Manifest is an explicit selection of journal prefixes: the scope and every selected descendant with its cutoff, in depth-first preorder by child creation."
    },
    "ManifestSpace": {
      "properties": {
        "space": {
          "$ref": "#/$defs/Space"
        },
        "through": {
          "type": "integer"
        }
      },
      "type": "object",
      "required": [
        "space",
        "through"
      ],
      "description": "ManifestSpace is one selected space and the cutoff its entries were selected through."
    },
    "Path": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "description": "Path is a location in the world: labels from a root organizer down, relative to the world."
    },
    "Space": {
      "properties": {
        "root_id": {
          "type": "string"
        },
        "space_id": {
          "type": "string"
        },
        "path": {
          "$ref": "#/$defs/Path"
        }
      },
      "type": "object",
      "required": [
        "root_id",
        "space_id",
        "path"
      ],
      "description": "Space is a space's identity together with its Dawn path: the labels below the world, so a grant by path applies to it."
    }
  },
  "properties": {
    "manifest": {
      "$ref": "#/$defs/Manifest"
    },
    "digest": {
      "type": "string"
    }
  },
  "type": "object",
  "required": [
    "manifest",
    "digest"
  ],
  "title": "Snapshot",
  "description": "Snapshot is a captured manifest, retained in Bytes as canonical JSON and cited by that digest."
}
