fix(validation): classify every level, and cite the coverage rule - #131
Open
simontaurus wants to merge 1 commit into
Open
fix(validation): classify every level, and cite the coverage rule#131simontaurus wants to merge 1 commit into
simontaurus wants to merge 1 commit into
Conversation
- severity() treated anything not a MUST as advice, so a level added upstream was silently demoted; unrecognised levels now raise - _ADVICE_LEVELS is listed rather than inferred, and a test ties both sets to the level enum of every tracked version - context.coverage cites OOLD-SCH-21d7, so its warning is the catalogue's severity rather than one chosen in code
Contributor
Release previewMerging this PR would release v0.17.1 (current: Changelog preview (truncated)## v0.17.1 (2026-08-23)
### Bug Fixes
- **validation**: Classify every level, and cite the coverage rule
([`ceab451`](https://github.com/OO-LD/oold-python/commit/ceab451d408a10d822d7b2c4da1c785787339bb7))
### Chores
- **meta**: Vendor oold-schema v1.0.0-rc.3
([`2485f98`](https://github.com/OO-LD/oold-python/commit/2485f98c6b5edb4a0af580f4c5be54f98e3a794a))
Preview via python-semantic-release and conventional commits. |
Contributor
📊 Benchmark ResultsClick to see benchmark comparisonThreshold: 1.3x (30% slower triggers a regression warning) Note: Benchmarks are informational only and won't fail the build. 💡 Tip: Download the |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
The two items https://github.com/OO-LD/oold-schema/releases/tag/v1.0.0-rc.3 unblocked. Closes the remaining half of #120 and item 4 of #125.
severity() no longer guesses
return FAIL if rule.level in _MUST_LEVELS else WARNtreated every unrecognised level as advice. That is silent and wrong in one direction: a level the specification adds later is demoted to a warning without anyone noticing.Not hypothetical -
NOT RECOMMENDEDentered the vocabulary in v1.0.0-rc.3, and the old reading would have absorbed it without a word. It happens to be advice, so the outcome was right by luck rather than by construction._ADVICE_LEVELSis now listed rather than inferred, and an unrecognised level raises, naming the rule and the level.test_the_severity_split_covers_the_whole_level_vocabularyties both sets to thelevelenum of every tracked version, so a vocabulary that grows upstream fails at vendoring time rather than at runtime, and asserts the two sets are disjoint and that it checked something.Raising is the right default here precisely because neither fallback is safe: as advice it demotes a requirement, as a failure it invents one.
context.coverage cites its rule
OOLD-SCH-21d7(SHOULD - a schema should offer at least one complete mapping) arrived in rc.3, so the check no longer needs a severity chosen in code.WARNnow follows from the catalogue'slevel, the way every other rule-backed finding does, with--strictas the opt-in override.Citing it is additive rather than gating, checked against both versions:
An older meta version keeps the warning and simply cites nothing, rather than skipping the check.
Verified
555 tests pass,
make checkexits 0.