Repository navigation
FEAT: Add DecisionOptionOrderConverter - #4311
hannahwestra25 merged 14 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies no active issues with the decision-option ordering converter change.
No open issues 🎉
What changed in this PR
Adds DecisionOptionOrderConverter to PyRIT’s converter framework as a focused step toward decision-model robustness testing in #3246, split from #3250.
Changes:
- Reverses or reproducibly shuffles choice options while preserving state, option definitions, and other question types.
- Exposes the converter through lazy package exports and adds usage documentation.
- Adds tests for validation, deterministic shuffling, registry resolution, and compatibility with
PromptNormalizerand a mocked decision SDK.
| File | Description |
|---|---|
tests/unit/converter/test_seeded_converter_determinism.py |
Includes the new converter in shared determinism tests. |
tests/unit/converter/test_decision_option_order_converter.py |
Tests reordering, validation, identifiers, and integration paths. |
pyrit/converter/decision_option_order_converter.py |
Implements reverse and shuffle modes for choice options. |
pyrit/converter/__init__.py |
Adds lazy export and static typing support. |
doc/code/converters/1_text_to_text_converters.py |
Adds a decision-request reordering example. |
doc/code/converters/1_text_to_text_converters.ipynb |
Adds the matching notebook example and saved output. |
doc/code/converters/0_converters.ipynb |
Includes the converter in the modality table. |
Review effort: Balanced
…k the redraw runs
|
hannahwestra25 the seed is fixed in bf4d31b, reply is under the thread. Ready for another look when you have time. |
|
hannahwestra25 merged main to fix the converter table conflict, no code changes since your check of the seed fix. Ready for another look when you have time. |
…n-order-converter # Conflicts: # doc/code/converters/0_converters.ipynb
…n-order-converter # Conflicts: # doc/code/converters/0_converters.ipynb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hannahwestra25
left a comment
There was a problem hiding this comment.
Thanks for contributing!
|
The three failed jobs are timing tests outside this PR: |
Related to #3246, part 2 of the split proposed in #3250.
Adds
DecisionOptionOrderConverter, which reverses or shuffles the options of eachchoicequestion in a decision request and leaves the state and other questions unchanged. Option order shouldn't change a decision, so a changed answer is a flip. The state converter from #3250 isn't included yet; I asked there whether it should become a general JSON-field converter.Tests: 38,981 passed, 30 skipped, 3 xfailed; lint and full type checks pass; diff coverage 100%. Tests cover seeded determinism, shuffles never returning the original order, the
PromptNormalizerpath, a converted request sent throughLiteLLMDecisionTargetto a mocked SDK, and registry resolution oforder.