{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://altheia.local/schemas/altheia_simulator_execution_1.0.schema.json",
  "title": "ALTHEIA simulator numerical row replay 1.0",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "module_contract",
    "capability_hash",
    "collective_hash",
    "inputs",
    "results",
    "execution_hash"
  ],
  "properties": {
    "schema_version": {
      "const": "altheia_simulator_execution_1.0"
    },
    "module_contract": {
      "type": "string"
    },
    "capability_hash": {
      "type": "string",
      "pattern": "^fnv1a-[a-f0-9]{8}$"
    },
    "collective_hash": {
      "type": "string",
      "pattern": "^fnv1a-[a-f0-9]{8}$"
    },
    "execution_hash": {
      "type": "string",
      "pattern": "^fnv1a-[a-f0-9]{8}$"
    },
    "inputs": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "input_hash",
          "input"
        ],
        "properties": {
          "input_hash": {
            "type": "string",
            "pattern": "^fnv1a-[a-f0-9]{8}$"
          },
          "input": {
            "type": "object",
            "required": [
              "kind"
            ],
            "properties": {
              "kind": {
                "enum": [
                  "beco",
                  "first_click",
                  "usability",
                  "reputation",
                  "quant_choice"
                ]
              }
            }
          }
        }
      }
    },
    "results": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "profile_uuid",
          "execution_id",
          "ownership_reference",
          "simulator_execution_reference"
        ],
        "properties": {
          "simulator_execution_reference": {
            "$ref": "#/$defs/reference"
          }
        }
      }
    }
  },
  "$defs": {
    "reference": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "module_contract",
        "capability_hash",
        "profile_uuid",
        "input_hash",
        "index",
        "output_hash"
      ],
      "properties": {
        "schema_version": {
          "const": "altheia_simulator_execution_1.0"
        },
        "module_contract": {
          "type": "string",
          "minLength": 1
        },
        "capability_hash": {
          "type": "string",
          "pattern": "^fnv1a-[a-f0-9]{8}$"
        },
        "profile_uuid": {
          "type": "string",
          "minLength": 1
        },
        "input_hash": {
          "type": "string",
          "pattern": "^fnv1a-[a-f0-9]{8}$"
        },
        "index": {
          "type": "integer",
          "minimum": 0
        },
        "output_hash": {
          "type": "string",
          "pattern": "^fnv1a-[a-f0-9]{8}$"
        }
      }
    }
  },
  "description": "Original numerical inputs and reproducible row outcomes; aggregate statistics and canonical metric correspondence require separate review."
}
