{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/compuute-se/json-schema/compuute-se-scan-response-schema.json",
  "title": "ScanResponse",
  "description": "POST /v1/scan response.\n\nStable schema. Agents may rely on field names. Top-level fields cover\nsummary + score + recommendation; `top_findings` is bounded to 10 for\npayload size — full findings list is a v2 enhancement.",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scan-compuute-se-openapi.json#/components/schemas/ScanResponse",
  "properties": {
    "repo_url": {
      "type": "string",
      "title": "Repo Url"
    },
    "scanned_at": {
      "type": "string",
      "title": "Scanned At",
      "description": "UTC timestamp when the scan started."
    },
    "scanner": {
      "$ref": "#/$defs/ScannerInfo"
    },
    "summary": {
      "$ref": "#/$defs/SeveritySummary"
    },
    "score": {
      "type": "integer",
      "maximum": 100.0,
      "minimum": 0.0,
      "title": "Score",
      "description": "0-100, higher safer."
    },
    "recommendation": {
      "type": "string",
      "title": "Recommendation"
    },
    "findings_count": {
      "type": "integer",
      "title": "Findings Count"
    },
    "top_findings": {
      "items": {
        "$ref": "#/$defs/FindingSummary"
      },
      "type": "array",
      "title": "Top Findings"
    },
    "l0_discovery": {
      "additionalProperties": true,
      "type": "object",
      "title": "L0 Discovery"
    },
    "performance": {
      "$ref": "#/$defs/Performance"
    },
    "_disclaimer": {
      "type": "string",
      "title": "Disclaimer",
      "description": "Mandatory disclaimer: compuute-scan is a static analyzer. Findings indicate vulnerable patterns are *present*; exploitability requires manual dataflow review."
    }
  },
  "type": "object",
  "required": [
    "repo_url",
    "scanned_at",
    "scanner",
    "summary",
    "score",
    "recommendation",
    "findings_count",
    "performance",
    "_disclaimer"
  ],
  "$defs": {
    "FindingSummary": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "severity": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Severity"
        },
        "file": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "File"
        },
        "line": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line"
        },
        "owasp": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Owasp"
        },
        "cwe": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cwe"
        }
      },
      "type": "object",
      "title": "FindingSummary"
    },
    "Performance": {
      "properties": {
        "clone_seconds": {
          "type": "number",
          "title": "Clone Seconds"
        },
        "scan_seconds": {
          "type": "number",
          "title": "Scan Seconds"
        },
        "repo_size_bytes": {
          "type": "integer",
          "title": "Repo Size Bytes"
        }
      },
      "type": "object",
      "required": [
        "clone_seconds",
        "scan_seconds",
        "repo_size_bytes"
      ],
      "title": "Performance"
    },
    "ScannerInfo": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "version": {
          "type": "string",
          "title": "Version"
        },
        "layers_covered": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Layers Covered"
        }
      },
      "type": "object",
      "required": [
        "name",
        "version"
      ],
      "title": "ScannerInfo"
    },
    "SeveritySummary": {
      "properties": {
        "critical": {
          "type": "integer",
          "title": "Critical",
          "default": 0
        },
        "high": {
          "type": "integer",
          "title": "High",
          "default": 0
        },
        "medium": {
          "type": "integer",
          "title": "Medium",
          "default": 0
        },
        "low": {
          "type": "integer",
          "title": "Low",
          "default": 0
        },
        "info": {
          "type": "integer",
          "title": "Info",
          "default": 0
        },
        "files_scanned": {
          "type": "integer",
          "title": "Files Scanned",
          "default": 0
        }
      },
      "type": "object",
      "title": "SeveritySummary"
    }
  }
}