{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aliakbari.dev/schemas/benchmark-v1.json",
  "title": "Benchmark report (reports/*.json), written by a generator, never edited by hand",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "id",
    "evidence_id",
    "commit",
    "generated_at",
    "generator",
    "environment",
    "scenario",
    "series",
    "raw",
    "raw_sha256",
    "limitations"
  ],
  "properties": {
    "schema": { "const": "https://aliakbari.dev/schemas/benchmark-v1.json" },
    "id": { "$ref": "defs-v1.json#/$defs/id" },
    "title": { "$ref": "defs-v1.json#/$defs/shortText" },
    "evidence_id": { "$ref": "defs-v1.json#/$defs/id" },
    "commit": { "$ref": "defs-v1.json#/$defs/sha" },
    "generated_at": { "$ref": "defs-v1.json#/$defs/rfc3339" },
    "generator": { "$ref": "defs-v1.json#/$defs/shortText" },
    "environment": { "$ref": "defs-v1.json#/$defs/envDetails" },
    "scenario": {
      "type": "object",
      "maxProperties": 20,
      "additionalProperties": {
        "anyOf": [
          { "type": "string", "maxLength": 120 },
          { "type": "number" },
          { "type": "boolean" },
          { "type": "array", "maxItems": 20, "items": { "anyOf": [{ "type": "number" }, { "type": "string", "maxLength": 120 }] } }
        ]
      }
    },
    "series": {
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["concurrency"],
        "properties": {
          "concurrency": { "type": "integer", "minimum": 1 },
          "p50_ms": { "type": "number", "minimum": 0 },
          "p95_ms": { "type": "number", "minimum": 0 },
          "p99_ms": { "type": "number", "minimum": 0 },
          "rps": { "type": "number", "minimum": 0 },
          "error_rate": { "type": "number", "minimum": 0, "maximum": 1 },
          "quota_deviation_pct": { "type": "number" },
          "failover_ms": { "type": "number", "minimum": 0 },
          "samples": { "type": "integer", "minimum": 1 }
        }
      }
    },
    "raw": { "$ref": "defs-v1.json#/$defs/relPath" },
    "raw_sha256": { "$ref": "defs-v1.json#/$defs/sha256" },
    "tolerance_pct": { "type": "number", "minimum": 0 },
    "limitations": { "type": "array", "minItems": 1, "maxItems": 12, "items": { "$ref": "defs-v1.json#/$defs/text" } }
  }
}
