Plugin eval report

brooks-lint v1.5.0

Plugin effect: ↓ -1.2 pts vs baseline — improved 3 · flat 3 · regressed 1 of 7 cases.

. Claude Code v2.1.270 2026-09-14 13:55 UTC 18m 31s $3.16 14 runs judge opus threshold 100%
Suite score · with plugin82%mean of per-case scores
Ablation Δ↓ -1.2score points vs baseline, 7 of 7 cases
Baseline score83.3%without the plugin
Cases74 of 7 ≥ 100% threshold
Perfect runs57.1%runs where every grader passed
How to read this report

01-pr29-provider-remap

evals/01-pr29-provider-remap ↓ -57.1 pts with plugin 28.6%
Results
With plugin 28.6% 0% of runs perfect
Run 1 28.6% 5 turns · $0.43 · 13:55:26 UTC
✗ fail finds-magic-string-remap

judge votes: FAIL FAIL FAIL

Judge votes✗ ✗ ✗
Evidence (what the judge was shown; for an image, a description of what was sent)
I now have the full Anthropic API reference loaded. Here's the technical verification (points 1–5), while the brooks-review agent finishes the broader code-quality pass in the background.

## Technical verification

**1. `new Anthropic({ baseURL: "..." })` for a third-party gateway — fine.**
The "use the platform's dedicated client, not `baseURL`" rule only applies to the three Anthropic-partnered hyperscaler platforms (Bedrock/Foundry/Vertex), which have dedicated SDK classes. For a generic third-party "Anthropic-compatible" gateway there's no dedicated client — `baseURL` (equivalently `ANTHROPIC_BASE_URL`) is the documented, supported mechanism. The comment about the SDK appending `/v1/messages` to the base URL is also accurate.

**2. `thinking: { type: "disabled" }` — works, but is the wrong fix.**
For the model actually in use here (`anthropic/claude-sonnet-5` via the gateway), `disabled` is a legal value — it won't 400. But the documented pitfall (real, not model-specific in practice) is that disabling thinking entirely can cause the model to write a tool call into visible text instead of leaking `<thinking>` tags into the output — silently corrupting the review output text/JSON this script parses. Since the actual complaint here is "reasoning eats the 4096-token budget," the correct fix is `output_config: { effort: "low" }` (or `"medium"`) with thinking left on `adaptive`, not `disabled`. That gets the token-budget control they want without the leakage risk. Worth raising as a should-fix, not a blocker.

**3. Model ID defaults — real IDs, but inconsistent across providers.**
`claude-sonnet-4-6` and `claude-opus-4-6` are real (previous-gen) IDs, not fabricated. The actual issue: the PR makes the `anthropic` path default to `claude-sonnet-4-6` (older gen) while the `examplegw` path defaults to `anthropic/claude-sonnet-5` (current gen). Same CI review action, two different model generations depending on which provider flag is set — that's a silent quality/behavior divergence a reviewer running `provider=anthropic` vs `provider=examplegw` wouldn't expect. Pre-existing default aside, this PR is a natural point to also bump the anthropic-path default to `claude-sonnet-5`.

**4 & 5. Reusing `ANTHROPIC_API_KEY` for the gateway key — mechanically works, but rests on an unverified assumption.**
The SDK's zero-arg client reads `ANTHROPIC_API_KEY` and sends it via the `x-api-key` header (not `Authorization: Bearer`). So `export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"` will work correctly **only if ExampleGW also authenticates via `x-api-key`**. If ExampleGW instead expects `Authorization: Bearer sk-gw-...` (common for many gateways), every request will 401 and the failure mode is opaque (the action would just fail on the API call, not at the validation step). This should be confirmed against ExampleGW's actual docs before merging, and ideally exercised once in CI against a real (or sandboxed) gateway endpoint rather than assumed from the "Anthropic-compatible" label. The `export` is correctly scoped to that one `run:` step (not written to `$GITHUB_ENV`), so there's no cross-step leakage — that part is sound. No beta headers are used (plain `client.messages.create`), so there's nothing beta-specific for the gateway to replicate.

The brooks-review agent is still running the standard PR-review pass (secret handling, provider-branching correctness, duplication between `ci-review.mjs`/`run-evals-live.mjs`, error handling). I'll report back once it lands.
✗ fail finds-multiple-sources-of-truth

judge votes: FAIL FAIL FAIL

Judge votes✗ ✗ ✗
Evidence (what the judge was shown; for an image, a description of what was sent)
I now have the full Anthropic API reference loaded. Here's the technical verification (points 1–5), while the brooks-review agent finishes the broader code-quality pass in the background.

## Technical verification

**1. `new Anthropic({ baseURL: "..." })` for a third-party gateway — fine.**
The "use the platform's dedicated client, not `baseURL`" rule only applies to the three Anthropic-partnered hyperscaler platforms (Bedrock/Foundry/Vertex), which have dedicated SDK classes. For a generic third-party "Anthropic-compatible" gateway there's no dedicated client — `baseURL` (equivalently `ANTHROPIC_BASE_URL`) is the documented, supported mechanism. The comment about the SDK appending `/v1/messages` to the base URL is also accurate.

**2. `thinking: { type: "disabled" }` — works, but is the wrong fix.**
For the model actually in use here (`anthropic/claude-sonnet-5` via the gateway), `disabled` is a legal value — it won't 400. But the documented pitfall (real, not model-specific in practice) is that disabling thinking entirely can cause the model to write a tool call into visible text instead of leaking `<thinking>` tags into the output — silently corrupting the review output text/JSON this script parses. Since the actual complaint here is "reasoning eats the 4096-token budget," the correct fix is `output_config: { effort: "low" }` (or `"medium"`) with thinking left on `adaptive`, not `disabled`. That gets the token-budget control they want without the leakage risk. Worth raising as a should-fix, not a blocker.

**3. Model ID defaults — real IDs, but inconsistent across providers.**
`claude-sonnet-4-6` and `claude-opus-4-6` are real (previous-gen) IDs, not fabricated. The actual issue: the PR makes the `anthropic` path default to `claude-sonnet-4-6` (older gen) while the `examplegw` path defaults to `anthropic/claude-sonnet-5` (current gen). Same CI review action, two different model generations depending on which provider flag is set — that's a silent quality/behavior divergence a reviewer running `provider=anthropic` vs `provider=examplegw` wouldn't expect. Pre-existing default aside, this PR is a natural point to also bump the anthropic-path default to `claude-sonnet-5`.

**4 & 5. Reusing `ANTHROPIC_API_KEY` for the gateway key — mechanically works, but rests on an unverified assumption.**
The SDK's zero-arg client reads `ANTHROPIC_API_KEY` and sends it via the `x-api-key` header (not `Authorization: Bearer`). So `export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"` will work correctly **only if ExampleGW also authenticates via `x-api-key`**. If ExampleGW instead expects `Authorization: Bearer sk-gw-...` (common for many gateways), every request will 401 and the failure mode is opaque (the action would just fail on the API call, not at the validation step). This should be confirmed against ExampleGW's actual docs before merging, and ideally exercised once in CI against a real (or sandboxed) gateway endpoint rather than assumed from the "Anthropic-compatible" label. The `export` is correctly scoped to that one `run:` step (not written to `$GITHUB_ENV`), so there's no cross-step leakage — that part is sound. No beta headers are used (plain `client.messages.create`), so there's nothing beta-specific for the gateway to replicate.

The brooks-review agent is still running the standard PR-review pass (secret handling, provider-branching correctness, duplication between `ci-review.mjs`/`run-evals-live.mjs`, error handling). I'll report back once it lands.
✗ fail health-score-line ×0.5

pattern not found in last_message

✓ pass no-factual-misreads

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
I now have the full Anthropic API reference loaded. Here's the technical verification (points 1–5), while the brooks-review agent finishes the broader code-quality pass in the background.

## Technical verification

**1. `new Anthropic({ baseURL: "..." })` for a third-party gateway — fine.**
The "use the platform's dedicated client, not `baseURL`" rule only applies to the three Anthropic-partnered hyperscaler platforms (Bedrock/Foundry/Vertex), which have dedicated SDK classes. For a generic third-party "Anthropic-compatible" gateway there's no dedicated client — `baseURL` (equivalently `ANTHROPIC_BASE_URL`) is the documented, supported mechanism. The comment about the SDK appending `/v1/messages` to the base URL is also accurate.

**2. `thinking: { type: "disabled" }` — works, but is the wrong fix.**
For the model actually in use here (`anthropic/claude-sonnet-5` via the gateway), `disabled` is a legal value — it won't 400. But the documented pitfall (real, not model-specific in practice) is that disabling thinking entirely can cause the model to write a tool call into visible text instead of leaking `<thinking>` tags into the output — silently corrupting the review output text/JSON this script parses. Since the actual complaint here is "reasoning eats the 4096-token budget," the correct fix is `output_config: { effort: "low" }` (or `"medium"`) with thinking left on `adaptive`, not `disabled`. That gets the token-budget control they want without the leakage risk. Worth raising as a should-fix, not a blocker.

**3. Model ID defaults — real IDs, but inconsistent across providers.**
`claude-sonnet-4-6` and `claude-opus-4-6` are real (previous-gen) IDs, not fabricated. The actual issue: the PR makes the `anthropic` path default to `claude-sonnet-4-6` (older gen) while the `examplegw` path defaults to `anthropic/claude-sonnet-5` (current gen). Same CI review action, two different model generations depending on which provider flag is set — that's a silent quality/behavior divergence a reviewer running `provider=anthropic` vs `provider=examplegw` wouldn't expect. Pre-existing default aside, this PR is a natural point to also bump the anthropic-path default to `claude-sonnet-5`.

**4 & 5. Reusing `ANTHROPIC_API_KEY` for the gateway key — mechanically works, but rests on an unverified assumption.**
The SDK's zero-arg client reads `ANTHROPIC_API_KEY` and sends it via the `x-api-key` header (not `Authorization: Bearer`). So `export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"` will work correctly **only if ExampleGW also authenticates via `x-api-key`**. If ExampleGW instead expects `Authorization: Bearer sk-gw-...` (common for many gateways), every request will 401 and the failure mode is opaque (the action would just fail on the API call, not at the validation step). This should be confirmed against ExampleGW's actual docs before merging, and ideally exercised once in CI against a real (or sandboxed) gateway endpoint rather than assumed from the "Anthropic-compatible" label. The `export` is correctly scoped to that one `run:` step (not written to `$GITHUB_ENV`), so there's no cross-step leakage — that part is sound. No beta headers are used (plain `client.messages.create`), so there's nothing beta-specific for the gateway to replicate.

The brooks-review agent is still running the standard PR-review pass (secret handling, provider-branching correctness, duplication between `ci-review.mjs`/`run-evals-live.mjs`, error handling). I'll report back once it lands.
✓ pass skill-fired plugin-fired indicator

Skill called 1x (expected 1..∞)

Baseline (no plugin) 85.7% 0% of runs perfect
Run 1 85.7% 5 turns · $0.38 · 13:57:16 UTC
✓ pass finds-magic-string-remap

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Reviewed against current Anthropic API behavior. One thing I'd fix before merging, plus a few to verify/tighten.

## Fix before merging

**Disabling thinking outright is the wrong lever, and it's not free.** On Sonnet 5 (and Opus-5-tier models generally), `thinking: {type: "disabled"}` is accepted, but with a known failure mode: the model can occasionally write a tool call into its **visible text** instead of a proper block, or leak reasoning-tag artifacts into the output — with no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into the report/SARIF pipeline, so any leaked tags would silently corrupt the CI output rather than fail loudly.

The token-budget problem this is solving (thinking eating into a fixed `max_tokens: 4096`) is better solved with `output_config: { effort: "low" }` (or `"medium"`) — this keeps adaptive thinking on (avoiding the leak mode) while still capping how much of the budget goes to reasoning. Sonnet 5 supports `effort` natively. I'd swap the `thinking: {disabled}` block for this in both `ci-review.mjs` and `run-evals-live.mjs`.

## Worth verifying

- **`anthropic/claude-sonnet-5`-style model ID**: provider-prefixed model strings aren't an Anthropic API convention — they're purely a gateway's own routing syntax. Since you've anonymized the real value, I can't check it, but confirm it's copied verbatim from ExampleGW's current docs, not inferred from the bare Anthropic ID by pattern-matching. Gateways change these prefixes without much notice.
- **Default-model remap is duplicated and fragile.** `ci-review.mjs` computes `DEFAULT_MODELS[provider]` when `--model` is *absent*, but `action.yml` always passes `--model "$MODEL"` (from the input's own default), so that mjs fallback is dead code on the action path — only the shell's `if [ "$MODEL" = "claude-sonnet-4-6" ]` string match actually does the remapping. If the action's `model` input default ever changes, this silently stops firing and the raw Anthropic model ID gets sent to ExampleGW. Simpler fix: default the `model` input to `""` in `action.yml` and let `ci-review.mjs`'s existing `args.model ?? DEFAULT_MODELS[provider]` be the single source of truth.

## Looks right

- Using the bare `Anthropic` client with a `baseURL` override for a third-party gateway is the correct pattern (dedicated provider clients like `AnthropicBedrockMantle`/`AnthropicVertex` only exist for Anthropic's own platform partners — ExampleGW isn't one, so `baseURL` is the intended mechanism here).
- `EXAMPLEGW_API_KEY` → `ANTHROPIC_API_KEY` handoff and the required-unless-examplegw validation in `action.yml` are sound; the native Anthropic path is unaffected by the new branch.
✓ pass finds-multiple-sources-of-truth

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Reviewed against current Anthropic API behavior. One thing I'd fix before merging, plus a few to verify/tighten.

## Fix before merging

**Disabling thinking outright is the wrong lever, and it's not free.** On Sonnet 5 (and Opus-5-tier models generally), `thinking: {type: "disabled"}` is accepted, but with a known failure mode: the model can occasionally write a tool call into its **visible text** instead of a proper block, or leak reasoning-tag artifacts into the output — with no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into the report/SARIF pipeline, so any leaked tags would silently corrupt the CI output rather than fail loudly.

The token-budget problem this is solving (thinking eating into a fixed `max_tokens: 4096`) is better solved with `output_config: { effort: "low" }` (or `"medium"`) — this keeps adaptive thinking on (avoiding the leak mode) while still capping how much of the budget goes to reasoning. Sonnet 5 supports `effort` natively. I'd swap the `thinking: {disabled}` block for this in both `ci-review.mjs` and `run-evals-live.mjs`.

## Worth verifying

- **`anthropic/claude-sonnet-5`-style model ID**: provider-prefixed model strings aren't an Anthropic API convention — they're purely a gateway's own routing syntax. Since you've anonymized the real value, I can't check it, but confirm it's copied verbatim from ExampleGW's current docs, not inferred from the bare Anthropic ID by pattern-matching. Gateways change these prefixes without much notice.
- **Default-model remap is duplicated and fragile.** `ci-review.mjs` computes `DEFAULT_MODELS[provider]` when `--model` is *absent*, but `action.yml` always passes `--model "$MODEL"` (from the input's own default), so that mjs fallback is dead code on the action path — only the shell's `if [ "$MODEL" = "claude-sonnet-4-6" ]` string match actually does the remapping. If the action's `model` input default ever changes, this silently stops firing and the raw Anthropic model ID gets sent to ExampleGW. Simpler fix: default the `model` input to `""` in `action.yml` and let `ci-review.mjs`'s existing `args.model ?? DEFAULT_MODELS[provider]` be the single source of truth.

## Looks right

- Using the bare `Anthropic` client with a `baseURL` override for a third-party gateway is the correct pattern (dedicated provider clients like `AnthropicBedrockMantle`/`AnthropicVertex` only exist for Anthropic's own platform partners — ExampleGW isn't one, so `baseURL` is the intended mechanism here).
- `EXAMPLEGW_API_KEY` → `ANTHROPIC_API_KEY` handoff and the required-unless-examplegw validation in `action.yml` are sound; the native Anthropic path is unaffected by the new branch.
✗ fail health-score-line ×0.5

pattern not found in last_message

✓ pass no-factual-misreads

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Reviewed against current Anthropic API behavior. One thing I'd fix before merging, plus a few to verify/tighten.

## Fix before merging

**Disabling thinking outright is the wrong lever, and it's not free.** On Sonnet 5 (and Opus-5-tier models generally), `thinking: {type: "disabled"}` is accepted, but with a known failure mode: the model can occasionally write a tool call into its **visible text** instead of a proper block, or leak reasoning-tag artifacts into the output — with no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into the report/SARIF pipeline, so any leaked tags would silently corrupt the CI output rather than fail loudly.

The token-budget problem this is solving (thinking eating into a fixed `max_tokens: 4096`) is better solved with `output_config: { effort: "low" }` (or `"medium"`) — this keeps adaptive thinking on (avoiding the leak mode) while still capping how much of the budget goes to reasoning. Sonnet 5 supports `effort` natively. I'd swap the `thinking: {disabled}` block for this in both `ci-review.mjs` and `run-evals-live.mjs`.

## Worth verifying

- **`anthropic/claude-sonnet-5`-style model ID**: provider-prefixed model strings aren't an Anthropic API convention — they're purely a gateway's own routing syntax. Since you've anonymized the real value, I can't check it, but confirm it's copied verbatim from ExampleGW's current docs, not inferred from the bare Anthropic ID by pattern-matching. Gateways change these prefixes without much notice.
- **Default-model remap is duplicated and fragile.** `ci-review.mjs` computes `DEFAULT_MODELS[provider]` when `--model` is *absent*, but `action.yml` always passes `--model "$MODEL"` (from the input's own default), so that mjs fallback is dead code on the action path — only the shell's `if [ "$MODEL" = "claude-sonnet-4-6" ]` string match actually does the remapping. If the action's `model` input default ever changes, this silently stops firing and the raw Anthropic model ID gets sent to ExampleGW. Simpler fix: default the `model` input to `""` in `action.yml` and let `ci-review.mjs`'s existing `args.model ?? DEFAULT_MODELS[provider]` be the single source of truth.

## Looks right

- Using the bare `Anthropic` client with a `baseURL` override for a third-party gateway is the correct pattern (dedicated provider clients like `AnthropicBedrockMantle`/`AnthropicVertex` only exist for Anthropic's own platform partners — ExampleGW isn't one, so `baseURL` is the intended mechanism here).
- `EXAMPLEGW_API_KEY` → `ANTHROPIC_API_KEY` handoff and the required-unless-examplegw validation in `action.yml` are sound; the native Anthropic path is unaffected by the new branch.
Prompt

Can you review this PR before I merge it? It lets our CI review action route requests through ExampleGW, an Anthropic-compatible model gateway, instead of calling Anthropic directly. Only the code files from the PR are included below, and I've anonymized the gateway's name, key prefix and URL in the paste.

diff --git a/.github/actions/brooks-lint/action.yml b/.github/actions/brooks-lint/action.yml
index 73977da..3f2e0b2 100644
--- a/.github/actions/brooks-lint/action.yml
+++ b/.github/actions/brooks-lint/action.yml
@@ -7,8 +7,14 @@ inputs:
     description: "Review mode: review, audit, debt, test, health, sweep"
     default: "review"
   anthropic-api-key:
-    description: "Anthropic API key"
-    required: true
+    description: "Anthropic API key (required unless provider is examplegw)"
+    default: ""
+  provider:
+    description: "Model provider: anthropic (default) or examplegw"
+    default: "anthropic"
+  examplegw-api-key:
+    description: "ExampleGW API key, sk-gw-... (required when provider is examplegw)"
+    default: ""
   fail-below:
     description: "Fail the check if Health Score is below this threshold (0 = never fail)"
     default: "0"
@@ -71,10 +77,29 @@ runs:
       shell: bash
       env:
         ANTHROPIC_API_KEY: ${{ inputs.anthropic-api-key }}
+        EXAMPLEGW_API_KEY: ${{ inputs.examplegw-api-key }}
+        PROVIDER: ${{ inputs.provider }}
         SARIF_FILE: ${{ inputs.sarif-file }}
         MODE: ${{ inputs.mode }}
         MODEL: ${{ inputs.model }}
       run: |
+        if [ "$PROVIDER" = "examplegw" ]; then
+          # ExampleGW serves an Anthropic-compatible /v1/messages endpoint. The
+          # key lives in examplegw-api-key (sk-gw-...); bare Anthropic model
+          # ids are not resolvable through the gateway, so the action's default
+          # claude-sonnet-4-6 is remapped to the ExampleGW-pinned id.
+          if [ -z "$EXAMPLEGW_API_KEY" ]; then
+            echo "provider=examplegw requires examplegw-api-key (sk-gw-...)" >&2
+            exit 1
+          fi
+          export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"
+          if [ "$MODEL" = "claude-sonnet-4-6" ]; then
+            MODEL="anthropic/claude-sonnet-5"
+          fi
+        elif [ -z "$ANTHROPIC_API_KEY" ]; then
+          echo "anthropic-api-key is required unless provider=examplegw" >&2
+          exit 1
+        fi
         sarif_arg=()
         if [ -n "$SARIF_FILE" ]; then
           sarif_arg=(--sarif-out "$SARIF_FILE")
@@ -82,6 +107,7 @@ runs:
         node "$BROOKS_LINT_ROOT/scripts/ci-review.mjs" \
           --mode "$MODE" \
           --model "$MODEL" \
+          --provider "$PROVIDER" \
           --skills-dir "$BROOKS_LINT_ROOT/skills" \
           --project-dir "$GITHUB_WORKSPACE" \
           "${sarif_arg[@]}" \
diff --git a/scripts/ci-review.mjs b/scripts/ci-review.mjs
index 61d67a7..91b31b6 100644
--- a/scripts/ci-review.mjs
+++ b/scripts/ci-review.mjs
@@ -13,11 +13,13 @@
  *     --model claude-sonnet-4-6 \
  *     --skills-dir ./skills \
  *     --project-dir /path/to/project \
+ *     [--provider anthropic|examplegw] \
  *     [--format json|sarif] \
  *     [--sarif-out brooks-lint.sarif]
  *
  * Environment:
- *   ANTHROPIC_API_KEY  required
+ *   ANTHROPIC_API_KEY  required (provider=anthropic)
+ *   EXAMPLEGW_API_KEY required (provider=examplegw; sk-gw-...)
  */
 
 import { execFileSync } from "node:child_process";
@@ -35,8 +37,22 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
 
 const args = parseArgs(process.argv.slice(2));
 
+const provider = args.provider ?? "anthropic";
+if (!["anthropic", "examplegw"].includes(provider)) {
+  console.error(`Unknown provider: ${provider}. Valid providers: anthropic, examplegw`);
+  process.exit(1);
+}
+
+// ExampleGW serves an Anthropic-compatible /v1/messages endpoint. Bare Anthropic
+// model ids (e.g. claude-sonnet-4-6) are not resolvable through the gateway, so
+// the default is pinned to the ExampleGW-prefixed id.
+const DEFAULT_MODELS = {
+  anthropic: "claude-sonnet-4-6",
+  examplegw: "anthropic/claude-sonnet-5",
+};
+
 const mode = args.mode ?? "review";
-const model = args.model ?? "claude-sonnet-4-6";
+const model = args.model ?? DEFAULT_MODELS[provider];
 const format = args.format ?? "json";
 const skillsDir = path.resolve(args["skills-dir"] ?? path.join(__dirname, "..", "skills"));
 const projectDir = path.resolve(args["project-dir"] ?? process.cwd());
@@ -79,7 +95,9 @@ function getGitDiff(projectRoot) {
 
 // ── Main ──────────────────────────────────────────────────────────────────────
 
-const client = new Anthropic();
+// ExampleGW's Anthropic-compatible endpoint — the client appends /v1/messages.
+const EXAMPLEGW_BASE_URL = "https://api.examplegw.example";
+const client = new Anthropic(provider === "examplegw" ? { baseURL: EXAMPLEGW_BASE_URL } : undefined);
 
 const { diff, scope } = getGitDiff(projectDir);
 const systemPrompt = assembleSystemPrompt(mode, skillsDir);
@@ -95,6 +113,10 @@ try {
     max_tokens: 4096,
     system: systemPrompt,
     messages: [{ role: "user", content: userMessage }],
+    // Reasoning models on ExampleGW spend the output budget on thinking blocks
+    // by default; the 4096-token budget here assumes direct text output, so the
+    // gateway path disables extended thinking to preserve that contract.
+    ...(provider === "examplegw" ? { thinking: { type: "disabled" } } : {}),
   });
 } catch (err) {
   console.error(JSON.stringify({ error: err.message, mode, scope }, null, 2));
diff --git a/scripts/run-evals-live.mjs b/scripts/run-evals-live.mjs
index cfdda01..bb64406 100644
--- a/scripts/run-evals-live.mjs
+++ b/scripts/run-evals-live.mjs
@@ -8,6 +8,7 @@
  *   ANTHROPIC_API_KEY=... node scripts/run-evals-live.mjs --id 5
  *   ANTHROPIC_API_KEY=... node scripts/run-evals-live.mjs --mode review
  *   ANTHROPIC_API_KEY=... node scripts/run-evals-live.mjs --model claude-opus-4-6
+ *   EXAMPLEGW_API_KEY=... node scripts/run-evals-live.mjs --provider examplegw
  */
 
 import { readFileSync } from "node:fs";
@@ -22,10 +23,24 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
 const root = path.resolve(__dirname, "..");
 
 const args = parseArgs(process.argv.slice(2));
+const provider   = args.provider ?? "anthropic";
+if (!["anthropic", "examplegw"].includes(provider)) {
+  console.error(`Unknown provider: ${provider}. Valid providers: anthropic, examplegw`);
+  process.exit(1);
+}
+
+// ExampleGW serves an Anthropic-compatible /v1/messages endpoint. Bare Anthropic
+// model ids are not resolvable through the gateway, so the default is pinned to
+// the ExampleGW-prefixed id.
+const DEFAULT_MODELS = {
+  anthropic: "claude-sonnet-4-6",
+  examplegw: "anthropic/claude-sonnet-5",
+};
+
 const filterRisk = args.risk ?? null;
 const filterId   = args.id ? parseInt(args.id, 10) : null;
 const filterMode = args.mode ?? null;
-const model      = args.model ?? "claude-sonnet-4-6";
+const model      = args.model ?? DEFAULT_MODELS[provider];
 const skillsDir  = path.join(root, "skills");
 
 if (filterMode && !VALID_MODES.includes(filterMode)) {
@@ -59,7 +74,9 @@ function getSystemPrompt(mode) {
 
 // ── Run scenarios ─────────────────────────────────────────────────────────────
 
-const client = new Anthropic();
+// ExampleGW's Anthropic-compatible endpoint — the client appends /v1/messages.
+const EXAMPLEGW_BASE_URL = "https://api.examplegw.example";
+const client = new Anthropic(provider === "examplegw" ? { baseURL: EXAMPLEGW_BASE_URL } : undefined);
 const results = [];
 
 for (const scenario of scenarios) {
@@ -80,6 +97,10 @@ for (const scenario of scenarios) {
       max_tokens: 4096,
       system: systemPrompt,
       messages: [{ role: "user", content: userMessage }],
+      // Reasoning models on ExampleGW spend the output budget on thinking blocks
+      // by default; the 4096-token budget here assumes direct text output, so the
+      // gateway path disables extended thinking to preserve that contract.
+      ...(provider === "examplegw" ? { thinking: { type: "disabled" } } : {}),
     });
     aiText  = message.content[0]?.text ?? "";
     verdict = classify(scenario, aiText);
Graders — what "good" means for this case
finds-magic-string-remapllm

Facts about the diff under review (use them to check the answer; do not grade the facts themselves):

  • In .github/actions/brooks-lint/action.yml, when PROVIDER is examplegw the script runs if [ "$MODEL" = "claude-sonnet-4-6" ]; then MODEL="anthropic/claude-sonnet-5"; fi.
  • claude-sonnet-4-6 is the action's current default value for its model input.

PASS only if the answer does BOTH:

  1. Identifies this equality check / model rewrite in action.yml (quoting it, or clearly describing "the action rewrites the model only when it equals the current default id").
  2. States at least one concrete consequence of tying the rewrite to that literal id: (a) when the action's default model is bumped, the check silently stops matching and the gateway receives an id it cannot resolve; or (b) a user who explicitly sets model: claude-sonnet-4-6 is silently switched to a different model; or (c) any other bare model id a user passes is not mapped for the gateway at all.

FAIL if the rewrite is not mentioned, or is only described neutrally (e.g. "remaps the default model") without explaining why the literal comparison is fragile.

finds-multiple-sources-of-truthllm

Facts about the diff under review:

  • The gateway's default model is encoded in more than one place: action.yml hard-codes the rewrite claude-sonnet-4-6 → anthropic/claude-sonnet-5, while scripts/ci-review.mjs and scripts/run-evals-live.mjs each define their own DEFAULT_MODELS = { anthropic: "claude-sonnet-4-6", examplegw: "anthropic/claude-sonnet-5" }.
  • action.yml always passes --model "$MODEL" to ci-review.mjs, and the script does args.model ?? DEFAULT_MODELS[provider], so on the action path DEFAULT_MODELS never takes effect.

PASS if the answer makes at least one of these points AND names at least two of the locations involved (file names or clearly identified code sites): A. The provider → default-model mapping lives in two or more places (the action.yml rewrite vs DEFAULT_MODELS, or DEFAULT_MODELS copied into both scripts), so the copies can drift apart. B. DEFAULT_MODELS in ci-review.mjs is dead / never used when invoked from the action, because the action always passes --model.

FAIL if neither A nor B is made. Pointing out that the provider-handling block is duplicated across the two scripts counts as A only if the answer makes clear the default-model mapping is part of what is duplicated.

health-score-lineregexweight ×0.5
target"last_message"
pattern"Health Score\\W*\\d{1,3}\\s*/\\s*100"
flags"i"
match"contains"
no-factual-misreadsllm

Check the review for factual misreadings of the diff. Ground truth about what the diff does:

  1. action.yml: when PROVIDER is examplegw it exits 1 if EXAMPLEGW_API_KEY is empty, otherwise exports it as ANTHROPIC_API_KEY. For any other provider value it still exits 1 when ANTHROPIC_API_KEY is empty — the Anthropic path keeps a missing-key check (moved from required: true to a runtime check).
  2. action.yml passes --provider "$PROVIDER" to ci-review.mjs. The action itself does not reject unknown provider values; both scripts do, exiting 1 with "Unknown provider".
  3. Both scripts construct new Anthropic({ baseURL: "https://api.examplegw.example" }) only when provider is examplegw; otherwise new Anthropic(undefined), which uses the SDK defaults (valid, does not throw).
  4. thinking: { type: "disabled" } is added to the request only when provider is examplegw.
  5. No API key value is printed to logs; the error messages only name the missing input.
  6. An explicit --model always wins; DEFAULT_MODELS[provider] is only the fallback when --model is absent.
  7. Only action.yml compares the model against the literal claude-sonnet-4-6. Neither script contains such a comparison — they use args.model ?? DEFAULT_MODELS[provider].
  8. Neither script reads EXAMPLEGW_API_KEY; the SDK picks up ANTHROPIC_API_KEY from the environment. action.yml exports the gateway key into ANTHROPIC_API_KEY first, but run-evals-live.mjs is documented as EXAMPLEGW_API_KEY=... node scripts/run-evals-live.mjs --provider examplegw with no such export — so a claim that this path ignores the gateway key, fails auth, or could send a real ANTHROPIC_API_KEY to the gateway host is CORRECT, not a misread.

FAIL if the answer states as fact anything that contradicts items 1–8 — for example: the Anthropic path no longer validates its key; the base URL is applied to both providers or never applied; thinking is disabled for every provider; a key is printed to logs; new Anthropic(undefined) throws; an unknown provider silently falls back to anthropic inside the scripts; DEFAULT_MODELS overrides an explicit --model; the scripts themselves remap claude-sonnet-4-6 by literal comparison.

Do NOT fail for: hedged remarks about behaviour outside the diff (e.g. whether the gateway accepts the thinking field), design opinions, or observations consistent with the ground truth (e.g. "action.yml does not validate the provider itself, so a typo only fails later in the script", or the credential issue in item 8).

PASS if no contradicting claim is present.

skill-firedtool_used
tool"Skill"
input_match"brooks-review"

02-pr33-bob-installer

evals/02-pr33-bob-installer · 0.0 pts with plugin 85.7%
Results
With plugin 85.7% 0% of runs perfect
Run 1 85.7% 3 turns · $0.17 · 13:58:43 UTC
✓ pass finds-bob-home-mismatch

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
看了这个 diff,有一个实质性问题会导致文档和脚本行为不一致,建议合并前先修:

**1)阻断性问题:`$BOB_HOME` 有文档承诺但脚本没实现**

`docs/bob-setup.md` 里明确写了:

> global: `~/.bob/skills` (or `$BOB_HOME/skills`)
> `<bob_home>` (default `~/.bob/skills`)

但 `scripts/install.sh` 里 `global_dir()` 新增的这一行是写死的:

```bash
bob) printf '%s' "$HOME/.bob/skills" ;;
```

完全没有读取 `$BOB_HOME`。如果用户设置了 `BOB_HOME` 指向别的目录(文档里明确说支持),全局安装会静默装到 `~/.bob/skills`,和文档承诺的行为不符。要么在脚本里补上:

```bash
bob) printf '%s' "${BOB_HOME:-$HOME/.bob}/skills" ;;
```

要么把文档里 `$BOB_HOME` 的说法删掉,二选一,现状是文档和代码互相矛盾。

**2)小瑕疵:两处平台列表的插入位置不一致**

`docs/getting-started.md` 把 `bob` 插到了 `dsh` 和 `gemini` 之间:

```
... droid · dsh · bob ·
gemini · codex · claude · agents
```

而 `scripts/install.sh` 的 `PLATFORMS` 变量把 `bob` 加到了最后:

```
... dsh gemini codex claude agents bob
```

不影响功能,但两个列表顺序对不上,读者按文档顺序去核对脚本会觉得奇怪,顺手改成一致比较好。

**3)需要人工确认的一点:`IBM Bob` / `bob.ibm.com` 这个产品是否真实存在**

我这边没有联网核实的工具,这个平台名字和链接是贡献者在 PR 里自己给的,建议合并前你自己确认一下 `bob.ibm.com` 是真实产品,而不是编造的(如果是假的,会给用户一个装不上东西的死链接)。仓库本身对这类"未端到端验证"的平台有 🧪 标记机制,所以就算暂时没法实测也不是阻断项,但产品真实性最好先确认。

**其余部分**(`PLATFORMS` 变量、`global_dir`/`project_dir` 里的 case 分支、`getting-started.md` 表格、"nine"→"ten" 的计数更新)都严格照抄了 `dsh`/`agents` 已有的加平台套路,结构上没问题。

结论:第 1 点是真 bug,建议要求贡献者补上再合;第 2、3 点是提醒事项,不必阻塞。
✗ fail health-score-line ×0.5

pattern not found in last_message

✓ pass no-false-alarms-on-installer

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
看了这个 diff,有一个实质性问题会导致文档和脚本行为不一致,建议合并前先修:

**1)阻断性问题:`$BOB_HOME` 有文档承诺但脚本没实现**

`docs/bob-setup.md` 里明确写了:

> global: `~/.bob/skills` (or `$BOB_HOME/skills`)
> `<bob_home>` (default `~/.bob/skills`)

但 `scripts/install.sh` 里 `global_dir()` 新增的这一行是写死的:

```bash
bob) printf '%s' "$HOME/.bob/skills" ;;
```

完全没有读取 `$BOB_HOME`。如果用户设置了 `BOB_HOME` 指向别的目录(文档里明确说支持),全局安装会静默装到 `~/.bob/skills`,和文档承诺的行为不符。要么在脚本里补上:

```bash
bob) printf '%s' "${BOB_HOME:-$HOME/.bob}/skills" ;;
```

要么把文档里 `$BOB_HOME` 的说法删掉,二选一,现状是文档和代码互相矛盾。

**2)小瑕疵:两处平台列表的插入位置不一致**

`docs/getting-started.md` 把 `bob` 插到了 `dsh` 和 `gemini` 之间:

```
... droid · dsh · bob ·
gemini · codex · claude · agents
```

而 `scripts/install.sh` 的 `PLATFORMS` 变量把 `bob` 加到了最后:

```
... dsh gemini codex claude agents bob
```

不影响功能,但两个列表顺序对不上,读者按文档顺序去核对脚本会觉得奇怪,顺手改成一致比较好。

**3)需要人工确认的一点:`IBM Bob` / `bob.ibm.com` 这个产品是否真实存在**

我这边没有联网核实的工具,这个平台名字和链接是贡献者在 PR 里自己给的,建议合并前你自己确认一下 `bob.ibm.com` 是真实产品,而不是编造的(如果是假的,会给用户一个装不上东西的死链接)。仓库本身对这类"未端到端验证"的平台有 🧪 标记机制,所以就算暂时没法实测也不是阻断项,但产品真实性最好先确认。

**其余部分**(`PLATFORMS` 变量、`global_dir`/`project_dir` 里的 case 分支、`getting-started.md` 表格、"nine"→"ten" 的计数更新)都严格照抄了 `dsh`/`agents` 已有的加平台套路,结构上没问题。

结论:第 1 点是真 bug,建议要求贡献者补上再合;第 2、3 点是提醒事项,不必阻塞。
✓ pass report-in-chinese

matched [一-鿿]{8}

✗ fail skill-fired plugin-fired indicator

Skill called 0x (expected 1..∞)

Baseline (no plugin) 85.7% 0% of runs perfect
Run 1 85.7% 3 turns · $0.16 · 14:00:08 UTC
✓ pass finds-bob-home-mismatch

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
看了这个 diff,技术实现本身没有安全问题(就是照抄现有平台的 case 分支模式,没有引入新的远程执行或路径穿越风险),但有两点建议合并前处理:

**1. "IBM Bob" 这个产品本身存疑,建议先核实**
我这轮没有联网能力,也没有在已知信息里见过 IBM 有一款叫 "Bob"、域名 `bob.ibm.com` 的 AI 开发者智能体产品(IBM 这边我知道的是 watsonx Code Assistant、Red Hat 的 Project Wisdom 等)。这不代表它一定不存在,但在合并前应该由维护者亲自打开 `bob.ibm.com` 确认:
- 域名确实是 IBM 官方拥有/控制的
- 产品确实存在,且确实是文档描述的"chat + IDE + Agent Skills + AGENTS.md"架构

如果这是虚构产品(无论是贡献者笔误、还是 AI 生成 PR 时编造的),合并后会在 README/docs 里留下一个指向不存在或非 IBM 域名的"官方链接",属于可信度和潜在钓鱼风险(即使当前 diff 里这个 URL 只是文档引用,没有被脚本实际 fetch)。

**2. 文档和代码不一致的 bug**
`docs/bob-setup.md` 里两处提到全局安装会读 `$BOB_HOME` 环境变量:
```
./scripts/install.sh bob            # global: ~/.bob/skills (or $BOB_HOME/skills)
...
| `<bob_home>/skills` (default `~/.bob/skills`) | what the global install writes |
```
但 `scripts/install.sh` 的 `global_dir()` 实际实现是硬编码的:
```bash
bob)         printf '%s' "$HOME/.bob/skills" ;;
```
完全没有检查 `$BOB_HOME`。要么补上 `${BOB_HOME:-$HOME/.bob}/skills` 这样的逻辑,要么把文档里 `$BOB_HOME` 的描述去掉,否则用户设置了 `BOB_HOME` 后行为和文档不符。

**其余部分**没问题:`PLATFORMS` 列表、`global_dir()`/`project_dir()` 的 case 分支、`getting-started.md` 表格新增行、"nine"→"ten" 的措辞更新,都严格照搬了现有平台(如 `dsh`)的模式,风格一致,没有引入新风险。

建议:先让贡献者确认 IBM Bob 产品和域名的真实性,再修掉 `$BOB_HOME` 这个文档/代码不一致的问题,其他可以合。
✗ fail health-score-line ×0.5

pattern not found in last_message

✓ pass no-false-alarms-on-installer

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
看了这个 diff,技术实现本身没有安全问题(就是照抄现有平台的 case 分支模式,没有引入新的远程执行或路径穿越风险),但有两点建议合并前处理:

**1. "IBM Bob" 这个产品本身存疑,建议先核实**
我这轮没有联网能力,也没有在已知信息里见过 IBM 有一款叫 "Bob"、域名 `bob.ibm.com` 的 AI 开发者智能体产品(IBM 这边我知道的是 watsonx Code Assistant、Red Hat 的 Project Wisdom 等)。这不代表它一定不存在,但在合并前应该由维护者亲自打开 `bob.ibm.com` 确认:
- 域名确实是 IBM 官方拥有/控制的
- 产品确实存在,且确实是文档描述的"chat + IDE + Agent Skills + AGENTS.md"架构

如果这是虚构产品(无论是贡献者笔误、还是 AI 生成 PR 时编造的),合并后会在 README/docs 里留下一个指向不存在或非 IBM 域名的"官方链接",属于可信度和潜在钓鱼风险(即使当前 diff 里这个 URL 只是文档引用,没有被脚本实际 fetch)。

**2. 文档和代码不一致的 bug**
`docs/bob-setup.md` 里两处提到全局安装会读 `$BOB_HOME` 环境变量:
```
./scripts/install.sh bob            # global: ~/.bob/skills (or $BOB_HOME/skills)
...
| `<bob_home>/skills` (default `~/.bob/skills`) | what the global install writes |
```
但 `scripts/install.sh` 的 `global_dir()` 实际实现是硬编码的:
```bash
bob)         printf '%s' "$HOME/.bob/skills" ;;
```
完全没有检查 `$BOB_HOME`。要么补上 `${BOB_HOME:-$HOME/.bob}/skills` 这样的逻辑,要么把文档里 `$BOB_HOME` 的描述去掉,否则用户设置了 `BOB_HOME` 后行为和文档不符。

**其余部分**没问题:`PLATFORMS` 列表、`global_dir()`/`project_dir()` 的 case 分支、`getting-started.md` 表格新增行、"nine"→"ten" 的措辞更新,都严格照搬了现有平台(如 `dsh`)的模式,风格一致,没有引入新风险。

建议:先让贡献者确认 IBM Bob 产品和域名的真实性,再修掉 `$BOB_HOME` 这个文档/代码不一致的问题,其他可以合。
✓ pass report-in-chinese

matched [一-鿿]{8}

Prompt

帮我看看这个 PR 能不能合?贡献者给安装脚本加了 IBM Bob 平台支持,下面是安装脚本和文档部分的 diff(README 的多语言同步改动省略了)。

diff --git a/docs/bob-setup.md b/docs/bob-setup.md
new file mode 100644
index 0000000..bc7683b
--- /dev/null
+++ b/docs/bob-setup.md
@@ -0,0 +1,51 @@
+# IBM Bob Setup
+
+[IBM Bob](https://bob.ibm.com) (`bob`) is IBM's AI-powered developer agent — an "everything is a
+skill" architecture with a chat interface and IDE integrations. It natively loads
+[Agent Skills](https://agentskills.io) and reads `AGENTS.md`, so all six brooks-lint modes run with
+no conversion.
+
+## Install
+
+```bash
+# simplest — one command (global)
+curl -fsSL https://raw.githubusercontent.com/hyhmrright/brooks-lint/main/scripts/install.sh | bash -s -- bob
+
+# from a clone
+./scripts/install.sh bob            # global: ~/.bob/skills (or $BOB_HOME/skills)
+./scripts/install.sh bob --project  # this repo: ./.bob/skills
+```
+
+Prefer a manual copy? Clone the repo and `cp -r skills/* ~/.bob/skills/` — the contents, not the
+`skills/` folder itself, so `_shared/` lands as a sibling of the `brooks-*` folders.
+
+Bob scans these skill roots, highest priority first, so an existing vendor-neutral install is picked
+up automatically:
+
+| Root | Notes |
+|---|---|
+| `<projectRoot>/.bob/skills` | what `--project` writes |
+| `<bob_home>/skills` (default `~/.bob/skills`) | what the global install writes |
+
+When the same skill name appears in two roots, the project-level skill takes precedence.
+
+## Invoke
+
+Just ask — Bob routes to a skill from its `description`:
+
+- "review this PR" → `brooks-review`
+- "audit the architecture" → `brooks-audit`
+- "where's our worst tech debt?" → `brooks-debt`
+
+For explicit invocation, type `/` followed by the skill token in the chat prompt, or type it by
+hand: `/brooks-review`, `/brooks-audit`, `/brooks-debt`, `/brooks-test`, `/brooks-health`,
+`/brooks-sweep`. The repo's `AGENTS.md` carries the Iron Law (Symptom → Source →
+Consequence → Remedy) and the Health Score rules; Bob also loads `$BOB_HOME/AGENTS.md` plus every
+`AGENTS.md` from the project root down to your working directory.
+
+## Notes
+
+- IBM Bob is available at [bob.ibm.com](https://bob.ibm.com); download and sign-in instructions
+  are on that page.
+- 🧪 Documented per the Agent Skills subsystem contract; community end-to-end verification welcome —
+  [open an issue](https://github.com/hyhmrright/brooks-lint/issues/new).
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 665f91f..8a91817 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -33,7 +33,7 @@ layout wrong:
 curl -fsSL https://raw.githubusercontent.com/hyhmrright/brooks-lint/main/scripts/install.sh | bash -s -- <platform>
 ```
 
-`<platform>` ∈ `opencode · cursor · windsurf · antigravity · pi · kiro · copilot · droid · dsh ·
+`<platform>` ∈ `opencode · cursor · windsurf · antigravity · pi · kiro · copilot · droid · dsh · bob ·
 gemini · codex · claude · agents`. Add `--project` to install into the current repo instead of your
 global config. `agents` targets the vendor-neutral `~/.agents/skills` folder that Cursor, Copilot, pi,
 Gemini, Codex, and DeepSeek Harness all read.
@@ -51,6 +51,7 @@ Gemini, Codex, and DeepSeek Harness all read.
 | Kiro | [kiro-setup.md](kiro-setup.md) | `.kiro/skills`, `~/.kiro/skills` | ✅ |
 | Factory Droid | [factory-droid-setup.md](factory-droid-setup.md) | `~/.factory/skills`, `.factory/skills`, `.agent/skills` | ✅ |
 | DeepSeek Harness | [dsh-setup.md](dsh-setup.md) | `.dsh/skills`, `.agents/skills`, `~/.dsh/skills`, `~/.agents/skills` | ✅ |
+| IBM Bob | [bob-setup.md](bob-setup.md) | `.bob/skills`, `~/.bob/skills` | ✅ |
 
 For Claude Code, Gemini CLI, and Codex CLI, see the [README install section](../README.md#installation).
 `./scripts/install.sh gemini` and `./scripts/install.sh codex` also work and use the flat layout these
@@ -69,7 +70,7 @@ If your agent accepts a skills folder or an instruction file, brooks-lint works:
 ## Verification status
 
 The marketplace-installed platforms (Claude Code, Gemini CLI, Codex CLI) are maintainer-verified. The
-nine Agent-Skills platforms above are documented from each tool's official skill spec and verified at
+ten Agent-Skills platforms above are documented from each tool's official skill spec and verified at
 the file-layout level (the installer is tested), but not yet end-to-end run by the maintainer on every
 platform. **Tried one? Tell us** — [open an issue](https://github.com/hyhmrright/brooks-lint/issues/new)
 with the platform, version, and what you saw, working or broken.
diff --git a/scripts/install.sh b/scripts/install.sh
index 90270ef..0391864 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -13,7 +13,7 @@
 #   ./scripts/install.sh <platform> [--project]
 #   curl -fsSL https://raw.githubusercontent.com/hyhmrright/brooks-lint/main/scripts/install.sh | bash -s -- <platform>
 #
-# Platforms: opencode cursor windsurf antigravity pi kiro copilot droid dsh gemini codex claude agents
+# Platforms: opencode cursor windsurf antigravity pi kiro copilot droid dsh gemini codex claude agents bob
 #   agents = the vendor-neutral ~/.agents/skills folder (read by Cursor, Copilot, pi, Gemini,
 #            Codex, and DeepSeek Harness)
 #
@@ -25,7 +25,7 @@
 set -euo pipefail
 
 REPO_URL="https://github.com/hyhmrright/brooks-lint.git"
-PLATFORMS="opencode cursor windsurf antigravity pi kiro copilot droid dsh gemini codex claude agents"
+PLATFORMS="opencode cursor windsurf antigravity pi kiro copilot droid dsh gemini codex claude agents bob"
 
 err()  { printf '\033[31merror:\033[0m %s\n' "$*" >&2; }
 info() { printf '\033[36m›\033[0m %s\n' "$*"; }
@@ -66,6 +66,7 @@ global_dir() {
     codex)       printf '%s' "$HOME/.codex/skills" ;;
     claude)      printf '%s' "$HOME/.claude/skills" ;;
     agents)      printf '%s' "$HOME/.agents/skills" ;;
+    bob)         printf '%s' "$HOME/.bob/skills" ;;
     *)           return 1 ;;
   esac
 }
@@ -85,6 +86,7 @@ project_dir() {
     codex)       printf '%s' "$PWD/.codex/skills" ;;
     claude)      printf '%s' "$PWD/.claude/skills" ;;
     agents)      printf '%s' "$PWD/.agents/skills" ;;
+    bob)         printf '%s' "$PWD/.bob/skills" ;;
     *)           return 1 ;;
   esac
 }
Graders — what "good" means for this case
finds-bob-home-mismatchllm

Facts about the diff under review (the answer is expected to be written in Chinese; judge its content):

  • docs/bob-setup.md says ./scripts/install.sh bob installs to "~/.bob/skills (or $BOB_HOME/skills)", lists a skill root "<bob_home>/skills (default ~/.bob/skills)", and says Bob loads $BOB_HOME/AGENTS.md.
  • scripts/install.sh global_dir() hard-codes bob) printf '%s' "$HOME/.bob/skills"; nothing in the installer reads BOB_HOME.

PASS only if the answer identifies that the documentation promises $BOB_HOME support (a configurable Bob home) that the installer does not implement — i.e. a user who sets BOB_HOME still gets the skills installed under $HOME/.bob/skills — and names both sides (the setup doc and install.sh / global_dir).

FAIL if BOB_HOME is not discussed, or is mentioned only as a documentation detail without noting that the installer ignores it.

health-score-lineregexweight ×0.5
target"last_message"
pattern"Health Score\\W*\\d{1,3}\\s*/\\s*100"
flags"i"
match"contains"
no-false-alarms-on-installerllm

Facts about the diff under review (the answer is expected to be written in Chinese; judge its content):

  • bob is appended to both the # Platforms: comment and the PLATFORMS variable in scripts/install.sh.
  • global_dir() gains bob) → $HOME/.bob/skills; project_dir() gains bob) → $PWD/.bob/skills, following exactly the pattern every other platform uses.
  • docs/getting-started.md adds bob to the <platform> enumeration and a table row listing .bob/skills, ~/.bob/skills, which match those two installer paths.

FAIL if the answer asserts any of the following as a problem:

  1. bob is missing from PLATFORMS, from global_dir(), or from project_dir().
  2. The paths ~/.bob/skills / ./.bob/skills in install.sh disagree with the getting-started table, or with the non-BOB_HOME paths in bob-setup.md.
  3. The added bob lines in install.sh are themselves wrong (bad syntax, wrong path, would break other platforms) and are rated critical / 🔴 / blocking.

NOT a false alarm (do not fail for these): saying the installer should also honour BOB_HOME or the doc should drop it; wording or ordering nits; doubts about Bob's own behaviour that the diff cannot show.

PASS if none of 1–3 occurs.

report-in-chineseregex
target"last_message"
pattern"[一-鿿]{8}"
flags""
match"contains"
skill-firedtool_used
tool"Skill"
input_match"brooks-review"

03-two-files-rule-drift

evals/03-two-files-rule-drift ↑ +14.3 pts with plugin 100%
Results
With plugin 100% 100% of runs perfect
Run 1 100% 10 turns · $0.32 · 14:01:10 UTC
✓ pass drift-ranked-first

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
# Brooks-Lint Review

**Mode:** PR Review
**Scope:** `pricing.py`, `cart_banner.py` (pasted, 2 files)
**Health Score:** 85/100

The two modules encode the same free-shipping rule with different types, different rounding, and different comparison operators — so the banner can promise a shipping outcome the quote doesn't deliver.

---

## Findings

### 🔴 Critical

**Knowledge Duplication — free-shipping rule reimplemented with float instead of Decimal**
Symptom: `pricing.quote()` computes the canonical subtotal as `Decimal` and applies free shipping with `subtotal >= FREE_SHIPPING_MIN` (inclusive, `Decimal("100.00")`, rounded `ROUND_HALF_UP`). `cart_banner.cart_total()` recomputes the same subtotal independently using `float(i.unit_price) * i.quantity`, rounds it with Python's built-in `round()` (banker's rounding, round-half-to-even), and `shipping_banner()` compares it with `total > 100` (strict, hardcoded literal instead of importing `FREE_SHIPPING_MIN`). Concretely: a cart totaling exactly `Decimal("100.00")` qualifies for free shipping in `quote()` (`>=`), but `shipping_banner()` evaluates `100.0 > 100` as `False` and renders "Add $0.00 more to get free shipping" — a customer already getting free shipping is told they need to spend more. More broadly, since `cart_banner` casts `Decimal` to `float`, it reintroduces the binary floating-point imprecision that `pricing.py` deliberately avoided by choosing `Decimal`, so the two modules can disagree on totals near any rounding boundary, not just $100.00.
Source: Hunt & Thomas — The Pragmatic Programmer, DRY (Don't Repeat Yourself); Fowler — Refactoring, Shotgun Surgery / Duplicate Code
Consequence: The checkout header can display a shipping promise that the actual order quote contradicts — a visible, customer-facing pricing bug, and every future change to `FREE_SHIPPING_MIN` or the rounding policy in `pricing.py` must be remembered and re-applied by hand in `cart_banner.py`, with no compiler or test to catch a missed update.
Remedy: Delete `cart_total()` and the local threshold/rounding logic from `cart_banner.py`. Have `shipping_banner()` call `pricing.quote(items)` and branch on `quote.shipping == Decimal("0.00")` (or expose a `Quote.free_shipping` property), and compute "remaining to free shipping" as `FREE_SHIPPING_MIN - quote.subtotal` using `Decimal` throughout — importing `FREE_SHIPPING_MIN` from `pricing` rather than hardcoding `100`.

---

## Summary

The core issue is that `cart_banner.py` treats "is this order eligible for free shipping" as its own calculation instead of asking `pricing.py`'s `quote()` for the answer it already computed — and the reimplementation drifted on both the comparison operator and the numeric type. Fix by routing the banner through `quote()` directly; once that's done, add a boundary-value test (subtotal exactly at `FREE_SHIPPING_MIN`) to lock the two modules together going forward.
✓ pass explains-boundary-divergence

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
# Brooks-Lint Review

**Mode:** PR Review
**Scope:** `pricing.py`, `cart_banner.py` (pasted, 2 files)
**Health Score:** 85/100

The two modules encode the same free-shipping rule with different types, different rounding, and different comparison operators — so the banner can promise a shipping outcome the quote doesn't deliver.

---

## Findings

### 🔴 Critical

**Knowledge Duplication — free-shipping rule reimplemented with float instead of Decimal**
Symptom: `pricing.quote()` computes the canonical subtotal as `Decimal` and applies free shipping with `subtotal >= FREE_SHIPPING_MIN` (inclusive, `Decimal("100.00")`, rounded `ROUND_HALF_UP`). `cart_banner.cart_total()` recomputes the same subtotal independently using `float(i.unit_price) * i.quantity`, rounds it with Python's built-in `round()` (banker's rounding, round-half-to-even), and `shipping_banner()` compares it with `total > 100` (strict, hardcoded literal instead of importing `FREE_SHIPPING_MIN`). Concretely: a cart totaling exactly `Decimal("100.00")` qualifies for free shipping in `quote()` (`>=`), but `shipping_banner()` evaluates `100.0 > 100` as `False` and renders "Add $0.00 more to get free shipping" — a customer already getting free shipping is told they need to spend more. More broadly, since `cart_banner` casts `Decimal` to `float`, it reintroduces the binary floating-point imprecision that `pricing.py` deliberately avoided by choosing `Decimal`, so the two modules can disagree on totals near any rounding boundary, not just $100.00.
Source: Hunt & Thomas — The Pragmatic Programmer, DRY (Don't Repeat Yourself); Fowler — Refactoring, Shotgun Surgery / Duplicate Code
Consequence: The checkout header can display a shipping promise that the actual order quote contradicts — a visible, customer-facing pricing bug, and every future change to `FREE_SHIPPING_MIN` or the rounding policy in `pricing.py` must be remembered and re-applied by hand in `cart_banner.py`, with no compiler or test to catch a missed update.
Remedy: Delete `cart_total()` and the local threshold/rounding logic from `cart_banner.py`. Have `shipping_banner()` call `pricing.quote(items)` and branch on `quote.shipping == Decimal("0.00")` (or expose a `Quote.free_shipping` property), and compute "remaining to free shipping" as `FREE_SHIPPING_MIN - quote.subtotal` using `Decimal` throughout — importing `FREE_SHIPPING_MIN` from `pricing` rather than hardcoding `100`.

---

## Summary

The core issue is that `cart_banner.py` treats "is this order eligible for free shipping" as its own calculation instead of asking `pricing.py`'s `quote()` for the answer it already computed — and the reimplementation drifted on both the comparison operator and the numeric type. Fix by routing the banner through `quote()` directly; once that's done, add a boundary-value test (subtotal exactly at `FREE_SHIPPING_MIN`) to lock the two modules together going forward.
✓ pass health-score-line ×0.5

matched Health Score\W*\d{1,3}\s*/\s*100

✓ pass names-both-threshold-copies

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
# Brooks-Lint Review

**Mode:** PR Review
**Scope:** `pricing.py`, `cart_banner.py` (pasted, 2 files)
**Health Score:** 85/100

The two modules encode the same free-shipping rule with different types, different rounding, and different comparison operators — so the banner can promise a shipping outcome the quote doesn't deliver.

---

## Findings

### 🔴 Critical

**Knowledge Duplication — free-shipping rule reimplemented with float instead of Decimal**
Symptom: `pricing.quote()` computes the canonical subtotal as `Decimal` and applies free shipping with `subtotal >= FREE_SHIPPING_MIN` (inclusive, `Decimal("100.00")`, rounded `ROUND_HALF_UP`). `cart_banner.cart_total()` recomputes the same subtotal independently using `float(i.unit_price) * i.quantity`, rounds it with Python's built-in `round()` (banker's rounding, round-half-to-even), and `shipping_banner()` compares it with `total > 100` (strict, hardcoded literal instead of importing `FREE_SHIPPING_MIN`). Concretely: a cart totaling exactly `Decimal("100.00")` qualifies for free shipping in `quote()` (`>=`), but `shipping_banner()` evaluates `100.0 > 100` as `False` and renders "Add $0.00 more to get free shipping" — a customer already getting free shipping is told they need to spend more. More broadly, since `cart_banner` casts `Decimal` to `float`, it reintroduces the binary floating-point imprecision that `pricing.py` deliberately avoided by choosing `Decimal`, so the two modules can disagree on totals near any rounding boundary, not just $100.00.
Source: Hunt & Thomas — The Pragmatic Programmer, DRY (Don't Repeat Yourself); Fowler — Refactoring, Shotgun Surgery / Duplicate Code
Consequence: The checkout header can display a shipping promise that the actual order quote contradicts — a visible, customer-facing pricing bug, and every future change to `FREE_SHIPPING_MIN` or the rounding policy in `pricing.py` must be remembered and re-applied by hand in `cart_banner.py`, with no compiler or test to catch a missed update.
Remedy: Delete `cart_total()` and the local threshold/rounding logic from `cart_banner.py`. Have `shipping_banner()` call `pricing.quote(items)` and branch on `quote.shipping == Decimal("0.00")` (or expose a `Quote.free_shipping` property), and compute "remaining to free shipping" as `FREE_SHIPPING_MIN - quote.subtotal` using `Decimal` throughout — importing `FREE_SHIPPING_MIN` from `pricing` rather than hardcoding `100`.

---

## Summary

The core issue is that `cart_banner.py` treats "is this order eligible for free shipping" as its own calculation instead of asking `pricing.py`'s `quote()` for the answer it already computed — and the reimplementation drifted on both the comparison operator and the numeric type. Fix by routing the banner through `quote()` directly; once that's done, add a boundary-value test (subtotal exactly at `FREE_SHIPPING_MIN`) to lock the two modules together going forward.
✓ pass skill-fired plugin-fired indicator

Skill called 1x (expected 1..∞)

Baseline (no plugin) 85.7% 0% of runs perfect
Run 1 85.7% 1 turns · $0.12 · 14:03:00 UTC
✓ pass drift-ranked-first

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Yes — the boundary condition and the arithmetic type don't match between the two modules, and that's a real bug for orders that land at or near $100.

**1. Free-shipping threshold is inconsistent (off-by-boundary)**

`pricing.py` grants free shipping when `subtotal >= FREE_SHIPPING_MIN` (i.e. **>= $100.00**).

`cart_banner.py`'s `shipping_banner` checks `total > 100` (**strictly greater than**).

So for an order that totals exactly $100.00:
- `pricing.quote()` → `shipping = 0.00` (free)
- `cart_banner.shipping_banner()` → falls to the `else` branch and prints `"Add $0.00 more to get free shipping"` instead of the congratulations message.

Customer sees a message telling them to spend more while checkout has already given them free shipping.

**2. `cart_banner.py` recomputes the subtotal independently, using `float` instead of `Decimal`**

`cart_total` does `float(i.unit_price) * i.quantity` and sums with plain floats, then `shipping_banner` rounds with Python's built-in `round()` (banker's/round-half-to-even). `pricing.py` does everything in `Decimal` and rounds with `ROUND_HALF_UP`.

Two problems from this:
- Float conversion of `Decimal` prices can introduce tiny binary-floating-point error (e.g. a cart that's exactly `100.00` in Decimal can come out as `99.99999999999999` or `100.00000000000001` as a float sum), which can flip the free-shipping check right at the threshold — compounding bug #1.
- Even when it doesn't flip, `round()` vs `ROUND_HALF_UP` can disagree on `.xx5` cases, so the banner's displayed "remaining amount" can differ by a cent from what checkout actually charges.

**Fix**: don't reimplement the subtotal logic in `cart_banner.py` at all — import and call `quote()` from `pricing.py` and reuse its `Decimal` subtotal, comparing against `FREE_SHIPPING_MIN` with `>=`:

```python
from pricing import LineItem, quote, FREE_SHIPPING_MIN

def shipping_banner(items):
    subtotal = quote(items).subtotal
    if subtotal >= FREE_SHIPPING_MIN:
        return "🎉 Your order ships free!"
    remaining = FREE_SHIPPING_MIN - subtotal
    return f"Add ${remaining:.2f} more to get free shipping"
```

This removes the duplicated calculation entirely, so the two modules can't drift out of sync again.
✓ pass explains-boundary-divergence

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Yes — the boundary condition and the arithmetic type don't match between the two modules, and that's a real bug for orders that land at or near $100.

**1. Free-shipping threshold is inconsistent (off-by-boundary)**

`pricing.py` grants free shipping when `subtotal >= FREE_SHIPPING_MIN` (i.e. **>= $100.00**).

`cart_banner.py`'s `shipping_banner` checks `total > 100` (**strictly greater than**).

So for an order that totals exactly $100.00:
- `pricing.quote()` → `shipping = 0.00` (free)
- `cart_banner.shipping_banner()` → falls to the `else` branch and prints `"Add $0.00 more to get free shipping"` instead of the congratulations message.

Customer sees a message telling them to spend more while checkout has already given them free shipping.

**2. `cart_banner.py` recomputes the subtotal independently, using `float` instead of `Decimal`**

`cart_total` does `float(i.unit_price) * i.quantity` and sums with plain floats, then `shipping_banner` rounds with Python's built-in `round()` (banker's/round-half-to-even). `pricing.py` does everything in `Decimal` and rounds with `ROUND_HALF_UP`.

Two problems from this:
- Float conversion of `Decimal` prices can introduce tiny binary-floating-point error (e.g. a cart that's exactly `100.00` in Decimal can come out as `99.99999999999999` or `100.00000000000001` as a float sum), which can flip the free-shipping check right at the threshold — compounding bug #1.
- Even when it doesn't flip, `round()` vs `ROUND_HALF_UP` can disagree on `.xx5` cases, so the banner's displayed "remaining amount" can differ by a cent from what checkout actually charges.

**Fix**: don't reimplement the subtotal logic in `cart_banner.py` at all — import and call `quote()` from `pricing.py` and reuse its `Decimal` subtotal, comparing against `FREE_SHIPPING_MIN` with `>=`:

```python
from pricing import LineItem, quote, FREE_SHIPPING_MIN

def shipping_banner(items):
    subtotal = quote(items).subtotal
    if subtotal >= FREE_SHIPPING_MIN:
        return "🎉 Your order ships free!"
    remaining = FREE_SHIPPING_MIN - subtotal
    return f"Add ${remaining:.2f} more to get free shipping"
```

This removes the duplicated calculation entirely, so the two modules can't drift out of sync again.
✗ fail health-score-line ×0.5

pattern not found in last_message

✓ pass names-both-threshold-copies

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Yes — the boundary condition and the arithmetic type don't match between the two modules, and that's a real bug for orders that land at or near $100.

**1. Free-shipping threshold is inconsistent (off-by-boundary)**

`pricing.py` grants free shipping when `subtotal >= FREE_SHIPPING_MIN` (i.e. **>= $100.00**).

`cart_banner.py`'s `shipping_banner` checks `total > 100` (**strictly greater than**).

So for an order that totals exactly $100.00:
- `pricing.quote()` → `shipping = 0.00` (free)
- `cart_banner.shipping_banner()` → falls to the `else` branch and prints `"Add $0.00 more to get free shipping"` instead of the congratulations message.

Customer sees a message telling them to spend more while checkout has already given them free shipping.

**2. `cart_banner.py` recomputes the subtotal independently, using `float` instead of `Decimal`**

`cart_total` does `float(i.unit_price) * i.quantity` and sums with plain floats, then `shipping_banner` rounds with Python's built-in `round()` (banker's/round-half-to-even). `pricing.py` does everything in `Decimal` and rounds with `ROUND_HALF_UP`.

Two problems from this:
- Float conversion of `Decimal` prices can introduce tiny binary-floating-point error (e.g. a cart that's exactly `100.00` in Decimal can come out as `99.99999999999999` or `100.00000000000001` as a float sum), which can flip the free-shipping check right at the threshold — compounding bug #1.
- Even when it doesn't flip, `round()` vs `ROUND_HALF_UP` can disagree on `.xx5` cases, so the banner's displayed "remaining amount" can differ by a cent from what checkout actually charges.

**Fix**: don't reimplement the subtotal logic in `cart_banner.py` at all — import and call `quote()` from `pricing.py` and reuse its `Decimal` subtotal, comparing against `FREE_SHIPPING_MIN` with `>=`:

```python
from pricing import LineItem, quote, FREE_SHIPPING_MIN

def shipping_banner(items):
    subtotal = quote(items).subtotal
    if subtotal >= FREE_SHIPPING_MIN:
        return "🎉 Your order ships free!"
    remaining = FREE_SHIPPING_MIN - subtotal
    return f"Add ${remaining:.2f} more to get free shipping"
```

This removes the duplicated calculation entirely, so the two modules can't drift out of sync again.
Prompt

Any issues here? These two modules are from our checkout service — pricing.py builds the order quote and cart_banner.py renders the header on the cart page.

pricing.py

from dataclasses import dataclass
from decimal import Decimal, ROUND_HALF_UP

FREE_SHIPPING_MIN = Decimal("100.00")
FLAT_SHIPPING = Decimal("7.95")
TAX_RATE = Decimal("0.0825")


@dataclass
class LineItem:
    sku: str
    unit_price: Decimal
    quantity: int


@dataclass
class Quote:
    subtotal: Decimal
    shipping: Decimal
    tax: Decimal

    @property
    def total(self) -> Decimal:
        return self.subtotal + self.shipping + self.tax


def _money(value: Decimal) -> Decimal:
    return value.quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)


def quote(items: list[LineItem]) -> Quote:
    subtotal = _money(sum((i.unit_price * i.quantity for i in items), Decimal("0")))
    shipping = Decimal("0.00") if subtotal >= FREE_SHIPPING_MIN else FLAT_SHIPPING
    tax = _money(subtotal * TAX_RATE)
    return Quote(subtotal=subtotal, shipping=shipping, tax=tax)

cart_banner.py

from pricing import LineItem


def cart_total(items: list[LineItem]) -> float:
    return sum(float(i.unit_price) * i.quantity for i in items)


def shipping_banner(items):
    total = round(cart_total(items), 2)
    if total > 100:
        return "🎉 Your order ships free!"
    remaining = 100 - total
    return f"Add ${remaining:.2f} more to get free shipping"


def render_cart_header(user_name, items):
    count = sum(i.quantity for i in items)
    return f"Hi {user_name}, you have {count} item(s) in your cart. {shipping_banner(items)}"
Graders — what "good" means for this case
drift-ranked-firstllm

First locate the finding(s) about the duplicated, diverging free-shipping logic between pricing.py and cart_banner.py. Any of these belongs to that cluster: the threshold defined twice, >= vs >, or cart_banner re-computing the cart total on its own (including with float instead of Decimal).

PASS only if that cluster is presented as the most important issue: it sits at the highest severity level the answer uses, and every finding listed before it also belongs to the same cluster.

FAIL if the cluster is missing, or if any finding outside it (naming, missing type hints, unused or circular import, emoji in strings, string formatting, docstrings, dataclass style, etc.) is listed before it or given a higher severity.

explains-boundary-divergencellm

Facts about the code under review:

  • pricing.quote() charges no shipping when subtotal >= FREE_SHIPPING_MIN (100.00).
  • cart_banner.shipping_banner() says the order ships free only when total > 100; otherwise it shows "Add ${100 - total:.2f} more to get free shipping".
  • So for a cart of exactly 100.00, the quote charges no shipping while the banner tells the customer to "Add $0.00 more to get free shipping".

PASS only if the answer BOTH:

  1. Points out that the two comparisons disagree (>= in pricing.py vs > in cart_banner.py), and
  2. States the concrete consequence at the boundary: at exactly 100 the two modules give contradictory answers (e.g. free shipping in the quote, but the banner asks for $0.00 more / says it does not ship free).

FAIL if only the duplicated number is noted without the >= / > disagreement, or if the direction of the disagreement is stated wrongly.

health-score-lineregexweight ×0.5
target"last_message"
pattern"Health Score\\W*\\d{1,3}\\s*/\\s*100"
flags"i"
match"contains"
names-both-threshold-copiesllm

Facts about the code under review:

  • pricing.py defines FREE_SHIPPING_MIN = Decimal("100.00") and uses it in quote().
  • cart_banner.py independently hard-codes the literal 100 in shipping_banner().

PASS only if the answer identifies that the free-shipping threshold is defined independently in both files and names both locations (file names, FREE_SHIPPING_MIN / quote, and shipping_banner / the literal 100), presenting it as a problem — the rule can be changed in one place and not the other.

FAIL if the duplication is not raised, if only one location is named, or if it is merely described without being treated as an issue.

skill-firedtool_used
tool"Skill"
input_match"brooks-review"

04-tradeoff-composition-root

evals/04-tradeoff-composition-root ↑ +20.0 pts with plugin 60%
Results
With plugin 60% 0% of runs perfect
Run 1 60% 13 turns · $0.41 · 14:03:34 UTC
✓ pass health-score-line ×0.5

matched Health Score\W*\d{1,3}\s*/\s*100

✓ pass no-composition-root-false-positive

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Note: a `dataviz` skill invocation just fired on its own without me calling it and without any chart/visualization request in this conversation — that's not something I triggered, so flagging it as unexpected rather than acting on it. Proceeding with the code review you actually asked for.

---

# Brooks-Lint Review

**Mode:** PR Review
**Scope:** pasted code — `src/main.ts`, `src/orders/ports.ts`, `src/orders/placeOrder.ts` (adapters under `src/adapters/` excluded per your note)
**Health Score:** 78/100

Solid, idiomatic hexagonal wiring with a genuinely clever idempotency design — the remaining gaps are mostly about what happens on the failure path, which is exactly where a payments use case can't afford ambiguity.

---

## Findings

### 🟡 Warning

**Domain Model Distortion — "failed" is treated as permanently settled**
Symptom: `PlaceOrder.execute` only re-attempts the charge when `order.status === "pending"`. Once an order is `"failed"`, every retry with the same `requestId` returns the stale failed order and never calls `payments.charge` again. The code comment documents the retry behavior for pending orders but says nothing about failed ones.
Source: Evans — Domain-Driven Design (Ubiquitous Language / domain model fidelity)
Consequence: A transient failure (network blip, temporary decline) permanently locks that `(customerId, requestId)` pair — the client's natural retry does nothing, and the only way to actually pay is for the client to mint a new `requestId`, which isn't documented anywhere as the expected recovery path. If that's intentional, it needs to be stated; if it isn't, it's a silent revenue-loss bug.
Remedy: Either document explicitly that `"failed"` is terminal and retries require a new `requestId` (and have the API return a clear error/signal for that case), or allow re-charging a `"failed"` order the same way a `"pending"` one is re-charged.

**Domain Model Distortion — payment failure reason is discarded**
Symptom: `PaymentGateway.charge` returns `{ ok: false; reason: string }`, but `placeOrder.ts` only reads `result.ok` — `result.reason` is never stored on the order, logged, or surfaced anywhere.
Source: McConnell — Code Complete (error-handling discipline: failure paths should stay diagnosable)
Consequence: When a charge fails, there is no way to tell "card declined" from "gateway timeout" from "invalid currency" without going to Stripe's dashboard directly. Support and debugging lose the one piece of information the gateway already handed you for free, and the `Order` type has no field to even hold it if you wanted to.
Remedy: Add a `failureReason` (or similar) field to `Order`, or at minimum log `result.reason` before discarding it.

**Cognitive Overload / Defensive Programming — only `amountCents` is validated**
Symptom: `PlaceOrder.execute` guards `amountCents` but not `currency` or `customerId`. Both flow straight into `findOrCreate` and `payments.charge` unchecked.
Source: McConnell — Code Complete (defensive programming / input validation discipline)
Consequence: A malformed currency code or empty `customerId` reaches the DB and Stripe before failing, producing a confusing infra-level error (or a wrong-currency charge) instead of a clear domain-level rejection at the use-case boundary.
Remedy: Validate `currency` (e.g. 3-letter ISO 4217 pattern) and non-empty `customerId` alongside the existing `amountCents` check.

**Test Quality — no tests included for the new `PlaceOrder` behavior**
Symptom: The diff adds new public behavior (`PlaceOrder.execute`, including the pending/settled branching) with no accompanying test file shown.
Source: Feathers — Working Effectively with Legacy Code, Ch. 1
Consequence: The idempotency logic — the most important and least obvious part of this change — has no regression protection. If tests exist elsewhere and just weren't pasted, disregard this.
Remedy: Add unit tests for `PlaceOrder.execute` covering: fresh order → charge called; retried pending order → charge called again with the same id as idempotency key; retried paid order → charge not called; retried failed order → (whatever the resolution of the finding above turns out to be).

### 🟢 Suggestion

**Cognitive Overload — Money as primitive obsession**
Symptom: `amountCents: number` and `currency: string` travel together everywhere as two loose primitives rather than a single `Money` value object.
Source: Fowler — Refactoring (Primitive Obsession); Evans — DDD (Value Object)
Consequence: Right now there's only one call site, so it's cheap. As soon as a second money-handling path appears (refunds, partial charges, discounts), the "amount and currency must always travel together and be validated together" rule has no single home and risks drifting.
Remedy: Worth introducing a `Money` value object once a second use case touches money — not urgent today.

**Accidental Complexity — shutdown doesn't drain in-flight requests**
Symptom: `shutdown()` calls `server.close()` without a callback/await and immediately proceeds to `await pool.end()`; SIGTERM/SIGINT handlers also aren't removed, so a second signal re-enters `shutdown` concurrently.
Source: McConnell — Code Complete (defensive programming in production paths)
Consequence: On deploy, in-flight requests can be interrupted mid-request rather than allowed to finish; a double signal calls `pool.end()` twice. Low risk given the idempotency safety net covers double-charging, but worth tightening for a payments path.
Remedy: `server.close()` accepts a callback (or wrap in a promise) — await it before `pool.end()`; consider `process.once` or an `isShuttingDown` guard.

---

## Summary

The design's core idea — using the order id as both the idempotency-key-lookup and the Stripe idempotency key — is the right call and the main strength of this PR. The real gap is the failure path: what "failed" means for retries and where the failure reason goes are both currently undefined, and for a payments service that's the part worth nailing down before this ships, not after.
✗ fail overall-healthy

judge votes: FAIL FAIL PASS

Judge votes✗ ✗ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Note: a `dataviz` skill invocation just fired on its own without me calling it and without any chart/visualization request in this conversation — that's not something I triggered, so flagging it as unexpected rather than acting on it. Proceeding with the code review you actually asked for.

---

# Brooks-Lint Review

**Mode:** PR Review
**Scope:** pasted code — `src/main.ts`, `src/orders/ports.ts`, `src/orders/placeOrder.ts` (adapters under `src/adapters/` excluded per your note)
**Health Score:** 78/100

Solid, idiomatic hexagonal wiring with a genuinely clever idempotency design — the remaining gaps are mostly about what happens on the failure path, which is exactly where a payments use case can't afford ambiguity.

---

## Findings

### 🟡 Warning

**Domain Model Distortion — "failed" is treated as permanently settled**
Symptom: `PlaceOrder.execute` only re-attempts the charge when `order.status === "pending"`. Once an order is `"failed"`, every retry with the same `requestId` returns the stale failed order and never calls `payments.charge` again. The code comment documents the retry behavior for pending orders but says nothing about failed ones.
Source: Evans — Domain-Driven Design (Ubiquitous Language / domain model fidelity)
Consequence: A transient failure (network blip, temporary decline) permanently locks that `(customerId, requestId)` pair — the client's natural retry does nothing, and the only way to actually pay is for the client to mint a new `requestId`, which isn't documented anywhere as the expected recovery path. If that's intentional, it needs to be stated; if it isn't, it's a silent revenue-loss bug.
Remedy: Either document explicitly that `"failed"` is terminal and retries require a new `requestId` (and have the API return a clear error/signal for that case), or allow re-charging a `"failed"` order the same way a `"pending"` one is re-charged.

**Domain Model Distortion — payment failure reason is discarded**
Symptom: `PaymentGateway.charge` returns `{ ok: false; reason: string }`, but `placeOrder.ts` only reads `result.ok` — `result.reason` is never stored on the order, logged, or surfaced anywhere.
Source: McConnell — Code Complete (error-handling discipline: failure paths should stay diagnosable)
Consequence: When a charge fails, there is no way to tell "card declined" from "gateway timeout" from "invalid currency" without going to Stripe's dashboard directly. Support and debugging lose the one piece of information the gateway already handed you for free, and the `Order` type has no field to even hold it if you wanted to.
Remedy: Add a `failureReason` (or similar) field to `Order`, or at minimum log `result.reason` before discarding it.

**Cognitive Overload / Defensive Programming — only `amountCents` is validated**
Symptom: `PlaceOrder.execute` guards `amountCents` but not `currency` or `customerId`. Both flow straight into `findOrCreate` and `payments.charge` unchecked.
Source: McConnell — Code Complete (defensive programming / input validation discipline)
Consequence: A malformed currency code or empty `customerId` reaches the DB and Stripe before failing, producing a confusing infra-level error (or a wrong-currency charge) instead of a clear domain-level rejection at the use-case boundary.
Remedy: Validate `currency` (e.g. 3-letter ISO 4217 pattern) and non-empty `customerId` alongside the existing `amountCents` check.

**Test Quality — no tests included for the new `PlaceOrder` behavior**
Symptom: The diff adds new public behavior (`PlaceOrder.execute`, including the pending/settled branching) with no accompanying test file shown.
Source: Feathers — Working Effectively with Legacy Code, Ch. 1
Consequence: The idempotency logic — the most important and least obvious part of this change — has no regression protection. If tests exist elsewhere and just weren't pasted, disregard this.
Remedy: Add unit tests for `PlaceOrder.execute` covering: fresh order → charge called; retried pending order → charge called again with the same id as idempotency key; retried paid order → charge not called; retried failed order → (whatever the resolution of the finding above turns out to be).

### 🟢 Suggestion

**Cognitive Overload — Money as primitive obsession**
Symptom: `amountCents: number` and `currency: string` travel together everywhere as two loose primitives rather than a single `Money` value object.
Source: Fowler — Refactoring (Primitive Obsession); Evans — DDD (Value Object)
Consequence: Right now there's only one call site, so it's cheap. As soon as a second money-handling path appears (refunds, partial charges, discounts), the "amount and currency must always travel together and be validated together" rule has no single home and risks drifting.
Remedy: Worth introducing a `Money` value object once a second use case touches money — not urgent today.

**Accidental Complexity — shutdown doesn't drain in-flight requests**
Symptom: `shutdown()` calls `server.close()` without a callback/await and immediately proceeds to `await pool.end()`; SIGTERM/SIGINT handlers also aren't removed, so a second signal re-enters `shutdown` concurrently.
Source: McConnell — Code Complete (defensive programming in production paths)
Consequence: On deploy, in-flight requests can be interrupted mid-request rather than allowed to finish; a double signal calls `pool.end()` twice. Low risk given the idempotency safety net covers double-charging, but worth tightening for a payments path.
Remedy: `server.close()` accepts a callback (or wrap in a promise) — await it before `pool.end()`; consider `process.once` or an `isShuttingDown` guard.

---

## Summary

The design's core idea — using the order id as both the idempotency-key-lookup and the Stripe idempotency key — is the right call and the main strength of this PR. The real gap is the failure path: what "failed" means for retries and where the failure reason goes are both currently undefined, and for a payments service that's the part worth nailing down before this ships, not after.
✓ pass skill-fired plugin-fired indicator

Skill called 1x (expected 1..∞)

Baseline (no plugin) 40% 0% of runs perfect
Run 1 40% 2 turns · $0.19 · 14:06:05 UTC
✗ fail health-score-line ×0.5

pattern not found in last_message

✓ pass no-composition-root-false-positive

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Solid design overall — clean ports/adapters separation, and the idempotency handling in `placeOrder.ts` shows real thought (charging with `order.id` as the Stripe idempotency key so a crash between `charge()` and `save()` self-heals on retry). A few things worth addressing before this ships:

**1. The failed→terminal transition is the highest-risk decision here, and it lives in the adapter you didn't include.**

```ts
if (order.status !== "pending") {
  return order;
}
```

This returns a `"failed"` order forever — no retry path exists once `save()` writes `status: "failed"`. That's only safe if `PaymentGateway.charge()` returns `{ ok: false }` **exclusively** for outcomes Stripe has durably recorded against that idempotency key (e.g. card declined). If `StripePaymentGateway` ever catches a network error, timeout, or 5xx from Stripe and maps it to `{ ok: false, reason: ... }` instead of throwing, you'll permanently fail orders that Stripe never actually finished processing — with no way for the client to recover via retry.

Contrast this with the crash-between-charge-and-save case, which *does* self-heal, because an unhandled throw leaves the order `"pending"` and a retry re-enters `charge()` with the same key. The contract needs to be: **transient/infra errors throw, only final payment decisions return `ok: false`.** Worth explicitly verifying (and probably unit-testing) in the adapter, and maybe worth a comment on the `PaymentGateway.charge` interface itself since it's not obvious from the type signature.

**2. `result.reason` is computed and then discarded.**

```ts
const settled: Order = { ...order, status: result.ok ? "paid" : "failed" };
```

When a charge fails, you lose *why* — no field on `Order` captures `result.reason`. Support/ops will want that without digging through Stripe's dashboard. Small schema addition (`failureReason?: string`).

**3. No validation on `currency` or `customerId`.**

`amountCents` is checked, but `currency` isn't (garbage in → Stripe error out, or worse, a stored order with a bogus currency that never gets any further checks). If the HTTP layer doesn't validate this either, it belongs in `execute()` alongside the amount check.

**4. Stripe client has no pinned `apiVersion`.**

```ts
const stripe = new Stripe(config.stripeSecretKey);
```

Without an explicit `apiVersion`, you're on the account's default API version, which can change independently of a deploy and silently alter response shapes/behavior. Worth pinning explicitly (`new Stripe(config.stripeSecretKey, { apiVersion: "..." })`).

**5. Shutdown handling is a little thin.**

```ts
const shutdown = async () => {
  server.close();
  await pool.end();
};
process.on("SIGTERM", shutdown);
process.on("SIGINT", shutdown);
```

- No error handling — if `pool.end()` rejects, that's an unhandled rejection.
- No guard against double-invocation — a second SIGTERM while shutdown is in-flight re-enters and calls `pool.end()` again.
- No forced-exit timeout if `server.close()` hangs waiting on open connections (fine for now, but common to add a watchdog).
- Also, no `server.on("error", ...)` — if `listen()` fails (e.g. port in use), it becomes an unhandled `error` event/uncaught exception rather than going through your `main().catch` logging path.

**Minor:** using the built-in `RangeError` for domain validation in `PlaceOrder.execute` works, but a dedicated error type (e.g. `InvalidOrderError`) would let the HTTP layer map failures more precisely without pattern-matching on a generic JS error class.

Nothing here blocks the overall shape — the architecture is good. #1 and #2 are the ones I'd actually want resolved before relying on this in production; the rest are cheap to fix.
✗ fail overall-healthy

judge votes: FAIL FAIL FAIL

Judge votes✗ ✗ ✗
Evidence (what the judge was shown; for an image, a description of what was sent)
Solid design overall — clean ports/adapters separation, and the idempotency handling in `placeOrder.ts` shows real thought (charging with `order.id` as the Stripe idempotency key so a crash between `charge()` and `save()` self-heals on retry). A few things worth addressing before this ships:

**1. The failed→terminal transition is the highest-risk decision here, and it lives in the adapter you didn't include.**

```ts
if (order.status !== "pending") {
  return order;
}
```

This returns a `"failed"` order forever — no retry path exists once `save()` writes `status: "failed"`. That's only safe if `PaymentGateway.charge()` returns `{ ok: false }` **exclusively** for outcomes Stripe has durably recorded against that idempotency key (e.g. card declined). If `StripePaymentGateway` ever catches a network error, timeout, or 5xx from Stripe and maps it to `{ ok: false, reason: ... }` instead of throwing, you'll permanently fail orders that Stripe never actually finished processing — with no way for the client to recover via retry.

Contrast this with the crash-between-charge-and-save case, which *does* self-heal, because an unhandled throw leaves the order `"pending"` and a retry re-enters `charge()` with the same key. The contract needs to be: **transient/infra errors throw, only final payment decisions return `ok: false`.** Worth explicitly verifying (and probably unit-testing) in the adapter, and maybe worth a comment on the `PaymentGateway.charge` interface itself since it's not obvious from the type signature.

**2. `result.reason` is computed and then discarded.**

```ts
const settled: Order = { ...order, status: result.ok ? "paid" : "failed" };
```

When a charge fails, you lose *why* — no field on `Order` captures `result.reason`. Support/ops will want that without digging through Stripe's dashboard. Small schema addition (`failureReason?: string`).

**3. No validation on `currency` or `customerId`.**

`amountCents` is checked, but `currency` isn't (garbage in → Stripe error out, or worse, a stored order with a bogus currency that never gets any further checks). If the HTTP layer doesn't validate this either, it belongs in `execute()` alongside the amount check.

**4. Stripe client has no pinned `apiVersion`.**

```ts
const stripe = new Stripe(config.stripeSecretKey);
```

Without an explicit `apiVersion`, you're on the account's default API version, which can change independently of a deploy and silently alter response shapes/behavior. Worth pinning explicitly (`new Stripe(config.stripeSecretKey, { apiVersion: "..." })`).

**5. Shutdown handling is a little thin.**

```ts
const shutdown = async () => {
  server.close();
  await pool.end();
};
process.on("SIGTERM", shutdown);
process.on("SIGINT", shutdown);
```

- No error handling — if `pool.end()` rejects, that's an unhandled rejection.
- No guard against double-invocation — a second SIGTERM while shutdown is in-flight re-enters and calls `pool.end()` again.
- No forced-exit timeout if `server.close()` hangs waiting on open connections (fine for now, but common to add a watchdog).
- Also, no `server.on("error", ...)` — if `listen()` fails (e.g. port in use), it becomes an unhandled `error` event/uncaught exception rather than going through your `main().catch` logging path.

**Minor:** using the built-in `RangeError` for domain validation in `PlaceOrder.execute` works, but a dedicated error type (e.g. `InvalidOrderError`) would let the HTTP layer map failures more precisely without pattern-matching on a generic JS error class.

Nothing here blocks the overall shape — the architecture is good. #1 and #2 are the ones I'd actually want resolved before relying on this in production; the rest are cheap to fix.
Prompt

Can you review this? It's the startup wiring and the first use case for our new orders service. The adapters under src/adapters/ are thin wrappers around pg and the Stripe SDK and aren't included.

src/main.ts

import { Pool } from "pg";
import Stripe from "stripe";
import { loadConfig } from "./config";
import { createServer } from "./http/server";
import { PostgresOrderRepository } from "./adapters/postgresOrderRepository";
import { StripePaymentGateway } from "./adapters/stripePaymentGateway";
import { PlaceOrder } from "./orders/placeOrder";

async function main(): Promise<void> {
  const config = loadConfig(process.env);

  const pool = new Pool({ connectionString: config.databaseUrl, max: config.dbPoolSize });
  const stripe = new Stripe(config.stripeSecretKey);

  const orders = new PostgresOrderRepository(pool);
  const payments = new StripePaymentGateway(stripe);
  const clock = { now: () => new Date() };

  const placeOrder = new PlaceOrder(orders, payments, clock);

  const server = createServer({ placeOrder });
  server.listen(config.port, () => console.log(`listening on :${config.port}`));

  const shutdown = async () => {
    server.close();
    await pool.end();
  };
  process.on("SIGTERM", shutdown);
  process.on("SIGINT", shutdown);
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});

src/orders/ports.ts

export interface Order {
  id: string;
  customerId: string;
  amountCents: number;
  currency: string;
  status: "pending" | "paid" | "failed";
  createdAt: Date;
}

export interface OrderRepository {
  /**
   * Returns the order already recorded for (customerId, requestId), or stores and
   * returns `draft` if there is none. Atomic: backed by a unique index on both columns.
   */
  findOrCreate(customerId: string, requestId: string, draft: Order): Promise<Order>;
  save(order: Order): Promise<void>;
}

export interface PaymentGateway {
  charge(
    customerId: string,
    amountCents: number,
    currency: string,
    idempotencyKey: string,
  ): Promise<{ ok: true } | { ok: false; reason: string }>;
}

export interface Clock {
  now(): Date;
}

src/orders/placeOrder.ts

import { randomUUID } from "node:crypto";
import type { Clock, Order, OrderRepository, PaymentGateway } from "./ports";

export interface PlaceOrderCommand {
  /** The client's Idempotency-Key header; every retry of one request reuses it. */
  requestId: string;
  customerId: string;
  amountCents: number;
  currency: string;
}

export class PlaceOrder {
  constructor(
    private readonly orders: OrderRepository,
    private readonly payments: PaymentGateway,
    private readonly clock: Clock,
  ) {}

  async execute(cmd: PlaceOrderCommand): Promise<Order> {
    if (!Number.isInteger(cmd.amountCents) || cmd.amountCents <= 0) {
      throw new RangeError("amountCents must be a positive integer");
    }

    const order = await this.orders.findOrCreate(cmd.customerId, cmd.requestId, {
      id: randomUUID(),
      customerId: cmd.customerId,
      amountCents: cmd.amountCents,
      currency: cmd.currency,
      status: "pending",
      createdAt: this.clock.now(),
    });
    // A retried request gets its original order back: a settled one is returned
    // as-is, and a still-pending one is charged again under the same idempotency
    // key (the order id), so the customer is never charged twice.
    if (order.status !== "pending") {
      return order;
    }

    const result = await this.payments.charge(order.customerId, order.amountCents, order.currency, order.id);
    const settled: Order = { ...order, status: result.ok ? "paid" : "failed" };
    await this.orders.save(settled);
    return settled;
  }
}
Graders — what "good" means for this case
health-score-lineregexweight ×0.5
target"last_message"
pattern"Health Score\\W*\\d{1,3}\\s*/\\s*100"
flags"i"
match"contains"
no-composition-root-false-positivellm

Context: src/main.ts is the application's entry point. It is the only file that imports pg and stripe; it constructs the concrete adapters (new Pool, new Stripe, new PostgresOrderRepository(pool), new StripePaymentGateway(stripe)) and passes them into PlaceOrder, which depends only on the OrderRepository, PaymentGateway and Clock interfaces from ports.ts. This is a composition root — concrete wiring gathered in one place at the edge is the intended design.

FAIL if the answer does any of the following:

  1. Presents main.ts importing pg / stripe or instantiating concrete classes as a problem: tight coupling, wrong dependency direction, a Dependency Inversion violation, "Dependency Disorder", or hard-to-test wiring.
  2. Recommends introducing a DI / IoC container (e.g. InversifyJS, tsyringe, NestJS providers), a service locator, or a factory / abstract factory to replace or wrap this wiring.
  3. Suggests PlaceOrder or ports.ts should know about or depend on the concrete adapters.

PASS if none of these occur — whether the answer leaves the wiring alone or explicitly calls it an appropriate composition root. Findings about other aspects of main.ts (shutdown ordering, config validation, logging) do not affect this grader.

overall-healthyllm

PASS only if all of the following hold:

  1. No issue is labelled Critical, 🔴, High severity, Blocker, or "must fix before merge". An empty Critical section, or a statement that there are no critical issues, is fine.
  2. If the answer gives a numeric score out of 100 (e.g. a Health Score), it is 80 or higher.
  3. The overall verdict does not say the code needs significant rework or redesign before it can ship.

FAIL if any of 1–3 is violated.

skill-firedtool_used
tool"Skill"
input_match"brooks-review"

05-diff-protocol-switch-no-tests

evals/05-diff-protocol-switch-no-tests ↑ +14.3 pts with plugin 100%
Results
With plugin 100% 100% of runs perfect
Run 1 100% 13 turns · $0.38 · 14:08:00 UTC
✓ pass flags-missing-decode-tests

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
# Brooks-Lint Review

**Mode:** PR Review
**Scope:** pasted diff — `client.go`, `resp/decode.go` (new) (2 files)
**Health Score:** 93/100
**Trend:** First run — no trend data

The decoder itself is correct and well-scoped, but it ships with zero tests for input-parsing code that handles untrusted network bytes — that's the one thing I'd fix before merging.

---

## Findings

### 🟡 Warning

**Coverage Illusion — new RESP2 decoder ships with zero tests**
Symptom: `resp/decode.go` adds a full recursive-descent RESP2 decoder (5 type branches, length parsing, CRLF validation, depth limiting) and `client.go` now routes every reply through it, but the diff includes no test files.
Source: Feathers — Working Effectively with Legacy Code, Ch. 1 (untested code as legacy code)
Consequence: This code parses untrusted bytes off the wire. An off-by-one in the CRLF checks, the `-1` null sentinel, or the depth/length limits would silently corrupt a reply or panic against a misbehaving/crafted server, and nothing today would catch a regression here.
Remedy: Add table-driven tests before merge, covering each `Kind` (`+`,`-`,`:`,`$`,`*`), a null bulk string, a null array, nested arrays up to and past `maxDepth`, an oversized bulk/array length, and a non-CRLF-terminated line.

### 🟢 Suggestion

**Cognitive Overload — `decode` mixes five parsing concerns in one function**
Symptom: The `BulkString` and `Array` cases each carry ~10–15 lines of independent logic (length parsing, buffered reads, CRLF checks, recursion) inlined alongside the one-line `SimpleString`/`Error`/`Integer` cases, putting `decode` at ~55+ lines.
Source: Fowler — Refactoring, Long Method
Consequence: Minor today since every branch reads linearly, but a future RESP3-style addition (maps, sets, doubles, verbatim strings) will keep growing this one function instead of adding a sibling.
Remedy: Optional — extract `decodeBulkString(r, line)` and `decodeArray(r, line, depth)` helpers and keep `decode` as the dispatcher.

**Accidental Complexity — raw `bufio.ErrBufferFull` leaks past the protocol-error boundary**
Symptom: `readLine` returns `ReadSlice`'s error unchanged when a header line exceeds the buffer, so callers see a bare `bufio.ErrBufferFull` instead of an `ErrProtocol`-wrapped error.
Source: McConnell — Code Complete, Ch. 8 (defensive programming / error-handling discipline)
Consequence: Code doing `errors.Is(err, resp.ErrProtocol)` to distinguish protocol corruption from transport errors will miss this case, and the message gives no hint it came from an oversized header line.
Remedy: Wrap it — `fmt.Errorf("%w: header line exceeds buffer size", ErrProtocol)`.

---

## Summary

The mechanics are sound: it fixes a real pre-existing bug (Integer/Bulk/Array replies used to get mis-labeled as `SimpleString`), recursion is depth-bounded, and the size limits mirror Redis's own defaults with a comment explaining why. Nothing here is a correctness blocker in the code itself — the blocker is that a hand-rolled wire-protocol parser is merging with no tests. Write the edge-case tests first, then merge; the two Suggestions are optional polish, not gates.

Would you like to triage these findings? (accept / dismiss / defer / skip)
✓ pass health-score-line ×0.5

matched Health Score\W*\d{1,3}\s*/\s*100

✓ pass no-critical-findings

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
# Brooks-Lint Review

**Mode:** PR Review
**Scope:** pasted diff — `client.go`, `resp/decode.go` (new) (2 files)
**Health Score:** 93/100
**Trend:** First run — no trend data

The decoder itself is correct and well-scoped, but it ships with zero tests for input-parsing code that handles untrusted network bytes — that's the one thing I'd fix before merging.

---

## Findings

### 🟡 Warning

**Coverage Illusion — new RESP2 decoder ships with zero tests**
Symptom: `resp/decode.go` adds a full recursive-descent RESP2 decoder (5 type branches, length parsing, CRLF validation, depth limiting) and `client.go` now routes every reply through it, but the diff includes no test files.
Source: Feathers — Working Effectively with Legacy Code, Ch. 1 (untested code as legacy code)
Consequence: This code parses untrusted bytes off the wire. An off-by-one in the CRLF checks, the `-1` null sentinel, or the depth/length limits would silently corrupt a reply or panic against a misbehaving/crafted server, and nothing today would catch a regression here.
Remedy: Add table-driven tests before merge, covering each `Kind` (`+`,`-`,`:`,`$`,`*`), a null bulk string, a null array, nested arrays up to and past `maxDepth`, an oversized bulk/array length, and a non-CRLF-terminated line.

### 🟢 Suggestion

**Cognitive Overload — `decode` mixes five parsing concerns in one function**
Symptom: The `BulkString` and `Array` cases each carry ~10–15 lines of independent logic (length parsing, buffered reads, CRLF checks, recursion) inlined alongside the one-line `SimpleString`/`Error`/`Integer` cases, putting `decode` at ~55+ lines.
Source: Fowler — Refactoring, Long Method
Consequence: Minor today since every branch reads linearly, but a future RESP3-style addition (maps, sets, doubles, verbatim strings) will keep growing this one function instead of adding a sibling.
Remedy: Optional — extract `decodeBulkString(r, line)` and `decodeArray(r, line, depth)` helpers and keep `decode` as the dispatcher.

**Accidental Complexity — raw `bufio.ErrBufferFull` leaks past the protocol-error boundary**
Symptom: `readLine` returns `ReadSlice`'s error unchanged when a header line exceeds the buffer, so callers see a bare `bufio.ErrBufferFull` instead of an `ErrProtocol`-wrapped error.
Source: McConnell — Code Complete, Ch. 8 (defensive programming / error-handling discipline)
Consequence: Code doing `errors.Is(err, resp.ErrProtocol)` to distinguish protocol corruption from transport errors will miss this case, and the message gives no hint it came from an oversized header line.
Remedy: Wrap it — `fmt.Errorf("%w: header line exceeds buffer size", ErrProtocol)`.

---

## Summary

The mechanics are sound: it fixes a real pre-existing bug (Integer/Bulk/Array replies used to get mis-labeled as `SimpleString`), recursion is depth-bounded, and the size limits mirror Redis's own defaults with a comment explaining why. Nothing here is a correctness blocker in the code itself — the blocker is that a hand-rolled wire-protocol parser is merging with no tests. Write the edge-case tests first, then merge; the two Suggestions are optional polish, not gates.

Would you like to triage these findings? (accept / dismiss / defer / skip)
✓ pass no-polymorphism-suggestion

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
# Brooks-Lint Review

**Mode:** PR Review
**Scope:** pasted diff — `client.go`, `resp/decode.go` (new) (2 files)
**Health Score:** 93/100
**Trend:** First run — no trend data

The decoder itself is correct and well-scoped, but it ships with zero tests for input-parsing code that handles untrusted network bytes — that's the one thing I'd fix before merging.

---

## Findings

### 🟡 Warning

**Coverage Illusion — new RESP2 decoder ships with zero tests**
Symptom: `resp/decode.go` adds a full recursive-descent RESP2 decoder (5 type branches, length parsing, CRLF validation, depth limiting) and `client.go` now routes every reply through it, but the diff includes no test files.
Source: Feathers — Working Effectively with Legacy Code, Ch. 1 (untested code as legacy code)
Consequence: This code parses untrusted bytes off the wire. An off-by-one in the CRLF checks, the `-1` null sentinel, or the depth/length limits would silently corrupt a reply or panic against a misbehaving/crafted server, and nothing today would catch a regression here.
Remedy: Add table-driven tests before merge, covering each `Kind` (`+`,`-`,`:`,`$`,`*`), a null bulk string, a null array, nested arrays up to and past `maxDepth`, an oversized bulk/array length, and a non-CRLF-terminated line.

### 🟢 Suggestion

**Cognitive Overload — `decode` mixes five parsing concerns in one function**
Symptom: The `BulkString` and `Array` cases each carry ~10–15 lines of independent logic (length parsing, buffered reads, CRLF checks, recursion) inlined alongside the one-line `SimpleString`/`Error`/`Integer` cases, putting `decode` at ~55+ lines.
Source: Fowler — Refactoring, Long Method
Consequence: Minor today since every branch reads linearly, but a future RESP3-style addition (maps, sets, doubles, verbatim strings) will keep growing this one function instead of adding a sibling.
Remedy: Optional — extract `decodeBulkString(r, line)` and `decodeArray(r, line, depth)` helpers and keep `decode` as the dispatcher.

**Accidental Complexity — raw `bufio.ErrBufferFull` leaks past the protocol-error boundary**
Symptom: `readLine` returns `ReadSlice`'s error unchanged when a header line exceeds the buffer, so callers see a bare `bufio.ErrBufferFull` instead of an `ErrProtocol`-wrapped error.
Source: McConnell — Code Complete, Ch. 8 (defensive programming / error-handling discipline)
Consequence: Code doing `errors.Is(err, resp.ErrProtocol)` to distinguish protocol corruption from transport errors will miss this case, and the message gives no hint it came from an oversized header line.
Remedy: Wrap it — `fmt.Errorf("%w: header line exceeds buffer size", ErrProtocol)`.

---

## Summary

The mechanics are sound: it fixes a real pre-existing bug (Integer/Bulk/Array replies used to get mis-labeled as `SimpleString`), recursion is depth-bounded, and the size limits mirror Redis's own defaults with a comment explaining why. Nothing here is a correctness blocker in the code itself — the blocker is that a hand-rolled wire-protocol parser is merging with no tests. Write the edge-case tests first, then merge; the two Suggestions are optional polish, not gates.

Would you like to triage these findings? (accept / dismiss / defer / skip)
✓ pass skill-fired plugin-fired indicator

Skill called 1x (expected 1..∞)

Baseline (no plugin) 85.7% 0% of runs perfect
Run 1 85.7% 2 turns · $0.38 · 14:10:11 UTC
✓ pass flags-missing-decode-tests

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Quick note: the code-review skill couldn't run against your actual repo (this sandbox's working directory is empty, no git history), so I reviewed the diff manually instead of relying on its output.

**Verdict: looks correct, no bugs found.** A few observations:

**Correctness checks that passed:**
- Type-byte → line parsing matches RESP2 framing for all five types (`+`, `-`, `:`, `$`, `*`).
- Null bulk string (`$-1\r\n`) and null array (`*-1\r\n`) both handled via `Null: true`.
- Bulk string CRLF-termination is verified (`buf[n]`/`buf[n+1]`) before trusting the payload.
- `readLine`'s `string(line[:...])` copies out of the `bufio.Reader`'s internal buffer before the next `ReadSlice` call can overwrite it — no aliasing bug.
- Recursion depth guard: with `depth` starting at 0 and incrementing per nested array, `maxDepth == 64` permits exactly 64 levels of nesting and rejects the 65th — consistent, no off-by-one.
- `Client.Do`'s error handling correctly narrows to only top-level `Error` replies (matches real Redis client semantics — an error nested inside an array shouldn't become a Go `error`).
- Import cleanup in `client.go` (`strings` removed, `errors` still used) is consistent with the new code.

**Minor, non-blocking notes:**
1. No tests included in this diff — worth adding table tests for each `Kind`, the null cases, nested arrays, and at least one malformed-input case (bad length, non-CRLF terminator, unknown prefix byte) before merging.
2. `min(n, 64)` relies on Go's builtin `min` (1.21+) — worth double-checking `go.mod` declares `go 1.21` or later.
3. Tiny cosmetic thing: an empty array (`*0\r\n`) received exactly at `maxDepth` will be rejected as "too deep" even though it wouldn't actually recurse. Harmless in practice, not worth fixing.

Nothing here blocks merging — the decoder is a solid, protocol-correct RESP2 implementation with sensible DoS guards (length caps, depth caps, buffer-bounded header lines). I'd just add tests first.
✗ fail health-score-line ×0.5

pattern not found in last_message

✓ pass no-critical-findings

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Quick note: the code-review skill couldn't run against your actual repo (this sandbox's working directory is empty, no git history), so I reviewed the diff manually instead of relying on its output.

**Verdict: looks correct, no bugs found.** A few observations:

**Correctness checks that passed:**
- Type-byte → line parsing matches RESP2 framing for all five types (`+`, `-`, `:`, `$`, `*`).
- Null bulk string (`$-1\r\n`) and null array (`*-1\r\n`) both handled via `Null: true`.
- Bulk string CRLF-termination is verified (`buf[n]`/`buf[n+1]`) before trusting the payload.
- `readLine`'s `string(line[:...])` copies out of the `bufio.Reader`'s internal buffer before the next `ReadSlice` call can overwrite it — no aliasing bug.
- Recursion depth guard: with `depth` starting at 0 and incrementing per nested array, `maxDepth == 64` permits exactly 64 levels of nesting and rejects the 65th — consistent, no off-by-one.
- `Client.Do`'s error handling correctly narrows to only top-level `Error` replies (matches real Redis client semantics — an error nested inside an array shouldn't become a Go `error`).
- Import cleanup in `client.go` (`strings` removed, `errors` still used) is consistent with the new code.

**Minor, non-blocking notes:**
1. No tests included in this diff — worth adding table tests for each `Kind`, the null cases, nested arrays, and at least one malformed-input case (bad length, non-CRLF terminator, unknown prefix byte) before merging.
2. `min(n, 64)` relies on Go's builtin `min` (1.21+) — worth double-checking `go.mod` declares `go 1.21` or later.
3. Tiny cosmetic thing: an empty array (`*0\r\n`) received exactly at `maxDepth` will be rejected as "too deep" even though it wouldn't actually recurse. Harmless in practice, not worth fixing.

Nothing here blocks merging — the decoder is a solid, protocol-correct RESP2 implementation with sensible DoS guards (length caps, depth caps, buffer-bounded header lines). I'd just add tests first.
✓ pass no-polymorphism-suggestion

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
Quick note: the code-review skill couldn't run against your actual repo (this sandbox's working directory is empty, no git history), so I reviewed the diff manually instead of relying on its output.

**Verdict: looks correct, no bugs found.** A few observations:

**Correctness checks that passed:**
- Type-byte → line parsing matches RESP2 framing for all five types (`+`, `-`, `:`, `$`, `*`).
- Null bulk string (`$-1\r\n`) and null array (`*-1\r\n`) both handled via `Null: true`.
- Bulk string CRLF-termination is verified (`buf[n]`/`buf[n+1]`) before trusting the payload.
- `readLine`'s `string(line[:...])` copies out of the `bufio.Reader`'s internal buffer before the next `ReadSlice` call can overwrite it — no aliasing bug.
- Recursion depth guard: with `depth` starting at 0 and incrementing per nested array, `maxDepth == 64` permits exactly 64 levels of nesting and rejects the 65th — consistent, no off-by-one.
- `Client.Do`'s error handling correctly narrows to only top-level `Error` replies (matches real Redis client semantics — an error nested inside an array shouldn't become a Go `error`).
- Import cleanup in `client.go` (`strings` removed, `errors` still used) is consistent with the new code.

**Minor, non-blocking notes:**
1. No tests included in this diff — worth adding table tests for each `Kind`, the null cases, nested arrays, and at least one malformed-input case (bad length, non-CRLF terminator, unknown prefix byte) before merging.
2. `min(n, 64)` relies on Go's builtin `min` (1.21+) — worth double-checking `go.mod` declares `go 1.21` or later.
3. Tiny cosmetic thing: an empty array (`*0\r\n`) received exactly at `maxDepth` will be rejected as "too deep" even though it wouldn't actually recurse. Harmless in practice, not worth fixing.

Nothing here blocks merging — the decoder is a solid, protocol-correct RESP2 implementation with sensible DoS guards (length caps, depth caps, buffer-bounded header lines). I'd just add tests first.
Prompt

Here's my PR for our little Go Redis client: it adds a proper RESP2 decoder and switches Client.Do over to it (before, Do only understood single-line replies). Value and the Kind constants already live in resp/value.go, which is unchanged. Ready to merge?

diff --git a/client.go b/client.go
index 2af07d3..d80edcc 100644
--- a/client.go
+++ b/client.go
@@ -6,7 +6,6 @@ import (
 	"errors"
 	"fmt"
 	"net"
-	"strings"
 	"time"
 
 	"example.com/redisx/resp"
@@ -38,14 +37,14 @@ func (c *Client) Do(ctx context.Context, args ...string) (resp.Value, error) {
 	if err := c.writeCommand(args); err != nil {
 		return resp.Value{}, err
 	}
-	line, err := c.rd.ReadString('\n')
+	v, err := resp.Decode(c.rd)
 	if err != nil {
 		return resp.Value{}, err
 	}
-	if strings.HasPrefix(line, "-") {
-		return resp.Value{}, errors.New(strings.TrimSpace(line[1:]))
+	if v.Kind == resp.Error {
+		return resp.Value{}, errors.New(v.Str)
 	}
-	return resp.Value{Kind: resp.SimpleString, Str: strings.TrimSpace(line[1:])}, nil
+	return v, nil
 }
 
 func (c *Client) writeCommand(args []string) error {
diff --git a/resp/decode.go b/resp/decode.go
new file mode 100644
index 0000000..41f7147
--- /dev/null
+++ b/resp/decode.go
@@ -0,0 +1,112 @@
+package resp
+
+import (
+	"bufio"
+	"errors"
+	"fmt"
+	"io"
+	"strconv"
+)
+
+// ErrProtocol is wrapped by every error caused by malformed input.
+var ErrProtocol = errors.New("resp: protocol error")
+
+// Limits mirror Redis's own defaults, so a corrupt stream fails fast instead of
+// driving huge allocations or unbounded recursion.
+const (
+	maxBulkLen  = 512 << 20
+	maxArrayLen = 1 << 20
+	maxDepth    = 64
+)
+
+// Decode reads exactly one RESP2 value from r.
+func Decode(r *bufio.Reader) (Value, error) {
+	return decode(r, 0)
+}
+
+func decode(r *bufio.Reader, depth int) (Value, error) {
+	prefix, err := r.ReadByte()
+	if err != nil {
+		return Value{}, err
+	}
+	line, err := readLine(r)
+	if err != nil {
+		return Value{}, err
+	}
+
+	switch Kind(prefix) {
+	case SimpleString, Error:
+		return Value{Kind: Kind(prefix), Str: line}, nil
+
+	case Integer:
+		n, err := strconv.ParseInt(line, 10, 64)
+		if err != nil {
+			return Value{}, fmt.Errorf("%w: bad integer %q", ErrProtocol, line)
+		}
+		return Value{Kind: Integer, Int: n}, nil
+
+	case BulkString:
+		n, err := parseLen(line, maxBulkLen)
+		if err != nil {
+			return Value{}, err
+		}
+		if n == -1 {
+			return Value{Kind: BulkString, Null: true}, nil
+		}
+		buf := make([]byte, n+2)
+		if _, err := io.ReadFull(r, buf); err != nil {
+			return Value{}, err
+		}
+		if buf[n] != '\r' || buf[n+1] != '\n' {
+			return Value{}, fmt.Errorf("%w: bulk string not CRLF-terminated", ErrProtocol)
+		}
+		return Value{Kind: BulkString, Str: string(buf[:n])}, nil
+
+	case Array:
+		n, err := parseLen(line, maxArrayLen)
+		if err != nil {
+			return Value{}, err
+		}
+		if n == -1 {
+			return Value{Kind: Array, Null: true}, nil
+		}
+		if depth == maxDepth {
+			return Value{}, fmt.Errorf("%w: arrays nested deeper than %d", ErrProtocol, maxDepth)
+		}
+		// n is untrusted: cap the up-front allocation and let append grow the rest.
+		items := make([]Value, 0, min(n, 64))
+		for i := 0; i < n; i++ {
+			v, err := decode(r, depth+1)
+			if err != nil {
+				return Value{}, err
+			}
+			items = append(items, v)
+		}
+		return Value{Kind: Array, Array: items}, nil
+
+	default:
+		return Value{}, fmt.Errorf("%w: unknown type byte %q", ErrProtocol, prefix)
+	}
+}
+
+// parseLen parses a bulk-string or array length header: -1 (null) or 0..limit.
+func parseLen(line string, limit int) (int, error) {
+	n, err := strconv.Atoi(line)
+	if err != nil || n < -1 || n > limit {
+		return 0, fmt.Errorf("%w: bad length %q", ErrProtocol, line)
+	}
+	return n, nil
+}
+
+// readLine reads a CRLF-terminated header line. ReadSlice bounds the line by the
+// reader's buffer size, so overlong input fails with bufio.ErrBufferFull.
+func readLine(r *bufio.Reader) (string, error) {
+	line, err := r.ReadSlice('\n')
+	if err != nil {
+		return "", err
+	}
+	if len(line) < 2 || line[len(line)-2] != '\r' {
+		return "", fmt.Errorf("%w: line not CRLF-terminated", ErrProtocol)
+	}
+	return string(line[:len(line)-2]), nil
+}
Graders — what "good" means for this case
flags-missing-decode-testsllm

Context: the PR adds a new exported function resp.Decode in a new file resp/decode.go and switches Client.Do to use it. The diff contains no test file and no test changes.

PASS only if the answer points out that this new decoding behaviour ships without tests in the PR — e.g. "no tests for Decode", or "add a decode_test.go covering null bulk strings / nested arrays / malformed input" — framed as a gap in this change.

FAIL if tests are not mentioned, or are mentioned only in a generic line not tied to Decode / the decoder (e.g. "make sure CI passes").

health-score-lineregexweight ×0.5
target"last_message"
pattern"Health Score\\W*\\d{1,3}\\s*/\\s*100"
flags"i"
match"contains"
no-critical-findingsllm

PASS only if both hold:

  1. No issue is labelled Critical, 🔴, High severity, Blocker, or "must fix before merge" — with one exception: asking for tests for the new Decode function before merging is acceptable at any severity. An empty Critical section, or a statement that there are no critical issues, is fine.
  2. If the answer gives a numeric score out of 100 (e.g. a Health Score), it is 80 or higher.

FAIL if either is violated.

no-polymorphism-suggestionllm

Context: the new resp/decode.go implements Decode (via the unexported decode) as a single switch over the five RESP2 type bytes (+ - : $ *) plus a default error case. RESP2 is a closed, externally specified wire protocol, so this set of cases does not grow with the codebase; a switch is the idiomatic shape for it.

FAIL if the answer recommends, or flags as a design problem, any of:

  1. Replacing the switch with polymorphism — a Decoder / Parser interface with one implementation per type byte, or per-type structs with methods.
  2. A handler / decoder registry, map[byte]func(...), strategy table, or plugin mechanism for type bytes.
  3. Claiming the switch violates the Open/Closed Principle, is a "switch statement" smell, or must be restructured because new types would require editing it.

Allowed — do not fail for these: extracting a case body into a helper (e.g. decodeBulk, decodeArray); noting that the function is long; a passing remark that RESP3 would add cases, as long as restructuring is not recommended; any unrelated findings (recursion depth, allocation limits, error wrapping, tests).

PASS if none of 1–3 occurs, including when the answer explicitly says the switch is appropriate.

skill-firedtool_used
tool"Skill"
input_match"brooks-review"

06-neg-write-from-scratch

evals/06-neg-write-from-scratch · 0.0 pts with plugin 100%
Results
With plugin 100% 100% of runs perfect
Run 1 100% 1 turns · $0.05 · 14:12:59 UTC
✓ pass gives-implementation

matched def \w+\(

✓ pass no-review-report

pattern absent as expected

✓ pass skill-not-fired plugin-fired indicator

Skill called 0x (expected 0..0)

Baseline (no plugin) 100% 100% of runs perfect
Run 1 100% 1 turns · $0.05 · 14:13:07 UTC
✓ pass gives-implementation

matched def \w+\(

✓ pass no-review-report

pattern absent as expected

Prompt

用 Python 写一个线程安全、带 TTL 的 LRU cache:支持 get / put,容量满时淘汰最久未使用的条目,过期条目在访问时惰性清除。直接把代码贴给我就行。

Graders — what "good" means for this case
gives-implementationregex
target"last_message"
pattern"def \\w+\\("
flags""
match"contains"
no-review-reportregex
target"last_message"
pattern"Health Score|^\\W*Symptom\\W*:|^\\W*Consequence\\W*:"
flags"m"
match"not_contains"
skill-not-firedtool_used
tool"Skill"
input_match"brooks-review"
min0
max0

07-neg-syntax-with-code

evals/07-neg-syntax-with-code · 0.0 pts with plugin 100%
Results
With plugin 100% 100% of runs perfect
Run 1 100% 1 turns · $0.08 · 14:13:17 UTC
✓ pass explains-satisfies-vs-as

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
The core difference is **checking vs. overriding**.

**`satisfies`** asks the compiler to verify that the expression's inferred type actually conforms to `Record<string, Route>`, while keeping the original inferred (literal) type for later use. When you delete `auth: true`, `{ path: "/settings" }` is checked against `Route`, which requires `auth: boolean` — that's a real structural mismatch, so it's a compile error. This is why `satisfies` catches it.

**`as Route`** is a type assertion, not a check — it tells the compiler "trust me, treat this as `Route`." TypeScript only allows an assertion when the two types are "comparable" in *either* direction (one assignable to the other), not that they're identical or that all required properties are present. Here:

- `{ path: "/settings" }` is **not** assignable to `Route` (missing `auth`) ❌
- but `Route` **is** assignable to `{ path: string }` (Route is a superset — extra properties are fine) ✅

Since one direction holds, the assertion passes the comparability check, even though the object is actually missing `auth`. The compiler doesn't verify the literal has every required field — it just checks the two types aren't *unrelated*.

**Practical consequence:** `legacyRoutes.settings.auth` will type-check as `boolean` but be `undefined` at runtime. That's the classic footgun with `as` — it's an escape hatch that can produce unsound types, whereas `satisfies` gives you compile-time safety *and* keeps type inference narrow (e.g. `routes.home.path` is inferred as the literal `"/"`, not widened to `string`, since `satisfies` doesn't change the expression's type the way an annotation or assertion does).

**Rule of thumb:** use `satisfies` when you want validation against a shape while preserving inference. Use `as` only when you have information the compiler can't derive (and are willing to bypass its checks) — it's not a substitute for validation.
✓ pass no-review-report

pattern absent as expected

✓ pass skill-not-fired plugin-fired indicator

Skill called 0x (expected 0..0)

Baseline (no plugin) 100% 100% of runs perfect
Run 1 100% 1 turns · $0.06 · 14:13:44 UTC
✓ pass explains-satisfies-vs-as

judge votes: PASS PASS PASS

Judge votes✓ ✓ ✓
Evidence (what the judge was shown; for an image, a description of what was sent)
`satisfies` checks that the expression conforms to a type, but keeps the *inferred* (narrower) type for the variable. `as` is a type assertion — it tells the compiler "trust me, treat this value as type `Route`," overriding whatever the compiler actually inferred, without re-checking the literal against `Route`'s shape.

Concretely:

- `routes = {...} satisfies Record<string, Route>` — TS infers the type of `routes` from the object literal itself (so `routes.settings` is `{ path: "/settings"; auth: boolean }`, and `routes.home.path` is even literal `"/"`), while *also* verifying each entry is assignable to `Route`. Since the check happens against the literal you wrote, removing `auth: true` makes that literal fail to satisfy `Route` (which requires `auth: boolean`) — error.

- `legacyRoutes: Record<string, Route> = {...}` with `{ path: "/settings" } as Route` — the `as Route` assertion forces the object literal `{ path: "/settings" }` to be treated as a `Route` *without* the compiler verifying it actually has all of `Route`'s properties. Assertions only get flagged if the two types are so unrelated that no overlap is possible; missing an optional-looking check like a required property isn't one of those cases, so it silently compiles even though `auth` is absent. At runtime, `legacyRoutes.settings.auth` would actually be `undefined` despite TS believing it's `boolean`.

So the real difference: `satisfies` validates against the type while preserving inference and catches missing/extra properties; `as` just relabels the type and bypasses that structural check. `satisfies` is almost always the safer choice when you want both accurate inference and type safety; `as` should be reserved for cases where you genuinely know more than the compiler (e.g., narrowing `unknown` from a JSON parse).
✓ pass no-review-report

pattern absent as expected

Prompt

Quick TypeScript question about this bit of our router config:

type Route = { path: string; auth: boolean };

const routes = {
  home: { path: "/", auth: false },
  settings: { path: "/settings", auth: true },
} satisfies Record<string, Route>;

const legacyRoutes: Record<string, Route> = {
  home: { path: "/", auth: false },
  settings: { path: "/settings" } as Route,
};

If I delete auth: true from routes.settings I get a compile error, but legacyRoutes.settings compiles fine without auth. What's the actual difference between satisfies and as here?

Graders — what "good" means for this case
explains-satisfies-vs-asllm

PASS only if the answer covers all three points:

  1. satisfies checks that the value conforms to the type — so a missing auth is reported — without changing the variable's inferred type (e.g. routes keeps its specific shape with keys home / settings, rather than becoming Record<string, Route>).
  2. as is a type assertion: it tells the compiler to treat the value as that type and does not perform a full conformance check — it only rejects conversions between unrelated / non-overlapping types — so { path: "/settings" } is accepted as Route even though auth is missing.
  3. It ties this back to the snippet: explains why deleting auth breaks routes but legacyRoutes.settings still compiles (mentioning that auth is then undefined at runtime is welcome but not required).

FAIL if any point is missing, or if the explanation is wrong — for example claiming as converts or validates the value at runtime, or that satisfies changes the variable's type to Record<string, Route>.

no-review-reportregex
target"last_message"
pattern"Health Score|^\\W*Symptom\\W*:|^\\W*Consequence\\W*:"
flags"m"
match"not_contains"
skill-not-firedtool_used
tool"Skill"
input_match"brooks-review"
min0
max0