Repository navigation
fix: load spec YAML as JSON-compatible scalars and reject epoch release versions - #30
Merged
Merged
Conversation
PyYAML's YAML 1.1 loader turned unquoted ISO dates into datetime objects, so fromisoformat crashed, and treated yes/no/on/off as booleans, so an asset id such as NO or created_by no never reached validation as text. Co-authored-by: quantum-like <quantum-like@users.noreply.github.com>
version_failure accepted PEP 440 epochs such as 1!1.2.3 even though a stable release must be a normalized X.Y.Z or X.Y.Z.postN version. Co-authored-by: quantum-like <quantum-like@users.noreply.github.com>
stefan-jansen
approved these changes
Oct 16, 2026
stefan-jansen
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the YAML resolver isolation, public contract deserialization, and epoch rejection. Reproduced both added regressions against main 701bde6 in an isolated source tree: both failed for the reported defects; both pass with the correction. Full suite: 424 passed with 100% branch coverage on Python 3.12, 3.13, and 3.14. Ruff lint/format, ty, wheel/sdist build and twine checks passed. Latest head only adds landed contribution-policy documentation to satisfy strict branch freshness. Merge remains conditional on current-head hosted checks. AI assistance: Codex performed this source review and verification.
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.
Owning issue
Closes #29
Outcome
2 correctness fixes, one commit each, each with a focused test:
read_spec_payloadloaded YAML with PyYAML's YAML 1.1 rules: unquoted ISO dates becamedatetimeobjects (andfromisoformatraisedTypeError), and unquotedyes/no/on/offbecame booleans, so an asset idNOdid not stay text andcreated_by: nowas saved as"False". Spec YAML now keeps JSON-compatible scalars:true,false,nulland numbers stay typed; dates and the YAML 1.1 bool aliases stay strings. Test:tests/test_spec_io.py::test_read_spec_payload_keeps_json_compatible_yaml_scalars. (457b9fd)1!1.2.3as a stableX.Y.Zversion. Epochs are now rejected. Test:1!1.2.3added totests/test_release_pipeline.py::test_release_preflight_rejects_nonstable_versions. (b127683)Compatibility
Spec files that relied on unquoted dates or YAML 1.1 bool aliases now load them as strings (as JSON would).
Verification
mainand passes with its fix)ruff format --checkis clean on the changed files andruff checkreports nothing new in them versusmain, but I did not run the full pre-commit suite)typasses (not run on this branch)pytest: 382 passed before, 384 passed after; coverage stays at 100%.Documentation and release
No documentation changes. The behavior changes above may be worth a line in the next patch-release notes.
Amir