fix(verify): normalize laptop and monitor structural scores - #101
Merged
Merged
Conversation
Normalize the available structural, host and provenance weights while preserving structural hard failures and the no-green policy. Closes #98 Refs GetTechAPI/TechAPI#297
4 tasks
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.
Valid laptop and monitor imports fell into red after #95 because categories without domain rules had only 65 available points but still used the 100-point scale. Normalize the assessed weights to 0–100, retain zero consistency credit, explicitly prohibit green until domain rules exist, and preserve structural hard failures.
Reproduction with
TECHAPI_DATA_DIR=C:/Users/29/Desktop/TechAPI/data(TechAPI e6050e6519698b7dcb40d2edc5930485dad1a9f3; engine baseline 78d2080):app.validate.validate()returned zero errors. No broken laptop or monitor records were found. All required fields are top-level, every filename matches its record slug, and all records carry a base model. Laptops use 1951 nested variant paths plus 44 accepted flat paths; monitors use 882 nested paths. The structural check therefore needs no relaxation.Laptop original scores: 965 at 35 (unknown host), 923 at 38 (tier 3), 46 at 58 (tier 1), and 61 at 62 (tier 1). All 882 monitors originally scored 38 (tier 3). Their red bands came from unavailable consistency credit rather than structural failure.
After counts come from a local
python -m app.verify statusrun with the same data root and a temporary output path. No TechAPI data changes are included. Software and website share the fallback branch and receive the same normalization; categories with domain rules are unchanged. Subscores retain their original weights, while the overall fallback score is normalized.Validation:
python -m pytest tests -q --basetemp=C:/Users/29/AppData/Local/Temp/techengine-98-fixed-testspython -m mypy apppython -m ruff check app testsRefs #98
Refs GetTechAPI/TechAPI#297