fix(validation): migrate P-006/P-007/P-008 severity ramp to target_api_status#381
Merged
hdamker merged 1 commit intoJul 21, 2026
Merged
Conversation
…i_status target_release_type governs release-plan rules, not the content severity ramp; target_api_status is the canonical field. Re-expressed on the anchor/demote convention, preserving each rule's existing behavior.
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.
What type of PR is this?
correction
What this PR does / why we need it:
Problem: P-006, P-007, and P-008 keyed their severity ramp on
target_release_type— the field that governs release-plan rules — instead oftarget_api_status(draft→alpha→rc→public), which is the canonical field for the per-status content ramp. They also expressed severity backwards compared to every other status-ramped rule in this file: starting athintand escalating upward, instead of anchoring on the final (public/stable) severity and only demoting for earlier statuses.Fix: Migrates the three rules onto
target_api_status:check-test-files-exist)check-test-file-version)check-test-directory-exists)Each rule's
conditional_levelis rewritten using the anchor convention already used elsewhere in this file (e.g. P-026/P-027):defaultis the rule's public/stable severity, andoverridesonly ever lower it for an earlier status or an initial (0.x) API — never raise it.No behavior change. For every existing API, the severity a rule reports today is exactly the severity it reported before this PR. A new test (
TestTestFileRulesStatusRamp) pins the full severity matrix per rule against the real rules file to confirm this.Which issue(s) this PR fixes:
No tooling issue — internal severity-model correction identified during the r3.4→r4.3 severity review.
Special notes for reviewers:
Added
TestTestFileRulesStatusRamptotest_postfilter_levels.py, pinning the full severity matrix per rule against the realpython-rules.yaml, mirroring the existingTestCompletenessRuleMaturityGrading(S-016/S-307) pattern.Test evidence:
python3 -m pytest validation/tests -q— 1180 passed; 3 pre-existing, unrelatedtest_yaml_parser_conformance.pyfailures (reproduce identically on an unmodified checkout).Changelog input
Additional documentation
This section can be blank.