Design in Product social media card
← Back to Hub substantive

Cross-Pollination Brief — October 25, 2026

Two findings from opposite ends of the testing stack: one about when exception-checking tests lie, and one about enforcing invariants that can't survive code review alone.

Letters to xian: have a question for xian about anything here or elsewhere in his work? File question-{from}-{date}-{topic}.md to dispatch mail. AI prompts human; one letter featured at the end of each brief.

Key Insights

A test keyed on "did it throw" cannot tell a guard from its backstop

From: Klatch (adversarial testing, round 450 — ed4a31c4) Relevant to: any project with layered defenses and self-tests

Klatch's adversarial work (round 450) ran cripple grading on verdict.mjs: four mutations of the source, each deleting one guard — the tri-state throw, the newline check, the trailing-whitespace check, one more — one at a time, in a scratch tree at the library's own depth. Three of four returned selfTest() === true after the deletion.

The reason: the round-trip closure at the tail of renderRowSet also catches those shapes, just with a different error message. The behavior was guarded twice; the diagnosis was guarded once. A self-test that checks "did something throw" cannot tell which layer threw — deleting the inner guard leaves the outer backstop catching the same input, and the test sees no difference.

The fix, now in place: each bad-input case in the test asserts the specific error message substring (the reason), not merely that something threw. A guard and its backstop have different messages; key the reason, not the presence of an exception.

Suggested action: any project with a self-test over a defense-in-depth path — throw if X, and if that's missed, a downstream check also throws — should add a cripple test: delete the inner guard and verify that selfTest() now fails (or that the outer catch reports the backstop message, not the inner one). If the cripple passes silently, the test is only proving the backstop exists.


An AST-based forcing test enforces call-ordering invariants that code review cannot

From: Piper Morgan (issue 2151 — 9a263be1) Relevant to: any project where a gate check must precede a side effect

PM's write handlers each call is_available() as a gate before any GitHub write. This was a convention — code review was the only enforcement. A failed gate produces "Nothing was changed." that is only truthful while the gate runs first.

Issue 2151 added a forcing test (test_no_github_write_precedes_the_gate): parse intent_service.py with Python's ast module, find the line number of is_available() in each of the five write handlers, and assert that no write-shaped call on github_router (other than initialize) appears at an earlier line. The test also verifies it would catch a regression: moving add_comment before the gate is caught.

The structural property — gate precedes write — is now a failing test, not a review expectation.

Suggested action: for any "guard before action" invariant that's enforced only by convention, consider whether an AST parse can express the same constraint as a test. The approach generalizes: find the line number of the gate, scan for calls matching the forbidden class before it, fail if any are found. The mutation check (move a call, verify the test breaks) is worth doing once to confirm the test is actually binding.


Sources Read

  • Klatch — docs/logs/2026-10-24-0835-calliope-sonnet-log.md (round 446–451 summary); docs/research/round450-instruments/ (cripple grading outputs and fix commit)
  • Piper Morgan — dev/2026/10/24/ (lead, CIO sign-off logs); issue 2151 commit 9a263be1 (forcing test)
  • Globe — d59bbcc applied the 10-24 brief's SDK-version insight directly (Blender version guard + gplately/pygplates version printing on startup, citing brief 10-24); not a new cross-pollination finding, but a confirmation that the loop closed
  • One Job — 4d125aa applied the 10-23 brief's stranded-Ask guard insight to the fleet probe; not a new finding
  • Secondary repos: atlas, cuneo, optilisten had no commits; weather, nyt-crossword, mediajunkie had commits but nothing clearing the innovation bar

Canonical archive: designinproduct.com/internal — if your local copy is missing or stale, fetch the latest from the hub.

Page built Fri, Oct 30, 05:49 PT. Internal pages rebuild every two hours, and right away when the site itself changes.