Repository navigation
Adeu DOCX Engine v1.4.0
·
963 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
This release introduces major improvements to how the Adeu engine projects complex MS Word domain structures (like definitions, footnotes, and cross-references) into editable Markdown. It significantly hardens the Track Changes engine with new validation rules, structural boundary protections, and improved diffing heuristics.
Major Features & Capabilities
Domain Gaps & Semantic Projection (The "Structural Appendix")
To solve domain visibility gaps without adding new MCP tools, read_docx now projects a strictly defined semantic dialect of Markdown, concluding with a deterministic "Language Server (LSP)" hover panel appended to the bottom of the document.
- Symbol Table (Defined Terms): The engine now structurally extracts defined legal terms (via typography and glossary scanning) and projects them into an index.
- Semantic Diagnostics (Linter): Statically analyzes the plain-text projection to map term usages, automatically generating high-signal warnings for:
- Duplicate Definitions: Terms defined multiple times.
- Possible Typos: Detects capitalized phrases within a Levenshtein distance of 1-2 from a valid term (with strict false-positive pruning for short acronyms and stop-words).
- Unused Definitions: Terms defined but never used in the document text.
- Named Anchors & Dependencies: Extracts a deterministic dependency map of Bookmark IDs and which clauses/paragraphs point to them.
Advanced Structural Editability
- Multi-Level Lists: OOXML list levels (
<w:ilvl>) now natively map to standard Markdown indentation (4 spaces per level) on read. The engine parses leading spaces on write to explicitly inject list levels, allowing seamless list editing via Markdown. - Bi-directional Footnotes/Endnotes: Footnotes and endnotes are now projected inline using stable OOXML IDs (e.g.,
[^fn-3]) and appended at the bottom of the document. Modifying the footnote content natively applies tracked changes insidefootnotes.xml. - External Link Retargeting: Links project as
[Text](url). Editing the display text applies redlines. Editing the URL executes a silent retargeting operation in the DOCX relationship files without emitting redlines.
Enhanced Track Changes & Redline Engine
- Diff Hunk Coalescing: Adjacent textual diff hunks separated only by short runs of stable tokens (≤ 4 words) within the same paragraph are now mathematically coalesced into a single unified edit hunk. This prevents fragmented redlines across single clauses.
- Paragraph Break Tracking: When multi-paragraph text is inserted (
\n\n), the engine explicitly injects an<w:ins>marker inside the<w:pPr><w:rPr>of the newly created paragraph, ensuring Word natively tracks the paragraph break itself. - Global Acceptance: The
accept_all_revisionsoperation now sweeps the entire package array, successfully resolving redlines inside generic XML parts (Headers, Footers, and Footnotes).
Safety & Validation Improvements (Strict Refusals)
The engine now intercepts and strictly rejects unsafe edits via BatchValidationError to prevent silent template or dependency corruption:
- Read-Only Cross-References: Cross-references project as
[~Text~](#_Ref). Modifying the display text or hash via text replacement is strictly rejected. Edits must target the source heading/paragraph instead. - Structural Boundary Violations: Modifications targeting the Read-Only Structural Appendix boundary, internal anchors (
{#_BookmarkName}), or attempting to fabricate/delete link/footnote syntax via text replacement are explicitly rejected. - Nested Redline Fragmentation: Edits that strictly target text inside an active
<w:ins>authored by a different user are rejected to prevent nested redline corruption. - Heading Depth Limits: Markdown heading depths are strictly clamped to a maximum of 6 to prevent generating unstyled XML blocks (e.g.,
Heading 7). - Multi-Author Sanitization Awareness: When executing a full document sanitization with auto-acceptance (
accept_all=True), if multiple distinct authors are detected in pending track changes, a high-visibility warning is injected into the Sanitize Report to alert the user of potential "silent smuggles."
Bug Fixes & Refinements
- Table Cell Comment Anchoring: Fixed an issue where comments attached to table row substitutions were incorrectly anchored to the first cell. The engine now uses heuristic cell matching to bypass whitespace drift and accurately anchor comments to the semantically modified cell.
- Contiguous Orphan Comment Sweep: Fixed an issue where comment anchors wrapping across adjacent, paired redline tags (
w:ins+w:del) leaked into the document body after acceptance. - Empty Ghost Insertions: The engine no longer generates self-closing ghost
<w:ins/>tags when tracking empty string insertions. - Live Word Identity Warnings: Live COM batch executions will now proactively surface a warning in the tool response when the requested
author_nameis forcefully overridden by the host OS M365 identity to maintain a predictable audit trail for Agents. - XML Proxy Serialization: Fixed serialization corruptions on generic XML parts by properly re-binding
part._element = part._adeu_elementand safely injecting custom namespaces directly at the document root to bypasslxmlalias artifacts.