# Prove the checks can fail before paying to scale

*Trusting the quality checks · Check calibration + mutation test. From the portfolio of Guilherme Rohden. Excerpts are quoted verbatim; internal paths and identifiers are redacted.*

The spend gate that blocks paid runs on a failed or stale calibration, the black-and-white false positive, and the test run that proves the fix.

## The decision

Before paid test runs scale up, each automated check must first reject a deliberately broken input. The receipt for that free demonstration is tied to the version of the checking code, so a changed check needs a new demonstration and an old green receipt cannot authorize spending.

That adds calibration and maintenance work. In return, a passing test means something stronger: the instrument has already shown it can catch its target failure.

## From the source

**Spend gate.** Unsuccessful demonstrations and a changed helper both block progression:

```typescript
  if (!parsed.allDemonstrated) {
    throw new Error(
      `Spec 184 D2 gate: the last can-fail demo did not demonstrate every probe red (${file}).`,
    );
  }
  if (parsed.probeHelperSha256 !== currentHelperSha256) {
    throw new Error(
      `Spec 184 D2 gate: render-seam-probe.ts changed since the can-fail demo ` +
        `(${parsed.probeHelperSha256.slice(0, 12)} → ${currentHelperSha256.slice(0, 12)}). ` +
        `Re-run the demo before spending.`,
    );
  }
```

**Grayscale experiment, September 2026.** The ungraded control’s chroma means already passed the tolerance of 2; within-frame chroma range separates it from the desaturated output. Only the fixture filename is redacted:

```text
| reading | delivered `bw` render | ungraded CONTROL (`[REDACTED: synthetic control filename]`) |
|---|---|---|
| mean UAVG / VAVG | **128.000 / 128.000** (|Δ| 0.000) | 127.59 / 127.55 (|Δ| 0.41 / 0.45) |
| mean per-frame chroma range (UMAX−UMIN / VMAX−VMIN) | **0.00 / 0.00** | 29.75 / 29.02 |
```

**Mutation run.** Disabling both range comparisons made the targeted regression fail:

```text
Test Suites: 1 failed, 1 total
Tests:       1 failed, 37 skipped, 4 passed, 42 total
Snapshots:   0 total
Time:        6.695 s, estimated 11 s
```

## Reading the result

| Check | Outcome | Why it matters |
|---|---|---|
| Colored control | Rejected by the range check despite passing the mean check | Exposes the original false positive |
| Same clip genuinely desaturated | Accepted | Protects against a check that rejects everything |
| Range comparisons disabled | 1 failure, 4 passes, 37 skips | The targeted regression depends on the required behavior |
| Original comparisons restored | 42/42 tests passed | The restored suite returned to green |

## What this shows

A check that tells the two cases apart in both directions, and a regression test that fails when the fix is removed. A separate 9 October receipt records **29 of 29** constructed-failure demonstrations bound to the helper hash. The pixels were read from encoder output after a delivery timeout, so they show the grade’s effect, not delivery timing.
