{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gxplex.com/api/v1/schema/probe-record.json",
  "title": "Probe partition line",
  "description": "One line of /api/v1/probe/<window>.jsonl. The first line is the partition's header record, `_record: header`; every other line is a probe: how a named client was answered by a host on a date. A transport measurement, not a document observation.",
  "anyOf": [
    {
      "type": "object",
      "title": "Partition header",
      "properties": {
        "schema_version": {
          "type": "integer",
          "description": "Always 1 under this contract. It increments only when a field is removed or re-typed, which the published contract forbids. Fields have been re-typed with this value unchanged; https://gxplex.com/how/schemas/#history lists each with its commit and its correction."
        },
        "collection": {
          "type": "string",
          "description": "Always `probe`."
        },
        "window": {
          "type": "string",
          "description": "The ISO week the partition covers."
        },
        "state": {
          "type": "string",
          "enum": [
            "open",
            "closed"
          ],
          "description": "`open` is the current week and still receiving rows."
        },
        "generated_at": {
          "type": "string",
          "format": "date",
          "description": "The day this record calls today, at day granularity. Not a build clock: the unit of this archive is the day."
        },
        "source": {
          "type": "string",
          "description": "The origin this document was built for."
        },
        "index": {
          "type": "string",
          "description": "The partition index."
        },
        "notice": {
          "type": "string",
          "description": "What a probe line records, and what it does not."
        },
        "rows": {
          "type": "integer",
          "description": "Probe lines in the partition."
        },
        "first_probe": {
          "type": [
            "string",
            "null"
          ],
          "description": "Earliest probe day in the partition."
        },
        "last_probe": {
          "type": [
            "string",
            "null"
          ],
          "description": "Latest probe day in the partition."
        },
        "_record": {
          "const": "header"
        }
      },
      "required": [
        "_record",
        "schema_version",
        "collection",
        "window",
        "state",
        "generated_at",
        "source",
        "index",
        "notice",
        "rows"
      ],
      "additionalProperties": true
    },
    {
      "type": "object",
      "title": "Probe",
      "properties": {
        "schema_version": {
          "type": "integer",
          "description": "Always 1 under this contract. It increments only when a field is removed or re-typed, which the published contract forbids. Fields have been re-typed with this value unchanged; https://gxplex.com/how/schemas/#history lists each with its commit and its correction."
        },
        "probed_at": {
          "type": "string",
          "description": "When the probe was made, as stored."
        },
        "probe_date": {
          "type": "string",
          "format": "date",
          "description": "The day of the probe."
        },
        "instrument_id": {
          "type": "string",
          "description": "The tracked row whose address was probed."
        },
        "authority": {
          "type": "string",
          "description": "The row's authority, as the row holds it."
        },
        "url": {
          "type": "string",
          "description": "The address probed."
        },
        "agent": {
          "type": "string",
          "description": "The named client profile."
        },
        "agent_ua": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user-agent string sent, as stored."
        },
        "robots_token": {
          "type": "string",
          "description": "The robots token the profile answers to."
        },
        "render_mode": {
          "type": [
            "string",
            "null"
          ],
          "description": "How the response was read, as stored."
        },
        "http_status": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The status the host answered with; null where none was received."
        },
        "bytes": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Bytes received; null where none were."
        },
        "final_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The address that answered."
        },
        "redirect_chain": {
          "type": [
            "array",
            "null"
          ],
          "description": "The redirects followed, as stored."
        },
        "ms": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Elapsed milliseconds, as stored."
        },
        "bot_headers": {
          "type": [
            "object",
            "null"
          ],
          "description": "Response headers a client profile is answered with, as stored."
        },
        "error": {
          "type": [
            "string",
            "null"
          ],
          "description": "The transport error, where one was recorded."
        },
        "robots": {
          "type": "object",
          "description": "The robots reading for the profile. A row whose read_on is a date holds the record's stored reading of the host, made on that day and not on the probe day, with its state; a row whose state is unmeasured had no stored reading, carries read_on and every directive field as null, and names the host in a note. A row with no state key was written by the earlier live read, which the correction of 2026-11-11 on the probe partitions records as having read no file on any line from 2026-08-03."
        },
        "method": {
          "type": "string",
          "description": "Carried by some rows only: how the request was made, or unmeasured where no request was made."
        },
        "not_requested": {
          "type": "string",
          "description": "Carried by some rows only: why no request was made."
        },
        "rescoped_from": {
          "type": "string",
          "description": "Carried by some rows only: the row id the probe was recorded under before a rescope."
        },
        "rescoped_on": {
          "type": "string",
          "description": "Carried by some rows only: the day of the rescope."
        },
        "rescope_reason": {
          "type": "string",
          "description": "Carried by some rows only: why the probe was rescoped."
        }
      },
      "required": [
        "schema_version",
        "probed_at",
        "probe_date",
        "instrument_id",
        "authority",
        "url",
        "agent",
        "agent_ua",
        "robots_token",
        "render_mode",
        "http_status",
        "bytes",
        "final_url",
        "redirect_chain",
        "ms",
        "bot_headers",
        "error",
        "robots"
      ],
      "additionalProperties": true
    }
  ]
}
