Skip to content

test(agents): cover headless save round-trip for comments and tracked changes#647

Open
jacobjove wants to merge 1 commit into
eigenpal:mainfrom
jacobjove:test/agents-headless-roundtrip
Open

test(agents): cover headless save round-trip for comments and tracked changes#647
jacobjove wants to merge 1 commit into
eigenpal:mainfrom
jacobjove:test/agents-headless-roundtrip

Conversation

@jacobjove
Copy link
Copy Markdown

@jacobjove jacobjove commented May 31, 2026

What & why

DocxReviewer's existing tests mutate a reviewer in memory but never serialize back, and the MCP integration test explicitly stops before toBuffer(). So nothing asserted that a headless edit actually reaches the saved bytes — the save path was only covered transitively.

This adds a focused round-trip test for the headless review flow:

  • Parse a clean fixture (styled-content.docx — no pre-existing comments or changes).
  • addComment + proposeInsertion.
  • toBuffer(), then reload via fromBuffer().
  • Assert the comment and the tracked insertion both survive, with the right author/text/type.

The from-scratch case is the point: the fixture has no comments part, so the save path has to scaffold comments.xml + its content-type/rels rather than patch an existing one. This locks that behavior against regression.

Changes

  • packages/agents/src/__tests__/DocxReviewer.roundtrip.test.ts — new, 4 cases.

Verification

bun run typecheck clean; bun test packages/agents/src/ → 245 pass / 0 fail. Test-only — no changeset, no public-API change.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

DocxReviewer's in-memory tests mutate a reviewer but never serialize back,
and the MCP integration test stops before toBuffer() — so nothing asserted
that a headless edit reaches the saved bytes. Add a round-trip test: parse a
clean fixture, add a comment and a tracked insertion, toBuffer(), reload via
fromBuffer(), and assert both survive. Exercises the from-scratch comments
part (the fixture has none, so the save path must scaffold comments.xml).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

Someone is attempting to deploy a commit to the EigenPal Team on Vercel.

A member of the Team first needs to authorize it.

@eigenpal-release-pal
Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅

Posted by the CLA bot.

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