Skip to content

MAINT: Remove the multi-label true/false scorer family (revert #3676) - #4791

Open
Richard Lundeen (richlundeen) wants to merge 2 commits into
microsoft:mainfrom
richlundeen:remove-multi-label-true-false-scorer
Open

Richard Lundeen (richlundeen) wants to merge 2 commits into
microsoft:mainfrom
richlundeen:remove-multi-label-true-false-scorer

Conversation

@richlundeen

@richlundeen Richard Lundeen (richlundeen) commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Remove MultiLabelTrueFalseScorer, MessageMultiLabelTrueFalseScorer, and TrueFalseScoreSelector, added in #3676, and keep every later change to the files it touched.

Why:

  • No scorer on main uses the family. The WildGuard migration it was built for never happened.
  • It declares true/false results but cannot be used where a true/false scorer is accepted. Attacks need TrueFalseScoreSelector, ScorerEvaluator rejects it, and get_scorer_metrics returns None.
  • Float-scale scorers already return several categories from one call as one score per category (for example AzureContentFilterScorer), so the family is a second mechanism for the same thing.
  • It is in no release (git tag --contains 910e47ee3 is empty; the latest tag is v1.2.1), so it can be removed without a deprecation period.

Changes:

  • Delete the two modules, doc/code/scoring/multi_label_true_false.md and its doc/myst.yml entry, and tests/unit/score/test_multi_label_true_false_scorer.py.
  • Remove the pyrit.score exports, the guards in ScorerEvaluator and FloatScaleThresholdScorer, the framework.md mention, and the section in 1_true_false_scorers (.py and .ipynb).
  • Add a Scorers rule to framework.md so reviews catch this design: a TrueFalseScorer makes one decision, and a scorer with several results is a FloatScaleScorer that returns one score per category.
  • Remove the references that later PRs added: the selector in test_scorer_info.py, the multi-label case in test_scorer_stability.py, and a comment and docstring wording in scorer_stability.py.
  • Regenerate the scorer table in 0_scoring.ipynb from get_scorer_info(). This drops the TrueFalseScoreSelector row and adds the PresidioPiiScorer row that the saved output had been missing since FEAT: Add optional Presidio-based PII entity scorer #4573.
  • Keep tests/unit/memory/memory_interface/test_score_category_filter.py, which FEAT Preserve labeled true/false verdicts with explicit selection #3676 also added. It does not use the family. It covers get_scores_async(score_category=...) whole-element matching with special characters and the SQL Server bound OPENJSON condition, both of which predate FEAT Preserve labeled true/false verdicts with explicit selection #3676 and are still used.

Open PRs that use these APIs and will need an update:

…oft#3676)

Remove MultiLabelTrueFalseScorer, MessageMultiLabelTrueFalseScorer, and
TrueFalseScoreSelector with their docs page, exports, guards, notebook
section, and tests, keeping every later change to those files.

No scorer on main uses the family, it cannot be used where a true/false
scorer is accepted without the selector, and float-scale scorers already
return one score per category. It is in no release, so no deprecation is
needed.

Also drop the references later PRs added in test_scorer_info.py,
test_scorer_stability.py, and scorer_stability.py, and regenerate the
0_scoring scorer table, which adds the PresidioPiiScorer row it was
missing. Keep test_score_category_filter.py: it covers the pre-existing
score_category memory filter, not the family.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings December 2, 2026 02:05

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.

🟢 Approval recommended

No active review issues remain for the removal of the unused multi-label scorer family.

No open issues 🎉

What changed in this PR

Removes PyRIT’s unused, unreleased multi-label true/false scorer family introduced in #3676, preserving unrelated later changes and category-filter tests.

Changes:

  • Deletes the scorer family, selector, exports, and associated guards and tests.
  • Removes related documentation and navigation entries.
  • Refreshes the scorer table, removing the selector and adding the missing PresidioPiiScorer entry.
File Description
tests/​unit/​score/​test_scorer_stability.py Removes multi-label rejection test.
tests/​unit/​score/​test_scorer_info.py Removes selector catalog expectation.
tests/​unit/​score/​test_multi_label_true_false_scorer.py Deletes family-specific tests.
pyrit/​score/​true_false/​true_false_score_selector.py Deletes label selector.
pyrit/​score/​true_false/​multi_label_true_false_scorer.py Deletes multi-label scorer bases.
pyrit/​score/​true_false/​float_scale_threshold_scorer.py Removes obsolete import and guard.
pyrit/​score/​scorer_evaluation/​scorer_stability.py Updates docstring and removes obsolete comment.
pyrit/​score/​scorer_evaluation/​scorer_evaluator.py Removes multi-label evaluation guard.
pyrit/​score/​__init__.py Removes deleted APIs from exports.
doc/​myst.yml Removes deleted guide from navigation.
doc/​code/​scoring/​multi_label_true_false.md Deletes multi-label guide.
doc/​code/​scoring/​1_true_false_scorers.py Removes label-selection documentation.
doc/​code/​scoring/​1_true_false_scorers.ipynb Removes matching notebook section.
doc/​code/​scoring/​0_scoring.ipynb Refreshes saved scorer table.
doc/​code/​framework.md Lists only retained scorer families.

Review effort: Balanced

Several results from one scorer, such as a classifier's harm categories,
belong in a float-scale scorer with one score per category, so reviews
can catch another multi-label true/false design.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

3 participants