Skip to content

MAINT: extract attack factory converter configuration composition - #2799

Merged
Roman Lutz (romanlutz) merged 10 commits into
microsoft:mainfrom
ahcrm-core:fix/2767-converter-config-composition
Sep 26, 2026
Merged

Roman Lutz (romanlutz) merged 10 commits into
microsoft:mainfrom
ahcrm-core:fix/2767-converter-config-composition

Conversation

@ahcrm-core

@ahcrm-core arafat k Elharoun (ahcrm-core) commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Addresses #2767.

This PR extracts the existing converter-configuration composition logic from AttackTechniqueFactory.create() into a small private typed helper.

It preserves the existing distinction between full configuration replacement and additive request-converter composition while keeping the public API and existing factory behavior unchanged.

Specifically, this change:

  • preserves full override semantics, including an explicitly empty AttackConverterConfig;
  • preserves request-converter ordering when additional converters are supplied;
  • preserves the response-converter pipeline from the effective base configuration;
  • avoids mutation of factory-stored configuration and caller-supplied converter lists;
  • leaves the existing supports_additional_request_converters capability validation and constructor checks unchanged;
  • keeps adversarial prompt assembly related to FEAT: add benchmark-owned adversarial prompts #2494 outside the scope of this change.

No public signatures or component identity are intentionally changed.

Tests and Documentation

Focused factory tests cover:

  • no override and no extra converters;
  • full configuration replacement;
  • explicitly empty override configuration;
  • additive request converters with and without an override;
  • preservation of request ordering and response converters;
  • repeated creation without converter accumulation or input mutation;
  • delegation of converter composition to the extracted private helper.

The focused tests were introduced before the implementation change. After correcting one test-only assertion issue found during the initial run, the clean First-Red state contained one expected failure showing that AttackTechniqueFactory.create() had not yet delegated composition to the private helper.

The implementation was then changed without weakening that test.

Post-repair unit-test coverage passed across the relevant tested configurations. One recorded matrix run completed with:

  • 19,219 passed
  • 125 skipped
  • 0 unit-test failures

No documentation changes are required because this is an internal refactor that preserves the public API and existing behavior.

@ahcrm-core

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Sep 26, 2026
Merged via the queue into microsoft:main with commit 49e5e65 Sep 26, 2026
49 checks passed
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.

2 participants