Skip to content

Release v1.6.1: Context Optimization and Structural Edits

Choose a tag to compare

@mkorpela mkorpela released this 09 May 18:58
· 869 commits to main since this release
Immutable release. Only release title and notes can be modified.
c6f13cd

This release focuses on improving agent reasoning by refining how document context is presented, drastically reducing payload sizes, and stabilizing structural formatting edits.

Context & Agent UX Improvements

  • Structural Appendix Decoupling: The read_docx tool no longer forces the structural appendix (defined terms, cross-references, diagnostics) onto every page. Body pages now include a lightweight pointer, and agents can fetch the appendix on demand using mode="appendix". This prevents massive context bloat and token waste on large legal documents.
  • Smart Ambiguity Resolution: When an agent attempts an edit with an ambiguous target, the validation error now explicitly displays the surrounding text for up to 5 matching locations. This gives the LLM the exact context it needs to instantly self-correct and retry.
  • Annotated Revision Bubbles: Tracked change IDs within the CriticMarkup bubble are now explicitly tagged by their action (e.g., [Chg:12 insert], [Chg:12 delete]). This eliminates agent confusion when accepting or rejecting specific halves of a text substitution.
  • Revision ID Coalescing: Edits that span across internal XML formatting boundaries (such as a partially bolded phrase) now share a single logical Chg ID in the UI, rather than fragmenting into multiple confusing IDs.

Core Redlining Engine

  • Clean Heading Swaps: Changing a heading's level via text replacement (e.g., # Heading to ## Heading) now performs a clean, atomic paragraph replacement. It accurately transfers the style without leaving behind empty "orphan" paragraphs in the document.
  • Surgical Initialization: The engine no longer performs global document normalization on startup. This strictly preserves untouched paragraphs, preventing the silent destruction of unrelated metadata like spellcheck markers or untargeted comments.
  • Live Word Stabilization: Major reliability improvements for the Live Word COM mode. Multi-paragraph insertions utilize a new anchoring algorithm to prevent formatting drift, and revision targeting now uses semantic proximity to survive Word's background index shifting.
  • Asynchronous Sanitization: The sanitize_docx tool now offloads processing to a background thread. This prevents heavy document scrubbing from blocking the MCP event loop and dropping client heartbeats.
  • Performance: Implemented a single-pass extraction engine for domain metadata and an O(1) XML style cache, significantly reducing the time it takes to parse and project large documents.