Skip to content

test: validate ai-review.yml@main invocation end-to-end#20

Closed
chouetz wants to merge 1 commit into
mainfrom
test/validate-main-invocation
Closed

test: validate ai-review.yml@main invocation end-to-end#20
chouetz wants to merge 1 commit into
mainfrom
test/validate-main-invocation

Conversation

@chouetz

@chouetz chouetz commented Jul 7, 2026

Copy link
Copy Markdown
Member

Purpose

Pure validation PR - confirms the post-merge state of PR #19 works correctly:

  • `ai-review.yml` on `main` now points `uses:` at `@main` (flipped from the feature branch pointer now that main has `prompt_file_pattern` declared).
  • `prompt_file_pattern: '**/codereview_guideline.md'` should discover `codereview_guideline.md` at the repo root via the self-checkout + `discoverGuidelinesForChangedFiles` path.
  • `fibonacci.py` has an intentional off-by-one bug for the reviewer to catch, confirming the full pipeline end-to-end.

Will close without merging once validated.

🤖 Generated with Claude Code

@chouetz chouetz requested a review from a team as a code owner July 7, 2026 20:37
@chouetz

chouetz commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/dd-review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread fibonacci.py
Comment on lines +8 to +9
a, b = 0, 1
for _ in range(n - 1):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
a, b = 0, 1
for _ in range(n - 1):
for _ in range(n):

@chouetz

chouetz commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

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.

@chouetz chouetz closed this Jul 7, 2026
@chouetz chouetz deleted the test/validate-main-invocation branch July 7, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant