# HTML Quality Probe

These checks are diagnostic and non-gating. A `needs-review` status means the generated artifacts found a likely conversion-quality issue, not that artifact generation failed.

- Status: `needs-review`
- Source PDF: [../source.pdf](../source.pdf)
- Generated HTML: [../semantic-continuous/index.html](../semantic-continuous/index.html)
- Sample notes: Multi-page federal tax form with boxed fields, instructions, and dense vector line work. Categories: government-form, forms, vector-heavy. Canonical source: https://www.irs.gov/forms-pubs/about-form-w-9
- Text reference: `pdfbox-net-run-fallback`
- Pages analyzed: 6

## Page Summary

| Page | Status | Source words | HTML words | Token coverage | Long HTML tokens | Foreground delta | Severe color delta | Text/object overlaps |
| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| 1 | `needs-review` | 946 | 1044 | 0.999 | 0 | 0.055 | 0.008 | 5 |
| 2 | `needs-review` | 1409 | 1394 | 0.989 | 0 | 0.018 | 1 | 0 |
| 3 | `needs-review` | 1339 | 1339 | 1 | 0 | 0.05 | 1 | 0 |
| 4 | `needs-review` | 1289 | 1289 | 1 | 0 | 0.061 | 1 | 0 |
| 5 | `needs-review` | 1010 | 1004 | 0.993 | 0 | 0.005 | 0.5 | 0 |
| 6 | `needs-review` | 512 | 506 | 0.988 | 0 | 0.005 |  | 0 |

## Issue Categories

| Category | Status | Evidence |
| --- | --- | --- |
| Text reconstruction and word boundaries | `passed` | All analyzed pages passed; lowest token coverage is 0.988 on page 6. |
| Page geometry and text-run structure | `needs-review` | 5 page dimension check(s) and 6 text-run count check(s) need review; max run-count delta is 191. |
| Text wrapping around images and vector objects | `needs-review` | 0 text/image overlap(s) and 5 text/vector overlap(s) were found. |
| Visual foreground parity | `needs-review` | Max foreground delta is 0.061; max source-only foreground ratio is 0.447; max HTML-only foreground ratio is 0.395. |
| Visual color parity | `needs-review` | Max mean CIE Lab color delta is 53.167; max severe color-delta ratio is 1; minimum compared page-pixel ratio is 0. |
| Source fixture expectations (manual review) | `needs-review` | Captured 7 source-authored acceptance statement(s) across 4 page(s); compare them with the visual evidence before treating the fixture as passed. |
| Probe setup and tool availability | `passed` | The browser probe and available renderers ran. |

## Fixture Expectations

These source-authored statements describe the intended appearance and make the corresponding visual diffs easier to interpret.

- Page 2:
  - • Form 1099-C (canceled debt).1. The treaty country. Generally, this must be the same treaty under
- Page 3:
  - blank. The name should match the name on your tax return.
  - documents on line 1. This name should match the name shown on the
  - be a disregarded entity. The name on line 1 should be the name shown requirements of section 401(f)(2).
  - on the income tax return on which the income should be reported. For
- Page 4:
  - code should be completed.
- Page 5:
  - must be furnished.

## Current Limitations

- Continuous semantic HTML is evaluated as reflowed content; it may not preserve the original PDF page height, per-glyph run count, or exact page-local geometry.
- Large vector overlays are not semantically attached to nearby content; review whether these are decorative backgrounds, table rules, clipping masks, or true text/object collisions.
- The visual probe compared at least one page using only the overlapping crop because renderer/browser pixel dimensions differed beyond the probe tolerance.
- Perceptual color differences exceed the severe-corruption threshold on at least one page; inspect the color heatmap for incorrect fills, opacity, blending, or color-space conversion.
- The HTML contains additional foreground pixels compared with the PDF render on at least one page, which often means duplicated glyphs, fallback text, or unmodeled object masks.

## Findings

- Page 1, `text-run-count`: The browser DOM contains 152 text runs, but the extracted layout contains 158.
- Page 1, `text-vector-overlap`: 5 text run(s) overlap large rendered vector boxes.
- Page 2, `page-dimensions`: Browser page dimensions differ from the PDF page dimensions.
- Page 2, `text-run-count`: The browser DOM contains 26 text runs, but the extracted layout contains 217.
- Page 2, `visual-foreground-mask`: PDF render and browser page screenshot have different pixel dimensions; foreground masks were compared across the overlapping region only.
- Page 2, `visual-color-difference`: PDF render and browser page screenshot have different pixel dimensions; color was compared across stable foreground interiors in the overlapping region only.
- Page 3, `page-dimensions`: Browser page dimensions differ from the PDF page dimensions.
- Page 3, `text-run-count`: The browser DOM contains 34 text runs, but the extracted layout contains 190.
- Page 3, `visual-foreground-mask`: PDF render and browser page screenshot have different pixel dimensions; foreground masks were compared across the overlapping region only.
- Page 3, `visual-color-difference`: PDF render and browser page screenshot have different pixel dimensions; color was compared across stable foreground interiors in the overlapping region only.
- Page 4, `page-dimensions`: Browser page dimensions differ from the PDF page dimensions.
- Page 4, `text-run-count`: The browser DOM contains 46 text runs, but the extracted layout contains 198.
- Page 4, `visual-foreground-mask`: PDF render and browser page screenshot have different pixel dimensions; foreground masks were compared across the overlapping region only.
- Page 4, `visual-color-difference`: PDF render and browser page screenshot have different pixel dimensions; color was compared across stable foreground interiors in the overlapping region only.
- Page 5, `page-dimensions`: Browser page dimensions differ from the PDF page dimensions.
- Page 5, `text-run-count`: The browser DOM contains 24 text runs, but the extracted layout contains 201.
- Page 5, `visual-foreground-mask`: PDF render and browser page screenshot have different pixel dimensions; foreground masks were compared across the overlapping region only.
- Page 5, `visual-color-difference`: PDF render and browser page screenshot have different pixel dimensions; color was compared across stable foreground interiors in the overlapping region only.
- Page 6, `page-dimensions`: Browser page dimensions differ from the PDF page dimensions.
- Page 6, `text-run-count`: The browser DOM contains 9 text runs, but the extracted layout contains 72.
- Page 6, `visual-foreground-mask`: PDF render and browser page screenshot have different pixel dimensions; foreground masks were compared across the overlapping region only.

## Artifacts

- [page-1-html.png](page-1-html.png)
- [page-1-source.png](page-1-source.png)
- [page-1-diff.png](page-1-diff.png)
- [page-1-color-heatmap.png](page-1-color-heatmap.png)
- [page-1-visual-report.html](page-1-visual-report.html)
- [page-2-html.png](page-2-html.png)
- [page-2-source.png](page-2-source.png)
- [page-2-diff.png](page-2-diff.png)
- [page-2-color-heatmap.png](page-2-color-heatmap.png)
- [page-2-visual-report.html](page-2-visual-report.html)
- [page-3-html.png](page-3-html.png)
- [page-3-source.png](page-3-source.png)
- [page-3-diff.png](page-3-diff.png)
- [page-3-color-heatmap.png](page-3-color-heatmap.png)
- [page-3-visual-report.html](page-3-visual-report.html)
- [page-4-html.png](page-4-html.png)
- [page-4-source.png](page-4-source.png)
- [page-4-diff.png](page-4-diff.png)
- [page-4-color-heatmap.png](page-4-color-heatmap.png)
- [page-4-visual-report.html](page-4-visual-report.html)
- [page-5-html.png](page-5-html.png)
- [page-5-source.png](page-5-source.png)
- [page-5-diff.png](page-5-diff.png)
- [page-5-color-heatmap.png](page-5-color-heatmap.png)
- [page-5-visual-report.html](page-5-visual-report.html)
- [page-6-html.png](page-6-html.png)
- [page-6-source.png](page-6-source.png)
- [page-6-diff.png](page-6-diff.png)
- [page-6-visual-report.html](page-6-visual-report.html)
