{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sudoku.legen.uk/data/sudoku/v1/schema.json",
  "title": "Legen Sudoku published puzzle sample",
  "description": "Schema for the fixed 2026-07-17 four-difficulty published puzzle sample.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "datasetVersion",
    "sampleDate",
    "licenseStatus",
    "licenseUrl",
    "source",
    "records"
  ],
  "properties": {
    "schemaVersion": {
      "const": "legen-sudoku-public-data-sample/v1"
    },
    "datasetVersion": {
      "const": "legen-sudoku-published-sample/2026-07-17/v1"
    },
    "sampleDate": {
      "const": "2026-07-17",
      "format": "date"
    },
    "licenseStatus": {
      "const": "cc-by-4.0"
    },
    "licenseUrl": {
      "const": "https://creativecommons.org/licenses/by/4.0/",
      "format": "uri"
    },
    "source": {
      "const": "https://sudoku.legen.uk/sudoku-data",
      "format": "uri"
    },
    "records": {
      "type": "array",
      "minItems": 4,
      "maxItems": 4,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "datasetVersion",
          "puzzleId",
          "givens",
          "solution",
          "publishedDate",
          "difficulty",
          "clueCount",
          "uniqueSolution",
          "engineVersion",
          "logicCoverage",
          "solverStatus",
          "logicalStepCount",
          "hardestTechnique",
          "difficultyIndex",
          "T_raw",
          "S_raw",
          "E_raw",
          "T",
          "S",
          "E",
          "ldiVersion",
          "provenance"
        ],
        "properties": {
          "schemaVersion": {
            "const": "legen-sudoku-public-data-sample/v1"
          },
          "datasetVersion": {
            "const": "legen-sudoku-published-sample/2026-07-17/v1"
          },
          "puzzleId": {
            "type": "string",
            "pattern": "^LDI0-[0-9a-f]{40}$"
          },
          "givens": {
            "type": "string",
            "pattern": "^[0-9]{81}$"
          },
          "solution": {
            "type": "string",
            "pattern": "^[1-9]{81}$"
          },
          "publishedDate": {
            "const": "2026-07-17",
            "format": "date"
          },
          "difficulty": {
            "enum": [
              "easy",
              "medium",
              "hard",
              "expert"
            ]
          },
          "clueCount": {
            "type": "integer",
            "minimum": 17,
            "maximum": 64
          },
          "uniqueSolution": {
            "const": true
          },
          "engineVersion": {
            "const": "legen-sudoku-engine/1.3.0"
          },
          "logicCoverage": {
            "const": "complete"
          },
          "solverStatus": {
            "const": "solved-logically"
          },
          "logicalStepCount": {
            "type": "integer",
            "minimum": 1
          },
          "hardestTechnique": {
            "enum": [
              "naked-single",
              "hidden-single",
              "locked-candidates",
              "naked-pair",
              "hidden-pair",
              "naked-triple",
              "hidden-triple",
              "x-wing",
              "xy-wing",
              "swordfish"
            ]
          },
          "difficultyIndex": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "T_raw": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "S_raw": {
            "type": "integer",
            "minimum": 0
          },
          "E_raw": {
            "type": "integer",
            "minimum": 0
          },
          "T": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "S": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "E": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "ldiVersion": {
            "const": "legen-ldi/v0/sha256:f541ca7389fce1f8257d6051209f234ddcd83980c1834ea29c078e6af58e0dd7"
          },
          "provenance": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
