{
  "type": "object",
  "properties": {
    "dependencies": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "scene_index": {"type": "integer"},
          "shot_index": {"type": "integer"},
          "location_refs": {
            "type": "array",
            "maxItems": 1,
            "description": "At most 1 previous shot reference for background continuity",
            "items": {
              "type": "object",
              "properties": {
                "scene_index": {"type": "integer"},
                "shot_index": {"type": "integer"},
                "reason": {"type": "string", "description": "Brief reason for this reference"},
                "ref_usage": {
                  "type": "string",
                  "enum": ["zoom_in_detail", "exact_background", "atmosphere_reference"],
                  "description": "See the system prompt section defining `ref_usage`."
                },
                "ignore_elements": {
                  "type": "string",
                  "description": "See the system prompt section defining `ignore_elements`."
                },
                "keep_elements": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string",
                        "description": "See the system prompt section defining `keep_elements`."
                      },
                      "kind": {
                        "type": "string",
                        "enum": ["environment", "static_prop"],
                        "description": "See the system prompt section defining the `kind` enum."
                      },
                      "subject_kind": {
                        "type": "string",
                        "enum": ["non_human_visual_element", "human_or_character_reference"],
                        "description": "See the system prompt section defining `subject_kind`."
                      }
                    },
                    "required": ["label", "kind", "subject_kind"],
                    "additionalProperties": false
                  },
                  "description": "See the system prompt section defining `keep_elements`."
                }
              },
              "required": ["scene_index", "shot_index", "reason", "ref_usage", "ignore_elements", "keep_elements"],
              "additionalProperties": false
            }
          }
        },
        "required": ["scene_index", "shot_index", "location_refs"],
        "additionalProperties": false
      }
    }
  },
  "required": ["dependencies"],
  "additionalProperties": false
}
