{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vaquill-ai/json-schema/vaquill-ai-page-comparison-hunk-schema.json",
  "title": "Page[ComparisonHunk]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vaquill-ai-comparisons-api-openapi.yml#/components/schemas/Page_ComparisonHunk_",
  "properties": {
    "data": {
      "items": {
        "$ref": "#/$defs/ComparisonHunk"
      },
      "type": "array",
      "title": "Data",
      "description": "The rows in this window, in the collection's default order."
    },
    "pagination": {
      "$ref": "#/$defs/Pagination",
      "description": "Where this window sits in the full result set."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "data",
    "pagination"
  ],
  "$defs": {
    "ComparisonHunk": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Public identifier for this hunk, `hnk_` followed by 32 hex characters."
        },
        "index": {
          "type": "integer",
          "title": "Index",
          "description": "Position in the change list, stable across reads of a finished comparison. This is what a customer means by 'the third change', and it is the sort key the list is paged by. Ordering, not geometry."
        },
        "kind": {
          "type": "string",
          "title": "Kind",
          "description": "What sort of change this is, for example an insertion, a deletion or a replacement."
        },
        "severity": {
          "type": "string",
          "title": "Severity",
          "description": "How significant the engine judged the change. Published as a plain string."
        },
        "beforeText": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Beforetext",
          "description": "The text as it stood in the original. Absent for a pure insertion."
        },
        "afterText": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Aftertext",
          "description": "The text as it stands in the revision. Absent for a pure deletion."
        },
        "sectionHeading": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sectionheading",
          "description": "Heading of the section the change sits in, when one could be resolved."
        },
        "clauseLabel": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Clauselabel",
          "description": "Clause number or label the change sits under, for example `8.2`."
        },
        "playbookVerdict": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Playbookverdict",
          "description": "What the playbook makes of this change. Present only when the comparison ran against a playbook."
        },
        "playbookReason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Playbookreason",
          "description": "Why the playbook reached that verdict. Present only when the comparison ran against a playbook."
        },
        "playbookClauseType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Playbookclausetype",
          "description": "Clause-type slug the playbook matched this change to."
        },
        "favorability": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Favorability",
          "description": "Whether the change favors your side or the counterparty. Present when the analysis pass ran."
        },
        "materiality": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Materiality",
          "description": "How much the change matters commercially. Present when the analysis pass ran."
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Category",
          "description": "What the change is about, for example liability or termination. Present when the analysis pass ran."
        },
        "impact": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Impact",
          "description": "Plain-language statement of what the change does to your position. Present when the analysis pass ran."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "id",
        "index",
        "kind",
        "severity"
      ],
      "title": "ComparisonHunk",
      "description": "One structural change, in terms that survive outside the viewer."
    },
    "Pagination": {
      "properties": {
        "limit": {
          "type": "integer",
          "title": "Limit",
          "description": "The `limit` that was applied to this request."
        },
        "offset": {
          "type": "integer",
          "title": "Offset",
          "description": "The `offset` that was applied to this request."
        },
        "total": {
          "type": "integer",
          "title": "Total",
          "description": "Total rows matching the filter, not the number returned in `data`. Use it to size a job before running it."
        },
        "hasMore": {
          "type": "boolean",
          "title": "Hasmore",
          "description": "True when rows remain beyond this window. Derived from `offset + len(data) < total`, so a full final page correctly reports `false` rather than sending you after an empty page."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "limit",
        "offset",
        "total",
        "hasMore"
      ],
      "title": "Pagination",
      "description": "Where the caller is, and whether there is more.\n\n`total` is the count of rows matching the filter, not the count returned,\nso a caller can size a job before running it."
    }
  }
}