{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://themwdesk.com/schemas/signals.schema.json",
  "title": "The MW Desk public signals feed",
  "description": "Public, permissioned records only. No worker profiles, private contacts, precise asset addresses, payment credentials, or confidential material.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "source_updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "enum": [
        "empty",
        "snapshot"
      ]
    },
    "note": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "category": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          }
        },
        "required": [
          "id",
          "date",
          "category",
          "title",
          "summary",
          "source",
          "url"
        ]
      }
    }
  },
  "required": [
    "schema_version",
    "generated_at",
    "source_updated_at",
    "status",
    "note",
    "items"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "status": {
            "const": "empty"
          }
        }
      },
      "then": {
        "properties": {
          "items": {
            "maxItems": 0
          }
        }
      }
    }
  ]
}
