{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hud-ai/json-schema/hud-ai-qa-result-list-response-schema.json",
  "title": "QaResultListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hud-ai-qa-api-openapi.yml#/components/schemas/QaResultListResponse",
  "properties": {
    "results": {
      "items": {
        "$ref": "#/$defs/QaResultResponse"
      },
      "type": "array",
      "title": "Results"
    }
  },
  "type": "object",
  "required": [
    "results"
  ],
  "$defs": {
    "JsonValue": {},
    "QaCheckFindingV1": {
      "properties": {
        "finding_type": {
          "type": "string",
          "title": "Finding Type"
        },
        "severity": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "error"
          ],
          "title": "Severity"
        },
        "summary": {
          "type": "string",
          "title": "Summary"
        },
        "confidence": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 1.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Confidence"
        },
        "evidence_refs": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Evidence Refs"
        },
        "recommended_action": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Recommended Action"
        },
        "metadata": {
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          },
          "type": "object",
          "title": "Metadata"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "finding_type",
        "severity",
        "summary"
      ],
      "title": "QaCheckFindingV1",
      "description": "One actionable issue a QA check identified."
    },
    "QaCheckResultV1": {
      "properties": {
        "schema_version": {
          "type": "string",
          "const": "qa_agent_result.v1",
          "title": "Schema Version"
        },
        "verdict": {
          "type": "string",
          "enum": [
            "passed",
            "failed",
            "unknown"
          ],
          "title": "Verdict"
        },
        "findings": {
          "items": {
            "$ref": "#/$defs/QaCheckFindingV1"
          },
          "type": "array",
          "title": "Findings"
        },
        "summary": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Summary"
        },
        "metadata": {
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          },
          "type": "object",
          "title": "Metadata"
        },
        "execution_error": {
          "anyOf": [
            {
              "$ref": "#/$defs/QaExecutionError"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "schema_version",
        "verdict",
        "findings"
      ],
      "title": "QaCheckResultV1",
      "description": "The result every QA check yields.\n\nA check fails on a confirmed problem and otherwise passes; ``unknown`` remains\nfor results recorded before ``execution_error``. A check whose input leaves\nnothing to judge passes and names that stage in ``execution_error``. A failure\na rerun may fix, such as input that did not load or an answer that did not\nparse, ends the run with an error instead of yielding a result."
    },
    "QaExecutionError": {
      "properties": {
        "stage": {
          "type": "string",
          "maxLength": 64,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9_]*$",
          "title": "Stage"
        },
        "reason": {
          "type": "string",
          "maxLength": 1000,
          "minLength": 1,
          "title": "Reason"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "stage",
        "reason"
      ],
      "title": "QaExecutionError",
      "description": "A step of a check that did not finish.\n\n``reason`` is shown to everyone who can read the result, so producers write it\nfrom code: no model output, raw analysis context, or credentials."
    },
    "QaResultResponse": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "check_key": {
          "type": "string",
          "title": "Check Key"
        },
        "subject_type": {
          "$ref": "#/$defs/QaSubjectType"
        },
        "subject_trace_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Subject Trace Id"
        },
        "subject_task_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Subject Task Id"
        },
        "subject_task_version_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Subject Task Version Id"
        },
        "source": {
          "$ref": "#/$defs/QaResultSource"
        },
        "status": {
          "$ref": "#/$defs/QaResultStatus"
        },
        "verdict": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "passed",
                "failed",
                "unknown"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Verdict"
        },
        "result": {
          "anyOf": [
            {
              "$ref": "#/$defs/QaCheckResultV1"
            },
            {
              "type": "null"
            }
          ]
        },
        "legacy_result": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Legacy Result"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Note"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Completed At"
        },
        "run_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Run Id"
        },
        "analysis_trace_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Analysis Trace Id"
        }
      },
      "type": "object",
      "required": [
        "id",
        "check_key",
        "subject_type",
        "source",
        "status",
        "created_at"
      ],
      "title": "QaResultResponse",
      "description": "One result of a check on a subject: a trace, or a version of a task."
    },
    "QaResultSource": {
      "type": "string",
      "enum": [
        "analysis",
        "skipped",
        "manual"
      ],
      "title": "QaResultSource",
      "description": "Where a result's verdict comes from."
    },
    "QaResultStatus": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "cancelling",
        "completed",
        "error",
        "cancelled"
      ],
      "title": "QaResultStatus"
    },
    "QaSubjectType": {
      "type": "string",
      "enum": [
        "trace",
        "task"
      ],
      "title": "QaSubjectType",
      "description": "What a check judges: a completed evaluation trace, or a task's current version."
    }
  }
}