{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/accessibility-contract.schema.json",
  "title": "Accessibility Contract",
  "type": "object",
  "required": ["description", "objective", "accessibility"],
  "properties": {
    "description": { "type": "string", "minLength": 1 },
    "objective": { "type": "string", "minLength": 1 },
    "accessibility": {
      "type": "object",
      "required": ["objective", "why", "target", "enforcement", "valueRules", "manualReviewChecklist", "antiPatterns", "qaGates", "passCriteria", "failCriteria", "objectiveAlignment"],
      "properties": {
        "objective": { "type": "string", "minLength": 1 },
        "why": { "type": "string", "minLength": 1 },
        "target": { "const": "WCAG 2.2 AA" },
        "enforcement": {
          "type": "object",
          "required": ["command", "method", "evidencePath", "automatedCoverageCaveat"],
          "properties": {
            "command": { "type": "string", "minLength": 1 },
            "method": { "type": "string", "minLength": 40 },
            "evidencePath": { "type": "string", "minLength": 1 },
            "automatedCoverageCaveat": { "type": "string", "minLength": 20 }
          }
        },
        "valueRules": {
          "type": "array",
          "minItems": 6,
          "items": {
            "type": "object",
            "required": ["id", "value", "wcag", "checkedBy"],
            "properties": {
              "id": { "type": "string", "minLength": 1 },
              "value": { "type": "string", "minLength": 10 },
              "wcag": { "type": "string", "minLength": 1 },
              "checkedBy": { "type": "string", "minLength": 10 }
            }
          }
        },
        "manualReviewChecklist": { "type": "array", "minItems": 3, "items": { "type": "string", "minLength": 10 } },
        "antiPatterns": {
          "type": "array",
          "minItems": 3,
          "items": {
            "type": "object",
            "required": ["id", "issue", "fix"],
            "properties": {
              "id": { "type": "string", "minLength": 1 },
              "issue": { "type": "string", "minLength": 10 },
              "fix": { "type": "string", "minLength": 10 }
            }
          }
        },
        "qaGates": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
        "passCriteria": { "type": "array", "minItems": 3, "items": { "type": "string", "minLength": 1 } },
        "failCriteria": { "type": "array", "minItems": 2, "items": { "type": "string", "minLength": 1 } },
        "objectiveAlignment": { "type": "string", "minLength": 1 }
      }
    }
  }
}
