This document catalogues every rule that makes a DOCX file valid in Microsoft Word. Each rule was discovered through systematic debugging: round-trip testing (load → save → open in Word), swap-testing (isolate which part causes failure), and repair analysis (diff broken vs Word-repaired).

1. How to use this reference

  • Reconciler authors — see Reconciler Mapping to find which method enforces each rule

  • Validation rule authors — see Validation Mapping to find which DOC-code checks each rule

  • Contributors — follow the rule template below to add new rules

2. Rule template

Each rule document follows this structure:

== Rule ID: R{n}
**Summary:** one-line description
**Severity:** error / warning / info
**Applies to:** which XML parts

=== What Word expects
Detailed description of the valid state.

=== What happens on violation
Error message or behavior.

=== Reconciler enforcement
Which reconciler method ensures this, and how.

=== Validation rule
Which DOC-{code} checks this.

=== Example
Valid vs invalid XML snippet.

3. Rules by category

3.1. Package Structure

3.2. Namespace Consistency

3.3. Relationship Integrity

3.4. Settings

3.5. Theme

3.6. Numbering

3.7. Styles

3.8. Footnotes and Endnotes

3.9. Section Properties

3.10. Document Metadata

3.11. Headers and Footers