Skip to content

[NER-41] feat: Neuri Analysis panel and Run Investigation button on incident detail#135

Merged
singret merged 6 commits into
mainfrom
singret/ner-41-regen-frontend-run-investigation-button-and-neuri-analysis
Jul 18, 2026
Merged

[NER-41] feat: Neuri Analysis panel and Run Investigation button on incident detail#135
singret merged 6 commits into
mainfrom
singret/ner-41-regen-frontend-run-investigation-button-and-neuri-analysis

Conversation

@singret

@singret singret commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds NeuriPanel component to the incident detail activity tab (below AI Summary), providing a one-click root-cause investigation flow powered by Neuri
  • Panel is aware of Neuri configuration state: shows a setup prompt when the webhook URL is missing (Settings → System → Neuri), and loads any existing investigation result immediately on mount
  • Trigger flow: POST /api/v1/neuri/investigate (secret stays server-side in the proxy) → poll /api/v1/neuri/result every 5s up to 90s → render result card with top-hypothesis badge, confidence %, free-text summary, and ranked hypothesis bar chart (collapse/expand when > 3 entries)
  • Re-run button available once a result exists; interval cleared on component unmount to avoid memory leaks
  • Adds frontend/src/api/neuri.ts API layer: getNeuriSettings, triggerNeuriInvestigation, getNeuriResults
  • Neuri types added to api/types.ts: NeuriSettingsResponse, NeuriResult, RankedHypothesis, NeuriResultListResponse, NeuriTriggerResponse

Test plan

  • Start Regen locally with make dev
  • Open any incident detail page → Activity tab
  • With Neuri not configured: confirm amber warning with link to Settings appears
  • Configure Neuri URL in Settings → System → Neuri; reload incident
  • Click Run Investigation → spinner appears, then polling skeleton
  • Simulate callback (curl -X POST http://localhost:8080/api/v1/neuri/result -d '{"incident_id":"<uuid>","investigation_run_id":"<uuid>","top_hypothesis":"CODE_CHANGE","confidence":0.82,"summary":"Recent deploy introduced a regression.","ranked_hypotheses":[{"type":"CODE_CHANGE","confidence":0.82},{"type":"DEPENDENCY_FAILURE","confidence":0.31},{"type":"RESOURCE_EXHAUSTION","confidence":0.12},{"type":"UNKNOWN","confidence":0.07}]}')
  • Result card renders: blue CODE_CHANGE badge, 82% confidence, summary text, 3 visible bars + "1 more" toggle
  • Click toggle → all 4 bars visible; click again → collapses
  • Refresh page → existing result loads without triggering investigation again
  • Click Re-run → new trigger starts; old result replaced when callback arrives
  • Navigate away and back → no dangling polling intervals (verify no repeated network calls in devtools)

Closes NER-41

singret and others added 6 commits July 1, 2026 08:02
…ncident detail

- NeuriPanel component inline in the activity tab (below AI Summary),
  following the same pattern as AISummaryPanel:
  - Checks GET /api/v1/settings/neuri on mount; shows "not configured"
    message if webhook_url is empty
  - Loads any existing result immediately on mount (no button click needed
    if investigation already ran)
  - "Run Investigation" button → POST /api/v1/neuri/investigate (proxy,
    secret stays server-side); shows spinner while triggering
  - Polls GET /api/v1/neuri/result?incident_id=<uuid> every 5s until
    result arrives; times out after 90s with actionable error message
  - Result card: top hypothesis badge (colour-coded by type), confidence %,
    summary text, ranked hypotheses with progress bars; collapse/expand
    when more than 3 hypotheses
- frontend/src/api/neuri.ts: getNeuriSettings, triggerNeuriInvestigation,
  getNeuriResults
- Neuri types added to api/types.ts: NeuriSettingsResponse, NeuriResult,
  RankedHypothesis, NeuriResultListResponse, NeuriTriggerResponse

Closes NER-41
Admins can now configure Neuri directly from Settings → System without
using curl. Fields: webhook URL, Regen base URL, webhook secret (masked,
show/hide toggle). Configured state shows the secret hint and a Remove
button. Secret field is optional on update — leave blank to keep the
existing secret.
Remove binding:"required" from TopHypothesis (can be null when
coverage_complete=false) and drop required from Confidence (0.0 is
valid when Neuri cannot determine a root cause). Both fields failing
validation caused every partial investigation callback to return 400,
leaving the UI stuck on the 90s timeout.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…estructure investigation UI [NER-41]

Two integration bugs against Neuri's real API, found via live testing:
- Trigger payload used incident_id, but Neuri's webhook expects id.
- affected_services was always sent empty; incident labels were never
  populated on the incident model, so there was no data to derive it from.

Frontend: RankedHypothesis.confidence renamed to score, matching Neuri's
actual API field name. NeuriPanel moves out of a persistent Activity-tab
strip into its own "Investigation" tab, with a compact NeuriActivityCard
summary left on the Activity tab linking into it.
Brings the branch current before finishing PR #135.
… [NER-41]

Surfaced only when Neuri isn't configured yet -- the moment someone
encounters the feature without having set it up, and the natural place
for a "learn more / join the pilot" CTA.
@singret
singret merged commit c49776a into main Jul 18, 2026
4 checks passed
@singret
singret deleted the singret/ner-41-regen-frontend-run-investigation-button-and-neuri-analysis branch July 18, 2026 12:15
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.

1 participant