feat(review): first-class "edited in place" comment state (Tier B) - #196
Merged
Conversation
…ressed) Tier B of the deterministic review-state work. When a comment's exact lines are edited in place -- the recorded text changes but its before/after context stays intact -- prereview now classifies it `edited` (anchor_status), a deterministic "likely addressed" hint, and badges it. This fills the gap when the agent addresses a comment but skips `prereview done`: the reviewer sees "likely addressed" and can confirm/resolve, instead of the comment sitting there looking untouched. Detection lives in the existing relocate classifier (anchor.go): the `case 0` that used to blanket-label a gone-from-its-lines comment `outdated` now splits it -- if the region is still BRACKETED by its recorded context (before AND after neighbors both in place) it is `edited`, else `outdated`. Requiring both sides is what separates an in-place edit from a deletion (which shifts the after-context away). Reuses neighborScore; no fuzzy matching. Semantics (the conservative default): - edited != correctly addressed, so it STAYS actionable -- a badge, never a drop; a wrongly-edited comment is never hidden. (An opt-in auto-resolve toggle is a deferred follow-up, not this change.) - `done` (processed.jsonl) and `resolved` win: the badge is suppressed when either is set, so it only shows in the gap it exists to fill. - `moved` stickiness is untouched; `edited` re-derives on each relocate. Badge renders green (a positive "likely addressed", distinct from grey moved / red outdated) in the inline card and the all-comments overview. Tests: unit (an in-place edit -> edited; a deletion or a disturbed-context edit -> outdated) + a browser e2e (comment a line, edit it in place, reload -> the "likely addressed" badge appears, no prereview command). Template goldens regenerated for the new conditional (no visible change for non-edited comments). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FG91be8B49Jq7sNMJskM8c
# Conflicts: # testdata/render/update-diff-card-thread.payload.golden # testdata/render/update-markdown-block-comment.payload.golden
…eanchor e2e The Tier B `edited` classifier compared context with neighborScore>0, which a far-off blank line could satisfy — so an in-place edit whose immediate before line had actually changed was still read as "edited". Tighten it to require the IMMEDIATELY-adjacent neighbor on each side to match, which cleanly separates an in-place edit from a deletion (shifts the after-neighbor) or a restructure (changes the before-neighbor). The existing re-anchor e2e edited a commented line but kept its context intact — which is now correctly `edited`, not `outdated`, so its outdated/re-anchor assertions no longer applied. Make its rewrite a genuine orphan (change the before-context too), keeping the trailing line as the re-anchor target. The in-place-edit → edited case is covered by the new TestE2E_EditedInPlaceBadge. Full unit + e2e suites green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FG91be8B49Jq7sNMJskM8c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Tier B of the deterministic review-state work (Tier A is #195). When a comment's exact lines are edited in place — the recorded text changes but its before/after context stays intact — prereview now classifies the comment
editedand badges it "likely addressed".This fills the gap when the agent addresses a comment but skips
prereview done: the reviewer sees "likely addressed" (deterministic, from the file itself) and can confirm/resolve, instead of the comment sitting there looking untouched.How
Detection reuses the existing relocate classifier (
anchor.go). Thecase 0that used to blanket-label a gone-from-its-lines commentoutdatednow splits it:edited;outdated, as before.Requiring both sides is what separates an in-place edit from a deletion (which shifts the after-context away so it no longer matches at the recorded position). Reuses
neighborScore; no fuzzy matching.Semantics (conservative default)
edited≠ correctly addressed, so it stays actionable — a badge, never a drop. A wrongly-edited comment is never hidden.done/resolvedwin: the badge is suppressed when either is set, so it only shows in the gap it exists to fill.movedstickiness untouched;editedre-derives on each relocate.moved/ redoutdated) renders in the inline card and the all-comments overview.Tests
edited; a deletion or a disturbed-context edit →outdated(guards the false positive).Deferred (explicitly out of scope)
The opt-in auto-resolve toggle (make
editedauto-leave the actionable set) from the plan's B3 — genuinely optional, and the conservative badge-only default is the safer starting point. Easy to add later if wanted.🤖 Generated with Claude Code
https://claude.ai/code/session_01FG91be8B49Jq7sNMJskM8c