From 0150523bb9dac4cc605b20be12306dfddb0c0f8c Mon Sep 17 00:00:00 2001 From: Patrick Buckley Date: Wed, 5 Aug 2026 00:18:55 -0700 Subject: [PATCH] test(session): pin the both-vocabulary title peel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The title lane's cosmetic peel walks the close-tag vocabularies in sequence, which review read as a double peel that could discard title text between a `` and a ``. It cannot: the remainder of the first cut begins after the last ``, so a `` still found in it is necessarily the later tag — the sequence is equivalent to one cut after whichever close occurs last (verified exhaustively over tag/text arrangements and 200k randomized fragment strings). The equivalence was unpinned, so both orderings join the variants table and the docstring records why the sequence is a single logical cut. --- tests/test_session.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/test_session.py b/tests/test_session.py index 6a202883..5eddd41f 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -1860,7 +1860,15 @@ class TestTitleRetry: """Reasoning reaches ``content`` in several shapes the title pass must survive: an opener-absent ``…`` (templates that pre-inject the opening tag), a paired ```` block, and a trailing - explanation after the title (only the first non-empty line is kept).""" + explanation after the title (only the first non-empty line is kept). + + The last two cases pin the BOTH-VOCABULARY shape in either order. + The peel walks the close-tag vocabularies in sequence, which is + equivalent to one cut after whichever close occurs last: the + remainder of the first cut begins after the last ````, so a + ```` still found in it is necessarily the later tag. + Title text after the last stray close always survives; only + reasoning between the tags is dropped.""" from turnstone.core.providers._protocol import ModelCapabilities cases = [ @@ -1870,6 +1878,14 @@ class TestTitleRetry: "Cluster Health Digest", ), ("Auth Layer Refactor\n\nThis title captures the request well.", "Auth Layer Refactor"), + ( + "weighingstill weighing\n\nRendezvous Routing", + "Rendezvous Routing", + ), + ( + "weighingstill weighing\n\nCluster Health Digest", + "Cluster Health Digest", + ), ] for content, expected in cases: session = _make_session()