{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.linear_algebra/1.14.16/output.json",
  "title": "Linear system / small matrix — 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": "math.linear_algebra"
    },
    "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",
        "order"
      ],
      "properties": {
        "mode": {
          "type": "string"
        },
        "order": {
          "type": "integer"
        },
        "rows": {
          "type": "integer"
        },
        "cols": {
          "type": "integer"
        },
        "status": {
          "type": "string"
        },
        "x": {
          "type": [
            "number",
            "null"
          ]
        },
        "y": {
          "type": [
            "number",
            "null"
          ]
        },
        "z": {
          "type": [
            "number",
            "null"
          ]
        },
        "residual_2": {
          "type": [
            "number",
            "null"
          ]
        },
        "backward_error": {
          "type": [
            "number",
            "null"
          ]
        },
        "rref": {
          "type": "array"
        },
        "pivot_columns": {
          "type": "array"
        },
        "det": {
          "type": "number"
        },
        "rank": {
          "type": "integer"
        },
        "method": {
          "type": "string"
        },
        "algorithm": {
          "type": "string"
        },
        "numeric_backend": {
          "type": "string"
        },
        "condition_number": {
          "type": [
            "number",
            "null"
          ]
        },
        "basis": {
          "type": "array"
        },
        "dimension": {
          "type": "integer"
        },
        "singular_values": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "number"
          }
        },
        "rank_numeric": {
          "type": "integer"
        },
        "S": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "VT": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "eigenvalues": {
          "type": "array"
        },
        "L": {
          "type": "array"
        },
        "Q": {
          "type": "array"
        },
        "inv": {
          "type": "array"
        },
        "reconstruction_residual": {
          "type": "number"
        },
        "orthogonality_residual": {
          "type": "number"
        },
        "residual_max": {
          "type": "number"
        },
        "singular": {
          "type": "boolean"
        },
        "eigenvectors": {
          "type": "array"
        },
        "U": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "R": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "formula": {
          "type": "string"
        },
        "A": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "B": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "AT": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "product": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "P": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "rhs": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "vector": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "number"
          }
        },
        "p": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "char_poly": {
          "type": [
            "string",
            "null"
          ]
        },
        "singularity_threshold": {
          "type": "number"
        },
        "u_orthogonality_residual": {
          "type": "number"
        },
        "v_orthogonality_residual": {
          "type": "number"
        },
        "basis_residual": {
          "type": "number"
        },
        "projection_residual": {
          "type": "number"
        },
        "norm_1": {
          "type": "number"
        },
        "inverse_norm_1": {
          "type": "number"
        },
        "solver": {
          "type": "string"
        },
        "norm": {
          "type": "string"
        },
        "w": {
          "type": [
            "number",
            "null"
          ]
        },
        "infinite": {
          "type": "boolean"
        },
        "eigenvectors_found": {
          "type": "integer"
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "severity",
              "detail"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "severity": {
                "type": "string"
              },
              "detail": {
                "type": "string"
              }
            }
          }
        },
        "trivial": {
          "type": "boolean"
        },
        "free_columns": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "effective_A": {
          "type": "array",
          "minItems": 2,
          "maxItems": 4,
          "items": {
            "type": "array",
            "minItems": 2,
            "maxItems": 4,
            "items": {
              "type": "number"
            }
          }
        },
        "symmetry_error": {
          "type": "number",
          "minimum": 0
        },
        "symmetry_tolerance": {
          "type": "number",
          "const": 1e-12
        },
        "symmetry_policy": {
          "type": "string",
          "const": "relative_pairwise_lower_triangle"
        },
        "relative_reconstruction_residual": {
          "type": "number",
          "minimum": 0
        },
        "reconstruction_tolerance": {
          "type": "number",
          "minimum": 0
        }
      },
      "oneOf": [
        {
          "properties": {
            "mode": {
              "const": "solve"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "status",
            "vector"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "det"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "det"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "inverse"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "inv"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "multiply"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "product",
            "B"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "transpose"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "AT"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "rank"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "rank"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "lu"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "L",
            "U",
            "P"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "chol"
            },
            "A": {
              "type": "array",
              "minItems": 2,
              "maxItems": 4,
              "items": {
                "type": "array",
                "minItems": 2,
                "maxItems": 4,
                "items": {
                  "type": "number"
                }
              }
            },
            "L": {
              "type": "array",
              "minItems": 2,
              "maxItems": 4,
              "items": {
                "type": "array",
                "minItems": 2,
                "maxItems": 4,
                "items": {
                  "type": "number"
                }
              }
            },
            "effective_A": {
              "type": "array",
              "minItems": 2,
              "maxItems": 4,
              "items": {
                "type": "array",
                "minItems": 2,
                "maxItems": 4,
                "items": {
                  "type": "number"
                }
              }
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "L",
            "effective_A",
            "symmetry_error",
            "symmetry_tolerance",
            "symmetry_policy",
            "relative_reconstruction_residual",
            "reconstruction_tolerance"
          ],
          "allOf": [
            {
              "if": {
                "properties": {
                  "order": {
                    "const": 2
                  }
                }
              },
              "then": {
                "properties": {
                  "A": {
                    "minItems": 2,
                    "maxItems": 2,
                    "items": {
                      "minItems": 2,
                      "maxItems": 2
                    }
                  },
                  "L": {
                    "minItems": 2,
                    "maxItems": 2,
                    "items": {
                      "minItems": 2,
                      "maxItems": 2
                    }
                  },
                  "effective_A": {
                    "minItems": 2,
                    "maxItems": 2,
                    "items": {
                      "minItems": 2,
                      "maxItems": 2
                    }
                  }
                }
              }
            },
            {
              "if": {
                "properties": {
                  "order": {
                    "const": 3
                  }
                }
              },
              "then": {
                "properties": {
                  "A": {
                    "minItems": 3,
                    "maxItems": 3,
                    "items": {
                      "minItems": 3,
                      "maxItems": 3
                    }
                  },
                  "L": {
                    "minItems": 3,
                    "maxItems": 3,
                    "items": {
                      "minItems": 3,
                      "maxItems": 3
                    }
                  },
                  "effective_A": {
                    "minItems": 3,
                    "maxItems": 3,
                    "items": {
                      "minItems": 3,
                      "maxItems": 3
                    }
                  }
                }
              }
            },
            {
              "if": {
                "properties": {
                  "order": {
                    "const": 4
                  }
                }
              },
              "then": {
                "properties": {
                  "A": {
                    "minItems": 4,
                    "maxItems": 4,
                    "items": {
                      "minItems": 4,
                      "maxItems": 4
                    }
                  },
                  "L": {
                    "minItems": 4,
                    "maxItems": 4,
                    "items": {
                      "minItems": 4,
                      "maxItems": 4
                    }
                  },
                  "effective_A": {
                    "minItems": 4,
                    "maxItems": 4,
                    "items": {
                      "minItems": 4,
                      "maxItems": 4
                    }
                  }
                }
              }
            }
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "qr"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "Q",
            "R"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "svd"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "U",
            "S",
            "VT",
            "singular_values"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "lstsq"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "vector",
            "residual_2"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "rref"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "rref",
            "rank"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "condition"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "condition_number",
            "infinite"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "nullspace"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "basis",
            "dimension"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "columnspace"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "basis",
            "dimension"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "rowspace"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "basis",
            "dimension"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "leftnullspace"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "basis",
            "dimension"
          ]
        },
        {
          "properties": {
            "mode": {
              "const": "eigen"
            }
          },
          "required": [
            "mode",
            "order",
            "A",
            "eigenvalues",
            "solver",
            "eigenvectors"
          ]
        }
      ]
    },
    "result_detail": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "unit",
        "formatted"
      ],
      "properties": {
        "value": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "order"
          ],
          "properties": {
            "mode": {
              "type": "string"
            },
            "order": {
              "type": "integer"
            },
            "rows": {
              "type": "integer"
            },
            "cols": {
              "type": "integer"
            },
            "status": {
              "type": "string"
            },
            "x": {
              "type": [
                "number",
                "null"
              ]
            },
            "y": {
              "type": [
                "number",
                "null"
              ]
            },
            "z": {
              "type": [
                "number",
                "null"
              ]
            },
            "residual_2": {
              "type": [
                "number",
                "null"
              ]
            },
            "backward_error": {
              "type": [
                "number",
                "null"
              ]
            },
            "rref": {
              "type": "array"
            },
            "pivot_columns": {
              "type": "array"
            },
            "det": {
              "type": "number"
            },
            "rank": {
              "type": "integer"
            },
            "method": {
              "type": "string"
            },
            "algorithm": {
              "type": "string"
            },
            "numeric_backend": {
              "type": "string"
            },
            "condition_number": {
              "type": [
                "number",
                "null"
              ]
            },
            "basis": {
              "type": "array"
            },
            "dimension": {
              "type": "integer"
            },
            "singular_values": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "number"
              }
            },
            "rank_numeric": {
              "type": "integer"
            },
            "S": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "VT": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "eigenvalues": {
              "type": "array"
            },
            "L": {
              "type": "array"
            },
            "Q": {
              "type": "array"
            },
            "inv": {
              "type": "array"
            },
            "reconstruction_residual": {
              "type": "number"
            },
            "orthogonality_residual": {
              "type": "number"
            },
            "residual_max": {
              "type": "number"
            },
            "singular": {
              "type": "boolean"
            },
            "eigenvectors": {
              "type": "array"
            },
            "U": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "R": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "formula": {
              "type": "string"
            },
            "A": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "B": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "AT": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "product": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "P": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "rhs": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "vector": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "number"
              }
            },
            "p": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "char_poly": {
              "type": [
                "string",
                "null"
              ]
            },
            "singularity_threshold": {
              "type": "number"
            },
            "u_orthogonality_residual": {
              "type": "number"
            },
            "v_orthogonality_residual": {
              "type": "number"
            },
            "basis_residual": {
              "type": "number"
            },
            "projection_residual": {
              "type": "number"
            },
            "norm_1": {
              "type": "number"
            },
            "inverse_norm_1": {
              "type": "number"
            },
            "solver": {
              "type": "string"
            },
            "norm": {
              "type": "string"
            },
            "w": {
              "type": [
                "number",
                "null"
              ]
            },
            "infinite": {
              "type": "boolean"
            },
            "eigenvectors_found": {
              "type": "integer"
            },
            "warnings": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "code",
                  "severity",
                  "detail"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "severity": {
                    "type": "string"
                  },
                  "detail": {
                    "type": "string"
                  }
                }
              }
            },
            "trivial": {
              "type": "boolean"
            },
            "free_columns": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "effective_A": {
              "type": "array",
              "minItems": 2,
              "maxItems": 4,
              "items": {
                "type": "array",
                "minItems": 2,
                "maxItems": 4,
                "items": {
                  "type": "number"
                }
              }
            },
            "symmetry_error": {
              "type": "number",
              "minimum": 0
            },
            "symmetry_tolerance": {
              "type": "number",
              "const": 1e-12
            },
            "symmetry_policy": {
              "type": "string",
              "const": "relative_pairwise_lower_triangle"
            },
            "relative_reconstruction_residual": {
              "type": "number",
              "minimum": 0
            },
            "reconstruction_tolerance": {
              "type": "number",
              "minimum": 0
            }
          },
          "oneOf": [
            {
              "properties": {
                "mode": {
                  "const": "solve"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "status",
                "vector"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "det"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "det"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "inverse"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "inv"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "multiply"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "product",
                "B"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "transpose"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "AT"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "rank"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "rank"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "lu"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "L",
                "U",
                "P"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "chol"
                },
                "A": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 4,
                  "items": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 4,
                    "items": {
                      "type": "number"
                    }
                  }
                },
                "L": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 4,
                  "items": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 4,
                    "items": {
                      "type": "number"
                    }
                  }
                },
                "effective_A": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 4,
                  "items": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 4,
                    "items": {
                      "type": "number"
                    }
                  }
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "L",
                "effective_A",
                "symmetry_error",
                "symmetry_tolerance",
                "symmetry_policy",
                "relative_reconstruction_residual",
                "reconstruction_tolerance"
              ],
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "order": {
                        "const": 2
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "A": {
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "minItems": 2,
                          "maxItems": 2
                        }
                      },
                      "L": {
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "minItems": 2,
                          "maxItems": 2
                        }
                      },
                      "effective_A": {
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "minItems": 2,
                          "maxItems": 2
                        }
                      }
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "order": {
                        "const": 3
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "A": {
                        "minItems": 3,
                        "maxItems": 3,
                        "items": {
                          "minItems": 3,
                          "maxItems": 3
                        }
                      },
                      "L": {
                        "minItems": 3,
                        "maxItems": 3,
                        "items": {
                          "minItems": 3,
                          "maxItems": 3
                        }
                      },
                      "effective_A": {
                        "minItems": 3,
                        "maxItems": 3,
                        "items": {
                          "minItems": 3,
                          "maxItems": 3
                        }
                      }
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "order": {
                        "const": 4
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "A": {
                        "minItems": 4,
                        "maxItems": 4,
                        "items": {
                          "minItems": 4,
                          "maxItems": 4
                        }
                      },
                      "L": {
                        "minItems": 4,
                        "maxItems": 4,
                        "items": {
                          "minItems": 4,
                          "maxItems": 4
                        }
                      },
                      "effective_A": {
                        "minItems": 4,
                        "maxItems": 4,
                        "items": {
                          "minItems": 4,
                          "maxItems": 4
                        }
                      }
                    }
                  }
                }
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "qr"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "Q",
                "R"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "svd"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "U",
                "S",
                "VT",
                "singular_values"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "lstsq"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "vector",
                "residual_2"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "rref"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "rref",
                "rank"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "condition"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "condition_number",
                "infinite"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "nullspace"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "basis",
                "dimension"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "columnspace"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "basis",
                "dimension"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "rowspace"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "basis",
                "dimension"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "leftnullspace"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "basis",
                "dimension"
              ]
            },
            {
              "properties": {
                "mode": {
                  "const": "eigen"
                }
              },
              "required": [
                "mode",
                "order",
                "A",
                "eigenvalues",
                "solver",
                "eigenvectors"
              ]
            }
          ]
        },
        "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"
          ]
        },
        "citation_kind": {
          "type": "string"
        },
        "expert_review": {
          "type": "string"
        },
        "domain_review": {
          "type": "string"
        },
        "calculation_version": {
          "type": "string"
        },
        "calc_tests": {
          "type": [
            "string",
            "null"
          ]
        },
        "tests_passed": {
          "type": [
            "integer",
            "null"
          ]
        },
        "tests_total": {
          "type": [
            "integer",
            "null"
          ]
        },
        "artifact_contract": {
          "type": [
            "string",
            "null"
          ]
        },
        "trust_peek": {
          "type": [
            "string",
            "null"
          ]
        },
        "verification_revision": {
          "type": "string"
        },
        "verified_scope": {
          "type": "string"
        },
        "evidence_digest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "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.14.16"
    },
    "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"
        }
      }
    }
  }
}
