MAINT: Refactoring scenario strategy selection#1627
Open
rlundeen2 wants to merge 6 commits intomicrosoft:mainfrom
Open
MAINT: Refactoring scenario strategy selection#1627rlundeen2 wants to merge 6 commits intomicrosoft:mainfrom
rlundeen2 wants to merge 6 commits intomicrosoft:mainfrom
Conversation
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.
ScenarioCompositeStrategywas an ad-hoc wrapper that conflated strategy selection with attack+converter composition, adding complexity without clear boundaries. This PR cleans that up.What changed:
ScenarioCompositeStrategy(removed_in="0.18.0" — extended window to give external callers time to migrate). The replacement isFoundryComposite, a typed dataclass that explicitly separates attack from converters.ScenarioStrategy:prepare_scenario_strategies,supports_composition, andvalidate_compositionwere only used by the deprecated composition path and are gone.RedTeamAgentconverts any legacyScenarioCompositeStrategyinputs toFoundryCompositeautomatically, so existing callers still work with a deprecation warning.FoundryComposite.__post_init__validation — catches misrouted strategies at construction time (e.g. a converter in the attack slot) with a clear error, rather than failing silently later.No behavioral change to existing scenarios. Passing
ScenarioCompositeStrategytoRedTeamAgentstill works and produces the same result, with a deprecation warning pointing toFoundryComposite.