feat: extend comment carry-forward to code files#324
Merged
tomasz-tomczyk merged 2 commits intomainfrom Apr 21, 2026
Merged
Conversation
carryForwardComments() only processed markdown files, leaving code files to fall through to carryForwardAllComments() which copies at original positions with zero remapping. This meant code file comments pointed to wrong lines after agent edits, and comments on deleted lines became invisible. - Unified carryForwardFileComments handles all file types with LCS line mapping + anchor verification (previously markdown-only) - Snapshot PreviousContent for all files with comments, not just markdown - Fix old-side anchor extraction: read from base ref via git show instead of working tree (which doesn't contain deleted lines) - Add fileContentAtRef() helper for reading file content at a git ref Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
…rward Old-side comments reference the base ref (stable across rounds), not the working tree. Running them through LCS remapping produced meaningless results and incorrectly marked them as drifted. - Skip LCS remapping and anchor correction for old-side comments - Add test for old-side comment position preservation - Fix stale comment about "anchor-only search" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
carryForwardComments()only processed markdown files — code files fell through tocarryForwardAllComments()which copied at original positions with zero remappingcarryForwardFileCommentsnow handles all file types with LCS + anchor verificationAddCommentto extract anchor from base ref for old-side comments viagit showReview
Test plan
go test ./...passes🤖 Generated with Claude Code