{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "OCx25 modelling results",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "problem",
    "targets",
    "models",
    "leakage_audit",
    "reproduction",
    "limitations"
  ],
  "properties": {
    "problem": {
      "type": "string",
      "minLength": 1
    },
    "targets": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "her_rows",
        "co2rr_rows",
        "sha256_targets_her",
        "sha256_targets_co2rr"
      ],
      "properties": {
        "her_rows": {
          "type": "integer",
          "minimum": 1
        },
        "co2rr_rows": {
          "type": "integer",
          "minimum": 1
        },
        "sha256_targets_her": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "sha256_targets_co2rr": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        }
      }
    },
    "models": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "reaction",
          "target_column",
          "is_baseline",
          "model_family",
          "features",
          "feature_sources",
          "hyperparameter_selection",
          "loco",
          "predictions_file"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "reaction": {
            "enum": [
              "HER",
              "CO2RR"
            ]
          },
          "target_column": {
            "type": "string",
            "minLength": 1
          },
          "is_baseline": {
            "type": "boolean"
          },
          "model_family": {
            "type": "string",
            "minLength": 1
          },
          "features": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "feature_sources": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "description": "Where every feature comes from: the bound inputs by key, or a public source by URL or DOI."
          },
          "hyperparameter_selection": {
            "type": "string",
            "minLength": 1,
            "description": "Fixed a priori, or nested inside the training folds; never on the held-out fold."
          },
          "loco": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "pearson_r2",
              "r2",
              "mae",
              "n",
              "n_folds"
            ],
            "properties": {
              "pearson_r2": {
                "type": "number"
              },
              "r2": {
                "type": "number"
              },
              "mae": {
                "type": "number"
              },
              "spearman_rho": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "n": {
                "type": "integer",
                "minimum": 1
              },
              "n_folds": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "loo": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "pearson_r2",
              "r2",
              "mae",
              "n",
              "n_folds"
            ],
            "properties": {
              "pearson_r2": {
                "type": "number"
              },
              "r2": {
                "type": "number"
              },
              "mae": {
                "type": "number"
              },
              "spearman_rho": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "n": {
                "type": "integer",
                "minimum": 1
              },
              "n_folds": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "predictions_file": {
            "type": "string",
            "minLength": 1,
            "description": "Path inside the code archive of the LOCO predictions CSV (sample_id, prediction, fold) evaluate.py scores."
          }
        }
      }
    },
    "discrepancies": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "what",
          "published_value",
          "reproduced_value",
          "explanation"
        ],
        "properties": {
          "what": {
            "type": "string"
          },
          "published_value": {
            "type": "string"
          },
          "reproduced_value": {
            "type": "string"
          },
          "explanation": {
            "type": "string"
          }
        }
      }
    },
    "leakage_audit": {
      "type": "string",
      "minLength": 200,
      "description": "How you checked that no held-out element system's electrochemical outcomes reached training, feature construction or model selection."
    },
    "reproduction": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "command",
        "environment",
        "external_downloads"
      ],
      "properties": {
        "command": {
          "type": "string",
          "minLength": 1
        },
        "environment": {
          "type": "string",
          "minLength": 1
        },
        "runtime_minutes": {
          "type": "number"
        },
        "random_seeds": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "external_downloads": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "url",
              "sha256_or_md5"
            ],
            "properties": {
              "url": {
                "type": "string"
              },
              "sha256_or_md5": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "limitations": {
      "type": "string",
      "minLength": 1
    }
  }
}
