{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thrustlab-com/json-schema/thrustlab-com-sweep-resource-schema.json",
  "title": "SweepResource",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thrustlab-com-openapi.json#/components/schemas/SweepResource",
  "additionalProperties": false,
  "properties": {
    "analysis_type": {
      "title": "Analysis Type",
      "type": "string"
    },
    "battery_component_id": {
      "title": "Battery Component Id",
      "type": "string"
    },
    "cancel_requested_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "When a cancel was requested for a RUNNING sweep. The status stays `running` until the worker honours it at its next point, keeping the points already solved. Null when no cancel was requested; a QUEUED sweep cancels immediately instead and never sets this.",
      "title": "Cancel Requested At"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "When the sweep reached a terminal state — completed, failed or canceled. Null until then.",
      "title": "Completed At"
    },
    "completed_points": {
      "title": "Completed Points",
      "type": "integer"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "When the sweep was submitted.",
      "title": "Created At"
    },
    "credits_breakdown": {
      "anyOf": [
        {
          "$ref": "#/$defs/SweepCreditsBreakdown"
        },
        {
          "type": "null"
        }
      ]
    },
    "credits_cost": {
      "title": "Credits Cost",
      "type": "integer"
    },
    "dispatched_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "When the sweep was handed to the worker queue. Null while it is parked and has never been dispatched. NOT the start of execution: launch_intent=run dispatches at submit, so this can equal created_at while the sweep waits for a slot.",
      "title": "Dispatched At"
    },
    "error": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "id": {
      "title": "Id",
      "type": "string"
    },
    "input_snapshot": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Input Snapshot"
    },
    "inputs": {
      "$ref": "#/$defs/SweepInputs"
    },
    "is_starred": {
      "title": "Is Starred",
      "type": "boolean"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name"
    },
    "object": {
      "const": "sweep",
      "title": "Object",
      "type": "string"
    },
    "plot_config_json": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Plot Config Json"
    },
    "progress": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Progress"
    },
    "project_id": {
      "title": "Project Id",
      "type": "string"
    },
    "propeller_model": {
      "default": "full",
      "title": "Propeller Model",
      "type": "string"
    },
    "rotor_groups": {
      "items": {
        "$ref": "#/$defs/RotorGroupResource"
      },
      "title": "Rotor Groups",
      "type": "array"
    },
    "snapshot_version": {
      "default": 1,
      "title": "Snapshot Version",
      "type": "integer"
    },
    "solver_engine": {
      "default": "prom-rs/0.12.0",
      "title": "Solver Engine",
      "type": "string"
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "When a worker claimed the sweep and solving began. Null until then. started_at - dispatched_at is the wait for a slot; completed_at - started_at is the solve itself.",
      "title": "Started At"
    },
    "status": {
      "enum": [
        "draft",
        "queued",
        "running",
        "completed",
        "failed",
        "canceled"
      ],
      "title": "Status",
      "type": "string"
    },
    "summary": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Summary"
    },
    "sweep_config": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sweep Config"
    },
    "total_points": {
      "title": "Total Points",
      "type": "integer"
    }
  },
  "required": [
    "id",
    "object",
    "status",
    "progress",
    "project_id",
    "inputs",
    "sweep_config",
    "total_points",
    "completed_points",
    "summary",
    "error",
    "name",
    "is_starred",
    "analysis_type",
    "credits_cost",
    "battery_component_id",
    "rotor_groups",
    "plot_config_json"
  ],
  "type": "object",
  "$defs": {
    "RotorGroupResource": {
      "additionalProperties": false,
      "description": "Reused by SimulationResource and SweepResource.",
      "properties": {
        "coax_position_m": {
          "default": 0.0,
          "title": "Coax Position M",
          "type": "number"
        },
        "coax_stack_id": {
          "default": 0,
          "title": "Coax Stack Id",
          "type": "integer"
        },
        "count": {
          "title": "Count",
          "type": "integer"
        },
        "esc_motor_wire_resistance_mohm": {
          "title": "Esc Motor Wire Resistance Mohm",
          "type": "number"
        },
        "esc_pwm_frequency_khz": {
          "default": 24.0,
          "title": "Esc Pwm Frequency Khz",
          "type": "number"
        },
        "esc_resistance_mohm": {
          "title": "Esc Resistance Mohm",
          "type": "number"
        },
        "esc_sync_rectification": {
          "default": true,
          "title": "Esc Sync Rectification",
          "type": "boolean"
        },
        "esc_timing": {
          "default": "medium",
          "title": "Esc Timing",
          "type": "string"
        },
        "esc_type": {
          "title": "Esc Type",
          "type": "string"
        },
        "label": {
          "title": "Label",
          "type": "string"
        },
        "motor_component_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Motor Component Id"
        },
        "propeller_component_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Propeller Component Id"
        },
        "propeller_label": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "description": "The printed size a Fast-model rotor ran from: diameter_m, pitch_m, num_blades, family, chord_ratio, camber_pct, and optionally weight_g and max_rpm. Null on a Full-model rotor.",
          "title": "Propeller Label"
        },
        "rotation_sense": {
          "default": 1,
          "title": "Rotation Sense",
          "type": "integer"
        },
        "throttle_pct": {
          "title": "Throttle Pct",
          "type": "number"
        }
      },
      "required": [
        "label",
        "count",
        "motor_component_id",
        "throttle_pct",
        "esc_resistance_mohm",
        "esc_motor_wire_resistance_mohm",
        "esc_type"
      ],
      "title": "RotorGroupResource",
      "type": "object"
    },
    "SweepCreditsBreakdown": {
      "additionalProperties": false,
      "description": "How this sweep's credit cost was arrived at.\n\nA sweep bills one compute unit per evaluation point per physical rotor, so\n`points * rotors * cu_per_point_per_rotor` is today's price. `total` is what\nwas actually charged: a sweep submitted before the pricing change of\n2026-09-03 was billed under a sub-linear curve and reports that lower\nfigure, which is why the two can differ on an old run.",
      "properties": {
        "cu_per_point_per_rotor": {
          "description": "Compute units billed per point per rotor.",
          "title": "Cu Per Point Per Rotor",
          "type": "integer"
        },
        "points": {
          "description": "Evaluation points in the grid.",
          "title": "Points",
          "type": "integer"
        },
        "rotors": {
          "description": "Physical rotors the grid was solved for.",
          "title": "Rotors",
          "type": "integer"
        },
        "total": {
          "description": "Credits actually charged for this sweep.",
          "title": "Total",
          "type": "integer"
        }
      },
      "required": [
        "points",
        "rotors",
        "cu_per_point_per_rotor",
        "total"
      ],
      "title": "SweepCreditsBreakdown",
      "type": "object"
    },
    "SweepInputs": {
      "additionalProperties": false,
      "properties": {
        "airspeed_m_s": {
          "title": "Airspeed M S",
          "type": "number"
        },
        "battery_charge_pct": {
          "title": "Battery Charge Pct",
          "type": "number"
        },
        "density_kg_m3": {
          "title": "Density Kg M3",
          "type": "number"
        },
        "solver": {
          "title": "Solver",
          "type": "string"
        }
      },
      "required": [
        "density_kg_m3",
        "airspeed_m_s",
        "battery_charge_pct",
        "solver"
      ],
      "title": "SweepInputs",
      "type": "object"
    }
  }
}