Skip to content

feat(docx-markdoc): preserve existing revisions during annotation projection #949

Description

@stevenobiajulu

Summary

docx-markdoc cannot compile annotation presentation projections when the source DOCX already contains tracked revisions. Compilation fails with EXISTING_REVISIONS_UNSUPPORTED, even when the requested change is limited to editing or re-presenting canonical comments/footnotes.

This prevents brownfield annotation workflows from operating directly on negotiated documents that already contain redlines. Accepting the revisions on a derivative allows annotation compilation to proceed, but destructively changes the review state and should not be required.

Privacy-safe reproduction

Use a synthetic DOCX built with the shared fixture infrastructure:

  1. Create a document with at least one existing w:ins or w:del revision.
  2. Add a supported ranged or point comment and/or a supported point footnote.
  3. Import it with importDocxToMarkdoc.
  4. Edit an annotation body or set an explicit presentation="comment", presentation="footnote", or presentation="preserve" choice.
  5. Call compileMarkdoc using the anchored source.

Actual result: compilation fails with EXISTING_REVISIONS_UNSUPPORTED before annotation projection can complete.

Control: accept the pre-existing revisions on a disposable derivative, repeat the import/edit/compile workflow, and annotation preservation/projection succeeds.

Expected behavior

Annotation-only compilation should preserve pre-existing tracked revisions exactly while applying annotation body edits and presentation projection. It must not accept, reject, flatten, duplicate, or re-author existing revisions.

If exact preservation cannot be proven for a particular topology, compilation should fail atomically with structured, annotation-specific and revision-specific diagnostics.

Acceptance criteria

  • A source containing supported pre-existing tracked revisions can import and compile supported annotations without accepting or rejecting those revisions.
  • Existing revision XML, authorship, dates, IDs, accept/reject semantics, and story placement remain intact.
  • Comment and footnote bodies can be edited and reopened successfully.
  • preserve, comment, and footnote projections work from the same canonical annotation IR.
  • Point and range geometry follows the canonical paragraph-index/visible-coordinate SSOT.
  • Verification proves both annotation dispositions and preservation of pre-existing revisions.
  • Unsupported combinations fail atomically with structured diagnostics.
  • Tests use shared synthetic DOCX fixtures and include accept/reject round-trip assertions.

Regression coverage

  • existing insertion plus ranged comment body edit;
  • existing deletion plus point comment body edit;
  • existing revisions plus point footnote body edit;
  • comment-to-footnote and footnote-to-point-comment projections;
  • reply topology alongside existing revisions;
  • revisions in supported ancillary stories, where applicable;
  • ambiguous or unsupported revision/annotation topology fails closed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions