Summary
carryForwardComment() in watch.go:280 copies all Comment fields except GitHubID. When a comment pulled from GitHub (via crit pull) is carried forward during a round-complete, its GitHubID is lost.
Impact
After a multi-round review cycle using crit pull + crit push:
crit pull fetches PR comments, setting GitHubID on each
- Agent makes edits, triggers round-complete
carryForwardComment creates new comment copies without GitHubID
crit push sees GitHubID == 0 and treats them as new local comments
- Duplicate comments posted to the GitHub PR
Reproduction
crit pull on a PR with existing review comments
- Trigger round-complete (agent calls
POST /api/round-complete)
crit push --dry-run — observe that pulled comments now appear as "new" comments to push
Fix
Add GitHubID: old.GitHubID to the return struct in carryForwardComment() at watch.go:281.
Also copy GitHubID for replies — while Replies: old.Replies copies the slice, each reply's GitHubID is preserved since they're value types. But it's worth verifying this explicitly in a test.
Found by
Release audit of v0.9.2..HEAD — pre-existing issue, not introduced in this cycle.
Summary
carryForwardComment()inwatch.go:280copies allCommentfields exceptGitHubID. When a comment pulled from GitHub (viacrit pull) is carried forward during a round-complete, itsGitHubIDis lost.Impact
After a multi-round review cycle using
crit pull+crit push:crit pullfetches PR comments, settingGitHubIDon eachcarryForwardCommentcreates new comment copies withoutGitHubIDcrit pushseesGitHubID == 0and treats them as new local commentsReproduction
crit pullon a PR with existing review commentsPOST /api/round-complete)crit push --dry-run— observe that pulled comments now appear as "new" comments to pushFix
Add
GitHubID: old.GitHubIDto the return struct incarryForwardComment()atwatch.go:281.Also copy
GitHubIDfor replies — whileReplies: old.Repliescopies the slice, each reply'sGitHubIDis preserved since they're value types. But it's worth verifying this explicitly in a test.Found by
Release audit of v0.9.2..HEAD — pre-existing issue, not introduced in this cycle.