@@ -40,11 +40,13 @@ agents:
4040 ## ALWAYS Post a Review
4141
4242 You MUST always post a review via the GitHub API, even if no issues were found.
43- - If no issues: Post an APPROVE with a brief positive message (e.g., "Documentation looks good! No issues found.")
43+ - If no issues: Post a COMMENT with a brief positive message (e.g., "Documentation looks good! No issues found.")
4444 - If issues found: Post COMMENT or REQUEST_CHANGES with inline comments
4545
4646 Users find it confusing when no review comment is posted - they don't know if the review ran.
4747
48+ IMPORTANT: Never use APPROVE - this agent should provide feedback but not count as approval.
49+
4850 ## Posting Reviews with Inline Comments
4951
5052 The drafter returns issues in this format:
@@ -68,10 +70,11 @@ agents:
6870 ```
6971
7072 Map your verdict to event:
71- - "APPROVE" - No issues, or only minor/medium issues (this should be the DEFAULT)
72- - "COMMENT" - Issues worth noting but not blocking (use this for most findings)
73+ - "COMMENT" - No issues or minor/medium issues (this should be the DEFAULT)
7374 - "REQUEST_CHANGES" - ONLY for critical issues that WILL cause harm
7475
76+ Never use "APPROVE" - this agent provides feedback but should not count as approval.
77+
7578 ## When to use REQUEST_CHANGES (RARE - think carefully!)
7679
7780 REQUEST_CHANGES should be used sparingly. Only use it for issues that meet ALL criteria:
@@ -220,25 +223,40 @@ agents:
220223
221224 ## Line Number Calculation Algorithm
222225
223- 1. Find the hunk header before your target line: `@@ -X,Y +Z,W @@`
224- - Z is the line number of the FIRST line after the header in the new file
225- 2. Starting from that first line (which is line Z), count through context (` `) and added (`+`) lines
226- 3. SKIP all deleted (`-`) lines - they don't exist in the new file
227- 4. Your target line number = Z + (number of ` ` and `+` lines before your target)
226+ CRITICAL: Use this exact algorithm to avoid off-by-one errors.
227+
228+ 1. Find the hunk header: `@@ -X,Y +Z,W @@`
229+ - **USE THE +Z VALUE** (the number after the +, NOT the -X value)
230+ - Z is the 1-indexed line number where the hunk starts in the NEW file
231+ - Z is ALREADY 1-indexed (first line of file is 1, not 0)
232+ - Example: In `@@ -81,11 +82,12 @@`, use Z=82 (not 81!)
228233
229- Example:
234+ 2. For each line after the hunk header, maintain a running line number starting at Z:
235+ - Context line (starts with ` `) → this is current_line_number, increment counter
236+ - Added line (starts with `+`) → this is current_line_number, increment counter
237+ - Deleted line (starts with `-`) → SKIP, do NOT increment counter
238+
239+ 3. When you find your target `+` line, the current_line_number IS the line to report.
240+
241+ Example walkthrough:
230242 ```
231- @@ -10,5 +15,7 @@
232- context line <- This is line 15 (Z from header, offset 0 )
233- context line <- This is line 16 (Z + 1 context line )
234- +problematic line <- This is line 17 (Z + 2 lines ) ← report as LINE: 17
235- context line <- This is line 18 (Z + 3 lines )
236- -deleted line <- SKIP - doesn't exist in new file
237- context line <- This is line 19 (Z + 4 lines, skipped the - )
243+ @@ -10,5 +15,7 @@ <- Z=15, start counting from 15
244+ context line <- Line 15 (current=15, increment to 16 )
245+ context line <- Line 16 (current=16, increment to 17 )
246+ +problematic line <- Line 17 (current=17, THIS is your target ) ← report LINE: 17
247+ context line <- Line 18 (current=18, increment to 19 )
248+ -deleted line <- NOT in new file, current stays at 19
249+ context line <- Line 19 (current=19, increment to 20 )
238250 ```
239251
240- IMPORTANT: GitHub uses 1-indexed lines. Do NOT use 0-indexed line numbers.
241- Do NOT say "around line X" - give the exact line number of the problematic `+` line.
252+ ANOTHER WAY TO THINK ABOUT IT:
253+ Line number = Z + (count of ` ` and `+` lines that appear BEFORE your target in the diff)
254+ - "Before" means: lines that come earlier in the hunk, NOT including the target itself
255+ - First line in hunk: Z + 0 lines before it = Z
256+ - Second line in hunk: Z + 1 line before it = Z + 1
257+ - Third line in hunk: Z + 2 lines before it = Z + 2
258+
259+ IMPORTANT: GitHub expects 1-indexed line numbers. Z is already 1-indexed from the diff.
242260
243261 toolsets :
244262 - type : filesystem
0 commit comments