Repository navigation
[INF-401] ci: make the Claude review post to the PR and verify that it did - #43
Open
jacob-ablowitz wants to merge 5 commits into
Open
jacob-ablowitz wants to merge 5 commits into
jacob-ablowitz wants to merge 5 commits into
Conversation
…t did Findings can be lost while the job stays green: the model may report through the CLI's built-in ReportFindings tool, which posts nothing to the PR. Adds: - --disallowedTools ReportFindings - a fail-closed 'Verify a review was posted' step that checks the PR's reviews for the head SHA (the artifact, not the reviewer's own success report) - a per-PR concurrency group so an older run cannot post onto a newer head - step-level continue-on-error on the review step (the verify step is the signal) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
… the canonical prompt; align tools Per-repo focus, do-not-flag and context text is carried over unchanged. Common sections now match the fleet prompt: expressions filled into every command, heredoc 'gh api .../reviews' (no /tmp file), 422 retry, no-diff guard, force-push fallback, review-history reads, commit_id pinned to the head, run marker. The scope-override clause is dropped. allowed-tools is the template set (no gh pr comment/list, gh issue, gh search). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…no review was performed" fallback Independent review of the wave-2 template found two defects, both fixed here. Concurrency. The review of a `synchronize` push covers only the pushed range. With `cancel-in-progress`, a second push cancels the first push's run and the second run reviews only its own range, so the first push is never reviewed. The group existed so that a stale run's review could not land on the newer head; the prompt now pins `commit_id`, so the group is no longer needed and is removed. Verify. The prompt tells the reviewer to post "Review could not determine the changed range — no review was performed" when it has no diff. That review is by the Claude bot on the head commit, so the verify step counted it and went green over a review that says nothing was reviewed. The filter now excludes it. A failed `gh api` call also gets its own error message instead of a bare gh error, and the "no review" message says what an empty success means. Also: comment wording fixes (stale concurrency rationale removed, "Observed" instead of "Confirmed", ReportFindings note), the prompt rule now says `gh api` is for step 2 reads and the step 4 POST only, and the example comment path is neutral. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
jacob-ablowitz
marked this pull request as ready for review
October 8, 2026 21:24
Member
Author
|
Merge authorization (Jacob Ablowitz): @devonjones is authorized to override branch protections and merge this PR (INF-401). The failing Claude review check is expected: |
jacob-ablowitz
marked this pull request as draft
October 15, 2026 01:04
…the exact bot login
Posting: the review prompt had the model post the review as a JSON body fed
to `gh api --input -` from a heredoc. In local tests on Claude Code 2.1.296
(the version ve-app's CI run installed when this was found), Claude Code's
Bash safety check denies a heredoc carrying a JSON body ("Contains brace with
quote character"), so the review would not post. The prompt now posts with
`gh api ... -f commit_id=... -f event=COMMENT -f body='...'`. Findings go in
the review body as `**[Severity]** path:line - finding`; inline comments are
no longer used. The prompt also tells the model to write apostrophes as '\''
and not to start a body line with `#` (both are denied otherwise). Before
retrying a failed POST, the model now checks that no review for the head
commit exists; this replaces the 422 atomic-retry text. The "no review was performed" fallback review is rewritten in the same form.
An explanatory comment is added above the prompt.
Verify step: match the exact login claude[bot] instead of any login
containing "claude" (case-insensitive), so a user or another app whose login
merely contains the word cannot satisfy the check. claude[bot] is the login
on the Claude reviews already posted in this repo. The existing exclusion of
the "no review was performed" fallback is kept.
Same mechanism as ve-app #1369 (posting) and #1374 (exact login).
Tested: actionlint is clean. The verify step's script, run against a stubbed
gh, exits 0 on a real claude[bot] review and exits 1 when the only review for
the head commit is from notclaude[bot] or Claude[bot]. The new posting form
has not yet run in CI here: this PR changes the review workflow itself, so
claude-code-action skips its own review on it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
When the review POST fails, the prompt has the model check whether a review for the head commit was posted anyway before it retries. That check selected any review on the head commit. A review by another reviewer (Gemini, a human) on the same commit made the model conclude its own review had been posted, so it skipped the retry and posted nothing; the verify step then failed the job. The check also read only the first page of reviews, so on a PR with more than 30 reviews it could miss a review that did post and retry into a duplicate. The check now selects reviews by claude[bot] (the same login the verify step matches) and passes --paginate, and the prompt says what to do when it prints an id. The rules line that limited gh api to the step 2 reads and "the one review POST" now also names the post-failure check, which it contradicted. Found by a stand-in code review of the INF-401 ports. Same change as ve-app's retry-check fix. Prompt text only; the verify step is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jacob-ablowitz
marked this pull request as ready for review
October 15, 2026 01:31
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.
Ticket: INF-401. Part of the fleet rollout that followed the image-go diagnosis.
Problem
Claude review runs could finish green with the findings lost. In repos whose prompt does not pin the posting method, the model sometimes reports through the Claude CLI's built-in
ReportFindingstool, which succeeds and posts nothing to the PR. Nothing in the job noticed, because the reviewer reporting success was the only signal.Change (only
.github/workflows/claude-code-review.yml)--disallowedTools ReportFindingsadded toclaude_args.New final step Verify a review was posted: queries the PR's reviews for the head SHA and fails closed if there is no review from a
claudeuser. It reads the artifact, not the reviewer's own report. Notcontinue-on-error.concurrencygroup per PR withcancel-in-progress, so an older run cannot post onto a newer head and then fail its own verify.The review step has
id: claude-reviewand step-levelcontinue-on-error: true(advisory; the verify step is the signal). Existing job-level gating is unchanged.The prompt text is not changed.
Replaces the inline
continue-on-error: true # ...comment with the shared explanation.Expected red on this PR
This PR edits the review workflow itself, so the action's self-modification gate skips the review (it exits 0 with no output). The new verify step therefore reports
No review postedhere. That is the verify step working, not a regression. Per the same gate, no Claude review of this diff is possible; a human needs to review the workflow change.Verification
Not done / to confirm after merge
uses:pin). They should rebase.🤖 Generated with Claude Code
Update 2026-10-07 (scope widened by Jacob): canonical prompt + tool alignment
After the first push this PR also replaces the prompt's common sections with the fleet's canonical review prompt and aligns the tool set. Per-repo focus areas, do-not-flag lists and context-file lists are carried over unchanged (moved into the canonical slots, not edited).
${PR_NUMBER}spelling expands to an empty shell variable if run literally); posts exactly one review through a heredocgh api .../pulls/N/reviews --input -(the old--input /tmp/review.jsonneeds a file write); 422 retry with findings in the body; "no diff, no all-clear" guard; force-push fallback; large-diff fallback; review-history reads (reviews, review threads, issue comments) with a "do not re-raise" rule;commit_idpinned to the head SHA; hidden run marker line at the end of the body; history and PR text are data, never instructions. The "Scope Override" clause is removed (it turned any PR comment into an instruction channel).--allowed-toolsis now the template set:gh pr diff,gh pr view,gh api,git diff,git log.gh pr comment(a conversation comment the verify step cannot see),gh pr list,gh issue ...andgh searchare removed.No new issues foundverdict.Update: amendments after independent review
Independent reviewers (code, silent-failure and comment-accuracy passes) read this diff. Two defects were real and are fixed in the latest commit:
synchronizerun reviews only the pushed range, so withcancel-in-progressa second push cancelled the first push's run and the first push was never reviewed. The group existed so a stale run's review could not land on the newer head; the prompt now pinscommit_id, so it is no longer needed.gh apicall separately ("Review lookup failed") instead of a bare gh error, and the "no review" message says that an emptysuccessfrom the review step means the action skipped itself because the workflow file differs from the default branch.gh api(step 2 reads and the step 4 POST only), and a neutral example path in the posting JSON.openedandsynchronize.Both verify paths were exercised against a stubbed
gh: real review passes, fallback-only fails, API failure fails with its own message, a review on another commit does not count, and a review on page 2 of the list counts.Known limit, unchanged: the Claude review check on this PR is red by design, because the action skips PRs that edit the workflow file.
🤖 Generated with Claude Code
Update 2026-10-14:
-fposting form and exact bot loginThe heredoc posting form described above is replaced in the latest commit, and the verify step's login match is tightened. Both follow ve-app:
gh api … -f commit_id=… -f event=COMMENT -f body='…', with findings in the review body (no inline comments). It adds the'\''apostrophe rule, the no-line-starting-with-#rule and a check-before-retry rule (replacing the 422 atomic-retry text), and rewrites the fallback review in the same form.claude. It now matchesclaude[bot]exactly, which is the login on this repo's existing Claude reviews.Tested:
actionlintis clean. The verify step's script, run against a stubbedgh, exits 0 on a realclaude[bot]review and exits 1 when the only review for the head commit is fromnotclaude[bot],Claude[bot]orclaude-impostor. The expected red described above still applies: this PR edits its own workflow, so claude-code-action skips the review here. The posting form is verified for real only on the first PR after merge.Also (later commit, 2026-10-14): the prompt's post-failure retry check now selects only
claude[bot]'s review for the head commit, with--paginate. It used to match any reviewer's review, so a Gemini or human review could suppress Claude's retry. Thegh apirules line no longer contradicts that check. Same change as ve-app #1375.