{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sciences-last-exam.org/submission-kit/schema.json",
  "title": "SLE preliminary result submission v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "kind",
    "submission_id",
    "created_at",
    "contact",
    "model",
    "harness",
    "benchmark",
    "execution",
    "evidence",
    "notes"
  ],
  "properties": {
    "schema_version": {
      "enum": [
        "sle-submission-v1"
      ]
    },
    "kind": {
      "enum": [
        "task-results",
        "hypothesis-discovery"
      ]
    },
    "submission_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{2,79}$"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "contact": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "email",
        "affiliation"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "email": {
          "type": "string",
          "format": "email",
          "maxLength": 254
        },
        "affiliation": {
          "type": "string",
          "minLength": 0,
          "maxLength": 300
        }
      }
    },
    "model": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "version",
        "provider",
        "effort",
        "temperature"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "version": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "provider": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "effort": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100
        },
        "temperature": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 10
        }
      }
    },
    "harness": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "version",
        "commit"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "version": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "commit": {
          "type": "string",
          "minLength": 7,
          "maxLength": 200
        }
      }
    },
    "benchmark": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "release",
        "selection_sha256",
        "task_content_revision",
        "subset",
        "protocol"
      ],
      "properties": {
        "release": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "selection_sha256": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[a-f0-9]{64}$"
        },
        "task_content_revision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "subset": {
          "enum": [
            "public",
            "representative",
            "last_exam",
            "custom",
            "discovery"
          ]
        },
        "protocol": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        }
      }
    },
    "execution": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "command",
        "environment",
        "network",
        "seed",
        "budgets",
        "reuse_description"
      ],
      "properties": {
        "command": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000
        },
        "environment": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "network": {
          "enum": [
            "task-default",
            "offline-agent",
            "other"
          ]
        },
        "seed": {
          "type": [
            "integer",
            "null"
          ]
        },
        "budgets": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "reuse_description": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2000
        }
      }
    },
    "evidence": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "url",
          "sha256",
          "access"
        ],
        "properties": {
          "kind": {
            "enum": [
              "code",
              "logs",
              "outputs",
              "evaluation",
              "environment"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000,
            "pattern": "^https://"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "access": {
            "enum": [
              "public",
              "on-request"
            ]
          }
        }
      }
    },
    "tasks": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id",
          "capability",
          "status",
          "metric",
          "score",
          "reused",
          "error_type"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "capability": {
            "enum": [
              "embodied_perception",
              "world_dynamics",
              "scientific_coding",
              "scientific_gui"
            ]
          },
          "status": {
            "enum": [
              "scored",
              "error",
              "pending"
            ]
          },
          "metric": {
            "enum": [
              "reward",
              "reward_repair"
            ]
          },
          "score": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1
          },
          "reused": {
            "type": "boolean"
          },
          "error_type": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          }
        }
      }
    },
    "discovery": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "generated",
        "filtered",
        "actionable",
        "literature_cutoff",
        "judge",
        "judging_protocol"
      ],
      "properties": {
        "generated": {
          "type": "integer",
          "minimum": 1
        },
        "filtered": {
          "type": "integer",
          "minimum": 0
        },
        "actionable": {
          "type": "integer",
          "minimum": 0
        },
        "literature_cutoff": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "judge": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "judging_protocol": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000
        }
      }
    },
    "notes": {
      "type": "string",
      "minLength": 0,
      "maxLength": 5000
    }
  }
}
