{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/browser-visual-qa.schema.json",
  "title": "Browser Visual QA",
  "type": "object",
  "required": ["description", "objective", "browser_visual_qa"],
  "properties": {
    "description": { "type": "string", "minLength": 1 },
    "objective": { "type": "string", "minLength": 1 },
    "browser_visual_qa": {
      "type": "object",
      "required": [
        "objective",
        "why",
        "command",
        "reportPath",
        "screenshotDirectory",
        "viewports",
        "routes",
        "checks",
        "passCriteria",
        "warningCriteria",
        "failCriteria",
        "objectiveAlignment"
      ],
      "properties": {
        "objective": { "type": "string", "minLength": 1 },
        "why": { "type": "string", "minLength": 1 },
        "command": { "type": "string", "minLength": 1 },
        "reportPath": { "type": "string", "minLength": 1 },
        "screenshotDirectory": { "type": "string", "minLength": 1 },
        "viewports": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": ["id", "width", "height", "why"]
          }
        },
        "routes": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": ["path", "why"]
          }
        },
        "checks": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": ["id", "severity", "method", "passCriteria", "failCriteria"]
          }
        },
        "passCriteria": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "string", "minLength": 1 }
        },
        "warningCriteria": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "string", "minLength": 1 }
        },
        "failCriteria": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "string", "minLength": 1 }
        },
        "objectiveAlignment": { "type": "string", "minLength": 1 }
      }
    }
  }
}
