{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://spec.super-arc.com/0.1.0/scene.json",
  "title": "Scene",
  "description": "A Scene in the Narrative Spec. Required core is deliberately tiny: a stub is valid, and depth is scored rather than demanded. Depth groups are the optional top-level objects below; a group is started when its key is present and its value is a non-null object, including {}.",
  "type": "object",
  "required": [
    "id",
    "specType",
    "specVersion",
    "name",
    "purpose"
  ],
  "properties": {
    "id": {
      "$ref": "common.json#/$defs/id"
    },
    "specType": {
      "const": "scene"
    },
    "specVersion": {
      "$ref": "common.json#/$defs/specVersion"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "Display name. May change; the slug in id may not."
    },
    "status": {
      "$ref": "common.json#/$defs/status"
    },
    "extensions": {
      "$ref": "common.json#/$defs/extensions"
    },
    "purpose": {
      "type": "string",
      "description": "What this scene is FOR. If it has none, it is not a scene, it is a page."
    },
    "pov": {
      "type": [
        "object",
        "null"
      ],
      "description": "Whose head the reader is in, and how close.",
      "properties": {
        "character": {
          "$ref": "common.json#/$defs/ref"
        },
        "distance": {
          "type": "string"
        },
        "notes": {
          "type": "string"
        }
      }
    },
    "location": {
      "type": [
        "object",
        "null"
      ],
      "description": "Where it happens.",
      "properties": {
        "location": {
          "$ref": "common.json#/$defs/ref"
        },
        "notes": {
          "type": "string"
        }
      }
    },
    "inOut": {
      "type": [
        "object",
        "null"
      ],
      "description": "The state of the world on the way in and on the way out. If these match, nothing happened.",
      "properties": {
        "in": {
          "type": "string",
          "description": "Where things stand as the scene opens."
        },
        "out": {
          "type": "string",
          "description": "What is different when it closes."
        }
      }
    },
    "beats": {
      "type": [
        "object",
        "null"
      ],
      "description": "The turns, in order.",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "cast": {
      "type": [
        "object",
        "null"
      ],
      "description": "Who is present, and who is only referred to.",
      "properties": {
        "present": {
          "type": "array",
          "items": {
            "$ref": "common.json#/$defs/ref"
          }
        },
        "offstage": {
          "type": "array",
          "items": {
            "$ref": "common.json#/$defs/ref"
          }
        }
      }
    },
    "events": {
      "type": [
        "object",
        "null"
      ],
      "description": "In-world events this scene dramatises. A Scene is not an Event: the Event is what happened in the world, the Scene is where a reader watches it.",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "common.json#/$defs/ref"
          }
        }
      }
    }
  },
  "x-depthOrder": [
    "pov",
    "location",
    "inOut",
    "beats",
    "cast",
    "events"
  ]
}
