Skip to content

MAINT: Clear transparency_attack_converter from the keyword-only baseline - #4464

Open
SERAG AHMED (seragAhmed) wants to merge 2 commits into
microsoft:mainfrom
seragAhmed:maint/keyword-only-transparency-attack-converter
Open

SERAG AHMED (seragAhmed) wants to merge 2 commits into
microsoft:mainfrom
seragAhmed:maint/keyword-only-transparency-attack-converter

Conversation

@seragAhmed

Copy link
Copy Markdown
Contributor

Description

Relates to #4216. Removes pyrit.converter.transparency_attack_converter from the keyword-only baseline by making the second array parameter of its three private helpers keyword-only:

  • _compute_mse_loss(blended_image, *, target_tensor)
  • _create_blended_image(attack_image, *, alpha)
  • _save_blended_image_async(attack_image, *, alpha)

Their only callers are in this module and its unit tests; nothing overrides them or passes them as callbacks. The callers and tests are updated, a test checks that positional calls are rejected, and the three baseline entries are removed. No behaviour or public API change.

🤖 Generated with Claude Code

…line

Relates to microsoft#4216. Make the second array parameter of the three private
TransparencyAttackConverter helpers keyword-only:

- _compute_mse_loss(blended_image, *, target_tensor)
- _create_blended_image(attack_image, *, alpha)
- _save_blended_image_async(attack_image, *, alpha)

Their only callers are in this module and in
tests/unit/converter/test_transparency_attack_converter.py; nothing
overrides them or passes them as callbacks. Update the callers and tests,
add a test that positional calls are rejected, and remove the three
baseline entries. No behaviour or public API changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 05:43

Copilot AI 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.

🟡 Changes recommended

The new test needs the required _async name suffix, a str annotation for sample_benign_image, and a None return annotation.

1 open issue
What changed in this PR

This PR advances #4216 by migrating three private TransparencyAttackConverter helpers to keyword-only second arguments, without changing conversion behavior or the public API.

Changes:

  • Update helper signatures and internal callers to use explicit keywords.
  • Update unit tests and add coverage rejecting positional second arguments.
  • Remove the three migrated helpers from the keyword-only baseline.
File Description
tests/​unit/​converter/​test_transparency_attack_converter.py Updates calls and tests positional-argument rejection.
pyrit/​converter/​transparency_attack_converter.py Makes second helper arguments keyword-only and updates callers.
build_scripts/​keyword_only_baseline.txt Removes the three migrated helper entries.

Review effort: Balanced

mock_factory.assert_called_once_with(category="prompt-memory-entries", data_type="image_path")
mock_serializer.save_b64_image_async.assert_called_once()

async def test_blending_helpers_reject_positional_second_argument(self, sample_benign_image):

This branch has not been deployed

No deployments
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