fix(docx-core): preserve merge-source commentsIds durable-ID rows#524
fix(docx-core): preserve merge-source commentsIds durable-ID rows#524stevenobiajulu wants to merge 1 commit into
Conversation
The comment ancillary post-pass merged comments.xml, commentsExtended.xml, and people.xml from the merge-source side but skipped commentsIds.xml. Merged-in comments therefore lost their Word durable-ID metadata ([MS-DOCX] w16cid:commentId rows) until Word regenerated them. Add mergeCommentsIds, mirroring mergeCommentsExtended: it carries forward the source rows keyed by w16cid:paraId (the same paraIds threaded through commentsExtended.xml) for the expanded comment set, appending into an existing result part or bootstrapping the part with OPC metadata when the base archive lacks it. Wired into mergeCommentAncillaryParts so it runs in both reconstruction modes. Ref: #471
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Verdict: Approve (with nits)Traced the implementation and tests end-to-end against issue #471. This is a clean, correctly-scoped bug fix that mirrors the established Why it's sound
Conventions
Nits (non-blocking)
|
LLM-Based Quality GateOverall: ✅ PASS (8 pass · 0 warn · 9 skipped · 17 total)
Full checklist questions
Estimated cost (this run): $0.0121 — 35,745 input + 521 output tokens (≈4 chars/token) on |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
The comment ancillary post-pass (
mergeCommentAncillaryPartsinpackages/docx-core/src/baselines/atomizer/pipeline.ts) merged the merge-source side'scomments.xml,commentsExtended.xml, andpeople.xml, but never mergedcommentsIds.xml. Merged-in comments therefore lost their Word durable-ID metadata ([MS-DOCX]w16cid:commentIdrows) until Word regenerated them — cosmetic, but it drops existing durable-ID metadata from the source document.This adds
mergeCommentsIds, mirroring the existingmergeCommentsExtendedshape:w16cid:paraId(the same paraIds threaded throughcommentsExtended.xml) for the expanded comment set.commentsIds.xml, or bootstraps the part (cloning the source root for namespaces, dropping non-matching rows) plus OPC metadata viaensureOpcMetadata/ a newCOMMENTS_IDS_DESCRIPTOR.mergeCommentAncillaryPartsso it runs for both reconstruction modes (the post-pass picksmergeSourceArchiveby mode).Tests
Added a focused regression describe block in
rebuild-auxiliary-merge.test.ts(issue #471), covering both paths:commentsIds.xmlwith the merge-source durable ID + content-type override + relationship.commentsIds.xml(both root and reply IDs survive).A
addCommentsIdsParthelper splices the part in, since the synthetic fixture does not emitcommentsIds.xml.Gates run
npm run build— passnpm run lint:workspaces— pass (0 errors; only pre-existing warnings)docx-corefull vitest suite — pass (1580 passed, 2 expected-fail, 11 skipped)npm run check:conformance-citations— pass (JSDoc cites[MS-DOCX], not ECMA-376)Reviewer notes
.openspec()tags added, so noTEST_FEATUREconst required.Ref: #471