From adf3299192116a7b2472ed8762e401d82b0fadf3 Mon Sep 17 00:00:00 2001 From: cluade-reviewer-andresmgsl Date: Sun, 2 Aug 2026 19:16:48 +0000 Subject: [PATCH] test(forge): assert the distinguishing text, not a surviving substring @codex-reviewer-andresmgsl (#4727) and @grok-reviewer-andresmgsl (#4734): "...and the refusal names both totals" searched only for "4", so it stayed green if the later total vanished from the message. A case named "names BOTH" must fail when one goes. Now asserts "4 then 9". Auditing this file's siblings for the same shape found a second, older instance: "the refusal names the client" searched for "gh", which also occurs in the explanatory prose ("gh speaks GitHub's /api/v3..."), so it would have passed even if the client name never reached the message. Now asserts "the 'gh' client cannot speak it". Both verified by mutation: removing the second total, and removing the interpolated client name, each red exactly their own case. Refs #188 --- test/forge-backends.test.sh | 6 +++++- test/forge.test.sh | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/forge-backends.test.sh b/test/forge-backends.test.sh index b931563..8e29027 100644 --- a/test/forge-backends.test.sh +++ b/test/forge-backends.test.sh @@ -177,7 +177,11 @@ check "a negative total is refused" 1 "not a non-negative integer" \ fake_forge '4,9' '[{"number":1},{"number":2}]' '[{"number":3},{"number":4}]' check "a total that changes between pages is refused" 1 "changed between pages" \ forge_api --paginate 'repos/o/r/issues' --jq '.[].number' -check "...and the refusal names both totals" 1 "4" \ +# The distinguishing text, not a substring that survives losing half the +# message: "4" alone stayed green if the later total vanished, which is what +# @codex-reviewer-andresmgsl (#4727) and @grok-reviewer-andresmgsl (#4734) +# both caught. A test named "names BOTH totals" must fail when one goes. +check "...and the refusal names both totals" 1 "4 then 9" \ forge_api --paginate 'repos/o/r/issues' --jq '.[].number' # A 200 whose body is not a collection. `length` on a non-array counted 0, diff --git a/test/forge.test.sh b/test/forge.test.sh index bc73f1b..34b09e5 100644 --- a/test/forge.test.sh +++ b/test/forge.test.sh @@ -102,7 +102,12 @@ check "forgejo + gh-only client refuses" 1 "cannot speak" \ preflight_in CEREMONY_FORGE=forgejo CEREMONY_FORGE_CLIENT=gh check "the refusal names the forge" 1 "forgejo" \ preflight_in CEREMONY_FORGE=forgejo CEREMONY_FORGE_CLIENT=gh -check "the refusal names the client" 1 "gh" \ +# The interpolated client, not the bare string "gh" — which also appears in +# the explanatory prose ("gh speaks GitHub's /api/v3…"), so the old assertion +# stayed green even if the client name never reached the message. Same class +# as the "names both totals" weakness the panel caught in the backend suite +# (#4727 / #4734); found by auditing this file for the same shape. +check "the refusal names the client" 1 "the 'gh' client cannot speak it" \ preflight_in CEREMONY_FORGE=forgejo CEREMONY_FORGE_CLIENT=gh # The refusal must be actionable, not merely loud: #188's whole cost was a # red check that told nobody what to do.