Repository navigation
fix(run): read frontmatter without YAML 1.1 booleans or non-text keys (SR-2f) - #99
Merged
Merged
Conversation
yaml.safe_load read a key such as `no` as False, so the frontmatter
round-trip property failed on meta {'no': 'A'}. Load with a SafeLoader
subclass whose mapping keys stay the text written and whose booleans are
only true/false, so yes/no/on/off/y/n stay text as keys and values.
Pin one @example per kind in tests/test_properties.py.
Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
jothimani-rajendran
marked this pull request as ready for review
October 25, 2026 14:12
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.
Summary
yaml.safe_loadfollows YAML 1.1, so a frontmatter keyno(alsoyes/on/off/y/n) was read as a bool, andtrue/false/nullkeys as bool/None. The round-trip property failed onmeta={'no': 'A'}.src/context_report/run/evalcases.py): aSafeLoadersubclass whose mapping keys stay the text written and whose booleans are onlytrue/false, so the 1.1 words stay text as keys and values.tests/test_properties.py):@exampleper kind (no,yes,on,off,y/n,true/false,nullas keys; the 1.1 words as values). The property is unchanged except it now also compares values (edge spaces stripped, as YAML plain scalars do).sr-2c-hardening): that branch does not touch these files;git merge-treeof the two heads reports no conflicts.Value
true/false/nullstay YAML 1.2 bool/null by design.