{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/why-explanations.schema.json",
  "title": "Why Explanations",
  "type": "object",
  "required": ["description", "objective", "why_explanations"],
  "properties": {
    "description": { "type": "string", "minLength": 1 },
    "objective": { "type": "string", "minLength": 1 },
    "why_explanations": {
      "type": "object",
      "required": ["objective", "why", "requiredSurfaces", "qualityRules", "antiPatterns", "qaCoverage", "stressTests", "passCriteria", "warningCriteria", "failCriteria", "objectiveAlignment"],
      "properties": {
        "objective": { "type": "string", "minLength": 1 },
        "why": { "type": "string", "minLength": 1 },
        "requiredSurfaces": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "object", "required": ["id", "surface", "requiredFields", "why"] }
        },
        "qualityRules": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
        "antiPatterns": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
        "qaCoverage": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "object", "required": ["check", "command", "coverage"] }
        },
        "stressTests": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
        "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 }
      }
    }
  }
}
