{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.amps_to_volts/1.4.2/output.json",
  "title": "Amps to volts — 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.amps_to_volts"
    },
    "tool": {
      "type": "string",
      "description": "Requested tool id"
    },
    "engine": {
      "type": "string"
    },
    "inputs": {
      "description": "Normalized calculation inputs (aliases resolved to canonical form)",
      "type": "object",
      "oneOf": [
        {
          "title": "a-v-ohm",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "current",
            "resistance"
          ],
          "properties": {
            "mode": {
              "const": "a-v-ohm",
              "description": "A → V (ohms): V = I × R"
            },
            "current": {
              "type": "number",
              "description": "Current in amperes. Callable envelope: 0 and negatives are schema-valid; engine may return VALUE_MUST_BE_NON_NEGATIVE."
            },
            "resistance": {
              "type": "number",
              "description": "Resistance in ohms. Callable envelope: 0 is schema-valid (product path yields 0 V)."
            }
          }
        },
        {
          "title": "v-a-ohm",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "voltage",
            "resistance"
          ],
          "properties": {
            "mode": {
              "const": "v-a-ohm",
              "description": "V → A (ohms): I = V ÷ R"
            },
            "voltage": {
              "type": "number",
              "description": "Voltage in volts. Callable envelope: 0 is schema-valid; 0/0 → UNDEFINED."
            },
            "resistance": {
              "type": "number",
              "description": "Resistance in ohms. Callable envelope: 0 is schema-valid; engine returns RESISTANCE_MUST_BE_NONZERO or UNDEFINED."
            }
          }
        },
        {
          "title": "a-v-watt",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "power",
            "current",
            "system"
          ],
          "properties": {
            "mode": {
              "const": "a-v-watt",
              "description": "A → V (watts): V = P ÷ (√3? · I · PF)"
            },
            "power": {
              "type": "number",
              "description": "Real power in watts. Callable envelope: 0 is schema-valid."
            },
            "current": {
              "type": "number",
              "description": "Current in amperes (RMS for AC). Callable envelope: 0 is schema-valid; engine returns CURRENT_MUST_BE_NONZERO or UNDEFINED."
            },
            "system": {
              "type": "string",
              "enum": [
                "dc",
                "ac_single",
                "ac_three"
              ],
              "description": "dc = DC (PF unused); ac_single = single-phase AC; ac_three = balanced three-phase L-L"
            },
            "power_factor": {
              "type": "number",
              "description": "Required for AC. Must be omitted for DC. Engine requires (0, 1]. UI initializes AC PF to 1.0; Agent must send it for AC. Legacy REST aliases: a/b, phase, pf."
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "system": {
                    "enum": [
                      "ac_single",
                      "ac_three"
                    ]
                  }
                },
                "required": [
                  "system"
                ]
              },
              "then": {
                "required": [
                  "power_factor"
                ]
              }
            },
            {
              "if": {
                "properties": {
                  "system": {
                    "const": "dc"
                  }
                },
                "required": [
                  "system"
                ]
              },
              "then": {
                "not": {
                  "required": [
                    "power_factor"
                  ]
                }
              }
            }
          ]
        },
        {
          "title": "v-a-watt",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "power",
            "voltage",
            "system"
          ],
          "properties": {
            "mode": {
              "const": "v-a-watt",
              "description": "V → A (watts): I = P ÷ (√3? · V · PF)"
            },
            "power": {
              "type": "number",
              "description": "Real power in watts. Callable envelope: 0 is schema-valid."
            },
            "voltage": {
              "type": "number",
              "description": "Voltage in volts (RMS for AC; L-L when system=ac_three). Callable envelope: 0 is schema-valid; engine returns VOLTAGE_MUST_BE_POSITIVE or UNDEFINED."
            },
            "system": {
              "type": "string",
              "enum": [
                "dc",
                "ac_single",
                "ac_three"
              ],
              "description": "dc = DC (PF unused); ac_single = single-phase AC; ac_three = balanced three-phase L-L"
            },
            "power_factor": {
              "type": "number",
              "description": "Required for AC. Must be omitted for DC. Engine requires (0, 1]. UI initializes AC PF to 1.0; Agent must send it for AC. Legacy REST aliases: a/b, phase, pf."
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "system": {
                    "enum": [
                      "ac_single",
                      "ac_three"
                    ]
                  }
                },
                "required": [
                  "system"
                ]
              },
              "then": {
                "required": [
                  "power_factor"
                ]
              }
            },
            {
              "if": {
                "properties": {
                  "system": {
                    "const": "dc"
                  }
                },
                "required": [
                  "system"
                ]
              },
              "then": {
                "not": {
                  "required": [
                    "power_factor"
                  ]
                }
              }
            }
          ]
        }
      ]
    },
    "result": {
      "type": "number",
      "description": "Numeric result"
    },
    "result_detail": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "unit",
        "formatted"
      ],
      "properties": {
        "value": {
          "type": "number",
          "description": "Numeric result"
        },
        "unit": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "V",
                "A"
              ]
            },
            {
              "type": "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.4.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"
        }
      }
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "inputs": {
            "type": "object",
            "properties": {
              "mode": {
                "const": "a-v-ohm"
              }
            },
            "required": [
              "mode"
            ]
          }
        },
        "required": [
          "inputs"
        ]
      },
      "then": {
        "properties": {
          "result_detail": {
            "type": "object",
            "properties": {
              "unit": {
                "const": "V"
              }
            },
            "required": [
              "unit"
            ]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "inputs": {
            "type": "object",
            "properties": {
              "mode": {
                "const": "a-v-watt"
              }
            },
            "required": [
              "mode"
            ]
          }
        },
        "required": [
          "inputs"
        ]
      },
      "then": {
        "properties": {
          "result_detail": {
            "type": "object",
            "properties": {
              "unit": {
                "const": "V"
              }
            },
            "required": [
              "unit"
            ]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "inputs": {
            "type": "object",
            "properties": {
              "mode": {
                "const": "v-a-ohm"
              }
            },
            "required": [
              "mode"
            ]
          }
        },
        "required": [
          "inputs"
        ]
      },
      "then": {
        "properties": {
          "result_detail": {
            "type": "object",
            "properties": {
              "unit": {
                "const": "A"
              }
            },
            "required": [
              "unit"
            ]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "inputs": {
            "type": "object",
            "properties": {
              "mode": {
                "const": "v-a-watt"
              }
            },
            "required": [
              "mode"
            ]
          }
        },
        "required": [
          "inputs"
        ]
      },
      "then": {
        "properties": {
          "result_detail": {
            "type": "object",
            "properties": {
              "unit": {
                "const": "A"
              }
            },
            "required": [
              "unit"
            ]
          }
        }
      }
    }
  ]
}
