Skip to content

docs: add adversarial code review guide#292

Open
jayaramkr wants to merge 2 commits into
AgentToolkit:mainfrom
jayaramkr:docs/adversarial-review-guide
Open

docs: add adversarial code review guide#292
jayaramkr wants to merge 2 commits into
AgentToolkit:mainfrom
jayaramkr:docs/adversarial-review-guide

Conversation

@jayaramkr

@jayaramkr jayaramkr commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

What

Adds docs/adversarial-review.md — a documented method for reviewing high-risk PRs where every finding carries a reproduction or it doesn't ship.

Why

We've been running this flow ad hoc on recent PRs (span-extraction, consistency guidelines, the memory-hooks seam) and it's caught real correctness bugs that green CI missed — fail-open compliance seams, silent signal inversions, crashes on realistic malformed inputs. This writes the method down so it's repeatable.

Contents

  • The 5-step method: isolate & baseline → fan out independent skeptic reviewers (one per risk surface) → reproduce by execution → verify headline claims → rank/separate/credit.
  • A reusable sub-agent prompt template.
  • Guidance on drafting and posting the review (summary + inline comments, deliberate verdict).

Docs-only; no code or behavior change.

Summary by CodeRabbit

  • Documentation
    • Added guidance for conducting consistent, evidence-based pull request reviews.
    • Documented steps for establishing baselines, investigating potential issues, validating findings through execution, and ranking confirmed results.
    • Added reusable review guidance covering edge cases, correctness, integrations, and test quality.
    • Clarified reporting standards, review comment placement, verdict selection, and configuration options.

A reproduce-by-execution method for reviewing high-risk PRs: isolate in a
worktree and baseline, fan out independent skeptic sub-agents scoped one per
risk surface, verify headline findings by execution, then rank and credit
what's correct. Includes the reusable sub-agent prompt template.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jayaramkr, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d9a42641-f226-42f8-ac5d-76c2637fb1cb

📥 Commits

Reviewing files that changed from the base of the PR and between 8aad997 and df07286.

📒 Files selected for processing (2)
  • .claude/commands/adversarial-review.md
  • .gitignore
📝 Walkthrough

Walkthrough

Adds a documented adversarial code review workflow covering isolated execution, baseline capture, independent sub-agent analysis, reproducible validation, result verification, severity ranking, and review posting guidance.

Changes

Adversarial Review Workflow

Layer / File(s) Summary
Review workflow and validation
docs/adversarial-review.md
Defines the five-step review process, reusable risk-focused sub-agent prompt, evidence requirements, review controls, and guidance for drafting, anchoring, and selecting verdicts.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the documentation change adding an adversarial code review guide.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/adversarial-review.md`:
- Line 37: Update the fenced prompt block in adversarial-review.md to include a
language identifier, preferably text, immediately after the opening fence so the
documentation passes markdownlint MD040.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2fc269c9-d4ef-4e5e-b63f-c0ea23836e21

📥 Commits

Reviewing files that changed from the base of the PR and between 8aa3da0 and 8aad997.

📒 Files selected for processing (1)
  • docs/adversarial-review.md


Fill in the bracketed parts, one instance per risk surface.

```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a language identifier to the fenced prompt block.

The unlabeled fence triggers markdownlint MD040. Use text (or another suitable language) to keep documentation lint-clean.

Proposed fix
-```
+```text
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 37-37: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/adversarial-review.md` at line 37, Update the fenced prompt block in
adversarial-review.md to include a language identifier, preferably text,
immediately after the opening fence so the documentation passes markdownlint
MD040.

Source: Linters/SAST tools

Un-ignore .claude/commands/ so project slash commands are checked into the repo
and available to anyone who clones it (personal .claude/settings*.json stay
ignored). Adds the /adversarial-review <PR#> command, which drives the flow in
docs/adversarial-review.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants