{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/electronics-architect-com/json-schema/electronics-architect-com-job-response-schema.json",
  "title": "JobResponse",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/electronics-architect-com-openapi.json#/components/schemas/JobResponse",
  "type": "object",
  "properties": {
    "job": {
      "$ref": "#/$defs/Job"
    },
    "result": {
      "$ref": "#/$defs/JobResult"
    },
    "meta": {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "integer"
        },
        "trials": {
          "type": "integer"
        },
        "requestedTrials": {
          "type": "integer"
        },
        "clamped": {
          "type": "boolean"
        },
        "clampedBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "seed": {
          "type": "integer"
        },
        "advanced": {
          "type": "boolean",
          "description": "On a poll: whether this request ran a slice."
        },
        "trialsThisSlice": {
          "type": "integer",
          "description": "How many trials the slice inside THIS request ran (0 when none ran). Divide the trials left by it for the polls remaining — measured on this job, not estimated from its size."
        },
        "cancelled": {
          "type": "boolean"
        },
        "refunded": {
          "type": "boolean"
        },
        "elapsedMs": {
          "type": "number"
        },
        "metered": {
          "type": "boolean"
        },
        "feature": {
          "type": "string"
        },
        "attribution": {
          "type": "object"
        }
      }
    }
  },
  "$defs": {
    "Job": {
      "type": "object",
      "description": "A Monte Carlo job: status and progress.",
      "properties": {
        "id": {
          "type": "string",
          "description": "`job_` + 20 characters."
        },
        "kind": {
          "type": "string",
          "enum": [
            "monte_carlo"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "running",
            "done",
            "failed",
            "cancelled",
            "expired"
          ]
        },
        "trials": {
          "type": "object",
          "properties": {
            "total": {
              "type": "integer"
            },
            "done": {
              "type": "integer"
            }
          }
        },
        "progress": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "sliceInProgress": {
          "type": "boolean",
          "description": "Another request is running a slice right now; poll again."
        },
        "seed": {
          "type": "integer"
        },
        "error": {
          "type": "string",
          "description": "Only when `failed`."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "JobResult": {
      "type": "object",
      "description": "The synchronous Monte Carlo result without its per-trial array: summary, seed, trialCount, failedTrials, unconvergedTrials, protectionTrips, operatingTrials, plus `nodeStats` — per node, `trials` and min / mean / max / stddev of voltage, current, power and temperature (over every solved trial, as the MCP digest folds them) with `thermalViolations` — and `attribution`.",
      "properties": {
        "summary": {
          "type": "object"
        },
        "nodeStats": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          }
        },
        "seed": {
          "type": "integer"
        },
        "trialCount": {
          "type": "integer"
        },
        "failedTrials": {
          "type": "integer"
        },
        "protectionTrips": {
          "type": "integer"
        },
        "operatingTrials": {
          "type": "integer"
        },
        "elapsedMs": {
          "type": "number",
          "description": "CPU time summed over every slice."
        },
        "attribution": {
          "type": "object"
        }
      }
    }
  }
}