{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/klisten-co-kr/json-schema/klisten-co-kr-scan-status-schema.json",
  "title": "ScanStatus",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/klisten-co-kr-openapi.json#/components/schemas/ScanStatus",
  "type": "object",
  "properties": {
    "scan_id": {
      "type": "string",
      "pattern": "^scan_[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
    },
    "service_id": {
      "type": "string",
      "pattern": "^svc_[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "dead_letter"
      ]
    },
    "attempts": {
      "type": "integer",
      "minimum": 0,
      "maximum": 3
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "observation": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^obs_[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
            },
            "completeness": {
              "type": "string",
              "enum": [
                "complete",
                "partial"
              ]
            },
            "risk_score": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100
                },
                {
                  "type": "null"
                }
              ]
            },
            "fingerprint": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^sha256:[a-f0-9]{64}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "observed_at": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
            },
            "expires_at": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
            },
            "coverage": {
              "type": "object",
              "properties": {
                "identity": {
                  "type": "string",
                  "enum": [
                    "complete",
                    "partial",
                    "not_checked"
                  ]
                },
                "metadata": {
                  "type": "string",
                  "enum": [
                    "complete",
                    "partial",
                    "not_checked"
                  ]
                },
                "tool_schema": {
                  "type": "string",
                  "enum": [
                    "complete",
                    "partial",
                    "not_checked"
                  ]
                },
                "availability": {
                  "type": "string",
                  "enum": [
                    "complete",
                    "partial",
                    "not_checked"
                  ]
                },
                "vulnerability": {
                  "type": "string",
                  "enum": [
                    "complete",
                    "partial",
                    "not_checked"
                  ]
                }
              },
              "required": [
                "identity",
                "metadata",
                "tool_schema",
                "availability",
                "vulnerability"
              ],
              "additionalProperties": false
            },
            "normalized_tools": {
              "maxItems": 200,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "input_schema": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "output_schema": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "annotations": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "description_hash": {
                    "type": "string",
                    "pattern": "^sha256:[a-f0-9]{64}$"
                  }
                },
                "required": [
                  "name",
                  "input_schema",
                  "annotations",
                  "description_hash"
                ],
                "additionalProperties": false
              }
            },
            "findings": {
              "maxItems": 200,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "rule_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "rule_version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "deterministic",
                      "heuristic"
                    ]
                  },
                  "severity": {
                    "type": "string",
                    "enum": [
                      "info",
                      "low",
                      "medium",
                      "high",
                      "critical"
                    ]
                  },
                  "code": {
                    "type": "string",
                    "pattern": "^[A-Z][A-Z0-9_]{0,99}$"
                  },
                  "tool_name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "evidence_pointer": {
                    "type": "string",
                    "maxLength": 1071,
                    "pattern": "^sha256:[a-f0-9]{64}#(?:\\/[^\\r\\n]*)?$"
                  },
                  "summary": {
                    "type": "string",
                    "maxLength": 300
                  }
                },
                "required": [
                  "rule_id",
                  "rule_version",
                  "kind",
                  "severity",
                  "code",
                  "tool_name",
                  "evidence_pointer",
                  "summary"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "id",
            "completeness",
            "risk_score",
            "fingerprint",
            "observed_at",
            "expires_at",
            "coverage",
            "findings"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "retryable": {
              "type": "boolean"
            }
          },
          "required": [
            "code",
            "retryable"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "request_id": {
      "type": "string",
      "pattern": "^req_[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
    }
  },
  "required": [
    "scan_id",
    "service_id",
    "status",
    "attempts",
    "created_at",
    "started_at",
    "completed_at",
    "observation",
    "error",
    "request_id"
  ],
  "additionalProperties": false
}