Plugin eval report

brooks-lint v1.5.0

Plugin effect: ↑ +18.2 pts vs baseline — improved 5 · flat 2 · regressed 0 of 7 cases.

. Claude Code v2.1.270 2026-09-14 12:51 UTC 4m 59s $3.05 14 runs 4 in flight judge opus threshold 100%
Suite score · with plugin82%mean of per-case scores
Ablation Δ↑ +18.2score points vs baseline, 7 of 7 cases
Baseline score63.9%without the plugin
Cases73 of 7 ≥ 100% threshold
Perfect runs42.9%runs where every grader passed
How to read this report

01-pr29-provider-remap

evals/01-pr29-provider-remap ↑ +28.6 pts with plugin 57.1%
Results
With plugin 57.1% 0% of runs perfect
Run 1 57.1% 12 turns · $0.54 · 12:51:55 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 pulled in Anthropic's own API guidance to check the Anthropic-specific parts of this diff (I wasn't able to reach the `brooks-review` skill's file outside the sandboxed working directory, so this is a manual review rather than the templated one — happy to retry if you can point me at the file). Here's what I found:

## Blocking / should-fix before merge

**1. `anthropic/claude-sonnet-5` is an unverified model-ID format.**
Anthropic's own model IDs are bare strings (`claude-sonnet-5`, `claude-opus-5` — no provider prefix, no date suffix). The `anthropic/…` slash-prefix convention shown here looks like an OpenRouter-style routing convention, not something Anthropic itself uses (compare: Bedrock uses a dot, `anthropic.claude-opus-5`; Vertex/Foundry use no prefix at all). Nothing in the diff or its comments cites ExampleGW's own docs confirming this is the id it expects. If it's wrong, every ExampleGW-routed CI review call fails at request time — and this string is hardcoded independently in both `ci-review.mjs` and `run-evals-live.mjs`, so it can drift. Confirm the exact id against ExampleGW's model catalog before merging, and consider defining it once (see #2).

**2. Provider logic is duplicated three times.** The `provider` validation, the `DEFAULT_MODELS` map, the `EXAMPLEGW_BASE_URL` constant, and the "disable thinking" block are copy-pasted verbatim across `action.yml`'s bash, `ci-review.mjs`, and `run-evals-live.mjs`. A future change to the gateway URL or the pinned model id means updating three places and risking them going out of sync. Worth factoring into one small shared module the two `.mjs` scripts import.

**3. Disabling thinking outright is riskier than the docs recommend, and the risk lands directly on this pipeline's output parsing.** Per current Anthropic guidance, forcing `thinking: {type: "disabled"}` on newer models can cause the model to write content (including stray `<thinking>`-style tags, or even a tool call) into the *visible text* instead of behaving as expected — silently, no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into JSON/SARIF parsing for the CI gate, so a leaked tag would corrupt that output without anyone noticing until a build behaves strangely. The documented safer alternative is `output_config: { effort: "low" }` (works on Sonnet 5), which gets the same token-budget economy without disabling thinking wholesale. Given the whole point of this change is trustworthy CI output, I'd swap to effort tuning, or at minimum add the "don't emit internal tags" instruction the docs suggest as a mitigation, and test it against the real gateway model before relying on it.

## Worth a look, not blocking

**4.** The thinking-disable block is gated on `provider === "examplegw"` for *any* model, but the code comment justifies it as a fix for "reasoning models." If a non-reasoning model ever gets routed through ExampleGW, it'll have thinking force-disabled for no reason. Consider gating on the resolved model name instead of the whole provider.

**5.** `EXAMPLEGW_BASE_URL` is a hardcoded literal in two files rather than an action input/env override. Given `action.yml` already exposes `examplegw-api-key` and `provider` as configurable inputs, a fixed URL is the odd one out if ExampleGW ever needs a per-tenant or self-hosted endpoint.

**6.** If a caller overrides `--model` explicitly while using `provider: examplegw`, there's no translation — they must already know to type the `anthropic/…` prefix themselves. Worth a line in `action.yml`'s `model` input description saying so.

**7.** I only have the diff hunks, not the full file — worth double-checking what happens after the `catch` block in `ci-review.mjs` on a gateway auth/model-id failure. This change adds two new failure modes (bad provider value, bad model id) that didn't exist before; confirm they still fail the CI check loudly rather than being swallowed.

## Looks right

- `claude-sonnet-4-6` and `claude-opus-4-6` (the pre-existing, unchanged model ids) are current, valid Anthropic model ids.
- Constructing the SDK client with a custom `baseURL` for a generic Anthropic-compatible third-party endpoint is the correct pattern — Anthropic's own guidance only steers you away from `baseURL` overrides for the three specifically-supported partner platforms (Bedrock/Vertex/Foundry), which have dedicated client classes. ExampleGW isn't one of those, so this is fine.
- Moving `anthropic-api-key` from `required: true` to a runtime-validated default is the right call, since GitHub Actions inputs can't express "required unless X."

**Bottom line:** the shape of the change is reasonable, but I'd confirm the `anthropic/claude-sonnet-5` id against ExampleGW's actual docs and reconsider the blanket `thinking: disabled` before merging — both are the kind of thing that fails silently in exactly the pipeline that's supposed to catch silent failures.
✓ 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)
I pulled in Anthropic's own API guidance to check the Anthropic-specific parts of this diff (I wasn't able to reach the `brooks-review` skill's file outside the sandboxed working directory, so this is a manual review rather than the templated one — happy to retry if you can point me at the file). Here's what I found:

## Blocking / should-fix before merge

**1. `anthropic/claude-sonnet-5` is an unverified model-ID format.**
Anthropic's own model IDs are bare strings (`claude-sonnet-5`, `claude-opus-5` — no provider prefix, no date suffix). The `anthropic/…` slash-prefix convention shown here looks like an OpenRouter-style routing convention, not something Anthropic itself uses (compare: Bedrock uses a dot, `anthropic.claude-opus-5`; Vertex/Foundry use no prefix at all). Nothing in the diff or its comments cites ExampleGW's own docs confirming this is the id it expects. If it's wrong, every ExampleGW-routed CI review call fails at request time — and this string is hardcoded independently in both `ci-review.mjs` and `run-evals-live.mjs`, so it can drift. Confirm the exact id against ExampleGW's model catalog before merging, and consider defining it once (see #2).

**2. Provider logic is duplicated three times.** The `provider` validation, the `DEFAULT_MODELS` map, the `EXAMPLEGW_BASE_URL` constant, and the "disable thinking" block are copy-pasted verbatim across `action.yml`'s bash, `ci-review.mjs`, and `run-evals-live.mjs`. A future change to the gateway URL or the pinned model id means updating three places and risking them going out of sync. Worth factoring into one small shared module the two `.mjs` scripts import.

**3. Disabling thinking outright is riskier than the docs recommend, and the risk lands directly on this pipeline's output parsing.** Per current Anthropic guidance, forcing `thinking: {type: "disabled"}` on newer models can cause the model to write content (including stray `<thinking>`-style tags, or even a tool call) into the *visible text* instead of behaving as expected — silently, no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into JSON/SARIF parsing for the CI gate, so a leaked tag would corrupt that output without anyone noticing until a build behaves strangely. The documented safer alternative is `output_config: { effort: "low" }` (works on Sonnet 5), which gets the same token-budget economy without disabling thinking wholesale. Given the whole point of this change is trustworthy CI output, I'd swap to effort tuning, or at minimum add the "don't emit internal tags" instruction the docs suggest as a mitigation, and test it against the real gateway model before relying on it.

## Worth a look, not blocking

**4.** The thinking-disable block is gated on `provider === "examplegw"` for *any* model, but the code comment justifies it as a fix for "reasoning models." If a non-reasoning model ever gets routed through ExampleGW, it'll have thinking force-disabled for no reason. Consider gating on the resolved model name instead of the whole provider.

**5.** `EXAMPLEGW_BASE_URL` is a hardcoded literal in two files rather than an action input/env override. Given `action.yml` already exposes `examplegw-api-key` and `provider` as configurable inputs, a fixed URL is the odd one out if ExampleGW ever needs a per-tenant or self-hosted endpoint.

**6.** If a caller overrides `--model` explicitly while using `provider: examplegw`, there's no translation — they must already know to type the `anthropic/…` prefix themselves. Worth a line in `action.yml`'s `model` input description saying so.

**7.** I only have the diff hunks, not the full file — worth double-checking what happens after the `catch` block in `ci-review.mjs` on a gateway auth/model-id failure. This change adds two new failure modes (bad provider value, bad model id) that didn't exist before; confirm they still fail the CI check loudly rather than being swallowed.

## Looks right

- `claude-sonnet-4-6` and `claude-opus-4-6` (the pre-existing, unchanged model ids) are current, valid Anthropic model ids.
- Constructing the SDK client with a custom `baseURL` for a generic Anthropic-compatible third-party endpoint is the correct pattern — Anthropic's own guidance only steers you away from `baseURL` overrides for the three specifically-supported partner platforms (Bedrock/Vertex/Foundry), which have dedicated client classes. ExampleGW isn't one of those, so this is fine.
- Moving `anthropic-api-key` from `required: true` to a runtime-validated default is the right call, since GitHub Actions inputs can't express "required unless X."

**Bottom line:** the shape of the change is reasonable, but I'd confirm the `anthropic/claude-sonnet-5` id against ExampleGW's actual docs and reconsider the blanket `thinking: disabled` before merging — both are the kind of thing that fails silently in exactly the pipeline that's supposed to catch silent failures.
✗ 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 pulled in Anthropic's own API guidance to check the Anthropic-specific parts of this diff (I wasn't able to reach the `brooks-review` skill's file outside the sandboxed working directory, so this is a manual review rather than the templated one — happy to retry if you can point me at the file). Here's what I found:

## Blocking / should-fix before merge

**1. `anthropic/claude-sonnet-5` is an unverified model-ID format.**
Anthropic's own model IDs are bare strings (`claude-sonnet-5`, `claude-opus-5` — no provider prefix, no date suffix). The `anthropic/…` slash-prefix convention shown here looks like an OpenRouter-style routing convention, not something Anthropic itself uses (compare: Bedrock uses a dot, `anthropic.claude-opus-5`; Vertex/Foundry use no prefix at all). Nothing in the diff or its comments cites ExampleGW's own docs confirming this is the id it expects. If it's wrong, every ExampleGW-routed CI review call fails at request time — and this string is hardcoded independently in both `ci-review.mjs` and `run-evals-live.mjs`, so it can drift. Confirm the exact id against ExampleGW's model catalog before merging, and consider defining it once (see #2).

**2. Provider logic is duplicated three times.** The `provider` validation, the `DEFAULT_MODELS` map, the `EXAMPLEGW_BASE_URL` constant, and the "disable thinking" block are copy-pasted verbatim across `action.yml`'s bash, `ci-review.mjs`, and `run-evals-live.mjs`. A future change to the gateway URL or the pinned model id means updating three places and risking them going out of sync. Worth factoring into one small shared module the two `.mjs` scripts import.

**3. Disabling thinking outright is riskier than the docs recommend, and the risk lands directly on this pipeline's output parsing.** Per current Anthropic guidance, forcing `thinking: {type: "disabled"}` on newer models can cause the model to write content (including stray `<thinking>`-style tags, or even a tool call) into the *visible text* instead of behaving as expected — silently, no error raised. `ci-review.mjs` takes `message.content[0]?.text` and feeds it straight into JSON/SARIF parsing for the CI gate, so a leaked tag would corrupt that output without anyone noticing until a build behaves strangely. The documented safer alternative is `output_config: { effort: "low" }` (works on Sonnet 5), which gets the same token-budget economy without disabling thinking wholesale. Given the whole point of this change is trustworthy CI output, I'd swap to effort tuning, or at minimum add the "don't emit internal tags" instruction the docs suggest as a mitigation, and test it against the real gateway model before relying on it.

## Worth a look, not blocking

**4.** The thinking-disable block is gated on `provider === "examplegw"` for *any* model, but the code comment justifies it as a fix for "reasoning models." If a non-reasoning model ever gets routed through ExampleGW, it'll have thinking force-disabled for no reason. Consider gating on the resolved model name instead of the whole provider.

**5.** `EXAMPLEGW_BASE_URL` is a hardcoded literal in two files rather than an action input/env override. Given `action.yml` already exposes `examplegw-api-key` and `provider` as configurable inputs, a fixed URL is the odd one out if ExampleGW ever needs a per-tenant or self-hosted endpoint.

**6.** If a caller overrides `--model` explicitly while using `provider: examplegw`, there's no translation — they must already know to type the `anthropic/…` prefix themselves. Worth a line in `action.yml`'s `model` input description saying so.

**7.** I only have the diff hunks, not the full file — worth double-checking what happens after the `catch` block in `ci-review.mjs` on a gateway auth/model-id failure. This change adds two new failure modes (bad provider value, bad model id) that didn't exist before; confirm they still fail the CI check loudly rather than being swallowed.

## Looks right

- `claude-sonnet-4-6` and `claude-opus-4-6` (the pre-existing, unchanged model ids) are current, valid Anthropic model ids.
- Constructing the SDK client with a custom `baseURL` for a generic Anthropic-compatible third-party endpoint is the correct pattern — Anthropic's own guidance only steers you away from `baseURL` overrides for the three specifically-supported partner platforms (Bedrock/Vertex/Foundry), which have dedicated client classes. ExampleGW isn't one of those, so this is fine.
- Moving `anthropic-api-key` from `required: true` to a runtime-validated default is the right call, since GitHub Actions inputs can't express "required unless X."

**Bottom line:** the shape of the change is reasonable, but I'd confirm the `anthropic/claude-sonnet-5` id against ExampleGW's actual docs and reconsider the blanket `thinking: disabled` before merging — both are the kind of thing that fails silently in exactly the pipeline that's supposed to catch silent failures.
✓ pass skill-fired plugin-fired indicator

Skill called 1x (expected 1..∞)

Baseline (no plugin) 28.6% 0% of runs perfect
Run 1 28.6% 6 turns · $0.45 · 12:51:55 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)
Reviewed the diff against current Anthropic API/SDK behavior. One finding is a real bug worth fixing before merge; the rest are smaller things to double check.

## Bug: `run-evals-live.mjs` never authenticates to ExampleGW

In `ci-review.mjs`, the `examplegw` credential flow works because **`action.yml`** does the heavy lifting first:

```bash
export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"
```

before invoking the script — so by the time `new Anthropic({ baseURL: ... })` runs, `ANTHROPIC_API_KEY` is already the gateway key.

`run-evals-live.mjs` has no such wrapper. It's invoked directly (per its own updated header comment: `EXAMPLEGW_API_KEY=... node scripts/run-evals-live.mjs --provider examplegw`), but the script:

- never reads `process.env.EXAMPLEGW_API_KEY`
- never passes `apiKey` to the `Anthropic` constructor
- only sets `baseURL` when `provider === "examplegw"`

The Anthropic SDK's credential resolution falls through `ANTHROPIC_API_KEY` → `ANTHROPIC_AUTH_TOKEN` → active OAuth profile → WIF → default profile-on-disk if the key isn't explicitly passed. So on a machine with a local `ant auth login` profile or `ANTHROPIC_API_KEY` already exported for other work, this script will silently authenticate with **real Anthropic credentials against ExampleGW's `baseURL`** — sending Anthropic secrets to a third-party host — rather than failing loudly or using the gateway key. That's a credential-leakage risk, not just a broken feature.

Fix: in both scripts, when `provider === "examplegw"`, explicitly construct the client with the gateway key rather than relying on ambient env state:

```js
new Anthropic(
  provider === "examplegw"
    ? { baseURL: EXAMPLEGW_BASE_URL, apiKey: process.env.EXAMPLEGW_API_KEY }
    : undefined
)
```

This also removes `ci-review.mjs`'s implicit dependency on the bash wrapper — right now that script silently does the wrong thing if anyone runs it directly (e.g. local testing) without replicating the `action.yml` export line.

## Verified as correct

- **`baseURL` constructor option** — correct key for the TS/JS SDK (confirmed against the SDK reference; Python's equivalent is `base_url`).
- **`thinking: { type: "disabled" }`** — this is a real, valid shape, and it's accepted for Sonnet 5 (which `anthropic/claude-sonnet-5` presumably resolves to on the gateway). No hallucinated parameter here.

## Worth a second look, not blocking

- **`"anthropic/claude-sonnet-5"` model ID format** — Anthropic's own model IDs are never provider-prefixed like this; that's an OpenRouter/aggregator-style convention. It's plausible this is exactly how ExampleGW namespaces models internally, but it's worth explicitly confirming against ExampleGW's model catalog before merge — a wrong/stale ID here only surfaces as a runtime error, not a type error.
- **Disabling thinking outright vs. lowering effort** — general guidance for Sonnet-5/Opus-5-tier models is to prefer `output_config.effort: "low"|"medium"` over fully disabling thinking, partly because disabled thinking can occasionally leak stray `<thinking>`-tag text into the visible response. These scripts don't declare `tools`, so the "tool call written as text" failure mode doesn't apply, but if the leaked-tags issue shows up it would land inside the JSON/SARIF-bound output these scripts parse. Might be worth a quick eval run against `run-evals-live.mjs --provider examplegw` to confirm output stays clean before relying on it in CI.
- **Default model for `provider=anthropic`** stays `claude-sonnet-4-6` (previous-gen) — unrelated to this PR's purpose, so not a blocker, just flagging in case you want to align defaults while you're in this code.
✗ 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)
Reviewed the diff against current Anthropic API/SDK behavior. One finding is a real bug worth fixing before merge; the rest are smaller things to double check.

## Bug: `run-evals-live.mjs` never authenticates to ExampleGW

In `ci-review.mjs`, the `examplegw` credential flow works because **`action.yml`** does the heavy lifting first:

```bash
export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"
```

before invoking the script — so by the time `new Anthropic({ baseURL: ... })` runs, `ANTHROPIC_API_KEY` is already the gateway key.

`run-evals-live.mjs` has no such wrapper. It's invoked directly (per its own updated header comment: `EXAMPLEGW_API_KEY=... node scripts/run-evals-live.mjs --provider examplegw`), but the script:

- never reads `process.env.EXAMPLEGW_API_KEY`
- never passes `apiKey` to the `Anthropic` constructor
- only sets `baseURL` when `provider === "examplegw"`

The Anthropic SDK's credential resolution falls through `ANTHROPIC_API_KEY` → `ANTHROPIC_AUTH_TOKEN` → active OAuth profile → WIF → default profile-on-disk if the key isn't explicitly passed. So on a machine with a local `ant auth login` profile or `ANTHROPIC_API_KEY` already exported for other work, this script will silently authenticate with **real Anthropic credentials against ExampleGW's `baseURL`** — sending Anthropic secrets to a third-party host — rather than failing loudly or using the gateway key. That's a credential-leakage risk, not just a broken feature.

Fix: in both scripts, when `provider === "examplegw"`, explicitly construct the client with the gateway key rather than relying on ambient env state:

```js
new Anthropic(
  provider === "examplegw"
    ? { baseURL: EXAMPLEGW_BASE_URL, apiKey: process.env.EXAMPLEGW_API_KEY }
    : undefined
)
```

This also removes `ci-review.mjs`'s implicit dependency on the bash wrapper — right now that script silently does the wrong thing if anyone runs it directly (e.g. local testing) without replicating the `action.yml` export line.

## Verified as correct

- **`baseURL` constructor option** — correct key for the TS/JS SDK (confirmed against the SDK reference; Python's equivalent is `base_url`).
- **`thinking: { type: "disabled" }`** — this is a real, valid shape, and it's accepted for Sonnet 5 (which `anthropic/claude-sonnet-5` presumably resolves to on the gateway). No hallucinated parameter here.

## Worth a second look, not blocking

- **`"anthropic/claude-sonnet-5"` model ID format** — Anthropic's own model IDs are never provider-prefixed like this; that's an OpenRouter/aggregator-style convention. It's plausible this is exactly how ExampleGW namespaces models internally, but it's worth explicitly confirming against ExampleGW's model catalog before merge — a wrong/stale ID here only surfaces as a runtime error, not a type error.
- **Disabling thinking outright vs. lowering effort** — general guidance for Sonnet-5/Opus-5-tier models is to prefer `output_config.effort: "low"|"medium"` over fully disabling thinking, partly because disabled thinking can occasionally leak stray `<thinking>`-tag text into the visible response. These scripts don't declare `tools`, so the "tool call written as text" failure mode doesn't apply, but if the leaked-tags issue shows up it would land inside the JSON/SARIF-bound output these scripts parse. Might be worth a quick eval run against `run-evals-live.mjs --provider examplegw` to confirm output stays clean before relying on it in CI.
- **Default model for `provider=anthropic`** stays `claude-sonnet-4-6` (previous-gen) — unrelated to this PR's purpose, so not a blocker, just flagging in case you want to align defaults while you're in this code.
✗ 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 the diff against current Anthropic API/SDK behavior. One finding is a real bug worth fixing before merge; the rest are smaller things to double check.

## Bug: `run-evals-live.mjs` never authenticates to ExampleGW

In `ci-review.mjs`, the `examplegw` credential flow works because **`action.yml`** does the heavy lifting first:

```bash
export ANTHROPIC_API_KEY="$EXAMPLEGW_API_KEY"
```

before invoking the script — so by the time `new Anthropic({ baseURL: ... })` runs, `ANTHROPIC_API_KEY` is already the gateway key.

`run-evals-live.mjs` has no such wrapper. It's invoked directly (per its own updated header comment: `EXAMPLEGW_API_KEY=... node scripts/run-evals-live.mjs --provider examplegw`), but the script:

- never reads `process.env.EXAMPLEGW_API_KEY`
- never passes `apiKey` to the `Anthropic` constructor
- only sets `baseURL` when `provider === "examplegw"`

The Anthropic SDK's credential resolution falls through `ANTHROPIC_API_KEY` → `ANTHROPIC_AUTH_TOKEN` → active OAuth profile → WIF → default profile-on-disk if the key isn't explicitly passed. So on a machine with a local `ant auth login` profile or `ANTHROPIC_API_KEY` already exported for other work, this script will silently authenticate with **real Anthropic credentials against ExampleGW's `baseURL`** — sending Anthropic secrets to a third-party host — rather than failing loudly or using the gateway key. That's a credential-leakage risk, not just a broken feature.

Fix: in both scripts, when `provider === "examplegw"`, explicitly construct the client with the gateway key rather than relying on ambient env state:

```js
new Anthropic(
  provider === "examplegw"
    ? { baseURL: EXAMPLEGW_BASE_URL, apiKey: process.env.EXAMPLEGW_API_KEY }
    : undefined
)
```

This also removes `ci-review.mjs`'s implicit dependency on the bash wrapper — right now that script silently does the wrong thing if anyone runs it directly (e.g. local testing) without replicating the `action.yml` export line.

## Verified as correct

- **`baseURL` constructor option** — correct key for the TS/JS SDK (confirmed against the SDK reference; Python's equivalent is `base_url`).
- **`thinking: { type: "disabled" }`** — this is a real, valid shape, and it's accepted for Sonnet 5 (which `anthropic/claude-sonnet-5` presumably resolves to on the gateway). No hallucinated parameter here.

## Worth a second look, not blocking

- **`"anthropic/claude-sonnet-5"` model ID format** — Anthropic's own model IDs are never provider-prefixed like this; that's an OpenRouter/aggregator-style convention. It's plausible this is exactly how ExampleGW namespaces models internally, but it's worth explicitly confirming against ExampleGW's model catalog before merge — a wrong/stale ID here only surfaces as a runtime error, not a type error.
- **Disabling thinking outright vs. lowering effort** — general guidance for Sonnet-5/Opus-5-tier models is to prefer `output_config.effort: "low"|"medium"` over fully disabling thinking, partly because disabled thinking can occasionally leak stray `<thinking>`-tag text into the visible response. These scripts don't declare `tools`, so the "tool call written as text" failure mode doesn't apply, but if the leaked-tags issue shows up it would land inside the JSON/SARIF-bound output these scripts parse. Might be worth a quick eval run against `run-evals-live.mjs --provider examplegw` to confirm output stays clean before relying on it in CI.
- **Default model for `provider=anthropic`** stays `claude-sonnet-4-6` (previous-gen) — unrelated to this PR's purpose, so not a blocker, just flagging in case you want to align defaults while you're in this code.
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.

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 or logged; 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.

FAIL if the answer states as fact anything that contradicts items 1–6 — 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 leaked to logs; new Anthropic(undefined) throws; an unknown provider silently falls back to anthropic inside the scripts; DEFAULT_MODELS overrides an explicit --model.

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").

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 ↑ +14.3 pts with plugin 100%
Results
With plugin 100% 100% of runs perfect
Run 1 100% 13 turns · $0.37 · 12:51:55 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)
我读取了 brooks-review 的完整评审框架(Iron Law + 六大腐化风险 + PR review 步骤),并对这份 diff 做了逐项扫描。核对了脚本里的实际逻辑和文档里的描述是否一致,发现了一处真实的文档-代码不一致问题。以下是完整报告:

---

# Brooks-Lint Review

**Mode:** PR Review
**Scope:** `scripts/install.sh`, `docs/getting-started.md`, `docs/bob-setup.md`(新文件)— 共 3 个文件,未包含省略的 README 多语言同步改动
**Health Score:** 94/100

这个 PR 结构上很干净、遵循了现有平台接入的既定模式,但文档对 `$BOB_HOME` 环境变量的描述与脚本实际行为不符,需要修正后再合并。

---

## Findings

### 🟡 Warning

**Knowledge Duplication — `docs/bob-setup.md` 声称支持 `$BOB_HOME`,但 `install.sh` 并未实现**
Symptom: `docs/bob-setup.md` 中写道 `./scripts/install.sh bob # global: ~/.bob/skills (or $BOB_HOME/skills)`,表格里也明确写 `<bob_home>/skills (default ~/.bob/skills)` 是"the global install writes"的位置。但 `scripts/install.sh` 里新增的 `global_dir()` 分支是硬编码的:
```bash
bob)         printf '%s' "$HOME/.bob/skills" ;;
```
完全没有读取 `$BOB_HOME` 环境变量做 fallback(对比同一函数里其他平台,也都没有类似的环境变量覆盖机制,说明这是贡献者凭空加上的文档承诺,不是照抄已有约定)。
Source: Fowler — *Refactoring*, Duplicate Code(同一决策——安装目录的选择——在文档和代码中各自表达了一遍,且已经产生分歧)
Consequence: 任何设置了 `$BOB_HOME`(比如把 Bob 的配置目录放在非默认位置)的用户,会以为全局安装的技能会装到 `$BOB_HOME/skills`,但实际上会被静默装到 `~/.bob/skills`。脚本不会报错,只是装错地方——用户后续会看到"Bob 里搜不到 brooks-* 技能"这种难以定位根因的问题。
Remedy: 二选一——(a) 在 `global_dir()` 里把 bob 分支改成 `printf '%s' "${BOB_HOME:-$HOME/.bob}/skills"`,让代码匹配文档承诺;或 (b) 如果 IBM Bob 实际上没有这个环境变量约定,就把 `bob-setup.md` 和 getting-started 注释里所有 `$BOB_HOME` 的提法删掉,只保留 `~/.bob/skills`。在没有验证真实 Bob 行为(PR 本身也标注"community end-to-end verification welcome”)的情况下,建议先按 (b) 处理更安全。

### 🟢 Suggestion

**Knowledge Duplication — 平台列表在 `install.sh` 和 `getting-started.md` 中顺序不一致**
Symptom: `install.sh` 里 `bob` 是追加在列表最末尾(`... claude agents bob`,两处:顶部注释和 `PLATFORMS` 变量),而 `docs/getting-started.md` 里 `bob` 被插入到 `dsh` 和 `gemini` 之间(`... dsh · bob ·\ngemini · codex · claude · agents`)。
Source: Hunt & Thomas — *The Pragmatic Programmer*, DRY(同一份枚举顺序被两处独立维护,已经产生漂移)
Consequence: 功能上无影响(case 语句不依赖顺序),但下次有人对照文档核对脚本、或者再加新平台时,容易被这个不一致误导,或者继续在错误的位置插入。
Remedy: 把其中一处的顺序改成和另一处一致——建议把 `bob` 在 doc 中也挪到末尾(`agents` 之后),和 `install.sh` 保持字面一致。

---

## Summary

唯一需要在合并前解决的是 `$BOB_HOME` 的文档/代码不一致——这是一个会让用户静默装错目录的真实问题,不是吹毛求疵。顺序不一致是顺手可修的小事。其余部分(`global_dir`/`project_dir` 两处 case 分支都正确补齐、平台计数从 9 改到 10、表格列的顺序和其他平台一致)贡献者做得很仔细,跟已有模式高度吻合,不需要额外重构。
✓ pass health-score-line ×0.5

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

✓ 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)
我读取了 brooks-review 的完整评审框架(Iron Law + 六大腐化风险 + PR review 步骤),并对这份 diff 做了逐项扫描。核对了脚本里的实际逻辑和文档里的描述是否一致,发现了一处真实的文档-代码不一致问题。以下是完整报告:

---

# Brooks-Lint Review

**Mode:** PR Review
**Scope:** `scripts/install.sh`, `docs/getting-started.md`, `docs/bob-setup.md`(新文件)— 共 3 个文件,未包含省略的 README 多语言同步改动
**Health Score:** 94/100

这个 PR 结构上很干净、遵循了现有平台接入的既定模式,但文档对 `$BOB_HOME` 环境变量的描述与脚本实际行为不符,需要修正后再合并。

---

## Findings

### 🟡 Warning

**Knowledge Duplication — `docs/bob-setup.md` 声称支持 `$BOB_HOME`,但 `install.sh` 并未实现**
Symptom: `docs/bob-setup.md` 中写道 `./scripts/install.sh bob # global: ~/.bob/skills (or $BOB_HOME/skills)`,表格里也明确写 `<bob_home>/skills (default ~/.bob/skills)` 是"the global install writes"的位置。但 `scripts/install.sh` 里新增的 `global_dir()` 分支是硬编码的:
```bash
bob)         printf '%s' "$HOME/.bob/skills" ;;
```
完全没有读取 `$BOB_HOME` 环境变量做 fallback(对比同一函数里其他平台,也都没有类似的环境变量覆盖机制,说明这是贡献者凭空加上的文档承诺,不是照抄已有约定)。
Source: Fowler — *Refactoring*, Duplicate Code(同一决策——安装目录的选择——在文档和代码中各自表达了一遍,且已经产生分歧)
Consequence: 任何设置了 `$BOB_HOME`(比如把 Bob 的配置目录放在非默认位置)的用户,会以为全局安装的技能会装到 `$BOB_HOME/skills`,但实际上会被静默装到 `~/.bob/skills`。脚本不会报错,只是装错地方——用户后续会看到"Bob 里搜不到 brooks-* 技能"这种难以定位根因的问题。
Remedy: 二选一——(a) 在 `global_dir()` 里把 bob 分支改成 `printf '%s' "${BOB_HOME:-$HOME/.bob}/skills"`,让代码匹配文档承诺;或 (b) 如果 IBM Bob 实际上没有这个环境变量约定,就把 `bob-setup.md` 和 getting-started 注释里所有 `$BOB_HOME` 的提法删掉,只保留 `~/.bob/skills`。在没有验证真实 Bob 行为(PR 本身也标注"community end-to-end verification welcome”)的情况下,建议先按 (b) 处理更安全。

### 🟢 Suggestion

**Knowledge Duplication — 平台列表在 `install.sh` 和 `getting-started.md` 中顺序不一致**
Symptom: `install.sh` 里 `bob` 是追加在列表最末尾(`... claude agents bob`,两处:顶部注释和 `PLATFORMS` 变量),而 `docs/getting-started.md` 里 `bob` 被插入到 `dsh` 和 `gemini` 之间(`... dsh · bob ·\ngemini · codex · claude · agents`)。
Source: Hunt & Thomas — *The Pragmatic Programmer*, DRY(同一份枚举顺序被两处独立维护,已经产生漂移)
Consequence: 功能上无影响(case 语句不依赖顺序),但下次有人对照文档核对脚本、或者再加新平台时,容易被这个不一致误导,或者继续在错误的位置插入。
Remedy: 把其中一处的顺序改成和另一处一致——建议把 `bob` 在 doc 中也挪到末尾(`agents` 之后),和 `install.sh` 保持字面一致。

---

## Summary

唯一需要在合并前解决的是 `$BOB_HOME` 的文档/代码不一致——这是一个会让用户静默装错目录的真实问题,不是吹毛求疵。顺序不一致是顺手可修的小事。其余部分(`global_dir`/`project_dir` 两处 case 分支都正确补齐、平台计数从 9 改到 10、表格列的顺序和其他平台一致)贡献者做得很仔细,跟已有模式高度吻合,不需要额外重构。
✓ pass report-in-chinese

matched [一-鿿]{8}

✓ pass skill-fired plugin-fired indicator

Skill called 1x (expected 1..∞)

Baseline (no plugin) 85.7% 0% of runs perfect
Run 1 85.7% 4 turns · $0.15 · 12:51:55 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,机制上的改动(PLATFORMS 列表、`global_dir`/`project_dir` 分支、getting-started.md 的表格和计数)都跟着现有模式改的,格式一致,没有语法问题。但有两个问题建议在合并前处理:

**1. "IBM Bob" 这个平台本身存疑**
我(以及我目前没有联网核实的能力)并不知道 IBM 有一个叫 "Bob" 的 AI 开发者 agent 产品,`bob.ibm.com` 这个域名、"everything is a skill" 架构、原生读取 `AGENTS.md` 等描述都无法验证。考虑到:
- `install.sh` 是通过 `curl | bash` 直接执行的脚本,对新增平台的真实性要求应该更高;
- 文档里写的"🧪 未端到端验证,欢迎社区验证"这种免责声明,恰恰说明贡献者自己也没有实际用过这个工具去验证。

在合并前,强烈建议维护者自行确认 IBM Bob 是否真实存在、行为是否如文档所述,而不是仅凭 PR 描述采信。如果这是一个不存在或被虚构出来的平台,合并进去会让用户以为有真实集成,属于误导性文档。

**2. 文档和脚本对不上(即使 Bob 是真的,这也是个 bug)**
`bob-setup.md` 里写:
> `<bob_home>`(默认 `~/.bob/skills`,可通过 `$BOB_HOME/skills` 覆盖)
> Bob also loads `$BOB_HOME/AGENTS.md`

但 `install.sh` 的 `global_dir()` 里 bob 分支是硬编码的:
```bash
bob) printf '%s' "$HOME/.bob/skills" ;;
```
完全没有读取 `$BOB_HOME` 环境变量。要么脚本要加上对 `BOB_HOME` 的支持,要么文档里关于 `$BOB_HOME` 覆盖的描述要删掉,两者现在互相矛盾。

**结论**:先别合。第 1 点是内容真实性问题,第 2 点是明确的代码/文档不一致,都应该在合并前让贡献者澄清或修正。其余部分(PLATFORMS 列表、表格、verified 计数)没有问题。
✗ 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,机制上的改动(PLATFORMS 列表、`global_dir`/`project_dir` 分支、getting-started.md 的表格和计数)都跟着现有模式改的,格式一致,没有语法问题。但有两个问题建议在合并前处理:

**1. "IBM Bob" 这个平台本身存疑**
我(以及我目前没有联网核实的能力)并不知道 IBM 有一个叫 "Bob" 的 AI 开发者 agent 产品,`bob.ibm.com` 这个域名、"everything is a skill" 架构、原生读取 `AGENTS.md` 等描述都无法验证。考虑到:
- `install.sh` 是通过 `curl | bash` 直接执行的脚本,对新增平台的真实性要求应该更高;
- 文档里写的"🧪 未端到端验证,欢迎社区验证"这种免责声明,恰恰说明贡献者自己也没有实际用过这个工具去验证。

在合并前,强烈建议维护者自行确认 IBM Bob 是否真实存在、行为是否如文档所述,而不是仅凭 PR 描述采信。如果这是一个不存在或被虚构出来的平台,合并进去会让用户以为有真实集成,属于误导性文档。

**2. 文档和脚本对不上(即使 Bob 是真的,这也是个 bug)**
`bob-setup.md` 里写:
> `<bob_home>`(默认 `~/.bob/skills`,可通过 `$BOB_HOME/skills` 覆盖)
> Bob also loads `$BOB_HOME/AGENTS.md`

但 `install.sh` 的 `global_dir()` 里 bob 分支是硬编码的:
```bash
bob) printf '%s' "$HOME/.bob/skills" ;;
```
完全没有读取 `$BOB_HOME` 环境变量。要么脚本要加上对 `BOB_HOME` 的支持,要么文档里关于 `$BOB_HOME` 覆盖的描述要删掉,两者现在互相矛盾。

**结论**:先别合。第 1 点是内容真实性问题,第 2 点是明确的代码/文档不一致,都应该在合并前让贡献者澄清或修正。其余部分(PLATFORMS 列表、表格、verified 计数)没有问题。
✓ 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 · 0.0 pts with plugin 85.7%
Results
With plugin 85.7% 0% of runs perfect
Run 1 85.7% 1 turns · $0.12 · 12:52:55 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 — two real issues, both stemming from `cart_banner.py` reimplementing pricing logic instead of using `pricing.quote()`:

**1. Free-shipping boundary is inconsistent (off-by-one on the threshold).**
- `pricing.py`: `shipping = 0.00 if subtotal >= FREE_SHIPPING_MIN else FLAT_SHIPPING` → **inclusive** of $100.00.
- `cart_banner.py`: `if total > 100:` → **exclusive** of $100.00.

At exactly a $100.00 cart, the customer is actually charged $0 shipping, but the banner still says "Add $0.00 more to get free shipping" instead of the celebratory free-shipping message. Minor cosmetic case, but it's user-facing and wrong.

**2. Duplicated money math using `float` instead of `Decimal`, which can silently disagree with the real quote.**
`cart_total()` recomputes the subtotal with `float(i.unit_price) * i.quantity` and sums with plain floats, then rounds with Python's `round()` (banker's rounding) — while `pricing.py` computes the same subtotal with `Decimal` and `ROUND_HALF_UP`. For most prices these agree, but float binary representation can produce a value like `99.999999999999` or `100.00000000001` for a cart that should be exactly `100.00`, and the two roundings modes can disagree on `.xx5` cases. That means the banner can say "free shipping!" while checkout actually charges shipping, or vice versa — exactly the kind of bug that's hard to reproduce because it only shows up for certain penny totals.

The fix is straightforward: have `cart_banner.py` call `pricing.quote(items)` and derive both the item count and the free-shipping message from the resulting `Quote` (compare `quote.subtotal >= FREE_SHIPPING_MIN` and `quote.shipping`), rather than re-deriving subtotal/threshold logic with different types and different rounding rules. That also removes the hardcoded `100` in `cart_banner.py`, which would otherwise drift if `FREE_SHIPPING_MIN` ever changes in `pricing.py`.

Want me to make that change?
✓ 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 — two real issues, both stemming from `cart_banner.py` reimplementing pricing logic instead of using `pricing.quote()`:

**1. Free-shipping boundary is inconsistent (off-by-one on the threshold).**
- `pricing.py`: `shipping = 0.00 if subtotal >= FREE_SHIPPING_MIN else FLAT_SHIPPING` → **inclusive** of $100.00.
- `cart_banner.py`: `if total > 100:` → **exclusive** of $100.00.

At exactly a $100.00 cart, the customer is actually charged $0 shipping, but the banner still says "Add $0.00 more to get free shipping" instead of the celebratory free-shipping message. Minor cosmetic case, but it's user-facing and wrong.

**2. Duplicated money math using `float` instead of `Decimal`, which can silently disagree with the real quote.**
`cart_total()` recomputes the subtotal with `float(i.unit_price) * i.quantity` and sums with plain floats, then rounds with Python's `round()` (banker's rounding) — while `pricing.py` computes the same subtotal with `Decimal` and `ROUND_HALF_UP`. For most prices these agree, but float binary representation can produce a value like `99.999999999999` or `100.00000000001` for a cart that should be exactly `100.00`, and the two roundings modes can disagree on `.xx5` cases. That means the banner can say "free shipping!" while checkout actually charges shipping, or vice versa — exactly the kind of bug that's hard to reproduce because it only shows up for certain penny totals.

The fix is straightforward: have `cart_banner.py` call `pricing.quote(items)` and derive both the item count and the free-shipping message from the resulting `Quote` (compare `quote.subtotal >= FREE_SHIPPING_MIN` and `quote.shipping`), rather than re-deriving subtotal/threshold logic with different types and different rounding rules. That also removes the hardcoded `100` in `cart_banner.py`, which would otherwise drift if `FREE_SHIPPING_MIN` ever changes in `pricing.py`.

Want me to make that change?
✗ 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 — two real issues, both stemming from `cart_banner.py` reimplementing pricing logic instead of using `pricing.quote()`:

**1. Free-shipping boundary is inconsistent (off-by-one on the threshold).**
- `pricing.py`: `shipping = 0.00 if subtotal >= FREE_SHIPPING_MIN else FLAT_SHIPPING` → **inclusive** of $100.00.
- `cart_banner.py`: `if total > 100:` → **exclusive** of $100.00.

At exactly a $100.00 cart, the customer is actually charged $0 shipping, but the banner still says "Add $0.00 more to get free shipping" instead of the celebratory free-shipping message. Minor cosmetic case, but it's user-facing and wrong.

**2. Duplicated money math using `float` instead of `Decimal`, which can silently disagree with the real quote.**
`cart_total()` recomputes the subtotal with `float(i.unit_price) * i.quantity` and sums with plain floats, then rounds with Python's `round()` (banker's rounding) — while `pricing.py` computes the same subtotal with `Decimal` and `ROUND_HALF_UP`. For most prices these agree, but float binary representation can produce a value like `99.999999999999` or `100.00000000001` for a cart that should be exactly `100.00`, and the two roundings modes can disagree on `.xx5` cases. That means the banner can say "free shipping!" while checkout actually charges shipping, or vice versa — exactly the kind of bug that's hard to reproduce because it only shows up for certain penny totals.

The fix is straightforward: have `cart_banner.py` call `pricing.quote(items)` and derive both the item count and the free-shipping message from the resulting `Quote` (compare `quote.subtotal >= FREE_SHIPPING_MIN` and `quote.shipping`), rather than re-deriving subtotal/threshold logic with different types and different rounding rules. That also removes the hardcoded `100` in `cart_banner.py`, which would otherwise drift if `FREE_SHIPPING_MIN` ever changes in `pricing.py`.

Want me to make that change?
✗ fail skill-fired plugin-fired indicator

Skill called 0x (expected 1..∞)

Baseline (no plugin) 85.7% 0% of runs perfect
Run 1 85.7% 1 turns · $0.14 · 12:53:37 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, a few real issues, mostly in `cart_banner.py`:

**1. Boundary mismatch between the two modules (the real bug).** `pricing.py` grants free shipping when `subtotal >= FREE_SHIPPING_MIN` (`>=`), but `cart_banner.py`'s `shipping_banner` checks `total > 100` (strict `>`). At exactly $100.00, `quote()` charges $0 shipping, while the banner still says "Add $0.00 more to get free shipping" instead of the celebratory message. Since `FREE_SHIPPING_MIN` isn't imported/reused, the two thresholds can drift independently.

**2. Money computed in `float` instead of `Decimal`.** `cart_total` does `float(i.unit_price) * i.quantity` and sums floats, whereas `pricing.py` deliberately uses `Decimal` for currency. Binary float arithmetic can produce results like `99.99999999999999` or `100.00000000000001` for inputs that are exact in `Decimal`, which — combined with issue #1's strict `>` — can push a customer who actually qualifies for free shipping (per `quote()`) into the "not quite" branch, or vice versa. `round(total, 2)` masks this most of the time but not at/near the threshold, which is exactly where it matters.

**3. Duplicated business logic.** The $100 free-shipping threshold is hardcoded in `cart_banner.py` rather than importing `FREE_SHIPPING_MIN` from `pricing.py`. Functionally redundant with #1, but worth flagging separately: any future change to the threshold (or a tiered/promo threshold) only updates checkout pricing, not the banner customers see while shopping.

**Suggested fix direction:** have `cart_banner.py` call `pricing.quote(items)` (or at least reuse `FREE_SHIPPING_MIN` and Decimal subtotal math) instead of recomputing totals in float — that eliminates both the precision risk and the drift risk in one move.
✓ 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, a few real issues, mostly in `cart_banner.py`:

**1. Boundary mismatch between the two modules (the real bug).** `pricing.py` grants free shipping when `subtotal >= FREE_SHIPPING_MIN` (`>=`), but `cart_banner.py`'s `shipping_banner` checks `total > 100` (strict `>`). At exactly $100.00, `quote()` charges $0 shipping, while the banner still says "Add $0.00 more to get free shipping" instead of the celebratory message. Since `FREE_SHIPPING_MIN` isn't imported/reused, the two thresholds can drift independently.

**2. Money computed in `float` instead of `Decimal`.** `cart_total` does `float(i.unit_price) * i.quantity` and sums floats, whereas `pricing.py` deliberately uses `Decimal` for currency. Binary float arithmetic can produce results like `99.99999999999999` or `100.00000000000001` for inputs that are exact in `Decimal`, which — combined with issue #1's strict `>` — can push a customer who actually qualifies for free shipping (per `quote()`) into the "not quite" branch, or vice versa. `round(total, 2)` masks this most of the time but not at/near the threshold, which is exactly where it matters.

**3. Duplicated business logic.** The $100 free-shipping threshold is hardcoded in `cart_banner.py` rather than importing `FREE_SHIPPING_MIN` from `pricing.py`. Functionally redundant with #1, but worth flagging separately: any future change to the threshold (or a tiered/promo threshold) only updates checkout pricing, not the banner customers see while shopping.

**Suggested fix direction:** have `cart_banner.py` call `pricing.quote(items)` (or at least reuse `FREE_SHIPPING_MIN` and Decimal subtotal math) instead of recomputing totals in float — that eliminates both the precision risk and the drift risk in one move.
✗ 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, a few real issues, mostly in `cart_banner.py`:

**1. Boundary mismatch between the two modules (the real bug).** `pricing.py` grants free shipping when `subtotal >= FREE_SHIPPING_MIN` (`>=`), but `cart_banner.py`'s `shipping_banner` checks `total > 100` (strict `>`). At exactly $100.00, `quote()` charges $0 shipping, while the banner still says "Add $0.00 more to get free shipping" instead of the celebratory message. Since `FREE_SHIPPING_MIN` isn't imported/reused, the two thresholds can drift independently.

**2. Money computed in `float` instead of `Decimal`.** `cart_total` does `float(i.unit_price) * i.quantity` and sums floats, whereas `pricing.py` deliberately uses `Decimal` for currency. Binary float arithmetic can produce results like `99.99999999999999` or `100.00000000000001` for inputs that are exact in `Decimal`, which — combined with issue #1's strict `>` — can push a customer who actually qualifies for free shipping (per `quote()`) into the "not quite" branch, or vice versa. `round(total, 2)` masks this most of the time but not at/near the threshold, which is exactly where it matters.

**3. Duplicated business logic.** The $100 free-shipping threshold is hardcoded in `cart_banner.py` rather than importing `FREE_SHIPPING_MIN` from `pricing.py`. Functionally redundant with #1, but worth flagging separately: any future change to the threshold (or a tiered/promo threshold) only updates checkout pricing, not the banner customers see while shopping.

**Suggested fix direction:** have `cart_banner.py` call `pricing.quote(items)` (or at least reuse `FREE_SHIPPING_MIN` and Decimal subtotal math) instead of recomputing totals in float — that eliminates both the precision risk and the drift risk in one move.
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% 9 turns · $0.34 · 12:54:01 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)
# Brooks-Lint Review

**Mode:** PR Review
**Scope:** 3 files as shared — `src/main.ts`, `src/orders/ports.ts`, `src/orders/placeOrder.ts` (adapters and `http/server` excluded per your note)
**Health Score:** 79/100

Clean ports-and-adapters wiring overall, but the payment idempotency guarantee doesn't actually hold against the retry scenario it's meant to cover — fix that before this ships.

---

## Findings

### 🔴 Critical

**Domain Model Distortion — Idempotency key doesn't protect against the retry it's meant for**
Symptom: `PlaceOrder.execute` generates a fresh `randomUUID()` every call and uses it as `payments.charge`'s idempotency key (`placeOrder.ts:19-25`). The comment claims this protects against "a crash mid-charge," but any retry initiated *above* this method — an HTTP client that timed out and resubmits, a load-balancer replay, a mobile app's automatic retry-on-timeout — calls `execute()` again, gets a brand-new UUID, and produces a second order with a different idempotency key.
Source: Evans — Domain-Driven Design (the code asserts an invariant — "idempotent placement" — that its own comment names, but the implementation doesn't hold that invariant for the failure mode that actually matters to the business).
Consequence: The customer is charged twice for what they experience as one submission — the single most common real-world failure mode for a payment endpoint. Because the guarantee is only asserted in a comment, the gap stays invisible until it produces a double charge and a support/chargeback incident.
Remedy: Accept the idempotency key as an input to `execute()` (a client-supplied request ID, or a key derived from stable caller-provided fields) instead of minting it from `randomUUID()` internally. `Order.id` can stay server-generated — only the Stripe idempotency key needs to survive across retries of the same logical request.

### 🟡 Warning

**Coverage Illusion — no tests for the new order-placement path**
Symptom: `PlaceOrder.execute` is new public behavior (create → charge → status transition), and `main.ts` is the composition root for the whole service — neither has accompanying tests in what's shown.
Source: Feathers — Working Effectively with Legacy Code, Ch. 1.
Consequence: The two-phase persist-then-charge sequence, and specifically the failure branch (`result.ok === false` → `status: "failed"`), has no regression protection. The next change to this method has no safety net proving pending/paid/failed handling still works.
Remedy: Add unit tests for `PlaceOrder.execute` covering the charge-success path and the charge-failure path. Also worth a test that pins down current retry behavior (two calls with the same logical intent → two separate orders) so the fix for the Critical finding above is provably correct once made.

### 🟢 Suggestion

**Cognitive Overload — Money as two disconnected primitives (Primitive Obsession)**
Symptom: `amountCents` and `currency` travel together everywhere (`Order`, `PaymentGateway.charge`) as separate primitive fields/params rather than a single value type.
Source: Fowler — Refactoring, Primitive Obsession; Evans — DDD, Value Object.
Consequence: Nothing enforces that the two stay paired or get validated together — a caller could mix `amountCents` from one context with `currency` from another with no type-level error. Small risk now, grows as more call sites appear.
Remedy: Introduce a small immutable `Money { amountCents, currency }` value type and use it in `Order` and in `PaymentGateway.charge`'s signature. Cheap to do while the surface area is still this small.

---

## Summary

The dependency shape is the strongest part of this PR: `PlaceOrder` only knows about the `OrderRepository`/`PaymentGateway`/`Clock` interfaces in `orders/ports.ts`, and `main.ts` is the only place that touches `pg`/`Stripe` concretes directly — that's dependency inversion done correctly, not just claimed. The idempotency-key gap is a correctness issue, not a style one, and worth blocking merge on given this is a payments path; the other two findings are fine to pick up as the module grows.
✗ 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)
# Brooks-Lint Review

**Mode:** PR Review
**Scope:** 3 files as shared — `src/main.ts`, `src/orders/ports.ts`, `src/orders/placeOrder.ts` (adapters and `http/server` excluded per your note)
**Health Score:** 79/100

Clean ports-and-adapters wiring overall, but the payment idempotency guarantee doesn't actually hold against the retry scenario it's meant to cover — fix that before this ships.

---

## Findings

### 🔴 Critical

**Domain Model Distortion — Idempotency key doesn't protect against the retry it's meant for**
Symptom: `PlaceOrder.execute` generates a fresh `randomUUID()` every call and uses it as `payments.charge`'s idempotency key (`placeOrder.ts:19-25`). The comment claims this protects against "a crash mid-charge," but any retry initiated *above* this method — an HTTP client that timed out and resubmits, a load-balancer replay, a mobile app's automatic retry-on-timeout — calls `execute()` again, gets a brand-new UUID, and produces a second order with a different idempotency key.
Source: Evans — Domain-Driven Design (the code asserts an invariant — "idempotent placement" — that its own comment names, but the implementation doesn't hold that invariant for the failure mode that actually matters to the business).
Consequence: The customer is charged twice for what they experience as one submission — the single most common real-world failure mode for a payment endpoint. Because the guarantee is only asserted in a comment, the gap stays invisible until it produces a double charge and a support/chargeback incident.
Remedy: Accept the idempotency key as an input to `execute()` (a client-supplied request ID, or a key derived from stable caller-provided fields) instead of minting it from `randomUUID()` internally. `Order.id` can stay server-generated — only the Stripe idempotency key needs to survive across retries of the same logical request.

### 🟡 Warning

**Coverage Illusion — no tests for the new order-placement path**
Symptom: `PlaceOrder.execute` is new public behavior (create → charge → status transition), and `main.ts` is the composition root for the whole service — neither has accompanying tests in what's shown.
Source: Feathers — Working Effectively with Legacy Code, Ch. 1.
Consequence: The two-phase persist-then-charge sequence, and specifically the failure branch (`result.ok === false` → `status: "failed"`), has no regression protection. The next change to this method has no safety net proving pending/paid/failed handling still works.
Remedy: Add unit tests for `PlaceOrder.execute` covering the charge-success path and the charge-failure path. Also worth a test that pins down current retry behavior (two calls with the same logical intent → two separate orders) so the fix for the Critical finding above is provably correct once made.

### 🟢 Suggestion

**Cognitive Overload — Money as two disconnected primitives (Primitive Obsession)**
Symptom: `amountCents` and `currency` travel together everywhere (`Order`, `PaymentGateway.charge`) as separate primitive fields/params rather than a single value type.
Source: Fowler — Refactoring, Primitive Obsession; Evans — DDD, Value Object.
Consequence: Nothing enforces that the two stay paired or get validated together — a caller could mix `amountCents` from one context with `currency` from another with no type-level error. Small risk now, grows as more call sites appear.
Remedy: Introduce a small immutable `Money { amountCents, currency }` value type and use it in `Order` and in `PaymentGateway.charge`'s signature. Cheap to do while the surface area is still this small.

---

## Summary

The dependency shape is the strongest part of this PR: `PlaceOrder` only knows about the `OrderRepository`/`PaymentGateway`/`Clock` interfaces in `orders/ports.ts`, and `main.ts` is the only place that touches `pg`/`Stripe` concretes directly — that's dependency inversion done correctly, not just claimed. The idempotency-key gap is a correctness issue, not a style one, and worth blocking merge on given this is a payments path; the other two findings are fine to pick up as the module grows.
✓ pass skill-fired plugin-fired indicator

Skill called 1x (expected 1..∞)

Baseline (no plugin) 40% 0% of runs perfect
Run 1 40% 1 turns · $0.15 · 12:54:17 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)
I reviewed all three files. The overall shape (ports/adapters, explicit two-phase persist-then-charge) is sound, but there's one correctness bug that matters for a payments path, plus a few things worth confirming before this ships.

**Critical — idempotency key is generated per-attempt, not per-request**

`placeOrder.ts`: `order.id` is a fresh `randomUUID()` on every `execute()` call, and that same id is used as the Stripe idempotency key. That only protects against retries *inside* a single `execute()` call — it does nothing for the case that actually happens in production: the charge succeeds, then the second `orders.save(settled)` fails (DB blip, pool exhausted, pod killed) before it returns. `execute()` throws, the HTTP layer returns an error, the client (reasonably) retries the "place order" request, and `PlaceOrder` mints a brand-new order id → brand-new idempotency key → Stripe charges the customer again.

The idempotency key needs to come from the caller (e.g., an `Idempotency-Key` header the HTTP layer threads through, or a client-supplied order reference), not be generated inside the use case. Otherwise the safety the code comment is aiming for ("crash mid-charge leaves a record the reconciliation job can retry") only covers the DB-record side, not the double-charge side.

**Worth confirming — reconciliation job and "pending" ambiguity**

The pending→charge→settle pattern is the right shape, but it depends on a reconciliation job (not shown) that queries Stripe by idempotency key for stuck `"pending"` orders. Two things to check there:
- `Order.status` can't distinguish "never attempted a charge" from "charge attempted, outcome unknown because we crashed/threw before the second save." Both look like `"pending"`. That's probably fine since reconciliation checks Stripe regardless, but confirm it handles "no charge found for this key" (safe to retry) vs "charge found" (mark paid) correctly.
- If `payments.charge` throws instead of resolving to `{ok: false}` (e.g. network timeout to Stripe — the ambiguous "did it go through?" case), that exception propagates out of `execute()` and the order is left at `"pending"` with no `"failed"` write. That's likely intentional given the reconciliation design, but confirm `StripePaymentGateway` never lets a genuine Stripe error bubble as `{ok:false}` when it should instead be left unresolved for reconciliation — conflating the two would let reconciliation retry a charge that actually already succeeded.

**Worth confirming — repository adapter**

`orders.save()` is called twice for the same `id` (insert-as-pending, then update-to-settled). Since `PostgresOrderRepository` isn't included, worth double-checking it's an upsert (`ON CONFLICT ... DO UPDATE`) and not a plain `INSERT`, or the second save will fail on a duplicate key and you'll lose the settle write entirely after a successful charge.

**Minor — main.ts shutdown**

- `server.close()` isn't awaited/promisified, so `shutdown()` calls `pool.end()` without waiting for in-flight requests (and their DB queries) to finish — a request mid-query can lose its connection out from under it.
- No timeout on shutdown: if a client never releases back to the pool, `pool.end()` (and thus process exit) can hang indefinitely. Consider a forced `process.exit()` after a grace period.
- `shutdown` is async but the `SIGTERM`/`SIGINT` handlers don't catch rejections — if `pool.end()` throws, that's an unhandled rejection.
- No guard against a second SIGTERM/SIGINT firing `shutdown()` concurrently.

**Minor — input validation**

`placeOrder.ts` validates `amountCents` but not `currency` (no ISO-4217 shape/case check) or `customerId` (non-empty). Not a correctness bug given Stripe will reject garbage, but it means invalid input reaches the network call instead of failing fast, and a bad currency case (Stripe wants lowercase) could produce a confusing Stripe-side error rather than a clear validation error.

**Nice-to-have**

- Pin `apiVersion` on the `Stripe` client in `main.ts` rather than relying on the account default — avoids behavior changing out from under you when the account default rolls forward.

Nothing here blocks the shape of the design — the persist-pending → charge → persist-settled pattern with a reconciliation job is a reasonable way to handle the lack of a distributed transaction between Postgres and Stripe. The idempotency-key-per-request issue is the one I'd fix before this goes live; the rest are worth a quick confirm.
✗ 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)
I reviewed all three files. The overall shape (ports/adapters, explicit two-phase persist-then-charge) is sound, but there's one correctness bug that matters for a payments path, plus a few things worth confirming before this ships.

**Critical — idempotency key is generated per-attempt, not per-request**

`placeOrder.ts`: `order.id` is a fresh `randomUUID()` on every `execute()` call, and that same id is used as the Stripe idempotency key. That only protects against retries *inside* a single `execute()` call — it does nothing for the case that actually happens in production: the charge succeeds, then the second `orders.save(settled)` fails (DB blip, pool exhausted, pod killed) before it returns. `execute()` throws, the HTTP layer returns an error, the client (reasonably) retries the "place order" request, and `PlaceOrder` mints a brand-new order id → brand-new idempotency key → Stripe charges the customer again.

The idempotency key needs to come from the caller (e.g., an `Idempotency-Key` header the HTTP layer threads through, or a client-supplied order reference), not be generated inside the use case. Otherwise the safety the code comment is aiming for ("crash mid-charge leaves a record the reconciliation job can retry") only covers the DB-record side, not the double-charge side.

**Worth confirming — reconciliation job and "pending" ambiguity**

The pending→charge→settle pattern is the right shape, but it depends on a reconciliation job (not shown) that queries Stripe by idempotency key for stuck `"pending"` orders. Two things to check there:
- `Order.status` can't distinguish "never attempted a charge" from "charge attempted, outcome unknown because we crashed/threw before the second save." Both look like `"pending"`. That's probably fine since reconciliation checks Stripe regardless, but confirm it handles "no charge found for this key" (safe to retry) vs "charge found" (mark paid) correctly.
- If `payments.charge` throws instead of resolving to `{ok: false}` (e.g. network timeout to Stripe — the ambiguous "did it go through?" case), that exception propagates out of `execute()` and the order is left at `"pending"` with no `"failed"` write. That's likely intentional given the reconciliation design, but confirm `StripePaymentGateway` never lets a genuine Stripe error bubble as `{ok:false}` when it should instead be left unresolved for reconciliation — conflating the two would let reconciliation retry a charge that actually already succeeded.

**Worth confirming — repository adapter**

`orders.save()` is called twice for the same `id` (insert-as-pending, then update-to-settled). Since `PostgresOrderRepository` isn't included, worth double-checking it's an upsert (`ON CONFLICT ... DO UPDATE`) and not a plain `INSERT`, or the second save will fail on a duplicate key and you'll lose the settle write entirely after a successful charge.

**Minor — main.ts shutdown**

- `server.close()` isn't awaited/promisified, so `shutdown()` calls `pool.end()` without waiting for in-flight requests (and their DB queries) to finish — a request mid-query can lose its connection out from under it.
- No timeout on shutdown: if a client never releases back to the pool, `pool.end()` (and thus process exit) can hang indefinitely. Consider a forced `process.exit()` after a grace period.
- `shutdown` is async but the `SIGTERM`/`SIGINT` handlers don't catch rejections — if `pool.end()` throws, that's an unhandled rejection.
- No guard against a second SIGTERM/SIGINT firing `shutdown()` concurrently.

**Minor — input validation**

`placeOrder.ts` validates `amountCents` but not `currency` (no ISO-4217 shape/case check) or `customerId` (non-empty). Not a correctness bug given Stripe will reject garbage, but it means invalid input reaches the network call instead of failing fast, and a bad currency case (Stripe wants lowercase) could produce a confusing Stripe-side error rather than a clear validation error.

**Nice-to-have**

- Pin `apiVersion` on the `Stripe` client in `main.ts` rather than relying on the account default — avoids behavior changing out from under you when the account default rolls forward.

Nothing here blocks the shape of the design — the persist-pending → charge → persist-settled pattern with a reconciliation job is a reasonable way to handle the lack of a distributed transaction between Postgres and Stripe. The idempotency-key-per-request issue is the one I'd fix before this goes live; the rest are worth a quick confirm.
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 {
  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 class PlaceOrder {
  constructor(
    private readonly orders: OrderRepository,
    private readonly payments: PaymentGateway,
    private readonly clock: Clock,
  ) {}

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

    const order: Order = {
      id: randomUUID(),
      customerId,
      amountCents,
      currency,
      status: "pending",
      createdAt: this.clock.now(),
    };
    // Persist as pending first so a crash mid-charge leaves a record the
    // reconciliation job can retry (the idempotency key is the order id).
    await this.orders.save(order);

    const result = await this.payments.charge(customerId, amountCents, 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 71.4%
Results
With plugin 71.4% 0% of runs perfect
Run 1 71.4% 13 turns · $0.40 · 12:54:21 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` (modified), `resp/decode.go` (new, 102 lines). `resp/value.go` not shown; treated as unchanged per your description.
**Health Score:** 80/100

Solid, well-scoped protocol fix — one real gap (unbounded recursion depth) should be closed before merge, and the new decoder path has no tests.

---

## Findings

### 🔴 Critical

**Defensive Programming — unbounded recursion depth on nested arrays**
Symptom: `Decode` bounds bulk-string length (`maxBulkLen`) and per-level array length (`maxArrayLen`) explicitly "so a corrupt or hostile peer cannot make us allocate unbounded memory" — but the `Array` case recurses into `Decode(r)` for each element with no depth counter. A peer sending `*1\r\n*1\r\n*1\r\n...` (deeply nested single-element arrays) costs 4 bytes per nesting level and drives the call stack arbitrarily deep, independent of `maxArrayLen`.
Source: McConnell — *Code Complete*, defensive programming / boundary-condition discipline (explicitly named in this project's own threat model comment).
Consequence: A malicious or buggy peer (compromised server, proxying layer, or protocol-confusion bug) can crash the client process via stack exhaustion — the exact class of attack the length limits were added to prevent, just via a different vector. This is a client library other code will depend on, so the gap ships to every caller.
Remedy: Thread a depth counter (or explicit stack-based iterative decode) through `Decode`, cap it (e.g. 32–64, matching Redis's own `PROTO_MAX_DEPTH`-style limits), and return an `ErrProtocol`-wrapped error when exceeded.

### 🟡 Warning

**Coverage Illusion — new decoder has no tests**
Symptom: The diff adds a full RESP2 decoder (5 type branches, null handling, length validation, recursion) and changes `Do`'s error/return semantics, but includes no `*_test.go` changes.
Source: Feathers — *Working Effectively with Legacy Code*, Ch. 1.
Consequence: This is the code that parses untrusted network input — exactly where regressions (off-by-one CRLF checks, null vs. empty confusion, integer overflow on `ParseInt`) are both easy to introduce and expensive to catch later. Right now correctness rests entirely on manual review.
Remedy: Add table-driven tests per type (`+OK\r\n`, `-ERR x\r\n`, `:123\r\n`, `$-1\r\n`, `$5\r\nhello\r\n`, `*-1\r\n`, nested arrays) plus malformed-input cases (bad length, missing CRLF, truncated stream) asserting `errors.Is(err, resp.ErrProtocol)` where appropriate.

---

## Summary

Merge-blocking issue is the recursion depth gap — it undercuts the exact hostile-peer protection the length limits were written for, so it's worth a small fix before this lands. Add basic decoder tests alongside it; a from-scratch parser for untrusted network data with zero test coverage is the kind of thing that's cheap to test now and expensive to debug in production later. Everything else in the diff — the `Do` rewrite, error wrapping, CRLF strictness — is a clean, well-scoped improvement over the old single-line parser.

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

✗ fail no-critical-findings

judge votes: FAIL FAIL FAIL

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` (modified), `resp/decode.go` (new, 102 lines). `resp/value.go` not shown; treated as unchanged per your description.
**Health Score:** 80/100

Solid, well-scoped protocol fix — one real gap (unbounded recursion depth) should be closed before merge, and the new decoder path has no tests.

---

## Findings

### 🔴 Critical

**Defensive Programming — unbounded recursion depth on nested arrays**
Symptom: `Decode` bounds bulk-string length (`maxBulkLen`) and per-level array length (`maxArrayLen`) explicitly "so a corrupt or hostile peer cannot make us allocate unbounded memory" — but the `Array` case recurses into `Decode(r)` for each element with no depth counter. A peer sending `*1\r\n*1\r\n*1\r\n...` (deeply nested single-element arrays) costs 4 bytes per nesting level and drives the call stack arbitrarily deep, independent of `maxArrayLen`.
Source: McConnell — *Code Complete*, defensive programming / boundary-condition discipline (explicitly named in this project's own threat model comment).
Consequence: A malicious or buggy peer (compromised server, proxying layer, or protocol-confusion bug) can crash the client process via stack exhaustion — the exact class of attack the length limits were added to prevent, just via a different vector. This is a client library other code will depend on, so the gap ships to every caller.
Remedy: Thread a depth counter (or explicit stack-based iterative decode) through `Decode`, cap it (e.g. 32–64, matching Redis's own `PROTO_MAX_DEPTH`-style limits), and return an `ErrProtocol`-wrapped error when exceeded.

### 🟡 Warning

**Coverage Illusion — new decoder has no tests**
Symptom: The diff adds a full RESP2 decoder (5 type branches, null handling, length validation, recursion) and changes `Do`'s error/return semantics, but includes no `*_test.go` changes.
Source: Feathers — *Working Effectively with Legacy Code*, Ch. 1.
Consequence: This is the code that parses untrusted network input — exactly where regressions (off-by-one CRLF checks, null vs. empty confusion, integer overflow on `ParseInt`) are both easy to introduce and expensive to catch later. Right now correctness rests entirely on manual review.
Remedy: Add table-driven tests per type (`+OK\r\n`, `-ERR x\r\n`, `:123\r\n`, `$-1\r\n`, `$5\r\nhello\r\n`, `*-1\r\n`, nested arrays) plus malformed-input cases (bad length, missing CRLF, truncated stream) asserting `errors.Is(err, resp.ErrProtocol)` where appropriate.

---

## Summary

Merge-blocking issue is the recursion depth gap — it undercuts the exact hostile-peer protection the length limits were written for, so it's worth a small fix before this lands. Add basic decoder tests alongside it; a from-scratch parser for untrusted network data with zero test coverage is the kind of thing that's cheap to test now and expensive to debug in production later. Everything else in the diff — the `Do` rewrite, error wrapping, CRLF strictness — is a clean, well-scoped improvement over the old single-line parser.

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` (modified), `resp/decode.go` (new, 102 lines). `resp/value.go` not shown; treated as unchanged per your description.
**Health Score:** 80/100

Solid, well-scoped protocol fix — one real gap (unbounded recursion depth) should be closed before merge, and the new decoder path has no tests.

---

## Findings

### 🔴 Critical

**Defensive Programming — unbounded recursion depth on nested arrays**
Symptom: `Decode` bounds bulk-string length (`maxBulkLen`) and per-level array length (`maxArrayLen`) explicitly "so a corrupt or hostile peer cannot make us allocate unbounded memory" — but the `Array` case recurses into `Decode(r)` for each element with no depth counter. A peer sending `*1\r\n*1\r\n*1\r\n...` (deeply nested single-element arrays) costs 4 bytes per nesting level and drives the call stack arbitrarily deep, independent of `maxArrayLen`.
Source: McConnell — *Code Complete*, defensive programming / boundary-condition discipline (explicitly named in this project's own threat model comment).
Consequence: A malicious or buggy peer (compromised server, proxying layer, or protocol-confusion bug) can crash the client process via stack exhaustion — the exact class of attack the length limits were added to prevent, just via a different vector. This is a client library other code will depend on, so the gap ships to every caller.
Remedy: Thread a depth counter (or explicit stack-based iterative decode) through `Decode`, cap it (e.g. 32–64, matching Redis's own `PROTO_MAX_DEPTH`-style limits), and return an `ErrProtocol`-wrapped error when exceeded.

### 🟡 Warning

**Coverage Illusion — new decoder has no tests**
Symptom: The diff adds a full RESP2 decoder (5 type branches, null handling, length validation, recursion) and changes `Do`'s error/return semantics, but includes no `*_test.go` changes.
Source: Feathers — *Working Effectively with Legacy Code*, Ch. 1.
Consequence: This is the code that parses untrusted network input — exactly where regressions (off-by-one CRLF checks, null vs. empty confusion, integer overflow on `ParseInt`) are both easy to introduce and expensive to catch later. Right now correctness rests entirely on manual review.
Remedy: Add table-driven tests per type (`+OK\r\n`, `-ERR x\r\n`, `:123\r\n`, `$-1\r\n`, `$5\r\nhello\r\n`, `*-1\r\n`, nested arrays) plus malformed-input cases (bad length, missing CRLF, truncated stream) asserting `errors.Is(err, resp.ErrProtocol)` where appropriate.

---

## Summary

Merge-blocking issue is the recursion depth gap — it undercuts the exact hostile-peer protection the length limits were written for, so it's worth a small fix before this lands. Add basic decoder tests alongside it; a from-scratch parser for untrusted network data with zero test coverage is the kind of thing that's cheap to test now and expensive to debug in production later. Everything else in the diff — the `Do` rewrite, error wrapping, CRLF strictness — is a clean, well-scoped improvement over the old single-line parser.

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) 57.1% 0% of runs perfect
Run 1 57.1% 4 turns · $0.18 · 12:54:54 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)
I couldn't cross-check this against your actual `resp/value.go` — this working directory has no Go files in it at all, so I reviewed the diff as presented. A few things I'd fix before merging:

**Real bugs / gaps**

1. **Unbounded recursion on nested arrays** (`decode.go:64-77`, the `Array` case). Each element is decoded via a recursive `Decode(r)` call with no depth limit. A peer sending deeply nested arrays (`*1\r\n*1\r\n*1\r\n...`) can exhaust the goroutine stack. You already bound `maxArrayLen` and `maxBulkLen` against a "corrupt or hostile peer" — nesting depth is the same threat model and it's uncovered.

2. **Unbounded line length for `SimpleString`/`Error`/`Integer`** (`readLine`, using `bufio.Reader.ReadString('\n')`). Unlike bulk strings and arrays, these types have no length prefix, so `ReadString` will keep growing its internal buffer until it finds `\n` (or EOF). A peer that sends `+` followed by gigabytes of non-newline bytes forces unbounded memory growth — the exact class of problem `maxBulkLen`/`maxArrayLen` were added to prevent, just left open on the other code path.

**Missing from the PR**

3. No tests. Given this is protocol-parsing code with several edge cases you clearly thought about (nulls, CRLF validation, length limits), it's worth locking those in with unit tests — especially nested arrays, null bulk/array, and the new CRLF-strictness behavior (which is a behavior change from the old `TrimSpace`-based parsing, and works in your favor, but should be pinned down).

**Not a bug, just noting**

- `Do`'s `ctx` still isn't wired into the read (no deadline enforcement) — pre-existing, not something this PR introduced.

The core logic (type dispatch, bulk/array framing, error propagation into `Do`) looks correct and is a real improvement over the old single-line-only parsing. I'd hold off on merge until the two robustness gaps above are addressed, since they undercut the hostile-input protection the PR is explicitly going for — otherwise this looks solid.
✗ fail health-score-line ×0.5

pattern not found in last_message

✗ fail no-critical-findings

judge votes: FAIL FAIL FAIL

Judge votes✗ ✗ ✗
Evidence (what the judge was shown; for an image, a description of what was sent)
I couldn't cross-check this against your actual `resp/value.go` — this working directory has no Go files in it at all, so I reviewed the diff as presented. A few things I'd fix before merging:

**Real bugs / gaps**

1. **Unbounded recursion on nested arrays** (`decode.go:64-77`, the `Array` case). Each element is decoded via a recursive `Decode(r)` call with no depth limit. A peer sending deeply nested arrays (`*1\r\n*1\r\n*1\r\n...`) can exhaust the goroutine stack. You already bound `maxArrayLen` and `maxBulkLen` against a "corrupt or hostile peer" — nesting depth is the same threat model and it's uncovered.

2. **Unbounded line length for `SimpleString`/`Error`/`Integer`** (`readLine`, using `bufio.Reader.ReadString('\n')`). Unlike bulk strings and arrays, these types have no length prefix, so `ReadString` will keep growing its internal buffer until it finds `\n` (or EOF). A peer that sends `+` followed by gigabytes of non-newline bytes forces unbounded memory growth — the exact class of problem `maxBulkLen`/`maxArrayLen` were added to prevent, just left open on the other code path.

**Missing from the PR**

3. No tests. Given this is protocol-parsing code with several edge cases you clearly thought about (nulls, CRLF validation, length limits), it's worth locking those in with unit tests — especially nested arrays, null bulk/array, and the new CRLF-strictness behavior (which is a behavior change from the old `TrimSpace`-based parsing, and works in your favor, but should be pinned down).

**Not a bug, just noting**

- `Do`'s `ctx` still isn't wired into the read (no deadline enforcement) — pre-existing, not something this PR introduced.

The core logic (type dispatch, bulk/array framing, error propagation into `Do`) looks correct and is a real improvement over the old single-line-only parsing. I'd hold off on merge until the two robustness gaps above are addressed, since they undercut the hostile-input protection the PR is explicitly going for — otherwise this looks solid.
✓ 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)
I couldn't cross-check this against your actual `resp/value.go` — this working directory has no Go files in it at all, so I reviewed the diff as presented. A few things I'd fix before merging:

**Real bugs / gaps**

1. **Unbounded recursion on nested arrays** (`decode.go:64-77`, the `Array` case). Each element is decoded via a recursive `Decode(r)` call with no depth limit. A peer sending deeply nested arrays (`*1\r\n*1\r\n*1\r\n...`) can exhaust the goroutine stack. You already bound `maxArrayLen` and `maxBulkLen` against a "corrupt or hostile peer" — nesting depth is the same threat model and it's uncovered.

2. **Unbounded line length for `SimpleString`/`Error`/`Integer`** (`readLine`, using `bufio.Reader.ReadString('\n')`). Unlike bulk strings and arrays, these types have no length prefix, so `ReadString` will keep growing its internal buffer until it finds `\n` (or EOF). A peer that sends `+` followed by gigabytes of non-newline bytes forces unbounded memory growth — the exact class of problem `maxBulkLen`/`maxArrayLen` were added to prevent, just left open on the other code path.

**Missing from the PR**

3. No tests. Given this is protocol-parsing code with several edge cases you clearly thought about (nulls, CRLF validation, length limits), it's worth locking those in with unit tests — especially nested arrays, null bulk/array, and the new CRLF-strictness behavior (which is a behavior change from the old `TrimSpace`-based parsing, and works in your favor, but should be pinned down).

**Not a bug, just noting**

- `Do`'s `ctx` still isn't wired into the read (no deadline enforcement) — pre-existing, not something this PR introduced.

The core logic (type dispatch, bulk/array framing, error propagation into `Do`) looks correct and is a real improvement over the old single-line-only parsing. I'd hold off on merge until the two robustness gaps above are addressed, since they undercut the hostile-input protection the PR is explicitly going for — otherwise this looks solid.
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..059840e
--- /dev/null
+++ b/resp/decode.go
@@ -0,0 +1,102 @@
+package resp
+
+import (
+	"bufio"
+	"errors"
+	"fmt"
+	"io"
+	"strconv"
+	"strings"
+)
+
+// ErrProtocol is wrapped by every error caused by malformed input.
+var ErrProtocol = errors.New("resp: protocol error")
+
+// Limits mirror Redis's defaults (proto-max-bulk-len) so a corrupt or hostile
+// peer cannot make us allocate unbounded memory.
+const (
+	maxBulkLen  = 512 << 20
+	maxArrayLen = 1 << 20
+)
+
+// Decode reads exactly one RESP2 value from r.
+func Decode(r *bufio.Reader) (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
+		}
+		items := make([]Value, 0, n)
+		for i := 0; i < n; i++ {
+			v, err := Decode(r)
+			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
+}
+
+func readLine(r *bufio.Reader) (string, error) {
+	line, err := r.ReadString('\n')
+	if err != nil {
+		return "", err
+	}
+	if !strings.HasSuffix(line, "\r\n") {
+		return "", fmt.Errorf("%w: line not CRLF-terminated", ErrProtocol)
+	}
+	return 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 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.04 · 12:55:24 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.04 · 12:55:30 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|Symptom\\W*:|Consequence\\W*:"
flags"i"
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 ↑ +50.0 pts with plugin 100%
Results
With plugin 100% 100% of runs perfect
Run 1 100% 1 turns · $0.07 · 12:55:37 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 difference is what type each expression is checked *against* and what type it ends up *with*.

**`satisfies`**

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

`satisfies` checks that the literal you wrote is assignable to `Record<string, Route>`, but then keeps the *original, narrower inferred type* for `routes` — not `Record<string, Route>`. Each property of the object literal still has to individually be a valid `Route`, so `settings` must have both `path` and `auth`. Delete `auth`, and `{ path: "/settings" }` is no longer assignable to `Route` (missing required property), so it fails at the site of the literal. That's the whole point of `satisfies`: full structural checking of the literal, while preserving literal types (e.g. `routes.home.path` is `"/"`, not just `string`).

**`as`**

```ts
settings: { path: "/settings" } as Route,
```

`as` is a type assertion — you're telling the compiler "trust me, treat this as a `Route`," and TypeScript only does a compatibility sanity check (do the types overlap enough that this isn't obviously nonsense), not a full structural check. Since `{ path: "/settings" }` and `Route` overlap (they share `path`), the assertion is allowed even though the object is actually missing `auth`. It compiles, but you've just lied to the compiler — at runtime `legacyRoutes.settings.auth` is `undefined`, not `boolean`, and nothing will catch that.

Also worth noting: the outer annotation `Record<string, Route>` on `legacyRoutes` doesn't save you here, because the `as Route` assertion on the individual property already forced that value to type-check as `Route` before the outer check even applies — the assertion overrides inference locally.

**Bottom line:** `satisfies` validates structurally and infers precisely; `as` overrides the checker and can hide missing/wrong fields exactly like this. Prefer `satisfies` whenever you want the safety and still want literal-type inference — reserve `as` for cases where you genuinely know more than the compiler (e.g., narrowing after a runtime check), not as a way to silence a legitimate type error.
✓ pass no-review-report

pattern absent as expected

✓ pass skill-not-fired plugin-fired indicator

Skill called 0x (expected 0..0)

Baseline (no plugin) 50% 0% of runs perfect
Run 1 50% 1 turns · $0.06 · 12:55:51 UTC
✗ fail explains-satisfies-vs-as

judge votes: FAIL FAIL FAIL

Judge votes✗ ✗ ✗
Evidence (what the judge was shown; for an image, a description of what was sent)
The core difference: `satisfies` checks the value against the type but keeps the value's own inferred type, while `as` overrides the type checker's inference entirely with a type assertion.

**`satisfies`:**
```ts
const routes = {
  home: { path: "/", auth: false },
  settings: { path: "/settings", auth: true },
} satisfies Record<string, Route>;
```
Here, `routes` still has its *inferred literal type* — TypeScript knows `routes.settings` is `{ path: string; auth: boolean }` — but every value in the object literal is checked against `Record<string, Route>` at the point of assignment. Each property of the literal must actually conform to `Route`. If you delete `auth: true`, the object `{ path: "/settings" }` no longer satisfies `Route` (which requires `auth: boolean`), so TypeScript flags it immediately at that property.

**`as`:**
```ts
const legacyRoutes: Record<string, Route> = {
  home: { path: "/", auth: false },
  settings: { path: "/settings" } as Route,
};
```
`as Route` is a type assertion — you're telling the compiler "trust me, treat this value as a `Route`," and it does no structural verification beyond a loose compatibility check (roughly: are these types not obviously unrelated). It doesn't check that the object literal actually has all of `Route`'s properties; it just forces the type. So `{ path: "/settings" }` gets stamped as `Route` even though `auth` is missing — the compiler doesn't complain because you've overridden its inference for that expression.

**In short:**
- `satisfies` = "verify this conforms to the type, but keep inferring the real type" → structural excess/missing-property checks still apply.
- `as` = "I know better than you, just treat it as this type" → bypasses property checking (it only errors if the types are wildly incompatible, e.g. `"str" as Route` would fail, but a subset-missing-property object mostly won't).

That's why deleting `auth` breaks the `satisfies` version but not the `as` version — `satisfies` still validates, `as` just silences the checker.
✓ 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: legacyRoutes.settings.auth is typed boolean but is undefined at runtime (or equivalently, the assertion hides a real bug).

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|Symptom\\W*:|Consequence\\W*:"
flags"i"
match"not_contains"
skill-not-firedtool_used
tool"Skill"
input_match"brooks-review"
min0
max0