@skyhook-io/radar-app 1.19.0 → 1.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/README.md +1 -1
  2. package/package.json +5 -5
  3. package/src/App.tsx +37 -9
  4. package/src/api/application-evidence.ts +63 -0
  5. package/src/api/argoSync.test.ts +22 -0
  6. package/src/api/client.audit-gating.test.tsx +48 -0
  7. package/src/api/client.kueuePosition.test.ts +32 -0
  8. package/src/api/client.kueueQueueWorkloads.test.tsx +71 -0
  9. package/src/api/client.resource-identity.test.ts +3 -0
  10. package/src/api/client.resourceIssues.test.tsx +239 -0
  11. package/src/api/client.resourcePath.test.ts +3 -0
  12. package/src/api/client.ts +353 -64
  13. package/src/api/config.ts +21 -0
  14. package/src/api/diagnose.ts +4 -0
  15. package/src/api/helmInventory.test.tsx +108 -0
  16. package/src/api/radarFeatures.render.test.tsx +33 -1
  17. package/src/api/radarFeatures.test.ts +47 -0
  18. package/src/api/radarFeatures.ts +42 -1
  19. package/src/api/rbac.settled.test.tsx +42 -0
  20. package/src/api/rbac.test.ts +18 -0
  21. package/src/api/rbac.ts +37 -7
  22. package/src/api/traffic.ts +9 -4
  23. package/src/api/usage-data.fixtures.ts +3 -1
  24. package/src/api/usage-data.test.tsx +134 -0
  25. package/src/api/usage-data.ts +35 -7
  26. package/src/api/workloadPodsPolling.test.ts +26 -0
  27. package/src/components/CloudConnectFlow.test.tsx +86 -0
  28. package/src/components/CloudConnectFlow.tsx +65 -27
  29. package/src/components/CloudFunnelButton.test.tsx +140 -5
  30. package/src/components/CloudFunnelButton.tsx +50 -9
  31. package/src/components/ConnectionErrorView.test.tsx +34 -0
  32. package/src/components/ConnectionErrorView.tsx +35 -11
  33. package/src/components/ContextSwitcher.tsx +5 -2
  34. package/src/components/SwitchAwareConnectionError.test.tsx +43 -0
  35. package/src/components/SwitchAwareConnectionError.tsx +85 -0
  36. package/src/components/application-evidence/ApplicationEvidenceAction.flow.test.tsx +234 -0
  37. package/src/components/application-evidence/ApplicationEvidenceAction.test.tsx +144 -0
  38. package/src/components/application-evidence/ApplicationEvidenceAction.tsx +218 -0
  39. package/src/components/capacity/CapacityDemand.tsx +3 -2
  40. package/src/components/capacity/demandSummary.test.ts +38 -0
  41. package/src/components/capacity/shared.tsx +12 -1
  42. package/src/components/cost/ApplicationCostTab.tsx +4 -0
  43. package/src/components/cost/CostTrendChart.tsx +2 -0
  44. package/src/components/cost/WorkloadCostTab.tsx +4 -0
  45. package/src/components/cost/source.test.ts +5 -0
  46. package/src/components/cost/source.ts +11 -0
  47. package/src/components/curl/ServiceCurlAvailability.test.tsx +32 -0
  48. package/src/components/curl/ServiceCurlButton.tsx +2 -2
  49. package/src/components/diagnose/AIMarkdown.tsx +3 -0
  50. package/src/components/diagnose/AgentSetupNotice.test.tsx +17 -0
  51. package/src/components/diagnose/AgentSetupNotice.tsx +21 -3
  52. package/src/components/diagnose/ContinueInAgentButton.mounted.test.tsx +182 -0
  53. package/src/components/diagnose/ContinueInAgentButton.test.tsx +128 -0
  54. package/src/components/diagnose/ContinueInAgentButton.tsx +303 -0
  55. package/src/components/diagnose/DiagnoseContext.question.test.tsx +1 -1
  56. package/src/components/diagnose/DiagnoseContext.tsx +68 -2
  57. package/src/components/diagnose/DiagnoseSurface.tsx +58 -113
  58. package/src/components/diagnose/ExampleInvestigationLink.tsx +20 -0
  59. package/src/components/diagnose/Home.test.tsx +26 -0
  60. package/src/components/diagnose/Home.tsx +20 -1
  61. package/src/components/diagnose/InvestigationEvidenceSections.tsx +45 -22
  62. package/src/components/diagnose/InvestigationView.tsx +94 -26
  63. package/src/components/diagnose/LocalDiagnoseAction.history.test.tsx +450 -0
  64. package/src/components/diagnose/LocalDiagnoseAction.tsx +354 -35
  65. package/src/components/diagnose/NextStepJump.test.tsx +92 -0
  66. package/src/components/diagnose/NextStepJump.tsx +75 -0
  67. package/src/components/diagnose/QuestionComposer.tsx +8 -0
  68. package/src/components/diagnose/exampleInvestigation.events.json +191 -0
  69. package/src/components/diagnose/exampleInvestigation.loadFailure.test.tsx +94 -0
  70. package/src/components/diagnose/exampleInvestigation.test.tsx +248 -0
  71. package/src/components/diagnose/exampleInvestigation.ts +121 -0
  72. package/src/components/diagnose/investigationCase.test.tsx +50 -1
  73. package/src/components/diagnose/investigationEvidence/adapters/applicationFindings.test.ts +739 -0
  74. package/src/components/diagnose/investigationEvidence/adapters/coverage.test.tsx +72 -0
  75. package/src/components/diagnose/investigationEvidence/adapters/diagnose.ts +50 -2
  76. package/src/components/diagnose/investigationEvidence/adapters/helm.ts +51 -16
  77. package/src/components/diagnose/investigationEvidence/adapters/issues.ts +9 -0
  78. package/src/components/diagnose/investigationEvidence/adapters/listings.ts +34 -4
  79. package/src/components/diagnose/investigationEvidence/adapters/resource.ts +3 -2
  80. package/src/components/diagnose/investigationEvidence/builder.ts +30 -0
  81. package/src/components/diagnose/investigationEvidence/observations.ts +121 -2
  82. package/src/components/diagnose/investigationEvidence/projection.test.ts +85 -3
  83. package/src/components/diagnose/investigationEvidence/types.ts +5 -0
  84. package/src/components/diagnose/investigationState.ts +28 -0
  85. package/src/components/diagnose/lastInvestigation.test.ts +95 -0
  86. package/src/components/diagnose/lastInvestigation.ts +58 -0
  87. package/src/components/diagnose/launch.test.ts +125 -1
  88. package/src/components/diagnose/launch.ts +57 -10
  89. package/src/components/diagnose/toolCallLabel.test.ts +10 -4
  90. package/src/components/execution/BatchExecutionView.tsx +24 -11
  91. package/src/components/execution/JobSetAdmission.test.tsx +42 -0
  92. package/src/components/execution/JobSetAdmission.tsx +18 -3
  93. package/src/components/execution/JobSetMemberComparison.tsx +2 -1
  94. package/src/components/execution/runState.test.ts +14 -0
  95. package/src/components/execution/runState.ts +8 -0
  96. package/src/components/gitops/GitOpsView.rollbackGate.test.tsx +202 -0
  97. package/src/components/gitops/GitOpsView.syncRequest.test.tsx +369 -0
  98. package/src/components/gitops/GitOpsView.tsx +86 -17
  99. package/src/components/gitops/RemoteDestinationCloudHint.tsx +2 -3
  100. package/src/components/gitops/destination-toast.test.ts +1 -1
  101. package/src/components/gitops/destination-toast.ts +2 -2
  102. package/src/components/helm/HelmDrawerFrame.tsx +101 -0
  103. package/src/components/helm/HelmDrawerRouting.test.tsx +86 -0
  104. package/src/components/helm/HelmReleaseDrawer.tsx +23 -86
  105. package/src/components/helm/HelmView.tsx +213 -71
  106. package/src/components/helm/ObservedHelmNotice.tsx +146 -0
  107. package/src/components/helm/ObservedHelmRelease.test.tsx +261 -0
  108. package/src/components/helm/ObservedHelmReleaseDrawer.test.tsx +80 -0
  109. package/src/components/helm/ObservedHelmReleaseDrawer.tsx +228 -0
  110. package/src/components/helm/OwnedResources.tsx +4 -2
  111. package/src/components/home/ClusterHealthCard.restricted.test.tsx +76 -0
  112. package/src/components/home/ClusterHealthCard.tsx +28 -5
  113. package/src/components/home/HelmSummary.tsx +23 -4
  114. package/src/components/home/HelmSummary.unread.test.ts +16 -0
  115. package/src/components/home/HomeAgentBlock.test.tsx +31 -3
  116. package/src/components/home/HomeAgentBlock.tsx +20 -4
  117. package/src/components/home/HomeDiagramCard.tsx +47 -0
  118. package/src/components/home/HomeView.tsx +81 -41
  119. package/src/components/home/MCPSetupDialog.test.tsx +126 -10
  120. package/src/components/home/MCPSetupDialog.tsx +33 -5
  121. package/src/components/home/ProblemsPanel.investigate.test.tsx +171 -0
  122. package/src/components/home/ProblemsPanel.test.tsx +3 -1
  123. package/src/components/home/TopologyPreview.test.tsx +73 -0
  124. package/src/components/home/TopologyPreview.tsx +120 -233
  125. package/src/components/home/TrafficSummary.test.tsx +63 -0
  126. package/src/components/home/TrafficSummary.tsx +135 -138
  127. package/src/components/home/mcpToolCatalog.ts +67 -14
  128. package/src/components/issues/IssuesPane.test.ts +11 -0
  129. package/src/components/issues/IssuesPane.tsx +15 -5
  130. package/src/components/issues/uncheckedSources.test.ts +22 -1
  131. package/src/components/issues/uncheckedSources.ts +21 -0
  132. package/src/components/kueue/KueuePendingPosition.tsx +35 -0
  133. package/src/components/kueue/useRelatedObjects.test.tsx +219 -0
  134. package/src/components/kueue/useRelatedReads.test.ts +56 -0
  135. package/src/components/kueue/useRelatedReads.ts +205 -0
  136. package/src/components/logs/MultiPodLogsTab.test.tsx +93 -0
  137. package/src/components/logs/MultiPodLogsTab.tsx +120 -0
  138. package/src/components/logs/PodLogsUnavailable.test.tsx +18 -0
  139. package/src/components/logs/PodLogsUnavailable.tsx +21 -0
  140. package/src/components/logs/RayClusterLogsTab.reselect.test.tsx +67 -0
  141. package/src/components/logs/RayClusterLogsTab.test.tsx +167 -0
  142. package/src/components/logs/RayClusterLogsTab.tsx +109 -0
  143. package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +3 -2
  144. package/src/components/logs/rayClusterPods.ts +32 -0
  145. package/src/components/outageSince.test.ts +21 -0
  146. package/src/components/outageSince.ts +10 -0
  147. package/src/components/resource/PrometheusCharts.overlays.test.ts +12 -0
  148. package/src/components/resource/PrometheusCharts.tsx +3 -40
  149. package/src/components/resources/crd/CRDSchemaTab.test.tsx +28 -0
  150. package/src/components/resources/crd/CRDSchemaTab.tsx +13 -0
  151. package/src/components/resources/crd/host.tsx +14 -0
  152. package/src/components/resources/renderers/CustomResourceDefinitionRenderer.test.tsx +27 -0
  153. package/src/components/resources/renderers/CustomResourceDefinitionRenderer.tsx +12 -0
  154. package/src/components/resources/renderers/JobAdmissionRenderers.test.tsx +4 -1
  155. package/src/components/resources/renderers/JobAdmissionRenderers.tsx +4 -3
  156. package/src/components/resources/renderers/KueueHostRenderers.test.tsx +117 -0
  157. package/src/components/resources/renderers/KueueQueueRenderers.test.tsx +97 -0
  158. package/src/components/resources/renderers/KueueQueueRenderers.tsx +139 -0
  159. package/src/components/resources/renderers/KueueWorkloadRenderer.test.tsx +7 -1
  160. package/src/components/resources/renderers/KueueWorkloadRenderer.tsx +47 -7
  161. package/src/components/resources/renderers/OpenTelemetryCollectorRenderer.test.tsx +67 -0
  162. package/src/components/resources/renderers/OpenTelemetryCollectorRenderer.tsx +31 -0
  163. package/src/components/resources/renderers/RayClusterRenderer.test.tsx +81 -3
  164. package/src/components/resources/renderers/RayClusterRenderer.tsx +19 -4
  165. package/src/components/resources/renderers/ServiceRenderer.test.tsx +15 -2
  166. package/src/components/resources/renderers/ServiceRenderer.tsx +1 -1
  167. package/src/components/resources/renderers/ValidatingAdmissionPolicyRenderer.test.tsx +160 -0
  168. package/src/components/resources/renderers/ValidatingAdmissionPolicyRenderer.tsx +128 -0
  169. package/src/components/traffic/TrafficView.tsx +3 -3
  170. package/src/components/ui/command-items-crd.test.tsx +23 -0
  171. package/src/components/ui/command-items.ts +2 -1
  172. package/src/components/useContextSwitchFlow.test.tsx +61 -0
  173. package/src/components/useContextSwitchFlow.tsx +21 -4
  174. package/src/components/whats-new/WhatsNew.test.ts +10 -3
  175. package/src/components/whats-new/WhatsNew.tsx +5 -1
  176. package/src/components/whats-new/WhatsNewDialog.test.tsx +17 -3
  177. package/src/components/whats-new/releaseNotes.ts +77 -4
  178. package/src/components/workload/RelatedFindingsSection.test.tsx +126 -0
  179. package/src/components/workload/RelatedFindingsSection.tsx +80 -0
  180. package/src/components/workload/WorkloadView.test.ts +10 -1
  181. package/src/components/workload/WorkloadView.tsx +85 -98
  182. package/src/components/workload/issueResourceOpener.test.ts +20 -0
  183. package/src/components/workload/issueResourceOpener.ts +17 -0
  184. package/src/context/ConnectionContext.tsx +133 -60
  185. package/src/context/ConnectionProvider.retry.test.tsx +176 -0
  186. package/src/context/ContextSwitchContext.tsx +14 -1
  187. package/src/context/DiagnoseCustomization.tsx +3 -0
  188. package/src/context/clusterConnected.ts +10 -0
  189. package/src/contexts/CapabilitiesContext.tsx +8 -4
  190. package/src/hooks/useElementSize.ts +30 -0
  191. package/src/hooks/useResolvedGitOpsOwner.test.ts +22 -0
  192. package/src/hooks/useResolvedGitOpsOwner.ts +6 -3
  193. package/src/integrations/resourceHost.test.tsx +1 -0
  194. package/src/integrations/resourceHost.ts +5 -1
  195. package/src/integrations/resourceHosts.test.tsx +21 -4
  196. package/src/integrations/resourceHosts.tsx +17 -0
  197. package/src/main.tsx +5 -0
  198. package/src/utils/related-findings.ts +46 -0
@@ -1,154 +1,151 @@
1
+ import { useId } from 'react'
1
2
  import type { DashboardTrafficSummary } from '../../api/client'
2
- import { Activity, ArrowRight, ArrowRightLeft } from 'lucide-react'
3
+ import { Activity } from 'lucide-react'
4
+ import { useElementSize } from '../../hooks/useElementSize'
5
+ import { NAMESPACE_PALETTE } from '../../utils/traffic-colors'
6
+ import { HomeDiagramCard } from './HomeDiagramCard'
3
7
 
4
8
  interface TrafficSummaryProps {
5
9
  data: DashboardTrafficSummary | null
6
10
  onNavigate: () => void
7
11
  }
8
12
 
9
- /**
10
- * Static schematic SVG mimicking the real traffic view layout:
11
- * vertical spine on the left, Internet node, chunky arrows branching
12
- * right to colored service nodes, some with further connections.
13
- */
14
- function TrafficSchematic() {
15
- // Service node colors matching the real traffic view
16
- const green = '#22c55e' // skyhook-connector style
17
- const blue = '#3b82f6' // dev services
18
- const brown = '#a3734c' // staging services
19
- const teal = '#14b8a6' // keda style
20
- const red = '#ef4444' // unhealthy / alert
21
- const purple = '#a855f7' // envoy / system
22
- const inet = '#93c5fd' // light blue — Internet node bg
23
- const inetBorder = '#60a5fa'
24
-
25
- // Edge color
26
- const ec = '#6b7280' // gray-500
13
+ const SOURCE_NAMES: Record<string, string> = {
14
+ hubble: 'Hubble',
15
+ beyla: 'Beyla',
16
+ caretta: 'Caretta',
17
+ istio: 'Istio',
18
+ }
19
+
20
+ export function trafficSourceName(source: string): string {
21
+ return SOURCE_NAMES[source] ?? source.charAt(0).toUpperCase() + source.slice(1)
22
+ }
23
+
24
+ // The drawing's height in its own units. Its width follows the card, up to a
25
+ // limit, so the picture fills a wide card instead of floating in the middle.
26
+ const SKETCH_H = 128
27
+ const SKETCH_MIN_W = 296
28
+ const SKETCH_MAX_W = 560
29
+ const NODE_W = 58
30
+ const NODE_H = 24
31
+
32
+ // Example namespaces shared with the Topology card's picture, coloured from the
33
+ // Traffic view's own palette.
34
+ const NAMESPACES = {
35
+ storefront: NAMESPACE_PALETTE[1],
36
+ payments: NAMESPACE_PALETTE[3],
37
+ }
38
+
39
+ type Column = 0 | 1 | 2 | 3
40
+ interface SketchNode { col: Column; y: number; name: string; namespace: keyof typeof NAMESPACES; port: number }
41
+
42
+ const NODES: Record<string, SketchNode> = {
43
+ frontend: { col: 1, y: 64, name: 'frontend', namespace: 'storefront', port: 8080 },
44
+ cart: { col: 2, y: 22, name: 'cart', namespace: 'storefront', port: 7070 },
45
+ catalog: { col: 2, y: 64, name: 'catalog', namespace: 'storefront', port: 3550 },
46
+ checkout: { col: 2, y: 106, name: 'checkout', namespace: 'payments', port: 5050 },
47
+ redis: { col: 3, y: 22, name: 'redis', namespace: 'storefront', port: 6379 },
48
+ payment: { col: 3, y: 106, name: 'payment', namespace: 'payments', port: 50051 },
49
+ }
50
+
51
+ const EDGES: [from: string, to: string, count: number][] = [
52
+ ['internet', 'frontend', 182],
53
+ ['frontend', 'cart', 72],
54
+ ['frontend', 'catalog', 32],
55
+ ['frontend', 'checkout', 28],
56
+ ['cart', 'redis', 49],
57
+ ['checkout', 'payment', 10],
58
+ ]
59
+
60
+ const INTERNET = { x: 4, y: 64, w: 44 }
61
+
62
+ // A right-angled route with rounded corners, the shape the Traffic view draws.
63
+ function route(x1: number, y1: number, x2: number, y2: number): string {
64
+ if (y1 === y2) return `M ${x1} ${y1} H ${x2}`
65
+ const mx = (x1 + x2) / 2
66
+ const r = Math.min(3, Math.abs(y2 - y1) / 2)
67
+ const dy = y2 > y1 ? r : -r
68
+ return `M ${x1} ${y1} H ${mx - r} Q ${mx} ${y1} ${mx} ${y1 + dy} V ${y2 - dy} Q ${mx} ${y2} ${mx + r} ${y2} H ${x2}`
69
+ }
70
+
71
+ // A static picture of what Live Traffic draws: services as boxes in their
72
+ // namespace's colour, reached on a port, with connection counts on the lines.
73
+ // It is a hint at the view, not this cluster's traffic, so it never moves and
74
+ // carries no health colour.
75
+ function TrafficSketch() {
76
+ const arrow = `${useId()}-arrow`
77
+ const [ref, size] = useElementSize<HTMLDivElement>({ width: SKETCH_MIN_W, height: SKETCH_H })
78
+ const width = Math.min(SKETCH_MAX_W, Math.max(SKETCH_MIN_W, (SKETCH_H * size.width) / size.height))
79
+ // Extra width spreads the columns apart rather than stretching the boxes.
80
+ const extra = width - SKETCH_MIN_W
81
+ const colX = (c: Column) => [66, 146, 226][c - 1] + (extra * c) / 3
82
+
83
+ const anchor = (key: string) => key === 'internet'
84
+ ? { left: INTERNET.x, right: INTERNET.x + INTERNET.w, y: INTERNET.y }
85
+ : { left: colX(NODES[key].col), right: colX(NODES[key].col) + NODE_W, y: NODES[key].y }
27
86
 
28
87
  return (
29
- <svg viewBox="0 0 160 120" className="w-full h-auto max-h-full" aria-hidden="true">
30
- <defs>
31
- <marker id="trf-a" viewBox="0 0 10 8" refX="9" refY="4"
32
- markerWidth="7" markerHeight="6" orient="auto">
33
- <path d="M 0 0 L 10 4 L 0 8 z" fill={ec} opacity="0.55" />
34
- </marker>
35
- <marker id="trf-a2" viewBox="0 0 10 8" refX="9" refY="4"
36
- markerWidth="7" markerHeight="6" orient="auto">
37
- <path d="M 0 0 L 10 4 L 0 8 z" fill={ec} opacity="0.35" />
38
- </marker>
39
- </defs>
40
-
41
- {/* Vertical spine */}
42
- <line x1="38" y1="6" x2="38" y2="114" stroke={ec} strokeWidth="2.5" opacity="0.3" strokeLinecap="round" />
43
-
44
- {/* Internet node — rounded rect with light fill */}
45
- <rect x="3" y="43" width="24" height="16" rx="5" fill={inet} opacity="0.35" stroke={inetBorder} strokeWidth="0.8" />
46
- <circle cx="12" cy="51" r="2.5" fill={inetBorder} opacity="0.6" />
47
-
48
- {/* Arrow: Internet → spine */}
49
- <line x1="27" y1="51" x2="36" y2="51" stroke={ec} strokeWidth="2.5" opacity="0.45" markerEnd="url(#trf-a)" />
50
-
51
- {/* === Branch 1: green service (top) === */}
52
- <line x1="39" y1="14" x2="56" y2="14" stroke={ec} strokeWidth="2" opacity="0.4" markerEnd="url(#trf-a)" />
53
- <rect x="58" y="8" width="28" height="12" rx="3" fill={green} opacity="0.85" />
54
- {/* status dot */}
55
- <circle cx="62" cy="14" r="1.5" fill="#fbbf24" opacity="0.9" />
56
-
57
- {/* === Branch 2: blue service → right node === */}
58
- <line x1="39" y1="33" x2="56" y2="33" stroke={ec} strokeWidth="1.8" opacity="0.4" markerEnd="url(#trf-a)" />
59
- <rect x="58" y="27" width="28" height="12" rx="3" fill={blue} opacity="0.85" />
60
- <circle cx="62" cy="33" r="1.5" fill={green} opacity="0.9" />
61
- {/* → right node (external) */}
62
- <line x1="86" y1="33" x2="108" y2="24" stroke={ec} strokeWidth="1.2" opacity="0.35" markerEnd="url(#trf-a2)" />
63
- <rect x="110" y="18" width="28" height="12" rx="3" fill={red} opacity="0.7" />
64
-
65
- {/* === Branch 3: brown service === */}
66
- <line x1="39" y1="51" x2="56" y2="51" stroke={ec} strokeWidth="2.2" opacity="0.45" markerEnd="url(#trf-a)" />
67
- <rect x="58" y="45" width="28" height="12" rx="3" fill={brown} opacity="0.85" />
68
- <circle cx="62" cy="51" r="1.5" fill={green} opacity="0.9" />
69
-
70
- {/* === Branch 4: teal service → right node === */}
71
- <line x1="39" y1="69" x2="56" y2="69" stroke={ec} strokeWidth="1.5" opacity="0.38" markerEnd="url(#trf-a)" />
72
- <rect x="58" y="63" width="28" height="12" rx="3" fill={teal} opacity="0.85" />
73
- <circle cx="62" cy="69" r="1.5" fill={green} opacity="0.9" />
74
- {/* → right node */}
75
- <line x1="86" y1="69" x2="108" y2="76" stroke={ec} strokeWidth="1.2" opacity="0.35" markerEnd="url(#trf-a2)" />
76
- <rect x="110" y="70" width="28" height="12" rx="3" fill={blue} opacity="0.7" />
77
-
78
- {/* === Branch 5: purple service (bottom) === */}
79
- <line x1="39" y1="87" x2="56" y2="87" stroke={ec} strokeWidth="1.3" opacity="0.35" markerEnd="url(#trf-a)" />
80
- <rect x="58" y="81" width="28" height="12" rx="3" fill={purple} opacity="0.85" />
81
- <circle cx="62" cy="87" r="1.5" fill={green} opacity="0.9" />
82
-
83
- {/* === Branch 6: small red service === */}
84
- <line x1="39" y1="103" x2="56" y2="103" stroke={ec} strokeWidth="1" opacity="0.3" markerEnd="url(#trf-a)" />
85
- <rect x="58" y="97" width="28" height="12" rx="3" fill={red} opacity="0.65" />
86
- <circle cx="62" cy="103" r="1.5" fill={red} opacity="0.9" />
87
- </svg>
88
+ <div ref={ref} className="w-full h-full">
89
+ <svg viewBox={`0 0 ${width} ${SKETCH_H}`} className="w-full h-full" preserveAspectRatio="xMidYMid meet" aria-hidden="true">
90
+ <defs>
91
+ <marker id={arrow} viewBox="0 0 8 6" refX="7" refY="3" markerWidth="5" markerHeight="4" orient="auto">
92
+ <path d="M 0 0 L 8 3 L 0 6 z" fill="var(--text-tertiary)" />
93
+ </marker>
94
+ </defs>
95
+
96
+ {EDGES.map(([from, to, count]) => {
97
+ const a = anchor(from)
98
+ const b = anchor(to)
99
+ const x1 = a.right
100
+ const x2 = b.left - 1.5
101
+ // The count sits on the destination's run, past any fan-out bend,
102
+ // where the Traffic view puts it.
103
+ const labelX = ((x1 + x2) / 2 + x2) / 2
104
+ const labelW = 3 + String(count).length * 2.8
105
+ return (
106
+ <g key={`${from}-${to}`}>
107
+ <path d={route(x1, a.y, x2, b.y)} fill="none" stroke="var(--text-tertiary)" strokeOpacity={0.7}
108
+ strokeWidth={0.6 + count / 182} markerEnd={`url(#${arrow})`} />
109
+ <rect x={labelX - labelW / 2} y={b.y - 3.5} width={labelW} height={7} rx={1.5} className="fill-gray-800/90" />
110
+ <text x={labelX} y={b.y + 1.6} textAnchor="middle" fontSize={4.6} className="fill-gray-300">{count}</text>
111
+ </g>
112
+ )
113
+ })}
114
+
115
+ <rect x={INTERNET.x} y={INTERNET.y - NODE_H / 2} width={INTERNET.w} height={NODE_H} rx={4}
116
+ className="fill-sky-500/20 stroke-sky-500/50" strokeWidth={0.6} />
117
+ <text x={INTERNET.x + 5} y={INTERNET.y - 1.5} fontSize={5.6} fontWeight={600} className="fill-sky-700 dark:fill-sky-300">Internet</text>
118
+ <text x={INTERNET.x + 5} y={INTERNET.y + 5} fontSize={4.4} className="fill-sky-700/70 dark:fill-sky-300/70">inbound</text>
119
+
120
+ {Object.entries(NODES).map(([key, n]) => {
121
+ const x = colX(n.col)
122
+ const top = n.y - NODE_H / 2
123
+ return (
124
+ <g key={key}>
125
+ <rect x={x} y={top} width={NODE_W} height={NODE_H} rx={4} fill={NAMESPACES[n.namespace]} />
126
+ <text x={x + 5} y={top + 7.6} fontSize={5.6} fontWeight={600} className="fill-white">{n.name}</text>
127
+ <text x={x + 5} y={top + 13.4} fontSize={4.4} className="fill-white/70">{n.namespace}</text>
128
+ <text x={x + 5} y={top + 20} fontSize={4.4} fontFamily="var(--font-mono, monospace)" className="fill-cyan-300">:{n.port}</text>
129
+ </g>
130
+ )
131
+ })}
132
+ </svg>
133
+ </div>
88
134
  )
89
135
  }
90
136
 
91
137
  export function TrafficSummary({ data, onNavigate }: TrafficSummaryProps) {
92
- const hasFlows = data && data.flowCount > 0
93
-
138
+ // The server names a source only once Radar has detected one, so no
139
+ // name means "not known yet", never "none installed".
94
140
  return (
95
- <button
96
- onClick={onNavigate}
97
- className="group h-[260px] rounded-xl bg-theme-surface shadow-theme-sm hover:-translate-y-1 hover:shadow-theme-md transition-all duration-200 text-left overflow-hidden"
98
- >
99
- <div className="flex flex-col h-full w-full">
100
- <div className="flex items-center justify-between px-5 py-3 border-b border-theme-border/50">
101
- <div className="flex items-center gap-2">
102
- <Activity className="w-4 h-4 text-theme-text-tertiary" />
103
- <span className="text-xs font-semibold uppercase tracking-wider text-theme-text-secondary">Live Traffic</span>
104
- </div>
105
- {hasFlows && (
106
- <span className="text-[11px] text-theme-text-tertiary">
107
- {data.source} &middot; {data.flowCount} flows
108
- </span>
109
- )}
110
- </div>
111
-
112
- <div className="flex-1 min-h-0 overflow-hidden">
113
- {hasFlows ? (
114
- /* Real data: show top flows */
115
- <div className="px-4 py-2 space-y-1.5">
116
- {data.topFlows.map((flow, i) => (
117
- <div key={i} className="flex items-center gap-2 text-xs">
118
- <span className="text-theme-text-primary truncate">{flow.src}</span>
119
- <ArrowRightLeft className="w-3 h-3 text-theme-text-tertiary shrink-0" />
120
- <span className="text-theme-text-primary truncate">{flow.dst}</span>
121
- <span className="text-xs text-theme-text-tertiary shrink-0 ml-auto">
122
- {flow.connections} conn
123
- </span>
124
- </div>
125
- ))}
126
- </div>
127
- ) : (
128
- /* No data yet: schematic + description */
129
- <div className="flex items-stretch gap-2 px-3 py-1.5 h-full">
130
- <div className="flex flex-col justify-center gap-1.5 w-[105px] shrink-0">
131
- <p className="text-[11px] leading-snug text-theme-text-secondary">
132
- Visualize live service-to-service network flows and external dependencies
133
- </p>
134
- {data && (
135
- <span className="text-[10px] text-theme-text-tertiary">
136
- Source: {data.source}
137
- </span>
138
- )}
139
- </div>
140
- <div className="flex-1 min-w-0 overflow-hidden">
141
- <TrafficSchematic />
142
- </div>
143
- </div>
144
- )}
145
- </div>
146
-
147
- <div className="px-4 py-1.5 border-t border-theme-border/50 flex items-center justify-end gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-theme-text-secondary group-hover:text-theme-text-primary transition-colors">
148
- Open Live Traffic
149
- <ArrowRight className="w-3.5 h-3.5 transition-transform group-hover:translate-x-0.5" />
150
- </div>
151
- </div>
152
- </button>
141
+ <HomeDiagramCard
142
+ icon={Activity}
143
+ title="Live Traffic"
144
+ fact={data ? trafficSourceName(data.source) : undefined}
145
+ drawing={<TrafficSketch />}
146
+ caption="Which services talk to each other, on which ports, and how much."
147
+ footer="Open Live Traffic"
148
+ onNavigate={onNavigate}
149
+ />
153
150
  )
154
151
  }
@@ -20,6 +20,7 @@ export interface MCPToolParam {
20
20
  export interface MCPToolInfo {
21
21
  name: string
22
22
  write?: boolean
23
+ localOnly?: boolean
23
24
  desc: string
24
25
  params: MCPToolParam[]
25
26
  }
@@ -67,7 +68,7 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
67
68
  desc: 'Topology graph of relationships between resources — Services, workloads, Pods, Ingresses, owners. Use traffic view for network flow or resources view for ownership hierarchy.',
68
69
  params: [
69
70
  { arg: 'namespace', desc: 'filter to a specific namespace' },
70
- { arg: 'view', desc: 'traffic or resources' },
71
+ { arg: 'view', desc: 'resources (default) or traffic' },
71
72
  { arg: 'format', desc: 'graph (default) or summary (text)' },
72
73
  ],
73
74
  },
@@ -109,17 +110,17 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
109
110
  },
110
111
  {
111
112
  name: 'diagnose',
112
- desc: 'Bounded, point-in-time evidence bundle for one narrowed target — not an agent run and not an authoritative root-cause verdict. For workloads, including Argo Rollout, Radar attempts selected, capped current and previous logs where available, alongside resource context, a capped warning-event sample, and startup blockers; GitOps reconcilers, including Flux HelmRelease, get status summary + parsed related issues; network entry kinds (Service / Ingress / HTTPRoute / GRPCRoute / Gateway) get a coverage-honest path trace that identifies a broken hop only when the evidence establishes one, with an optional one-shot reachability test.',
113
+ desc: 'Bounded, point-in-time evidence bundle for one narrowed target — not an agent run and not an authoritative root-cause verdict. Batch targets return cached context, Issues and events without runtime logs or metrics. For pod-backed workloads, including Argo Rollout, Radar attempts selected, capped current and previous logs where available, alongside resource context, a capped warning-event sample, and startup blockers; GitOps reconcilers, including Flux HelmRelease, get status summary + parsed related issues; network entry kinds (Service / Ingress / HTTPRoute / GRPCRoute / Gateway) get a coverage-honest path trace that identifies a broken hop only when the evidence establishes one, with an optional one-shot reachability test.',
113
114
  params: [
114
- { arg: 'kind', required: true, desc: 'pod, deployment, statefulset, daemonset, Argo Rollout, application, kustomization, Flux HelmRelease, service, ingress, httproute, grpcroute, or gateway' },
115
+ { arg: 'kind', required: true, desc: 'pod, deployment, statefulset, daemonset, Argo Rollout, Job, JobSet, RayJob, Kueue Workload, application, kustomization, Flux HelmRelease, service, ingress, httproute, grpcroute, or gateway' },
115
116
  { arg: 'group', desc: 'API group for CRDs or kind collisions (for example argoproj.io for Rollout); built-ins are inferred' },
116
117
  { arg: 'namespace', required: true, desc: 'resource namespace' },
117
118
  { arg: 'name', required: true, desc: 'resource name' },
118
119
  { arg: 'probe', desc: 'network kinds only: add active DNS/TCP/TLS/HTTP probes against the declared path (0-3s wall time)' },
119
120
  { arg: 'in_cluster', desc: 'network kinds: run the probe from inside the cluster via short-lived self-destructing pods (real dataplane) - confirms a route the apiserver proxy could only reach indirectly. Creates up to 5 short-lived probe pods (one per dialed target) under your RBAC' },
120
- { arg: 'container', desc: 'workload kinds: specific container (defaults to all)' },
121
- { arg: 'tail_lines', desc: 'workload kinds: lines per pod/stream (default 100)' },
122
- { arg: 'since', desc: 'workload kinds: only logs newer than this duration' },
121
+ { arg: 'container', desc: 'log-collecting targets only: specific container (defaults to all)' },
122
+ { arg: 'tail_lines', desc: 'log-collecting targets only: lines per pod/stream (default 100)' },
123
+ { arg: 'since', desc: 'log-collecting targets only: only logs newer than this duration' },
123
124
  ],
124
125
  },
125
126
  {
@@ -172,20 +173,29 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
172
173
  },
173
174
  {
174
175
  name: 'list_helm_releases',
175
- desc: 'All Helm releases with status, resource health, storage namespace, Flux ownership, current lastOperation, and capped operation trails for failed upgrades, rollbacks, or stuck pending operations.',
176
+ desc: 'All Helm releases with status, resource health, storage namespace, Flux ownership, current lastOperation, and capped operation trails for failed upgrades, rollbacks, or stuck pending operations. Without access to Helm’s Secrets, rows come from labels and annotations on objects you can read, with no status.',
176
177
  params: [{ arg: 'namespace', desc: 'filter to a specific namespace' }],
177
178
  },
178
179
  {
179
180
  name: 'get_helm_release',
180
- desc: 'Detailed Helm release info with owned resources, health, Flux ownership, current lastOperation, operationInsight, hooks, and failed/running hook diagnostics with live Job/Pod/Event/redacted-log evidence when available.',
181
+ desc: 'Detailed Helm release info with owned resources, health, Flux ownership, current lastOperation, operationInsight, hooks, and failed/running hook diagnostics with live Job/Pod/Event/redacted-log evidence when available. Without access to Helm’s Secrets, the release as its objects describe it, with no status or history.',
181
182
  params: [
182
183
  { arg: 'namespace', required: true, desc: 'Helm storage namespace; use storageNamespace from list_helm_releases when present' },
183
184
  { arg: 'name', required: true, desc: 'release name' },
184
- { arg: 'include', desc: 'values, history, operations, diff, values_diff, notes_diff, resource_diff' },
185
+ { arg: 'include', desc: 'chart (stored defaults/schema), notes (untrusted), versions (upgrade targets from the confirmed source), values, history, operations, diff, values_diff, notes_diff, resource_diff' },
186
+ { arg: 'chart_path', desc: 'with include=chart: JSON pointer into defaults; omit to list top-level paths' },
185
187
  { arg: 'diff_revision_1', desc: 'first revision for any diff include' },
186
188
  { arg: 'diff_revision_2', desc: 'second revision for any diff include (defaults to current)' },
187
189
  ],
188
190
  },
191
+ {
192
+ name: 'get_helm_chart',
193
+ desc: 'Versions of a chart in a configured repository or OCI source, newest first, read live before installing it; latest is the newest non-prerelease.',
194
+ params: [
195
+ { arg: 'repository', required: true, desc: 'configured repository name or URL, or OCI prefix: the value an install uses' },
196
+ { arg: 'chart', required: true, desc: 'chart name' },
197
+ ],
198
+ },
189
199
  {
190
200
  name: 'list_packages',
191
201
  desc: 'Unified "what\'s installed" view across Helm releases, workload labels, CRD registrations, and GitOps declarations (Argo + Flux), with sources, versions, health, and a sourceLegend for the stable source codes.',
@@ -208,7 +218,7 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
208
218
  },
209
219
  {
210
220
  name: 'search',
211
- desc: 'Find resources by content/term match — config keys, env refs, images, label values, ConfigMap data, CRD fields, status messages. Secret values are never indexed.',
221
+ desc: 'Find resources by content/term match — config keys, env refs, images, label values, ConfigMap data, CRD fields, status messages, or an IP/ip:port to find the Pod, Service or Node holding it. Secret values are never indexed.',
212
222
  params: [
213
223
  { arg: 'query', required: true, desc: 'tokens AND\'d; modifiers kind:, ns:, label:, image:' },
214
224
  { arg: 'limit', desc: 'max hits (default 50, max 500)' },
@@ -297,7 +307,7 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
297
307
  name: 'get_workload_logs',
298
308
  desc: 'Aggregated logs across all pods of a workload. Without grep, filters for diagnostic relevance; grep returns only matching timestamp-prefixed lines instead.',
299
309
  params: [
300
- { arg: 'kind', desc: 'deployment (default), statefulset, daemonset, job, or workflow' },
310
+ { arg: 'kind', desc: 'deployment (default), statefulset, daemonset, rollout, job, or workflow' },
301
311
  { arg: 'namespace', required: true, desc: 'workload namespace' },
302
312
  { arg: 'name', required: true, desc: 'workload name' },
303
313
  { arg: 'container', desc: 'specific container (defaults to all)' },
@@ -307,6 +317,18 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
307
317
  { arg: 'previous', desc: 'logs from the previous terminated container' },
308
318
  ],
309
319
  },
320
+ {
321
+ name: 'curl_service',
322
+ write: true,
323
+ desc: 'HTTP GET to a selector-backed Service with a ClusterIP from in-cluster Radar, with status/body and no Kubernetes credentials. Requires --mcp-http-tools and get services/proxy permission. No redirects or authenticated requests; internal TLS certificates are not verified.',
324
+ params: [
325
+ { arg: 'namespace', required: true, desc: 'Service namespace' },
326
+ { arg: 'name', required: true, desc: 'Service name' },
327
+ { arg: 'port', required: true, desc: 'numeric Service port' },
328
+ { arg: 'scheme', desc: 'http (default) or https' },
329
+ { arg: 'path', desc: 'path and query; defaults to /' },
330
+ ],
331
+ },
310
332
  {
311
333
  name: 'exec_pod',
312
334
  write: true,
@@ -320,10 +342,41 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
320
342
  { arg: 'timeout_seconds', desc: 'one deadline for resolution and execution; default 30, max 45 seconds; 64 KiB per output stream' },
321
343
  ],
322
344
  },
345
+ {
346
+ name: 'collect_application_evidence',
347
+ localOnly: true,
348
+ desc: 'Read one Pod’s RabbitMQ alarms/resource values, NATS JetStream observations or Vault node state. Local only, with operator approval and Pod-read/port-forward permissions. Unavailable evidence is not a health verdict.',
349
+ params: [
350
+ { arg: 'application', required: true, desc: 'rabbitmq, nats, or vault' },
351
+ { arg: 'namespace', required: true, desc: 'Pod namespace' },
352
+ { arg: 'pod', required: true, desc: 'one explicitly selected Pod' },
353
+ { arg: 'pod_uid', desc: 'expected Pod UID from a diagnosis suggestion' },
354
+ { arg: 'confirm_network_access', required: true, desc: 'true after operator authorization to collect endpoint evidence' },
355
+ ],
356
+ },
357
+ {
358
+ name: 'manage_helm',
359
+ write: true,
360
+ desc: 'Install, upgrade, roll back or uninstall a native Helm release. Uses your Kubernetes permissions. Keep GitOps-managed dependencies in git. Upgrade and rollback can be previewed first; a rollback preview names objects it would take over from other releases. Uninstall previews what it deletes, keeps and runs before accepting a reviewed confirmation token.',
361
+ params: [
362
+ { arg: 'action', required: true, desc: 'install, upgrade, rollback, or uninstall' },
363
+ { arg: 'namespace', required: true, desc: 'release storage namespace' },
364
+ { arg: 'name', required: true, desc: 'release name' },
365
+ { arg: 'chart', desc: 'chart name for install' },
366
+ { arg: 'repository', desc: 'configured install source; upgrade optionally asserts the confirmed saved source and requires it to be configured' },
367
+ { arg: 'version', desc: 'exact version for install (choices from get_helm_chart); upgrade choices come from get_helm_release include=versions; omit on upgrade only when latest and deployed charts agree' },
368
+ { arg: 'values', desc: 'upgrade overrides merge over the deployed revision\'s overrides; no literal credentials' },
369
+ { arg: 'replace_values', desc: 'upgrade only: explicitly replace all stored overrides with values' },
370
+ { arg: 'dry_run', desc: 'upgrade or rollback: advisory preview (upgrade: same merge rules; rollback: stored diff plus live takeover and retention checks); false executes' },
371
+ { arg: 'expected_revision', desc: 'upgrade or rollback: refuse a changed latest revision; not an atomic lock' },
372
+ { arg: 'revision', desc: 'positive rollback revision from release history' },
373
+ { arg: 'confirm', desc: 'reviewed preview token to execute uninstall; expires after 5 minutes' },
374
+ ],
375
+ },
323
376
  {
324
377
  name: 'manage_workload',
325
378
  write: true,
326
- desc: 'Operate on a workload: restart triggers a rolling restart, scale changes the replica count, rollback reverts to a previous revision. Rollout rollback re-runs every canary step — pair it with manage_rollout promote-full, or abort instead.',
379
+ desc: 'Operate on a workload: restart triggers a rolling restart, scale changes the replica count, rollback reverts to a previous revision. Roll back a native Helm release\'s workload as the Helm release, not the workload alone. Rollout rollback re-runs every canary step — pair it with manage_rollout promote-full, or abort instead.',
327
380
  params: [
328
381
  { arg: 'action', required: true, desc: 'restart, scale, or rollback' },
329
382
  { arg: 'kind', required: true, desc: 'deployment, statefulset, daemonset, or rollout' },
@@ -356,13 +409,13 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
356
409
  {
357
410
  name: 'manage_gitops',
358
411
  write: true,
359
- desc: 'Operate on GitOps resources. ArgoCD: sync, refresh, terminate, rollback, suspend, resume. FluxCD: reconcile, sync-with-source, suspend, resume.',
412
+ desc: 'Operate on GitOps resources. Argo CD: sync, refresh, terminate, rollback, suspend, resume. Flux: reconcile, sync-with-source, suspend, resume.',
360
413
  params: [
361
414
  { arg: 'action', required: true, desc: 'sync/reconcile, refresh, terminate, rollback, suspend, or resume' },
362
415
  { arg: 'tool', required: true, desc: 'argocd or fluxcd' },
363
416
  { arg: 'namespace', required: true, desc: 'resource namespace' },
364
417
  { arg: 'name', required: true, desc: 'resource name' },
365
- { arg: 'kind', desc: 'FluxCD resource kind (e.g. kustomization, helmrelease)' },
418
+ { arg: 'kind', desc: 'Flux resource kind (e.g. kustomization, helmrelease)' },
366
419
  ],
367
420
  },
368
421
  {
@@ -191,6 +191,17 @@ describe('issueSubjectState', () => {
191
191
  it('reads an empty answer as unconfirmed when RBAC withheld issues about it', () => {
192
192
  expect(issueSubjectState(subject, [], loaded({ withheld: { issues: 2 } }))).toEqual({ state: 'unconfirmed', why: 'your permissions withhold 2 issues about it' })
193
193
  })
194
+ it('reads an empty answer as unconfirmed when a check about it could not be made for the caller', () => {
195
+ const unchecked = [{ source: 'kueue', reason: 'caller_access_denied', kinds: [{ group: 'kueue.x-k8s.io', kind: 'ClusterQueue' }] }]
196
+ expect(issueSubjectState(subject, [], loaded({ unchecked_sources: unchecked }))).toEqual({ state: 'unconfirmed', why: "you can't read ClusterQueues, which this check needs" })
197
+ })
198
+ it('keeps unchecked evidence alongside findings and withheld issue counts', () => {
199
+ const found = issue({ kind: 'Job', namespace: 'pg', name: 'main' })
200
+ const unchecked = [{ source: 'kueue', reason: 'caller_access_denied', kinds: [{ group: 'kueue.x-k8s.io', kind: 'ClusterQueue' }] }]
201
+ expect(issueSubjectState(subject, [], loaded({ issues: [found], withheld: { issues: 1 }, unchecked_sources: unchecked }))).toEqual({
202
+ state: 'found', issues: [found], withheld: 1, uncheckedWhy: "you can't read ClusterQueues, which this check needs",
203
+ })
204
+ })
194
205
  it('reads an empty answer under limited visibility as unconfirmed, never none', () => {
195
206
  expect(issueSubjectState(subject, [], loaded({ visibility: { state: 'degraded', impact: 'Pods are not readable.' } }))).toEqual({ state: 'unconfirmed', why: "some evidence isn't readable (Pods are not readable)" })
196
207
  expect(issueSubjectState(subject, [], loaded({ visibility: { state: 'limited' } }))).toEqual({ state: 'unconfirmed', why: "some evidence isn't readable" })
@@ -25,7 +25,8 @@ import {
25
25
  import { builtinGroupForKind } from "@skyhook-io/k8s-ui/utils/api-resources";
26
26
  import { AlertTriangle } from "lucide-react";
27
27
  import { IssueDiagnoseButton } from "../diagnose/LocalDiagnoseAction";
28
- import { uncheckedSourceLines } from "./uncheckedSources";
28
+ import { recordUsageEvent } from "../../api/usage-data";
29
+ import { uncheckedSourceLines, uncheckedSubjectWhy } from "./uncheckedSources";
29
30
  import { UncheckedSourceHelp } from "./UncheckedSourceHelp";
30
31
 
31
32
  // A capacity-relevant issue links to its Karpenter diagnosis. Karpenter is
@@ -114,7 +115,7 @@ export type IssueSubjectState =
114
115
  | { state: "hidden" }
115
116
  | { state: "checking" }
116
117
  | { state: "unconfirmed"; why: string }
117
- | { state: "found"; issues: Issue[]; withheld: number }
118
+ | { state: "found"; issues: Issue[]; withheld: number; uncheckedWhy?: string }
118
119
  | { state: "none" };
119
120
 
120
121
  /**
@@ -137,7 +138,8 @@ export function issueSubjectState(
137
138
  }
138
139
  const data = related.data;
139
140
  if (related.isLoading || !data) return { state: "checking" };
140
- if (data.issues.length > 0) return { state: "found", issues: data.issues, withheld: data.withheld?.issues ?? 0 };
141
+ const uncheckedWhy = uncheckedSubjectWhy(data.unchecked_sources);
142
+ if (data.issues.length > 0) return { state: "found", issues: data.issues, withheld: data.withheld?.issues ?? 0, ...(uncheckedWhy ? { uncheckedWhy } : {}) };
141
143
  if (data.coverage === "unknownKind") return { state: "unconfirmed", why: "this cluster has no such kind" };
142
144
  if (data.coverage === "notWatched") return { state: "unconfirmed", why: `Radar isn't watching ${subject.kind}` };
143
145
  if (data.coverage === "syncing") return { state: "unconfirmed", why: `Radar is still loading ${subject.kind}` };
@@ -145,6 +147,7 @@ export function issueSubjectState(
145
147
  if (withheld > 0) {
146
148
  return { state: "unconfirmed", why: `your permissions withhold ${withheld} ${withheld === 1 ? "issue" : "issues"} about it` };
147
149
  }
150
+ if (uncheckedWhy) return { state: "unconfirmed", why: uncheckedWhy };
148
151
  const visibility = data.visibility;
149
152
  if (visibility?.state === "degraded" || visibility?.state === "limited") {
150
153
  return {
@@ -235,13 +238,15 @@ export function IssuesPane({
235
238
  return next;
236
239
  });
237
240
 
238
- const onResourceClick = (ref: IssueResourceRef) =>
241
+ const onResourceClick = (ref: IssueResourceRef) => {
242
+ recordUsageEvent({ type: "ui", name: "issue_action:open" });
239
243
  onNavigateToResource({
240
244
  kind: ref.kind,
241
245
  namespace: ref.namespace ?? "",
242
246
  name: ref.name,
243
247
  group: ref.group ?? "",
244
248
  });
249
+ };
245
250
 
246
251
  if (!subject && isLoading) {
247
252
  return <PaneLoader label="Loading issues…" className="flex-1" />;
@@ -373,6 +378,8 @@ export function IssuesPane({
373
378
  {subjectState.state === "unconfirmed" && ` — can't confirm: ${subjectState.why}`}
374
379
  {subjectState.state === "found" && subjectState.withheld > 0 &&
375
380
  ` — your permissions withhold ${subjectState.withheld} more`}
381
+ {subjectState.state === "found" && subjectState.uncheckedWhy &&
382
+ ` — some checks are unconfirmed: ${subjectState.uncheckedWhy}`}
376
383
  </span>
377
384
  )}
378
385
  <button type="button" onClick={clearSubject} className="text-accent-text hover:underline">
@@ -424,7 +431,10 @@ export function IssuesPane({
424
431
  {capacityHref && (
425
432
  <button
426
433
  type="button"
427
- onClick={() => navigate(capacityHref)}
434
+ onClick={() => {
435
+ recordUsageEvent({ type: "ui", name: "issue_action:capacity" });
436
+ navigate(capacityHref);
437
+ }}
428
438
  className="rounded-md border border-theme-border px-2 py-1 text-xs font-medium text-accent-text transition-colors hover:bg-theme-hover"
429
439
  >
430
440
  View in Capacity →
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from 'vitest'
2
- import { UNKNOWN_SOURCE_LINE, uncheckedSourceLines } from './uncheckedSources'
2
+ import { UNKNOWN_SOURCE_LINE, uncheckedSourceLines, uncheckedSubjectWhy } from './uncheckedSources'
3
3
 
4
4
  describe('uncheckedSourceLines', () => {
5
5
  it('names the kinds still loading', () => {
@@ -28,10 +28,31 @@ describe('uncheckedSourceLines', () => {
28
28
  })
29
29
 
30
30
  it("says when Radar's own service account is the problem", () => {
31
+ expect(uncheckedSourceLines([{ source: 'helm', reason: 'caller_access_denied' }]))
32
+ .toEqual(['Radar can\'t read Helm\'s release Secrets here, so failed or stuck releases may be missing.'])
31
33
  expect(uncheckedSourceLines([{ source: 'helm', reason: 'collector_access_denied' }]))
32
34
  .toEqual(["Helm releases couldn't be checked because Radar's service account isn't allowed to impersonate users, so failed or stuck releases may be missing."])
33
35
  })
34
36
 
37
+ it('says a Kueue queue check was skipped because the caller cannot read ClusterQueues', () => {
38
+ expect(uncheckedSourceLines([{
39
+ source: 'kueue', reason: 'caller_access_denied', kinds: [{ group: 'kueue.x-k8s.io', kind: 'ClusterQueue' }],
40
+ }])).toEqual(["You can't read ClusterQueues, so Radar can't tell you whether a queue your runs wait on is stopped on purpose or broken."])
41
+ })
42
+
43
+ it('explains a per-resource gap with or without kinds', () => {
44
+ expect(uncheckedSubjectWhy([{ source: 'kueue', reason: 'caller_access_denied' }])).toBe("you can't read what this check needs")
45
+ expect(uncheckedSubjectWhy([{ source: 'kueue', reason: 'read_failed' }])).toBe("some checks couldn't run")
46
+ expect(uncheckedSubjectWhy(undefined)).toBeUndefined()
47
+ })
48
+
49
+ it('names Kueue kinds Radar could not load', () => {
50
+ expect(uncheckedSourceLines([{ source: 'kueue', reason: 'kind_sync_pending', kinds: [{ group: 'kueue.x-k8s.io', kind: 'LocalQueue' }] }]))
51
+ .toEqual(['Still loading LocalQueues, so their issues may be missing.'])
52
+ expect(uncheckedSourceLines([{ source: 'kueue', reason: 'read_failed' }]))
53
+ .toEqual(["Kueue resources couldn't be checked, so blocked runs and broken queues may be missing."])
54
+ })
55
+
35
56
  it('falls back to the source line for a reason this version does not know', () => {
36
57
  expect(uncheckedSourceLines([{ source: 'karpenter', reason: 'something_new' }]))
37
58
  .toEqual(["Karpenter resources couldn't be checked, so NodePool and NodeClaim issues may be missing."])