{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pulsefeed-dev/json-schema/pulsefeed-dev-drift-feed-schema.json",
  "title": "DriftFeed",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pulsefeed-dev-openapi.json#/components/schemas/DriftFeed",
  "type": "object",
  "properties": {
    "generated": {
      "type": "string",
      "format": "date-time"
    },
    "windowDays": {
      "type": "number"
    },
    "total": {
      "type": "integer",
      "minimum": 0
    },
    "counts": {
      "type": "object",
      "additionalProperties": {
        "type": "integer",
        "minimum": 0
      }
    },
    "bySeverity": {
      "type": "object",
      "additionalProperties": {
        "type": "integer",
        "minimum": 0
      }
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DriftEvent"
      }
    },
    "note": {
      "type": "string"
    },
    "retractions": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "byReason": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "minimum": 0
          }
        },
        "latestAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "note": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "idRecipe": {
      "type": "string"
    },
    "schema": {
      "type": "string"
    },
    "requested": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Packages included in a scoped feed request."
    },
    "notTracked": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Requested packages with no matching event in the window."
    },
    "coverage": {
      "type": "object",
      "properties": {
        "observed": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Requested packages with a non-retracted event in the window or a successful audit in the window with a prior profile and no later failed attempt. A first snapshot alone cannot establish change coverage."
        },
        "sourcesComplete": {
          "type": "boolean",
          "description": "Whether the service could read and interpret its observation sources for this request. Compare total with events.length separately to detect a truncated page."
        }
      },
      "required": [
        "observed",
        "sourcesComplete"
      ],
      "additionalProperties": true
    }
  },
  "required": [
    "generated",
    "windowDays",
    "total",
    "counts",
    "bySeverity",
    "events",
    "note",
    "retractions",
    "idRecipe",
    "schema"
  ],
  "additionalProperties": true,
  "$defs": {
    "DriftEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "at": {
          "type": "string",
          "format": "date-time"
        },
        "headline": {
          "type": "string"
        },
        "eventId": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "type",
        "kind",
        "severity",
        "at",
        "headline"
      ],
      "additionalProperties": true
    }
  }
}