{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://nerabotaetv.ru/contracts/api-v2/2.4.0/contract.schema.json",
  "title": "NE RABOTAET V RF API 2.4.0 shared definitions",
  "description": "Public API v2 pilot shared definitions. Runtime and cross-field requirements: semantics.md and profiles.json.",
  "definitions": {
    "Target": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "url",
        "query_redacted",
        "target_key",
        "hostname",
        "scheme",
        "port"
      ],
      "properties": {
        "url": {
          "type": "string",
          "maxLength": 2048,
          "format": "uri",
          "description": "Display URL: query removed. Never execute this representation."
        },
        "query_redacted": {
          "type": "boolean"
        },
        "target_key": {
          "type": "string",
          "maxLength": 64,
          "pattern": "^[0-9a-f]{64}$"
        },
        "hostname": {
          "type": "string",
          "maxLength": 253,
          "minLength": 1
        },
        "scheme": {
          "enum": [
            "http",
            "https"
          ]
        },
        "port": {
          "enum": [
            80,
            443
          ]
        }
      }
    },
    "ExecutionTarget": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "url",
        "target_key",
        "hostname",
        "scheme",
        "port"
      ],
      "properties": {
        "url": {
          "type": "string",
          "maxLength": 2048,
          "format": "uri",
          "description": "Full canonical URL including exact path/query. Secret-bearing; no logs, only assigned probe."
        },
        "target_key": {
          "type": "string",
          "maxLength": 64,
          "pattern": "^[0-9a-f]{64}$"
        },
        "hostname": {
          "type": "string",
          "maxLength": 253,
          "minLength": 1
        },
        "scheme": {
          "enum": [
            "http",
            "https"
          ]
        },
        "port": {
          "enum": [
            80,
            443
          ]
        }
      }
    },
    "Profile": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "revision",
        "method_version",
        "max_units_per_probe",
        "execution_timeout_ms",
        "check_deadline_seconds",
        "comparison_window_seconds",
        "lease_seconds",
        "ack_timeout_seconds",
        "delivery_grace_seconds",
        "max_redirects",
        "max_candidates_per_hop",
        "max_candidates_per_family",
        "max_parallel_connects",
        "connection_attempt_delay_ms",
        "max_connections",
        "max_http_requests",
        "max_dns_questions",
        "max_dns_wire_queries",
        "max_dns_answers_per_question",
        "max_cname_depth",
        "max_response_header_bytes",
        "max_decoded_body_bytes_per_response",
        "max_response_wire_bytes_total",
        "max_dns_wire_bytes_total",
        "max_result_bytes",
        "dns_timeout_ms",
        "connect_timeout_ms",
        "tls_timeout_ms",
        "http_timeout_ms",
        "diagnostic_address_limit",
        "target_policy",
        "dns_policy",
        "request_policy",
        "tls_policy",
        "protocols",
        "description"
      ],
      "properties": {
        "id": {
          "enum": [
            "web-basic-v1",
            "web-url-v1",
            "web-diagnostic-v1",
            "web-basic-ru-v1",
            "web-url-ru-v1",
            "web-diagnostic-ru-v1"
          ]
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "method_version": {
          "const": "go-web-2"
        },
        "max_units_per_probe": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4
        },
        "execution_timeout_ms": {
          "type": "integer",
          "minimum": 1,
          "maximum": 30000
        },
        "check_deadline_seconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 90
        },
        "comparison_window_seconds": {
          "enum": [
            60,
            90
          ]
        },
        "lease_seconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 40
        },
        "ack_timeout_seconds": {
          "const": 5
        },
        "delivery_grace_seconds": {
          "const": 5
        },
        "max_redirects": {
          "const": 3
        },
        "max_candidates_per_hop": {
          "const": 4
        },
        "max_candidates_per_family": {
          "const": 2
        },
        "max_parallel_connects": {
          "const": 2
        },
        "connection_attempt_delay_ms": {
          "const": 250
        },
        "max_connections": {
          "type": "integer",
          "minimum": 1,
          "maximum": 12
        },
        "max_http_requests": {
          "type": "integer",
          "minimum": 1,
          "maximum": 8
        },
        "max_dns_questions": {
          "type": "integer",
          "minimum": 1,
          "maximum": 12
        },
        "max_dns_wire_queries": {
          "type": "integer",
          "minimum": 1,
          "maximum": 24
        },
        "max_dns_answers_per_question": {
          "const": 32
        },
        "max_cname_depth": {
          "const": 8
        },
        "max_response_header_bytes": {
          "const": 16384
        },
        "max_decoded_body_bytes_per_response": {
          "const": 16384
        },
        "max_response_wire_bytes_total": {
          "type": "integer",
          "minimum": 1,
          "maximum": 262144
        },
        "max_dns_wire_bytes_total": {
          "const": 131072
        },
        "max_result_bytes": {
          "const": 262144
        },
        "dns_timeout_ms": {
          "const": 3000
        },
        "connect_timeout_ms": {
          "const": 3000
        },
        "tls_timeout_ms": {
          "const": 5000
        },
        "http_timeout_ms": {
          "const": 8000
        },
        "diagnostic_address_limit": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4
        },
        "target_policy": {
          "enum": [
            "public-root-http-https-v1",
            "private-url-http-https-v1"
          ]
        },
        "dns_policy": {
          "const": "probe-configured-recursive-v1"
        },
        "request_policy": {
          "const": "get-no-cookies-identity-v1"
        },
        "tls_policy": {
          "enum": [
            "verify-system-roots-no-ech-v1",
            "verify-system-and-ru-nuc-2022-no-ech-v1"
          ]
        },
        "protocols": {
          "type": "array",
          "items": {
            "enum": [
              "http/1.1",
              "h2"
            ]
          },
          "minItems": 2,
          "maxItems": 2,
          "uniqueItems": true
        },
        "description": {
          "type": "string",
          "maxLength": 1000
        }
      }
    },
    "ProfileRef": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "revision"
      ],
      "properties": {
        "id": {
          "enum": [
            "web-basic-v1",
            "web-url-v1",
            "web-diagnostic-v1",
            "web-basic-ru-v1",
            "web-url-ru-v1",
            "web-diagnostic-ru-v1"
          ]
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "ProfileList": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "profiles",
        "trust_profiles"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "profiles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Profile"
          },
          "minItems": 3,
          "maxItems": 6
        },
        "trust_profiles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TrustProfile"
          },
          "minItems": 0,
          "maxItems": 2
        }
      }
    },
    "Locations": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "preset"
          ],
          "properties": {
            "preset": {
              "const": "ru-core"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "probe_ids"
          ],
          "properties": {
            "probe_ids": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 128,
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9_-]+$"
              },
              "minItems": 1,
              "maxItems": 10,
              "uniqueItems": true
            }
          }
        }
      ]
    },
    "CheckIntent": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "target",
        "locations"
      ],
      "properties": {
        "target": {
          "type": "string",
          "maxLength": 2048,
          "minLength": 1,
          "description": "R-01: DNS name or absolute HTTP(S) URL. web-basic accepts root only; URL/diagnostic preserve exact path/query in private checks. No userinfo/fragments/nonstandard ports."
        },
        "profile": {
          "enum": [
            "web-basic-v1",
            "web-url-v1",
            "web-diagnostic-v1",
            "web-basic-ru-v1",
            "web-url-ru-v1",
            "web-diagnostic-ru-v1"
          ],
          "default": "web-basic-v1"
        },
        "locations": {
          "$ref": "#/definitions/Locations"
        },
        "freshness_max_age_seconds": {
          "type": "integer",
          "minimum": 0,
          "maximum": 900,
          "default": 300,
          "description": "0 disallows completed cache reuse; it can join still-running work. R-11/R-12."
        },
        "extended": {
          "type": "boolean",
          "default": false,
          "description": "Use bounded web-delivery-v1 on basic and URL profiles. Website results belong to the initiating session."
        }
      }
    },
    "CheckRequest": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "target",
            "locations",
            "max_units"
          ],
          "properties": {
            "target": {
              "type": "string",
              "maxLength": 2048,
              "minLength": 1,
              "description": "R-01: DNS name or absolute HTTP(S) URL. web-basic accepts root only; URL/diagnostic preserve exact path/query in private checks. No userinfo/fragments/nonstandard ports."
            },
            "profile": {
              "enum": [
                "web-basic-v1",
                "web-url-v1",
                "web-diagnostic-v1",
                "web-basic-ru-v1",
                "web-url-ru-v1",
                "web-diagnostic-ru-v1"
              ],
              "default": "web-basic-v1"
            },
            "locations": {
              "$ref": "#/definitions/Locations"
            },
            "freshness_max_age_seconds": {
              "type": "integer",
              "minimum": 0,
              "maximum": 900,
              "default": 300,
              "description": "0 disallows completed cache reuse; it can join still-running work. R-11/R-12."
            },
            "max_units": {
              "type": "integer",
              "minimum": 0,
              "maximum": 40,
              "description": "Hard cap in quota units, not currency."
            },
            "extended": {
              "type": "boolean",
              "default": false,
              "description": "Use bounded web-delivery-v1 on basic and URL profiles. Website results belong to the initiating session."
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "plan_id",
            "max_units"
          ],
          "properties": {
            "plan_id": {
              "type": "string",
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[a-zA-Z0-9_-]+$"
            },
            "max_units": {
              "type": "integer",
              "minimum": 0,
              "maximum": 40
            }
          }
        }
      ]
    },
    "Plan": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "plan_id",
        "expires_at",
        "target",
        "profile",
        "resolved_probe_ids",
        "maximum_units",
        "billing_mode",
        "cache_eligible",
        "freshness_max_age_seconds"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "plan_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "expires_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "target": {
          "$ref": "#/definitions/Target"
        },
        "profile": {
          "$ref": "#/definitions/ProfileRef"
        },
        "resolved_probe_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "minItems": 1,
          "maxItems": 10,
          "uniqueItems": true
        },
        "maximum_units": {
          "type": "integer",
          "minimum": 0,
          "maximum": 40
        },
        "billing_mode": {
          "const": "quota_only"
        },
        "cache_eligible": {
          "type": "boolean"
        },
        "freshness_max_age_seconds": {
          "type": "integer",
          "minimum": 0,
          "maximum": 900
        }
      }
    },
    "Phase": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "state",
        "duration_ms",
        "code"
      ],
      "properties": {
        "state": {
          "enum": [
            "ok",
            "error",
            "skipped",
            "cancelled",
            "unsupported"
          ]
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "code": {
          "anyOf": [
            {
              "enum": [
                "dns.timeout",
                "dns.nxdomain",
                "dns.servfail",
                "dns.refused",
                "dns.invalid_response",
                "dns.transport_error",
                "tcp.timeout",
                "tcp.refused",
                "tcp.reset",
                "tcp.unreachable",
                "tcp.io_error",
                "tls.timeout",
                "tls.reset",
                "tls.handshake_error",
                "tls.cert_expired",
                "tls.cert_not_yet_valid",
                "tls.cert_untrusted",
                "tls.cert_hostname",
                "http.timeout",
                "http.reset",
                "http.read_error",
                "http.protocol_error",
                "http.unsupported_encoding",
                "connect.race_lost",
                "measurement.cancelled",
                "probe.resource_exhausted",
                "ipv6.unsupported",
                "profile.unsupported"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "state": {
                "enum": [
                  "skipped",
                  "unsupported"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "duration_ms": {
                "type": "null"
              }
            }
          },
          "else": {
            "properties": {
              "duration_ms": {
                "type": "number",
                "minimum": 0
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "state": {
                "enum": [
                  "ok",
                  "skipped"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "code": {
                "type": "null"
              }
            }
          },
          "else": {
            "properties": {
              "code": {
                "type": "string",
                "maxLength": 80,
                "minLength": 1
              }
            }
          }
        }
      ]
    },
    "DNSAnswer": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "type",
        "value",
        "ttl_seconds"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 253,
          "minLength": 1
        },
        "type": {
          "enum": [
            "A",
            "AAAA",
            "CNAME"
          ]
        },
        "value": {
          "type": "string",
          "maxLength": 1024,
          "minLength": 1
        },
        "ttl_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "DNSQuery": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "query_id",
        "hop_index",
        "purpose",
        "resolver_id",
        "transport",
        "name",
        "qtype",
        "phase",
        "rcode",
        "observed_at",
        "answers",
        "answers_truncated"
      ],
      "properties": {
        "query_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "hop_index": {
          "type": "integer",
          "minimum": 0,
          "maximum": 3
        },
        "purpose": {
          "enum": [
            "primary",
            "control"
          ]
        },
        "resolver_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "transport": {
          "enum": [
            "udp",
            "tcp",
            "doh",
            "system"
          ]
        },
        "name": {
          "type": "string",
          "maxLength": 253,
          "minLength": 1
        },
        "qtype": {
          "enum": [
            "A",
            "AAAA"
          ]
        },
        "phase": {
          "$ref": "#/definitions/Phase"
        },
        "rcode": {
          "anyOf": [
            {
              "enum": [
                "NOERROR",
                "NXDOMAIN",
                "SERVFAIL",
                "REFUSED",
                "FORMERR",
                "NOTIMP",
                "OTHER"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "observed_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "answers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DNSAnswer"
          },
          "minItems": 0,
          "maxItems": 32
        },
        "answers_truncated": {
          "type": "boolean"
        }
      }
    },
    "Candidate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ip",
        "family",
        "source_query_ids",
        "disposition",
        "attempt_ids"
      ],
      "properties": {
        "ip": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 45,
              "format": "ipv4"
            },
            {
              "type": "string",
              "maxLength": 45,
              "format": "ipv6"
            }
          ]
        },
        "family": {
          "enum": [
            4,
            6
          ]
        },
        "source_query_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "minItems": 1,
          "maxItems": 4,
          "uniqueItems": true
        },
        "disposition": {
          "enum": [
            "attempted",
            "not_selected",
            "unsupported_family",
            "policy_denied",
            "budget_exhausted"
          ]
        },
        "attempt_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "minItems": 0,
          "maxItems": 12,
          "uniqueItems": true
        }
      }
    },
    "Hop": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "hop_index",
        "url",
        "query_redacted",
        "resolution_ids",
        "candidates",
        "selected_attempt_id"
      ],
      "properties": {
        "hop_index": {
          "type": "integer",
          "minimum": 0,
          "maximum": 3
        },
        "url": {
          "type": "string",
          "maxLength": 2048,
          "format": "uri"
        },
        "query_redacted": {
          "type": "boolean"
        },
        "resolution_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "minItems": 1,
          "maxItems": 4,
          "uniqueItems": true
        },
        "candidates": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Candidate"
          },
          "minItems": 0,
          "maxItems": 64
        },
        "selected_attempt_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[a-zA-Z0-9_-]+$"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "TLS": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "phase",
        "version",
        "alpn",
        "verification",
        "cert_sha256",
        "cert_not_after"
      ],
      "properties": {
        "phase": {
          "$ref": "#/definitions/Phase"
        },
        "version": {
          "anyOf": [
            {
              "enum": [
                "TLSv1.2",
                "TLSv1.3"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "alpn": {
          "anyOf": [
            {
              "enum": [
                "http/1.1",
                "h2"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "verification": {
          "anyOf": [
            {
              "enum": [
                "valid",
                "invalid"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "cert_sha256": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[0-9a-f]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "cert_not_after": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40,
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "HTTP": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "phase",
        "status_code",
        "protocol",
        "ttfb_ms",
        "content_encoding",
        "body_bytes_read",
        "body_state",
        "body_sha256",
        "redirect_to",
        "redirect_query_redacted",
        "challenge_signal"
      ],
      "properties": {
        "phase": {
          "$ref": "#/definitions/Phase"
        },
        "status_code": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 200,
              "maximum": 599
            },
            {
              "type": "null"
            }
          ]
        },
        "protocol": {
          "anyOf": [
            {
              "enum": [
                "http/1.1",
                "h2"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "ttfb_ms": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "content_encoding": {
          "anyOf": [
            {
              "enum": [
                "identity",
                "gzip",
                "unsupported"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "body_bytes_read": {
          "type": "integer",
          "minimum": 0,
          "maximum": 16384
        },
        "body_state": {
          "enum": [
            "complete",
            "prefix_only",
            "error",
            "not_read"
          ]
        },
        "body_sha256": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[0-9a-f]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "redirect_to": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048,
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "redirect_query_redacted": {
          "type": "boolean"
        },
        "challenge_signal": {
          "anyOf": [
            {
              "enum": [
                "cf-mitigated-challenge"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "Attempt": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "attempt_id",
        "hop_index",
        "role",
        "ip",
        "family",
        "port",
        "host",
        "sni",
        "start_offset_ms",
        "duration_ms",
        "tcp",
        "tls",
        "http"
      ],
      "properties": {
        "attempt_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "hop_index": {
          "type": "integer",
          "minimum": 0,
          "maximum": 3
        },
        "role": {
          "enum": [
            "primary",
            "diagnostic"
          ]
        },
        "ip": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 45,
              "format": "ipv4"
            },
            {
              "type": "string",
              "maxLength": 45,
              "format": "ipv6"
            }
          ]
        },
        "family": {
          "enum": [
            4,
            6
          ]
        },
        "port": {
          "enum": [
            80,
            443
          ]
        },
        "host": {
          "type": "string",
          "maxLength": 253,
          "minLength": 1
        },
        "sni": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 253,
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "start_offset_ms": {
          "type": "number",
          "minimum": 0
        },
        "duration_ms": {
          "type": "number",
          "minimum": 0
        },
        "tcp": {
          "$ref": "#/definitions/Phase"
        },
        "tls": {
          "$ref": "#/definitions/TLS"
        },
        "http": {
          "$ref": "#/definitions/HTTP"
        }
      }
    },
    "WorkUsed": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "elapsed_ms",
        "connects",
        "dns_wire_queries",
        "http_requests",
        "response_wire_bytes",
        "dns_wire_bytes",
        "limits_hit"
      ],
      "properties": {
        "elapsed_ms": {
          "type": "number",
          "minimum": 0
        },
        "connects": {
          "type": "integer",
          "minimum": 0,
          "maximum": 12
        },
        "dns_wire_queries": {
          "type": "integer",
          "minimum": 0,
          "maximum": 24
        },
        "http_requests": {
          "type": "integer",
          "minimum": 0,
          "maximum": 8
        },
        "response_wire_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 262144
        },
        "dns_wire_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 131072
        },
        "limits_hit": {
          "type": "array",
          "items": {
            "enum": [
              "budget.execution",
              "budget.connections",
              "budget.http_requests",
              "budget.dns_questions",
              "budget.dns_wire_queries",
              "budget.response_bytes",
              "budget.header_bytes",
              "budget.dns_bytes",
              "budget.result_bytes",
              "diagnostic.deadline"
            ]
          },
          "minItems": 0,
          "maxItems": 16,
          "uniqueItems": true
        }
      }
    },
    "ObservationFacts": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "measurement_id",
        "agent_version",
        "method_version",
        "profile",
        "environment",
        "started_at",
        "completed_at",
        "clock_offset_ms",
        "local_health",
        "resolutions",
        "hops",
        "attempts",
        "work_used",
        "diagnostic_sample_ips",
        "diagnostic_complete",
        "journey_stop"
      ],
      "properties": {
        "measurement_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "agent_version": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1
        },
        "method_version": {
          "const": "go-web-2"
        },
        "profile": {
          "$ref": "#/definitions/ProfileRef"
        },
        "environment": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "runtime_version",
            "trust_store_sha256",
            "resolver_config_revision",
            "ipv4",
            "ipv6"
          ],
          "properties": {
            "runtime_version": {
              "type": "string",
              "maxLength": 80,
              "minLength": 1
            },
            "trust_store_sha256": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[0-9a-f]{64}$"
            },
            "resolver_config_revision": {
              "type": "string",
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[a-zA-Z0-9_-]+$"
            },
            "ipv4": {
              "type": "boolean"
            },
            "ipv6": {
              "type": "boolean"
            }
          }
        },
        "started_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "completed_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "clock_offset_ms": {
          "description": "Local wall clock minus reference UTC in milliseconds; null if unknown. Reference UTC = local timestamp - offset. Heartbeat server_time is not a clock-health source.",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "local_health": {
          "enum": [
            "healthy",
            "degraded",
            "unknown"
          ]
        },
        "resolutions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DNSQuery"
          },
          "minItems": 0,
          "maxItems": 12
        },
        "hops": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Hop"
          },
          "minItems": 1,
          "maxItems": 4
        },
        "attempts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Attempt"
          },
          "minItems": 0,
          "maxItems": 12
        },
        "work_used": {
          "$ref": "#/definitions/WorkUsed"
        },
        "diagnostic_sample_ips": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 45,
                "format": "ipv4"
              },
              {
                "type": "string",
                "maxLength": 45,
                "format": "ipv6"
              }
            ]
          },
          "minItems": 0,
          "maxItems": 4,
          "uniqueItems": true
        },
        "diagnostic_complete": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "journey_stop": {
          "enum": [
            "none",
            "network_error",
            "policy_stop",
            "budget_exhausted",
            "redirect_loop",
            "redirect_limit",
            "unsupported"
          ]
        }
      }
    },
    "ProbeSnapshot": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "label",
        "country_code",
        "city",
        "asn",
        "network_type",
        "metadata_verified_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "label": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1
        },
        "country_code": {
          "type": "string",
          "maxLength": 2,
          "pattern": "^[A-Z]{2}$"
        },
        "city": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ]
        },
        "asn": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 4294967295
            },
            {
              "type": "null"
            }
          ]
        },
        "network_type": {
          "enum": [
            "datacenter",
            "residential",
            "mobile",
            "unknown"
          ]
        },
        "metadata_verified_at": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40,
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "Probe": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "label",
        "country_code",
        "city",
        "asn",
        "network_type",
        "metadata_verified_at",
        "health",
        "last_seen_at",
        "ipv4",
        "ipv6",
        "profiles"
      ],
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "label": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1
        },
        "country_code": {
          "type": "string",
          "maxLength": 2,
          "pattern": "^[A-Z]{2}$"
        },
        "city": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ]
        },
        "asn": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 4294967295
            },
            {
              "type": "null"
            }
          ]
        },
        "network_type": {
          "enum": [
            "datacenter",
            "residential",
            "mobile",
            "unknown"
          ]
        },
        "metadata_verified_at": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40,
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "health": {
          "enum": [
            "ready",
            "degraded",
            "offline"
          ]
        },
        "last_seen_at": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40,
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "ipv4": {
          "type": "boolean"
        },
        "ipv6": {
          "type": "boolean"
        },
        "profiles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProfileRef"
          },
          "minItems": 0,
          "maxItems": 6
        }
      }
    },
    "ProbeList": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "probes",
        "next_cursor"
      ],
      "properties": {
        "probes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Probe"
          },
          "minItems": 0,
          "maxItems": 100
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 256
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "Finding": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "code",
        "basis",
        "evidence_refs"
      ],
      "properties": {
        "code": {
          "enum": [
            "ipv6_path_failed",
            "probe.ipv6_unsupported",
            "address_race_cancelled",
            "address_tls_failed",
            "address_http_error",
            "https_downgrade",
            "target.policy_denied",
            "dns.no_addresses",
            "dns.answers_truncated",
            "address.sample_limited"
          ]
        },
        "basis": {
          "enum": [
            "observed",
            "inferred"
          ]
        },
        "evidence_refs": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 1024,
            "pattern": "^/facts/"
          },
          "minItems": 1,
          "maxItems": 32,
          "uniqueItems": true
        }
      }
    },
    "Observation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "probe",
        "received_at",
        "quality",
        "invalid_reason",
        "outcome",
        "facts",
        "findings"
      ],
      "properties": {
        "probe": {
          "$ref": "#/definitions/ProbeSnapshot"
        },
        "received_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "quality": {
          "enum": [
            "valid",
            "invalid"
          ]
        },
        "invalid_reason": {
          "anyOf": [
            {
              "enum": [
                "clock.skew",
                "clock.unknown",
                "probe.unhealthy",
                "probe.resource_exhausted",
                "method.incompatible",
                "environment.unapproved"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "outcome": {
          "enum": [
            "success",
            "network_failure",
            "http_error",
            "access_limited",
            "inconclusive"
          ]
        },
        "facts": {
          "$ref": "#/definitions/PublicObservationFacts"
        },
        "findings": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Finding"
          },
          "minItems": 0,
          "maxItems": 32
        }
      }
    },
    "Coverage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "expected",
        "received",
        "usable",
        "missing_probe_ids",
        "excluded",
        "complete",
        "known_asn_count",
        "unknown_asn_probe_ids"
      ],
      "properties": {
        "expected": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        },
        "received": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10
        },
        "usable": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10
        },
        "missing_probe_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "minItems": 0,
          "maxItems": 10,
          "uniqueItems": true
        },
        "excluded": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "probe_id",
              "reason"
            ],
            "properties": {
              "probe_id": {
                "type": "string",
                "maxLength": 128,
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9_-]+$"
              },
              "reason": {
                "enum": [
                  "invalid",
                  "inconclusive",
                  "stale",
                  "incompatible"
                ]
              }
            }
          },
          "minItems": 0,
          "maxItems": 10
        },
        "complete": {
          "type": "boolean"
        },
        "known_asn_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10
        },
        "unknown_asn_probe_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "minItems": 0,
          "maxItems": 10,
          "uniqueItems": true
        }
      }
    },
    "Freshness": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "state",
        "max_age_seconds",
        "oldest_observed_at",
        "newest_observed_at"
      ],
      "properties": {
        "state": {
          "enum": [
            "fresh",
            "mixed",
            "stale",
            "unknown"
          ]
        },
        "max_age_seconds": {
          "type": "integer",
          "minimum": 0,
          "maximum": 900
        },
        "oldest_observed_at": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40,
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "newest_observed_at": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40,
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "Summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "last_observed_status",
        "reason_code",
        "title",
        "detail",
        "scope"
      ],
      "properties": {
        "status": {
          "enum": [
            "available",
            "degraded",
            "unavailable",
            "site_error",
            "restricted",
            "insufficient_data"
          ]
        },
        "last_observed_status": {
          "enum": [
            "available",
            "degraded",
            "unavailable",
            "site_error",
            "restricted",
            "insufficient_data"
          ]
        },
        "reason_code": {
          "enum": [
            "all_succeeded",
            "mixed_outcomes",
            "all_network_failed",
            "all_http_error",
            "all_access_limited",
            "no_usable_observations"
          ]
        },
        "title": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        "detail": {
          "type": "string",
          "maxLength": 1000,
          "minLength": 1
        },
        "scope": {
          "const": "selected_probes"
        },
        "observed_stop": {
          "type": "string",
          "enum": [
            "redirect_loop",
            "redirect_limit",
            "policy_stop",
            "budget_exhausted",
            "unsupported"
          ],
          "description": "Common diagnostic stop of all received valid inconclusive observations in a comparable window. Does not assert availability. Optional for legacy records."
        }
      }
    },
    "Report": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "report_id",
        "visibility",
        "detail_level",
        "target",
        "profile",
        "method_version",
        "ruleset_version",
        "expected_probe_ids",
        "evaluated_at",
        "window",
        "freshness",
        "coverage",
        "summary",
        "links",
        "diagnostics",
        "trust_comparison"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "report_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "visibility": {
          "enum": [
            "public",
            "private"
          ]
        },
        "detail_level": {
          "enum": [
            "summary",
            "full"
          ]
        },
        "target": {
          "$ref": "#/definitions/Target"
        },
        "profile": {
          "$ref": "#/definitions/ProfileRef"
        },
        "method_version": {
          "const": "go-web-2"
        },
        "ruleset_version": {
          "const": "availability-1"
        },
        "expected_probe_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "minItems": 1,
          "maxItems": 10,
          "uniqueItems": true
        },
        "evaluated_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "window": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "first_started_at",
            "last_finished_at",
            "max_span_seconds"
          ],
          "properties": {
            "first_started_at": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 40,
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "last_finished_at": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 40,
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "max_span_seconds": {
              "enum": [
                60,
                90
              ]
            }
          }
        },
        "freshness": {
          "$ref": "#/definitions/Freshness"
        },
        "coverage": {
          "$ref": "#/definitions/Coverage"
        },
        "summary": {
          "$ref": "#/definitions/Summary"
        },
        "observations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Observation"
          },
          "minItems": 0,
          "maxItems": 10
        },
        "links": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "self",
            "details"
          ],
          "properties": {
            "self": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri-reference"
            },
            "details": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri-reference"
            }
          }
        },
        "diagnostics": {
          "$ref": "#/definitions/Diagnostics"
        },
        "trust_comparison": {
          "anyOf": [
            {
              "$ref": "#/definitions/TrustComparison"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "detail_level": {
                "const": "full"
              }
            }
          },
          "then": {
            "required": [
              "observations"
            ]
          },
          "else": {
            "not": {
              "required": [
                "observations"
              ]
            }
          }
        }
      ]
    },
    "Usage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "billing_mode",
        "source",
        "reserved_units",
        "pending_units",
        "consumed_units",
        "released_units"
      ],
      "properties": {
        "billing_mode": {
          "const": "quota_only"
        },
        "source": {
          "enum": [
            "fresh",
            "shared",
            "cache"
          ]
        },
        "reserved_units": {
          "type": "integer",
          "minimum": 0,
          "maximum": 40
        },
        "pending_units": {
          "type": "integer",
          "minimum": 0,
          "maximum": 40
        },
        "consumed_units": {
          "type": "integer",
          "minimum": 0,
          "maximum": 40
        },
        "released_units": {
          "type": "integer",
          "minimum": 0,
          "maximum": 40
        }
      }
    },
    "Check": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "check_id",
        "state",
        "created_at",
        "deadline_at",
        "finished_at",
        "failure_code",
        "target",
        "profile",
        "resolved_probe_ids",
        "usage",
        "result",
        "links"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "check_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "state": {
          "enum": [
            "queued",
            "running",
            "completed",
            "expired",
            "failed"
          ]
        },
        "created_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "deadline_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "finished_at": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40,
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "failure_code": {
          "anyOf": [
            {
              "enum": [
                "platform.internal",
                "platform.storage_unavailable",
                "platform.scheduler_unavailable"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "target": {
          "$ref": "#/definitions/Target"
        },
        "profile": {
          "$ref": "#/definitions/ProfileRef"
        },
        "resolved_probe_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "minItems": 1,
          "maxItems": 10,
          "uniqueItems": true
        },
        "usage": {
          "$ref": "#/definitions/Usage"
        },
        "result": {
          "$ref": "#/definitions/Report"
        },
        "links": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "self",
            "result"
          ],
          "properties": {
            "self": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri-reference"
            },
            "result": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri-reference"
            }
          }
        }
      }
    },
    "Problem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "title",
        "status",
        "detail",
        "instance",
        "code",
        "request_id",
        "retryable",
        "retry_after_seconds"
      ],
      "properties": {
        "type": {
          "type": "string",
          "maxLength": 2048,
          "format": "uri"
        },
        "title": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        "status": {
          "type": "integer",
          "minimum": 400,
          "maximum": 599
        },
        "detail": {
          "type": "string",
          "maxLength": 1000
        },
        "instance": {
          "type": "string",
          "maxLength": 2048,
          "format": "uri-reference"
        },
        "code": {
          "enum": [
            "invalid_json",
            "unauthenticated",
            "forbidden",
            "not_found",
            "idempotency_conflict",
            "plan_expired",
            "plan_stale",
            "plan_consumed",
            "result_conflict",
            "stale_lease",
            "lease_expired",
            "details_expired",
            "payload_too_large",
            "invalid_target",
            "scheme_required",
            "unsupported_profile",
            "incompatible_probe",
            "probe_unavailable",
            "budget_exceeded",
            "result_invalid",
            "quota_exceeded",
            "rate_limited",
            "platform_unavailable",
            "coverage_unavailable"
          ]
        },
        "request_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "retryable": {
          "type": "boolean"
        },
        "retry_after_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 86400
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "Capabilities": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "billing_mode",
        "presets",
        "limits",
        "links"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "billing_mode": {
          "const": "quota_only"
        },
        "presets": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "probe_ids",
              "selection_revision"
            ],
            "properties": {
              "id": {
                "const": "ru-core"
              },
              "probe_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 128,
                  "minLength": 1,
                  "pattern": "^[a-zA-Z0-9_-]+$"
                },
                "minItems": 1,
                "maxItems": 10,
                "uniqueItems": true
              },
              "selection_revision": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "minItems": 0,
          "maxItems": 1
        },
        "limits": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "max_probes_per_check",
            "max_concurrent_checks",
            "daily_units",
            "create_requests_per_minute",
            "read_requests_per_minute"
          ],
          "properties": {
            "max_probes_per_check": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10
            },
            "max_concurrent_checks": {
              "type": "integer",
              "minimum": 1
            },
            "daily_units": {
              "type": "integer",
              "minimum": 0
            },
            "create_requests_per_minute": {
              "type": "integer",
              "minimum": 1
            },
            "read_requests_per_minute": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "links": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "profiles",
            "probes",
            "openapi"
          ],
          "properties": {
            "profiles": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri-reference"
            },
            "probes": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri-reference"
            },
            "openapi": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri-reference"
            }
          }
        }
      }
    },
    "AcquireRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "boot_id",
        "capacity",
        "wait_seconds"
      ],
      "properties": {
        "boot_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "capacity": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2
        },
        "wait_seconds": {
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        }
      }
    },
    "Lease": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "lease_id",
        "task_id",
        "generation",
        "probe_id",
        "issued_at",
        "ack_deadline_at",
        "execution_deadline_at",
        "expires_at",
        "check_deadline_at",
        "target",
        "profile"
      ],
      "properties": {
        "lease_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "task_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "generation": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2
        },
        "probe_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "issued_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "ack_deadline_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "execution_deadline_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "expires_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "check_deadline_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "target": {
          "$ref": "#/definitions/ExecutionTarget"
        },
        "profile": {
          "$ref": "#/definitions/Profile"
        }
      }
    },
    "AcquireResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "leases",
        "retry_after_seconds"
      ],
      "properties": {
        "leases": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Lease"
          },
          "minItems": 0,
          "maxItems": 2
        },
        "retry_after_seconds": {
          "type": "integer",
          "minimum": 0,
          "maximum": 60
        }
      }
    },
    "AckRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "generation",
        "boot_id"
      ],
      "properties": {
        "generation": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2
        },
        "boot_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        }
      }
    },
    "AckResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "lease_id",
        "generation"
      ],
      "properties": {
        "status": {
          "const": "acknowledged"
        },
        "lease_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "generation": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2
        }
      }
    },
    "AgentResult": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "generation",
        "observation"
      ],
      "properties": {
        "generation": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2
        },
        "observation": {
          "$ref": "#/definitions/ObservationFacts"
        }
      }
    },
    "ResultAck": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "measurement_id"
      ],
      "properties": {
        "status": {
          "enum": [
            "accepted",
            "duplicate",
            "late_ignored"
          ]
        },
        "measurement_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        }
      }
    },
    "HeartbeatRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "boot_id",
        "agent_version",
        "profiles",
        "ipv4",
        "ipv6",
        "local_health",
        "clock_offset_ms",
        "active_executions",
        "spool_results",
        "spool_bytes"
      ],
      "properties": {
        "boot_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "agent_version": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1
        },
        "profiles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProfileRef"
          },
          "minItems": 1,
          "maxItems": 6
        },
        "ipv4": {
          "type": "boolean"
        },
        "ipv6": {
          "type": "boolean"
        },
        "local_health": {
          "enum": [
            "healthy",
            "degraded",
            "unknown"
          ]
        },
        "clock_offset_ms": {
          "description": "Local wall clock minus reference UTC in milliseconds; null if unknown. Reference UTC = local timestamp - offset. Heartbeat server_time is not a clock-health source.",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "active_executions": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10,
          "description": "Active measurements on this probe, bounded at 10. Acquire capacity is a separate per-request batch limit of 2."
        },
        "spool_results": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "spool_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10485760
        }
      }
    },
    "HeartbeatResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "server_time",
        "next_heartbeat_seconds"
      ],
      "properties": {
        "server_time": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "next_heartbeat_seconds": {
          "const": 60
        }
      }
    },
    "PublicObservationFacts": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "measurement_id",
        "method_version",
        "profile",
        "environment",
        "started_at",
        "completed_at",
        "clock_offset_ms",
        "local_health",
        "resolutions",
        "hops",
        "attempts",
        "work_used",
        "diagnostic_sample_ips",
        "diagnostic_complete",
        "journey_stop"
      ],
      "properties": {
        "measurement_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "method_version": {
          "const": "go-web-2"
        },
        "profile": {
          "$ref": "#/definitions/ProfileRef"
        },
        "environment": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "ipv4",
            "ipv6"
          ],
          "properties": {
            "ipv4": {
              "type": "boolean"
            },
            "ipv6": {
              "type": "boolean"
            }
          }
        },
        "started_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "completed_at": {
          "type": "string",
          "maxLength": 40,
          "format": "date-time"
        },
        "clock_offset_ms": {
          "description": "Local wall clock minus reference UTC in milliseconds; null if unknown. Reference UTC = local timestamp - offset. Heartbeat server_time is not a clock-health source.",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "local_health": {
          "enum": [
            "healthy",
            "degraded",
            "unknown"
          ]
        },
        "resolutions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DNSQuery"
          },
          "minItems": 0,
          "maxItems": 12
        },
        "hops": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Hop"
          },
          "minItems": 1,
          "maxItems": 4
        },
        "attempts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Attempt"
          },
          "minItems": 0,
          "maxItems": 12
        },
        "work_used": {
          "$ref": "#/definitions/WorkUsed"
        },
        "diagnostic_sample_ips": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 45,
                "format": "ipv4"
              },
              {
                "type": "string",
                "maxLength": 45,
                "format": "ipv6"
              }
            ]
          },
          "minItems": 0,
          "maxItems": 4,
          "uniqueItems": true
        },
        "diagnostic_complete": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "journey_stop": {
          "enum": [
            "none",
            "network_error",
            "policy_stop",
            "budget_exhausted",
            "redirect_loop",
            "redirect_limit",
            "unsupported"
          ]
        },
        "catalogue_delivery": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "root": {
              "$ref": "#/definitions/DeliveryStage"
            },
            "script": {
              "$ref": "#/definitions/DeliveryStage"
            },
            "file": {
              "$ref": "#/definitions/DeliveryStage"
            },
            "h3": {
              "$ref": "#/definitions/DeliveryStage"
            },
            "method": {
              "enum": [
                "catalogue-delivery-v1",
                "web-delivery-v1"
              ]
            },
            "summary": {
              "enum": [
                "root_restricted",
                "root_client_challenge",
                "root_access_limited",
                "root_unconfirmed",
                "partial_delivery",
                "unexpected_content",
                "delivery_unconfirmed",
                "delivery_slowed",
                "tcp_passed_h3_not_advertised",
                "tcp_passed_h3_partial",
                "tcp_passed_h3_content_differs",
                "selected_checks_passed",
                "tcp_passed_h3_unconfirmed"
              ]
            },
            "resource": {
              "enum": [
                "none",
                "response",
                "stylesheet",
                "script"
              ]
            }
          },
          "required": [
            "root",
            "script",
            "file",
            "h3",
            "method",
            "summary"
          ]
        }
      },
      "description": "Public measurement evidence. Operational agent/runtime versions, CA fingerprint and resolver configuration revision remain internal."
    },
    "RootSummary": {
      "allOf": [
        {
          "$ref": "#/definitions/Report"
        },
        {
          "properties": {
            "visibility": {
              "const": "public"
            },
            "detail_level": {
              "const": "summary"
            },
            "profile": {
              "properties": {
                "id": {
                  "const": "web-basic-v1"
                }
              }
            },
            "target": {
              "properties": {
                "query_redacted": {
                  "const": false
                },
                "scheme": {
                  "const": "https"
                },
                "port": {
                  "const": 443
                }
              }
            }
          }
        }
      ]
    },
    "CatalogueItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "domain",
        "name",
        "latest"
      ],
      "properties": {
        "domain": {
          "type": "string",
          "minLength": 3,
          "maxLength": 253,
          "pattern": "^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "latest": {
          "anyOf": [
            {
              "$ref": "#/definitions/RootSummary"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "CataloguePage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "items",
        "next_cursor"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CatalogueItem"
          },
          "maxItems": 100
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 3,
              "maxLength": 253,
              "pattern": "^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "CatalogueHistory": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "domain",
        "name",
        "history",
        "next_cursor"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "domain": {
          "type": "string",
          "minLength": 3,
          "maxLength": 253,
          "pattern": "^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "history": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RootSummary"
          },
          "maxItems": 50
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[a-zA-Z0-9_-]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "timeline": {
          "type": "array",
          "maxItems": 500,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "report_id",
              "probe_id",
              "label",
              "observed_at",
              "quality",
              "outcome"
            ],
            "properties": {
              "report_id": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9_-]{1,128}$",
                "maxLength": 128
              },
              "probe_id": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9_-]{1,128}$",
                "maxLength": 128
              },
              "label": {
                "type": "string",
                "maxLength": 120
              },
              "observed_at": {
                "type": "string",
                "format": "date-time"
              },
              "quality": {
                "enum": [
                  "valid",
                  "invalid"
                ]
              },
              "outcome": {
                "enum": [
                  "success",
                  "network_failure",
                  "http_error",
                  "access_limited",
                  "inconclusive"
                ]
              },
              "journey_stop": {
                "type": "string",
                "enum": [
                  "redirect_loop",
                  "redirect_limit",
                  "policy_stop",
                  "budget_exhausted",
                  "unsupported"
                ],
                "description": "Observed diagnostic stop for a valid inconclusive point, if retained. Absence does not imply a successful journey."
              }
            }
          }
        }
      }
    },
    "PublishRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {}
    },
    "PublicationPage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "items",
        "next_cursor"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Publication"
          },
          "maxItems": 20
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[a-zA-Z0-9_-]+$"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "AbuseRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "subject_type",
        "subject_id",
        "reason",
        "child_safety"
      ],
      "properties": {
        "subject_type": {
          "enum": [
            "publication",
            "catalogue"
          ]
        },
        "subject_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 253,
          "pattern": "^[a-zA-Z0-9_.-]+$"
        },
        "reason": {
          "enum": [
            "phishing",
            "malware",
            "suspected_illegal",
            "spam"
          ]
        },
        "child_safety": {
          "type": "boolean"
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "child_safety": {
                "const": true
              }
            }
          },
          "then": {
            "properties": {
              "reason": {
                "const": "suspected_illegal"
              }
            }
          }
        }
      ]
    },
    "AbuseReceipt": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "receipt_id",
        "state"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "receipt_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "state": {
          "const": "received"
        }
      }
    },
    "PublicationWithdrawal": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "publication_id",
        "state"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "publication_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "state": {
          "const": "withdrawn"
        }
      }
    },
    "ActivityPage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "items",
        "refresh_after_seconds"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "items": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "activity_id",
                  "created_at",
                  "visibility"
                ],
                "properties": {
                  "activity_id": {
                    "type": "string",
                    "pattern": "^a_[0-9a-f]{64}$"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "visibility": {
                    "const": "private"
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "activity_id",
                  "created_at",
                  "visibility",
                  "publication"
                ],
                "properties": {
                  "activity_id": {
                    "type": "string",
                    "pattern": "^a_[0-9a-f]{64}$"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "visibility": {
                    "const": "public"
                  },
                  "publication": {
                    "$ref": "#/definitions/Publication"
                  }
                }
              }
            ]
          }
        },
        "refresh_after_seconds": {
          "const": 10
        }
      }
    },
    "BrowserObservationRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "request_id",
        "domain",
        "outcome",
        "duration_ms",
        "consent"
      ],
      "properties": {
        "request_id": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9_-]{1,128}$",
          "maxLength": 128,
          "minLength": 16
        },
        "domain": {
          "type": "string",
          "minLength": 1,
          "maxLength": 253
        },
        "outcome": {
          "enum": [
            "response",
            "unconfirmed",
            "timeout"
          ]
        },
        "duration_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 60000
        },
        "consent": {
          "const": true
        }
      }
    },
    "BrowserObservationReceipt": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "received_at",
        "evidence",
        "accepted"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "received_at": {
          "type": "string",
          "format": "date-time"
        },
        "evidence": {
          "const": "unverified_browser"
        },
        "accepted": {
          "const": true
        }
      }
    },
    "BrowserObservationSummary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "domain",
        "evidence",
        "since",
        "until",
        "response",
        "unconfirmed",
        "timeout"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "domain": {
          "type": "string",
          "minLength": 1,
          "maxLength": 253
        },
        "evidence": {
          "const": "unverified_browser"
        },
        "since": {
          "type": "string",
          "format": "date-time"
        },
        "until": {
          "type": "string",
          "format": "date-time"
        },
        "response": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4000
        },
        "unconfirmed": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4000
        },
        "timeout": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4000
        }
      }
    },
    "CatalogueDay": {
      "description": "Complete operator catalogue checks completed in [window_start,window_end), exactly 24 hours. Window ends at the latest completed UTC minute and may be cached until the next minute. Includes every retained compact observation of each selected check; individual observations can precede window_start by the check duration. Empty intervals and missing/invalid points do not mean an outage. Historical results, not a current availability assertion. No truncation or user checks.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "items"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "items": {
          "type": "array",
          "minItems": 1,
          "maxItems": 10,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "domain",
              "window_start",
              "window_end",
              "reports"
            ],
            "properties": {
              "domain": {
                "type": "string",
                "minLength": 3,
                "maxLength": 253,
                "pattern": "^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$"
              },
              "window_start": {
                "type": "string",
                "format": "date-time"
              },
              "window_end": {
                "type": "string",
                "format": "date-time"
              },
              "reports": {
                "type": "array",
                "maxItems": 512,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "report_id",
                    "observed_at",
                    "expected",
                    "observations"
                  ],
                  "properties": {
                    "report_id": {
                      "type": "string",
                      "pattern": "^[a-zA-Z0-9_-]{1,128}$",
                      "maxLength": 128
                    },
                    "observed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "expected": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 10
                    },
                    "observations": {
                      "type": "array",
                      "maxItems": 10,
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "report_id",
                          "probe_id",
                          "label",
                          "observed_at",
                          "quality",
                          "outcome"
                        ],
                        "properties": {
                          "report_id": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9_-]{1,128}$",
                            "maxLength": 128
                          },
                          "probe_id": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9_-]{1,128}$",
                            "maxLength": 128
                          },
                          "label": {
                            "type": "string",
                            "maxLength": 120
                          },
                          "observed_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "quality": {
                            "enum": [
                              "valid",
                              "invalid"
                            ]
                          },
                          "outcome": {
                            "enum": [
                              "success",
                              "network_failure",
                              "http_error",
                              "access_limited",
                              "inconclusive"
                            ]
                          },
                          "journey_stop": {
                            "type": "string",
                            "enum": [
                              "redirect_loop",
                              "redirect_limit",
                              "policy_stop",
                              "budget_exhausted",
                              "unsupported"
                            ],
                            "description": "Observed diagnostic stop for a valid inconclusive point, if retained. Absence does not imply a successful journey."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "CatalogueRelevanceItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "domain",
        "event_kind",
        "event_started_at",
        "valid_until",
        "expected",
        "usable",
        "comparable",
        "affected",
        "baseline_coverage",
        "reason_codes"
      ],
      "properties": {
        "domain": {
          "type": "string",
          "maxLength": 253
        },
        "event_kind": {
          "enum": [
            "new_failure",
            "unstable",
            "recovery",
            "unconfirmed_change",
            "ongoing_failure",
            "stable",
            "insufficient_history",
            "no_data"
          ]
        },
        "event_started_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "valid_until": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "expected": {
          "type": "integer",
          "minimum": 0,
          "maximum": 200
        },
        "usable": {
          "type": "integer",
          "minimum": 0,
          "maximum": 200
        },
        "comparable": {
          "type": "integer",
          "minimum": 0,
          "maximum": 200
        },
        "affected": {
          "type": "integer",
          "minimum": 0,
          "maximum": 200
        },
        "baseline_coverage": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "reason_codes": {
          "type": "array",
          "minItems": 1,
          "maxItems": 8,
          "uniqueItems": true,
          "items": {
            "enum": [
              "new_failure",
              "unstable",
              "recovery",
              "unconfirmed_change",
              "ongoing_failure",
              "stable",
              "insufficient_history",
              "no_data",
              "no_fresh_observations"
            ]
          }
        }
      }
    },
    "CatalogueRelevance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "method_version",
        "snapshot_id",
        "ranked_at",
        "expires_at",
        "items"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "method_version": {
          "const": "catalogue-relevance-v1"
        },
        "snapshot_id": {
          "type": "string",
          "pattern": "^rel_[a-f0-9]{32}$"
        },
        "ranked_at": {
          "type": "string",
          "format": "date-time"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        },
        "items": {
          "type": "array",
          "maxItems": 200,
          "items": {
            "$ref": "#/definitions/CatalogueRelevanceItem"
          }
        }
      }
    },
    "CatalogueSeriesCounts": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "expected",
        "success",
        "network_failure",
        "http_error",
        "access_limited",
        "inconclusive",
        "invalid",
        "missing"
      ],
      "properties": {
        "expected": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000
        },
        "success": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000
        },
        "network_failure": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000
        },
        "http_error": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000
        },
        "access_limited": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000
        },
        "inconclusive": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000
        },
        "invalid": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000
        },
        "missing": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000
        }
      }
    },
    "CatalogueSeriesProbe": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "probe_id",
        "label",
        "counts",
        "covered_slots",
        "fractions"
      ],
      "properties": {
        "probe_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        },
        "counts": {
          "$ref": "#/definitions/CatalogueSeriesCounts"
        },
        "covered_slots": {
          "type": "integer",
          "minimum": 0,
          "maximum": 288
        },
        "fractions": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "success",
            "failure",
            "issues",
            "unknown"
          ],
          "properties": {
            "success": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "failure": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "issues": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "unknown": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          }
        }
      }
    },
    "CatalogueSeriesBin": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "start",
        "end",
        "checks",
        "covered_slots",
        "total_slots",
        "counts",
        "fractions",
        "probes"
      ],
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "end": {
          "type": "string",
          "format": "date-time"
        },
        "checks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000000
        },
        "covered_slots": {
          "type": "integer",
          "minimum": 0,
          "maximum": 288
        },
        "total_slots": {
          "type": "integer",
          "minimum": 1,
          "maximum": 288
        },
        "counts": {
          "$ref": "#/definitions/CatalogueSeriesCounts"
        },
        "fractions": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "success",
            "failure",
            "issues",
            "unknown"
          ],
          "properties": {
            "success": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "failure": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "issues": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "unknown": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          }
        },
        "probes": {
          "type": "array",
          "maxItems": 200,
          "items": {
            "$ref": "#/definitions/CatalogueSeriesProbe"
          }
        }
      },
      "description": "Counts add observations; fractions average normalized five-minute slots over elapsed time, including empty slots as unknown. Probe counts refer only to actual selected checks, not invented scheduled answers."
    },
    "CatalogueSeries": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "method_version",
        "domain",
        "period",
        "timezone",
        "window_start",
        "window_end",
        "prepared_at",
        "ready",
        "bins"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "method_version": {
          "const": "catalogue-series-v1"
        },
        "domain": {
          "type": "string",
          "minLength": 3,
          "maxLength": 253
        },
        "period": {
          "enum": [
            "7d",
            "30d"
          ]
        },
        "timezone": {
          "const": "Europe/Moscow"
        },
        "window_start": {
          "type": "string",
          "format": "date-time"
        },
        "window_end": {
          "type": "string",
          "format": "date-time"
        },
        "prepared_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "ready": {
          "type": "boolean"
        },
        "bins": {
          "type": "array",
          "minItems": 1,
          "maxItems": 168,
          "items": {
            "$ref": "#/definitions/CatalogueSeriesBin"
          }
        }
      },
      "description": "Prepared public catalogue history. 7 or 30 Moscow calendar dates including today; current date/hour is partial. Window ends at the most recent closed five-minute boundary. Missing time is never interpolated. ready=false means initial backfill or an index older than ten minutes. Does not launch probes."
    },
    "DiagnosticCause": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "code",
        "stage",
        "impact",
        "http_status",
        "probe_ids",
        "title",
        "detail"
      ],
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80,
          "pattern": "^[a-z][a-z0-9_.]+$"
        },
        "stage": {
          "enum": [
            "dns",
            "tcp",
            "tls",
            "http",
            "journey",
            "probe",
            "measurement"
          ]
        },
        "impact": {
          "enum": [
            "outcome",
            "attempt",
            "measurement"
          ]
        },
        "http_status": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 100,
              "maximum": 599
            },
            {
              "type": "null"
            }
          ]
        },
        "probe_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "minItems": 0,
          "maxItems": 10
        },
        "title": {
          "type": "string",
          "maxLength": 200
        },
        "detail": {
          "type": "string",
          "maxLength": 1000
        }
      }
    },
    "Diagnostics": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "version",
        "trust_profile",
        "state",
        "title",
        "detail",
        "causes"
      ],
      "properties": {
        "version": {
          "const": "availability-diagnostics-1"
        },
        "trust_profile": {
          "enum": [
            "standard",
            "standard-plus-ru-nuc-2022"
          ]
        },
        "state": {
          "enum": [
            "complete",
            "partial",
            "unavailable"
          ]
        },
        "title": {
          "type": "string",
          "maxLength": 200
        },
        "detail": {
          "type": "string",
          "maxLength": 2000
        },
        "causes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DiagnosticCause"
          },
          "minItems": 0,
          "maxItems": 64
        }
      }
    },
    "TrustProfile": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "label",
        "tls_policy",
        "additional_root_sha256",
        "additional_root_not_after",
        "system_store_modified"
      ],
      "properties": {
        "id": {
          "enum": [
            "standard",
            "standard-plus-ru-nuc-2022"
          ]
        },
        "label": {
          "type": "string",
          "maxLength": 200
        },
        "tls_policy": {
          "enum": [
            "verify-system-roots-no-ech-v1",
            "verify-system-and-ru-nuc-2022-no-ech-v1"
          ]
        },
        "additional_root_sha256": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ]
        },
        "additional_root_not_after": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "maxLength": 40
            },
            {
              "type": "null"
            }
          ]
        },
        "system_store_modified": {
          "const": false
        }
      }
    },
    "TrustComparison": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "report_id",
        "profile",
        "trust_profile",
        "summary",
        "expected_probe_ids",
        "coverage",
        "freshness",
        "diagnostics",
        "links"
      ],
      "properties": {
        "report_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "profile": {
          "$ref": "#/definitions/ProfileRef"
        },
        "trust_profile": {
          "enum": [
            "standard",
            "standard-plus-ru-nuc-2022"
          ]
        },
        "summary": {
          "$ref": "#/definitions/Summary"
        },
        "expected_probe_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "minItems": 1,
          "maxItems": 10,
          "uniqueItems": true
        },
        "coverage": {
          "$ref": "#/definitions/Coverage"
        },
        "freshness": {
          "$ref": "#/definitions/Freshness"
        },
        "diagnostics": {
          "$ref": "#/definitions/Diagnostics"
        },
        "links": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "self",
            "details"
          ],
          "properties": {
            "self": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri-reference"
            },
            "details": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri-reference"
            }
          }
        }
      }
    },
    "MaskedPublication": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "publication_version",
        "publication_id",
        "masked_name",
        "published_at",
        "observed_at",
        "status",
        "expected",
        "received",
        "usable"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "publication_version": {
          "const": 2
        },
        "publication_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "masked_name": {
          "type": "string",
          "maxLength": 253,
          "pattern": "^(\\*\\*\\*|[a-z0-9-]+\\*\\*\\*[a-z0-9-]+\\.[a-z0-9.-]+)$"
        },
        "published_at": {
          "type": "string",
          "format": "date-time",
          "maxLength": 40
        },
        "observed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "maxLength": 40
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "enum": [
            "available",
            "degraded",
            "unavailable",
            "site_error",
            "restricted",
            "insufficient_data"
          ]
        },
        "expected": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        },
        "received": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10
        },
        "usable": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10
        }
      },
      "description": "Masked publication v2: no target, hostname, URL, target key, observations or private report. status is historical at observed_at, never a safety or legality assessment. Owner reads the original private Report separately."
    },
    "DomainPublication": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "publication_version",
        "publication_id",
        "published_at",
        "observed_at",
        "status",
        "expected",
        "received",
        "usable",
        "domain",
        "profile",
        "trust_profile"
      ],
      "properties": {
        "schema_version": {
          "const": "2.4.0"
        },
        "publication_version": {
          "const": 3
        },
        "publication_id": {
          "type": "string",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "published_at": {
          "type": "string",
          "format": "date-time",
          "maxLength": 40
        },
        "observed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "maxLength": 40
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "enum": [
            "available",
            "degraded",
            "unavailable",
            "site_error",
            "restricted",
            "insufficient_data"
          ]
        },
        "expected": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        },
        "received": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10
        },
        "usable": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10
        },
        "domain": {
          "type": "string",
          "minLength": 3,
          "maxLength": 253,
          "pattern": "^[a-z0-9-]+(\\.[a-z0-9-]+)+$"
        },
        "profile": {
          "enum": [
            "web-basic-v1",
            "web-basic-ru-v1"
          ]
        },
        "trust_profile": {
          "enum": [
            "standard",
            "standard-plus-ru-nuc-2022"
          ]
        }
      },
      "description": "Masked publication v2: no target, hostname, URL, target key, observations or private report. status is historical at observed_at, never a safety or legality assessment. Owner reads the original private Report separately.",
      "allOf": [
        {
          "anyOf": [
            {
              "properties": {
                "profile": {
                  "const": "web-basic-v1"
                },
                "trust_profile": {
                  "const": "standard"
                }
              }
            },
            {
              "properties": {
                "profile": {
                  "const": "web-basic-ru-v1"
                },
                "trust_profile": {
                  "const": "standard-plus-ru-nuc-2022"
                }
              }
            }
          ]
        }
      ]
    },
    "Publication": {
      "oneOf": [
        {
          "$ref": "#/definitions/MaskedPublication"
        },
        {
          "$ref": "#/definitions/DomainPublication"
        }
      ]
    },
    "PublicationRequest": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {}
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "disclosure"
          ],
          "properties": {
            "disclosure": {
              "const": "domain"
            }
          }
        }
      ]
    },
    "DeliveryStage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "state",
        "protocol",
        "http",
        "bytes",
        "elapsed_ms",
        "quiet_ms",
        "checkpoints_ms",
        "reference",
        "rule",
        "sustained_drop"
      ],
      "properties": {
        "state": {
          "enum": [
            "not_run",
            "not_required",
            "complete",
            "sample_reached",
            "block_page",
            "client_challenge",
            "access_limited",
            "not_seen_in_prefix",
            "no_progress",
            "truncated",
            "read_error",
            "http_error",
            "wrong_media_type",
            "no_response_before_deadline",
            "transport_error",
            "reference_mismatch",
            "short_object",
            "empty_object",
            "not_advertised",
            "offer_outside_plan",
            "protocol_mismatch",
            "budget_ended",
            "invalid_plan",
            "redirect",
            "unexpected_status",
            "encoding_unmeasured",
            "time_limit"
          ]
        },
        "protocol": {
          "enum": [
            "",
            "HTTP/1.1",
            "HTTP/2.0",
            "HTTP/3.0"
          ]
        },
        "http": {
          "type": "integer",
          "minimum": 0,
          "maximum": 599
        },
        "bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 262144
        },
        "elapsed_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 60000
        },
        "quiet_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 60000
        },
        "checkpoints_ms": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0,
            "maximum": 60000
          },
          "minItems": 0,
          "maxItems": 5
        },
        "reference": {
          "enum": [
            "",
            "match",
            "mismatch",
            "incomplete"
          ]
        },
        "rule": {
          "enum": [
            "",
            "dvsat-html-v1"
          ]
        },
        "sustained_drop": {
          "type": "boolean"
        }
      }
    }
  }
}
