{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://fartbench.org/data/schemas/fartbench-core-overall-ranking-v1.schema.json",
  "title": "FARTBench Core Overall Ranking V1",
  "description": "A presentation/ranking layer over a frozen fartbench-core-results-v2 document (decision 0021). Factual Score = event-success count + strict-scene-success count over the four requested scenes; ties on Factual Score and full-factual-success count share a rank. Ratings never break a tie. Adopted after the Core R01 reveal; not preregistered for R01.",
  "type": "object",
  "additionalProperties": false,
  "required": ["artifact", "ranking_version", "round", "layer", "adopted_utc", "preregistered", "statement", "decision", "source", "rule", "rows"],
  "properties": {
    "artifact": { "type": "string" },
    "ranking_version": { "const": "fartbench-core-overall-ranking-v1" },
    "round": { "type": "string" },
    "layer": { "const": "official" },
    "adopted_utc": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$" },
    "preregistered": { "const": false },
    "statement": { "const": "Overall Ranking V1 was adopted after the Core R01 reveal; it was not preregistered for R01." },
    "decision": { "type": "string" },
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": ["results_path", "results_sha256", "results_tag", "results_schema_version", "results_data_status"],
      "properties": {
        "results_path": { "type": "string" },
        "results_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
        "results_tag": { "type": "string" },
        "results_schema_version": { "const": "fartbench-core-results-v2" },
        "results_data_status": { "enum": ["revealed-preliminary", "official"] }
      }
    },
    "rule": { "type": "object" },
    "rows": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/row" } }
  },
  "$defs": {
    "count": {
      "type": "object",
      "additionalProperties": false,
      "required": ["success", "not_success", "no_consensus", "evaluated", "requested"],
      "properties": {
        "success": { "type": "integer", "minimum": 0 },
        "not_success": { "type": "integer", "minimum": 0 },
        "no_consensus": { "type": "integer", "minimum": 0 },
        "evaluated": { "type": "integer", "minimum": 0 },
        "requested": { "type": "integer", "minimum": 1 }
      }
    },
    "outcome": { "enum": ["success", "not_success", "no_consensus", null] },
    "scene": {
      "type": "object",
      "additionalProperties": false,
      "required": ["status", "event", "strict", "full", "primary_causal", "points"],
      "properties": {
        "status": { "enum": ["generated", "refused"] },
        "event": { "$ref": "#/$defs/outcome" },
        "strict": { "$ref": "#/$defs/outcome" },
        "full": { "$ref": "#/$defs/outcome" },
        "primary_causal": { "$ref": "#/$defs/outcome" },
        "points": { "type": "integer", "minimum": 0, "maximum": 2 }
      }
    },
    "rating": {
      "type": "object",
      "additionalProperties": false,
      "required": ["mean", "median", "sd", "numeric_responses", "na_responses"],
      "properties": {
        "mean": { "type": ["number", "null"] },
        "median": { "type": ["number", "null"] },
        "sd": { "type": ["number", "null"] },
        "numeric_responses": { "type": "integer", "minimum": 0 },
        "na_responses": { "type": "integer", "minimum": 0 }
      }
    },
    "row": {
      "type": "object",
      "additionalProperties": false,
      "required": ["rank", "shared_rank", "tied_with", "canonical_position", "configuration_id", "label", "family", "factual_score", "factual_score_max",
        "event_success", "strict_scene_success", "full_factual_success", "primary_causal_success", "refusals", "scenes", "ratings",
        "reviewers_per_clip", "human_questions", "human_questions_with_consensus"],
      "properties": {
        "rank": { "type": "integer", "minimum": 1 },
        "shared_rank": { "type": "boolean" },
        "tied_with": { "type": "integer", "minimum": 0 },
        "canonical_position": { "type": "integer", "minimum": 1 },
        "configuration_id": { "type": "string" },
        "label": { "type": "string" },
        "family": { "type": "string" },
        "factual_score": { "type": "integer", "minimum": 0, "maximum": 8 },
        "factual_score_max": { "const": 8 },
        "event_success": { "$ref": "#/$defs/count" },
        "strict_scene_success": { "$ref": "#/$defs/count" },
        "full_factual_success": { "$ref": "#/$defs/count" },
        "primary_causal_success": { "$ref": "#/$defs/count" },
        "refusals": {
          "type": "object",
          "additionalProperties": false,
          "required": ["count", "scenes", "marker"],
          "properties": {
            "count": { "type": "integer", "minimum": 0 },
            "scenes": { "type": "array", "items": { "type": "string" } },
            "marker": { "enum": ["R", null] }
          }
        },
        "scenes": { "type": "object", "additionalProperties": { "$ref": "#/$defs/scene" } },
        "ratings": {
          "type": "object",
          "additionalProperties": false,
          "required": ["acoustic_plausibility", "temporal_causal_coherence", "physical_social_plausibility"],
          "properties": {
            "acoustic_plausibility": { "$ref": "#/$defs/rating" },
            "temporal_causal_coherence": { "$ref": "#/$defs/rating" },
            "physical_social_plausibility": { "$ref": "#/$defs/rating" }
          }
        },
        "reviewers_per_clip": { "type": "integer", "minimum": 1 },
        "human_questions": { "type": "integer", "minimum": 0 },
        "human_questions_with_consensus": { "type": "integer", "minimum": 0 }
      }
    }
  }
}
