{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/engineering.uncertainty.propagate/1.9.8/output.json",
  "title": "Uncertainty propagation — success output",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "status",
    "capability_id",
    "engine",
    "inputs",
    "result",
    "result_detail",
    "calculation_version",
    "verification"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Requested tool id"
    },
    "status": {
      "const": "success"
    },
    "capability_id": {
      "const": "engineering.uncertainty.propagate"
    },
    "tool": {
      "type": "string",
      "description": "Requested tool id"
    },
    "engine": {
      "type": "string"
    },
    "inputs": {
      "type": "object",
      "description": "Normalized calculation inputs (aliases resolved)"
    },
    "result": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "u_c",
        "reported"
      ],
      "properties": {
        "mode": {
          "type": "string"
        },
        "y": {
          "type": [
            "number",
            "null"
          ],
          "description": "Combined value (binary) or optional y (machine precision)"
        },
        "u_c": {
          "type": "number",
          "description": "Combined standard uncertainty (machine / raw precision)"
        },
        "u_rel": {
          "type": [
            "number",
            "null"
          ],
          "description": "|u_c/y| when y ≠ 0"
        },
        "reported": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "u_c",
            "significant_digits"
          ],
          "description": "Human-facing rounded values (2 significant digits on u_c; y aligned to same decimal place). formatted_* strings keep trailing zeros JSON numbers cannot.",
          "properties": {
            "u_c": {
              "type": "number"
            },
            "y": {
              "type": [
                "number",
                "null"
              ]
            },
            "significant_digits": {
              "type": "integer",
              "const": 2
            },
            "decimal_places": {
              "type": "integer",
              "minimum": 0,
              "description": "Decimal places used to align y with reported u_c"
            },
            "formatted_y": {
              "type": [
                "string",
                "null"
              ],
              "description": "Audit-report y with trailing zeros (e.g. \"150.00\")"
            },
            "formatted_u_c": {
              "type": [
                "string",
                "null"
              ],
              "description": "Audit-report u_c with trailing zeros (e.g. \"0.22\")"
            },
            "k": {
              "type": "number"
            },
            "U": {
              "type": "number"
            },
            "formatted_U": {
              "type": [
                "string",
                "null"
              ],
              "description": "Audit-report expanded uncertainty U, same decimal places as u_c"
            }
          }
        },
        "a": {
          "type": "number"
        },
        "b": {
          "type": "number"
        },
        "ua": {
          "type": "number"
        },
        "ub": {
          "type": "number"
        },
        "terms": {
          "type": "number",
          "description": "Number of uncertainty terms (sensitivity/rss)"
        },
        "unit": {
          "type": [
            "string",
            "null"
          ],
          "description": "Resolved output unit for y and u_c (Quantity Engine v1.1: SI-prefix + derived rewrites; not full SI algebra)"
        },
        "unit_a": {
          "type": [
            "string",
            "null"
          ]
        },
        "unit_b": {
          "type": [
            "string",
            "null"
          ]
        },
        "quantity": {
          "type": "object",
          "description": "Present when SI-prefix conversion scaled inputs into the output unit",
          "properties": {
            "converted": {
              "type": "boolean"
            },
            "scale_a": {
              "type": "number"
            },
            "scale_b": {
              "type": "number"
            },
            "a_aligned": {
              "type": "number"
            },
            "b_aligned": {
              "type": "number"
            },
            "ua_aligned": {
              "type": "number"
            },
            "ub_aligned": {
              "type": "number"
            }
          }
        },
        "rho": {
          "type": [
            "number",
            "null"
          ],
          "description": "Correlation used (binary; default 0)"
        },
        "correlations": {
          "type": "array",
          "description": "Normalized correlation pairs applied (sensitivity)",
          "items": {
            "type": "object",
            "properties": {
              "i": {
                "type": "integer"
              },
              "j": {
                "type": "integer"
              },
              "rho": {
                "type": "number"
              }
            }
          }
        },
        "k": {
          "type": [
            "number",
            "null"
          ],
          "description": "Coverage factor when provided"
        },
        "U": {
          "type": [
            "number",
            "null"
          ],
          "description": "Expanded uncertainty k·u_c when k provided"
        },
        "contributions": {
          "type": "array",
          "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"
                ]
              }
            }
          },
          "description": "Diagonal variance contributions (% of u_c²)"
        },
        "largest": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "i": {
              "type": "integer"
            },
            "label": {
              "type": [
                "string",
                "null"
              ]
            },
            "percent": {
              "type": "number"
            },
            "kind": {
              "type": "string",
              "description": "diagonal when correlations present"
            }
          }
        },
        "covariance_contributions": {
          "type": "array",
          "description": "Off-diagonal 2ρ c_i c_j u_i u_j shares of u_c²",
          "items": {
            "type": "object",
            "properties": {
              "i": {
                "type": "integer"
              },
              "j": {
                "type": "integer"
              },
              "i_label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "j_label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "rho": {
                "type": "number"
              },
              "covariance": {
                "type": "number"
              },
              "percent": {
                "type": "number"
              }
            }
          }
        },
        "nu_eff": {
          "type": [
            "number",
            "null"
          ],
          "description": "Welch–Satterthwaite νeff when dof provided; Infinity when all ν→∞"
        },
        "nua": {
          "type": [
            "number",
            "null"
          ]
        },
        "nub": {
          "type": [
            "number",
            "null"
          ]
        },
        "nu_eff_infinite": {
          "type": "boolean",
          "description": "True when νeff → ∞ (JSON-safe; nu_eff is then null)"
        },
        "k_source": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "user",
            "student_t",
            "montecarlo_percentile",
            null
          ],
          "description": "How k was obtained"
        },
        "confidence": {
          "type": [
            "number",
            "null"
          ],
          "description": "Coverage probability when Student-t auto-k used"
        },
        "components": {
          "type": "array",
          "description": "Echo of budget components (normalized)",
          "items": {
            "type": "object"
          }
        },
        "y_mean": {
          "type": "number"
        },
        "y_median": {
          "type": "number"
        },
        "y_p025": {
          "type": "number"
        },
        "y_p975": {
          "type": "number"
        },
        "y_low": {
          "type": [
            "number",
            "null"
          ]
        },
        "y_high": {
          "type": [
            "number",
            "null"
          ]
        },
        "linear_u_c": {
          "type": [
            "number",
            "null"
          ],
          "description": "First-order GUM u_c for comparison"
        },
        "N": {
          "type": "integer"
        },
        "seed": {
          "type": "integer"
        },
        "model": {
          "type": "string"
        },
        "n_valid": {
          "type": "integer",
          "description": "Monte Carlo samples used for mean/std after singularity filtering"
        },
        "invalid_samples": {
          "type": "integer"
        },
        "near_singularity_samples": {
          "type": "integer"
        },
        "invalid_fraction": {
          "type": "number"
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "result_detail": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "unit",
        "formatted"
      ],
      "properties": {
        "value": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "u_c",
            "reported"
          ],
          "properties": {
            "mode": {
              "type": "string"
            },
            "y": {
              "type": [
                "number",
                "null"
              ],
              "description": "Combined value (binary) or optional y (machine precision)"
            },
            "u_c": {
              "type": "number",
              "description": "Combined standard uncertainty (machine / raw precision)"
            },
            "u_rel": {
              "type": [
                "number",
                "null"
              ],
              "description": "|u_c/y| when y ≠ 0"
            },
            "reported": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "u_c",
                "significant_digits"
              ],
              "description": "Human-facing rounded values (2 significant digits on u_c; y aligned to same decimal place). formatted_* strings keep trailing zeros JSON numbers cannot.",
              "properties": {
                "u_c": {
                  "type": "number"
                },
                "y": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "significant_digits": {
                  "type": "integer",
                  "const": 2
                },
                "decimal_places": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Decimal places used to align y with reported u_c"
                },
                "formatted_y": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Audit-report y with trailing zeros (e.g. \"150.00\")"
                },
                "formatted_u_c": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Audit-report u_c with trailing zeros (e.g. \"0.22\")"
                },
                "k": {
                  "type": "number"
                },
                "U": {
                  "type": "number"
                },
                "formatted_U": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Audit-report expanded uncertainty U, same decimal places as u_c"
                }
              }
            },
            "a": {
              "type": "number"
            },
            "b": {
              "type": "number"
            },
            "ua": {
              "type": "number"
            },
            "ub": {
              "type": "number"
            },
            "terms": {
              "type": "number",
              "description": "Number of uncertainty terms (sensitivity/rss)"
            },
            "unit": {
              "type": [
                "string",
                "null"
              ],
              "description": "Resolved output unit for y and u_c (Quantity Engine v1.1: SI-prefix + derived rewrites; not full SI algebra)"
            },
            "unit_a": {
              "type": [
                "string",
                "null"
              ]
            },
            "unit_b": {
              "type": [
                "string",
                "null"
              ]
            },
            "quantity": {
              "type": "object",
              "description": "Present when SI-prefix conversion scaled inputs into the output unit",
              "properties": {
                "converted": {
                  "type": "boolean"
                },
                "scale_a": {
                  "type": "number"
                },
                "scale_b": {
                  "type": "number"
                },
                "a_aligned": {
                  "type": "number"
                },
                "b_aligned": {
                  "type": "number"
                },
                "ua_aligned": {
                  "type": "number"
                },
                "ub_aligned": {
                  "type": "number"
                }
              }
            },
            "rho": {
              "type": [
                "number",
                "null"
              ],
              "description": "Correlation used (binary; default 0)"
            },
            "correlations": {
              "type": "array",
              "description": "Normalized correlation pairs applied (sensitivity)",
              "items": {
                "type": "object",
                "properties": {
                  "i": {
                    "type": "integer"
                  },
                  "j": {
                    "type": "integer"
                  },
                  "rho": {
                    "type": "number"
                  }
                }
              }
            },
            "k": {
              "type": [
                "number",
                "null"
              ],
              "description": "Coverage factor when provided"
            },
            "U": {
              "type": [
                "number",
                "null"
              ],
              "description": "Expanded uncertainty k·u_c when k provided"
            },
            "contributions": {
              "type": "array",
              "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"
                    ]
                  }
                }
              },
              "description": "Diagonal variance contributions (% of u_c²)"
            },
            "largest": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "i": {
                  "type": "integer"
                },
                "label": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "percent": {
                  "type": "number"
                },
                "kind": {
                  "type": "string",
                  "description": "diagonal when correlations present"
                }
              }
            },
            "covariance_contributions": {
              "type": "array",
              "description": "Off-diagonal 2ρ c_i c_j u_i u_j shares of u_c²",
              "items": {
                "type": "object",
                "properties": {
                  "i": {
                    "type": "integer"
                  },
                  "j": {
                    "type": "integer"
                  },
                  "i_label": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "j_label": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "rho": {
                    "type": "number"
                  },
                  "covariance": {
                    "type": "number"
                  },
                  "percent": {
                    "type": "number"
                  }
                }
              }
            },
            "nu_eff": {
              "type": [
                "number",
                "null"
              ],
              "description": "Welch–Satterthwaite νeff when dof provided; Infinity when all ν→∞"
            },
            "nua": {
              "type": [
                "number",
                "null"
              ]
            },
            "nub": {
              "type": [
                "number",
                "null"
              ]
            },
            "nu_eff_infinite": {
              "type": "boolean",
              "description": "True when νeff → ∞ (JSON-safe; nu_eff is then null)"
            },
            "k_source": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "user",
                "student_t",
                "montecarlo_percentile",
                null
              ],
              "description": "How k was obtained"
            },
            "confidence": {
              "type": [
                "number",
                "null"
              ],
              "description": "Coverage probability when Student-t auto-k used"
            },
            "components": {
              "type": "array",
              "description": "Echo of budget components (normalized)",
              "items": {
                "type": "object"
              }
            },
            "y_mean": {
              "type": "number"
            },
            "y_median": {
              "type": "number"
            },
            "y_p025": {
              "type": "number"
            },
            "y_p975": {
              "type": "number"
            },
            "y_low": {
              "type": [
                "number",
                "null"
              ]
            },
            "y_high": {
              "type": [
                "number",
                "null"
              ]
            },
            "linear_u_c": {
              "type": [
                "number",
                "null"
              ],
              "description": "First-order GUM u_c for comparison"
            },
            "N": {
              "type": "integer"
            },
            "seed": {
              "type": "integer"
            },
            "model": {
              "type": "string"
            },
            "n_valid": {
              "type": "integer",
              "description": "Monte Carlo samples used for mean/std after singularity filtering"
            },
            "invalid_samples": {
              "type": "integer"
            },
            "near_singularity_samples": {
              "type": "integer"
            },
            "invalid_fraction": {
              "type": "number"
            },
            "warnings": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "unit": {
          "type": [
            "string",
            "null"
          ]
        },
        "formatted": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "formula": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string"
            },
            "expression": {
              "type": "string"
            },
            "label": {
              "type": "string"
            }
          }
        }
      ]
    },
    "assumptions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "suggestion": {
            "type": "string"
          }
        }
      }
    },
    "verification": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "tier",
        "engine_tested",
        "expert_reviewed",
        "source_checked",
        "reviewed_by",
        "reviewer_role",
        "last_reviewed"
      ],
      "properties": {
        "tier": {
          "type": "string",
          "enum": [
            "candidate",
            "engine_tested",
            "internally_reviewed",
            "expert_verified"
          ]
        },
        "engine_tested": {
          "type": "boolean"
        },
        "expert_reviewed": {
          "type": "boolean"
        },
        "internally_reviewed": {
          "type": "boolean"
        },
        "review_kind": {
          "type": [
            "string",
            "null"
          ]
        },
        "source_checked": {
          "type": "boolean"
        },
        "reviewed_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewer_role": {
          "type": [
            "string",
            "null"
          ]
        },
        "last_reviewed": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "tier": {
                "const": "expert_verified"
              }
            },
            "required": [
              "tier"
            ]
          },
          "then": {
            "properties": {
              "engine_tested": {
                "const": true
              },
              "expert_reviewed": {
                "const": true
              },
              "source_checked": {
                "const": true
              },
              "reviewed_by": {
                "type": "string",
                "minLength": 1
              },
              "reviewer_role": {
                "type": "string",
                "minLength": 1
              },
              "last_reviewed": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "tier": {
                "const": "internally_reviewed"
              }
            },
            "required": [
              "tier"
            ]
          },
          "then": {
            "properties": {
              "engine_tested": {
                "const": true
              },
              "internally_reviewed": {
                "const": true
              },
              "source_checked": {
                "const": true
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "tier": {
                "const": "engine_tested"
              }
            },
            "required": [
              "tier"
            ]
          },
          "then": {
            "properties": {
              "engine_tested": {
                "const": true
              }
            }
          }
        }
      ]
    },
    "calculation_version": {
      "type": "string",
      "const": "1.9.8"
    },
    "api_version": {
      "type": "string"
    },
    "api_contract_version": {
      "type": "string"
    },
    "spec_version": {
      "type": "string"
    },
    "page": {
      "type": [
        "string",
        "null"
      ],
      "description": "Canonical calculator page URL"
    },
    "links": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema_input": {
          "type": "string",
          "format": "uri"
        },
        "schema_output": {
          "type": "string",
          "format": "uri"
        },
        "evidence": {
          "type": "string",
          "format": "uri"
        },
        "openapi": {
          "type": "string",
          "format": "uri"
        },
        "capabilities": {
          "type": "string",
          "format": "uri"
        },
        "mcp": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}
