Skip to content

FIX: use the canonical score-to-outcome mapping when a human score is removed - #3182

Merged
Roman Lutz (romanlutz) merged 4 commits into
microsoft:mainfrom
ManoharPaturi:fix/remove-human-score-outcome
Oct 14, 2026
Merged

Roman Lutz (romanlutz) merged 4 commits into
microsoft:mainfrom
ManoharPaturi:fix/remove-human-score-outcome

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

Description

Fixes #3181

remove_human_score_async recomputed the outcome with score_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 through attack_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.py suite passes (190 tests).

No documentation change needed, so I did not run JupyText.

… 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>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 15:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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
@romanlutz
Roman Lutz (romanlutz) merged commit 850dbdf into microsoft:main Oct 14, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Removing a human score maps float-scale automated scores to failure

3 participants