From 136c068d7ccb301e8357629b7c10bc72c57d200d Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 9 Oct 2026 05:40:28 -0400 Subject: [PATCH] Draw only valid node prose in the G5a A4 property test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_a4_description_and_citation_change_no_key drew prose from st.text(alphabet="a…z .", max_size=35), which can produce a whitespace-only string such as " ". graph/decl.py's _description rightly refuses that ("must be empty or contain non-whitespace text"), so the test failed whenever Hypothesis drew it: 2 of 6 local runs of the file at main, each with the falsifying case prose=' '. That makes the engine-free job flaky for every microcosm PR. Map the strategy through str.strip: the result is empty or contains a non-whitespace character, which is exactly what decl.py accepts, and the property (editing description/citation moves no key and no artifact byte) is unchanged. tests: the A4 test 8/8 runs passed; test_transport_population_kernels.py 27 passed; ruff check and format pass. Co-Authored-By: Claude Opus 5.5 --- .../engine_free/shared/test_transport_population_kernels.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/microcosm-build/tests/engine_free/shared/test_transport_population_kernels.py b/packages/microcosm-build/tests/engine_free/shared/test_transport_population_kernels.py index 5f3e9f5e12..08d7b0f52a 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_transport_population_kernels.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_transport_population_kernels.py @@ -214,7 +214,11 @@ def test_a1_a2_d2_create_contracts_on_a_synthetic_graph(tmp_path, mass): @PROPERTY @example(prose="Edited prose and citations.") -@given(prose=st.text(alphabet="abcdefghijklmnopqrstuvwxyz .", max_size=35)) +# Stripped: a node description must be empty or carry non-whitespace text +# (graph/decl.py), so a whitespace-only draw such as " " is not valid prose. +@given( + prose=st.text(alphabet="abcdefghijklmnopqrstuvwxyz .", max_size=35).map(str.strip) +) def test_a4_description_and_citation_change_no_key(tmp_path, prose): with TemporaryDirectory(dir=tmp_path) as temporary: root = Path(temporary)