Skip to content

FEAT Add expandable paired outcome transition details - #3391

Merged
Roman Lutz (romanlutz) merged 8 commits into
microsoft:mainfrom
shashank03-dev:feat/paired-outcome-drilldown
Nov 10, 2026
Merged

Roman Lutz (romanlutz) merged 8 commits into
microsoft:mainfrom
shashank03-dev:feat/paired-outcome-drilldown

Conversation

@shashank03-dev

Copy link
Copy Markdown
Contributor

Description

Closes #3389, following merged #3337. Scenario run results show paired outcome counts, but users need to inspect the objectives and conversations behind each transition. Each transition can now be expanded and collapsed to load its matching pairs on demand.

  • Show each objective, logical seed, saved prompt pieces, baseline/attack outcomes, reasons, and timestamps. Conversation links use existing routes and retain Scenario context.
  • Reuse the aggregate backend pairing and compatibility checks, including latest top-level completions, exclusions, retries, and compound children. Child attempts never become extra observations.
  • For a compound completion without its own conversation, provide a clearly labelled child-conversation link while preserving the compound outcome. Prefer the last linked conversation matching the parent outcome; otherwise use the last linked conversation.
  • Load 25 pairs at a time (API maximum 100), in stable seed order, with validated cursors scoped to the run, selected groups, and transition. Seed digests keep cursors within the API bound even for long or Unicode IDs.
  • Handle loading, empty results, retryable failures, cancellation, selection changes, late responses, collapse/re-expansion, keyboard navigation, and narrow screens. Pagination restores focus to newly loaded pairs; mobile Retry controls meet the existing touch-target minimum.

No new dependencies or schema migrations.

Tests and Documentation

  • Full Python suite: 30,293 passed, 12 skipped (make unit-test).
  • Full frontend suite: 142 suites and 3,408 tests passed.
  • Focused analytics/API tests: 89 passed.
  • PairedOutcomes interaction tests: 20 passed, including Strict Mode cancellation, late responses, retries, pagination, multimodal prompts sharing a sequence, and compound conversation links.
  • Playwright: 6 passed, exercising the GUI → API → disposable real SQLite flow, both conversation routes, long seed IDs, 320px mobile layout (including wrapped error messages), keyboard pagination, and recovery from a real offline network failure.
  • ESLint, frontend and Python type checks, Ruff lint/format checks, production build, documentation structure validation, pre-commit hooks, and Git whitespace checks passed.

The existing two ScenarioDetail dataset-replacement tests queried the page before Fluent UI restored accessibility after cancelling Run preview. Their reopen action now waits for the accessible Launch scan button; modal production behavior is unchanged.

Updated doc/gui/0_gui.md with usage guidance and actual desktop/mobile screenshots. No notebooks or executable documentation examples changed; JupyText execution was not run. Existing build/dependency warnings remain (Vite chunk size/config compatibility and Pydantic field-name warnings).

Desktop

Expanded paired outcomes on desktop

Mobile

Focused capture of one expanded transition (272 × 452), without app-chrome overlap or blank space. Mobile metrics use two columns, transition labels retain room beside right-aligned counts, and detail padding adapts to narrow screens.

Expanded paired outcomes on mobile

@shashank03-dev

Copy link
Copy Markdown
Contributor Author

Completed #3389 with expandable pair details, conversation links, pagination, and mobile layout fixes. Desktop/mobile checks and regression tests pass. Ready for review.

Keep the simplified GUI guide from main and describe paired outcome
transition details under Scanner.
Copilot AI balanced review requested due to automatic review settings November 2, 2026 11:47

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.

🟢 Approval recommended

No active review issues were identified for the paired-outcome detail expansion.

No open issues 🎉

What changed in this PR

Extends the Scenario run’s existing Paired outcomes panel with expandable details, addressing #3389 and building on #3337. Users can inspect matched objectives and conversations without changing the aggregate pairing rules.

Changes:

  • Adds a paginated detail API that reuses pairing validation and supports labelled compound-child conversation links.
  • Adds on-demand expansion, retry and cancellation handling, keyboard focus restoration, and responsive layouts.
  • Extends unit and browser coverage and documents the drill-down workflow.
File Description
tests/​unit/​backend/​test_paired_outcome_routes.py Tests detail responses and request validation.
tests/​unit/​analytics/​test_paired_outcome_statistics.py Tests pairing consistency, cursors, pagination, and compound links.
pyrit/​backend/​routes/​scenarios.py Adds the paginated paired-outcome detail endpoint.
pyrit/​analytics/​paired_outcome_statistics.py Adds detail models and pagination using shared pairing logic.
pyrit/​analytics/​__init__.py Exposes the new analytics API through lazy exports.
frontend/​src/​types/​index.ts Defines transition and detail response types.
frontend/​src/​services/​api.ts Adds cancellable detail requests.
frontend/​src/​components/​Scenarios/​PairedOutcomes.tsx Adds expandable pair details and conversation navigation.
frontend/​src/​components/​Scenarios/​PairedOutcomes.test.tsx Covers loading, retries, cancellation, pagination, and links.
frontend/​src/​components/​Scenarios/​PairedOutcomes.styles.ts Styles detail cards, mobile layouts, and accessible controls.
frontend/​e2e/​paired-outcomes.spec.ts Exercises real-API navigation, pagination, keyboard use, and recovery.
frontend/​e2e/​fixtures/​paired_outcomes_backend.py Seeds saved conversations and pagination edge cases.
doc/​gui/​0_gui.md Documents paired-outcome inspection with desktop and mobile screenshots.

Review effort: Balanced

@shashank03-dev

Copy link
Copy Markdown
Contributor Author

Roman Lutz (@romanlutz) merged main and fixed the doc conflict (main dropped the paired outcomes section, so I added a short one under Scanner). Tests, ty and frontend checks pass locally. PTAL when u get a chance, thanks

Keep comparison optional behind a completed-scan disclosure, use saved plans only, and preserve canonical conversation links. Restore dedicated browser coverage in CI.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Nov 10, 2026
Merged via the queue into microsoft:main with commit 8a4b794 Nov 10, 2026
61 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.

FEAT: Drill into paired Scenario outcome conversations

3 participants