Skip to content

test(doc-codec): pin a table row's header flag through a write/read round trip - #1395

Merged
Mearman merged 1 commit into
mainfrom
fix/doc-codec-mutation-survivors
Sep 21, 2026
Merged

Mearman merged 1 commit into
mainfrom
fix/doc-codec-mutation-survivors

Conversation

@Mearman

@Mearman Mearman commented Sep 21, 2026

Copy link
Copy Markdown
Member

Mutation testing failed for doc-codec on main (99.86 against the required 100, GitHub Actions run 35613292447) after #1390 added isHeader header-row support across the table read/write path.

Five survivors, all at the same gap: table/write.ts derived a row's header flag from row.isHeader === true in two places (line 426's headerFlags map and line 441's per-row override), and table/read.ts omitted the isHeader key entirely for a non-header row via isHeader === undefined ? {} : { isHeader }. Nothing in the existing suite ever wrote a table with an explicit isHeader: true row 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 value undefined.

Added one round-trip test in write.test.ts that writes a table with a header row and an ordinary row, then checks both the value and, via Object.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

…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
Mearman marked this pull request as ready for review September 21, 2026 19:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-21T19:28:09.714873Z 52fc454 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit 74717a3 Sep 21, 2026
39 checks passed
@Mearman
Mearman deleted the fix/doc-codec-mutation-survivors branch September 21, 2026 19:34
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant