Skip to content

MAINT Simplify attack result queries - #2321

Merged
romanlutz merged 3 commits into
microsoft:mainfrom
romanlutz:romanlutz-simplify-attack-result-queries
Aug 4, 2026
Merged

MAINT Simplify attack result queries#2321
romanlutz merged 3 commits into
microsoft:mainfrom
romanlutz:romanlutz-simplify-attack-result-queries

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Description

MemoryInterface.get_attack_results had accumulated filtering, batching, deduplication, and pagination branches in one large method. This refactors the implementation into a private immutable query object and focused condition-building helpers while preserving the existing public method signature as a compatibility wrapper.

The SQLite and Azure SQL backend hooks remain unchanged, as do filtering semantics, recency ordering, keyset pagination, deduplication, turn bounds, and batched ID lookups. The internal query type is intentionally private so this maintenance refactor does not expand PyRIT's public API.

Tests and Documentation

Added focused tests for immutable input snapshots, keyword-only construction, complete wrapper forwarding, and parity between the compatibility wrapper and internal query executor.

Validated the affected memory, backend, analytics, scenario, and executor suites, plus Ruff, ty, pre-commit hooks, and git diff --check. Documentation was not changed because public behavior and APIs are unchanged. JupyText was not applicable.

Copilot AI added 3 commits August 3, 2026 09:50
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 647cdf27-3786-40a2-918c-b88f784fbc6d
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 647cdf27-3786-40a2-918c-b88f784fbc6d

@varunj-msft varunj-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.

lgtm!

@varunj-msft varunj-msft self-assigned this Aug 4, 2026
@romanlutz
romanlutz added this pull request to the merge queue Aug 4, 2026
Merged via the queue into microsoft:main with commit 78efa6b Aug 4, 2026
54 checks passed
@romanlutz
romanlutz deleted the romanlutz-simplify-attack-result-queries branch August 4, 2026 21:47
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.

3 participants