{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.scientific_notation/2.0.1/output.json",
  "title": "Scientific notation — success output",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "status",
    "capability_id",
    "engine",
    "inputs",
    "result",
    "result_detail",
    "calculation_version",
    "verification",
    "review"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Requested tool id"
    },
    "status": {
      "const": "success"
    },
    "capability_id": {
      "const": "math.scientific_notation"
    },
    "tool": {
      "type": "string",
      "description": "Requested tool id"
    },
    "engine": {
      "type": "string"
    },
    "inputs": {
      "description": "Normalized calculation inputs (aliases resolved to canonical form)",
      "type": "object",
      "oneOf": [
        {
          "title": "convert",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "value"
          ],
          "properties": {
            "mode": {
              "const": "convert",
              "description": "Decimal / E / A×10ⁿ → normalized scientific notation"
            },
            "value": {
              "type": [
                "number",
                "string"
              ],
              "description": "Decimal, E-notation, or A×10ⁿ literal. Share-URL alias numInput is not part of this contract.",
              "maxLength": 512
            }
          }
        },
        {
          "title": "engineering",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "value"
          ],
          "properties": {
            "mode": {
              "const": "engineering",
              "description": "Same parse as convert; primary form uses n ≡ 0 (mod 3)"
            },
            "value": {
              "type": [
                "number",
                "string"
              ],
              "description": "Decimal, E-notation, or A×10ⁿ literal. Share-URL alias numInput is not part of this contract.",
              "maxLength": 512
            }
          }
        },
        {
          "title": "normalize",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "coef",
            "exp"
          ],
          "properties": {
            "mode": {
              "const": "normalize",
              "description": "Rewrite A×10ⁿ so 1 ≤ |A| < 10 (zero → 0)"
            },
            "coef": {
              "type": [
                "number",
                "string"
              ],
              "description": "Coefficient A. Share-URL alias coefInput is not part of this contract. Decimal token retained until combined conversion; exponent must be an integer within±10000.",
              "maxLength": 512
            },
            "exp": {
              "type": [
                "number",
                "string"
              ],
              "description": "Integer exponent n. Share-URL alias expInput is not part of this contract. Decimal token retained until combined conversion; exponent must be an integer within±10000.",
              "maxLength": 512
            }
          }
        },
        {
          "title": "operate",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "op",
            "a",
            "b"
          ],
          "properties": {
            "mode": {
              "const": "operate",
              "description": "±×÷ of two scientific values, then normalize"
            },
            "op": {
              "type": "string",
              "enum": [
                "mul",
                "div",
                "add",
                "sub"
              ]
            },
            "a": {
              "type": [
                "number",
                "string"
              ],
              "description": "Operand A (decimal, E-notation, or A×10ⁿ). Share-URL alias aInput is not part of this contract.",
              "maxLength": 512
            },
            "b": {
              "type": [
                "number",
                "string"
              ],
              "description": "Operand B (decimal, E-notation, or A×10ⁿ). Share-URL alias bInput is not part of this contract.",
              "maxLength": 512
            }
          }
        }
      ]
    },
    "result": {
      "type": "object",
      "additionalProperties": false,
      "required": [],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "convert",
            "engineering",
            "normalize",
            "operate"
          ]
        },
        "coef": {
          "type": "number",
          "description": "Normalized scientific coefficient A"
        },
        "exp": {
          "type": "integer",
          "description": "Normalized scientific exponent n"
        },
        "value": {
          "type": "number",
          "description": "Reconstructed finite real (binary64)"
        },
        "eng_coef": {
          "type": "number",
          "description": "Engineering coefficient (n ≡ 0 mod 3)"
        },
        "eng_exp": {
          "type": "integer",
          "description": "Engineering exponent, multiple of 3"
        },
        "op": {
          "type": "string",
          "enum": [
            "mul",
            "div",
            "add",
            "sub"
          ]
        }
      },
      "oneOf": [
        {
          "title": "convert",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "coef",
            "exp",
            "value"
          ],
          "properties": {
            "mode": {
              "const": "convert"
            },
            "coef": {
              "type": "number"
            },
            "exp": {
              "type": "integer"
            },
            "value": {
              "type": "number"
            }
          }
        },
        {
          "title": "engineering",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "eng_coef",
            "eng_exp",
            "value"
          ],
          "properties": {
            "mode": {
              "const": "engineering"
            },
            "eng_coef": {
              "type": "number"
            },
            "eng_exp": {
              "type": "integer"
            },
            "value": {
              "type": "number"
            }
          }
        },
        {
          "title": "normalize",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "coef",
            "exp",
            "value"
          ],
          "properties": {
            "mode": {
              "const": "normalize"
            },
            "coef": {
              "type": "number"
            },
            "exp": {
              "type": "integer"
            },
            "value": {
              "type": "number"
            }
          }
        },
        {
          "title": "operate",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "op",
            "coef",
            "exp",
            "value"
          ],
          "properties": {
            "mode": {
              "const": "operate"
            },
            "op": {
              "type": "string",
              "enum": [
                "mul",
                "div",
                "add",
                "sub"
              ]
            },
            "coef": {
              "type": "number"
            },
            "exp": {
              "type": "integer"
            },
            "value": {
              "type": "number"
            }
          }
        }
      ]
    },
    "result_detail": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "unit",
        "formatted"
      ],
      "properties": {
        "value": {
          "type": "object",
          "additionalProperties": false,
          "required": [],
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "convert",
                "engineering",
                "normalize",
                "operate"
              ]
            },
            "coef": {
              "type": "number",
              "description": "Normalized scientific coefficient A"
            },
            "exp": {
              "type": "integer",
              "description": "Normalized scientific exponent n"
            },
            "value": {
              "type": "number",
              "description": "Reconstructed finite real (binary64)"
            },
            "eng_coef": {
              "type": "number",
              "description": "Engineering coefficient (n ≡ 0 mod 3)"
            },
            "eng_exp": {
              "type": "integer",
              "description": "Engineering exponent, multiple of 3"
            },
            "op": {
              "type": "string",
              "enum": [
                "mul",
                "div",
                "add",
                "sub"
              ]
            }
          },
          "oneOf": [
            {
              "title": "convert",
              "type": "object",
              "additionalProperties": false,
              "required": [
                "mode",
                "coef",
                "exp",
                "value"
              ],
              "properties": {
                "mode": {
                  "const": "convert"
                },
                "coef": {
                  "type": "number"
                },
                "exp": {
                  "type": "integer"
                },
                "value": {
                  "type": "number"
                }
              }
            },
            {
              "title": "engineering",
              "type": "object",
              "additionalProperties": false,
              "required": [
                "mode",
                "eng_coef",
                "eng_exp",
                "value"
              ],
              "properties": {
                "mode": {
                  "const": "engineering"
                },
                "eng_coef": {
                  "type": "number"
                },
                "eng_exp": {
                  "type": "integer"
                },
                "value": {
                  "type": "number"
                }
              }
            },
            {
              "title": "normalize",
              "type": "object",
              "additionalProperties": false,
              "required": [
                "mode",
                "coef",
                "exp",
                "value"
              ],
              "properties": {
                "mode": {
                  "const": "normalize"
                },
                "coef": {
                  "type": "number"
                },
                "exp": {
                  "type": "integer"
                },
                "value": {
                  "type": "number"
                }
              }
            },
            {
              "title": "operate",
              "type": "object",
              "additionalProperties": false,
              "required": [
                "mode",
                "op",
                "coef",
                "exp",
                "value"
              ],
              "properties": {
                "mode": {
                  "const": "operate"
                },
                "op": {
                  "type": "string",
                  "enum": [
                    "mul",
                    "div",
                    "add",
                    "sub"
                  ]
                },
                "coef": {
                  "type": "number"
                },
                "exp": {
                  "type": "integer"
                },
                "value": {
                  "type": "number"
                }
              }
            }
          ]
        },
        "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,
      "description": "Computational verification under CVP. Review-policy tiers live on `review`, not here.",
      "required": [
        "cvp"
      ],
      "properties": {
        "cvp": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status",
            "protocol",
            "profile",
            "verified_scope",
            "verification_revision",
            "evidence_digest"
          ],
          "properties": {
            "status": {
              "type": "string",
              "description": "CVP verification status (e.g. VERIFIED)"
            },
            "protocol": {
              "type": "string",
              "description": "CVP protocol id, e.g. 1.0.0-proposed"
            },
            "profile": {
              "type": "string"
            },
            "verified_scope": {
              "type": "string"
            },
            "verification_revision": {
              "type": [
                "string",
                "null"
              ]
            },
            "evidence_digest": {
              "type": [
                "string",
                "null"
              ]
            },
            "production": {
              "type": [
                "string",
                "null"
              ],
              "description": "Production freshness, e.g. CURRENT"
            },
            "evidence": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      }
    },
    "review": {
      "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": "2.0.1"
    },
    "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"
        }
      }
    }
  }
}
