{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://law.arxo.io/schema/experiment.schema.json",
  "title": "Arxo experiment 0.1",
  "description": "Pinned task bank, system variants, evaluator, and runs; summary per (task, arm) with error classes, not a single score. The knowledge axis is the same agent on a new canon; the application axis is the same canon with a new agent, skill, or adapter.",
  "$comment": "DECISION-0455; formerly law.experiment/0.1",
  "type": "object",
  "required": [
    "schema",
    "experimentId",
    "name",
    "axis",
    "bank",
    "variants",
    "scorer",
    "scope",
    "runs",
    "summary"
  ],
  "properties": {
    "schema": {
      "const": "law.experiment/0.1"
    },
    "experimentId": {
      "type": "string",
      "pattern": "^exp:[0-9a-f]{24}$"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "axis": {
      "enum": [
        "knowledge",
        "application"
      ]
    },
    "bank": {
      "type": "object",
      "required": [
        "tasks"
      ],
      "properties": {
        "file": {
          "type": "string"
        },
        "digest": {
          "type": "string"
        },
        "size": {
          "type": "integer"
        },
        "tasks": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "variants": {
      "type": "object",
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ]
      }
    },
    "scorer": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "digest": {
          "type": "string"
        },
        "classes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "scope": {
      "type": "object",
      "required": [
        "checked",
        "notChecked"
      ],
      "properties": {
        "checked": {
          "type": "string"
        },
        "notChecked": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "runs": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^run:[0-9a-f]{32}$"
      }
    },
    "summary": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "task",
          "arm",
          "runs",
          "correct",
          "total",
          "errors",
          "ungrounded",
          "journal",
          "runIds"
        ],
        "properties": {
          "task": {
            "type": [
              "string",
              "null"
            ]
          },
          "arm": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "runs": {
            "type": "integer"
          },
          "correct": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "ungrounded": {
            "type": "integer"
          },
          "journal": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "runIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
