{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "monitored": {
      "type": "object",
      "properties": {
        "schema_version": {
          "type": "number",
          "const": 1
        },
        "workspace_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "Workspace that owns this record."
        },
        "project_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "Project that owns this record."
        },
        "generated_at": {
          "type": "string"
        },
        "status_filter": {
          "type": "string",
          "enum": [
            "all",
            "active",
            "paused"
          ]
        },
        "coverage": {
          "type": "object",
          "properties": {
            "basis": {
              "type": "string",
              "const": "latest_retained_attempt_per_watch"
            },
            "whole_web_coverage": {
              "type": "boolean",
              "const": false,
              "description": "False: these results do not measure the whole web."
            },
            "total_watches": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "scanned_watches": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "eligible_present_watches": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "included_present_watches": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "excluded_evidence_watches": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "occurrences": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "scanned_bytes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "partial": {
              "type": "boolean"
            },
            "limitations": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "overlapping_watches_deduplicated": {
              "type": "boolean",
              "const": false
            }
          },
          "required": [
            "basis",
            "whole_web_coverage",
            "total_watches",
            "scanned_watches",
            "eligible_present_watches",
            "included_present_watches",
            "excluded_evidence_watches",
            "occurrences",
            "scanned_bytes",
            "partial",
            "limitations",
            "overlapping_watches_deduplicated"
          ],
          "additionalProperties": false,
          "description": "Dataset scope and completeness, including limits on what these results establish."
        },
        "distributions": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "enum": [
                  "watches",
                  "occurrences",
                  "anchor_terms"
                ]
              },
              "denominator": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "known_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "unknown_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "unknown_share": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "share": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    }
                  },
                  "required": [
                    "value",
                    "count",
                    "share"
                  ],
                  "additionalProperties": false,
                  "description": "Records in this bounded page."
                },
                "description": "Records in this bounded page."
              },
              "other_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "truncated": {
                "type": "boolean"
              }
            },
            "required": [
              "unit",
              "denominator",
              "known_count",
              "unknown_count",
              "unknown_share",
              "items",
              "other_count",
              "truncated"
            ],
            "additionalProperties": false
          }
        },
        "notes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "schema_version",
        "workspace_id",
        "project_id",
        "generated_at",
        "status_filter",
        "coverage",
        "distributions",
        "notes"
      ],
      "additionalProperties": false
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "set_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "revision": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991,
              "description": "Optimistic concurrency revision; supply it as expectedRevision on the next write."
            },
            "whole_web_coverage": {
              "type": "boolean",
              "const": false,
              "description": "False: these results do not measure the whole web."
            },
            "absence_claim": {
              "type": "string",
              "const": "not_supported",
              "description": "not_supported: missing dataset rows cannot prove link absence."
            },
            "pooled": {
              "type": "boolean",
              "const": false
            },
            "datasets": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "inventory_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "member_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "member_target": {
                    "type": "string"
                  },
                  "provider": {
                    "type": "string"
                  },
                  "data_mode": {
                    "type": "string"
                  },
                  "captured_at": {
                    "type": "string"
                  },
                  "member_role": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "competitor"
                    ]
                  },
                  "retrieved_from": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "retrieved_to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "coverage": {
                    "type": "string",
                    "description": "Dataset scope and completeness, including limits on what these results establish."
                  },
                  "row_count": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "basis": {
                    "type": "string",
                    "const": "frozen_inventory_rows"
                  },
                  "distributions": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "unit": {
                          "type": "string",
                          "enum": [
                            "watches",
                            "occurrences",
                            "anchor_terms",
                            "inventory_rows"
                          ]
                        },
                        "denominator": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "known_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "unknown_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "unknown_share": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "count": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "share": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 1
                              }
                            },
                            "required": [
                              "value",
                              "count",
                              "share"
                            ],
                            "additionalProperties": false,
                            "description": "Records in this bounded page."
                          },
                          "description": "Records in this bounded page."
                        },
                        "other_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "unit",
                        "denominator",
                        "known_count",
                        "unknown_count",
                        "unknown_share",
                        "items",
                        "other_count",
                        "truncated"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "inventory_id",
                  "member_id",
                  "member_target",
                  "provider",
                  "data_mode",
                  "captured_at",
                  "member_role",
                  "retrieved_from",
                  "retrieved_to",
                  "coverage",
                  "row_count",
                  "basis",
                  "distributions"
                ],
                "additionalProperties": false
              }
            },
            "notes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "set_id",
            "revision",
            "whole_web_coverage",
            "absence_claim",
            "pooled",
            "datasets",
            "notes"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "index": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "source_key": {
              "type": "string"
            },
            "basis": {
              "type": "string",
              "const": "latest_retained_receipt_per_watch_for_source"
            },
            "total_watches": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "scanned_watches": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "partial": {
              "type": "boolean"
            },
            "expired_watches": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "missing_watches": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "distribution": {
              "type": "object",
              "properties": {
                "unit": {
                  "type": "string",
                  "enum": [
                    "watches",
                    "occurrences",
                    "anchor_terms",
                    "inventory_rows"
                  ]
                },
                "denominator": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "known_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "unknown_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "unknown_share": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "count": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "share": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      }
                    },
                    "required": [
                      "value",
                      "count",
                      "share"
                    ],
                    "additionalProperties": false,
                    "description": "Records in this bounded page."
                  },
                  "description": "Records in this bounded page."
                },
                "other_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "truncated": {
                  "type": "boolean"
                }
              },
              "required": [
                "unit",
                "denominator",
                "known_count",
                "unknown_count",
                "unknown_share",
                "items",
                "other_count",
                "truncated"
              ],
              "additionalProperties": false
            },
            "notes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "source_key",
            "basis",
            "total_watches",
            "scanned_watches",
            "partial",
            "expired_watches",
            "missing_watches",
            "distribution",
            "notes"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "monitored",
    "comparison",
    "index"
  ],
  "additionalProperties": {}
}
