{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://patchgap.ai/feed.schema.json",
 "title": "Patch Gap feed",
 "type": "object",
 "required": [
  "schema_version",
  "generated_at",
  "last_checked",
  "agent_rules",
  "counts",
  "incidents",
  "products"
 ],
 "properties": {
  "schema_version": {
   "type": "string"
  },
  "generated_at": {
   "type": "string",
   "format": "date-time"
  },
  "last_checked": {
   "type": "string",
   "format": "date"
  },
  "agent_instructions": {
   "type": "string"
  },
  "agent_rules": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "counts": {
   "type": "object"
  },
  "incidents": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "url",
     "title",
     "status",
     "severity",
     "exploited_in_wild",
     "confidence",
     "updated_at",
     "summary",
     "affected",
     "fix_steps",
     "official_patch_links",
     "sources"
    ],
    "properties": {
     "status": {
      "enum": [
       "no-patch",
       "partial",
       "patched"
      ]
     },
     "severity": {
      "enum": [
       "critical",
       "high",
       "medium",
       "low",
       "unknown"
      ]
     },
     "exploited_in_wild": {
      "enum": [
       "yes",
       "no",
       "unknown"
      ]
     },
     "confidence": {
      "enum": [
       "confirmed",
       "unconfirmed"
      ]
     },
     "affected": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "product",
        "platform",
        "affected_versions",
        "fixed_version",
        "fixed_min",
        "fix_note",
        "check"
       ],
       "properties": {
        "platform": {
         "enum": [
          "windows",
          "macos",
          "linux",
          "router",
          "ios",
          "android"
         ]
        },
        "check": {
         "type": [
          "object",
          "null"
         ],
         "properties": {
          "menu_path": {
           "type": "string"
          },
          "command": {
           "type": [
            "string",
            "null"
           ]
          },
          "read_only": {
           "type": [
            "boolean",
            "null"
           ]
          }
         }
        }
       }
      }
     },
     "sources": {
      "type": "array",
      "minItems": 1,
      "items": {
       "type": "object",
       "required": [
        "url",
        "title",
        "date",
        "kind",
        "official"
       ]
      }
     }
    }
   }
  },
  "products": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "slug",
     "name",
     "platforms",
     "json_url",
     "check"
    ]
   }
  }
 }
}