{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trajectory/json-schema/trajectory-krun-jobs-response-schema.json",
  "title": "KrunJobsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trajectory-krun-api-openapi.yml#/components/schemas/KrunJobsResponse",
  "properties": {
    "jobs": {
      "items": {
        "$ref": "#/$defs/KrunJob"
      },
      "type": "array",
      "title": "Jobs"
    },
    "environment": {
      "type": "string",
      "enum": [
        "production",
        "staging"
      ],
      "title": "Environment"
    },
    "count": {
      "type": "integer",
      "title": "Count"
    },
    "cluster_profile": {
      "type": "string",
      "title": "Cluster Profile"
    },
    "cluster": {
      "type": "string",
      "title": "Cluster"
    },
    "namespace": {
      "type": "string",
      "title": "Namespace"
    },
    "timestamp": {
      "type": "string",
      "title": "Timestamp"
    }
  },
  "type": "object",
  "required": [
    "jobs",
    "environment",
    "count",
    "cluster_profile",
    "cluster",
    "namespace",
    "timestamp"
  ],
  "$defs": {
    "KrunJob": {
      "properties": {
        "job_name": {
          "type": "string",
          "title": "Job Name"
        },
        "namespace": {
          "type": "string",
          "title": "Namespace"
        },
        "xid": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Xid"
        },
        "experiment": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Experiment"
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "pending",
            "succeeded",
            "failed",
            "unknown"
          ],
          "title": "Status"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reason"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Started At"
        },
        "age_seconds": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Age Seconds"
        },
        "active": {
          "type": "integer",
          "title": "Active"
        },
        "succeeded": {
          "type": "integer",
          "title": "Succeeded"
        },
        "failed": {
          "type": "integer",
          "title": "Failed"
        },
        "pod_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pod Name"
        },
        "pod_phase": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pod Phase"
        },
        "node_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Node Name"
        },
        "user": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "User"
        },
        "experiment_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Experiment Name"
        },
        "git_sha": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Git Sha"
        },
        "wandb_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Wandb Url"
        },
        "aim_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Aim Url"
        },
        "tempo_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tempo Url"
        },
        "pyroscope_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pyroscope Url"
        },
        "logging_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Logging Url"
        },
        "firestore_status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Firestore Status"
        },
        "firestore_created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Firestore Created At"
        },
        "job_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Job Type"
        },
        "training_backend_mode": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Training Backend Mode"
        },
        "cost_status": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "pending",
                "succeeded",
                "failed"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Cost Status"
        },
        "cost_total_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cost Total Usd"
        },
        "cost_breakdown": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cost Breakdown"
        }
      },
      "type": "object",
      "required": [
        "job_name",
        "namespace",
        "xid",
        "experiment",
        "status",
        "reason",
        "created_at",
        "started_at",
        "age_seconds",
        "active",
        "succeeded",
        "failed",
        "pod_name",
        "pod_phase",
        "node_name",
        "user"
      ],
      "title": "KrunJob",
      "description": "A live xm-runner Kubernetes Job, enriched with its experiment row when one is visible."
    }
  }
}