{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/common/uncertainty-summary.json",
  "title": "UncertaintySummary",
  "description": "Shared composed-uncertainty object (CalculatorX cross-capability contract). Returned when a capability composes engineering.uncertainty.propagate. Reuse across Battery, Voltage Drop, RF Link, PCB Thermal, Sensor Chain, and similar tools.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "u_c",
    "U",
    "k"
  ],
  "properties": {
    "y": {
      "type": "number",
      "description": "Evaluated measurand (same unit as u_c / U)"
    },
    "u_c": {
      "type": "number",
      "description": "Combined standard uncertainty"
    },
    "U": {
      "type": "number",
      "description": "Expanded uncertainty (typically k\u00b7u_c)"
    },
    "k": {
      "type": "number",
      "description": "Coverage factor"
    },
    "k_source": {
      "type": [
        "string",
        "null"
      ],
      "description": "How k was chosen (e.g. user, student_t, default)"
    },
    "coverage": {
      "type": [
        "number",
        "null"
      ],
      "description": "Coverage probability when k came from confidence / Student-t; otherwise null"
    },
    "unit": {
      "type": [
        "string",
        "null"
      ]
    },
    "u_rel": {
      "type": [
        "number",
        "null"
      ],
      "description": "|u_c/y| when y \u2260 0"
    },
    "mode": {
      "type": "string",
      "description": "Uncertainty Engine operation used (e.g. sensitivity)"
    },
    "contributions": {
      "type": "array",
      "description": "Diagonal variance contributions (% of u_c\u00b2)",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "i",
          "c",
          "u",
          "variance",
          "percent"
        ],
        "properties": {
          "i": {
            "type": "integer"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "c": {
            "type": "number"
          },
          "u": {
            "type": "number"
          },
          "variance": {
            "type": "number"
          },
          "percent": {
            "type": "number"
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "nu": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      }
    },
    "largest": {
      "type": [
        "object",
        "null"
      ],
      "description": "Dominant contribution entry"
    },
    "reported": {
      "type": "object",
      "description": "Human-facing rounded values from the Uncertainty Engine",
      "additionalProperties": true
    },
    "capability_id": {
      "type": "string",
      "const": "engineering.uncertainty.propagate",
      "description": "Composing capability id"
    },
    "method": {
      "type": "string",
      "description": "Optional alias for mode (Uncertainty Engine operation, e.g. sensitivity)"
    },
    "source_capability": {
      "type": "string",
      "description": "Optional alias for capability_id of the composing Uncertainty Engine call"
    }
  }
}
