{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://zkove.com/schema/v1.json",
  "title": "ZKOVE Machine Access Record",
  "type": "object",
  "required": ["domain", "name", "kind", "first_seen", "last_verified", "next_check_after", "refresh_tier", "confidence", "signals", "capabilities", "sources"],
  "additionalProperties": false,
  "$defs": {
    "status": {
      "type": "string",
      "enum": ["verified", "restricted", "blocked", "not_found", "unknown", "not_applicable"]
    },
    "signal": {
      "type": "object",
      "required": ["status"],
      "additionalProperties": true,
      "properties": {
        "status": {"$ref": "#/$defs/status"},
        "url": {"type": ["string", "null"], "format": "uri"},
        "docs_url": {"type": ["string", "null"], "format": "uri"},
        "endpoint": {"type": ["string", "null"]},
        "auth": {"type": ["string", "null"]},
        "version": {"type": ["string", "null"]},
        "note": {"type": ["string", "null"]}
      }
    },
    "source": {
      "type": "object",
      "required": ["url", "type", "checked_at", "supports"],
      "additionalProperties": false,
      "properties": {
        "url": {"type": "string", "format": "uri"},
        "type": {
          "type": "string",
          "enum": ["canonical_endpoint", "first_party_docs", "first_party_terms", "first_party_changelog", "official_registry", "first_party_page", "authoritative_standard"]
        },
        "checked_at": {"type": "string", "format": "date-time"},
        "supports": {"type": "array", "items": {"type": "string"}, "minItems": 1, "uniqueItems": true}
      }
    }
  },
  "properties": {
    "domain": {"type": "string", "minLength": 1},
    "name": {"type": "string", "minLength": 1},
    "kind": {
      "type": "string",
      "enum": ["service", "registry", "platform", "api", "agent", "infrastructure", "commerce", "knowledge", "other"]
    },
    "first_seen": {"type": "string", "format": "date-time"},
    "last_verified": {"type": "string", "format": "date-time"},
    "last_changed": {"type": ["string", "null"], "format": "date-time"},
    "next_check_after": {"type": "string", "format": "date"},
    "refresh_tier": {"type": "string", "enum": ["hot", "active", "stable", "dormant"]},
    "confidence": {"type": "string", "enum": ["high", "medium", "low"]},
    "signals": {
      "type": "object",
      "required": ["web", "robots_txt", "llms_txt", "api", "mcp", "a2a", "x402", "mpp", "automation_policy"],
      "additionalProperties": false,
      "properties": {
        "web": {"$ref": "#/$defs/signal"},
        "robots_txt": {"$ref": "#/$defs/signal"},
        "llms_txt": {"$ref": "#/$defs/signal"},
        "api": {"$ref": "#/$defs/signal"},
        "mcp": {"$ref": "#/$defs/signal"},
        "a2a": {"$ref": "#/$defs/signal"},
        "x402": {"$ref": "#/$defs/signal"},
        "mpp": {"$ref": "#/$defs/signal"},
        "automation_policy": {"$ref": "#/$defs/signal"}
      }
    },
    "auth_methods": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    "capabilities": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    "sources": {"type": "array", "items": {"$ref": "#/$defs/source"}, "minItems": 1},
    "extensions": {"type": "object", "additionalProperties": true}
  }
}
