{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/engineering.tolerance.monte_carlo/1.12.0/output.json",
  "title": "1-D Tolerance Analysis Workspace — 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": "engineering.tolerance.monte_carlo"
    },
    "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": [
        "mean",
        "std",
        "std_analytic",
        "stack_nom",
        "p05",
        "p50",
        "p95",
        "p99",
        "N",
        "seed"
      ],
      "properties": {
        "mode": {
          "type": "string"
        },
        "profile": {
          "type": "string",
          "enum": [
            "basic",
            "dimensional"
          ]
        },
        "n": {
          "type": "integer"
        },
        "N": {
          "type": "integer"
        },
        "seed": {
          "type": "integer"
        },
        "k_sigma": {
          "type": "number"
        },
        "unit": {
          "type": [
            "string",
            "null"
          ]
        },
        "tol": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "half_tolerances": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "tolerances": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string"
              },
              "nominal": {
                "type": "number"
              },
              "half_tolerance": {
                "type": "number"
              },
              "coefficient": {
                "type": "number"
              },
              "distribution": {
                "type": "string"
              },
              "mean_shift": {
                "type": "number"
              },
              "tol_plus": {
                "type": "number"
              },
              "tol_minus": {
                "type": "number"
              },
              "asymmetric": {
                "type": "boolean"
              },
              "error_mean": {
                "type": "number"
              },
              "error_std": {
                "type": "number"
              }
            }
          }
        },
        "stack_nom": {
          "type": "number",
          "description": "Σ cᵢ·nominalᵢ"
        },
        "mean": {
          "type": "number"
        },
        "std": {
          "type": "number"
        },
        "std_analytic": {
          "type": "number"
        },
        "std_rel_err": {
          "type": [
            "number",
            "null"
          ]
        },
        "p025": {
          "type": "number"
        },
        "p05": {
          "type": "number"
        },
        "p50": {
          "type": "number"
        },
        "p95": {
          "type": "number"
        },
        "p975": {
          "type": "number"
        },
        "p99": {
          "type": "number"
        },
        "stack_worst": {
          "type": "number"
        },
        "stack_rss": {
          "type": "number"
        },
        "LSL": {
          "type": [
            "number",
            "null"
          ]
        },
        "USL": {
          "type": [
            "number",
            "null"
          ]
        },
        "yield": {
          "type": [
            "number",
            "null"
          ],
          "description": "Fraction of samples within spec limits"
        },
        "reject_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "ppm_below": {
          "type": [
            "number",
            "null"
          ]
        },
        "ppm_above": {
          "type": [
            "number",
            "null"
          ]
        },
        "ppm_total": {
          "type": [
            "number",
            "null"
          ]
        },
        "below_count": {
          "type": [
            "integer",
            "null"
          ]
        },
        "above_count": {
          "type": [
            "integer",
            "null"
          ]
        },
        "in_spec_count": {
          "type": [
            "integer",
            "null"
          ]
        },
        "Cpl": {
          "type": [
            "number",
            "null"
          ]
        },
        "Cpu": {
          "type": [
            "number",
            "null"
          ]
        },
        "Ppk": {
          "type": [
            "number",
            "null"
          ]
        },
        "rng": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "algorithm": {
              "type": "string"
            },
            "normal_sampler": {
              "type": "string"
            },
            "version": {
              "type": "string"
            },
            "seed": {
              "type": "integer"
            }
          }
        },
        "histogram": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "bins": {
              "type": "integer"
            },
            "min": {
              "type": "number"
            },
            "max": {
              "type": "number"
            },
            "counts": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            }
          }
        },
        "correlated": {
          "type": "boolean"
        },
        "correlation_model": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "two_piece_normal",
            "gaussian_copula_norta",
            null
          ],
          "description": "null if independent; two_piece_normal for all-normal joint; gaussian_copula_norta for non-normal/mixed marginals."
        },
        "correlations": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "a": {
                "type": "string"
              },
              "b": {
                "type": "string"
              },
              "i": {
                "type": "integer"
              },
              "j": {
                "type": "integer"
              },
              "rho": {
                "type": "number"
              }
            }
          }
        },
        "stack_shift": {
          "type": "number"
        },
        "stack_center": {
          "type": "number",
          "description": "stack_nom + stack_shift"
        },
        "contributors": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string"
              },
              "sigma": {
                "type": "number"
              },
              "variance_share": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "percent": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "sensitivity": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "sensitivity_method": {
                "type": "string"
              },
              "sensitivity_share": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "sobol_first": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "sobol_total": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "shapley_effect": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "shapley_share": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          }
        },
        "Cp": {
          "type": [
            "number",
            "null"
          ]
        },
        "Cpk": {
          "type": [
            "number",
            "null"
          ]
        },
        "stack_dist_mean": {
          "type": "number"
        },
        "sensitivity_method": {
          "type": "string"
        },
        "convergence": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "N": {
                "type": "integer"
              },
              "std": {
                "type": "number"
              },
              "mean": {
                "type": "number"
              },
              "rel_err_vs_analytic": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "code": {
                "type": "string"
              },
              "severity": {
                "type": "string"
              },
              "detail": {
                "type": "string"
              },
              "suggestion": {
                "type": "string"
              }
            }
          }
        },
        "capability_basis": {
          "type": [
            "string",
            "null"
          ]
        },
        "capability_normal_equivalent": {
          "type": "boolean"
        },
        "simulated_Cp": {
          "type": [
            "number",
            "null"
          ]
        },
        "simulated_Cpk": {
          "type": [
            "number",
            "null"
          ]
        },
        "sensitivity_metric": {
          "type": "string"
        },
        "yield_sampling": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "N": {
              "type": "integer"
            },
            "observed_pass": {
              "type": "integer"
            },
            "observed_fail": {
              "type": "integer"
            },
            "observed_yield": {
              "type": "number"
            },
            "rule_of_three": {
              "type": "number"
            },
            "ppm_per_sample": {
              "type": "number"
            },
            "ci_method": {
              "type": "string"
            },
            "ci_level": {
              "type": "number"
            },
            "ci_low": {
              "type": [
                "number",
                "null"
              ]
            },
            "ci_high": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        },
        "calculation_fingerprint": {
          "type": "string",
          "description": "Audit fingerprint: sha256 of canonical normalized inputs + engine/PRNG lock."
        },
        "calculation_short_id": {
          "type": "string",
          "description": "Short FNV-1a32 id for UI/cache only — not an audit fingerprint."
        },
        "sobol": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "sobol_N": {
          "type": [
            "integer",
            "null"
          ]
        },
        "shapley": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "shapley_N": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    },
    "result_detail": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "unit",
        "formatted"
      ],
      "properties": {
        "value": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mean",
            "std",
            "std_analytic",
            "stack_nom",
            "p05",
            "p50",
            "p95",
            "p99",
            "N",
            "seed"
          ],
          "properties": {
            "mode": {
              "type": "string"
            },
            "profile": {
              "type": "string",
              "enum": [
                "basic",
                "dimensional"
              ]
            },
            "n": {
              "type": "integer"
            },
            "N": {
              "type": "integer"
            },
            "seed": {
              "type": "integer"
            },
            "k_sigma": {
              "type": "number"
            },
            "unit": {
              "type": [
                "string",
                "null"
              ]
            },
            "tol": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "half_tolerances": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "tolerances": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "nominal": {
                    "type": "number"
                  },
                  "half_tolerance": {
                    "type": "number"
                  },
                  "coefficient": {
                    "type": "number"
                  },
                  "distribution": {
                    "type": "string"
                  },
                  "mean_shift": {
                    "type": "number"
                  },
                  "tol_plus": {
                    "type": "number"
                  },
                  "tol_minus": {
                    "type": "number"
                  },
                  "asymmetric": {
                    "type": "boolean"
                  },
                  "error_mean": {
                    "type": "number"
                  },
                  "error_std": {
                    "type": "number"
                  }
                }
              }
            },
            "stack_nom": {
              "type": "number",
              "description": "Σ cᵢ·nominalᵢ"
            },
            "mean": {
              "type": "number"
            },
            "std": {
              "type": "number"
            },
            "std_analytic": {
              "type": "number"
            },
            "std_rel_err": {
              "type": [
                "number",
                "null"
              ]
            },
            "p025": {
              "type": "number"
            },
            "p05": {
              "type": "number"
            },
            "p50": {
              "type": "number"
            },
            "p95": {
              "type": "number"
            },
            "p975": {
              "type": "number"
            },
            "p99": {
              "type": "number"
            },
            "stack_worst": {
              "type": "number"
            },
            "stack_rss": {
              "type": "number"
            },
            "LSL": {
              "type": [
                "number",
                "null"
              ]
            },
            "USL": {
              "type": [
                "number",
                "null"
              ]
            },
            "yield": {
              "type": [
                "number",
                "null"
              ],
              "description": "Fraction of samples within spec limits"
            },
            "reject_rate": {
              "type": [
                "number",
                "null"
              ]
            },
            "ppm_below": {
              "type": [
                "number",
                "null"
              ]
            },
            "ppm_above": {
              "type": [
                "number",
                "null"
              ]
            },
            "ppm_total": {
              "type": [
                "number",
                "null"
              ]
            },
            "below_count": {
              "type": [
                "integer",
                "null"
              ]
            },
            "above_count": {
              "type": [
                "integer",
                "null"
              ]
            },
            "in_spec_count": {
              "type": [
                "integer",
                "null"
              ]
            },
            "Cpl": {
              "type": [
                "number",
                "null"
              ]
            },
            "Cpu": {
              "type": [
                "number",
                "null"
              ]
            },
            "Ppk": {
              "type": [
                "number",
                "null"
              ]
            },
            "rng": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "algorithm": {
                  "type": "string"
                },
                "normal_sampler": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "seed": {
                  "type": "integer"
                }
              }
            },
            "histogram": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "bins": {
                  "type": "integer"
                },
                "min": {
                  "type": "number"
                },
                "max": {
                  "type": "number"
                },
                "counts": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                }
              }
            },
            "correlated": {
              "type": "boolean"
            },
            "correlation_model": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "two_piece_normal",
                "gaussian_copula_norta",
                null
              ],
              "description": "null if independent; two_piece_normal for all-normal joint; gaussian_copula_norta for non-normal/mixed marginals."
            },
            "correlations": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "a": {
                    "type": "string"
                  },
                  "b": {
                    "type": "string"
                  },
                  "i": {
                    "type": "integer"
                  },
                  "j": {
                    "type": "integer"
                  },
                  "rho": {
                    "type": "number"
                  }
                }
              }
            },
            "stack_shift": {
              "type": "number"
            },
            "stack_center": {
              "type": "number",
              "description": "stack_nom + stack_shift"
            },
            "contributors": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "sigma": {
                    "type": "number"
                  },
                  "variance_share": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "percent": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "sensitivity": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "sensitivity_method": {
                    "type": "string"
                  },
                  "sensitivity_share": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "sobol_first": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "sobol_total": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "shapley_effect": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "shapley_share": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                }
              }
            },
            "Cp": {
              "type": [
                "number",
                "null"
              ]
            },
            "Cpk": {
              "type": [
                "number",
                "null"
              ]
            },
            "stack_dist_mean": {
              "type": "number"
            },
            "sensitivity_method": {
              "type": "string"
            },
            "convergence": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "N": {
                    "type": "integer"
                  },
                  "std": {
                    "type": "number"
                  },
                  "mean": {
                    "type": "number"
                  },
                  "rel_err_vs_analytic": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                }
              }
            },
            "warnings": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "severity": {
                    "type": "string"
                  },
                  "detail": {
                    "type": "string"
                  },
                  "suggestion": {
                    "type": "string"
                  }
                }
              }
            },
            "capability_basis": {
              "type": [
                "string",
                "null"
              ]
            },
            "capability_normal_equivalent": {
              "type": "boolean"
            },
            "simulated_Cp": {
              "type": [
                "number",
                "null"
              ]
            },
            "simulated_Cpk": {
              "type": [
                "number",
                "null"
              ]
            },
            "sensitivity_metric": {
              "type": "string"
            },
            "yield_sampling": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": false,
              "properties": {
                "N": {
                  "type": "integer"
                },
                "observed_pass": {
                  "type": "integer"
                },
                "observed_fail": {
                  "type": "integer"
                },
                "observed_yield": {
                  "type": "number"
                },
                "rule_of_three": {
                  "type": "number"
                },
                "ppm_per_sample": {
                  "type": "number"
                },
                "ci_method": {
                  "type": "string"
                },
                "ci_level": {
                  "type": "number"
                },
                "ci_low": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ci_high": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            },
            "calculation_fingerprint": {
              "type": "string",
              "description": "Audit fingerprint: sha256 of canonical normalized inputs + engine/PRNG lock."
            },
            "calculation_short_id": {
              "type": "string",
              "description": "Short FNV-1a32 id for UI/cache only — not an audit fingerprint."
            },
            "sobol": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": true
            },
            "sobol_N": {
              "type": [
                "integer",
                "null"
              ]
            },
            "shapley": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": true
            },
            "shapley_N": {
              "type": [
                "integer",
                "null"
              ]
            }
          }
        },
        "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.12.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"
        }
      }
    }
  }
}
