PDF QA
Act as a gatekeeper. Never certify visual quality from PDF metadata, text extraction, OCR, or successful rendering alone.
Enforce the visual loop: Generate -> Render -> Inspect -> Fix -> Re-render.
Workflow
- Preserve the editable source and identify its relationship to the PDF. If the source is unavailable, record that limitation instead of inventing one.
- Run
scripts/preflight.pyto verify that Poppler providespdfinfoand at least one ofpdftocairoorpdftoppm. - Run
scripts/render-pages.py --input <file.pdf> --output-dir <qa-dir> --source-ref <editable-source>; use 180 DPI unless the artifact needs closer inspection. - Inspect every emitted page PNG visually. Use
view_imagewhen available. Read references/qa-checklist.md for the checks and inspection record shape. - Create one
pdf-qa.inspection/v1JSON record covering every rendered page and every required check. Record the rendered image SHA-256 so stale evidence cannot pass. - Run
scripts/record-inspection.py --manifest <qa-manifest.json> --inspection <inspection.json> --output <qa-final.json>. - If the final status is
revise, return the issues to the source-producing skill, regenerate the PDF, and repeat from step 2. Never patch the rendered PNG as the fix.
Gate Rules
- Treat the initial render manifest as
revise; rendering is evidence preparation, not inspection. - Require visual evidence for
clipping,overlap,glyph_integrity,page_balance, andtable_spacingon every page. - Accept only
visual_image_review,vision_model_review, orhuman_visual_reviewas inspection methods. Do not treat text-only or OCR-only methods as visual evidence. - Set
passonly when every required check on every rendered page is explicitly recorded aspassagainst the current image digest. - Set
revisewhen any check fails. Include a concrete page-level detail for every result. - Keep the PDF, editable source reference, rendered pages, render manifest, inspection record, and final QA manifest linked and available for reproduction.
Completion
Report PDF QA complete only when qa-final.json has status: pass, all pages were rendered at the recorded DPI, all image digests match the inspection, and no required check is missing. Otherwise report revise and the issue list.