{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/mmerterden/multi-agent-pipeline/pipeline/schemas/bug-bash-verification.schema.json",
  "version": "1.0.0",
  "title": "Multi-Agent Pipeline  -  bug bash verifications",
  "description": "One entry per merged candidate, written by the verifying subagents of /multi-agent:bug-bash. bug-bash.mjs report confirms a candidate only when its repro test failed with ASSERTION_FAILED on the assertion that encodes it (failedAt equals assertion); any other outcome is listed as rejected with the reason.",
  "type": "array",
  "items": {
    "type": "object",
    "required": ["id", "status"],
    "properties": {
      "id": { "type": "string", "pattern": "^BB-[0-9]+$" },
      "status": { "enum": ["confirmed", "rejected"] },
      "reason": {
        "enum": ["artifact", "environment", "design", "fixture", "did-not-reproduce", "duplicate"],
        "description": "Required when rejected. artifact: the explorer misread the screen; environment: a key, service or limit only the local stack lacks; design: the code, tests or copy say it is intended; fixture: the seed data lacks what real records have."
      },
      "note": { "type": "string" },
      "productionRisk": {
        "type": "boolean",
        "description": "An environment rejection whose failure handling production users would also see."
      },
      "rootCause": { "type": "string", "description": "file:line, when the source was read." },
      "repro": {
        "type": "object",
        "required": ["path", "command", "code", "assertion"],
        "properties": {
          "path": { "type": "string", "minLength": 1 },
          "command": { "type": "string", "minLength": 1 },
          "code": {
            "type": ["string", "null"],
            "description": "ASSERTION_FAILED, PASSED, or the failure code the run produced."
          },
          "assertion": { "type": "string", "minLength": 1 },
          "failedAt": { "type": ["string", "null"] },
          "trace": { "type": "string" }
        }
      }
    }
  }
}
