Skip to content

ci: make the claude-pr-loop fix agent adversarial and scope-aware - #228

Merged
allxsmith merged 1 commit into
mainfrom
claude/adversarial-fixer
Jul 6, 2026
Merged

allxsmith merged 1 commit into
mainfrom
claude/adversarial-fixer

Conversation

@allxsmith

@allxsmith allxsmith commented Jul 6, 2026 •

Copy link
Copy Markdown
Owner

Description

Item 1 of 3 from the Bun/robobun-inspired loop hardening.

The fix agent in claude-pr-loop.yml behaved like an order-taker — it tried to satisfy every CodeRabbit finding, including the out-of-scope "make Button/Link fully generic-polymorphic" ask that #188 explicitly deemed unnecessary. It burned its entire turn budget attempting that refactor and failed with error_max_turns (twice on #225, even after 40→80).

Fix: add a BE ADVERSARIAL directive to the fix prompt:

  • Read the linked issue's scope and refute findings that exceed it (even technically-valid ones).
  • Treat the opus deep review's clean verdict as a strong prior — findings in areas it cleared need a concrete, reproducible bug to act on.
  • Never undertake a large type-system/architecture refactor to satisfy one reviewer.
  • Refute = reply with a code-cited reason + push no code; let contested findings escalate to needs-human-review instead of thrashing.

This mirrors the "adversarial code review" + "verify the problem is real" model that Bun/robobun use (per this session's deep-research).

Affected package(s):

  • Other: CI / GitHub Actions (.github/workflows/claude-pr-loop.yml)

Related Issue(s)

Refs #188. Unblocks #225 (the fixer will now refute the Major and converge the rest).

Type of Change

  • Build tooling

Checklist

  • Self-reviewed; YAML validated
  • Prompt-only change to the fix job; no permission or tool changes

🤖 Generated with Claude Code

https://claude.ai/code/session_01NVR5yWevceZEFbTJmpviiM


Generated by Claude Code

Summary by CodeRabbit

  • Chores
    • Improved the automated review workflow so it handles issue scope more strictly and only raises concrete, reproducible findings.
    • Added clearer behavior for cases where a finding is not supported, helping avoid unnecessary back-and-forth on out-of-scope changes.
    • Reduced the chance of broad, unrelated changes being suggested during automated fix attempts.

The fixer was an order-taker: it tried to satisfy every CodeRabbit
finding, including out-of-scope "make it fully generic-polymorphic"
asks that #188 explicitly deemed unnecessary — burning its whole turn
budget on a refactor it should have refused (see #225's max-turns
failures).

Add a "BE ADVERSARIAL" directive to the fix prompt: read the linked
issue's scope and refute findings that exceed it; treat the opus deep
review's clean verdict as a strong prior; never attempt large
type-system/architecture refactors for one reviewer; refute (reply +
no code) and let contested findings escalate to needs-human-review
rather than thrashing. Mirrors the "adversarial code review" + "verify
the problem is real" model Bun/robobun use.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVR5yWevceZEFbTJmpviiM
@allxsmith
allxsmith merged commit b0e323d into main Jul 6, 2026
8 checks passed
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 35263c77-83d0-4197-83ea-9550154d2e46

📥 Commits

Reviewing files that changed from the base of the PR and between 337b231 and bfc39fa.

📒 Files selected for processing (1)
  • .github/workflows/claude-pr-loop.yml

Walkthrough

The Claude PR loop workflow's fix prompt was updated to instruct Claude to act as a skeptical reviewer, treating linked issue scope as a strict contract, requiring reproducible findings, prohibiting large refactors, and defining explicit refute behavior for out-of-scope or disputed findings.

Changes

Claude Fix Prompt Update

Layer / File(s) Summary
Adversarial reviewer prompt instructions
.github/workflows/claude-pr-loop.yml
Fix prompt now enforces strict scope adherence, requires concrete reproducible defects, prohibits large refactors/architecture changes, and defines refute behavior that leaves contested threads open for human escalation.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • allxsmith/bestax#216: Modifies the same claude-pr-loop.yml fix prompt/refute logic introduced in this earlier PR for the autonomous Claude PR loop workflow.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/adversarial-fixer

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://73f96988.bestax.pages.dev

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants