{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "AffiliationExport": {
      "additionalProperties": false,
      "description": "Structured affiliation parsed from the author byline. ``text`` is our own\nverbatim byline string; the parsed components are best-effort (LLM).",
      "properties": {
        "affiliation_id": {
          "title": "Affiliation Id",
          "type": "integer"
        },
        "text": {
          "title": "Text",
          "type": "string"
        },
        "institution": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Institution"
        },
        "department": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Department"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "City"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Country"
        },
        "author_ids": {
          "default": [],
          "items": {
            "type": "integer"
          },
          "title": "Author Ids",
          "type": "array"
        }
      },
      "required": [
        "affiliation_id",
        "text"
      ],
      "title": "AffiliationExport",
      "type": "object"
    },
    "AuthorExport": {
      "additionalProperties": false,
      "properties": {
        "author_id": {
          "title": "Author Id",
          "type": "integer"
        },
        "given": {
          "title": "Given",
          "type": "string"
        },
        "family": {
          "title": "Family",
          "type": "string"
        },
        "suffix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Suffix"
        },
        "affiliation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Affiliation"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Email"
        },
        "corresponding": {
          "title": "Corresponding",
          "type": "boolean"
        },
        "orcid": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Orcid"
        },
        "role": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Role",
          "type": "array"
        }
      },
      "required": [
        "author_id",
        "given",
        "family",
        "corresponding"
      ],
      "title": "AuthorExport",
      "type": "object"
    },
    "BibExport": {
      "additionalProperties": false,
      "properties": {
        "bib_id": {
          "title": "Bib Id",
          "type": "integer"
        },
        "text_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Text Id"
        },
        "bib_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bib Type"
        },
        "doi": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Doi"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "authors": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Authors"
        },
        "author": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/PersonNameExport"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Author"
        },
        "editors": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Editors"
        },
        "editor": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/PersonNameExport"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Editor"
        },
        "publisher": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Publisher"
        },
        "year": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Year"
        },
        "year_suffix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Year Suffix"
        },
        "date": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Date"
        },
        "container": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Container"
        },
        "volume": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Volume"
        },
        "issue": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Issue"
        },
        "first_page": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "First Page"
        },
        "last_page": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Last Page"
        },
        "edition": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Edition"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "is_in_press": {
          "default": false,
          "title": "Is In Press",
          "type": "boolean"
        },
        "arxiv": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Arxiv"
        },
        "pmid": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Pmid"
        },
        "series": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Series"
        },
        "access_date": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Access Date"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Note"
        },
        "consolidated_fields": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Consolidated Fields"
        }
      },
      "required": [
        "bib_id"
      ],
      "title": "BibExport",
      "type": "object"
    },
    "BibMatchExport": {
      "additionalProperties": false,
      "description": "Flat enrichment match from an external service.",
      "properties": {
        "bib_id": {
          "title": "Bib Id",
          "type": "integer"
        },
        "service": {
          "title": "Service",
          "type": "string"
        },
        "service_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Service Id"
        },
        "score": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Score"
        },
        "bib_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bib Type"
        },
        "doi": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Doi"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "author": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/PersonNameExport"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Author"
        },
        "editor": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/PersonNameExport"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Editor"
        },
        "publisher": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Publisher"
        },
        "year": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Year"
        },
        "date": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Date"
        },
        "container": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Container"
        },
        "volume": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Volume"
        },
        "issue": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Issue"
        },
        "first_page": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "First Page"
        },
        "last_page": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Last Page"
        },
        "edition": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Edition"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        }
      },
      "required": [
        "bib_id",
        "service"
      ],
      "title": "BibMatchExport",
      "type": "object"
    },
    "CaptionAssignmentExport": {
      "additionalProperties": false,
      "properties": {
        "caption_id": {
          "title": "Caption Id",
          "type": "string"
        },
        "object_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Object Id"
        },
        "score": {
          "title": "Score",
          "type": "number"
        },
        "reasons": {
          "items": {
            "type": "string"
          },
          "title": "Reasons",
          "type": "array"
        },
        "ambiguous": {
          "default": false,
          "title": "Ambiguous",
          "type": "boolean"
        }
      },
      "required": [
        "caption_id",
        "object_id",
        "score",
        "reasons"
      ],
      "title": "CaptionAssignmentExport",
      "type": "object"
    },
    "CaptionAssignmentReceiptExport": {
      "additionalProperties": false,
      "properties": {
        "candidates": {
          "items": {
            "$ref": "#/$defs/CaptionCandidateExport"
          },
          "title": "Candidates",
          "type": "array"
        },
        "assignments": {
          "items": {
            "$ref": "#/$defs/CaptionAssignmentExport"
          },
          "title": "Assignments",
          "type": "array"
        }
      },
      "required": [
        "candidates",
        "assignments"
      ],
      "title": "CaptionAssignmentReceiptExport",
      "type": "object"
    },
    "CaptionCandidateExport": {
      "additionalProperties": false,
      "properties": {
        "caption_id": {
          "title": "Caption Id",
          "type": "string"
        },
        "text": {
          "title": "Text",
          "type": "string"
        },
        "object_type": {
          "title": "Object Type",
          "type": "string"
        },
        "page_number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Page Number"
        },
        "bbox": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bbox"
        },
        "source_index": {
          "title": "Source Index",
          "type": "integer"
        }
      },
      "required": [
        "caption_id",
        "text",
        "object_type",
        "page_number",
        "bbox",
        "source_index"
      ],
      "title": "CaptionCandidateExport",
      "type": "object"
    },
    "CitationCandidateExport": {
      "additionalProperties": false,
      "description": "Lossless JSON representation of one citation detector candidate.",
      "properties": {
        "text_id": {
          "title": "Text Id",
          "type": "integer"
        },
        "start": {
          "title": "Start",
          "type": "integer"
        },
        "end": {
          "title": "End",
          "type": "integer"
        },
        "raw": {
          "title": "Raw",
          "type": "string"
        },
        "style": {
          "title": "Style",
          "type": "string"
        },
        "bib_ids": {
          "items": {
            "type": "integer"
          },
          "title": "Bib Ids",
          "type": "array"
        },
        "evidence": {
          "items": {
            "type": "string"
          },
          "title": "Evidence",
          "type": "array"
        },
        "confidence": {
          "title": "Confidence",
          "type": "number"
        },
        "accepted": {
          "title": "Accepted",
          "type": "boolean"
        },
        "rejection_reasons": {
          "items": {
            "type": "string"
          },
          "title": "Rejection Reasons",
          "type": "array"
        }
      },
      "required": [
        "text_id",
        "start",
        "end",
        "raw",
        "style",
        "bib_ids",
        "evidence",
        "confidence",
        "accepted",
        "rejection_reasons"
      ],
      "title": "CitationCandidateExport",
      "type": "object"
    },
    "CitationLinkingExport": {
      "additionalProperties": false,
      "description": "Evidence-bearing diagnostic receipt for inline citation linking.",
      "properties": {
        "style_scores": {
          "additionalProperties": {
            "type": "number"
          },
          "title": "Style Scores",
          "type": "object"
        },
        "candidates": {
          "items": {
            "$ref": "#/$defs/CitationCandidateExport"
          },
          "title": "Candidates",
          "type": "array"
        },
        "resolved_candidate_fraction": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Resolved Candidate Fraction"
        },
        "unique_linked_bib_fraction": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unique Linked Bib Fraction"
        }
      },
      "required": [
        "style_scores",
        "candidates",
        "resolved_candidate_fraction",
        "unique_linked_bib_fraction"
      ],
      "title": "CitationLinkingExport",
      "type": "object"
    },
    "DiagnosticsExport": {
      "additionalProperties": false,
      "description": "Outcome flags and stage receipts \u2014 never raw payloads.\n\n``regions`` and ``trace`` are deliberately NOT here: they are megabyte-scale\nintermediate data, and bundling them would force every diagnostics consumer\nto reason about size.",
      "properties": {
        "text_quality": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Text Quality"
        },
        "references_complete": {
          "default": true,
          "title": "References Complete",
          "type": "boolean"
        },
        "ref_seg_fallback_used": {
          "default": false,
          "title": "Ref Seg Fallback Used",
          "type": "boolean"
        },
        "citation_linking": {
          "anyOf": [
            {
              "$ref": "#/$defs/CitationLinkingExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "caption_assignment": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaptionAssignmentReceiptExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "reference_yield": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReferenceYieldExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "title": "DiagnosticsExport",
      "type": "object"
    },
    "DoiCandidateExport": {
      "additionalProperties": false,
      "properties": {
        "raw": {
          "title": "Raw",
          "type": "string"
        },
        "normalized": {
          "title": "Normalized",
          "type": "string"
        },
        "source_kind": {
          "title": "Source Kind",
          "type": "string"
        },
        "page": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Page"
        },
        "section_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Section Id"
        },
        "section_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Section Type"
        },
        "region_index": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Region Index"
        },
        "region_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Region Type"
        },
        "text_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text Id"
        },
        "marker_kind": {
          "title": "Marker Kind",
          "type": "string"
        },
        "repeated_header_footer_count": {
          "title": "Repeated Header Footer Count",
          "type": "integer"
        },
        "semantic_context": {
          "title": "Semantic Context",
          "type": "string"
        },
        "selection_tier": {
          "title": "Selection Tier",
          "type": "integer"
        },
        "rejection_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Rejection Reason"
        }
      },
      "required": [
        "raw",
        "normalized",
        "source_kind",
        "page",
        "section_id",
        "section_type",
        "region_index",
        "region_type",
        "text_id",
        "marker_kind",
        "repeated_header_footer_count",
        "semantic_context",
        "selection_tier"
      ],
      "title": "DoiCandidateExport",
      "type": "object"
    },
    "EnrichmentExport": {
      "additionalProperties": false,
      "description": "Reference-enrichment completeness \u2014 lets a consumer distinguish a\npartial (timed-out) Crossref enrichment from a complete one without\ngrepping ``extraction.warnings``. ``null`` when enrichment never ran.",
      "properties": {
        "complete": {
          "title": "Complete",
          "type": "boolean"
        },
        "refs_enriched": {
          "title": "Refs Enriched",
          "type": "integer"
        },
        "refs_total": {
          "title": "Refs Total",
          "type": "integer"
        }
      },
      "required": [
        "complete",
        "refs_enriched",
        "refs_total"
      ],
      "title": "EnrichmentExport",
      "type": "object"
    },
    "EqExport": {
      "additionalProperties": false,
      "properties": {
        "eq_id": {
          "title": "Eq Id",
          "type": "integer"
        },
        "text_id": {
          "title": "Text Id",
          "type": "integer"
        },
        "grp_id": {
          "title": "Grp Id",
          "type": "integer"
        },
        "verbatim": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Verbatim"
        },
        "lhs": {
          "title": "Lhs",
          "type": "string"
        },
        "df": {
          "title": "Df",
          "type": "string"
        },
        "comp": {
          "title": "Comp",
          "type": "string"
        },
        "rhs": {
          "title": "Rhs",
          "type": "string"
        }
      },
      "required": [
        "eq_id",
        "text_id",
        "grp_id",
        "lhs",
        "df",
        "comp",
        "rhs"
      ],
      "title": "EqExport",
      "type": "object"
    },
    "ExpectedIdentityExport": {
      "additionalProperties": false,
      "properties": {
        "queue_record_id": {
          "title": "Queue Record Id",
          "type": "string"
        },
        "expected_doi": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Expected Doi"
        },
        "expected_doi_sha256": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Expected Doi Sha256"
        },
        "expected_title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Expected Title"
        },
        "target_block_hint": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Target Block Hint"
        },
        "source_sha256": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Source Sha256"
        },
        "doi_required": {
          "default": false,
          "title": "Doi Required",
          "type": "boolean"
        }
      },
      "required": [
        "queue_record_id"
      ],
      "title": "ExpectedIdentityExport",
      "type": "object"
    },
    "ExtractionExport": {
      "additionalProperties": false,
      "description": "Extraction provenance \u2014 how this output was produced.\n\nBuilt by ``ExportStage._build_extraction`` from the pipeline context; the\nexport function passes it through verbatim. Omitted entirely when a Paper is\nexported outside the pipeline.",
      "properties": {
        "bibr_version": {
          "title": "Bibr Version",
          "type": "string"
        },
        "build_sha": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Build Sha"
        },
        "completed_at": {
          "title": "Completed At",
          "type": "string"
        },
        "ocr": {
          "anyOf": [
            {
              "$ref": "#/$defs/OcrEngineExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "llm": {
          "anyOf": [
            {
              "$ref": "#/$defs/LlmEngineExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "settings": {
          "$ref": "#/$defs/ExtractionSettingsExport"
        },
        "timings": {
          "anyOf": [
            {
              "$ref": "#/$defs/TimingsExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "usage": {
          "anyOf": [
            {
              "$ref": "#/$defs/UsageExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "enrichment": {
          "anyOf": [
            {
              "$ref": "#/$defs/EnrichmentExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "identity": {
          "anyOf": [
            {
              "$ref": "#/$defs/IdentityExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "diagnostics": {
          "anyOf": [
            {
              "$ref": "#/$defs/DiagnosticsExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "warnings": {
          "items": {
            "type": "string"
          },
          "title": "Warnings",
          "type": "array"
        },
        "regions": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/RegionExport"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Regions"
        },
        "trace": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/LlmTraceExport"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Trace"
        }
      },
      "required": [
        "bibr_version",
        "completed_at",
        "settings"
      ],
      "title": "ExtractionExport",
      "type": "object"
    },
    "ExtractionSettingsExport": {
      "additionalProperties": false,
      "description": "Per-run resolutions of the reference/enrichment knobs.",
      "properties": {
        "ref_seg": {
          "title": "Ref Seg",
          "type": "string"
        },
        "ref_parse": {
          "title": "Ref Parse",
          "type": "string"
        },
        "crossref_enrich": {
          "title": "Crossref Enrich",
          "type": "boolean"
        },
        "consolidate": {
          "title": "Consolidate",
          "type": "string"
        }
      },
      "required": [
        "ref_seg",
        "ref_parse",
        "crossref_enrich",
        "consolidate"
      ],
      "title": "ExtractionSettingsExport",
      "type": "object"
    },
    "FigureExport": {
      "additionalProperties": false,
      "properties": {
        "figure_id": {
          "title": "Figure Id",
          "type": "integer"
        },
        "section_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Section Id"
        },
        "image": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Image"
        },
        "caption": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Caption"
        },
        "page_number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Page Number"
        },
        "parts": {
          "default": [],
          "items": {
            "$ref": "#/$defs/FigurePartExport"
          },
          "title": "Parts",
          "type": "array"
        }
      },
      "required": [
        "figure_id",
        "page_number"
      ],
      "title": "FigureExport",
      "type": "object"
    },
    "FigurePartExport": {
      "additionalProperties": false,
      "properties": {
        "part_index": {
          "title": "Part Index",
          "type": "integer"
        },
        "image": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Image"
        },
        "page_number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Page Number"
        },
        "bbox": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bbox"
        },
        "provenance": {
          "default": [],
          "items": {
            "$ref": "#/$defs/ProvenanceExport"
          },
          "title": "Provenance",
          "type": "array"
        }
      },
      "required": [
        "part_index"
      ],
      "title": "FigurePartExport",
      "type": "object"
    },
    "FundingExport": {
      "additionalProperties": false,
      "description": "Structured funding entry parsed from the funding statement.",
      "properties": {
        "funding_id": {
          "title": "Funding Id",
          "type": "integer"
        },
        "funder": {
          "title": "Funder",
          "type": "string"
        },
        "award_ids": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Award Ids",
          "type": "array"
        }
      },
      "required": [
        "funding_id",
        "funder"
      ],
      "title": "FundingExport",
      "type": "object"
    },
    "IdentityExport": {
      "additionalProperties": false,
      "description": "Caller-supplied expectations and the DOI-selection receipt.",
      "properties": {
        "expected": {
          "anyOf": [
            {
              "$ref": "#/$defs/ExpectedIdentityExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "receipt": {
          "anyOf": [
            {
              "$ref": "#/$defs/IdentityReceiptExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "title": "IdentityExport",
      "type": "object"
    },
    "IdentityReceiptExport": {
      "additionalProperties": false,
      "properties": {
        "selected": {
          "anyOf": [
            {
              "$ref": "#/$defs/DoiCandidateExport"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "candidates": {
          "items": {
            "$ref": "#/$defs/DoiCandidateExport"
          },
          "title": "Candidates",
          "type": "array"
        },
        "issue_codes": {
          "items": {
            "type": "string"
          },
          "title": "Issue Codes",
          "type": "array"
        }
      },
      "title": "IdentityReceiptExport",
      "type": "object"
    },
    "LlmEngineExport": {
      "additionalProperties": false,
      "description": "The CORE extraction LLM. ``null`` when the run deliberately had none.\n\n``usage.breakdown`` is authoritative for every engine that actually ran;\nwhen the two disagree (multi-engine run), breakdown wins.",
      "properties": {
        "provider": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Provider"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Model"
        },
        "backend": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Backend"
        }
      },
      "title": "LlmEngineExport",
      "type": "object"
    },
    "LlmTraceExport": {
      "additionalProperties": false,
      "description": "One LLM call's captured prompt and raw response.\n\nCapture is opt-in via ``LLM_CAPTURE_TRACE`` (default off). Traces are joined\nto the extraction by paper ID and to usage breakdowns by label, provider,\nand model. Credential-shaped tokens are scrubbed before export; document\ntext is still present, so callers control where trace-bearing exports go.\n\nOnly the Instructor backend currently captures traces. The NuExtract-native\nbackend logs a warning when tracing is requested and emits no trace rows.\nOnly successful physical attempts are captured: validation re-asks inside\nInstructor and transient failures in the outer retry loop are absent.\nConsequently ``attempt`` is currently always 1; failure fields do not\nconstitute a complete retry history.",
      "properties": {
        "label": {
          "title": "Label",
          "type": "string"
        },
        "provider": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Provider"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Model"
        },
        "messages": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "title": "Messages",
          "type": "array"
        },
        "raw_completion": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Raw Completion"
        },
        "parsed_ok": {
          "title": "Parsed Ok",
          "type": "boolean"
        },
        "finish_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Finish Reason"
        },
        "params": {
          "additionalProperties": true,
          "title": "Params",
          "type": "object"
        },
        "attempt": {
          "default": 1,
          "title": "Attempt",
          "type": "integer"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        }
      },
      "required": [
        "label",
        "parsed_ok"
      ],
      "title": "LlmTraceExport",
      "type": "object"
    },
    "MetadataExport": {
      "additionalProperties": false,
      "description": "Scalar paper-level metadata.\n\nScalars only: nested objects/lists here break R consumers that call\n``as.data.frame(metadata)`` (metacheck's ``.read_bibr``). Processing\nmetadata lives under ``extraction`` instead; file identity under ``source``.",
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "abstract": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Abstract"
        },
        "keywords": {
          "items": {
            "type": "string"
          },
          "title": "Keywords",
          "type": "array"
        },
        "doi": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Doi"
        },
        "paper_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Paper Type"
        },
        "paper_type_confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Paper Type Confidence"
        },
        "oecd_l1": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oecd L1"
        },
        "oecd_l2": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oecd L2"
        },
        "oecd_confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oecd Confidence"
        },
        "journal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Journal"
        },
        "volume": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Volume"
        },
        "issue": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Issue"
        },
        "first_page": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "First Page"
        },
        "last_page": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Last Page"
        },
        "issn": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Issn"
        },
        "publisher": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Publisher"
        },
        "published": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Published"
        },
        "license": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "License"
        },
        "funding_statement": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Funding Statement"
        },
        "coi_statement": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Coi Statement"
        },
        "ethics_statement": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ethics Statement"
        },
        "data_availability": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Data Availability"
        }
      },
      "required": [
        "title",
        "keywords",
        "doi"
      ],
      "title": "MetadataExport",
      "type": "object"
    },
    "MetadataMatchExport": {
      "additionalProperties": false,
      "description": "Flat enrichment match for the paper's OWN bibliographic identity.\n\nMirrors :class:`BibMatchExport` (same external-service shape) but keyed to\nthe paper rather than a reference, so it carries no ``bib_id``.",
      "properties": {
        "service": {
          "title": "Service",
          "type": "string"
        },
        "service_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Service Id"
        },
        "score": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Score"
        },
        "bib_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bib Type"
        },
        "doi": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Doi"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "author": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/PersonNameExport"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Author"
        },
        "editor": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/PersonNameExport"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Editor"
        },
        "publisher": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Publisher"
        },
        "year": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Year"
        },
        "date": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Date"
        },
        "container": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Container"
        },
        "volume": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Volume"
        },
        "issue": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Issue"
        },
        "first_page": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "First Page"
        },
        "last_page": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Last Page"
        },
        "edition": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Edition"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Version"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        }
      },
      "required": [
        "service"
      ],
      "title": "MetadataMatchExport",
      "type": "object"
    },
    "OcrEngineExport": {
      "additionalProperties": false,
      "description": "Which OCR engine produced this output. ``null`` on the DOCX-native path.",
      "properties": {
        "backend": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Backend"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Model"
        },
        "profile": {
          "anyOf": [
            {
              "enum": [
                "paddle",
                "glm"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Profile"
        }
      },
      "title": "OcrEngineExport",
      "type": "object"
    },
    "PersonNameExport": {
      "additionalProperties": false,
      "description": "One structured person name.\n\n``literal`` holds corporate/unsplittable names whole (the JATS\n``string-name`` analog); when it is set, ``family``/``given`` are absent.",
      "properties": {
        "family": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Family"
        },
        "given": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Given"
        },
        "suffix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Suffix"
        },
        "literal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Literal"
        }
      },
      "title": "PersonNameExport",
      "type": "object"
    },
    "ProvenanceExport": {
      "additionalProperties": false,
      "properties": {
        "page": {
          "title": "Page",
          "type": "integer"
        },
        "bbox": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bbox"
        }
      },
      "required": [
        "page"
      ],
      "title": "ProvenanceExport",
      "type": "object"
    },
    "ReferenceSegmentationAttemptExport": {
      "additionalProperties": false,
      "properties": {
        "strategy": {
          "title": "Strategy",
          "type": "string"
        },
        "spans": {
          "items": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "title": "Spans",
          "type": "array"
        },
        "credible_starts": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Credible Starts"
        },
        "selected": {
          "title": "Selected",
          "type": "boolean"
        },
        "reason_flags": {
          "items": {
            "type": "string"
          },
          "title": "Reason Flags",
          "type": "array"
        }
      },
      "required": [
        "strategy",
        "spans",
        "credible_starts",
        "selected",
        "reason_flags"
      ],
      "title": "ReferenceSegmentationAttemptExport",
      "type": "object"
    },
    "ReferenceYieldExport": {
      "additionalProperties": false,
      "properties": {
        "credible_source_starts": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Credible Source Starts"
        },
        "attempts": {
          "items": {
            "$ref": "#/$defs/ReferenceSegmentationAttemptExport"
          },
          "title": "Attempts",
          "type": "array"
        },
        "selected_spans": {
          "items": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "title": "Selected Spans",
          "type": "array"
        },
        "source_character_coverage": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Character Coverage"
        },
        "parsed_count": {
          "title": "Parsed Count",
          "type": "integer"
        },
        "valid_count": {
          "title": "Valid Count",
          "type": "integer"
        },
        "duplicate_rate": {
          "title": "Duplicate Rate",
          "type": "number"
        },
        "reason_flags": {
          "items": {
            "type": "string"
          },
          "title": "Reason Flags",
          "type": "array"
        }
      },
      "required": [
        "credible_source_starts",
        "attempts",
        "selected_spans",
        "source_character_coverage",
        "parsed_count",
        "valid_count",
        "duplicate_rate",
        "reason_flags"
      ],
      "title": "ReferenceYieldExport",
      "type": "object"
    },
    "RegionExport": {
      "additionalProperties": false,
      "description": "Per-region layout debug payload (``include_regions=True``).",
      "properties": {
        "page": {
          "title": "Page",
          "type": "integer"
        },
        "index": {
          "title": "Index",
          "type": "integer"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Label"
        },
        "bbox": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bbox"
        },
        "font_size": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Font Size"
        },
        "font_weight": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Font Weight"
        },
        "font_bold": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Font Bold"
        },
        "section_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Section Id"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "raw_ocr_content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Raw Ocr Content"
        },
        "bbox_height": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bbox Height"
        },
        "bbox_width": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bbox Width"
        },
        "char_density": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Char Density"
        },
        "estimated_line_height": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Estimated Line Height"
        }
      },
      "required": [
        "page",
        "index",
        "label",
        "bbox"
      ],
      "title": "RegionExport",
      "type": "object"
    },
    "SectionExport": {
      "additionalProperties": false,
      "properties": {
        "section_id": {
          "title": "Section Id",
          "type": "integer"
        },
        "header": {
          "title": "Header",
          "type": "string"
        },
        "level": {
          "title": "Level",
          "type": "integer"
        },
        "parent_section_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Parent Section Id"
        },
        "section_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Section Type"
        },
        "classification_score": {
          "title": "Classification Score",
          "type": "number"
        },
        "classification_source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Classification Source"
        }
      },
      "required": [
        "section_id",
        "header",
        "level",
        "parent_section_id",
        "section_type",
        "classification_score"
      ],
      "title": "SectionExport",
      "type": "object"
    },
    "SourceExport": {
      "additionalProperties": false,
      "description": "Identity of the input artifact \u2014 not of the paper.",
      "properties": {
        "file_name": {
          "title": "File Name",
          "type": "string"
        },
        "file_hash": {
          "title": "File Hash",
          "type": "string"
        },
        "input_format": {
          "title": "Input Format",
          "type": "string"
        }
      },
      "required": [
        "file_name",
        "file_hash",
        "input_format"
      ],
      "title": "SourceExport",
      "type": "object"
    },
    "TableExport": {
      "additionalProperties": false,
      "properties": {
        "table_id": {
          "title": "Table Id",
          "type": "integer"
        },
        "section_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Section Id"
        },
        "html": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Html"
        },
        "contents": {
          "items": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": "Contents",
          "type": "array"
        },
        "caption": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Caption"
        },
        "page_number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Page Number"
        },
        "parts": {
          "default": [],
          "items": {
            "$ref": "#/$defs/TablePartExport"
          },
          "title": "Parts",
          "type": "array"
        }
      },
      "required": [
        "table_id",
        "contents",
        "page_number"
      ],
      "title": "TableExport",
      "type": "object"
    },
    "TablePartExport": {
      "additionalProperties": false,
      "properties": {
        "part_index": {
          "title": "Part Index",
          "type": "integer"
        },
        "html": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Html"
        },
        "contents": {
          "items": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": "Contents",
          "type": "array"
        },
        "page_number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Page Number"
        },
        "bbox": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bbox"
        },
        "provenance": {
          "default": [],
          "items": {
            "$ref": "#/$defs/ProvenanceExport"
          },
          "title": "Provenance",
          "type": "array"
        }
      },
      "required": [
        "part_index",
        "contents"
      ],
      "title": "TablePartExport",
      "type": "object"
    },
    "TextExport": {
      "additionalProperties": false,
      "properties": {
        "text": {
          "title": "Text",
          "type": "string"
        },
        "text_id": {
          "title": "Text Id",
          "type": "integer"
        },
        "paragraph_id": {
          "title": "Paragraph Id",
          "type": "integer"
        },
        "section_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Section Id"
        },
        "page_number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Page Number"
        },
        "formatted": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Formatted"
        },
        "_font_size": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Font Size"
        },
        "_font_bold": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Font Bold"
        },
        "_is_italic": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Is Italic"
        },
        "_bbox_2d": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bbox 2D"
        },
        "_region_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Region Type"
        },
        "_page_w": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Page W"
        },
        "_page_h": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Page H"
        }
      },
      "required": [
        "text",
        "text_id",
        "paragraph_id",
        "section_id",
        "page_number"
      ],
      "title": "TextExport",
      "type": "object"
    },
    "TimingsExport": {
      "additionalProperties": false,
      "description": "Per-stage wall-clock seconds (the export stage's own time is excluded \u2014\nit is still running when this is built).\n\nBoth fields are always populated when this object exists: an untimed run\nomits the whole ``extraction.timings`` object rather than emitting one with\nnull fields (``ExportStage._build_extraction`` passes ``None``, which\n``ExtractionExport._omit_absent`` then drops). The ``| None`` types are\nstructural only.",
      "properties": {
        "stages": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "number"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Stages"
        },
        "total_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Total Seconds"
        }
      },
      "title": "TimingsExport",
      "type": "object"
    },
    "UrlExport": {
      "additionalProperties": false,
      "properties": {
        "href": {
          "title": "Href",
          "type": "string"
        },
        "link_text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Link Text"
        },
        "text_id": {
          "title": "Text Id",
          "type": "integer"
        }
      },
      "required": [
        "href",
        "link_text",
        "text_id"
      ],
      "title": "UrlExport",
      "type": "object"
    },
    "UsageExport": {
      "additionalProperties": false,
      "properties": {
        "totals": {
          "$ref": "#/$defs/UsageTotalsExport"
        },
        "breakdown": {
          "items": {
            "$ref": "#/$defs/UsageRowExport"
          },
          "title": "Breakdown",
          "type": "array"
        }
      },
      "required": [
        "totals"
      ],
      "title": "UsageExport",
      "type": "object"
    },
    "UsageRowExport": {
      "additionalProperties": false,
      "description": "One ``(label, provider, model)`` LLM usage row.",
      "properties": {
        "label": {
          "title": "Label",
          "type": "string"
        },
        "provider": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Provider"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Model"
        },
        "calls": {
          "title": "Calls",
          "type": "integer"
        },
        "input_tokens": {
          "title": "Input Tokens",
          "type": "integer"
        },
        "cached_input_tokens": {
          "title": "Cached Input Tokens",
          "type": "integer"
        },
        "output_tokens": {
          "title": "Output Tokens",
          "type": "integer"
        },
        "total_tokens": {
          "title": "Total Tokens",
          "type": "integer"
        }
      },
      "required": [
        "label",
        "calls",
        "input_tokens",
        "cached_input_tokens",
        "output_tokens",
        "total_tokens"
      ],
      "title": "UsageRowExport",
      "type": "object"
    },
    "UsageTotalsExport": {
      "additionalProperties": false,
      "description": "Aggregate of every ``breakdown`` row \u2014 denormalized deliberately.",
      "properties": {
        "calls": {
          "title": "Calls",
          "type": "integer"
        },
        "input_tokens": {
          "title": "Input Tokens",
          "type": "integer"
        },
        "cached_input_tokens": {
          "title": "Cached Input Tokens",
          "type": "integer"
        },
        "output_tokens": {
          "title": "Output Tokens",
          "type": "integer"
        },
        "total_tokens": {
          "title": "Total Tokens",
          "type": "integer"
        }
      },
      "required": [
        "calls",
        "input_tokens",
        "cached_input_tokens",
        "output_tokens",
        "total_tokens"
      ],
      "title": "UsageTotalsExport",
      "type": "object"
    },
    "ValidationExport": {
      "additionalProperties": false,
      "description": "Promotion disposition derived from typed validation issues.",
      "properties": {
        "errors": {
          "title": "Errors",
          "type": "integer"
        },
        "warnings": {
          "title": "Warnings",
          "type": "integer"
        },
        "blocking": {
          "default": 0,
          "title": "Blocking",
          "type": "integer"
        },
        "promotable": {
          "default": true,
          "title": "Promotable",
          "type": "boolean"
        },
        "issues": {
          "items": {
            "$ref": "#/$defs/ValidationIssueExport"
          },
          "title": "Issues",
          "type": "array"
        }
      },
      "required": [
        "errors",
        "warnings",
        "issues"
      ],
      "title": "ValidationExport",
      "type": "object"
    },
    "ValidationIssueExport": {
      "additionalProperties": false,
      "description": "JSON-safe representation of a shared pipeline validation issue.",
      "properties": {
        "code": {
          "title": "Code",
          "type": "string"
        },
        "severity": {
          "title": "Severity",
          "type": "string"
        },
        "message": {
          "title": "Message",
          "type": "string"
        },
        "origin_stage": {
          "default": "export",
          "title": "Origin Stage",
          "type": "string"
        },
        "evidence_ids": {
          "items": {
            "type": "string"
          },
          "title": "Evidence Ids",
          "type": "array"
        },
        "count": {
          "title": "Count",
          "type": "integer"
        },
        "blocking": {
          "default": false,
          "title": "Blocking",
          "type": "boolean"
        }
      },
      "required": [
        "code",
        "severity",
        "message",
        "count"
      ],
      "title": "ValidationIssueExport",
      "type": "object"
    },
    "XrefExport": {
      "additionalProperties": false,
      "properties": {
        "target_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Target Id"
        },
        "xref_type": {
          "enum": [
            "bib",
            "table",
            "figure",
            "foot",
            "supplementary",
            "equation",
            "section"
          ],
          "title": "Xref Type",
          "type": "string"
        },
        "contents": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Contents"
        },
        "text_id": {
          "title": "Text Id",
          "type": "integer"
        },
        "tier": {
          "anyOf": [
            {
              "enum": [
                "numeric",
                "paren-numeric",
                "flattened-superscript",
                "author-year",
                "llm"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tier"
        }
      },
      "required": [
        "target_id",
        "xref_type",
        "contents",
        "text_id"
      ],
      "title": "XrefExport",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Pydantic model for the bibr v11.0 JSON export schema.\n\nv11 is a clean break: no v10 payload validates against this model, and none\nis meant to. Readers dispatch on the presence of the root ``schema_version``.",
  "properties": {
    "paper_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Paper identifier: user-supplied --paper-id, else the DOI, else the source file name.",
      "title": "Paper Id"
    },
    "schema_version": {
      "const": "11.0",
      "description": "Export schema version. Its presence at the root is how readers distinguish v11 from all earlier versions.",
      "title": "Schema Version",
      "type": "string"
    },
    "source": {
      "$ref": "#/$defs/SourceExport",
      "description": "Identity of the input artifact: file name, content hash, and format."
    },
    "metadata": {
      "$ref": "#/$defs/MetadataExport",
      "description": "Scalar paper-level metadata: title, abstract, keywords, DOI, paper-type and OECD classification, the paper's own journal/venue identity, and research-integrity statement text."
    },
    "author": {
      "description": "Extracted authors, with name, affiliation, email, corresponding-author flag, ORCID, and contribution roles.",
      "items": {
        "$ref": "#/$defs/AuthorExport"
      },
      "title": "Author",
      "type": "array"
    },
    "text": {
      "description": "Full body text as an ordered array of sentence-level spans, each linked to its paragraph, section, and page.",
      "items": {
        "$ref": "#/$defs/TextExport"
      },
      "title": "Text",
      "type": "array"
    },
    "section": {
      "description": "Document section headers with hierarchy (level, parent) and IMRaD classification.",
      "items": {
        "$ref": "#/$defs/SectionExport"
      },
      "title": "Section",
      "type": "array"
    },
    "url": {
      "description": "Hyperlinks found in the body text, with their link text and source sentence.",
      "items": {
        "$ref": "#/$defs/UrlExport"
      },
      "title": "Url",
      "type": "array"
    },
    "bib": {
      "description": "Parsed bibliography entries, verbatim from the printed reference list \u2014 never backfilled from external enrichment.",
      "items": {
        "$ref": "#/$defs/BibExport"
      },
      "title": "Bib",
      "type": "array"
    },
    "xref": {
      "description": "In-text citation/cross-reference markers linking a sentence to a bibliography entry, table, figure, footnote, equation, or section.",
      "items": {
        "$ref": "#/$defs/XrefExport"
      },
      "title": "Xref",
      "type": "array"
    },
    "figure": {
      "description": "Extracted figures with caption, page number, and (optionally) base64-encoded image data.",
      "items": {
        "$ref": "#/$defs/FigureExport"
      },
      "title": "Figure",
      "type": "array"
    },
    "table": {
      "description": "Extracted tables with HTML markup, structured cell contents, caption, and page number.",
      "items": {
        "$ref": "#/$defs/TableExport"
      },
      "title": "Table",
      "type": "array"
    },
    "eq": {
      "description": "Parsed statistical/mathematical expressions split into left-hand side, degrees of freedom, comparator, and right-hand side.",
      "items": {
        "$ref": "#/$defs/EqExport"
      },
      "title": "Eq",
      "type": "array"
    },
    "bib_match": {
      "default": [],
      "description": "Flattened enrichment matches (e.g. Crossref) for bibliography entries, one row per external-service hit.",
      "items": {
        "$ref": "#/$defs/BibMatchExport"
      },
      "title": "Bib Match",
      "type": "array"
    },
    "metadata_match": {
      "default": [],
      "description": "Enrichment matches for the paper's own bibliographic identity (self-DOI lookup), shaped like bib_match minus bib_id.",
      "items": {
        "$ref": "#/$defs/MetadataMatchExport"
      },
      "title": "Metadata Match",
      "type": "array"
    },
    "funding": {
      "default": [],
      "description": "Structured funder names and award IDs parsed from the funding statement.",
      "items": {
        "$ref": "#/$defs/FundingExport"
      },
      "title": "Funding",
      "type": "array"
    },
    "affiliation": {
      "default": [],
      "description": "Structured author affiliations parsed from the byline: verbatim text plus best-effort institution/department/city/country and linked author IDs.",
      "items": {
        "$ref": "#/$defs/AffiliationExport"
      },
      "title": "Affiliation",
      "type": "array"
    },
    "qualification_provenance": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Deployment-qualification provenance: identity SHAs, per-task protocol hashes, native-validity + fallback outcome, and request counts. Always present; null (never omitted) when no LLM ran or usage tracking is disabled.",
      "title": "Qualification Provenance"
    },
    "extraction": {
      "anyOf": [
        {
          "$ref": "#/$defs/ExtractionExport"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Extraction provenance: how this output was produced \u2014 engines, per-run settings, timings, LLM usage, enrichment, identity receipts, diagnostics and warnings; omitted when exported outside the pipeline."
    },
    "validation": {
      "anyOf": [
        {
          "$ref": "#/$defs/ValidationExport"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Output validation gate result: counts of errors/warnings and the structured issue list; absent when the gate was skipped."
    }
  },
  "required": [
    "paper_id",
    "schema_version",
    "source",
    "metadata",
    "author",
    "text",
    "section",
    "url",
    "bib",
    "xref",
    "figure",
    "table",
    "eq",
    "bib_match",
    "metadata_match",
    "funding",
    "affiliation",
    "qualification_provenance"
  ],
  "title": "PaperExport",
  "type": "object"
}
