{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xecores.com/api/v1/model-output.schema.json",
  "title": "XeCores model-output submission v1",
  "description": "Opt-in qualitative record: one prompt, the exact response a model produced on Intel Arc hardware, and how it was tested. Generated text never enters the benchmark result schema. Client HTML is rejected; rendering happens only through the site-safe markdown renderer.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "kind", "challenge", "task", "model", "hardware", "output", "evidence", "consent"],
  "properties": {
    "schema_version": { "const": "1.0" },
    "kind": { "const": "model-output" },
    "challenge": {
      "type": "object", "additionalProperties": false, "required": ["id", "token"],
      "properties": { "id": { "type": "string", "format": "uuid" }, "token": { "type": "string", "minLength": 32, "maxLength": 128, "pattern": "^[A-Za-z0-9_-]+$" } }
    },
    "task": {
      "type": "object", "additionalProperties": false, "required": ["category", "prompt"],
      "properties": {
        "category": { "enum": ["code", "reasoning", "instruction", "math", "long-context"] },
        "prompt": { "type": "string", "minLength": 1, "maxLength": 16000 },
        "prompt_source": { "type": ["string", "null"], "maxLength": 300, "pattern": "^https://" }
      }
    },
    "model": {
      "type": "object", "additionalProperties": false, "required": ["id", "quantization", "engine"],
      "properties": {
        "id": { "type": "string", "minLength": 1, "maxLength": 240 },
        "revision": { "type": ["string", "null"], "maxLength": 120 },
        "quantization": { "type": "string", "minLength": 1, "maxLength": 80 },
        "engine": { "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 } } }
      }
    },
    "hardware": {
      "type": "object", "additionalProperties": false, "required": ["gpu_vendor", "gpu_model", "gpu_count"],
      "properties": {
        "gpu_vendor": { "const": "Intel" },
        "gpu_model": { "type": "string", "minLength": 2, "maxLength": 100 },
        "gpu_count": { "type": "integer", "minimum": 1, "maximum": 16 }
      }
    },
    "output": {
      "type": "object", "additionalProperties": false, "required": ["format", "body"],
      "properties": {
        "format": { "enum": ["markdown", "code"] },
        "body": { "type": "string", "minLength": 1, "maxLength": 64000 }
      }
    },
    "evaluation": {
      "type": ["object", "null"], "additionalProperties": false, "required": ["result"],
      "properties": {
        "result": { "enum": ["pass", "fail", "not-tested"] },
        "test_command": { "type": ["string", "null"], "maxLength": 400 },
        "notes": { "type": ["string", "null"], "maxLength": 2000 }
      }
    },
    "evidence": {
      "type": "object", "additionalProperties": false, "required": ["url"],
      "properties": { "url": { "type": "string", "maxLength": 300, "pattern": "^https://" } }
    },
    "credit": {
      "type": ["object", "null"], "additionalProperties": false, "required": ["display_name"],
      "properties": {
        "display_name": { "type": "string", "minLength": 1, "maxLength": 80 },
        "url": { "type": ["string", "null"], "maxLength": 300, "pattern": "^https://" }
      }
    },
    "consent": {
      "type": "object", "additionalProperties": false, "required": ["publish", "rights"],
      "properties": { "publish": { "const": true }, "rights": { "const": true } }
    }
  }
}
