feat(review): anchor-safety validation for inline suggestions (#2140) - #3974
Conversation
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-07 09:02:04 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3974 +/- ##
=======================================
Coverage 93.70% 93.70%
=======================================
Files 373 374 +1
Lines 35076 35098 +22
Branches 12863 12870 +7
=======================================
+ Hits 32868 32890 +22
Misses 1584 1584
Partials 624 624
🚀 New features to boost your workflow:
|
…red#2140) Strip ```suggestion blocks when the finding anchor is a context line (not added in the diff); keep plain inline comments. Extract pure patch parsing to inline-suggestion-anchor.ts with unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
120477f to
fb87abc
Compare
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Summary
inline-suggestion-anchor.tsto parse ADDED (+) RIGHT-side lines from unified-diff patches — the only lines GitHub accepts a```suggestionblock onanchoredSuggestionBlockintoformatInlineBody/selectInlineCommentsalongside existing fence-safety (One-click suggested-change blocks on inline review comments #1956)Fixes #2140
Test plan
inline-suggestion-anchor.test.ts— added vs context lines, empty patch, anchor checks, unsafe fencesinline-comments.test.ts— context-line suggestion stripped; no-patch file drops findingnpx tsc -p tsconfig.json --noEmitpasses locallyMade with Cursor