{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vaquill-ai/json-schema/vaquill-ai-page-fact-set-schema.json",
  "title": "Page[FactSet]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vaquill-ai-facts-api-openapi.yml#/components/schemas/Page_FactSet_",
  "properties": {
    "data": {
      "items": {
        "$ref": "#/$defs/FactSet"
      },
      "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": {
    "FactSet": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "`fct_` identifier. The same id the operation's resource carries."
        },
        "matterId": {
          "type": "string",
          "title": "Matterid",
          "description": "The `mat_` matter this set covers."
        },
        "status": {
          "$ref": "#/$defs/OperationStatus",
          "description": "The generation's status, in the same five values every operation uses."
        },
        "mode": {
          "type": "string",
          "title": "Mode",
          "description": "How this set was generated. `standard` re-reads the matter, `incremental` reads only what changed. Sets generated from the web app may report `deep`, which this API does not accept."
        },
        "isCurrent": {
          "type": "boolean",
          "title": "Iscurrent",
          "description": "True for the one set in force for this matter. Generating a new set makes the previous one `false`; nothing is deleted, and its facts stay readable."
        },
        "isStale": {
          "type": "boolean",
          "title": "Isstale",
          "description": "True when the matter's documents have changed since this set was built. Computed per request against the current document set, never stored."
        },
        "changedDocCount": {
          "type": "integer",
          "title": "Changeddoccount",
          "description": "How many documents the matter has gained since this set was generated. Zero with `isStale` true means documents were re-ingested rather than added."
        },
        "coverage": {
          "$ref": "#/$defs/FactSetCoverage",
          "description": "What the generation read."
        },
        "factCount": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Factcount",
          "description": "Facts in the set, once it has finished."
        },
        "conflictCount": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Conflictcount",
          "description": "Facts the reducer flagged as conflicted."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "title": "Createdat",
          "description": "When the generation was requested."
        },
        "completedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Completedat",
          "description": "When the generation finished. Null until it does."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "id",
        "matterId",
        "status",
        "mode",
        "isCurrent",
        "isStale",
        "changedDocCount",
        "coverage",
        "createdAt"
      ],
      "title": "FactSet",
      "description": "One generated ledger."
    },
    "FactSetCoverage": {
      "properties": {
        "included": {
          "type": "integer",
          "title": "Included",
          "description": "Documents whose evidence went into this set."
        },
        "total": {
          "type": "integer",
          "title": "Total",
          "description": "Documents in the matter at generation time."
        },
        "excluded": {
          "type": "integer",
          "title": "Excluded",
          "description": "Documents in the matter that this generation did not read, because it hit the per-run inline ceiling. Generate again to pick up more."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "included",
        "total",
        "excluded"
      ],
      "title": "FactSetCoverage",
      "description": "What the generation actually read, and what it did not.\n\nNot decoration. The reducer extracts at most 60 documents inline, so on a\nlarger matter `included` is 60 and `excluded` is the rest, while the\noperation reports 60 of 60 and looks complete. It IS complete, for what it\nread. This is the only place that says what that was."
    },
    "OperationStatus": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ],
      "title": "OperationStatus",
      "description": "The public five. There is no sixth, and there are no synonyms.\n\nInternal vocabularies spell terminal success `completed`, `ready`,\n`extracted`, `succeeded` and `fresh`; terminal failure `failed` and `error`;\nqueued `pending`, `queued` and `draft`. All of that is collapsed here by\n`app.workspace_api.adapters.status_map`, which refuses to guess."
    },
    "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."
    }
  }
}