Maps each validity rule (R1-R15) to the reconciler method that enforces it.
| Rule | Reconciler Method | What it does |
|---|---|---|
R1 mc:Ignorable |
|
Clears cached namespace plans so |
R2 Settings values |
|
Generates w14:docId (hex) and w15:docId (GUID format) when missing. |
R3 Theme completeness |
|
Loads default Office theme from profile with complete fmtScheme. |
R4 Level elements |
|
Maps all |
R5 lvlOverride |
|
Maps |
R6 Relationship integrity |
|
Rebuilds standard relationships (rId1-rId6); preserves non-standard rels (headers, footers, images). |
R7 Content types |
|
Rebuilds defaults (rels, xml) and overrides for all standard parts. |
R8 Required parts |
Reconciler Group 2 methods |
Creates settings, font_table, styles, web_settings, theme when profile is set. |
R9 Footnotes |
|
Ensures footnotePr ↔ footnotes.xml pairing; adds separator entries. |
R10 Style completeness |
|
Adds Normal, DefaultParagraphFont, TableNormal, NoList if missing. |
R11 Section properties |
|
Creates default sectPr with US Letter page size if missing. |
R12 Rsids |
|
Assigns rsidR and rsidRDefault to paragraphs, rsidR to sectPr, paraId and textId to paragraphs. |
R13 Font signatures |
|
Loads font metadata from |
R14 Core properties |
|
Rebuilds CoreProperties from parsed state for namespace_scope. |
R15 Header/footer refs |
|
Creates header/footer parts and wires rId references. |
1. Audit trail
Every reconciler method records its fixes via record_fix(validity_rule, message).
The applied_fixes array is available after reconcile completes:
reconciler = Uniword::Docx::Reconciler.new(package, profile: profile)
reconciler.reconcile
reconciler.applied_fixes.each do |fix|
puts "[#{fix[:validity_rule]}] #{fix[:message]}"
end