{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pipelinexlab.com/contracts/document-analysis.v2.schema.json",
  "title": "Immutable PDF analysis with explicit processed page coverage",
  "description": "Core additionally validates sorted in-range coverage and requires every segment to belong to a processed page. Coverage describes completed extraction, not quality, blankness, review or access. V1 remains a separate unchanged contract with unknown coverage.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "kind",
    "coordinateSpace",
    "source",
    "processor",
    "segments",
    "processedPageIndices"
  ],
  "properties": {
    "schemaVersion": {
      "const": 2
    },
    "kind": {
      "$ref": "https://pipelinexlab.com/contracts/document-analysis.v1.schema.json#/$defs/analysis/properties/kind"
    },
    "coordinateSpace": {
      "$ref": "https://pipelinexlab.com/contracts/document-analysis.v1.schema.json#/$defs/analysis/properties/coordinateSpace"
    },
    "source": {
      "$ref": "https://pipelinexlab.com/contracts/document-analysis.v1.schema.json#/$defs/analysis/properties/source"
    },
    "processor": {
      "$ref": "https://pipelinexlab.com/contracts/document-analysis.v1.schema.json#/$defs/analysis/properties/processor"
    },
    "segments": {
      "$ref": "https://pipelinexlab.com/contracts/document-analysis.v1.schema.json#/$defs/analysis/properties/segments"
    },
    "processedPageIndices": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "integer",
        "minimum": 0,
        "maximum": 4294967295
      },
      "description": "Strictly increasing zero-based physical page indices, including processed pages that produced no segments. Not inferred from source.pages or segment presence."
    }
  }
}
