Repository navigation
2 - FEAT: Consolidated History - #3650
Richard Lundeen (richlundeen) merged 21 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move history into feature routes, add stored ID lookup, and retain the current chat draft. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve discard blocking before resetting the composer and use shared encoded continuation and scenario routes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep an explicit not-found page and Home recovery link at unknown URLs. Preserve the last valid chat and dataset views without changing legacy aliases or Registry index behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
fc26acc to
c8c3a56
Compare
Prefer the existing retained draft when entering Chat from another view. Keep an already open chat in place so live work is not replaced by an older snapshot. Cover the workflow with the real History table, Chat tabs, composer and reset controls. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use shared readiness and completion watchdogs instead of a short scheduling deadline while preserving the concurrent settings edit assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Behnam (behnam-o)
left a comment
There was a problem hiding this comment.
[GHCP]: Verdict: APPROVE.
PR 2/10 - Consolidated History. Please address and resolve all 3 numbered inline comments in this review. Approval does not waive any comment.
- [GHCP]: MEDIUM - Previously exported evidence links break.
- [GHCP]: MEDIUM - Browser-route renaming corrupts unchanged API mocks and waits.
- [GHCP]: MEDIUM - UI-test consumers still require removed contracts.
Scope: the feature increment 4a72b940490ab0d1aeb17e3a5287a024dd6d8536 -> 9bd986a01e03a868d2594e815afc96ee0f0f4b36. Static review only; tests, builds, and browser validation were not run.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep result details within the viewport after resizing, preserve editor assertions across modal restoration, and align unit and mock callers with feature-owned new attacks and exact ID forwarding. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Addressed the issues in this review. Addressed the supported route, unchanged-REST, and UI-consumer issues and preserved those corrections through the main/dependency merges. The published repair is b1b7db5. Its scoped checks pass: 74 mock E2E tests, 322 frontend tests, 23 scenario-history tests, lint, type-check, and production build. The mobile details popover also passes the original viewport and 44px assertions. Keep editing coverage retains the exact unsaved-text assertion on both saved and unsaved routes; fresh evidence showed deferred modal accessibility restoration rather than draft loss. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Richard Lundeen (richlundeen)
left a comment
There was a problem hiding this comment.
Automated review completed. No blocking concerns remain. This review records source coverage; it does not authorize merge.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Exact conversation-ID lookup misses saved pruned conversations with NULL ownership links in upgraded databases, requiring a dialect-aware JSON-array fallback and a regression test for that case.
1 open issue
What changed in this PR
Moves attack and scanner history into their respective feature pages, with updated routes and chat-draft retention. This cumulative change also includes the expandable sidebar from the preceding layer.
Changes:
- Add feature-level Chat/History and Launch/History tabs, separate New attack controls, and scan-return navigation.
- Add exact-ID scanner-history lookup through the API and memory query layers.
- Update evidence links, Operation-scoped history links, documentation, and navigation tests.
| File | Description |
|---|---|
| tests/unit/memory/test_scenario_history.py | Verify reference-ID forwarding. |
| tests/unit/memory/memory_interface/test_interface_scenario_history.py | Test stored-ID lookup and pagination. |
| tests/unit/backend/test_scenario_run_service.py | Test lookup-bound cursors. |
| tests/unit/backend/test_scenario_run_routes.py | Test lookup parameters and UUID validation. |
| tests/unit/backend/test_finding_export.py | Update exported-link expectations. |
| pyrit/memory/memory_interface.py | Forward history reference IDs. |
| pyrit/memory/_scenario_history.py | Filter stored runs by exact IDs. |
| pyrit/backend/services/scenario_run_service.py | Bind lookup filters to pagination. |
| pyrit/backend/services/finding_export.py | Generate new chat evidence URLs. |
| pyrit/backend/routes/scenarios.py | Expose the reference-ID query parameter. |
| frontend/src/utils/userPreferences.ts | Parse saved sidebar expansion. |
| frontend/src/utils/routeParams.ts | Update chat and scanner route builders. |
| frontend/src/utils/routeParams.test.ts | Verify revised route shapes. |
| frontend/src/utils/chatDraft.ts | Recognize additional retained draft state. |
| frontend/src/utils/attackConversationRoute.cases.json | Update shared evidence-route cases. |
| frontend/src/types/index.ts | Extend draft and preference types. |
| frontend/src/styles/touchTargets.ts | Share the narrow-screen query. |
| frontend/src/services/api.ts | Send scanner-history reference IDs. |
| frontend/src/hooks/useUserPreferences.test.tsx | Test sidebar preference persistence. |
| frontend/src/hooks/useTour.ts | Update route examples in comments. |
| frontend/src/hooks/useTour.test.ts | Update tour anchors and wording expectations. |
| frontend/src/hooks/useMediaQuery.ts | Add reactive viewport-query support. |
| frontend/src/hooks/useMediaQuery.test.ts | Test media-query subscription cleanup. |
| frontend/src/hooks/useChatDraftHandoff.tsx | Reject stale draft snapshots. |
| frontend/src/hooks/useChatDraftHandoff.test.tsx | Update draft-origin routes. |
| frontend/src/components/Tour/tourSteps.ts | Explain feature-level history navigation. |
| frontend/src/components/Sidebar/Navigation.tsx | Add expandable navigation and revised destinations. |
| frontend/src/components/Sidebar/Navigation.test.tsx | Test expansion, tooltips, and destination order. |
| frontend/src/components/Sidebar/Navigation.styles.ts | Style expanded and active navigation. |
| frontend/src/components/ScenarioSuites/suiteRoutes.ts | Move suite progress under scanner history. |
| frontend/src/components/ScenarioSuites/suiteRoutes.test.ts | Verify suite progress routes. |
| frontend/src/components/ScenarioSuites/ScenarioSuiteExecutionPage.tsx | Update launch links and heading levels. |
| frontend/src/components/ScenarioSuites/ScenarioSuiteExecutionPage.test.tsx | Update suite navigation expectations. |
| frontend/src/components/ScenarioSuites/LaunchSuiteDialog.test.tsx | Update launch destination expectations. |
| frontend/src/components/Scenarios/ScenarioRunPage.tsx | Update return routes and headings. |
| frontend/src/components/Scenarios/ScenarioRunPage.test.tsx | Verify revised run and conversation navigation. |
| frontend/src/components/Scenarios/ScenarioQueue.tsx | Use the shared run-route builder. |
| frontend/src/components/Scenarios/ScenarioQueue.test.tsx | Test queue links and ID encoding. |
| frontend/src/components/Scenarios/ScenarioFlow.test.tsx | Update catalog-to-run navigation tests. |
| frontend/src/components/Scenarios/ScenarioDetail.tsx | Update launch links and heading hierarchy. |
| frontend/src/components/Scenarios/ScenarioCatalog.tsx | Present the scanner Launch view. |
| frontend/src/components/Scenarios/ScenarioCatalog.test.tsx | Update catalog text and route expectations. |
| frontend/src/components/ScenarioPresets/presetRoutes.ts | Build preset links under Launch. |
| frontend/src/components/ScenarioPresets/presetRoutes.test.ts | Verify revised preset launch links. |
| frontend/src/components/Registry/ScenarioPresetRegistry.tsx | Link to scanner Launch. |
| frontend/src/components/Registry/ScenarioPresetRegistry.test.tsx | Update scanner-link expectations. |
| frontend/src/components/Operations/OperationDetailPage.tsx | Add separate Operation-scoped history links. |
| frontend/src/components/Operations/OperationDetailPage.test.tsx | Verify both scoped history destinations. |
| frontend/src/components/Operations/FindingEvidenceList.test.tsx | Update evidence chat-link expectations. |
| frontend/src/components/Layout/PageNotFound.tsx | Add an unmatched-route screen. |
| frontend/src/components/Layout/PageNotFound.styles.ts | Style the unmatched-route screen. |
| frontend/src/components/Layout/MainLayout.tsx | Add responsive navigation and feature-tab slots. |
| frontend/src/components/Layout/MainLayout.test.tsx | Test expansion persistence without workspace remounts. |
| frontend/src/components/Layout/MainLayout.styles.ts | Size the sidebar, drawer, and viewport layout. |
| frontend/src/components/Layout/FeatureNavigation.tsx | Add feature tabs and New attack action. |
| frontend/src/components/Layout/FeatureNavigation.styles.ts | Style feature navigation. |
| frontend/src/components/Home/Home.tsx | Delegate history navigation through a callback. |
| frontend/src/components/Home/Home.test.tsx | Test the history callback. |
| frontend/src/components/History/scenarioHistoryFilters.ts | Serialize the exact-ID filter. |
| frontend/src/components/History/scenarioHistoryFilters.test.ts | Test ID-filter URL round trips. |
| frontend/src/components/History/ScenarioHistory.tsx | Add validated ID lookup and cursor resets. |
| frontend/src/components/History/ScenarioHistory.test.tsx | Test lookup, validation, clearing, and pagination. |
| frontend/src/components/History/ScenarioHistory.styles.ts | Fit ID lookup into the filter row. |
| frontend/src/components/History/HistoryPage.tsx | Remove the standalone history wrapper. |
| frontend/src/components/History/HistoryPage.test.tsx | Remove standalone-wrapper tests. |
| frontend/src/components/History/HistoryPage.styles.ts | Remove standalone-wrapper styles. |
| frontend/src/components/Configuration/Configuration.test.tsx | Update scanner navigation in tests. |
| frontend/src/components/Configuration/Configuration.reload-guard.test.tsx | Update reload-guard navigation routes. |
| frontend/src/components/Chat/ObjectiveHeader.tsx | Constrain result popovers to the viewport. |
| frontend/src/components/Chat/ChatWindow.tsx | Retain draft settings and relocate scan-return controls. |
| frontend/src/components/Chat/ChatWindow.test.tsx | Update chat controls and navigation tests. |
| frontend/src/components/Chat/ChatWindow.styles.ts | Reuse the shared narrow-screen query. |
| frontend/src/auth/AuthProvider.tsx | Update a route example in documentation. |
| frontend/src/auth/AuthProvider.test.tsx | Update authentication return-path tests. |
| frontend/src/App.targets.test.tsx | Test draft-target retention and explicit resets. |
| frontend/src/App.labels.test.tsx | Update shared-label and chat-control tests. |
| frontend/e2e/touch-targets.spec.ts | Update mobile navigation routes. |
| frontend/e2e/themes.spec.ts | Check themes on revised feature routes. |
| frontend/e2e/sidebar.spec.ts | Test saved expansion and narrow-screen navigation. |
| frontend/e2e/scenario-history.spec.ts | Update scanner history and provenance flows. |
| frontend/e2e/scenario-hierarchy.spec.ts | Update child-chat and scan-return expectations. |
| frontend/e2e/routing.spec.ts | Update deep-link and history navigation tests. |
| frontend/e2e/registry.spec.ts | Update scanner launch navigation. |
| frontend/e2e/operations.spec.ts | Test separate history links and exported URLs. |
| frontend/e2e/operations-acceptance.spec.ts | Update Operation-scoped feature flows. |
| frontend/e2e/onboarding-tour.spec.ts | Update tour route expectations. |
| frontend/e2e/numeric-controls.spec.ts | Exercise controls on revised launch routes. |
| frontend/e2e/history.spec.ts | Open attack history through feature tabs. |
| frontend/e2e/flows.spec.ts | Update target setup and history navigation. |
| frontend/e2e/errors.spec.ts | Update navigation selectors in error flows. |
| frontend/e2e/converters.spec.ts | Update converter-flow navigation. |
| frontend/e2e/config.spec.ts | Test retained drafts versus new-attack defaults. |
| frontend/e2e/compatibility.spec.ts | Update compatibility-gate navigation selectors. |
| frontend/e2e/chat.spec.ts | Update chat navigation and New attack selectors. |
| frontend/e2e/chat-scoring.spec.ts | Update the scoring deep link. |
| frontend/e2e/chat-recovery.spec.ts | Update recovery-flow routes and selectors. |
| frontend/e2e/api.spec.ts | Update the delayed-API navigation assertion. |
| frontend/e2e/analytics.spec.ts | Update analytics-to-chat route expectations. |
| frontend/e2e/accessibility.spec.ts | Update accessible navigation and heading expectations. |
| doc/gui/0_gui.md | Describe feature histories, draft retention, and sidebar preferences. |
Review effort: Balanced
Preserve feature-scoped attack and scanner navigation while incorporating microsoft/PyRIT main at 5fb4fb9. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reuse backend JSON-array membership for saved pruned conversation IDs without ownership links, with persisted SQLite and SQL Server query-shape regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reuse the existing READY_RUNTIME response so saved-target resolution can execute while retaining deep-link, enabled-composer and reload assertions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reuse the base regex identity fields and include URL-filter decoding policy so copied-default patterns cannot collide with default scorer provenance or evaluation hashes. Verify opposite verdicts, stable identities and persisted score provenance for both aggregators. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Addressed the NULL-ownership lookup issue in this review in cfb8760. The existing correlated history predicate now includes the backend's JSON-array membership hook for persisted pruned conversation IDs. A real SQLite regression confirms a saved conversation whose ownership remains NULL resolves to its owning run before pagination, and a SQL Server construction test checks bound parameters and parent correlation. Both regressions were red before the fix and green afterward; the scoped memory suites report 139 passed and one existing live-Azure-SQL-only skip. |

Moves attack and scan history into their feature pages and updates the routes. Adds exact ID lookup and retains the current chat and unsent draft across navigation.
Changes:
Layer 2/10 | Previous: #3642 | Final: #3648 | Blocked by: #3642
Diff is cumulative until preceding layers merge.
Before (original GUI)
A standalone History page combines attack and scanner history in shared tabs.
After
Attacks has Chat and History tabs above target controls, plus a separate New attack action. The unsent prompt and objective remain after navigation.
Scanner has Launch and History tabs. Its compact ID filter stays beside the existing filters, with mouseover help for the four supported ID types.
In a scan-owned chat, Back to scan sits immediately left of Markdown.
Video
history-production-workflow.mp4