{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/whoisgeni-us/json-schema/whoisgeni-us-api-response-job-status-response-schema.json",
  "title": "ApiResponse[JobStatusResponse]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/whoisgeni-us-jobs-api-openapi.yml#/components/schemas/ApiResponse_JobStatusResponse_",
  "properties": {
    "data": {
      "anyOf": [
        {
          "$ref": "#/$defs/JobStatusResponse"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/ErrorDetail"
        },
        {
          "type": "null"
        }
      ]
    },
    "meta": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Meta"
    }
  },
  "type": "object",
  "$defs": {
    "ErrorDetail": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code"
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "details": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Details"
        }
      },
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "title": "ErrorDetail",
      "description": "Structured error information for API error responses.\n\nAttributes:\n    code: Machine-readable error code (e.g. \"JOB_NOT_FOUND\").\n    message: Human-readable error description.\n    details: Optional additional context for debugging."
    },
    "JobStatusResponse": {
      "properties": {
        "job_id": {
          "type": "string",
          "title": "Job Id"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "processing",
            "completed",
            "failed",
            "partial"
          ],
          "title": "Status"
        },
        "domain": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Domain"
        },
        "phase": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Phase"
        },
        "collectors_done": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Collectors Done"
        },
        "collectors_total": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Collectors Total"
        },
        "analysis_run_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Analysis Run Id"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Started At"
        },
        "completed_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Completed At"
        },
        "scoring_result": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scoring Result"
        }
      },
      "type": "object",
      "required": [
        "job_id",
        "status"
      ],
      "title": "JobStatusResponse",
      "description": "Response for polling a job's current status.\n\nWhen the job is completed, ``scoring_result`` contains the full\nScoringResult dict from the scoring engine.\n\nWhen LLM enrichment is enabled and the ambiguity gate triggers,\nthe scoring_result dict includes additional fields:\nenriched_conclusion, entity_resolution_notes, arbitration_reasoning.\nThese fields are null/absent when LLM was not invoked.\n\nAttributes:\n    job_id: Unique job identifier.\n    status: Current job status (pending, processing, completed, failed).\n    domain: Domain being analyzed.\n    collectors_done: Number of collectors that have finished.\n    collectors_total: Total number of collectors in the pipeline.\n    analysis_run_id: Database analysis run ID.\n    started_at: ISO 8601 timestamp when the job started processing.\n    completed_at: ISO 8601 timestamp when the job finished.\n    scoring_result: Full scoring result dict when completed. May include\n        enriched_conclusion, entity_resolution_notes, and\n        arbitration_reasoning when LLM enrichment was invoked."
    }
  }
}