Skip to content

Commit e9b59bf

Browse files
committed
test(release): invert the assertion that encoded the tag-stripping defect (#569)
This test computed the strip-cleaned form of the composed message and asserted the tag body equalled it. That was the right call while the defect stood - it documented shipped behaviour instead of papering over it - and it left instructions for this exact moment: if the body ever DOES contain its heading, the invocation picked up --cleanup=verbatim and the assertion should be relaxed deliberately rather than chased as a regression. Now inverted: the composed message must reach the tag object byte-for-byte, with the version heading and each group heading asserted individually so a regression names what was lost. Added a negative control. Every assertion above would pass vacuously on a message containing no `#` lines, since strip and verbatim agree on such a message - the fix would be untested and the suite would still be green. Requiring the two forms to differ proves the fixture exercises the bytes the defect destroys. That also keeps _git_strip_cleanup load-bearing rather than leaving it dead behind the inversion. Verified the assertion discriminates: it passes on a verbatim body and fails on a default-cleanup body. CHANGELOG: covered by the 2.11.0 Fixed entry on tag-message stripping
1 parent fd3d8d6 commit e9b59bf

1 file changed

Lines changed: 49 additions & 19 deletions

File tree

‎.github/scripts/test_consumer_smoke.py‎

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,33 +2118,63 @@ def test_the_real_annotated_tag_carries_the_composed_message(self):
21182118
# FILE, never against the tag object actually created) never
21192119
# observe it. `RealHistoryTagStrippingEvidenceTest` below confirms
21202120
# this has ALREADY happened to this repo's own real, published
2121-
# `v2.8.13` tag. This is not fixed here -- fixing the skill's `git
2122-
# tag` invocation is out of this test's scope and belongs to
2123-
# whichever task takes up T-41x or a new issue; this assertion
2124-
# documents the ACTUAL, currently-shipping behavior rather than
2125-
# silently "fixing" the extracted invocation to make the test pass.
2121+
# `v2.8.13` tag.
2122+
#
2123+
# INVERTED 2026-07-31 (run-4 adversarial review; issue #569). This
2124+
# assertion used to ENCODE the defect: it computed
2125+
# `_git_strip_cleanup(message)` and asserted the tag body equalled
2126+
# that mangled form -- documenting shipped behaviour rather than
2127+
# papering over it, which was the right call while the defect
2128+
# stood. It also left instructions for this exact moment: "if this
2129+
# now FAILS because the tag body DOES contain its heading, the
2130+
# invocation picked up `--cleanup=verbatim` and the defect was
2131+
# FIXED -- relax this assertion deliberately rather than treating a
2132+
# red run as a regression to chase." That is what happened; this is
2133+
# that deliberate inversion.
2134+
#
2135+
# It now asserts the OPPOSITE: the composed message must reach the
2136+
# tag object byte-for-byte, headings intact. A test asserting a
2137+
# stripped expectation cannot distinguish a fixed lane from a
2138+
# broken one -- it passes in precisely the world the fix exists to
2139+
# end.
21262140
tag = self.result["tag_name"]
21272141
obj_type = _git(["cat-file", "-t", tag], self.lane.consumer_root).stdout.strip()
21282142
self.assertEqual(obj_type, "tag")
21292143
raw = _git(["cat-file", "-p", tag], self.lane.consumer_root).stdout
21302144
# The tag object's own header lines (object/type/tag/tagger) precede
21312145
# a blank line, after which the message body begins verbatim.
21322146
_, _, body = raw.partition("\n\n")
2133-
stripped_expectation = _git_strip_cleanup(self.result["message"])
2134-
self.assertEqual(body.rstrip("\n"), stripped_expectation.rstrip("\n"))
2135-
# The composed message's OWN heading survives in-memory (the
2136-
# pre-tag guards run against it) but is genuinely gone from what
2137-
# got tagged -- the concrete gap between "checked" and "shipped".
2147+
self.assertEqual(
2148+
body.rstrip("\n"), self.result["message"].rstrip("\n"),
2149+
"the composed message must reach the tag object unmodified; a "
2150+
"difference here means `--cleanup=verbatim` was dropped from "
2151+
"the skill's `git tag` invocation and Markdown headings are "
2152+
"being stripped again (issue #569)")
2153+
# The exact bytes the default cleanup mode destroys, asserted
2154+
# individually so a regression names what was lost instead of
2155+
# printing a whole-body diff.
21382156
self.assertIn(f"## [{self.result['next_version']}]", self.result["message"])
2139-
self.assertNotIn(
2140-
"## [", body,
2141-
"if this now FAILS because the tag body DOES contain its "
2142-
"heading, that means the skill's `git tag -a` invocation picked "
2143-
"up `--cleanup=verbatim` (or equivalent) and the stripping "
2144-
"defect this test documents was FIXED -- re-triage the "
2145-
"[NEEDS-TRIAGE] finding above and relax this assertion "
2146-
"deliberately, rather than treating a red run here as a "
2147-
"regression to chase")
2157+
self.assertIn(
2158+
f"## [{self.result['next_version']}]", body,
2159+
"the version heading is gone from the tag object -- #569 is back")
2160+
for heading in ("### Added", "### Fixed"):
2161+
if heading in self.result["message"]:
2162+
self.assertIn(
2163+
heading, body,
2164+
f"{heading!r} is gone from the tag object -- #569 is back")
2165+
# Negative control. Everything above would pass VACUOUSLY if the
2166+
# composed message happened to contain no `#` lines at all: strip
2167+
# and verbatim cleanup agree on such a message, so the assertions
2168+
# would hold no matter which mode the lane used, and the fix would
2169+
# be untested. Requiring the two forms to DIFFER proves this
2170+
# fixture actually exercises the bytes the defect destroys.
2171+
self.assertNotEqual(
2172+
_git_strip_cleanup(self.result["message"]).rstrip("\n"),
2173+
self.result["message"].rstrip("\n"),
2174+
"the composed message contains nothing git's default cleanup "
2175+
"would strip, so the assertions above cannot distinguish "
2176+
"`--cleanup=verbatim` from the default -- the fixture stopped "
2177+
"covering #569 and needs a message with Markdown headings")
21482178

21492179

21502180
class LaneDriverUnitTest(unittest.TestCase):

0 commit comments

Comments
 (0)