Skip to content

test: pin the inline wrappers, and correct two limitations that were fixed - #40

Merged
elvogel merged 2 commits into
mainfrom
test/pin-inline-wrappers
Oct 2, 2026
Merged

elvogel merged 2 commits into
mainfrom
test/pin-inline-wrappers

Conversation

@elvogel

@elvogel elvogel commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Commit a3e3558 fixed two things and pinned one of them, then shipped that way through eight
releases
— v0.1.0 to v0.2.4.

Its tests cover the text-box half (w:txbxContent). The inline-wrapper half had nothing:

case test before this PR
inline w:sdt none
w:fldSimple none
w:smartTag none
w:instrText exclusion none
block-level w:sdt ListStylesheetTests ✓
w:del exclusion MarkdownStylesheetTests ✓

The only content-control test covered the block-level form, and docs/limitations.md is
explicit 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:tab branch of
SourceWords was deleted, 356 tests stayed green, and 382 phantom losses turned up in the next
corpus run.

The tests 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, which is the inverse of the rule
that came out of the 9,371 w:noBreakHyphen losses: the oracle must stay strictly more inclusive
than the transform, and here the transform had fallen behind it.

Documentation corrected

docs/limitations.md carried Status: open on two defects that a3e3558 fixed on
2026-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~~ — fixed convention, cite the fixing
commit, 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: --report is off the not-yet-supported list (it shipped in 0.2.3), and --style-map now
carries a note that it should set an XsltTransformer.ResourcePolicy when it ships, which needs
Xslt ≥ 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:ilvl aborts the
conversion — 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 is
what 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

Lucas Vogel and others added 2 commits October 1, 2026 17:55
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
@elvogel
elvogel merged commit b77719f into main Oct 2, 2026
1 check passed
@elvogel
elvogel deleted the test/pin-inline-wrappers branch October 2, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant