test: pin the inline wrappers, and correct two limitations that were fixed - #40
Merged
Merged
Conversation
a3e3558 fixed two things and pinned one. Its tests cover the text-box half (w:txbxContent); the inline-wrapper half shipped with nothing asserting it: inline w:sdt no test w:fldSimple no test w:smartTag no test w:instrText no test (the exclusion) Only the BLOCK-LEVEL w:sdt route had a test, in ListStylesheetTests, and docs/limitations.md is explicit that the block form was never the broken one. So the fix was live, correct, and free to regress silently. This repo has already paid for that exact gap: the w:tab branch of SourceWords was deleted, 356 tests stayed green, and 382 phantom losses turned up in the next corpus run. Six tests, and they were proven able to fail. Reverting the select-list half of a3e3558 (back to "w:r | w:ins | w:hyperlink") fails exactly five of the six. FieldCode_IsNotEmitted survives the mutation, correctly: it guards an exclusion, which does not depend on that select list. A mutation that failed all six would have told me less, because it could not distinguish the two kinds of test. Why the inclusions are not a matter of taste: docmd:text-nodes walks the DESCENDANT axis, so TextCoverageReport already counts this text as words a reader can see. A transform that cannot reach it does not merely omit it -- it reports itself as lossy. The oracle had already cast the deciding vote. Verified end-to-end as well as in unit tests: the exact fixture docs/limitations.md says produces "Field:" and nothing else now yields all three wrapped strings, with the field code and the deleted text correctly absent, and --report clean at 0 words lost. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018wZEgtuzaZPswykiGEBxbz
…t are not docs/limitations.md carried "Status: open" on two defects that commit a3e3558 fixed on 2026-09-08. That file is the public accounting of what docmd cannot do, so it was telling prospective users docmd drops their content-control text and their text-box text. Both convert, verified end to end today. Text inside transparent wrappers fixed. The fixture this file says produces "Field:" and nothing else now yields every string, with the field code and the deleted text correctly absent and --report clean. Text inside a text box fixed. Content becomes blocks after its anchor paragraph; --report clean. Both sections now use the file's own convention for a closed item, carry the commit that fixed them, and name the tests that pin them. The wrapper entry also drops a prediction that turned out to be wrong. It said the policy for which fields carry content needed frequency data from a corpus audit first. It did not: docmd:text-nodes walks the descendant axis, so TextCoverageReport already counted that text as words a reader can see, which means a transform unable to reach it reported itself as lossy. The oracle had already decided. Recording that because the entry's reasoning is the kind that defers work indefinitely while waiting for data it does not need. Three defects ARE still real, reproduced today and now filed rather than left in prose: #37 a non-numeric w:ilvl aborts the conversion: exit 1, no output file, so in a batch the document is lost rather than degraded #38 four or more leading tabs silently turn a paragraph into a CommonMark indented code block #39 an interrupted ordered list restarts at 1. Each issue carries its fixture and its exact observed output. #38 and #39 both exit 0 and report no loss, which is what makes them worth filing: every word survives and only its meaning changes, so the text-coverage oracle cannot see them. Also corrected: this file listed --report among flags that "fail cleanly as not-yet-supported". It shipped in 0.2.3. --style-map is unblocked, phoenixmldb-xslt#12 being closed, and when it ships it should set an XsltTransformer.ResourcePolicy. Running a stylesheet somebody else wrote is untrusted code, and policy enforcement across reads, fetches and xsl:evaluate landed in Xslt 2.5.1 as GHSA-86rg-wxgp-9p5j. Noted where the flag is described rather than left to be rediscovered. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018wZEgtuzaZPswykiGEBxbz
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.
Commit
a3e3558fixed two things and pinned one of them, then shipped that way through eightreleases —
v0.1.0tov0.2.4.Its tests cover the text-box half (
w:txbxContent). The inline-wrapper half had nothing:w:sdtw:fldSimplew:smartTagw:instrTextexclusionw:sdtListStylesheetTests✓w:delexclusionMarkdownStylesheetTests✓The only content-control test covered the block-level form, and
docs/limitations.mdisexplicit that the block form was never the broken one. So a live, correct fix was free to regress
silently — and this repo has already paid for that exact shape once: the
w:tabbranch ofSourceWordswas deleted, 356 tests stayed green, and 382 phantom losses turned up in the nextcorpus run.
The tests were proven able to fail
Reverting the select-list half of
a3e3558(back tow:r | w:ins | w:hyperlink) fails exactlyfive of the six.
FieldCode_IsNotEmittedsurvives the mutation, correctly — it guards anexclusion, which does not depend on that select list. A mutation that failed all six would have
told me less, because it could not distinguish the two kinds of test.
Why the inclusions are not a matter of taste
docmd:text-nodeswalks the descendant axis, soTextCoverageReportalready counts this textas words a reader can see. A transform that cannot reach it does not merely omit it — it reports
itself as lossy. The oracle had already cast the deciding vote, which is the inverse of the rule
that came out of the 9,371
w:noBreakHyphenlosses: the oracle must stay strictly more inclusivethan the transform, and here the transform had fallen behind it.
Documentation corrected
docs/limitations.mdcarriedStatus: openon two defects thata3e3558fixed on2026-09-08. That file is docmd's public accounting of what it cannot do, so it was telling
prospective users docmd drops their content-control text and their text-box text. Both convert;
verified end to end, not inferred from a git log.
Both sections now use the file's own
~~strikethrough~~ — fixedconvention, cite the fixingcommit, and name the pinning tests. The wrapper entry also drops a prediction that was wrong: it
said the policy for which fields carry content needed corpus frequency data first. It did not, for
the oracle reason above — recorded because "we need data first" is the kind of justification that
defers work indefinitely while the data it waits for is already in hand.
Also:
--reportis off the not-yet-supported list (it shipped in 0.2.3), and--style-mapnowcarries a note that it should set an
XsltTransformer.ResourcePolicywhen it ships, which needsXslt ≥ 2.5.1 (GHSA-86rg-wxgp-9p5j).
Three defects that are still real
Reproduced today and filed rather than left in prose: #37 (a non-numeric
w:ilvlaborts theconversion — exit 1, no output file), #38 (four leading tabs become a code block), #39 (an
interrupted ordered list restarts at
1.). #38 and #39 both exit 0 and report no loss, which iswhat makes them worth filing: every word survives and only its meaning changes, so the
text-coverage oracle is structurally blind to them.
Verified
363 tests, 362 pass, 1 skip, 0 failures. No source change — tests and documentation only.
🤖 Generated with Claude Code
https://claude.ai/code/session_018wZEgtuzaZPswykiGEBxbz