{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://promptedllc.com/access-projection.schema.json",
  "title": "Prompted access projection register",
  "type": "object",
  "required": [
    "schema",
    "version",
    "updated",
    "title",
    "human_surface",
    "rule",
    "topology",
    "depth_lattice",
    "projections",
    "projection_edges"
  ],
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "schema": {
      "const": "prompted.access-projections.v2"
    },
    "version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+$"
    },
    "updated": {
      "type": "string",
      "format": "date"
    },
    "title": {
      "type": "string"
    },
    "human_surface": {
      "type": "string",
      "format": "uri"
    },
    "rule": {
      "type": "string"
    },
    "topology": {
      "type": "object",
      "required": [
        "kind",
        "mandatory_sequence",
        "crowned_route",
        "selection_basis"
      ],
      "properties": {
        "kind": {
          "const": "lattice"
        },
        "mandatory_sequence": {
          "const": false
        },
        "crowned_route": {
          "type": "null"
        },
        "selection_basis": {
          "$ref": "#/$defs/stringList"
        }
      },
      "additionalProperties": false
    },
    "depth_lattice": {
      "type": "array",
      "minItems": 7,
      "maxItems": 7,
      "items": {
        "$ref": "#/$defs/depth"
      }
    },
    "projections": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/projection"
      }
    },
    "projection_edges": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/projectionEdge"
      }
    }
  },
  "$defs": {
    "stringList": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "route": {
      "type": "string",
      "pattern": "^/"
    },
    "depth": {
      "type": "object",
      "required": [
        "id",
        "label",
        "function"
      ],
      "properties": {
        "id": {
          "enum": [
            "signal",
            "orientation",
            "working_model",
            "guided_practice",
            "operational_interface",
            "full_authority",
            "evidence_and_lineage"
          ]
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "function": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "projection": {
      "type": "object",
      "required": [
        "id",
        "title",
        "way_in",
        "route",
        "medium",
        "encounter",
        "time_band",
        "audience",
        "intended_action",
        "authority_ceiling",
        "authority_route",
        "preserved_invariants",
        "intentional_omissions",
        "canonical_sources",
        "rehydration_path",
        "accessibility",
        "success_measures",
        "drift_tests",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9-]+$"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "way_in": {
          "enum": [
            "signal",
            "orientation",
            "working_model",
            "guided_practice",
            "operational_interface",
            "full_authority",
            "evidence_and_lineage"
          ]
        },
        "route": {
          "$ref": "#/$defs/route"
        },
        "medium": {
          "$ref": "#/$defs/stringList"
        },
        "encounter": {
          "enum": [
            "listen",
            "read",
            "explore",
            "practice",
            "operate",
            "verify"
          ]
        },
        "time_band": {
          "enum": [
            "quick",
            "settled",
            "deep",
            "open"
          ]
        },
        "audience": {
          "type": "string",
          "minLength": 1
        },
        "intended_action": {
          "type": "string",
          "minLength": 1
        },
        "authority_ceiling": {
          "type": "string",
          "minLength": 1
        },
        "authority_route": {
          "$ref": "#/$defs/route"
        },
        "preserved_invariants": {
          "$ref": "#/$defs/stringList"
        },
        "intentional_omissions": {
          "$ref": "#/$defs/stringList"
        },
        "canonical_sources": {
          "$ref": "#/$defs/stringList"
        },
        "rehydration_path": {
          "$ref": "#/$defs/stringList"
        },
        "accessibility": {
          "type": "object",
          "required": [
            "time",
            "supports"
          ],
          "properties": {
            "time": {
              "type": "string"
            },
            "supports": {
              "$ref": "#/$defs/stringList"
            }
          },
          "additionalProperties": false
        },
        "success_measures": {
          "$ref": "#/$defs/stringList"
        },
        "drift_tests": {
          "$ref": "#/$defs/stringList"
        },
        "status": {
          "enum": [
            "active",
            "held",
            "superseded"
          ]
        }
      },
      "additionalProperties": false
    },
    "projectionEdge": {
      "type": "object",
      "required": [
        "id",
        "carrier",
        "carrier_route",
        "carrier_kind",
        "parent_projection",
        "relationship",
        "makes_legible",
        "authority_routes",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9-]+$"
        },
        "carrier": {
          "type": "string",
          "minLength": 1
        },
        "carrier_route": {
          "$ref": "#/$defs/route"
        },
        "carrier_kind": {
          "enum": [
            "lecture",
            "audio_edition",
            "audiobook",
            "interactive",
            "chapter",
            "exhibit"
          ]
        },
        "parent_projection": {
          "type": "string",
          "pattern": "^[a-z0-9-]+$"
        },
        "relationship": {
          "enum": [
            "makes-legible",
            "holds-open"
          ]
        },
        "makes_legible": {
          "$ref": "#/$defs/stringList"
        },
        "authority_routes": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/route"
          }
        },
        "status": {
          "enum": [
            "active",
            "held",
            "superseded"
          ]
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
