Repository navigation
Conversation
Fixes dotnet#7665 InterpretScore(NumericMetric) only marked a metric as failed when its value parsed to a double below the minimum passing score. A metric with no value at all, which is what happens when the judge's reply cannot be parsed, took the not-failed branch, and so did a value outside the scale the ratings cover. Both already carry an Inconclusive rating, so a pipeline that gates on Failed treated a metric that was never scored as a pass. Metrics with no value, and values outside the range the ratings cover, are now marked as failed. The BooleanMetric overload in the same file already behaved this way.
peterwald
approved these changes
Sep 3, 2026
peterwald
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for the contribution
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #7665
The quality evaluators interpret their own score through
InterpretScore(NumericMetric). That method only reached the failed branch when the metric's value parsed to a double below the minimum passing score of 4.0, so two cases fell through to not-failed:double.TryParseacceptsBoth already produced an Inconclusive rating, so the metric carried a rating saying nothing was concluded alongside a result that reads as a pass. A pipeline gating on
Failedtreats a metric that was never successfully scored as green.This marks both cases as failed. The
BooleanMetricoverload in the same file already fails closed on a null value, and the report UI already counts a metric with an error diagnostic as failed, which every parse failure produces. So the flag now agrees with what the rest of the library already treats as a failure.On the compatibility guidance in CONTRIBUTING: this does change observable behavior. A run that previously reported no failures can now report one, in exactly the cases where the judge did not return a usable score. Values inside the scale are unaffected, including the 4.0 boundary and the existing reason text for scores below it.
The same shape exists in
InterpretContentSafetyScoreandInterpretContentHarmScorein the Safety package, and in the NLP package'sScoreInterpretationExtensions. I left those alone since the issue is scoped to Quality, and can follow up if you want them consistent.Verified locally with the pinned SDK on net10.0, net9.0, net8.0 and net472. With the fix reverted and the new tests present, the test project fails 3 of 173; with the fix applied, 174 of 174 pass on every target.
Microsoft Reviewers: Open in CodeFlow