fix(scenario): warn when selected attack techniques have no registered factory - #2466
Open
fei (feiiiiii5) wants to merge 1 commit into
Open
fix(scenario): warn when selected attack techniques have no registered factory#2466fei (feiiiiii5) wants to merge 1 commit into
fei (feiiiiii5) wants to merge 1 commit into
Conversation
…d factory resolve_technique_factories silently dropped techniques whose factory was not registered, so a typo or an unregistered custom technique shrank the run without any signal. Emit one warning naming the missing technique(s) in selection order (deduplicated), and update the docstring accordingly. Fixes microsoft#2461
This was referenced Aug 22, 2026
Open
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.
Description
resolve_technique_factories()inpyrit/scenario/core/matrix_atomic_attack_builder.pysilently dropped selected techniques whose factory is not registered — the docstring even documented the behavior as "silently dropped". When a scenario (or a user ofextra_factories) selects a technique that was never registered, e.g. due to a typo or a custom technique added under a different name, the run quietly proceeds with fewer attacks and there is no signal anywhere that selections were discarded.This PR emits a single warning naming every missing technique, then proceeds with the remaining ones as before:
Design notes:
Fixes #2461
Tests
Added three regression tests to
TestResolveTechniqueFactories:All 35 tests in
tests/unit/scenario/core/test_matrix_atomic_attack_builder.pypass locally (73 failed / 569 passedelsewhere intests/unit/scenario/is identical to the pre-change baseline on this machine — those failures are environment-only, unrelated modules). Ruff check + format pass on both touched files.