{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.thermal.heatsink_rth/1.1.0/output.json",
  "title": "Heatsink Thermal Resistance — 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": "electrical.thermal.heatsink_rth"
    },
    "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",
        "thermal_path",
        "Ta_C",
        "P_W",
        "Rth_C_per_W",
        "dT_C"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "junction_effective_ja",
            "junction_heatsink_stack",
            "required_heatsink_sa"
          ]
        },
        "thermal_path": {
          "type": "string",
          "enum": [
            "JA",
            "JC+CS+SA",
            "required_SA"
          ],
          "description": "JA = effective θJA; JC+CS+SA = explicit heatsink stack; required_SA = solved θSA,max. Not interchangeable models."
        },
        "Ta_C": {
          "type": "number"
        },
        "P_W": {
          "type": "number",
          "minimum": 0
        },
        "Rth_C_per_W": {
          "type": "number",
          "description": "Headline resistance: θJA or θtotal on rise models; θSA,max on required_heatsink_sa"
        },
        "Rth_total": {
          "type": [
            "number",
            "null"
          ]
        },
        "Rth_total_max": {
          "type": [
            "number",
            "null"
          ],
          "description": "(Tj,max−Ta)/P in required mode"
        },
        "Rth_SA_required": {
          "type": [
            "number",
            "null"
          ]
        },
        "Rth_JA": {
          "type": [
            "number",
            "null"
          ]
        },
        "Rth_JC": {
          "type": [
            "number",
            "null"
          ]
        },
        "Rth_CS": {
          "type": [
            "number",
            "null"
          ]
        },
        "Rth_SA": {
          "type": [
            "number",
            "null"
          ]
        },
        "dT_C": {
          "type": "number"
        },
        "dT_JC_C": {
          "type": [
            "number",
            "null"
          ]
        },
        "dT_CS_C": {
          "type": [
            "number",
            "null"
          ]
        },
        "dT_SA_C": {
          "type": [
            "number",
            "null"
          ]
        },
        "Tj_C": {
          "type": [
            "number",
            "null"
          ]
        },
        "Tj_max_C": {
          "type": [
            "number",
            "null"
          ]
        },
        "margin_C": {
          "type": [
            "number",
            "null"
          ]
        },
        "warnings": {
          "type": "array",
          "description": "HEATSINK_INFEASIBLE when θSA,max ≤ 0. Also copied to the response-level warnings array.",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "code"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "severity": {
                "type": "string"
              },
              "detail": {
                "type": "string"
              },
              "suggestion": {
                "type": "string"
              }
            }
          }
        }
      },
      "oneOf": [
        {
          "description": "Effective θJA: Rth_JA set; stack fields and Rth_SA_required null",
          "properties": {
            "thermal_path": {
              "const": "JA"
            },
            "mode": {
              "const": "junction_effective_ja"
            },
            "Tj_C": {
              "type": "number"
            },
            "Rth_JA": {
              "type": "number"
            },
            "Rth_JC": {
              "type": "null"
            },
            "Rth_CS": {
              "type": "null"
            },
            "Rth_SA": {
              "type": "null"
            },
            "Rth_SA_required": {
              "type": "null"
            }
          },
          "required": [
            "thermal_path",
            "mode",
            "Tj_C",
            "Rth_JA",
            "Rth_JC",
            "Rth_CS",
            "Rth_SA",
            "Rth_SA_required"
          ]
        },
        {
          "description": "Heatsink stack: Rth_JC+Rth_CS+Rth_SA set; Rth_JA and Rth_SA_required null",
          "properties": {
            "thermal_path": {
              "const": "JC+CS+SA"
            },
            "mode": {
              "const": "junction_heatsink_stack"
            },
            "Tj_C": {
              "type": "number"
            },
            "Rth_JA": {
              "type": "null"
            },
            "Rth_JC": {
              "type": "number"
            },
            "Rth_CS": {
              "type": "number"
            },
            "Rth_SA": {
              "type": "number"
            },
            "Rth_total": {
              "type": "number"
            },
            "Rth_SA_required": {
              "type": "null"
            }
          },
          "required": [
            "thermal_path",
            "mode",
            "Tj_C",
            "Rth_JA",
            "Rth_JC",
            "Rth_CS",
            "Rth_SA",
            "Rth_total",
            "Rth_SA_required"
          ]
        },
        {
          "description": "Required heatsink: Rth_SA_required is θSA,max; Rth_JA and Rth_SA null",
          "properties": {
            "thermal_path": {
              "const": "required_SA"
            },
            "mode": {
              "const": "required_heatsink_sa"
            },
            "Tj_C": {
              "type": "null"
            },
            "Rth_JA": {
              "type": "null"
            },
            "Rth_JC": {
              "type": "number"
            },
            "Rth_CS": {
              "type": "number"
            },
            "Rth_SA": {
              "type": "null"
            },
            "Rth_SA_required": {
              "type": "number"
            },
            "Rth_total_max": {
              "type": "number"
            }
          },
          "required": [
            "thermal_path",
            "mode",
            "Tj_C",
            "Rth_JA",
            "Rth_JC",
            "Rth_CS",
            "Rth_SA",
            "Rth_SA_required",
            "Rth_total_max"
          ]
        }
      ]
    },
    "result_detail": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "unit",
        "formatted"
      ],
      "properties": {
        "value": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "thermal_path",
            "Ta_C",
            "P_W",
            "Rth_C_per_W",
            "dT_C"
          ],
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "junction_effective_ja",
                "junction_heatsink_stack",
                "required_heatsink_sa"
              ]
            },
            "thermal_path": {
              "type": "string",
              "enum": [
                "JA",
                "JC+CS+SA",
                "required_SA"
              ],
              "description": "JA = effective θJA; JC+CS+SA = explicit heatsink stack; required_SA = solved θSA,max. Not interchangeable models."
            },
            "Ta_C": {
              "type": "number"
            },
            "P_W": {
              "type": "number",
              "minimum": 0
            },
            "Rth_C_per_W": {
              "type": "number",
              "description": "Headline resistance: θJA or θtotal on rise models; θSA,max on required_heatsink_sa"
            },
            "Rth_total": {
              "type": [
                "number",
                "null"
              ]
            },
            "Rth_total_max": {
              "type": [
                "number",
                "null"
              ],
              "description": "(Tj,max−Ta)/P in required mode"
            },
            "Rth_SA_required": {
              "type": [
                "number",
                "null"
              ]
            },
            "Rth_JA": {
              "type": [
                "number",
                "null"
              ]
            },
            "Rth_JC": {
              "type": [
                "number",
                "null"
              ]
            },
            "Rth_CS": {
              "type": [
                "number",
                "null"
              ]
            },
            "Rth_SA": {
              "type": [
                "number",
                "null"
              ]
            },
            "dT_C": {
              "type": "number"
            },
            "dT_JC_C": {
              "type": [
                "number",
                "null"
              ]
            },
            "dT_CS_C": {
              "type": [
                "number",
                "null"
              ]
            },
            "dT_SA_C": {
              "type": [
                "number",
                "null"
              ]
            },
            "Tj_C": {
              "type": [
                "number",
                "null"
              ]
            },
            "Tj_max_C": {
              "type": [
                "number",
                "null"
              ]
            },
            "margin_C": {
              "type": [
                "number",
                "null"
              ]
            },
            "warnings": {
              "type": "array",
              "description": "HEATSINK_INFEASIBLE when θSA,max ≤ 0. Also copied to the response-level warnings array.",
              "items": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "severity": {
                    "type": "string"
                  },
                  "detail": {
                    "type": "string"
                  },
                  "suggestion": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "oneOf": [
            {
              "description": "Effective θJA: Rth_JA set; stack fields and Rth_SA_required null",
              "properties": {
                "thermal_path": {
                  "const": "JA"
                },
                "mode": {
                  "const": "junction_effective_ja"
                },
                "Tj_C": {
                  "type": "number"
                },
                "Rth_JA": {
                  "type": "number"
                },
                "Rth_JC": {
                  "type": "null"
                },
                "Rth_CS": {
                  "type": "null"
                },
                "Rth_SA": {
                  "type": "null"
                },
                "Rth_SA_required": {
                  "type": "null"
                }
              },
              "required": [
                "thermal_path",
                "mode",
                "Tj_C",
                "Rth_JA",
                "Rth_JC",
                "Rth_CS",
                "Rth_SA",
                "Rth_SA_required"
              ]
            },
            {
              "description": "Heatsink stack: Rth_JC+Rth_CS+Rth_SA set; Rth_JA and Rth_SA_required null",
              "properties": {
                "thermal_path": {
                  "const": "JC+CS+SA"
                },
                "mode": {
                  "const": "junction_heatsink_stack"
                },
                "Tj_C": {
                  "type": "number"
                },
                "Rth_JA": {
                  "type": "null"
                },
                "Rth_JC": {
                  "type": "number"
                },
                "Rth_CS": {
                  "type": "number"
                },
                "Rth_SA": {
                  "type": "number"
                },
                "Rth_total": {
                  "type": "number"
                },
                "Rth_SA_required": {
                  "type": "null"
                }
              },
              "required": [
                "thermal_path",
                "mode",
                "Tj_C",
                "Rth_JA",
                "Rth_JC",
                "Rth_CS",
                "Rth_SA",
                "Rth_total",
                "Rth_SA_required"
              ]
            },
            {
              "description": "Required heatsink: Rth_SA_required is θSA,max; Rth_JA and Rth_SA null",
              "properties": {
                "thermal_path": {
                  "const": "required_SA"
                },
                "mode": {
                  "const": "required_heatsink_sa"
                },
                "Tj_C": {
                  "type": "null"
                },
                "Rth_JA": {
                  "type": "null"
                },
                "Rth_JC": {
                  "type": "number"
                },
                "Rth_CS": {
                  "type": "number"
                },
                "Rth_SA": {
                  "type": "null"
                },
                "Rth_SA_required": {
                  "type": "number"
                },
                "Rth_total_max": {
                  "type": "number"
                }
              },
              "required": [
                "thermal_path",
                "mode",
                "Tj_C",
                "Rth_JA",
                "Rth_JC",
                "Rth_CS",
                "Rth_SA",
                "Rth_SA_required",
                "Rth_total_max"
              ]
            }
          ]
        },
        "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.1.0"
    },
    "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"
        }
      }
    }
  }
}
