Skip to content

Two collection guards passed against no implementation at all - #265

Merged
adamjohnwright merged 3 commits into
mainfrom
tests/non-vacuous-collection-guards
Sep 19, 2026
Merged

adamjohnwright merged 3 commits into
mainfrom
tests/non-vacuous-collection-guards

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

The website session pointed out that removing their presence implementation left two of four tests green — and that both were the ones asserting absence. Nothing set is also nothing seen.

Two of mine were the same. Deleting the wiring from generate_answer left five of seven green, including both tests written to guard the dangerous directions:

  • that a reactome selection never leaks into the userguide bundle
  • that a selection does not outlive the question

Each asserted None, and None is exactly what an unimplemented feature produces. They would have gone on passing through any refactor that quietly dropped the wiring.

Both now show the mechanism is live before asserting the absence — a reactome call that must be seen, then the userguide call that must not be; set during, absent after.

Deleting the wiring now fails four of seven, up from two. The three that still pass are the prompt and schema tests, which do not depend on the wiring and are not vacuous for passing.

The general form is worth keeping: a test that asserts something is absent proves nothing until the same test has shown the thing can be present.

501 passed, 1 skipped; mypy over all 137 files, ruff clean.

🤖 Generated with Claude Code

The website session observed that absence tests can pass vacuously -- removing
their implementation left two of four green, and both were the ones asserting
that something is not there. Nothing set is also nothing seen.

Two of mine were the same. Deleting the wiring from `generate_answer` left
five of seven green, including both tests meant to guard the dangerous
directions: that a reactome selection never leaks into the userguide bundle,
and that a selection does not outlive the question. Each asserted `None`, and
`None` is what an unimplemented feature produces.

Both now establish the mechanism is live before asserting the absence -- a
reactome call that must be seen, then the userguide call that must not be;
set during, absent after. Deleting the wiring now fails four of seven instead
of two. The three that still pass are the prompt and schema tests, which do
not depend on the wiring and are not vacuous for passing.

The general form is worth keeping: a test that asserts something is absent
proves nothing until the same test has shown the thing can be present.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright force-pushed the tests/non-vacuous-collection-guards branch from a5216b0 to e015523 Compare September 19, 2026 06:42
adamjohnwright and others added 2 commits September 19, 2026 07:13
Reviewing the fix found one it missed. `test_the_userguide_prompt_alone_
offers_no_collections` asserted only that the block is absent from the
userguide-only prompt -- which passes just as well when the block never
renders for anyone. Verified by deleting it: the test stayed green while
a different test in the same file caught the fault.

File-level coverage was therefore fine and the test itself was worth
nothing. A guard that relies on a neighbour to be non-vacuous is one
refactor of the neighbour away from guarding nothing, and the neighbour
is not mentioned anywhere near it.

Both halves are in the one test now: the block renders for reactome, and
it does not reach the userguide. Deleting the block fails it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 476ff51 into main Sep 19, 2026
10 checks passed
@adamjohnwright
adamjohnwright deleted the tests/non-vacuous-collection-guards branch September 19, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant