Repository navigation
FIX: use the canonical score-to-outcome mapping when a human score is removed - #3182
Merged
Roman Lutz (romanlutz) merged 4 commits intoOct 14, 2026
Conversation
… removed remove_human_score_async compared score_value against the literal string true, so a float_scale automated score like 0.9 was stored as FAILURE and an undetermined score could never come back as UNDETERMINED. Route the recompute through attack_outcome_from_score, the same contract every attack strategy uses. Fixes microsoft#3181 Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Roman Lutz (romanlutz)
approved these changes
Oct 14, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 793a90d7-1cb3-4545-a760-4b5209c58e87
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 793a90d7-1cb3-4545-a760-4b5209c58e87
The canonical helper already handles UndeterminedScoreError. Remove the unreachable duplicate handler so the PR meets the required changed-line coverage threshold without mocking an impossible error path. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 793a90d7-1cb3-4545-a760-4b5209c58e87
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.
Description
Fixes #3181
remove_human_score_asyncrecomputed the outcome withscore_value.casefold() == "true", which ignores the score type. A float_scale automated score of 0.9 became FAILURE when the human override was removed, and an undetermined score could not come back as UNDETERMINED. The recompute now goes throughattack_outcome_from_score, the same mapping every attack strategy uses, so the endpoint can never disagree with the executor.Tests and Documentation
Added a parametrized test covering float_scale 0.9 and 0.0 plus the existing true_false cases, and a test for an undetermined automated score. The float 0.9 case fails on main and passes with the change. Full
tests/unit/backend/test_attack_service.pysuite passes (190 tests).No documentation change needed, so I did not run JupyText.