{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://duellab.org/benchmark/charts_data.schema.json",
  "title": "Public benchmark charts_data.json v2",
  "description": "Payload for charts.html; produced by boardgame_cli (see crates/boardgame_cli/src/public_benchmark/charts_payload.rs).",
  "type": "object",
  "required": [
    "schema_version",
    "snapshot_id",
    "public_release_id",
    "generated_at",
    "benchmark_line",
    "results_cut_id",
    "suite_line_id",
    "suite_version",
    "version_display",
    "heatmap_track_id",
    "game_order",
    "models",
    "economics_chart"
  ],
  "additionalProperties": false,
  "properties": {
    "schema_version": { "const": 2 },
    "public_release_id": { "type": "string", "pattern": "^gb2-[0-9]{8}-[a-f0-9]{12}$" },
    "generated_at": { "type": "string", "format": "date-time" },
    "benchmark_line": { "const": "gamebench2" },
    "snapshot_id": { "type": "string", "minLength": 1 },
    "results_cut_id": { "type": "string", "minLength": 1 },
    "suite_line_id": { "type": "string", "minLength": 1 },
    "suite_version": { "type": "string" },
    "version_display": { "type": "string" },
    "rating_method": { "$ref": "#/definitions/ratingMethod" },
    "heatmap_track_id": { "type": "string", "minLength": 1 },
    "game_order": {
      "type": "array",
      "items": { "type": "string" }
    },
    "games": {
      "type": "array",
      "items": { "$ref": "#/definitions/publicGameInfo" }
    },
    "models": {
      "type": "array",
      "items": { "$ref": "#/definitions/chartsModelRow" }
    },
    "economics_chart": {
      "type": "object",
      "required": ["enabled", "eligible_aliases"],
      "additionalProperties": false,
      "properties": {
        "enabled": { "type": "boolean" },
        "eligible_aliases": {
          "type": "array",
          "items": { "type": "string" }
        }
      }
    },
    "versus_totals_tracks": { "$ref": "#/definitions/chartsVersusTotalsTracks" },
    "versus_totals_all": { "$ref": "#/definitions/versusMatrix" }
  },
  "definitions": {
    "publicGameInfo": {
      "type": "object",
      "required": ["alias", "name", "slug"],
      "additionalProperties": false,
      "properties": {
        "alias": { "type": "string", "minLength": 1 },
        "name": { "type": "string", "minLength": 1 },
        "slug": { "type": "string", "minLength": 1 }
      }
    },
    "ratingMethod": {
      "type": "object",
      "required": ["method", "first_player_advantage", "bootstrap_iterations"],
      "additionalProperties": false,
      "properties": {
        "method": { "type": "string", "minLength": 1 },
        "first_player_advantage": { "type": "boolean" },
        "bootstrap_iterations": { "type": "integer", "minimum": 0 }
      }
    },
    "chartsCodegenCostUsd": {
      "type": "object",
      "required": ["mean", "min", "max", "total", "run_count"],
      "additionalProperties": false,
      "properties": {
        "mean": { "type": "number" },
        "median": { "type": "number", "minimum": 0 },
        "min": { "type": "number" },
        "max": { "type": "number" },
        "total": { "type": "number", "minimum": 0 },
        "cell_count": { "type": "integer", "minimum": 0 },
        "run_count": { "type": "integer", "minimum": 0 },
        "admitted_cell_count": { "type": "integer", "minimum": 0 },
        "failed_cell_count": { "type": "integer", "minimum": 0 },
        "recorded_attempt_count": { "type": "integer", "minimum": 0 },
        "token_priced_attempt_count": { "type": "integer", "minimum": 0 },
        "legacy_label_count": { "type": "integer", "minimum": 0 },
        "cost_basis_counts": {
          "type": "object",
          "additionalProperties": { "type": "integer", "minimum": 0 }
        },
        "pricing_table_versions": {
          "type": "object",
          "additionalProperties": { "type": "integer", "minimum": 0 }
        },
        "evidence_basis": { "type": "string" }
      }
    },
    "chartsCodegenOutputTokens": {
      "type": "object",
      "required": ["output_mean", "output_min", "output_max", "run_count", "attempt_count"],
      "additionalProperties": false,
      "properties": {
        "output_mean": { "type": "number", "minimum": 0 },
        "output_min": { "type": "integer", "minimum": 0 },
        "output_max": { "type": "integer", "minimum": 0 },
        "run_count": { "type": "integer", "minimum": 0 },
        "attempt_count": { "type": "integer", "minimum": 0 }
      }
    },
    "chartsCodegenLatencyMs": {
      "type": "object",
      "required": ["mean_ms", "min_ms", "max_ms", "run_count", "attempt_count"],
      "additionalProperties": false,
      "properties": {
        "mean_ms": { "type": "number", "minimum": 0 },
        "min_ms": { "type": "integer", "minimum": 0 },
        "max_ms": { "type": "integer", "minimum": 0 },
        "run_count": { "type": "integer", "minimum": 0 },
        "attempt_count": { "type": "integer", "minimum": 0 }
      }
    },
    "chartsLevelAgg": {
      "type": "object",
      "required": ["mean", "min", "max"],
      "additionalProperties": false,
      "properties": {
        "mean": { "type": "number" },
        "min": { "type": "number" },
        "max": { "type": "number" }
      }
    },
    "chartsReasoning": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "highest": { "type": "number" },
        "medium": { "type": "number" },
        "none": { "type": "number" }
      }
    },
    "chartsReasoningAgg": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "highest": { "$ref": "#/definitions/chartsLevelAgg" },
        "medium": { "$ref": "#/definitions/chartsLevelAgg" },
        "none": { "$ref": "#/definitions/chartsLevelAgg" }
      }
    },
    "chartsScoreDiagnostics": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "expected_score": { "type": "number" },
        "score_interval_low": { "type": "number" },
        "score_interval_high": { "type": "number" },
        "ceiling_score": { "type": "number" },
        "reliability_score": { "type": "number" },
        "uncertainty_avg": { "type": "number" },
        "uncertainty_penalty": {
          "type": "number",
          "description": "Expected score minus public score; retained under the legacy field name for compatibility and may include uncertainty and generation-failure adjustments."
        },
        "reasoning_variance": { "type": "number" }
      }
    },
    "chartsScoreDiagnosticsByReasoning": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "highest": { "$ref": "#/definitions/chartsScoreDiagnostics" },
        "medium": { "$ref": "#/definitions/chartsScoreDiagnostics" },
        "none": { "$ref": "#/definitions/chartsScoreDiagnostics" }
      }
    },
    "perGameMap": {
      "type": "object",
      "additionalProperties": { "type": "number" }
    },
    "perGameTracks": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "highest": { "$ref": "#/definitions/perGameMap" },
        "medium": { "$ref": "#/definitions/perGameMap" },
        "none": { "$ref": "#/definitions/perGameMap" }
      }
    },
    "chartsMatchTotals": {
      "type": "object",
      "required": ["wins", "losses", "draws"],
      "additionalProperties": false,
      "properties": {
        "wins": { "type": "integer", "minimum": 0 },
        "losses": { "type": "integer", "minimum": 0 },
        "draws": { "type": "integer", "minimum": 0 }
      }
    },
    "versusRowTotalsMap": {
      "type": "object",
      "additionalProperties": { "$ref": "#/definitions/chartsMatchTotals" }
    },
    "versusMatrix": {
      "type": "object",
      "additionalProperties": { "$ref": "#/definitions/versusRowTotalsMap" }
    },
    "chartsVersusTotalsTracks": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "highest": { "$ref": "#/definitions/versusMatrix" },
        "medium": { "$ref": "#/definitions/versusMatrix" },
        "none": { "$ref": "#/definitions/versusMatrix" }
      }
    },
    "perGameMatchTotalsMap": {
      "type": "object",
      "additionalProperties": { "$ref": "#/definitions/chartsMatchTotals" }
    },
    "perGameMatchTracks": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "highest": { "$ref": "#/definitions/perGameMatchTotalsMap" },
        "medium": { "$ref": "#/definitions/perGameMatchTotalsMap" },
        "none": { "$ref": "#/definitions/perGameMatchTotalsMap" }
      }
    },
    "chartsMatchTotalsTracks": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "highest": { "$ref": "#/definitions/chartsMatchTotals" },
        "medium": { "$ref": "#/definitions/chartsMatchTotals" },
        "none": { "$ref": "#/definitions/chartsMatchTotals" }
      }
    },
    "chartsCostByReasoning": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "highest": { "$ref": "#/definitions/chartsCodegenCostUsd" },
        "medium": { "$ref": "#/definitions/chartsCodegenCostUsd" },
        "none": { "$ref": "#/definitions/chartsCodegenCostUsd" }
      }
    },
    "chartsOutputTokensByReasoning": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "highest": { "$ref": "#/definitions/chartsCodegenOutputTokens" },
        "medium": { "$ref": "#/definitions/chartsCodegenOutputTokens" },
        "none": { "$ref": "#/definitions/chartsCodegenOutputTokens" }
      }
    },
    "chartsLatencyByReasoning": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "highest": { "$ref": "#/definitions/chartsCodegenLatencyMs" },
        "medium": { "$ref": "#/definitions/chartsCodegenLatencyMs" },
        "none": { "$ref": "#/definitions/chartsCodegenLatencyMs" }
      }
    },
    "chartsEconomicsScores": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "all": { "type": "number" },
        "highest": { "type": "number" },
        "medium": { "type": "number" },
        "none": { "type": "number" }
      }
    },
    "chartsModelRow": {
      "type": "object",
      "required": [
        "id",
        "canonical_public_row_identity",
        "overall_eligibility_flag",
        "overall_official_rank",
        "overall_ranking_status",
        "overall_ineligibility_reason_codes",
        "model_slug",
        "display_name",
        "provider_key",
        "provider_company",
        "provider_color",
        "provider_text_color",
        "last_measured_at",
        "first_seen_at",
        "is_recent_addition",
        "rank_movement",
        "rank_movement_baseline_at",
        "overall",
        "reasoning",
        "reasoning_settings",
        "reasoning_agg",
        "per_game_tracks",
        "generation_metadata",
        "generation_quality_by_reasoning"
      ],
      "additionalProperties": false,
      "properties": {
        "id": { "type": "string" },
        "canonical_public_row_identity": { "type": "string", "pattern": "^publication-row\\.v1:overall:" },
        "overall_eligibility_flag": {
          "type": "boolean",
          "description": "True only when the Overall row has complete qualifying evidence; partial rows remain false."
        },
        "overall_official_rank": {
          "type": ["integer", "null"],
          "minimum": 1,
          "description": "Official Overall rank shared by complete and partial rows in schema v2."
        },
        "overall_ranking_status": { "enum": ["ranked", "partial"] },
        "overall_ineligibility_reason_codes": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "enum": [
              "missing_bracket_scores",
              "unknown_capability_evidence",
              "missing_or_non_distinct_settings",
              "untested_or_ineligible_settings",
              "missing_generation_quality",
              "below_generation_quality_threshold"
            ]
          }
        },
        "model_slug": { "type": "string", "minLength": 1 },
        "display_name": { "type": "string" },
        "provider_key": { "type": "string" },
        "provider_company": { "type": "string" },
        "provider_color": { "type": "string" },
        "provider_text_color": { "type": "string" },
        "last_measured_at": { "type": ["string", "null"] },
        "first_seen_at": { "type": ["string", "null"] },
        "is_recent_addition": { "type": "boolean" },
        "rank_movement": { "type": ["integer", "null"] },
        "rank_movement_baseline_at": { "type": ["string", "null"] },
        "overall": { "$ref": "#/definitions/chartsLevelAgg" },
        "reasoning": { "$ref": "#/definitions/chartsReasoning" },
        "reasoning_labels": {
          "type": "object",
          "required": ["highest", "medium", "none"],
          "additionalProperties": false,
          "properties": {
            "highest": { "type": "string", "minLength": 1 },
            "medium": { "type": "string", "minLength": 1 },
            "none": { "type": "string", "minLength": 1 }
          }
        },
        "reasoning_settings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "intensive": { "type": "string", "minLength": 1 },
            "balanced": { "type": "string", "minLength": 1 },
            "baseline": { "type": "string", "minLength": 1 }
          }
        },
        "reasoning_agg": { "$ref": "#/definitions/chartsReasoningAgg" },
        "per_game_tracks": { "$ref": "#/definitions/perGameTracks" },
        "per_game_all": { "$ref": "#/definitions/perGameMap" },
        "per_game_raw_elo_tracks": { "$ref": "#/definitions/perGameTracks" },
        "per_game_raw_elo_all": { "$ref": "#/definitions/perGameMap" },
        "score_diagnostics": { "$ref": "#/definitions/chartsScoreDiagnostics" },
        "score_diagnostics_by_reasoning": {
          "$ref": "#/definitions/chartsScoreDiagnosticsByReasoning"
        },
        "per_game": { "$ref": "#/definitions/perGameMap" },
        "codegen_cost_usd": { "$ref": "#/definitions/chartsCodegenCostUsd" },
        "codegen_cost_by_reasoning": { "$ref": "#/definitions/chartsCostByReasoning" },
        "codegen_cost_by_setting": {
          "type": "object",
          "additionalProperties": { "$ref": "#/definitions/chartsCodegenCostUsd" }
        },
        "codegen_output_tokens": { "$ref": "#/definitions/chartsCodegenOutputTokens" },
        "codegen_output_tokens_by_reasoning": {
          "$ref": "#/definitions/chartsOutputTokensByReasoning"
        },
        "codegen_latency_ms": { "$ref": "#/definitions/chartsCodegenLatencyMs" },
        "codegen_latency_ms_by_reasoning": {
          "$ref": "#/definitions/chartsLatencyByReasoning"
        },
        "economics": { "$ref": "#/definitions/chartsEconomicsScores" },
        "match_totals_tracks": { "$ref": "#/definitions/chartsMatchTotalsTracks" },
        "match_totals_all": { "$ref": "#/definitions/chartsMatchTotals" },
        "per_game_match_totals_tracks": { "$ref": "#/definitions/perGameMatchTracks" },
        "per_game_match_totals_all": { "$ref": "#/definitions/perGameMatchTotalsMap" },
        "generation_metadata": { "$ref": "#/definitions/generationMetadata" },
        "generation_quality_by_reasoning": {
          "$ref": "#/definitions/generationQualityByReasoning"
        }
      }
    },
    "generationQualityStats": {
      "type": "object",
      "required": [
        "evaluated_cells",
        "admitted_plugins",
        "model_code_failures",
        "model_code_failure_rate"
      ],
      "additionalProperties": false,
      "properties": {
        "evaluated_cells": { "type": "integer", "minimum": 0 },
        "admitted_plugins": { "type": "integer", "minimum": 0 },
        "first_pass_admitted": { "type": "integer", "minimum": 0 },
        "repaired_admitted": { "type": "integer", "minimum": 0 },
        "model_code_failures": { "type": "integer", "minimum": 0 },
        "model_code_failure_rate": { "type": "number", "minimum": 0, "maximum": 1 },
        "first_pass_rate": { "type": "number", "minimum": 0, "maximum": 1 },
        "repaired_rate": { "type": "number", "minimum": 0, "maximum": 1 },
        "infra_failures_excluded": { "type": "integer", "minimum": 0 },
        "failed_game_aliases": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 },
          "uniqueItems": true
        },
        "infra_excluded_game_aliases": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 },
          "uniqueItems": true
        }
      }
    },
    "generationQualityByReasoning": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "intensive": { "$ref": "#/definitions/generationQualityStats" },
        "balanced": { "$ref": "#/definitions/generationQualityStats" },
        "baseline": { "$ref": "#/definitions/generationQualityStats" },
        "highest": { "$ref": "#/definitions/generationQualityStats" },
        "medium": { "$ref": "#/definitions/generationQualityStats" },
        "none": { "$ref": "#/definitions/generationQualityStats" }
      }
    },
    "generationSettingsPublic": {
      "type": "object",
      "required": ["temperature", "max_tokens", "stream"],
      "additionalProperties": false,
      "properties": {
        "temperature": { "type": ["number", "null"] },
        "max_tokens": { "type": ["integer", "null"], "minimum": 0 },
        "stream": { "type": ["boolean", "null"] }
      }
    },
    "reasoningProvenance": {
      "type": "object",
      "required": [
        "reasoning_bucket",
        "reasoning_bucket_label",
        "reasoning_bracket",
        "reasoning_policy_version",
        "reasoning_catalog_sha256",
        "provider",
        "provider_model",
        "provider_route",
        "requested_reasoning_effort",
        "provider_setting_label",
        "reasoning_request_mode",
        "provider_reasoning_params",
        "prompt_identity",
        "prompt_profile",
        "code_prompt_version",
        "code_output_mode",
        "generation_settings_public"
      ],
      "additionalProperties": false,
      "properties": {
        "reasoning_bucket": { "type": "string", "minLength": 1 },
        "reasoning_bucket_label": { "type": "string", "minLength": 1 },
        "reasoning_bracket": {
          "type": ["string", "null"],
          "enum": ["baseline", "balanced", "intensive", "mixed", null]
        },
        "reasoning_policy_version": { "type": "string", "minLength": 1 },
        "reasoning_catalog_sha256": { "type": "string", "minLength": 1 },
        "provider": { "type": "string", "minLength": 1 },
        "provider_model": { "type": "string", "minLength": 1 },
        "provider_route": { "type": "string", "minLength": 1 },
        "requested_reasoning_effort": { "type": ["string", "null"] },
        "provider_setting_label": { "type": ["string", "null"] },
        "reasoning_request_mode": {
          "type": ["string", "null"],
          "enum": ["effort", "toggle", "omitted", "budget", null]
        },
        "provider_reasoning_params": { "type": "object" },
        "prompt_identity": { "type": "string", "minLength": 1 },
        "prompt_profile": { "type": "string", "minLength": 1 },
        "code_prompt_version": { "type": "string", "minLength": 1 },
        "code_output_mode": { "type": "string", "minLength": 1 },
        "generation_settings_public": { "$ref": "#/definitions/generationSettingsPublic" }
      }
    },
    "generationPolicy": {
      "type": "object",
      "required": [
        "generation_policy",
        "timeout_mode",
        "stream_idle_timeout_seconds",
        "strict_wall_clock_timeout_seconds",
        "streaming_enabled"
      ],
      "additionalProperties": false,
      "properties": {
        "generation_policy": {
          "enum": [
            "quality_generation_policy",
            "latency_bounded_generation_policy",
            "diagnostic_generation_policy",
            "unknown_legacy"
          ]
        },
        "timeout_mode": { "type": "string", "minLength": 1 },
        "stream_idle_timeout_seconds": { "type": ["integer", "null"], "minimum": 0 },
        "strict_wall_clock_timeout_seconds": { "type": ["integer", "null"], "minimum": 0 },
        "streaming_enabled": { "type": ["boolean", "null"] }
      }
    },
    "generationTiming": {
      "type": "object",
      "required": [
        "generation_started_at",
        "generation_completed_at",
        "generation_wall_clock_seconds",
        "stream_progress_event_count",
        "first_progress_after_seconds",
        "finish_reason"
      ],
      "additionalProperties": false,
      "properties": {
        "generation_started_at": { "type": ["string", "null"] },
        "generation_completed_at": { "type": ["string", "null"] },
        "generation_wall_clock_seconds": { "type": ["number", "null"], "minimum": 0 },
        "stream_progress_event_count": { "type": ["integer", "null"], "minimum": 0 },
        "first_progress_after_seconds": { "type": ["number", "null"], "minimum": 0 },
        "finish_reason": { "type": "string", "minLength": 1 }
      }
    },
    "generationAttemptEvidence": {
      "type": "object",
      "required": ["indexed_attempts"],
      "additionalProperties": false,
      "properties": {
        "indexed_attempts": { "type": "integer", "minimum": 1 },
        "finish_reasons": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 },
          "uniqueItems": true
        },
        "finish_reason_observations": { "type": "integer", "minimum": 0 },
        "requested_max_output_tokens": {
          "type": "array",
          "items": { "type": "integer", "minimum": 0 },
          "uniqueItems": true
        },
        "requested_max_output_token_observations": { "type": "integer", "minimum": 0 },
        "effective_max_output_tokens": {
          "type": "array",
          "items": { "type": "integer", "minimum": 0 },
          "uniqueItems": true
        },
        "effective_max_output_token_observations": { "type": "integer", "minimum": 0 },
        "stream_modes": {
          "type": "array",
          "items": { "enum": ["stream", "non_stream"] },
          "uniqueItems": true
        },
        "stream_mode_observations": { "type": "integer", "minimum": 0 },
        "total_output_tokens": { "type": "integer", "minimum": 0 },
        "output_token_observations": { "type": "integer", "minimum": 0 },
        "total_reasoning_output_tokens": { "type": "integer", "minimum": 0 },
        "reasoning_token_observations": { "type": "integer", "minimum": 0 },
        "total_visible_output_tokens": { "type": "integer", "minimum": 0 },
        "visible_token_observations": { "type": "integer", "minimum": 0 },
        "provider_post_attempts": { "type": "integer", "minimum": 0 },
        "provider_post_attempt_observations": { "type": "integer", "minimum": 0 },
        "reconciliation_get_attempts": { "type": "integer", "minimum": 0 },
        "reconciliation_get_attempt_observations": { "type": "integer", "minimum": 0 }
      }
    },
    "generationMetadata": {
      "type": "object",
      "required": ["reasoning_provenance", "generation_policy", "generation_timing"],
      "additionalProperties": false,
      "properties": {
        "reasoning_provenance": { "$ref": "#/definitions/reasoningProvenance" },
        "generation_policy": { "$ref": "#/definitions/generationPolicy" },
        "generation_timing": { "$ref": "#/definitions/generationTiming" },
        "attempt_evidence": { "$ref": "#/definitions/generationAttemptEvidence" }
      }
    }
  }
}
