Add original revision context to review replies

What does this MR do and why?

Add one original comment anchor beside the File/Diff context for @GitLabDuo mention replies, plus the current MR head when available. The head uses diff_head_sha, including its source-branch fallback. Added/context lines use the original head SHA, new path, and new line; deleted lines use the base SHA, old path, and old line. Missing, nontext, or incomplete anchors are omitted.

Conversation messages retain author and body only. This affects mention replies, not the main review or re-review flow.

References

The companion prompt experiment is optional and not required for this context change to merge. Its missing-history behavior remains unresolved.

Historical ordered-list finding.

Screenshots or screen recordings

Not applicable - backend context only.

How to set up and validate locally

Inspect the emitted goal in a local fixture MR after a push: confirm one original anchor alongside the current head. For a deleted line, confirm base coordinates; for an ordinary comment, confirm no anchor.

At 04177e84, 21 handler specs, RuboCop, and local push hooks pass. Coverage includes a persisted diff-thread reply, moved positions, deleted lines with a renamed path, missing/incomplete/nontext anchors, ordinary comments, source-branch fallback, and blank head SHAs.

Earlier controlled retrieval evaluation used the previous verbose payload. Available-history cases succeeded with the experimental prompt, but missing-history replies remained unreliable. The revised compact payload has not undergone model evaluation or deployed DAP replay.

MR acceptance checklist

  • Pass handler specs and local checks.
  • Verify compatibility with the existing deployed mention flow.

Draft; CI remains skipped pending authorization.

Merge request reports

Loading
Loading