{
  "schemaVersion": 2,
  "caseId": "OCR-A01",
  "caseVersion": "1.1.0",
  "purpose": "Comparar dos PDF de apariencia nominal equivalente: uno con texto real y otro compuesto únicamente por una imagen.",
  "scope": "Caso sintético. No ejecuta OCR, no mide precisión OCR y no anticipa resultados funcionales.",
  "generator": {
    "file": "scripts/generate-ocr-a01-case.mjs",
    "version": "1.1.0",
    "deterministic": true,
    "networkRequired": false,
    "systemFontsRequired": false
  },
  "targetRuntime": {
    "pdfjs": "6.1.200",
    "docx": "9.7.1",
    "routes": [
      "/visor-pdf",
      "/pdf-a-word"
    ]
  },
  "dimensions": {
    "pagePoints": [
      612,
      792
    ],
    "sourceImagePixels": [
      1224,
      1584
    ],
    "nominalDpi": 144,
    "imageColor": "RGB 8-bit without alpha"
  },
  "artifacts": {
    "truth": {
      "file": "ocr-a01-verdad.txt",
      "mediaType": "text/plain; charset=utf-8",
      "bytes": 527,
      "sha256": "40d0ff01c6fe744421fce282eeec3e8aa27d29294f230f7f8ffbadb44b6fd377",
      "lineEnding": "LF"
    },
    "sourceImage": {
      "file": "ocr-a01-pagina.png",
      "mediaType": "image/png",
      "bytes": 12781,
      "sha256": "1a1f3c5d426995421877307176d8ec11dcca789cdbb66f493192bc15e88e2456",
      "width": 1224,
      "height": 1584,
      "colorType": 2,
      "bitDepth": 8
    },
    "textPdf": {
      "file": "ocr-a01-texto.pdf",
      "mediaType": "application/pdf",
      "bytes": 23064,
      "sha256": "b210bef23e691dd208b8cb56be3025b19f407fc87fef9cc4441991ef02bffa21",
      "pages": 1,
      "mediaBox": [
        0,
        0,
        612,
        792
      ]
    },
    "imagePdf": {
      "file": "ocr-a01-imagen.pdf",
      "mediaType": "application/pdf",
      "bytes": 11178,
      "sha256": "649b96bd9cc875bd3c36e9d582b9dbd4434a3f61be23eac4606d7785d4244d68",
      "pages": 1,
      "mediaBox": [
        0,
        0,
        612,
        792
      ]
    }
  },
  "scene": {
    "coordinateSystem": "PDF points; origin at bottom-left",
    "text": [
      {
        "id": "title",
        "text": "FACTURA OCR-A01",
        "x": 60,
        "y": 704,
        "size": 20
      },
      {
        "id": "notice",
        "text": "CASO SINTETICO SIN DATOS REALES",
        "x": 60,
        "y": 672,
        "size": 10
      },
      {
        "id": "date",
        "text": "FECHA: 2026-01-15",
        "x": 60,
        "y": 636,
        "size": 10
      },
      {
        "id": "controls",
        "text": "CONTROL: O0 I1 l1",
        "x": 60,
        "y": 612,
        "size": 10
      },
      {
        "id": "accents-upper",
        "text": "ACENTOS: Á É Í Ó Ú Ñ Ü",
        "x": 60,
        "y": 588,
        "size": 10
      },
      {
        "id": "accents-lower",
        "text": "PRUEBA: á é í ó ú ñ ü",
        "x": 60,
        "y": 564,
        "size": 10
      },
      {
        "id": "header-concept",
        "text": "CONCEPTO",
        "x": 72,
        "y": 510,
        "size": 10
      },
      {
        "id": "header-quantity",
        "text": "CANTIDAD",
        "x": 330,
        "y": 510,
        "size": 10
      },
      {
        "id": "header-value",
        "text": "VALOR USD",
        "x": 438,
        "y": 510,
        "size": 10
      },
      {
        "id": "row-1-concept",
        "text": "CUADERNO",
        "x": 72,
        "y": 466,
        "size": 10
      },
      {
        "id": "row-1-quantity",
        "text": "3",
        "x": 354,
        "y": 466,
        "size": 10
      },
      {
        "id": "row-1-value",
        "text": "7.50",
        "x": 468,
        "y": 466,
        "size": 10
      },
      {
        "id": "row-2-concept",
        "text": "BOLIGRAFO",
        "x": 72,
        "y": 422,
        "size": 10
      },
      {
        "id": "row-2-quantity",
        "text": "2",
        "x": 354,
        "y": 422,
        "size": 10
      },
      {
        "id": "row-2-value",
        "text": "3.00",
        "x": 468,
        "y": 422,
        "size": 10
      },
      {
        "id": "subtotal",
        "text": "SUBTOTAL: 10.50",
        "x": 360,
        "y": 342,
        "size": 10
      },
      {
        "id": "tax",
        "text": "IMPUESTO: 1.26",
        "x": 360,
        "y": 318,
        "size": 10
      },
      {
        "id": "total",
        "text": "TOTAL: 11.76",
        "x": 360,
        "y": 286,
        "size": 10
      },
      {
        "id": "footer",
        "text": "OCR-A01 / FUENTE SINTETICA DETERMINISTA",
        "x": 60,
        "y": 72,
        "size": 10
      }
    ],
    "rectangles": [
      {
        "id": "title-rule",
        "x": 60,
        "y": 690,
        "width": 492,
        "height": 2,
        "color": [
          31,
          82,
          176
        ]
      },
      {
        "id": "table-top",
        "x": 60,
        "y": 536,
        "width": 492,
        "height": 2,
        "color": [
          30,
          41,
          59
        ]
      },
      {
        "id": "table-row-1",
        "x": 60,
        "y": 492,
        "width": 492,
        "height": 1,
        "color": [
          82,
          96,
          120
        ]
      },
      {
        "id": "table-row-2",
        "x": 60,
        "y": 448,
        "width": 492,
        "height": 1,
        "color": [
          82,
          96,
          120
        ]
      },
      {
        "id": "table-bottom",
        "x": 60,
        "y": 404,
        "width": 492,
        "height": 2,
        "color": [
          30,
          41,
          59
        ]
      },
      {
        "id": "table-left",
        "x": 60,
        "y": 404,
        "width": 2,
        "height": 134,
        "color": [
          30,
          41,
          59
        ]
      },
      {
        "id": "table-col-1",
        "x": 312,
        "y": 404,
        "width": 1,
        "height": 134,
        "color": [
          82,
          96,
          120
        ]
      },
      {
        "id": "table-col-2",
        "x": 420,
        "y": 404,
        "width": 1,
        "height": 134,
        "color": [
          82,
          96,
          120
        ]
      },
      {
        "id": "table-right",
        "x": 550,
        "y": 404,
        "width": 2,
        "height": 134,
        "color": [
          30,
          41,
          59
        ]
      },
      {
        "id": "total-rule",
        "x": 360,
        "y": 274,
        "width": 192,
        "height": 2,
        "color": [
          31,
          82,
          176
        ]
      }
    ]
  },
  "expectedInvariants": {
    "textPdf": {
      "pages": 1,
      "embeddedFontSubtype": "Type3",
      "toUnicode": true,
      "realTextOperators": true,
      "imageXObjects": 0
    },
    "imagePdf": {
      "pages": 1,
      "imageXObjects": 1,
      "fonts": 0,
      "toUnicode": false,
      "textOperators": false,
      "actualText": false,
      "annotations": false,
      "forms": false,
      "textualMetadata": false
    }
  },
  "expectedChecks": [
    "PDF.js 6.1.200 debería extraer la capa Unicode del PDF textual.",
    "PDF.js 6.1.200 debería producir cero elementos de texto para el PDF solo imagen.",
    "La selección y búsqueda dependen del lector PDF integrado y requieren comprobación posterior.",
    "PDF a Word debería convertir el PDF textual y rechazar el PDF solo imagen sin producir un DOCX obsoleto."
  ],
  "observedResults": {
    "status": "verified",
    "provenance": {
      "structuralAudit": {
        "status": "verified",
        "runId": "etapa2-20261116",
        "report": "docs/auditoria-fase4c12-lote3b-etapa2.md"
      },
      "functionalRun": {
        "status": "verified",
        "runId": "etapa3-20261116T-etapa3-final",
        "report": "docs/implementacion-fase4c12-lote3b-etapa3.md"
      },
      "independentAudit": {
        "status": "verified",
        "runId": "etapa3-20261116T-etapa3-audit-independent",
        "report": "docs/auditoria-fase4c12-lote3b-etapa3.md"
      }
    },
    "environment": {
      "status": "verified",
      "playwright": "1.64.1",
      "pdfjs": "6.1.200",
      "docx": "9.7.1",
      "browsers": [
        {
          "name": "Chromium",
          "version": "156.0.8078.4"
        },
        {
          "name": "Edge",
          "version": "157.0.4341.60"
        },
        {
          "name": "Brave",
          "version": "157.0.8103.79"
        }
      ]
    },
    "structural": {
      "status": "verified",
      "textPdf": {
        "status": "verified",
        "pages": 1,
        "fontSubtype": "Type3",
        "charProcs": 46,
        "toUnicode": true,
        "textOperatorsTj": 19,
        "imageXObjects": 0,
        "pdfjsRawItems": 26,
        "pdfjsSignificantItems": 19,
        "pdfjsRawCharacters": 261,
        "pdfjsNormalizedCharacters": 255,
        "expectedSceneElementsMatched": 19
      },
      "imagePdf": {
        "status": "verified",
        "pages": 1,
        "imageXObjects": 1,
        "imagePixels": [
          1224,
          1584
        ],
        "colorSpace": "DeviceRGB",
        "bitsPerComponent": 8,
        "fonts": 0,
        "textOperators": 0,
        "toUnicode": false,
        "actualText": false,
        "annotations": false,
        "forms": false,
        "textualMetadata": false,
        "pdfjsTextItems": 0,
        "pdfjsCharacters": 0,
        "decodedPixelBytes": 5816448,
        "decodedPixelSha256": "27581d4955b735a4750b60c62285aef8b1b261161506ad873e0c72b77605e586"
      }
    },
    "visualComparison": {
      "status": "verified",
      "renderer": "PDF.js 6.1.200 on Chromium 156.0.8078.4",
      "renderPixels": [
        1224,
        1584
      ],
      "totalPixels": 1938816,
      "differentPixels": 0,
      "differentPercent": 0,
      "meanAbsoluteErrorPerChannel": 0,
      "maximumChannelDifference": 0,
      "differenceBoundingBox": null,
      "renderSha256": "c706ffe0919a984184ab7bf1f2b3ce2c5d0dd687e2693653f3bb83bc8e8929af"
    },
    "viewer": {
      "status": "verified",
      "routes": [
        "/visor-pdf"
      ],
      "browsers": [
        {
          "name": "Chromium",
          "version": "156.0.8078.4"
        },
        {
          "name": "Edge",
          "version": "157.0.4341.60"
        },
        {
          "name": "Brave",
          "version": "157.0.8103.79"
        }
      ],
      "pageCount": 1,
      "pagePoints": [
        612,
        792
      ],
      "orientation": "portrait",
      "replacement": "verified",
      "clear": "verified",
      "cancellation": "verified",
      "nativeReader": {
        "search": {
          "status": "not-supported",
          "browsers": [
            "Chromium",
            "Edge",
            "Brave"
          ],
          "reason": "Playwright no expone una señal DOM verificable dentro del lector PDF nativo privilegiado."
        },
        "selectionAndCopy": {
          "status": "not-supported",
          "browsers": [
            "Chromium",
            "Edge",
            "Brave"
          ],
          "reason": "La selección y el portapapeles del lector PDF nativo no son observables de forma fiable mediante Playwright."
        },
        "manualProtocol": [
          "Cargar el PDF textual en cada navegador.",
          "Buscar OCR-A01 con Ctrl+F y capturar la coincidencia visible.",
          "Seleccionar FACTURA OCR-A01, copiar y pegar en un editor plano.",
          "Repetir con el PDF solo imagen y documentar la ausencia de capa seleccionable."
        ]
      }
    },
    "pdfToWord": {
      "status": "verified",
      "textualPdf": {
        "status": "verified",
        "resultSummary": "1 página · 261 caracteres · 8.7 KB",
        "downloadedInBrowsers": [
          "Chromium",
          "Edge",
          "Brave"
        ],
        "auditedDocxFiles": 6,
        "zipEntriesPerFile": 22,
        "documentXmlBytes": 5485,
        "documentXmlSha256": "ff80d42b0c9a06b2273160280811f26156fea13c767e588d77de0d1f85370e9a",
        "paragraphs": 13,
        "textNodes": 13,
        "pageBreaks": 0,
        "missingCriticalFields": 0,
        "semanticVariants": 1,
        "unicodeAndReadingOrderPreserved": true
      },
      "imagePdf": {
        "status": "verified",
        "acceptedAsPdf": true,
        "extractedCharacters": 0,
        "rejectedForConversion": true,
        "needsOcrMessage": true,
        "docxProduced": false,
        "staleResultRetained": false
      }
    },
    "privacy": {
      "status": "verified",
      "syntheticCorpus": true,
      "externalRequestBodies": 0,
      "urlOrQueryLeaks": 0,
      "firstPartyFailures": 0,
      "documentUploads": 0
    },
    "regressions": {
      "status": "verified",
      "deterministicCase": "110/110",
      "e2eBrowsers": "3/3",
      "viewerPhase4c10": "28/28",
      "pdfToWordFixture": "3/3",
      "pdfToWordLoader": "14/14",
      "npmTest": "verified",
      "npmCheck": "verified",
      "gitDiffCheck": "verified"
    },
    "ocr": {
      "status": "not-tested",
      "implemented": false,
      "executed": false,
      "measured": false,
      "note": "OCR-A01 compara capa textual y ausencia de capa textual; no incorpora ni evalúa un motor OCR."
    },
    "findings": {
      "p0": [],
      "p1": [],
      "p2": [],
      "p3": [
        {
          "status": "limitation",
          "area": "auxiliary-extractor",
          "note": "pypdf 7.1.0 sustituye acentos Type 3 por U+FFFD; PDF.js 6.1.200 y Poppler los preservan."
        },
        {
          "status": "limitation",
          "area": "native-pdf-reader",
          "note": "La búsqueda, selección y copia no son observables de forma fiable mediante Playwright."
        },
        {
          "status": "limitation",
          "area": "evidence-timing",
          "note": "Algunas capturas del rechazo solo imagen preceden al cierre asíncrono; el estado final limpio fue verificado."
        }
      ]
    }
  },
  "privacy": {
    "classification": "synthetic-test-data",
    "containsPersonalData": false
  },
  "limitations": [
    "La equivalencia visual exacta se verificó para OCR-A01 en Chromium 156.0.8078.4 con PDF.js 6.1.200; no generaliza a otros fixtures o versiones.",
    "Este caso no incorpora ni evalúa un motor OCR.",
    "La búsqueda y selección en lectores PDF nativos no fue observable de forma fiable mediante Playwright y requiere el protocolo manual documentado.",
    "pypdf 7.1.0 sustituye los acentos Type 3 por U+FFFD; PDF.js 6.1.200 y Poppler preservan el Unicode y son la autoridad para este fixture.",
    "Los resultados se congelan desde las evidencias auditadas de las etapas 2 y 3; el generador no reejecuta ni infiere pruebas."
  ]
}
