Skip to content

test(mcp): report what was counted, not just the failure count - #6

Merged
bhyi4 merged 1 commit into
mainfrom
fix/contract-test-denominator
Aug 24, 2026
Merged

test(mcp): report what was counted, not just the failure count#6
bhyi4 merged 1 commit into
mainfrom
fix/contract-test-denominator

Conversation

@bhyi4

@bhyi4 bhyi4 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #5, acting on review feedback left on that PR.

The problem

The contract-test summary read:

all _run contract tests passed (0 failed)

A run that collected zero checks prints the same line. So it could not distinguish
"everything passed" from "nothing ran". The real evidence was the eight ok lines above it —
but the summary is what gets quoted later, and it was the weakest statement in the file.

This is the same rule the rest of this work applies elsewhere: a green without a denominator
is not a measurement. substance_check.py was already reporting n/n (...), so the two
summary lines in this repo disagreed with each other. Now they don't.

What changed

  • Summary is N/M checks passed. A sabotaged run now reads 4/8 — the number says which
    half broke, instead of just that something did.
  • An empty run is an explicit failure, and that is decided before printing: a summary
    saying "passed" above a failure line is the same trap one line further down.
  • Drops an em-dash from the MCP import step's output — it renders as ? on the Windows
    console, which reads like a mojibake defect in the log when nothing is actually wrong.
    Cosmetic, but a log that carries a false signal costs someone a real investigation.

Verified in three directions

run summary
normal all _run contract tests passed: 8/8 checks passed
_run fix reverted CONTRACT TESTS FAILED: 4/8 checks passed
no checks collected CONTRACT TESTS FAILED: no checks ran at all (exit 1)

Scope: reporting only. No change to what is asserted or to _run itself.

Follow-up to #5, from review feedback on that PR.

The summary line read `all _run contract tests passed (0 failed)`. A run that collected ZERO
checks prints exactly the same thing, so the line could not tell "everything passed" apart
from "nothing ran". The real evidence was the eight `ok` lines above it — but the summary is
what a human quotes later, and it was the weakest statement in the file.

This is the same rule the rest of this work applies elsewhere: a green without a denominator
is not a measurement. `substance_check.py` was already reporting `n/n (...)`; the two summary
lines in this repo now agree with each other.

- summary is now `N/M checks passed`, so a sabotaged run reads `4/8` instead of a bare count
- an empty run is an explicit failure rather than a vacuous pass, and it is decided BEFORE
  printing — a summary saying "passed" above a failure line is the same trap one line lower

Also drops an em-dash from the MCP import step's output: it renders as `?` on the Windows
console, which reads like a mojibake defect in the log when nothing is wrong. The test passes
either way; this only stops the log from carrying a false signal.

Verified in all three directions: normal run 8/8, fix reverted 4/8, no checks collected fails.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@bhyi4
bhyi4 merged commit bfa9f32 into main Aug 24, 2026
4 checks passed
@bhyi4
bhyi4 deleted the fix/contract-test-denominator branch August 24, 2026 20:49
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