Agent sonnet

Peer Reviewer

Adversarial reviewer subagent for /dr-verify Layer 2/3 cross-Claude-family fallback. Reviews PRD/plan/code in clean isolated context. Findings-only, read-only tools.

Overview

The Peer Reviewer is the cross-Claude-family fallback subagent used by /dr-verify Layer 2 when no external provider (DeepSeek, Moonshot, OpenRouter) is configured. It runs as a Claude Code subagent at model: sonnet in a freshly isolated context — no upstream conversation history that could induce self-agreement bias — and produces structured JSONL findings under the canonical schema in skills/self-verification.md § Findings Schema.

Why It Exists

Layer 2 of the tri-layer verification pipeline is most effective when the reviewer is a different model checkpoint than the one that produced the artifact. The strongest mitigation is cross-vendor (different company, different training run, different RLHF). Cross-Claude-family — Sonnet reviewing Opus output, or vice versa — is the middle tier: different model checkpoints with different post-training runs, isolated subagent context, no per-user external API key required (covered by the Claude subscription). It is the default fallback when chain steps #1–#4 yield no provider.

When It's Used

Activated by dev-tools/resolve-peer-provider.sh at chain step #5 — that is, when:

  • --peer-provider CLI flag is not set, AND
  • ./datarim/config.yaml has no peer_review.provider, AND
  • ~/.config/datarim/config.yaml has no peer_review.provider, AND
  • ~/.config/coworker/profiles.yaml code profile has no recommended_provider, AND
  • The runtime is Claude Code (Codex CLI degraded mode skips this step and falls through to step #6 same-model isolated).

Output Schema

Findings tagged with:

  • source_layer: "peer_review"
  • peer_review_provider: "sonnet"
  • peer_review_mode: "cross_claude_family"
  • peer_review_provider_source_layer: "fallback_subagent"

The reviewer follows the JSONL emission discipline: emit only defects or incorrect-premise findings; never emit PASS-as-finding entries (e.g. {"check_name": "F001 cleared, no finding"}). Confirmations of passing claims compress into the final-line summary {cleared_iter1: [...], total_new_findings: N}.

Tools

Read-only by design: Read, Grep, Glob. Cannot edit files, write commits, or run arbitrary shell. The subagent ID and findings are persisted in the audit log datarim/qa/verify-{TASK-ID}-{stage}-{iter}.md for trace.

Adversarial Frame

Receives the same canonical adversarial prompt template as cross-vendor providers (see skills/self-verification.md § Single-Prompt Loop Mechanics) verbatim. Prompt instructs the reviewer to find weaknesses, not bless the doc — at minimum 2 substantive concerns OR explicit grep evidence justifying zero findings.

Limitations and Empirical Status

Cross-Claude-family is the first measured tier: empirical bias delta vs same-model self-critique remains under observation in the active dogfood window (per dev-tools/measure-prospective-rate.sh with --mode cross_claude_family). The hypothesis — different post-training is enough to break the self-agreement loop without crossing vendors — is plausible but not yet validated at scale. When external API budget is available, prefer cross-vendor (DeepSeek default, ~14× cheaper than Sonnet on output tokens).

Skills Used

self-verification (canonical findings schema + JSONL discipline), datarim-system (path resolution, audit log location).