test: validate ai-review.yml@main invocation end-to-end#20
Conversation
|
/dd-review |
There was a problem hiding this comment.
AI review by Claude - workflow run
Review verdict: patch is incorrect
The fibonacci function has an off-by-one error in its loop bound. Starting from a, b = 0, 1, computing fib(n) requires n iterations, but the loop uses range(n - 1). This makes it return fib(n-1) for every n >= 1 — e.g. fibonacci(1) returns 0 instead of 1, and fibonacci(9) returns 21 instead of 34. The __main__ demo would print a sequence shifted by one position. See the inline comment for the fix.
Confidence: 0.97
| a, b = 0, 1 | ||
| for _ in range(n - 1): |
There was a problem hiding this comment.
Off-by-one error in the loop bound. With the accumulator initialized to a, b = 0, 1, producing fib(n) needs n iterations, but range(n - 1) runs one too few. As written the function returns fib(n-1) for all n >= 1: fibonacci(1) yields 0 (should be 1), fibonacci(9) yields 21 (should be 34). The n == 0 early return already covers the zero case, so the loop count should simply be n.
| a, b = 0, 1 | |
| for _ in range(n - 1): | |
| for _ in range(n): |
|
Validated: ai-review.yml@main invocation works end-to-end (self-checkout resolved to main correctly, prompt_file_pattern discovered codereview_guideline.md, review caught the intentional fibonacci bug). Closing without merging. |
Purpose
Pure validation PR - confirms the post-merge state of PR #19 works correctly:
Will close without merging once validated.
🤖 Generated with Claude Code