{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://earsling.com/sdk/schemas/earsling-evaluate-request.schema.json",
  "title": "GNX Earsling Evaluate Request",
  "type": "object",
  "additionalProperties": false,
  "required": ["profile", "candidateState", "contextState"],
  "properties": {
    "profile": {
      "type": "object",
      "additionalProperties": false,
      "required": ["age", "sex", "heightCm", "weightKg"],
      "properties": {
        "age": {"type": "integer", "minimum": 18, "maximum": 100},
        "sex": {"type": "string", "enum": ["female", "male", "other", "undisclosed"]},
        "heightCm": {"type": "number", "minimum": 120, "maximum": 230},
        "weightKg": {"type": "number", "minimum": 30, "maximum": 250},
        "diabetesYn": {"type": "string", "enum": ["Y", "N", "unknown"]},
        "consentScope": {"type": "string", "enum": ["demo", "evaluation"]}
      }
    },
    "candidateState": {
      "type": "object",
      "additionalProperties": false,
      "required": ["metric"],
      "properties": {
        "metric": {"type": "string", "enum": ["body_temperature", "heart_rhythm", "blood_pressure_range"]},
        "thermalBand": {"type": "string", "enum": ["normal", "outside_low", "outside_high"]},
        "ambientThermalBand": {"type": "string", "enum": ["normal", "low", "high"]},
        "heartRateBand": {"type": "string", "enum": ["normal", "outside_low", "outside_high"]},
        "rhythmIrregularityBand": {"type": "string", "enum": ["normal", "candidate_irregular", "outside"]},
        "bloodPressureBand": {"type": "string", "enum": ["normal", "elevated", "outside_high", "severe"]},
        "candidateSource": {"type": "string", "enum": ["demo_adapter", "sdk_adapter", "ble_adapter", "cloud_adapter"]}
      }
    },
    "contextState": {
      "type": "object",
      "additionalProperties": false,
      "required": ["contactQuality", "frameStable", "baselineReady", "motionNoise", "adapterIntegrity", "sourceIntegrity"],
      "properties": {
        "contactQuality": {"type": "string", "enum": ["excellent", "good", "fair", "poor"]},
        "frameStable": {"type": "boolean"},
        "baselineReady": {"type": "boolean"},
        "motionNoise": {"type": "string", "enum": ["low", "medium", "high"]},
        "adapterIntegrity": {"type": "string", "enum": ["verified", "unverified", "fail"]},
        "sourceIntegrity": {"type": "string", "enum": ["verified", "unverified", "fail"]}
      }
    },
    "persistEvidence": {"type": "boolean"}
  }
}
