{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thrustlab-com/json-schema/thrustlab-com-dynamic-resource-schema.json",
  "title": "DynamicResource",
  "description": "The dynamic-simulation resource. ``result`` is populated only once the run\nis ``completed`` (the worker writes it); it stays ``None`` for\nqueued/running/failed/canceled (the SweepResource optional-result idiom).",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thrustlab-com-openapi.json#/components/schemas/DynamicResource",
  "additionalProperties": false,
  "properties": {
    "battery_topology": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Battery Topology"
    },
    "cancel_requested_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "When a cancel was requested for a RUNNING run. The status stays `running` until the worker stops at its next integration chunk boundary — at which point it keeps the results it has, refunds in full, and the run turns `canceled` with a partial `result`. Null when no cancel is pending, which includes every terminal run: the field reports a request in flight, not the history of one. A QUEUED run cancels immediately instead and never sets this.",
      "title": "Cancel Requested At"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "When the run was submitted.",
      "title": "Created At"
    },
    "credits_cost": {
      "title": "Credits Cost",
      "type": "integer"
    },
    "dispatched_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "When the run was handed to the worker queue. A dynamic run is dispatched at creation, so this always equals created_at — it is NOT the start of execution.",
      "title": "Dispatched At"
    },
    "display_labels": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Display Labels"
    },
    "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"
    },
    "is_starred": {
      "default": false,
      "title": "Is Starred",
      "type": "boolean"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name"
    },
    "object": {
      "const": "dynamic_simulation",
      "default": "dynamic_simulation",
      "title": "Object",
      "type": "string"
    },
    "progress": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "How far a running solve has got, refreshed at every integration chunk boundary: `fraction` (0-1, null when it cannot be estimated), `sim_time_s` reached, `sim_time_total_s` (null for a run to depletion, which has no fixed horizon — its fraction comes from the estimated duration and is capped at 0.99), `wall_s` of real time so far, and `updated_at`. Null before the first chunk completes.",
      "title": "Progress"
    },
    "project_id": {
      "title": "Project Id",
      "type": "string"
    },
    "result": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Result"
    },
    "snapshot_version": {
      "default": 2,
      "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 run and the solve began. Null until then. For a dynamic run this is the only field that shows how long it waited for a slot.",
      "title": "Started At"
    },
    "status": {
      "enum": [
        "queued",
        "running",
        "completed",
        "failed",
        "canceled"
      ],
      "title": "Status",
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "project_id",
    "credits_cost"
  ],
  "type": "object"
}