{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.voltage_drop.output.json",
  "title": "Voltage drop — 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.voltage_drop"
    },
    "tool": {
      "type": "string",
      "description": "Requested tool id"
    },
    "engine": {
      "type": "string"
    },
    "inputs": {
      "description": "Canonical echoed inputs. REST may omit mode (echoed as dc); Agent schema requires mode. Optional V_system and u_* only appear when provided.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "I",
        "length_m",
        "R_ohm_per_km"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "dc",
            "three"
          ]
        },
        "I": {
          "type": "number",
          "minimum": 0
        },
        "length_m": {
          "type": "number",
          "minimum": 0
        },
        "R_ohm_per_km": {
          "type": "number",
          "minimum": 0
        },
        "V_system": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "u_I": {
          "type": "number",
          "minimum": 0
        },
        "u_length_m": {
          "type": "number",
          "minimum": 0
        },
        "u_R_ohm_per_km": {
          "type": "number",
          "minimum": 0
        },
        "uncertainty_k": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "confidence": {
          "type": "number",
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1
        }
      }
    },
    "result": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "V_drop",
        "R_one_way",
        "P_loss"
      ],
      "properties": {
        "V_drop": {
          "type": "number",
          "description": "Estimated voltage drop (V)"
        },
        "R_one_way": {
          "type": "number",
          "description": "One-way conductor resistance (Ω) = L(m)·R_km/1000"
        },
        "R_loop": {
          "type": "number",
          "description": "Go-and-return loop resistance (Ω) = 2·R_one_way; present for dc / resistive 1φ only"
        },
        "P_loss": {
          "type": "number",
          "description": "Conductor I²R loss (W). DC / resistive 1φ: I²·2R. Balanced 3φ: 3·I²·R."
        },
        "percent_drop": {
          "type": "number",
          "description": "Present when V_system is set: 100·V_drop/V_system. 3φ uses line-to-line V_system."
        },
        "V_load": {
          "type": "number",
          "description": "Present when V_system is set: estimated load voltage V_system − V_drop (same basis as V_system)"
        },
        "uncertainty": {
          "description": "Present when any u_* is provided; UncertaintySummary via engineering.uncertainty.propagate (sensitivity on V_drop)",
          "allOf": [
            {
              "$ref": "https://www.calculatorx.com/schemas/common/uncertainty-summary.json"
            }
          ]
        },
        "warnings": {
          "type": "array",
          "description": "Structured notices (also mirrored on the API envelope warnings[])",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "code"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "severity": {
                "type": "string"
              },
              "detail": {
                "type": "string"
              },
              "suggestion": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "result_detail": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "unit",
        "formatted"
      ],
      "properties": {
        "value": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "V_drop",
            "R_one_way",
            "P_loss"
          ],
          "properties": {
            "V_drop": {
              "type": "number",
              "description": "Estimated voltage drop (V)"
            },
            "R_one_way": {
              "type": "number",
              "description": "One-way conductor resistance (Ω) = L(m)·R_km/1000"
            },
            "R_loop": {
              "type": "number",
              "description": "Go-and-return loop resistance (Ω) = 2·R_one_way; present for dc / resistive 1φ only"
            },
            "P_loss": {
              "type": "number",
              "description": "Conductor I²R loss (W). DC / resistive 1φ: I²·2R. Balanced 3φ: 3·I²·R."
            },
            "percent_drop": {
              "type": "number",
              "description": "Present when V_system is set: 100·V_drop/V_system. 3φ uses line-to-line V_system."
            },
            "V_load": {
              "type": "number",
              "description": "Present when V_system is set: estimated load voltage V_system − V_drop (same basis as V_system)"
            },
            "uncertainty": {
              "description": "Present when any u_* is provided; UncertaintySummary via engineering.uncertainty.propagate (sensitivity on V_drop)",
              "allOf": [
                {
                  "$ref": "https://www.calculatorx.com/schemas/common/uncertainty-summary.json"
                }
              ]
            },
            "warnings": {
              "type": "array",
              "description": "Structured notices (also mirrored on the API envelope warnings[])",
              "items": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "severity": {
                    "type": "string"
                  },
                  "detail": {
                    "type": "string"
                  },
                  "suggestion": {
                    "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.5.2"
    },
    "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"
        }
      }
    }
  }
}
