From 3faf509a38773355cb902ec7469b6c8b55186841 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 7 Jul 2026 05:43:22 +0000 Subject: [PATCH] ci: give the deep review CodeRabbit-grade formatting, a human blurb, and 2x turns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The deep review posted terse, jumbled-paragraph findings and a one-line summary — hard for a human to scan and thinner than CodeRabbit's structured output. Rework the reviewer prompt so its output is both AI-actionable and human-readable: - Every inline finding is now structured Markdown: bold title + severity (Critical/Major/Minor) + category tag, What / Why it matters / Fix (a suggestion block or fenced diff), long traces folded into
, and a mermaid diagram when a flow picture beats prose. - The certifying summary review is now a severity table + an Overall read + a short, human 'California surfer' blurb — written to a file and posted via gh api -F body=@file so the tables/markdown survive intact. The machine-parsed marker stays the first line. - Double the reviewer's budget (--max-turns 60 -> 120): richer, verified, well-formatted findings need more room, and the deep review missed two real bugs on #243 that CodeRabbit caught with deeper per-file analysis. Follow-up (separate PR): the bounded 3-round reviewer<->bestaxbot rebuttal on refuted findings, which needs gate/state-machine changes. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01NVR5yWevceZEFbTJmpviiM --- .github/workflows/claude-review.yml | 55 ++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index 7576805b0..53ce9e8e6 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -93,7 +93,7 @@ jobs: # The PR opener/labeler is claude[bot] (the implementer) by design. allowed_bots: 'claude' claude_args: | - --max-turns 60 + --max-turns 120 --model claude-opus-4-8 --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh api:*),Bash(pnpm run:*),Bash(pnpm test:*),Bash(pnpm exec:*),Bash(pnpm --filter:*)" prompt: | @@ -116,16 +116,55 @@ jobs: - meaningful coverage gaps in the new code 3. Do NOT post nitpicks, style, or formatting comments — CodeRabbit and the linters cover those. + + FORMAT — your output is read by BOTH the fix agent (which needs + precise, actionable detail) and a human maintainer (who wants it + to read cleanly). Use GitHub-flavored Markdown well; NEVER post a + jumbled wall-of-text paragraph. 4. Post each defect as an inline comment with mcp__github_inline_comment__create_inline_comment - (confirmed: true). - 5. ALWAYS finish — findings or not — by submitting one summary + (confirmed: true). Structure EVERY inline finding as Markdown: + - A bold one-line title followed by a severity + category tag, + e.g. `**Observer ref can be clobbered** — 🟠 Major · + Correctness`. Severity is one of 🔴 Critical / 🟠 Major / + 🟡 Minor; category is Correctness / Accessibility / API / + Coverage / SSR / Performance. + - **What:** one or two sentences on the actual defect. + - **Why it matters:** the concrete failure mode or user impact. + - **Fix:** a ```suggestion block when it is a small local edit, + otherwise a fenced diff or code snippet. + - Put any long trace or reasoning inside a
block so + the comment stays scannable. + - Include a ```mermaid diagram when a control-/data-flow picture + makes the bug clearer than prose (GitHub renders it). + 5. ALWAYS finish — findings or not — by submitting ONE summary review that certifies the deep review ran (the loop's gate - requires it before it may hand the PR to a human): - gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews" \ - -f event=COMMENT \ - -f body="**Deep review complete** — finding(s) posted as inline comments." + requires it before it may hand the PR to a human). Write the + body to a file first so the Markdown/tables survive intact, + then post it: + + (write this to /tmp/deep-review.md, filling in the values) + + ## Deep review — finding(s) + + | # | Severity | Area | Finding | Location | + |---|----------|------|---------|----------| + | 1 | 🟠 Major | Correctness | | `path:line` | + + **Overall:** <2-3 sentences — is the change sound, what is the + riskiest part, and what should the human focus on first.> + + > 🏄 California surfer summing up the vibe of this PR — fun, but + > still accurate about whether it is good to go.> + + then: + gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews" \ + -f event=COMMENT -F body=@/tmp/deep-review.md + Keep the literal marker "" as the - first thing in the body — it is machine-parsed. + VERY FIRST line of the body — it is machine-parsed. With zero + findings, put "No blocking defects found." in the table area and + still include the Overall line and the surfer blurb. 6. Never push, merge, close, or label anything, and never write "@claude" or "@coderabbitai" in any text.