Rendered truth is not complete when the skill only emits a PDF or page PNG directory. Those are artifacts, not the final answer.
docx closes the rendered-truth loop only when it delivers all four layers:
python3 <skill_dir>/scripts/docx_to_pdf.py --input in.docx --output /tmp/render.pdf
python3 <skill_dir>/scripts/render_docx_pages.py in.docx --output-dir /tmp/render-pages
python3 <skill_dir>/scripts/read_docx_structure.py in.docx --json > /tmp/structure.json
python3 <skill_dir>/scripts/rendered_report.py \
--pdf /tmp/render.pdf \
--pages-dir /tmp/render-pages \
--structure-json /tmp/structure.json \
--issue-file /tmp/rendered-issues.json \
--format markdown > /tmp/rendered-report.md
The operator still has to inspect the rendered pages and write rendered-issues.json.
That is intentional: rendered truth starts from what the user sees, not what the XML predicts.
rendered-issues.json inputThe issue file is a JSON array. Each item describes a single observed visual problem.
[
{
"issueClass": "toc_layout_or_update",
"pages": [2, 3],
"severity": "high",
"visualSymptom": "TOC page numbers do not match the rendered body headings.",
"notes": "The rendered TOC still shows pre-edit pagination."
}
]
Supported issueClass values:
| Issue class | Use when |
|---|---|
toc_layout_or_update |
TOC looks stale, misaligned, missing entries, or paginates incorrectly |
header_footer_mismatch |
header/footer appearance differs across pages or sections |
page_number_wrong |
visible page numbers are missing, duplicated, restarted, or inconsistent |
extra_blank_page |
a rendered page looks unexpectedly blank |
template_fidelity |
the output no longer visually follows the target template system |
layout_overflow_or_clipping |
body/table/image content clips, overflows, or collides visually |
rendered_report.py emits either JSON or Markdown. No schema file is required at runtime; the gate is
the concrete output contract below.
Use --task-family READ_RENDERED for inspection output and --task-family REPAIR_LAYOUT for
before/after repair reports.
When --format json, the top-level object must contain:
artifactSummary — PDF path, pages dir, page count, per-page PNG inventorystructureCues — section / TOC / page-number / contamination cues extracted from structure truthcandidateIssueClasses — issue classes suggested by structure cues when observation has not yet been written downpageIssueSummary — one entry per observed problemcompletionChecklist — explicit reminder that artifact creation alone is not enoughEach pageIssueSummary entry must carry the same fields across READ_RENDERED and REPAIR_LAYOUT:
issueClasslabelpagesseverityvisualSymptomrenderedEvidence — page -> PNG mappingstructureCauseAlignment — concrete structure signals and what they supportlikelyStructuralCausesrecommendedChecksWhen --format markdown, the report must include these sections in order:
# Rendered issue report## Artifact summary## Structure cues## Candidate issue classes## Page issue summary## Completion checklistEvery issue block under ## Page issue summary must contain:
issueClassStructure cause alignment:Likely structural causes:Recommended checks:The report intentionally aligns visual problems to structure causes instead of treating them as two separate deliverables.
| Symptom family | Typical structure alignment |
|---|---|
| TOC drift | TOC field count, heading outline-level risks, section transitions |
| Header/footer mismatch | per-section header/footer references, titlePg, even/odd header flags |
| Page-number issues | PAGE / NUMPAGES / SECTIONPAGES fields, section count, titlePg |
| Blank page | section break types, title-page sections |
| Template fidelity drift | section graph, missing styles, direct-format contamination |
| Overflow / clipping | direct formatting, table density, drawing density |
For layout repair, generate the rendered report twice:
Do not declare REPAIR_LAYOUT complete without the second rendered report.