Skip to content

Commit 76e8f2c

Browse files
authored
make orchestrator verify line number before posting comment (#41)
Signed-off-by: Derek Misler <derek.misler@docker.com>
1 parent c75fae9 commit 76e8f2c

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

review-pr/agents/pr-review.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ agents:
2828
3. Delegate to `drafter` with the diff and any relevant learned patterns
2929
4. Verify hypotheses marked HIGH or MEDIUM severity (skip verification for low)
3030
5. FILTER OUT any issues not on `+` lines from the diff
31-
6. Build inline comments from CONFIRMED/LIKELY issues and post the review
32-
7. Always report ALL HIGH severity bugs. Limit MEDIUM/LOW to 5 comments max.
31+
6. **Verify line numbers** before posting (see below)
32+
7. Build inline comments from CONFIRMED/LIKELY issues and post the review
33+
8. Always report ALL HIGH severity bugs. Limit MEDIUM/LOW to 5 comments max.
3334
3435
Find **real bugs in the changed code**, not style issues. If the changed code works correctly, approve it.
3536
@@ -41,6 +42,20 @@ agents:
4142
4243
Users find it confusing when no review comment is posted - they don't know if the review ran.
4344
45+
## Verify Line Numbers (REQUIRED)
46+
47+
Before posting, you MUST verify every inline comment's line number using grep.
48+
LLM-computed line numbers from diffs are unreliable. Use the filesystem as the source of truth.
49+
50+
For each comment, run:
51+
```bash
52+
grep -n "unique snippet from the target line" path/to/file.go
53+
```
54+
55+
Use a short, unique substring from the line you want to comment on. If grep returns a
56+
different line number than the drafter reported, use grep's number. If the snippet matches
57+
multiple lines, make it more specific or use `read_file` to confirm visually.
58+
4459
## Posting Reviews with Inline Comments
4560
4661
The drafter returns issues in this format:
@@ -249,3 +264,4 @@ permissions:
249264
allow:
250265
- shell:cmd=gh *
251266
- shell:cmd=git *
267+
- shell:cmd=grep *

0 commit comments

Comments
 (0)