test(doc-codec): pin a table row's header flag through a write/read round trip - #1395
Merged
Merged
Conversation
…ound trip table/write.ts derived headerFlags and the per-row isHeader override from row.isHeader inside one map/comparison chain that only ever ran with every row left at its default, so nothing distinguished an isHeader:true row from an untouched one. table/read.ts built the returned row object with a ternary meant to omit the isHeader key for an ordinary row, but the only existing assertion read the property back through a plain map, which cannot tell a missing key from one present with value undefined. The new round trip writes a table with one explicit header row and one ordinary row, then checks both the value and, via Object.hasOwn, the presence of the isHeader key on each returned row.
Mearman
marked this pull request as ready for review
September 21, 2026 19:25
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
🎉 This PR is included in version 6.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Mutation testing failed for doc-codec on main (99.86 against the required 100, GitHub Actions run 35613292447) after #1390 added
isHeaderheader-row support across the table read/write path.Five survivors, all at the same gap:
table/write.tsderived a row's header flag fromrow.isHeader === truein two places (line 426'sheaderFlagsmap and line 441's per-row override), andtable/read.tsomitted theisHeaderkey entirely for a non-header row viaisHeader === undefined ? {} : { isHeader }. Nothing in the existing suite ever wrote a table with an explicitisHeader: truerow and checked it round-tripped, and the one read-side assertion read the property back through a plain.map(), which cannot distinguish a missing key from one present with valueundefined.Added one round-trip test in
write.test.tsthat writes a table with a header row and an ordinary row, then checks both the value and, viaObject.hasOwn, the key's presence on each returned row. Confirmed it kills all five survivors by reproducing each exact mutation locally (same file, same line, same replacement per the mutation report) and watching the new test fail, then reverting.Refs #1377