{
  "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": "zoom_in_detail: same moment/space/subject, camera reframed (close-up/zoom) — reuse entire frame, add nothing new. exact_background: same room, different moment/pose — keep background as-is, ignore moving people. atmosphere_reference: different room/angle — style/mood only, do not copy layout."
                },
                "ignore_elements": {
                  "type": "string",
                  "description": "What to IGNORE in the reference image. Use common nouns only (no entity IDs). State only definite descriptions of what to ignore — no editing directives and no conditional phrasing (see system.md ignore_elements rules). Leave as empty string ('') if nothing needs to be ignored. E.g. 'Ignore the standing man by the door.' or ''."
                },
                "keep_elements": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string",
                        "description": "Visual description of the non-human element to keep (natural language, common nouns only, no entity IDs). E.g. 'wooden bench against the wall', 'broken vase on the table', 'warm ceiling lamp casting yellow light'."
                      },
                      "kind": {
                        "type": "string",
                        "enum": ["environment", "static_prop"],
                        "description": "environment: walls, floors, furniture layout, lighting, background structure. static_prop: non-human objects (tools, bags, documents, photos, broken items, etc.). See subject_kind for the person / non-person classification of this entry."
                      },
                      "subject_kind": {
                        "type": "string",
                        "enum": ["non_human_visual_element", "human_or_character_reference"],
                        "description": "Explicit subject classification of this entry. non_human_visual_element: the label describes environment or a non-human object. human_or_character_reference: the label describes a person, character, or body. keep_elements may only carry non_human_visual_element entries; a human_or_character_reference entry is rejected — person/character state is routed to scene_consistency, character_state_variant, and semantic_contract_router, not keep_elements."
                      }
                    },
                    "required": ["label", "kind", "subject_kind"],
                    "additionalProperties": false
                  },
                  "description": "Structured list of non-human elements to keep from the previous shot reference. Each entry has a label (visual description), a kind (environment / static_prop), and a subject_kind (person / non-person classification). Character state, person pose, dead/unconscious bodies must NOT appear here — those are routed to scene_consistency.character_state, character_state_variant ref, and semantic_contract_router. For zoom_in_detail, include the main non-human environment/prop carrying over. For atmosphere_reference, usually [] is appropriate."
                }
              },
              "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
}
