Skip to content

[hardening] DeletedRun writes literal '[deleted]' instead of original span text #53

@MTCMarkFranco

Description

@MTCMarkFranco

Bug

OpenXmlMarkupService.ApplyOne writes a literal "[deleted]" token into the DeletedRun regardless of what was actually deleted.

Location: src/LambdaRag.Markup/OpenXmlMarkupService.cs line ~186

paragraph.AppendChild(new DeletedRun(new Run(new DeletedText("[deleted]") ...

Impact: When a reviewer accepts/rejects a tracked deletion in Word, they see the strikethrough text [deleted] instead of the actual original wording. This makes tracked-change accept/reject ambiguous and is unsuitable for legal review.

Expected: DeletedRun should contain the original span text (a.Span source slice) so accepting the deletion removes the right characters and rejecting it preserves them.

Acceptance criteria

  • DeletedRun contains the actual original text from the span, not a placeholder.
  • Unit test asserting that for a Replace annotation with original "foo bar""baz", the resulting docx contains a w:del with w:delText = "foo bar".
  • Idempotency test still passes (deterministic output preserved).
  • Engine genericity guard test still passes (no domain coupling introduced).

Out of scope

  • Precise span anchoring (tracked separately).
  • Cross-paragraph spans (tracked separately).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmodalityOutput modality (report/markup/UI/API)phase-1-pattern-defPhase 1: Pattern definition (writing)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions