Skip to content

MAINT: Adding existing scorers to new paradigm (phase 8) - #2899

Merged
Richard Lundeen (richlundeen) merged 13 commits into
microsoft:mainfrom
richlundeen:richlundeen-scorer-contract-proposal
Oct 8, 2026
Merged

Richard Lundeen (richlundeen) merged 13 commits into
microsoft:mainfrom
richlundeen:richlundeen-scorer-contract-proposal

Conversation

@richlundeen

Copy link
Copy Markdown
Contributor

Existing scorers need to use the shared evidence and expectation contract without keeping target-specific behavior in their base classes. This makes text, conversation, and target-backed scoring consistent while preserving concrete scorer constructors.

Implements Phase 8 of the scorer contract proposal.

Adds typed output matching and whole-conversation snapshots, and migrates existing target-backed scorers to explicit JudgmentRequest and TargetJudge composition. Unifies blocked-judge handling and preserves evidence links and score anchors across conversation entry paths. Updates regression coverage and scoring documentation, with all six scoring notebooks executed and their outputs retained.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread pyrit/score/scorer.py
Comment thread pyrit/score/true_false/self_ask_true_false_scorer.py
Preserve the upstream empty-target matching fix in the shared matcher.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep deprecated target validation through the generic and message-family bases without storing targets or creating judges. Cover hidden legacy hook rejection across migrated scorers and document required hook migration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread pyrit/score/conversation_scorer.py
@richlundeen Richard Lundeen (richlundeen) changed the title MAINT: Adding existing scorers to new paradigm MAINT: Adding existing scorers to new paradigm (phase 8) Oct 1, 2026
Preserve numeric response validation and separate conversation wrapper results from retained intermediate scores.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use get_chat_target() in shared scoring batches, image batches, and scorer evaluation. Cover delegated targets, direct targets, and target-free scorers with configured and unconfigured RPM limits.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve scorer, model export, and text matching conflicts. Preserve main's non-editable judge retry support and the scenario completion-order assertion fix; adapt regression tests to explicit judgment requests and async memory.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread doc/code/scoring/1_true_false_scorers.ipynb Outdated
Comment thread doc/code/scoring/2_float_scale_scorers.ipynb
Comment thread pyrit/models/score/text_matcher.py

@hannahwestra25 hannahwestra25 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.

looks good! some small nits + ghcp finding

Comment thread doc/code/scoring/1_true_false_scorers.py
Comment thread doc/code/framework.md Outdated

@jsong468 Justin Song (jsong468) 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.

some additional documentation nits but lgtm!

Preserve shared cancellation cleanup and validate n-gram sizes in the shared text matcher. Reject blank Regex criteria, document per-piece output matching, clarify conversation evidence handling, and retain main's notebook migration-output cleanup. Remove unrelated float-scale notebook output churn.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep analytics compatibility exports and move upstream matcher identifier parameters to pyrit.common.text_matching so substring scorers retain distinct behavioral identities.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merge origin/main at c8aa5bd without conflicts, preserving scorer contracts, task cancellation cleanup, and matcher identity. Reuse only the backend test helpers and failing conversation-editor test repair from richlundeen's microsoft#3015 (789802b). Wait for a terminal send state and drain tasks before mock and database teardown; retain all existing assertions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ebae5d0f-7b81-4426-afaf-4e884f12cca3
Merge origin/main at b2e9c78 without conflicts. Preserve scorer evidence persistence and lazy model exports alongside the new scenario result roles. Restore the locked Python and frontend environments and validate the merged state.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ebae5d0f-7b81-4426-afaf-4e884f12cca3
Keep main's AsyncGenerator annotation for the shared lifecycle helper now that the conversation-send reliability fix has landed. Preserve the same terminal-state wait and task cleanup behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ebae5d0f-7b81-4426-afaf-4e884f12cca3
@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Oct 8, 2026
Merged via the queue into microsoft:main with commit 6ddee3b Oct 8, 2026
51 checks passed
@richlundeen
Richard Lundeen (richlundeen) deleted the richlundeen-scorer-contract-proposal branch October 8, 2026 21:45
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.

5 participants