{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "schemaVersion": 1,
  "artifact": "coverage",
  "title": "Bug Hunter Coverage Artifact",
  "type": "object",
  "required": ["schemaVersion", "iteration", "status", "files", "bugs", "fixes"],
  "properties": {
    "schemaVersion": {
      "type": "integer",
      "minimum": 1
    },
    "iteration": {
      "type": "integer",
      "minimum": 0
    },
    "status": {
      "type": "string",
      "enum": ["IN_PROGRESS", "COMPLETE"]
    },
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["path", "status"],
        "properties": {
          "path": { "type": "string", "minLength": 1 },
          "status": {
            "type": "string",
            "enum": ["pending", "in_progress", "done", "failed"]
          }
        },
        "additionalProperties": false
      }
    },
    "bugs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["bugId", "severity", "file", "claim"],
        "properties": {
          "bugId": { "type": "string", "minLength": 1 },
          "severity": {
            "type": "string",
            "enum": ["Critical", "High", "Medium", "Low"]
          },
          "file": { "type": "string", "minLength": 1 },
          "claim": { "type": "string", "minLength": 1 }
        },
        "additionalProperties": false
      }
    },
    "fixes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["bugId", "status"],
        "properties": {
          "bugId": { "type": "string", "minLength": 1 },
          "status": { "type": "string", "minLength": 1 }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
