{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "schemaVersion": 1,
  "artifact": "findings",
  "title": "Bug Hunter Findings Artifact",
  "type": "array",
  "items": {
    "type": "object",
    "required": [
      "bugId",
      "severity",
      "category",
      "file",
      "lines",
      "claim",
      "evidence",
      "runtimeTrigger",
      "crossReferences",
      "confidenceScore"
    ],
    "properties": {
      "bugId": { "type": "string", "minLength": 1 },
      "severity": {
        "type": "string",
        "enum": ["Critical", "High", "Medium", "Low"]
      },
      "category": {
        "type": "string",
        "enum": [
          "logic",
          "security",
          "error-handling",
          "concurrency",
          "edge-case",
          "data-integrity",
          "type-safety",
          "resource-leak",
          "api-contract",
          "cross-file"
        ]
      },
      "file": { "type": "string", "minLength": 1 },
      "lines": { "type": "string", "minLength": 1 },
      "claim": { "type": "string", "minLength": 1 },
      "evidence": { "type": "string", "minLength": 1 },
      "runtimeTrigger": { "type": "string", "minLength": 1 },
      "crossReferences": {
        "type": "array",
        "items": { "type": "string", "minLength": 1 }
      },
      "confidenceScore": {
        "type": "number",
        "minimum": 0,
        "maximum": 100
      },
      "confidenceLabel": {
        "type": "string",
        "enum": ["high", "medium", "low"]
      },
      "stride": {
        "type": "string",
        "enum": [
          "Spoofing",
          "Tampering",
          "Repudiation",
          "InfoDisclosure",
          "DoS",
          "ElevationOfPrivilege",
          "N/A"
        ]
      },
      "cwe": { "type": "string", "minLength": 1 }
    },
    "additionalProperties": false
  }
}
