agent quoted the redline's struck-through text as the current clause - it parsed deleted text as operative
Fixes a contract review agent that treats redline deleted text as live clause language. Use when a redline summary quotes struck-through text, or the agent reports clause wording that no longer exists in the current version. Key trigger: extracted clause text matches the deleted side of a tracked change instead of the inserted replacement.
TL;DR: Parse the redline's tracked-change markup before extracting any clause text, so deleted runs are dropped and only inserted or accepted text counts as operative. Then re-extract the flagged clause and diff it against the accepted version to confirm the quote matches. The agent was reading raw document text with the deletion markup stripped out, which made deleted wording look like live wording.
agent quoted the redline's struck-through text as the current clause - it parsed deleted text as operative- Confirm the redline actually contains tracked changes before trusting any extraction. Open the document in Word or LibreOffice and look for revision markup, or scan the docx XML for deleted-text and inserted-text runs. Expected: you see explicit deletion and insertion markers, not just plain text.
- Build the accepted view first. In python-docx, walk each paragraph and drop runs tagged as deleted while keeping runs tagged as inserted, then run clause extraction on that accepted view only. Expected: the accepted view no longer contains the struck-through wording at all.
- Re-run the clause extraction the agent used, but feed it the accepted view. Compare the new quote against the old one. Expected: the new quote matches the inserted replacement text, and the struck-through wording is gone.
- If the redline came as a PDF (not docx), check whether the PDF is a redline export with strike styling or a flattened clean version. If it is a redline export, re-export the clean accepted version from the source doc and diff against that instead. Expected: diffing against the clean version shows the clause wording as unchanged.
- Add a standing guard to the pipeline: every extraction result must record which revision of the document it read (accepted view vs redline view). Expected: future extractions carry a revision label, so a quote from a redline view never passes as current text.
Use this when
- the agent's clause quote contains wording you know was struck out in the redline
- extraction output includes both the old and new phrasing of the same clause with no label saying which is current
- the pipeline reads .docx files with tracked changes still unresolved
- a redline summary flags a clause as "current" but the counterparty's clean draft says otherwise
Not for this skill when
- the document has no tracked changes and the quote is simply wrong for another reason (check OCR or chunking instead)
- the dispute is about what the redline MEANS, not which text is operative
- the source is a scanned image PDF with no markup layer at all
Variant phrasings
- agent extracted deleted contract language as if it were still in force
- redline parser quoted the struck-out clause instead of the replacement
- clause extraction picked up redline deletions in a tracked-changes docx
- agent reported old indemnity wording that was redlined out of the agreement
Why it happens
Tracked-change documents store both versions of every edit in the same file. A parser that reads raw text runs usually concatenates inserted and deleted runs together, or strips the deletion tags while keeping the words. The agent then "sees" the deleted wording as ordinary body text and quotes it. The fix works because the accepted view is the only text both parties agreed is live.
Edge cases
- Some redlines arrive as PDFs rendered from Word with strike-through as pure styling. There is no markup to parse, so re-export the accepted docx and work from that.
- A clause deleted and re-inserted elsewhere keeps the same wording. The accepted view handles this, but your clause linker should still key on section number, not text match.
- Comment bubbles and revision metadata are not clause text. Strip them before extraction or the agent may quote a reviewer's note as contract language.
Provenance
Resolved from the public thread: https://vectle.com/posts/psteZMykN45Pjin9UPw4nm7w
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.