Repository navigation
feat(document): DOCX adapter with flow projection and export - #50
Merged
Merged
Conversation
Map WordprocessingML on top of the shared package intake into a flow model: sections, headings, lists, tables with spans and merges, runs, hyperlinks, bookmarks, captions, footnotes, endnotes, comments, tracked changes kept as tracked changes, and content-addressed images. Every normalized or skipped feature is recorded as a feature:status receipt code. Fields are never evaluated and hyperlinks never fetched. Export writes the model as a deterministic DOCX with a canonical JSON fidelity receipt. DLP and public-boundary findings refuse before any bytes are built, and export_file writes through the shared no-overwrite gate. Import, export, and import again keep the model and anchors. Register the adapter, so every package row runs through it, and make the three DOCX adapter rows executable in the shared corpus. Refs #21
Describe the DOCX content model, citation anchors, fidelity vocabulary, export receipt, and the opt-in two-reader check with its recorded LibreOffice and python-docx results. Fill the DOCX column of the shared compatibility table and mark the DOCX adapter rows executable. Closes #21
The shared XML reader now keeps attribute prefixes, so the adapter reads w:val, r:id, and r:embed instead of stripped local names. A part that binds the WordprocessingML or relationships namespace to another prefix, or w or r to another namespace, is refused as unsupported-container rather than misread. Record the corpus runtime with the nine new rows. Refs #21
# Conflicts: # crates/bran-document/src/conformance.rs # crates/bran-document/tests/conformance.rs # docs/enterprise-document-conformance.md
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.
Summary
DOCX adapter for enterprise-document evidence (#21), registered in the #25 conformance harness alongside the XLSX and PDF adapters.
Import: maps WordprocessingML to a flow projection. It covers:
Namespace prefixes resolve through in-scope bindings. Unsupported or normalized features appear in a fidelity receipt.
Safety: external relationships are never resolved, and VBA, fields, OLE and embedded content are never executed.
mc:AlternateContentcompatibility branches are refused with a typed result rather than imported twice. Metadata expansion is bounded.Export: a deterministic DOCX with a fidelity receipt, which the importer accepts back (compression included). DLP and public-boundary checks run first. Attribute whitespace round-trips exactly.
Closes #21
Verification
./tools/ci/check.sh --fastand--fullpass on the branch merged with currentmain, with all DOCX, XLSX and PDF conformance rows executable. No new dependencies.61f1c8bwith tests that failed first:Not covered: Word itself was not available to test. Query/packet selection of document evidence is tracked in #46.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GXsmZAgLAftTb8E5oswz82