{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://benchmarks.duellab.org/route_inventory.schema.json",
  "title": "DuelLab prepared route inventory v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "host",
    "origin",
    "public_release_id",
    "generated_at",
    "benchmark_version",
    "source_commit",
    "routes"
  ],
  "properties": {
    "schema_version": { "const": 1 },
    "host": { "enum": ["duellab.org", "benchmarks.duellab.org"] },
    "origin": {
      "enum": ["https://duellab.org", "https://benchmarks.duellab.org"]
    },
    "public_release_id": { "type": "string", "pattern": "^gb2-[0-9]{8}-[a-f0-9]{12}$" },
    "generated_at": { "type": "string", "format": "date-time" },
    "benchmark_version": { "type": "string", "minLength": 1 },
    "source_commit": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
    "routes": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "canonical_path",
          "canonical_url",
          "physical_file",
          "physical_sha256",
          "alias_paths",
          "expected_release_id",
          "expected_generated_at",
          "expected_benchmark_version",
          "expected_source_commit"
        ],
        "properties": {
          "canonical_path": { "type": "string", "pattern": "^/" },
          "canonical_url": { "type": "string", "format": "uri" },
          "physical_file": { "type": "string", "pattern": "^[^/]" },
          "physical_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
          "alias_paths": {
            "type": "array",
            "uniqueItems": true,
            "items": { "type": "string", "pattern": "^/" }
          },
          "expected_release_id": {
            "type": "string",
            "pattern": "^gb2-[0-9]{8}-[a-f0-9]{12}$"
          },
          "expected_generated_at": { "type": "string", "format": "date-time" },
          "expected_benchmark_version": { "type": "string", "minLength": 1 },
          "expected_source_commit": { "type": "string", "pattern": "^[a-f0-9]{40}$" }
        }
      }
    }
  }
}
