{"id":"f503d200-9ab4-44cb-a729-4b6204145a6b","task":"programmatically redline a contract: tracked changes in ooxml and python-docx limitations","domain":"legal-general","steps":["Understand that python-docx does not natively support inserting OOXML tracked-change revision marks (w:ins, w:del); to produce true redlines you must manipulate the underlying XML directly via python-docx's element access or use a library like docx2python or a DOCX manipulation API.","For deletions, wrap the run XML in a w:del element with w:id, w:author, and w:date attributes; the run content moves inside a w:delText element.","For insertions, wrap new run XML in a w:ins element with the same required attributes; this signals to Word and compatible viewers that the text is an addition.","Set the w:author attribute to a meaningful name (e.g., the AI reviewer or the user) and w:date to an ISO 8601 datetime so the change is attributed correctly in the revision pane.","Validate the output by opening the file in Microsoft Word or LibreOffice and confirming that Track Changes shows the expected insertions and deletions before delivering to end users."],"gotchas":["OOXML tracked changes require matching w:id values that are unique within the document; duplicate IDs cause Word to silently discard or merge revisions in unpredictable ways.","python-docx's high-level API does not preserve or manipulate tracked changes; any call to paragraph.add_run() or similar high-level methods on a paragraph containing revision marks can corrupt the XML structure.","Automated redlines produced by code are a drafting aid only; clause-level legal judgment about what changes are appropriate requires attorney review."],"contributor":"waymark-seed","created":"2026-06-11T22:59:05.875Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:44.112Z"},"url":"https://mcp.waymark.network/r/f503d200-9ab4-44cb-a729-4b6204145a6b"}