{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nittim-com/json-schema/nittim-com-job-status-schema.json",
  "title": "JobStatus",
  "description": "Shape varies by status: 'running' carries only id/status/created_at; 'error' adds an error string; a finished job adds verdict/scores/report/display/markdown.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nittim-com-openapi.json#/components/schemas/JobStatus",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "running",
        "error",
        "done"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "error": {
      "type": "string"
    },
    "verdict": {
      "type": "string",
      "enum": [
        "production_ready",
        "ready_with_conditions",
        "high_risk",
        "not_safe",
        "not_audited"
      ],
      "description": "The four rated verdicts, best to worst, plus `not_audited`: the AI step was paused for that run, so nothing was rated (scores are 0, `meta.aiDisabled` is true, deterministic findings are still listed). `not_audited` is not a rung on the ladder and is never a pass."
    },
    "executive_risk_score": {
      "type": "integer"
    },
    "report_url": {
      "type": "string",
      "format": "uri"
    },
    "report": {
      "type": [
        "object",
        "null"
      ],
      "description": "The finished AuditReport (present once status is \"done\"; full shape rendered at https://nittim.com/report/{id}). `report.meta.filesAudited` and, when this deployment recorded it, `report.meta.eligibleFilesSeen` say how much of the eligible tree this run actually read — the same pair the digest's coverage sentence and https://nittim.com/report/{id} both derive their percentage from (floor(filesAudited / eligibleFilesSeen, falling back to filesSeen when eligibleFilesSeen is absent) * 100). `report.meta.truncated` is true when that fell short of the whole eligible set."
    },
    "coverage": {
      "type": [
        "object",
        "null"
      ],
      "description": "The same filesAudited/eligibleFilesSeen pair `report.meta` carries, plus the ready-to-use percentage already computed off the same eligible-aware denominator (the identical arithmetic the `report` field above documents) — so a caller doesn't have to re-derive it from meta. Present alongside `report` once status is \"done\"; absent otherwise. `eligibleFilesSeen` is null on a report from before this deployment recorded it.",
      "properties": {
        "filesAudited": {
          "type": "integer"
        },
        "eligibleFilesSeen": {
          "type": [
            "integer",
            "null"
          ]
        },
        "pct": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Null only when the percentage is genuinely uncomputable (no files seen at all)."
        }
      }
    },
    "prev_report": {
      "type": [
        "object",
        "null"
      ],
      "description": "The baseline this report is compared against — same shape as `report`. Present when the request named an explicit prevReportId at audit time, or (only with `?baseline=auto`) the newest earlier same-repo audit in your history was found and you're entitled to read it. Null when there's no baseline to show. Diff it against `report` client-side, the same way https://nittim.com/report/{id} does."
    }
  }
}