{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "annotation.schema.json",
  "title": "Per-clip annotation (S6b merged)",
  "description": "Per-clip action-annotation contract — see annotation.example.json for a worked example. Additional vendor fields may be present and can be ignored.",
  "type": "object",
  "required": [
    "clip_id",
    "video_id",
    "transform_version",
    "viewpoint",
    "domain",
    "duration_s",
    "caption",
    "asr",
    "steps",
    "segments"
  ],
  "properties": {
    "clip_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{11}_[0-9]+_[0-9]+$"
    },
    "video_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{11}$"
    },
    "transform_version": {
      "type": "string"
    },
    "viewpoint": {
      "enum": [
        "head_cam",
        "hands_only_static",
        "exo",
        "unclear"
      ]
    },
    "egocentric_score": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "maximum": 1
    },
    "domain": {
      "enum": [
        "cooking",
        "diy_repair",
        "assembly",
        "crafts",
        "household",
        "none"
      ]
    },
    "language": {
      "type": [
        "string",
        "null"
      ]
    },
    "duration_s": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "fps": {
      "type": [
        "number",
        "null"
      ]
    },
    "width": {
      "type": [
        "integer",
        "null"
      ]
    },
    "height": {
      "type": [
        "integer",
        "null"
      ]
    },
    "caption": {
      "type": "string"
    },
    "asr": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "start",
          "end",
          "text"
        ],
        "properties": {
          "start": {
            "type": "number",
            "minimum": 0
          },
          "end": {
            "type": "number",
            "minimum": 0
          },
          "text": {
            "type": "string"
          },
          "words": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "w",
                "s",
                "e"
              ],
              "properties": {
                "w": {
                  "type": "string"
                },
                "s": {
                  "type": "number"
                },
                "e": {
                  "type": "number"
                }
              }
            }
          }
        }
      }
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "step_index",
          "start",
          "end",
          "summary"
        ],
        "properties": {
          "step_index": {
            "type": "integer",
            "minimum": 1
          },
          "start": {
            "type": "number",
            "minimum": 0
          },
          "end": {
            "type": "number",
            "minimum": 0
          },
          "summary": {
            "type": "string"
          }
        }
      }
    },
    "segments": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "start",
          "end",
          "action_verb"
        ],
        "properties": {
          "start": {
            "type": "number",
            "minimum": 0
          },
          "end": {
            "type": "number",
            "minimum": 0
          },
          "step_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "action_verb": {
            "type": "string"
          },
          "taxonomy": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "epic_verb_id": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "epic_verb": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "epic_noun_id": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "epic_noun": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "method": {
                "enum": [
                  "exact_key",
                  "exact_instance",
                  "cosine",
                  "guided_choice",
                  null
                ]
              },
              "sim": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "vocab": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "out_of_vocab": {
                "type": "boolean"
              }
            }
          },
          "caption": {
            "type": [
              "string",
              "null"
            ]
          },
          "asr_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "motion_score": {
            "type": [
              "number",
              "null"
            ]
          },
          "egomotion_score": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      }
    }
  }
}