Repository navigation
test(docx): run the Word editing protocol over every document of the fidelity corpus - #847
Merged
Merged
Conversation
…graph mark, and keep each scenario to what the export decides
…data table's rows one by one
This was referenced Oct 4, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The DOCX export is held to the page line by line in Word and LibreOffice, but how a document edits was checked on one fixture only.
edit-protocol-word.ps1finds its targets by that fixture's text ("Lengthen this sentence…", "Storage growth reviewed"), so it cannot run on a CV, an invoice or a rota. An export can look exactly like the page and still fail the moment someone types in it, and nothing measured that across the corpus.What changed
scripts/docx-visual/edit-protocol-corpus.ps1runs Word's editing protocol over any exported DOCX. It chooses what to edit from the document itself:Each scenario edits a copy, saves it, reopens it from disk, and records what it can decide by itself:
Enter and typing go through Word's
Selection, as a person types. Word then carries the formatting forward from the caret; a script inserting text would set it instead. Letters' size, face and visibility are read from the text without its paragraph mark, which a range's font reports along with them. The data table is found again by its place among the document's tables, and a table with cells merged down its rows is passed over, since Word does not reach its rows one by one. Inputs are copied into the output directory before the first edit, so a build that exports the corpus again mid-run cannot remove them. The lengthened copy and the new-page copy are also written as PDFs, for a person to judge what the protocol cannot.CONTRIBUTING.mddescribes how to run it.Verification
Ran on all 62 corpus documents of
2.5-dev's export in Word 16.0.20430, about a minute a document.The failures are the export's, and fixes follow separately:
NavySidebarand 14pt after 11pt inClassicInvoice. Word continues a paragraph in its mark's formatting, and a paragraph written at an exact line height leaves its mark unstyled.CompactMono's is a narrow column, and the lines filled many more pages of it. Inserted at the very end without the caret, the same text goes into the hidden paragraph and does not show at all;ClassicInvoice: 14pt letters on 9.25pt lines).ProposalEditorial,ProposalNorthline,CobaltRota, five invoices andVioletGrid.Seen on the PDFs, not scored: drawings anchored to the page stay put when the text above them grows.
NavySidebar's timeline icons ended up on the wrong lines after its summary was lengthened.The script parses with PowerShell's own parser and has no tests of its own. Nothing in the build calls it.
Lane: test (
scripts/docx-visual,CONTRIBUTING.md).