Skip to content

[BREAKING] [FIX]: Apply the _async naming convention - #159

Merged
Spencer Schoenberg (spencrr) merged 2 commits into
microsoft:mainfrom
spencrr:dev/spencrr/linter-tool-v2-fixes
Aug 14, 2026
Merged

[BREAKING] [FIX]: Apply the _async naming convention#159
Spencer Schoenberg (spencrr) merged 2 commits into
microsoft:mainfrom
spencrr:dev/spencrr/linter-tool-v2-fixes

Conversation

@spencrr

@spencrr Spencer Schoenberg (spencrr) commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Description

Second commit of the #22 follow-up. Clears the .flake8 baseline added in #158 (merge that first), so RMP001 is enforced everywhere with no exemptions.

147 renames: 8 in rampart/, 139 async test functions, plus call sites, tests and docs.

Old New
InjectionHandle.wait_until_ready wait_until_ready_async
ExecutionEventHandler.on_event on_event_async
sleep_until_ready sleep_until_ready_async
BaseExecution._fire _fire_async
_send_via_normalizer _send_via_normalizer_async
_send_and_parse _send_and_parse_async

Breaking changes

InjectionHandle.wait_until_ready and ExecutionEventHandler.on_event are public. External surfaces and handlers must rename to *_async. Handles that don't now raise a clear TypeError from Attacks.xpia instead of failing obscurely.

Checklist

  • pre-commit run --all-files passes
  • Tests added or updated for changes -- 20 test files updated for renamed symbols and test names
  • Documentation updated -- core-protocols.md, xpia.md, extending-rampart.md, authoring-tests.md, unit-tests-standards.instructions.md

@spencrr
Spencer Schoenberg (spencrr) requested a review from a team August 8, 2026 01:31
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@spencrr
Spencer Schoenberg (spencrr) force-pushed the dev/spencrr/linter-tool-v2-fixes branch 2 times, most recently from 5b4a1f7 to bbc0295 Compare August 8, 2026 01:51
@nina-msft

Copy link
Copy Markdown
Contributor

Took a cursory glance - this change looks good once #158 is merged and this PR adopts those changes :-) Will hold off on approval until then!

Clears the .flake8 baseline added in the previous commit, so RMP001 is now
enforced everywhere with no exemptions.

Renames 8 async functions in rampart/ and 139 async test functions, plus all
call sites, tests and docs. The test standards already required the suffix on
async test names and 99 tests already followed it; this makes the rest
consistent. pytest discovers tests by the test_ prefix, so the suffix does not
affect collection and the test count is unchanged.

InjectionHandle is a @runtime_checkable Protocol, so renaming wait_until_ready
changes what isinstance() accepts. Attacks.xpia had an unguarded else branch
that treated a non-conforming handle as a list, producing an unrelated
"not iterable" TypeError deep in execution instead of a clear error at the
boundary. That branch is now guarded and covered by tests.
Comment thread docs/attacks/xpia.md Outdated
@nina-msft

Copy link
Copy Markdown
Contributor

Since this has breaking changes - do we have a policy to write that anywhere in the title of the PR like PyRIT does?

@spencrr Spencer Schoenberg (spencrr) changed the title [FIX]: Apply the _async naming convention [BREAKING] [FIX]: Apply the _async naming convention Aug 14, 2026

@nina-msft Nina Chikanov (nina-msft) 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.

great work enforcing this :)

@spencrr
Spencer Schoenberg (spencrr) merged commit 7ae98a6 into microsoft:main Aug 14, 2026
14 checks passed
@spencrr
Spencer Schoenberg (spencrr) deleted the dev/spencrr/linter-tool-v2-fixes branch August 14, 2026 19:17
Mahdi Alhakim (mahdi-al-hakim) added a commit to mahdi-al-hakim/RAMPART that referenced this pull request Aug 15, 2026
Rebased onto main, which now enforces RMP001 from microsoft#158 and microsoft#159. The tests
this PR adds were written before that rule landed, so they are renamed to
match it. Seven names are also shortened to stay inside the line limit.
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