{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://data.clap.gg/downloads/save-one-schema.json",
  "title": "Clap Save One Mission Record",
  "description": "Proposed record structure for a single Save One mission submission. This is an illustrative product design from Clap's design-partner stage: required fields describe the core record every pilot would deliver, while optional fields are candidates whose inclusion, naming, and delivery format are finalized per pilot with the partner. It is not a description of a production dataset.",
  "type": "object",
  "required": [
    "dataset_version",
    "mission_id",
    "prompt_version",
    "submission_id",
    "participant_id",
    "response",
    "capture",
    "transcript",
    "quality",
    "provenance"
  ],
  "properties": {
    "notice": {
      "type": "string",
      "description": "Optional human-readable note carried on illustrative or sample records."
    },
    "dataset_version": {
      "type": "string",
      "description": "Version identifier for the dataset/delivery this record belongs to."
    },
    "mission_id": {
      "type": "string",
      "description": "Identifier of the Save One mission (one mission spec, one prompt family)."
    },
    "prompt_version": {
      "type": "string",
      "description": "Version of the exact prompt shown to the participant, so records are reproducible across prompt iterations."
    },
    "submission_id": {
      "type": "string",
      "description": "Unique identifier of this submission."
    },
    "participant_id": {
      "type": "string",
      "description": "Pseudonymous participant identifier. Never a name, handle, or contact detail."
    },
    "response": {
      "type": "object",
      "description": "What the participant chose and how quickly.",
      "required": ["selected_option_id", "options_presented", "time_to_choice_ms"],
      "properties": {
        "selected_option_id": {
          "type": "string",
          "description": "Identifier of the option the participant saved."
        },
        "options_presented": {
          "type": "array",
          "description": "Option identifiers in the order presented.",
          "items": { "type": "string" },
          "minItems": 2
        },
        "time_to_choice_ms": {
          "type": "integer",
          "minimum": 0,
          "description": "Milliseconds from options shown to selection."
        },
        "explanation_duration_ms": {
          "type": "integer",
          "minimum": 0,
          "description": "Optional duration of the on-camera explanation in milliseconds."
        }
      }
    },
    "capture": {
      "type": "object",
      "description": "How the response was captured.",
      "required": ["modalities", "device_class"],
      "properties": {
        "modalities": {
          "type": "array",
          "description": "Signal families captured in this submission.",
          "items": {
            "type": "string",
            "enum": ["video", "audio", "choice", "timing"]
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "camera_pov": {
          "type": "string",
          "enum": ["front_facing", "rear_facing", "unknown"],
          "description": "Camera orientation used for the recording, when video is captured."
        },
        "device_class": {
          "type": "string",
          "enum": ["mobile_web", "mobile_app", "desktop_web"],
          "description": "Class of device the participant used."
        }
      }
    },
    "media": {
      "type": "object",
      "description": "Media artifacts for this submission. Delivery formats and paths are configured per pilot.",
      "required": ["video_path"],
      "properties": {
        "video_path": {
          "type": "string",
          "description": "Relative path of the video artifact within the delivery."
        },
        "audio_path": {
          "type": "string",
          "description": "Optional isolated audio export. Availability and format are scoped per pilot rather than assumed."
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$",
          "description": "SHA-256 checksum of the primary media artifact."
        }
      }
    },
    "transcript": {
      "type": "object",
      "description": "Verbatim transcript of the spoken explanation.",
      "required": ["text", "language"],
      "properties": {
        "text": { "type": "string" },
        "language": {
          "type": "string",
          "description": "BCP 47 language tag, e.g. en-US."
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Transcription confidence score."
        }
      }
    },
    "labels": {
      "type": "object",
      "description": "Optional structured explanation labels. The label taxonomy is defined with the partner per mission.",
      "properties": {
        "primary_reason": {
          "type": "string",
          "description": "Primary reasoning category behind the choice."
        },
        "secondary_reasons": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Additional reasoning categories, if any."
        },
        "sentiment": {
          "type": "string",
          "enum": ["positive", "neutral", "negative", "mixed"]
        },
        "certainty": {
          "type": "string",
          "enum": ["high", "medium", "low"]
        }
      }
    },
    "quality": {
      "type": "object",
      "description": "Acceptance checks applied to the submission. Check definitions are agreed with the partner before collection.",
      "required": ["prompt_compliance", "accepted"],
      "properties": {
        "prompt_compliance": {
          "type": "string",
          "enum": ["pass", "review", "fail"],
          "description": "Whether the response answers the intended prompt."
        },
        "visual_quality": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5,
          "description": "Video usability rating."
        },
        "audio_quality": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5,
          "description": "Audio intelligibility rating."
        },
        "single_subject": {
          "type": "boolean",
          "description": "Exactly one participant appears in the recording."
        },
        "bystander_detected": {
          "type": "boolean",
          "description": "Whether a non-participant is visible or audible."
        },
        "accepted": {
          "type": "boolean",
          "description": "Whether the submission passed all acceptance checks."
        },
        "rejection_reasons": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Reasons a submission was rejected; empty when accepted."
        }
      }
    },
    "provenance": {
      "type": "object",
      "description": "Consent and permitted-use references carried on every record.",
      "required": ["consent_record_id", "disclosure_version", "permitted_use_scope", "ai_training_allowed"],
      "properties": {
        "consent_record_id": {
          "type": "string",
          "description": "Reference to the versioned consent record for this submission."
        },
        "disclosure_version": {
          "type": "string",
          "description": "Version of the mission-specific disclosure shown before submission."
        },
        "permitted_use_scope": {
          "type": "array",
          "items": { "type": "string" },
          "minItems": 1,
          "description": "Agreed uses for this record, e.g. evaluation, research. Scoped per pilot with counsel."
        },
        "ai_training_allowed": {
          "type": "boolean",
          "description": "Whether AI-training use is permitted for this record. False unless explicitly granted in the pilot terms."
        }
      }
    }
  }
}
