Reconciling Native, Image, and Text Parity in Mixed-Format Productions

Parity failures — a document whose image page count, extracted text, and native file do not agree — are the quiet defects that pass a superficial export check and surface only when the receiving party imports the volume. Inside the Production Validation & QC stage, a parity check asserts that every produced document carries exactly the artifacts its disposition requires and that those artifacts describe the same document: a five-page spreadsheet imaged to five TIFFs must have five image references, a non-empty text file, and — unless it was redacted — its native. When they disagree, the load file binds mismatched pieces together, and a reviewer opens page one of one document beside the text of another. This guide isolates why parity drifts in mixed-format productions and delivers a per-document reconciliation that fails closed on any mismatch.

Diagnostic Log Signatures

The validator flags parity defects per document. Capture the block verbatim — the counts that disagree tell you which artifact is wrong.

text
[INFO] Parity scan volume PROD012 : 96011 documents
[ERROR] parity_mismatch DOC-050318: image_pages=1 native_pages=14 (spreadsheet imaged as single page)
[ERROR] missing_text DOC-050902: image_pages=8 text_bytes=0 (empty extraction)
[ERROR] redacted_native_leak DOC-051115: redacted=true native_path=DOC-051115.xlsx
[WARN] slipsheet_without_reason DOC-051540: image=placeholder reason_code=None
[CRITICAL] Volume PROD012 not sealed: 4 parity defects

Symptom checklist — two or more of these indicate a genuine parity failure:

  • A document’s image page count differs from the page count implied by its native (a 14-tab workbook imaged to a single page).
  • A produced, non-slip-sheet document has a zero-byte or missing extracted-text file.
  • A document tagged redacted still references a native file in its manifest row.
  • A placeholder (slip-sheet) image has no reason code explaining why the document was not imaged.
  • The counts are stable across re-runs — the mismatch is deterministic, pointing at a rendering or extraction rule, not a transient error.

Root-Cause Breakdown

Parity drift in mixed-format collections has three recurring causes.

  1. Format-blind rendering. Spreadsheets, presentations, and CAD files do not have a natural one-page image. A renderer that treats every document as “print to one image” collapses a 14-tab workbook to a single page, so the image page count no longer matches the native’s logical extent. The routing table from ESI format mapping standards has to drive format-specific pagination — print each worksheet, expand hidden rows/columns per the production protocol — or image and native will always disagree for structured formats.
  2. Silent extraction failure. Text extraction that swallows an exception writes an empty file instead of failing. A password-protected PDF, an image-only scan with no OCR pass, or a corrupt container yields zero bytes, and a parity check that only asserts “a text file exists” passes it. The correct assertion is that a produced document’s text is non-empty or the document is explicitly flagged as legitimately text-free (a pure image with OCR disabled by protocol), with the reason recorded.
  3. Redaction and native coupling. A redacted document must be produced as an image with its native withheld, because the native still contains the unredacted content. When the production loop copies the native for every document uniformly, redacted documents leak their native — the single most serious parity defect because it discloses exactly what the redaction was meant to protect. This is the boundary redaction automation is responsible for, and QC is the backstop that catches a regression in it.

Remediation Architecture

Reconcile each document against a disposition-aware parity contract, and fail closed when any leg of the contract is unmet.

  1. Derive expected artifacts from disposition and format. For each document, compute the required artifact set: image (always, for produced items), text (unless protocol-exempt), native (only if not redacted and the protocol produces natives for that format).
  2. Validate counts, not just presence. Assert the image page count matches the format-specific expected pagination, and that the text is non-empty for text-bearing formats.
  3. Enforce the redaction-native exclusion first. Check the redacted-native rule before anything else, because it is the highest-severity defect; a single leak fails the volume regardless of other checks.

Per-document parity implementation

The routine below encodes the parity contract as a pure function of disposition, format, and the artifacts actually on disk. It compiles and runs, and every failure returns a structured defect rather than a bare boolean.

python
from dataclasses import dataclass, field
from pathlib import Path
from typing import List, Optional

# Formats whose logical page count is not 1-per-file; pagination is format-driven.
STRUCTURED_FORMATS = {"xlsx", "xls", "csv", "pptx", "ppt"}
# Protocol may legitimately produce no extractable text for these.
TEXT_EXEMPT_FORMATS = {"tiff", "jpg", "png", "gif"}


@dataclass
class ParityDefect:
    doc_id: str
    kind: str
    detail: str


@dataclass
class ProducedDoc:
    doc_id: str
    ext: str
    redacted: bool
    is_slipsheet: bool
    reason_code: Optional[str]
    image_pages: int
    expected_pages: int          # format-aware, from the render manifest
    text_path: Optional[Path]
    native_path: Optional[Path]


def check_document_parity(doc: ProducedDoc) -> List[ParityDefect]:
    defects: List[ParityDefect] = []

    # 1. Highest-severity check first: a redacted document must not ship a native.
    if doc.redacted and doc.native_path is not None:
        defects.append(ParityDefect(doc.doc_id, "redacted_native_leak",
                                    f"native present: {doc.native_path}"))

    # 2. Slip-sheets must carry a reason code explaining the non-image.
    if doc.is_slipsheet:
        if not doc.reason_code:
            defects.append(ParityDefect(doc.doc_id, "slipsheet_without_reason",
                                        "placeholder image with no reason_code"))
        return defects  # a slip-sheet has no image/text/native expectations

    # 3. Image pagination must match the format-aware expectation.
    if doc.image_pages != doc.expected_pages:
        defects.append(ParityDefect(doc.doc_id, "image_page_mismatch",
                                    f"image_pages={doc.image_pages} expected={doc.expected_pages}"))

    # 4. Text must be non-empty unless the format is protocol-exempt.
    text_bytes = doc.text_path.stat().st_size if doc.text_path and doc.text_path.exists() else 0
    if text_bytes == 0 and doc.ext.lower() not in TEXT_EXEMPT_FORMATS:
        defects.append(ParityDefect(doc.doc_id, "missing_text",
                                    f"text_bytes=0 for text-bearing .{doc.ext}"))

    return defects


def validate_parity(docs: List[ProducedDoc]) -> List[ParityDefect]:
    """Fail closed: collect every defect across the set; empty means parity holds."""
    out: List[ParityDefect] = []
    for d in docs:
        out.extend(check_document_parity(d))
    return out

Verification Checklist

Confirm parity before the volume seals:

Conclusion

Native-image-text parity is what keeps a load file’s bindings honest: the image, the text, and the native each have to describe the same document at the same extent. Drift comes from format-blind rendering, silently swallowed extraction errors, and uniform native copying that leaks redacted content. Encode parity as a disposition-and-format-aware contract, check the redacted-native exclusion first because it is the most damaging, validate counts rather than mere presence, and fail closed on any mismatch. The production is defensible when every produced document can be shown to carry exactly the artifacts its disposition requires — no leaked native, no empty text, no collapsed pagination.

Frequently Asked Questions

Why does a spreadsheet fail image-page parity so often?

Because a spreadsheet has no natural single-page image. A workbook with fourteen worksheets, hidden columns, and print areas can render to anywhere from one to dozens of pages depending on the rendering rules. If the renderer prints “one page per file” it collapses the workbook and the image no longer represents the native’s extent. Format-specific pagination — driven by the production protocol and the format mapping table — is what makes structured formats produce a defensible image set.

Is an empty text file always a defect?

No. Some documents legitimately have no extractable text — a photograph, a scanned image with OCR disabled by the protocol, or a pure-binary technical file. The defect is an unexplained empty text file for a text-bearing format. The parity contract distinguishes the two by flagging text-free formats as protocol-exempt with a recorded reason, so a genuine empty extraction on a Word document fails while a photograph passes.

What makes a leaked native the most serious parity defect?

Because it defeats the redaction entirely. A redacted document is produced as an image precisely so the protected content is rasterized away; the native still contains that content in full. Shipping the native alongside the redacted image hands the receiving party exactly what the redaction was meant to withhold. That is why the parity check evaluates the redacted-native exclusion first and fails the whole volume on a single occurrence.

For production-form guidance, see the EDRM production standards and The Sedona Principles on form of production.

Up one level: Production Validation & QC — the stage that certifies artifact consistency before delivery.