DOCX Architecture Audit
Audit semantics that static identifier checks cannot prove. Report only evidence-backed findings with an exact code reference or a reproducible command.
Workflow
Read
AGENTS.mdanddocs/docx-layout-engine-redesign.mdcompletely.Inspect the complete change against
main; do not limit review to the latest commit. Read the owning modules and focused tests, not only the diff.Consult the relevant local
spec/material before judging OOXML behavior. Prefer ECMA-376 / ISO/IEC 29500, then the applicable Microsoft implementation note. Do not disclose private sample contents or paths.Run the deterministic gates:
mise exec -- node scripts/check-docx-layout-boundaries.mjs --final mise exec -- pnpm test:docx-boundaries mise exec -- pnpm test:docx-compatibility mise exec -- pnpm test:docx-public-api mise exec -- pnpm test:docx-package-build mise exec -- pnpm typecheck git diff --checkAudit the final dependency direction and runtime behavior:
- one production layout algorithm exists for each supported feature class;
- parser facts flow into immutable point-space layout and then measurement-free paint;
- paint performs no measurement, shaping, style resolution, pagination, or parser-model access, including through transitive imports;
- parser objects and retained layouts are not mutated or runtime-stamped;
- no migration flag, silent legacy fallback, dry-render geometry collection, or transitional allowance remains;
- body, stories, tables, text boxes, and supported floating content participate
in
DocumentLayoutand preserve page/layer ownership; - main and worker use the same contracts and stable layout fingerprints;
- compatibility decisions are isolated with exact evidence, while normative rules and unsupported diagnostics are not mislabeled as observations;
renderer.tsremains a thin adapter with no hidden layout or paint algorithm;- public declarations remain compatible;
- shared OOXML primitives live in
coreorooxml-commononly when the abstraction is genuinely cross-format.
Run focused behavior tests for every suspicious path. Run the full repository test suite and browser conformance checks when declaring the architecture complete or when the touched surface crosses package/runtime boundaries.
Classify findings by severity. For each finding, state the violated invariant, exact evidence, affected behavior, and smallest coherent fix. Distinguish a proven defect from a question or missing evidence.
End with an explicit
APPROVEonly when no unresolved finding remains and every required command passes. Otherwise useREQUEST_CHANGESand list the blockers. Never approve based only on green tests.