{
  "$id": "https://nirs4all.org/schemas/robustness-summary/v1",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "conformal_guarantee_status": {
      "additionalProperties": true,
      "properties": {
        "calibrated_coverages": {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        "coverage": {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        "effective_engine": {
          "type": "string"
        },
        "guarantee": {
          "type": "string"
        },
        "invalidation_reasons": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "limitations": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "method": {
          "type": "string"
        },
        "requested_engine": {
          "type": "string"
        },
        "scope": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "unit": {
          "type": "string"
        },
        "version": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "fingerprint": {
      "minLength": 1,
      "type": "string"
    },
    "format": {
      "const": "nirs4all.robustness.summary"
    },
    "mode": {
      "enum": [
        "clean_frozen",
        "matched_recalibration",
        "structural_refit"
      ]
    },
    "report_version": {
      "minimum": 1,
      "type": "integer"
    },
    "schema_version": {
      "const": 1
    },
    "slice_by": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "spectral_replay": {
      "additionalProperties": false,
      "properties": {
        "all_predictions": {
          "type": "boolean"
        },
        "predictor_bundle": {
          "type": "string"
        },
        "route": {
          "type": "string"
        },
        "sample_ids_forwarded": {
          "type": "boolean"
        },
        "source": {
          "enum": [
            "predictor",
            "predictor_bundle"
          ]
        }
      },
      "required": [
        "route",
        "sample_ids_forwarded",
        "source"
      ],
      "type": "object"
    },
    "summary": {
      "items": {
        "additionalProperties": true,
        "properties": {
          "bias": {
            "type": "number"
          },
          "conformal_max_abs_coverage_gap": {
            "type": [
              "number",
              "null"
            ]
          },
          "conformal_mean_width_mean": {
            "type": [
              "number",
              "null"
            ]
          },
          "conformal_min_observed_coverage": {
            "type": [
              "number",
              "null"
            ]
          },
          "delta_bias": {
            "type": "number"
          },
          "delta_mae": {
            "type": "number"
          },
          "delta_max_abs_error": {
            "type": "number"
          },
          "delta_rmse": {
            "type": "number"
          },
          "execution_scope": {
            "enum": [
              "baseline",
              "prediction_replay",
              "spectral_replay"
            ]
          },
          "mae": {
            "type": "number"
          },
          "mae_ratio": {
            "type": [
              "number",
              "null"
            ]
          },
          "max_abs_error": {
            "type": "number"
          },
          "n_samples": {
            "minimum": 1,
            "type": "integer"
          },
          "requires_spectral_replay": {
            "type": "boolean"
          },
          "rmse": {
            "type": "number"
          },
          "rmse_ratio": {
            "type": [
              "number",
              "null"
            ]
          },
          "scenario": {
            "type": "object"
          },
          "scenario_index": {
            "minimum": 0,
            "type": "integer"
          },
          "scenario_label": {
            "type": "string"
          },
          "severity": {
            "type": "number"
          },
          "worst_slice_key": {
            "type": [
              "object",
              "null"
            ]
          },
          "worst_slice_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "worst_slice_metric": {
            "type": "string"
          },
          "worst_slice_value": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "bias",
          "delta_mae",
          "delta_rmse",
          "mae",
          "max_abs_error",
          "n_samples",
          "rmse",
          "scenario",
          "scenario_index",
          "scenario_label",
          "severity"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "fingerprint",
    "format",
    "mode",
    "report_version",
    "schema_version",
    "slice_by",
    "summary"
  ],
  "title": "NIRS4All robustness summary artifact",
  "type": "object"
}
