{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://groupmixer.com/benchmarks/public-group-generator-v1/publication.schema.json",
  "title": "GroupMixer public group-generator benchmark publication",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "benchmarkId",
    "benchmarkRevision",
    "attemptSeeds",
    "comparators",
    "resourceClasses",
    "cases",
    "disclosure"
  ],
  "properties": {
    "schemaVersion": { "const": "groupmixer-benchmark-publication-v1" },
    "benchmarkId": { "const": "public-group-generator-v1" },
    "benchmarkRevision": { "type": "integer", "minimum": 1 },
    "attemptSeeds": { "type": "array", "items": { "type": "integer" }, "minItems": 1, "uniqueItems": true },
    "comparators": { "type": "array", "items": { "$ref": "#/$defs/comparator" }, "minItems": 1 },
    "resourceClasses": { "type": "object" },
    "cases": { "type": "array", "items": { "$ref": "#/$defs/case" }, "minItems": 1 },
    "disclosure": { "type": "string", "minLength": 1 }
  },
  "$defs": {
    "comparator": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "name", "kind"],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "name": { "type": "string", "minLength": 1 },
        "kind": { "enum": ["product", "general_purpose_solver", "end_user_product"] }
      }
    },
    "summary": {
      "type": "object",
      "required": ["status", "attemptCount", "validAttemptCount", "bestCost", "medianCost", "statusCounts"],
      "properties": {
        "status": { "enum": ["optimal", "optimal_proven", "feasible", "timeout", "error", "unsupported", "unavailable", "invalid", "pending_verification", "not_run", "infeasible_proven"] },
        "attemptCount": { "type": "integer", "minimum": 0 },
        "validAttemptCount": { "type": "integer", "minimum": 0 },
        "bestCost": { "type": ["number", "null"] },
        "medianCost": { "type": ["number", "null"] },
        "statusCounts": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 0 } },
        "observedLimit": { "type": "object" }
      }
    },
    "case": {
      "type": "object",
      "required": ["scenarioId", "slug", "title", "summary", "problemHash", "lane", "caseKind", "resourceClass", "attemptPolicy", "dimensions", "comparators"],
      "properties": {
        "scenarioId": { "type": "string" },
        "slug": { "type": "string" },
        "title": { "type": "string" },
        "summary": { "type": "string" },
        "problemHash": { "pattern": "^sha256:[0-9a-f]{64}$" },
        "lane": { "enum": ["common_mixing", "constrained", "capability_frontier", "proof_behavior"] },
        "caseKind": { "enum": ["quality", "hard_infeasible_proof"] },
        "resourceClass": { "enum": ["standard", "heavy"] },
        "attemptPolicy": { "type": "string" },
        "dimensions": { "type": "object" },
        "comparators": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["comparatorId", "admissionState", "configurationId", "evidenceRevision", "attemptPolicy", "summary", "attempts"],
            "properties": {
              "comparatorId": { "type": "string" },
              "admissionState": { "type": "string" },
              "configurationId": { "type": "string" },
              "evidenceRevision": { "type": "integer", "minimum": 1 },
              "attemptPolicy": { "type": "string" },
              "reason": { "type": ["string", "null"] },
              "summary": { "$ref": "#/$defs/summary" },
              "attempts": { "type": "array" },
              "evidenceHref": { "type": ["string", "null"] }
            }
          }
        }
      }
    }
  }
}
