test(docx-core): add required tblGrid to synthetic tables#461
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
LLM-Based Quality GateOverall: ✅ PASS (4 pass · 0 warn · 11 skipped · 15 total)
Full checklist questions
Estimated cost (this run): $0.0044 — 12,710 input + 249 output tokens (≈4 chars/token) on |
LLM-Based Quality GateOverall: ✅ PASS (4 pass · 0 warn · 11 skipped · 15 total)
Full checklist questions
Estimated cost (this run): $0.0044 — 12,804 input + 231 output tokens (≈4 chars/token) on |
Synthetic table fixtures were omitting w:tblGrid, so once emitted document.xml instances were validated against the ECMA-376 Transitional schema the corpus needed a known-failure pin for documents that did not resemble Word-authored tables. This keeps the fixture XML itself conformant instead of adding builder-time normalization, so future tests can still deliberately exercise malformed tables when needed. While removing that pin, the same schema gate exposed cell-margin children from the layout padding helper in non-schema order. Reordering those margins at the primitive writer keeps the now-valid table fixtures from surfacing a second emitted-schema failure and matches the existing w:tcMar conformance registry entry. Fixes: #453
8f0b60d to
2b12457
Compare
LLM-Based Quality GateOverall: ✅ PASS (7 pass · 0 warn · 8 skipped · 15 total)
Full checklist questions
Estimated cost (this run): $0.0120 — 36,454 input + 446 output tokens (≈4 chars/token) on |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
What changed
w:tblPrwhere needed and a requiredw:tblGridbefore rows.synthetic-table-missing-tblgridemitted-schema known-failure entry.w:tcMarmargin children in schema order whensetTableCellPaddingmutates cell padding; this was exposed once the affected table fixtures became valid enough for schema validation to reach the cell-margin nodes.Why
The emitted-schema CI gate validates captured
word/document.xmlinstances against the ECMA-376 Transitional schema. Synthetic tables that omittedw:tblGridwere invalid fixture debt, not engine behavior, and masked later schema checks in the same emitted documents.Validation
npm run buildnpm run lint:workspacesnpm run check:spec-coveragenpm run check:conformance-citationsnpm run check:conformance-docSDX_SCHEMA_CORPUS_DIR=$PWD/.tmp/schema-corpus npm run test:run -w @usejunior/docx-core(rerun outside sandbox because sandboxedtsxIPC is blocked)SDX_SCHEMA_CORPUS_DIR=$PWD/.tmp/schema-corpus npm run test:run -w @usejunior/docx-mcpnode scripts/check_emitted_document_schema.mjs --self-test --known-failures coverage/emitted-schema-known-failures.json .tmp/schema-corpus→1795 of 1795 document.xml instances validate against the Transitional WML schemaFixes #453