Skip to content

Release v0.9.0 - API Unification & Reliability

Choose a tag to compare

@mkorpela mkorpela released this 29 Mar 19:19
· 1064 commits to main since this release
Immutable release. Only release title and notes can be modified.
12b3277

This release marks a major stabilization of the Adeu MCP interface and Python SDK. We have completely overhauled the way AI agents interact with documents, moving from fragmented, multi-step tool calls to a unified, reliable batch-processing pipeline.

Key Features & Agentic Improvements

  • Unified Flat API (DocumentChange): The LLM now interacts with a single, flat list of operations represented by a discriminated union. This dramatically improves LLM structured output reliability compared to managing separate arrays for edits and actions.
  • The "Commit & Negotiate" Pipeline: Replaced fragmented endpoints with a single powerful MCP tool: process_document_batch. Agents can now execute search-and-replace edits (modify), accept/reject existing redlines (accept, reject), and reply to comments (reply) in a single, atomic tool call.
  • Search-and-Replace First: Pure insertions and deletions are intentionally hidden from the LLM at the API level. All text modifications must now be executed as a search-and-replace (ModifyText), ensuring the LLM always provides sufficient anchoring context for our fuzzy matcher.
  • Pre-Flight Validation (BatchValidationError): The engine now performs an exhaustive dry-run validation of all text edits in a batch before touching the XML. If an edit fails to anchor, the entire batch is rejected with explicit, positive error logging, allowing the agent to self-correct.

MCP Tool Changes (Claude Desktop)

  • Added: process_document_batch - The single entry point for all document modifications.
  • Removed: apply_edits_as_markdown, apply_structured_edits, manage_review_actions. These have been consolidated into the batch processor.
  • Updated Prompts: The recommended System Prompt in the README.md has been updated. Agents should now be instructed to use type: "modify", "accept", "reject", or "reply" within the batch tool.

Migration Guide for SDK Builders

If you are using the RedlineEngine in your own Python applications, update your data models:

Old (v0.8.x):

from adeu import DocumentEdit, ReviewAction

edits = [DocumentEdit(target_text="Old", new_text="New")]
actions = [ReviewAction(action="ACCEPT", target_id="Chg:1")]

engine.apply_review_actions(actions)
engine.apply_edits(edits)

New (v0.9.0):

from adeu import ModifyText, AcceptChange

changes = [
    AcceptChange(target_id="Chg:1"),
    ModifyText(target_text="Old", new_text="New")
]

# The engine handles the safe ordering (actions first, rebuild DOM, then edits)
engine.process_batch(changes)

CLI Updates

  • The adeu apply and adeu markup commands now expect the new List[DocumentChange] JSON format.
  • Backwards Compatibility: The CLI includes a fallback adapter. If you pass an older JSON file structured with {"actions": [...], "edits": [...]}, Adeu will automatically up-convert it to the new flat format at runtime.

Reliability & Testing

  • Added test_server.py to cover end-to-end MCP tool execution.
  • Extensive testing added for the process_document_batch pipeline to prevent cascading misanchors when accepting/rejecting changes dynamically shifts the Virtual DOM.