{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/electronics-architect-com/json-schema/electronics-architect-com-derating-response-schema.json",
  "title": "DeratingResponse",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/electronics-architect-com-openapi.json#/components/schemas/DeratingResponse",
  "type": "object",
  "properties": {
    "result": {
      "type": "object",
      "properties": {
        "standard": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "apiId": {
              "type": "string",
              "enum": [
                "NASA_GSFC",
                "IPC_9592"
              ]
            },
            "label": {
              "type": "string"
            },
            "reference": {
              "type": "string"
            }
          }
        },
        "ambientTemperature": {
          "type": "number"
        },
        "summary": {
          "type": "object",
          "properties": {
            "evaluated": {
              "type": "integer"
            },
            "compliant": {
              "type": "integer"
            },
            "warning": {
              "type": "integer"
            },
            "overstressed": {
              "type": "integer"
            },
            "worstStatus": {
              "type": "string",
              "enum": [
                "GREEN",
                "ORANGE",
                "RED"
              ]
            }
          }
        },
        "components": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DeratingComponent"
          }
        },
        "thresholds": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "number",
              "null"
            ]
          },
          "description": "The factor table used: the fraction of the rating allowed per parameter class. `*_tj_cap` and `*_temp_cap` keys are temperature ceilings in °C, `*_tj_margin` keys mean \"never above Tmax − n °C\", `fuse_temp_derate` is the fraction lost per °C above 25 °C, and null means the standard sets no such limit."
        },
        "statusLegend": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "solve": {
          "type": "object",
          "properties": {
            "release": {
              "type": "string"
            },
            "simulatedAt": {
              "type": "string",
              "format": "date-time"
            },
            "elapsedMs": {
              "type": "number"
            },
            "converged": {
              "type": "boolean"
            },
            "sheets": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "sheetIndex": {
                    "type": "integer"
                  },
                  "sheetName": {
                    "type": "string"
                  },
                  "converged": {
                    "type": "boolean"
                  },
                  "error": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "attribution": {
          "$ref": "#/$defs/Attribution"
        },
        "schemaVersion": {
          "type": "integer"
        },
        "standard": {
          "type": "string"
        },
        "corner": {
          "type": "string"
        },
        "ambientTemperature": {
          "type": "number"
        },
        "nodes": {
          "type": "integer"
        },
        "sheets": {
          "type": "integer"
        },
        "elapsedMs": {
          "type": "number"
        },
        "metered": {
          "type": "boolean"
        }
      }
    }
  },
  "$defs": {
    "Attribution": {
      "type": "object",
      "description": "Who solved it and how to check (AR4.1). The same block on every solve response (`meta.attribution`), every export, and — as one line — every PDF, PNG and CSV the editor or the API produces.",
      "properties": {
        "solver": {
          "type": "string"
        },
        "release": {
          "type": "string",
          "description": "The build that solved the design — the release tag on production (e.g. \"0.9.60\"), \"main-<sha>\" on staging, \"dev\" elsewhere."
        },
        "resultContract": {
          "type": "string",
          "description": "The result-shape contract version (`result.version`)."
        },
        "designHash": {
          "type": "string",
          "pattern": "^[0-9a-f]{16}$",
          "description": "Sixteen hex characters of SHA-256 over the canonical design: parts, properties, tolerances, selected parts and wiring. Layout, routing and solve options are excluded, so one design has one hash at every corner."
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "verifyUrl": {
          "type": "string",
          "description": "/verify/{designHash}, with ?s=<token> when the design has a VIEW-ONLY public share link, so the page can re-solve it unaided. An `edit` or `clone` share link is deliberately omitted: that token also opens the design for writing, and an export is a document you hand to someone else."
        },
        "statement": {
          "type": "string",
          "description": "The one printed line: \"Solved by Electronics Architect solver vX · design <hash> · <date> · verify: <url>\"."
        }
      }
    },
    "DeratingCheck": {
      "type": "object",
      "description": "One stress parameter of one part.",
      "properties": {
        "parameterName": {
          "type": "string"
        },
        "actual": {
          "type": "number"
        },
        "rated": {
          "type": "number",
          "description": "The abs-max rating from the part's properties."
        },
        "limit": {
          "type": "number",
          "description": "rated × the standard's factor, or lower where the rule sets its own ceiling: a junction temperature (NASA: ICs never above 110 °C or Tmax − 40, diodes 125 °C or Tmax − 40; IPC: 115 °C) or, at NASA, a resistor's √(P_derated × R)."
        },
        "unit": {
          "type": "string"
        },
        "stressPct": {
          "type": "number",
          "description": "actual over RATED, in percent; a thermal check grades the rise over ambient against the rated rise."
        },
        "status": {
          "type": "string",
          "enum": [
            "GREEN",
            "ORANGE",
            "RED"
          ]
        },
        "basis": {
          "type": [
            "string",
            "null"
          ],
          "description": "Where the rule comes from: a citation such as `EEE-INST-002 M3 Table 4` (M3 microcircuits, S1 diodes, R2 resistors, C1 capacitors, F3 fuses) on a NASA check, or null — a check the standard does not cover, whose factor is the tool's own (capacitor ripple, inductor current, transformer and inverter VA, diode and rectifier power, battery, motor), and every IPC check, because that column has not been checked against IPC-9592."
        }
      }
    },
    "DeratingComponent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "sheet": {
          "type": "string"
        },
        "worstStatus": {
          "type": "string",
          "enum": [
            "GREEN",
            "ORANGE",
            "RED"
          ]
        },
        "worstStressPct": {
          "type": "number"
        },
        "checks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DeratingCheck"
          }
        },
        "unrated": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Parameters whose rating the design leaves unstated (0 or blank). They are not in checks, are not graded and do not count toward the status; the rating must be entered before they can be."
        },
        "recommendations": {
          "type": "string",
          "description": "Mitigation text for every failing check, or a one-line pass, followed by the unrated parameters when there are any."
        }
      }
    }
  }
}