← Back to Pull requests

ci: Claude review check on every PR, with REVIEW.md #667

Open
unknown opened this pull request with 334 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 07, 2026 18:29 UTC
Author

Adds an independent Claude review to every same-repo PR, reported as the Claude review check. It fails while any Important finding is open, so agents can land a PR on this check instead of a Reviewed-by: line. This is layer 2 of the Osmani review model in dfakkeldy/grok-bots#932. A separate claude-skills PR teaches land_pr.py to accept the check.

How it works

  • .github/workflows/claude-review.yml runs on opened, synchronize, reopened and ready_for_review. It skips forks, drafts and promotion heads (nightly, weekly, main).

  • .github/scripts/claude_review.py prepare picks a mode. review runs when the PR's own diff changed (by patch-id). skip runs for base merges, re-runs and reopens: no Claude, and the earlier verdict stands. rethink runs after three rounds. empty runs when every changed file is on the ignore list. It writes Claude's brief: the PR's stated intent, REVIEW.md from the base branch, the diff, the new diff since the last round, and the earlier findings with their replies.

  • Claude (Opus, pinned claude-code-action) only reads: Read, Grep, Glob and git diff/log/show. It answers through --json-schema structured output.

  • finish posts one COMMENT review with inline findings marked Important, Nit or Pre-existing. The review opens with a count line or "no issues found". It replies to and resolves the earlier Important threads that Claude found fixed or accepted, resolves Nit and Pre-existing threads at once (so they never block), and fails the check while an Important thread is open.

  • REVIEW.md holds what fails here (the AGENTS.md evidence rules, privacy, secrets, frozen-input pins), what never counts (style, things CI catches), the paths to ignore and the reporting rules.

  • claude_review.py measure --since DATE counts what happened to each finding (fixed, rejected, intended, changed, no response) for the two-week noise check.
  • Testing


  • python3 -m unittest discover -s .github/scripts/tests -v: 21 new tests, all 96 pass. They cover the modes, patch-id across a base merge, the interdiff, anchoring, the nit cap, never re-raising a settled finding, settling threads, the rethink gate and failure without posting when Claude doesn't finish.

  • Live run on this PR: (filled in below after the workflow ran)
  • Risk


    Stop-list tier (workflow and .github/scripts). It reads with CLAUDE_CODE_OAUTH_TOKEN, so each review counts against Dan's Claude usage. A failed Claude run fails the check, and re-running the job retries it. Nothing merges on this check until the claude-skills change lands.

    How to revert


    gh pr revert <this PR>. Threads and reviews already posted stay on their PRs.

    Diff: 334 lines (+250 / -84) across 4 files Reviewer: github-actions[bot] Review duration: 9m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.47) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 334 lines diff across 4 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.348
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #667"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.2% (MEDIUM) · Higher = larger blast radius
    47.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.1% · Safe to merge
    25.1%