← Back to Pull requests

feat(lens): add Investigations nav tab and Stop run actions #276

Open
unknown opened this pull request with 540 lines diff across 6 files
View on GitHub
unknown unknown commented on Nov 29, 2026 04:42 UTC
Author

Summary

Investigations were only reachable through a "Manage investigations" button on the Findings header, which is hidden for read-only viewers, and ?tab=investigations was rewritten to ?tab=findings without opening the browser. Running investigations also could only be stopped from the run report

Admin-tier users now get a first-class Investigations tab in the sidebar and in the gateway frame navigation, rendering the existing InvestigationsView (read-only when readOnly || !isAdmin || demo, as before). Both legacy deep links, ?tab=investigations and ?tab=findings&findings_view=investigations, open it. The redundant Manage investigations button is gone and New investigation stays on Findings

Stop run (existing POST /lens/admin/{lens_id}/cancel) is now in the list row actions and the detail ⋯ menu whenever a job is active. It cancels the current run only and leaves monitoring as it was. No backend changes

Before, ?demo=true&tab=investigations landed on Findings

!before

After

!after

!history

To reproduce, run npm run dev:ui, open http://127.0.0.1:3100/ui/?demo=true and click Investigations in the sidebar, then open an investigation and its History tab

Tested with npm run typecheck:ui and the touched Vitest files (navigation, workspace, setup, investigations view and actions). The gateway frame uses its existing fallback icon for the new tab, and that path was covered by integration tests rather than a deployed gateway

<details>
<summary>Details</summary>

Link to Devin session: https://app.devin.ai/sessions/e8bc254bcc584b199e486302c890d3c1
Open in Devin Desktop: https://app.devin.ai/desktop/session/e8bc254bcc584b199e486302c890d3c1?variant=devin
Requested by: @moe-berri

</details>

<!-- CURSOR_SUMMARY -->
---

[!NOTE]

Low Risk

UI-only routing and navigation changes with no backend modifications; cancel uses an existing admin endpoint.

> Overview

Adds a dedicated Investigations sidebar/gateway tab (gated by canViewInvestigations) and renders InvestigationsView on its own route instead of a Findings sub-mode. Manage investigations is removed from Findings; legacy URLs (?tab=investigations, ?findings_view=investigations, bare ?lens=…) still land on Investigations, and closing a lens detail keeps the list visible.

> Stop run is exposed on investigation list rows and in the detail actions menu when a job is active, reusing the existing cancel API. Read-only behavior and role restrictions are unchanged aside from Investigations being reachable from nav for admin-tier users.

> <sup>Reviewed by Cursor Bugbot for commit cb7d9054ac8c49f92aeb0de992d503871530aa44. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

<!-- /CURSOR_SUMMARY -->

Diff: 540 lines (+405 / -135) across 6 files Reviewer: cursor[bot] Review duration: 20m
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.48) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 540 lines diff across 6 files
0.48
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
42%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.377
Shallow Review Depth shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #276"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 43.0% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 48.0% (MEDIUM) · Higher = larger blast radius
48.0%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 43.0% · Lower = rushed or shallow review
43.0%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 27.4% · Safe to merge
27.4%
Repository