feat(office): close DOCX round-trip residuals and document Phase 2 closure - #5
Merged
Merged
Conversation
Copilot
AI
changed the title
feat(office): close DOCX writer round-trip residuals and document in kb
feat(office): close DOCX round-trip residuals and document Phase 2 closure
Aug 2, 2026
Copilot created this pull request from a session on behalf of
digiogithub
August 2, 2026 12:10
View session
digiogithub
marked this pull request as ready for review
August 2, 2026 12:25
digiogithub
approved these changes
Aug 2, 2026
There was a problem hiding this comment.
Pull request overview
This PR closes remaining Phase 2 DOCX round-trip fidelity gaps (writer + DocMark parse/emit edge cases), adds corpus-wide idempotence tests, and updates the knowledge base / plan to document Phase 2 core-path closure.
Changes:
- Improve DOCX writer fidelity (floating
wp:anchor, image transforms + hyperlinks, full footnote body rendering, omitw:startunless set, covered table cells asw:vMergecontinuations). - Fix DocMark parsing/serialization residuals impacting identity (fence chunking order, nested list depth handling, GFM table span normalization, covered-cell emission).
- Add/expand tests to enforce DOCX corpus Office→DocMark→Office→DocMark idempotence and
serialize(parse(md)) == mdover DOCX goldens; updatekb/and plan status to reflect closure.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| kb/README.md | Links the new Phase 2 closure note and updates the “status in one line” summary. |
| kb/06-phase-2-roundtrip-closure.md | New KB entry documenting residual Phase 2 issues, what landed, and remaining non-blockers. |
| kb/04-next-phases.md | Updates Phase 2 section from “implemented” to “closed” and summarizes delivered vs still-open items. |
| kb/01-phases-0-1-summary.md | Clarifies that reverse conversion + spreadsheets were later phases and are now closed. |
| docs/development-plan.md | Marks Phase 2 core-path status as closed and updates tasks/acceptance criteria accordingly. |
| crates/docsai-office/src/docx/write.rs | Implements floating anchors, transforms, hyperlink support, full footnote body writing, covered-cell vMerge behavior, and adds a regression test. |
| crates/docsai-docmark/src/writer.rs | Emits covered table cells as empty placeholders to keep GFM grids rectangular. |
| crates/docsai-docmark/src/parser.rs | Fixes list-depth parsing, fence chunk splitting order, and normalizes GFM span placeholders into IR covered/spans. |
| crates/docsai-convert/tests/goldens.rs | Adds corpus-wide DOCX idempotence and DOCX golden serialize(parse) identity tests (with asset seeding from companion .docx). |
| AGENTS.md | Updates current-status text to reflect newly-closed DOCX round-trip fidelity items. |
Suppressed comments (2)
crates/docsai-office/src/docx/write.rs:1712
- The test’s assertion still looks for the Spanish substring "negrita". If the fixture text is updated to English, this should be updated too to keep the test consistent with the English-only guideline (AGENTS.md §5).
if t.contains("negrita") {
*bold_note = true;
crates/docsai-office/src/docx/write.rs:1661
- AGENTS.md (§5, lines ~102–105) requires English-only code/comments; this newly added literal is Spanish ("cuerpo"). Please change it to English to avoid introducing more non-English content.
Inline::Image(image),
Inline::Text(" cuerpo".into()),
Inline::Footnote(footnote_body),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1640
to
+1642
| Inline::Text("Nota con ".into()), | ||
| Inline::Styled { | ||
| content: vec![Inline::Text("negrita".into())], |
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.
Closes leftover Phase 2 DOCX round-trip gaps: complete the writer fidelity path, fix DocMark parse/emit residuals that broke corpus identity, and record the closure under
kb/.DOCX writer
wp:anchor(no inline downgrade)w:startonly when set in IRDocMark parser / writer
:::fence depth before blank-line chunk splitsdepth+1soilvlsurvives round-tripTests
corpus/docxOffice→DocMark→Office→DocMark identityserialize(parse)identity on goldens in convert (assets seeded from companion.docx; keeps crate dep rules)Docs
kb/06-phase-2-roundtrip-closure.mdAGENTS.mdstatus updatesStill open (non-blocking)