Annotated tracked changes: reasons become anchored Word comments

↗ view on GitHub · Eli Ziff · 2026-07-28 · 95e53f17

applyTrackedEdits gains annotate mode: each edit's reason is rendered
as a real Word comment (commentRangeStart/End + commentReference)
spanning that edit's revision wrappers, with the comments part
created or extended (self-closed empty parts handled), content-type
and relationship registered, and ids continued from existing
comments. Genre contract: annotate requires a non-empty reason on
every edit - rationale-free markup is rejected, because a markup
without visible explanations is a clean draft (the failure that
zeroed LAB pilot task 02 for the reference harness).

library_revise_docx passes annotate through, pre-validates reasons,
reports comment_count, and auto-runs the structural lint on the new
version so markup deliverables get deterministic same-turn QA.

Verified end-to-end: evalValidators.checkDocxStructure reports 4
insertions / 3 deletions / 3 comments on a three-issue arbitration
markup; python-docx opens the package; range ids match the comments
part; accepted view reads correctly. 5 unit tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018bhP89cYSdEEjHNPnxacns
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents 1fadca12
Stats 3 files changed , +327 , -3
Part of SourceDoc / DOCX engine: redlines, tracked changes, editing benchmark

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-95e53f17.md from inside the repo you want the change in.

⬇ Download capture-commit-95e53f17.md