Repository navigation
Draw only valid node prose in the G5a A4 property test - #1160
Merged
Merged
Conversation
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 <noreply@anthropic.com>
Contributor
Author
|
Merged by the NZ hub (session local_e407a527) at 136c068 with --merge. Gates: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes an intermittent engine-free failure that #1159 (G5a) brought to main.
test_a4_description_and_citation_change_no_key(packages/microcosm-build/tests/engine_free/shared/test_transport_population_kernels.py) drew its prose fromst.text(alphabet="abcdefghijklmnopqrstuvwxyz .", max_size=35). That strategy can produce a whitespace-only string such as" ", andgraph/decl.py's_descriptioncorrectly refuses it: a description "must be empty or contain non-whitespace text". So the test failed whenever Hypothesis drew one. Two of six local runs of the file at main failed this way, each with the falsifying caseprose=' '. The engine-free job runs this file on every microcosm PR.The fix maps the strategy through
str.strip. Its output is either empty or contains a non-whitespace character, which is exactly whatdecl.pyaccepts. The property under test is unchanged: editing a node's description or citation moves no key and no artifact byte.Invariant. Every generated prose value is a valid
Node.description. This holds by construction, becausestr.strip()never returns a non-empty whitespace-only string.Tests. The A4 test passed 8 of 8 runs,
test_transport_population_kernels.pypassed 27, and ruff check and format pass.The NZ hub's G6 PR fixes the same latent pattern in its new composed-graph test.
🤖 Generated with Claude Code