{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "DGen 5.0 completed scene interpretation v1.1",
  "description": "Separate NoPixel 5.0 DGen project. Shape validation is not identity, consent, ingestion, or scoring. Hardcore 64 uses a separate player agreement.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "event_id",
    "scene_id",
    "server_era",
    "player_discord_id",
    "channel_id",
    "stream_id",
    "character_name",
    "started_at",
    "ended_at",
    "observed_at",
    "activity",
    "interpretation",
    "apparent_outcome",
    "observation_basis",
    "confidence",
    "model_version",
    "rubric_version",
    "private_evidence_ref",
    "context",
    "program_id",
    "participant_agreement_version",
    "activity_catalog_version",
    "activity_code"
  ],
  "properties": {
    "schema_version": {
      "const": "dgen.scene.v1.1"
    },
    "event_id": {
      "type": "string",
      "format": "uuid"
    },
    "scene_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "server_era": {
      "const": "V"
    },
    "player_discord_id": {
      "type": "string",
      "pattern": "^[0-9]{17,20}$"
    },
    "channel_id": {
      "type": "string",
      "pattern": "^[0-9]{1,30}$"
    },
    "stream_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "character_name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "started_at": {
      "type": "string",
      "format": "date-time"
    },
    "ended_at": {
      "type": "string",
      "format": "date-time"
    },
    "observed_at": {
      "type": "string",
      "format": "date-time"
    },
    "activity": {
      "type": "string",
      "enum": [
        "pursuit",
        "robbery",
        "other",
        "uncertain"
      ]
    },
    "interpretation": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2500
    },
    "apparent_outcome": {
      "type": "string",
      "enum": [
        "escape",
        "capture",
        "downed",
        "unknown"
      ]
    },
    "observation_basis": {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "frames",
          "audio",
          "chat"
        ]
      }
    },
    "confidence": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "maximum": 1
    },
    "model_version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "rubric_version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "private_evidence_ref": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200
    },
    "context": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "interaction",
        "opposition",
        "continuation",
        "repeated_activity",
        "rationale"
      ],
      "properties": {
        "interaction": {
          "type": "string",
          "enum": [
            "observed",
            "not_observed",
            "uncertain"
          ]
        },
        "opposition": {
          "type": "string",
          "enum": [
            "observed",
            "not_observed",
            "uncertain"
          ]
        },
        "continuation": {
          "type": "string",
          "enum": [
            "observed",
            "not_observed",
            "uncertain"
          ]
        },
        "repeated_activity": {
          "type": "string",
          "enum": [
            "observed",
            "not_observed",
            "uncertain"
          ]
        },
        "rationale": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1500
        }
      }
    },
    "program_id": {
      "const": "dgen"
    },
    "participant_agreement_version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "activity_catalog_version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "activity_code": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9_.-]{0,119}$"
    }
  }
}
