Reviewer: self-review を事前検出し無駄な APPROVE/REQUEST_CHANGES を省く#512
Merged
clonable-eden merged 6 commits intomainfrom Mar 23, 2026
Merged
Conversation
Verify reviewer.md contains self-review pre-detection logic: - PR author vs current GH user comparison before review submission - COMMENT event for self-review - Old try-catch fallback pattern removed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the try-catch fallback pattern (attempt APPROVE → catch 422 → COMMENT) with proactive self-review detection. The reviewer now compares PR author with the current GitHub user before submitting, using COMMENT from the start for self-reviews. This eliminates unnecessary 422 errors and resolves the ambiguity where reviews were reported as "approved" but only posted as COMMENT on GitHub. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract the self-review/normal event selection into a VERDICT/EVENT variable pattern, reducing duplication in the Approve and Request Changes code blocks. Update tests to match the refactored pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
clonable-eden
commented
Mar 23, 2026
Owner
Author
clonable-eden
left a comment
There was a problem hiding this comment.
Review: APPROVE ✅
Changes correctly implement issue #509 — pre-detecting self-review before submitting APPROVE/REQUEST_CHANGES to avoid 422 errors.
Evaluation
Correctness ✅
- Pre-detects self-review by comparing
PR_AUTHORwithGH_USERbefore submitting - Uses
gh apiinstead ofgh pr review(rationale clearly documented:gh pr review --approveposts body as COMMENTED even on failure) - VERDICT/EVENT separation is clean: VERDICT represents the review decision, EVENT represents what's sent to GitHub
notify-complete.shcorrectly uses the verdict (approved/changes-requested), not the GitHub event type
Conventions ✅
- PR body includes
closes #509 - Uses
$((var + 1))instead of((var++))per known pitfall guidance - Content-based tests are appropriate per CLAUDE.md exception (no executable scripts changed)
- Test placed in
tests/orchestrator/following existing reviewer test pattern
Tests ✅
- 7 content-based regression guards covering: section presence, variable names, API calls, ordering, and absence of old pattern
- CI passes (4/4 checks OK)
Scope ✅
- Changes are focused on the issue without unrelated modifications
Owner
Author
|
テストなしで |
reviewer.md is an agent definition (prompt instructions), not an executable script. Per CLAUDE.md: "Test only the behavior of executable scripts." Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Workers tend to write tests for .md file changes despite the "test only executable scripts" rule. Add explicit guidance that agent definitions, skill definitions, and documentation files are not test targets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #509
Summary
Test Plan