@skyhook-io/radar-app 1.17.1 → 1.18.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 (146) hide show
  1. package/README.md +6 -0
  2. package/package.json +10 -11
  3. package/src/App.tsx +36 -36
  4. package/src/api/client.gitops-destination.test.tsx +55 -0
  5. package/src/api/client.gitopsPoll.test.ts +99 -0
  6. package/src/api/client.helmPreview.test.tsx +48 -0
  7. package/src/api/client.resource-list.test.ts +76 -0
  8. package/src/api/client.resourceAvailability.test.ts +24 -0
  9. package/src/api/client.ts +396 -105
  10. package/src/api/client.workloadRuns.test.ts +53 -0
  11. package/src/api/config.test.ts +23 -1
  12. package/src/api/config.ts +7 -3
  13. package/src/api/diagnose.ts +4 -1
  14. package/src/api/drain-plan.test.ts +70 -40
  15. package/src/api/policy.ts +5 -5
  16. package/src/api/quotas.ts +9 -20
  17. package/src/api/radarFeatures.ts +3 -0
  18. package/src/api/resourceLists.test.ts +84 -0
  19. package/src/api/resourceLists.ts +71 -0
  20. package/src/api/traffic.scope.render.test.tsx +60 -0
  21. package/src/api/traffic.ts +3 -1
  22. package/src/components/cnpg/CNPGSummaryHost.tsx +4 -3
  23. package/src/components/cnpg/CNPGView.tsx +1 -0
  24. package/src/components/compare/CompareResourcePicker.test.tsx +58 -0
  25. package/src/components/compare/CompareViewRoute.tsx +5 -1
  26. package/src/components/compare/useCompareCandidates.ts +1 -1
  27. package/src/components/compare/useCompareLauncher.tsx +4 -2
  28. package/src/components/diagnose/DiagnoseSurface.tsx +3 -3
  29. package/src/components/diagnose/InvestigationChangesEvidence.test.tsx +352 -0
  30. package/src/components/diagnose/InvestigationEvidencePane.test.tsx +101 -0
  31. package/src/components/diagnose/InvestigationView.tsx +2 -1
  32. package/src/components/diagnose/StoryExcerpt.tsx +24 -5
  33. package/src/components/diagnose/investigationEvidence/adapters/changes.test.ts +123 -0
  34. package/src/components/diagnose/investigationEvidence/adapters/changes.ts +192 -3
  35. package/src/components/diagnose/investigationEvidence/adapters/issues.ts +73 -51
  36. package/src/components/diagnose/investigationEvidence/adapters/listCoverage.test.ts +415 -0
  37. package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +64 -2
  38. package/src/components/diagnose/investigationEvidence/adapters/resource.test.ts +37 -0
  39. package/src/components/diagnose/investigationEvidence/adapters/resource.ts +107 -8
  40. package/src/components/diagnose/investigationEvidence/adapters/testdata/get-changes-created.json +323 -0
  41. package/src/components/diagnose/investigationEvidence/bodies/inventory.tsx +66 -16
  42. package/src/components/diagnose/investigationEvidence/bodies/streams.tsx +144 -15
  43. package/src/components/diagnose/investigationEvidence/builder.ts +13 -1
  44. package/src/components/diagnose/investigationEvidence/excerpt.ts +2 -0
  45. package/src/components/diagnose/investigationEvidence/observations.ts +21 -0
  46. package/src/components/diagnose/investigationEvidence/parse.ts +57 -1
  47. package/src/components/diagnose/investigationEvidence/projection.test.ts +131 -1
  48. package/src/components/diagnose/investigationEvidence/types.ts +26 -0
  49. package/src/components/diagnose/investigationEvidencePresentation.test.ts +18 -0
  50. package/src/components/diagnose/investigationState.test.ts +36 -1
  51. package/src/components/diagnose/investigationState.ts +8 -0
  52. package/src/components/diagnose/launch.ts +2 -2
  53. package/src/components/diagnose/toolCallLabel.test.ts +9 -0
  54. package/src/components/diagnose/toolCallLabel.ts +2 -0
  55. package/src/components/dock/BottomDock.tsx +6 -3
  56. package/src/components/dock/WorkloadLogsTab.tsx +3 -0
  57. package/src/components/execution/BatchExecutionView.image-browse.test.tsx +46 -0
  58. package/src/components/execution/BatchExecutionView.render.test.tsx +29 -1
  59. package/src/components/execution/BatchExecutionView.tsx +28 -11
  60. package/src/components/execution/cluster-template-runs.render.test.tsx +42 -0
  61. package/src/components/gitops/GitOpsView.identity.test.tsx +113 -0
  62. package/src/components/gitops/GitOpsView.tsx +69 -40
  63. package/src/components/gitops/useDestinationCluster.ts +2 -1
  64. package/src/components/helm/ArtifactHubSourceSearch.test.tsx +124 -0
  65. package/src/components/helm/ArtifactHubSourceSearch.tsx +240 -0
  66. package/src/components/helm/ChartBrowser.tsx +5 -4
  67. package/src/components/helm/HelmReleaseDrawer.tsx +139 -55
  68. package/src/components/helm/HelmReleaseNotes.test.tsx +42 -0
  69. package/src/components/helm/HelmReleaseNotes.tsx +26 -0
  70. package/src/components/helm/OwnedResources.tsx +2 -2
  71. package/src/components/helm/TrackChartSourceDialog.render.test.tsx +295 -50
  72. package/src/components/helm/TrackChartSourceDialog.test.ts +3 -2
  73. package/src/components/helm/TrackChartSourceDialog.tsx +614 -85
  74. package/src/components/helm/ValuesDiffPreview.tsx +4 -1
  75. package/src/components/home/ClusterHealthCard.tsx +4 -4
  76. package/src/components/home/CostCard.test.tsx +100 -0
  77. package/src/components/home/CostCard.tsx +2 -2
  78. package/src/components/home/HelmSummary.tsx +2 -2
  79. package/src/components/home/HomeView.tsx +15 -6
  80. package/src/components/home/MCPSetupDialog.test.tsx +30 -0
  81. package/src/components/home/MCPSetupDialog.tsx +13 -6
  82. package/src/components/home/ProblemsPanel.test.tsx +1 -0
  83. package/src/components/home/mcpToolCatalog.ts +28 -2
  84. package/src/components/issues/IssuesPane.render.test.tsx +21 -0
  85. package/src/components/issues/IssuesPane.tsx +31 -7
  86. package/src/components/issues/UncheckedSourceHelp.test.tsx +42 -0
  87. package/src/components/issues/UncheckedSourceHelp.tsx +24 -0
  88. package/src/components/issues/uncheckedSources.test.ts +43 -0
  89. package/src/components/issues/uncheckedSources.ts +58 -5
  90. package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +4 -2
  91. package/src/components/resource/PrometheusCharts.overlays.test.ts +45 -0
  92. package/src/components/resource/PrometheusCharts.tsx +2 -2
  93. package/src/components/resources/ImageFilesystemModal.test.tsx +68 -0
  94. package/src/components/resources/ImageFilesystemModal.tsx +11 -4
  95. package/src/components/resources/PodFilesystemModal.tsx +2 -2
  96. package/src/components/resources/ResourcesView.scope.render.test.tsx +58 -0
  97. package/src/components/resources/ResourcesView.tsx +46 -69
  98. package/src/components/resources/renderers/FluxHelmReleaseRenderer.test.tsx +111 -0
  99. package/src/components/resources/renderers/FluxHelmReleaseRenderer.tsx +67 -0
  100. package/src/components/resources/renderers/KyvernoPolicyCoverage.scope.render.test.tsx +64 -0
  101. package/src/components/resources/renderers/KyvernoPolicyCoverage.tsx +6 -7
  102. package/src/components/resources/renderers/PodRenderer.tsx +4 -1
  103. package/src/components/settings/MyPermissionsDialog.tsx +12 -9
  104. package/src/components/settings/SettingsDialog.tsx +21 -15
  105. package/src/components/traffic/TrafficFilterSidebar.test.tsx +77 -0
  106. package/src/components/traffic/TrafficFilterSidebar.tsx +42 -31
  107. package/src/components/traffic/TrafficSourcePill.test.tsx +110 -0
  108. package/src/components/traffic/TrafficSourcePill.tsx +111 -0
  109. package/src/components/traffic/TrafficView.tsx +21 -67
  110. package/src/components/traffic/trafficFilters.test.ts +20 -1
  111. package/src/components/traffic/trafficFilters.ts +13 -0
  112. package/src/components/ui/DiagnosticsOverlay.test.ts +25 -0
  113. package/src/components/ui/DiagnosticsOverlay.tsx +2 -1
  114. package/src/components/ui/Omnibar.note.test.tsx +141 -0
  115. package/src/components/ui/Omnibar.tsx +89 -14
  116. package/src/components/ui/RadarOmnibar.test.tsx +183 -0
  117. package/src/components/ui/RadarOmnibar.tsx +38 -4
  118. package/src/components/ui/Toast.tsx +1 -1
  119. package/src/components/ui/UpdateNotification.manual.test.tsx +177 -0
  120. package/src/components/ui/UpdateNotification.test.tsx +2 -1
  121. package/src/components/ui/UpdateNotification.tsx +29 -5
  122. package/src/components/ui/omnibar-match.test.ts +37 -0
  123. package/src/components/ui/omnibar-match.ts +23 -0
  124. package/src/components/ui/searchCoverage.fixtures.ts +16 -0
  125. package/src/components/ui/searchCoverageNote.test.ts +245 -0
  126. package/src/components/ui/searchCoverageNote.ts +222 -0
  127. package/src/components/whats-new/WhatsNew.test.ts +10 -0
  128. package/src/components/whats-new/WhatsNew.tsx +5 -4
  129. package/src/components/whats-new/WhatsNewDialog.test.tsx +20 -0
  130. package/src/components/whats-new/releaseNotes.ts +57 -5
  131. package/src/components/workload/CronJobSchedulingEvidence.test.tsx +35 -0
  132. package/src/components/workload/CronJobSchedulingEvidence.tsx +37 -0
  133. package/src/components/workload/NodeDrainStatus.test.tsx +253 -0
  134. package/src/components/workload/NodeDrainStatus.tsx +55 -0
  135. package/src/components/workload/WorkloadView.tsx +43 -5
  136. package/src/context/ConnectionContext.test.ts +27 -1
  137. package/src/context/ConnectionContext.tsx +17 -7
  138. package/src/hooks/useResourceCounts.ts +2 -0
  139. package/src/index.css +2 -4
  140. package/src/index.ts +7 -0
  141. package/src/integrations/resourceHosts.test.tsx +1 -0
  142. package/src/integrations/resourceHosts.tsx +2 -0
  143. package/src/utils/artifacthub.test.ts +18 -0
  144. package/src/utils/artifacthub.ts +9 -0
  145. package/src/utils/navigation.ts +14 -0
  146. package/src/utils/wails-clipboard.ts +4 -2
@@ -226,20 +226,94 @@ export function adaptListNamespaces(
226
226
  );
227
227
  }
228
228
 
229
+ // list_resources arrives as `{summary, coverage, items}`. summary says in
230
+ // words what the rows cover and what was not read; coverage.read names the
231
+ // namespaces Radar read when that is a namespace set. A bare array is an older
232
+ // Radar's list (or a run recorded from one): it carries no coverage, so
233
+ // nothing about it may read as complete.
234
+ type ListCoverage = {
235
+ partial: boolean;
236
+ narrowed: boolean;
237
+ /** Set when Radar read a finite namespace set: rows prove nothing outside it. */
238
+ namespacesRead?: string[];
239
+ namespacesReadOmitted: number;
240
+ summary: string;
241
+ };
242
+
243
+ function listedRows(
244
+ payload: unknown,
245
+ ): { rows: unknown[]; coverage?: ListCoverage } | undefined {
246
+ if (Array.isArray(payload)) return { rows: payload };
247
+ const value = record(payload);
248
+ const coverage = record(value?.coverage);
249
+ const status = coverage?.status;
250
+ if (
251
+ !value ||
252
+ !Array.isArray(value.items) ||
253
+ !nonEmptyString(value.summary) ||
254
+ (status !== "complete" && status !== "partial")
255
+ ) {
256
+ return undefined;
257
+ }
258
+ const summary = value.summary;
259
+ const read = record(coverage?.read);
260
+ const narrowed =
261
+ Array.isArray(coverage?.narrowedBy) && coverage.narrowedBy.length > 0;
262
+ if (read?.type !== "namespaces") {
263
+ return {
264
+ rows: value.items,
265
+ coverage: {
266
+ partial: status === "partial",
267
+ narrowed,
268
+ namespacesReadOmitted: 0,
269
+ summary,
270
+ },
271
+ };
272
+ }
273
+ // A set lists every name or, when it is too large, none: then which
274
+ // namespaces were read is unknown and only the count is.
275
+ const set = record(read.namespaces);
276
+ const count = set?.count;
277
+ const names = set?.names === undefined ? [] : stringArray(set.names);
278
+ if (
279
+ !names ||
280
+ typeof count !== "number" ||
281
+ !Number.isInteger(count) ||
282
+ (set?.names !== undefined && names.length !== count)
283
+ ) {
284
+ return undefined;
285
+ }
286
+ return {
287
+ rows: value.items,
288
+ coverage: {
289
+ partial: status === "partial",
290
+ narrowed,
291
+ namespacesRead: names,
292
+ namespacesReadOmitted: count - names.length,
293
+ summary,
294
+ },
295
+ };
296
+ }
297
+
229
298
  export function adaptListResources(
230
299
  builder: ProjectionBuilder,
231
300
  source: InvestigationEvidenceSource,
232
301
  payload: unknown,
233
302
  options: { title?: string } = {},
234
303
  ): void {
235
- if (!Array.isArray(payload)) {
304
+ const listed = listedRows(payload);
305
+ if (!listed) {
236
306
  invalidPayload(builder, source);
237
307
  return;
238
308
  }
239
- const resources = payload
309
+ const { rows, coverage } = listed;
310
+ const namespacesRead = coverage?.namespacesRead;
311
+ const namespacesReadCount =
312
+ (namespacesRead?.length ?? 0) + (coverage?.namespacesReadOmitted ?? 0);
313
+ const resources = rows
240
314
  .map(resourceSummary)
241
315
  .filter((item): item is InvestigationResourceSummary => Boolean(item));
242
- if (resources.length !== payload.length) {
316
+ if (resources.length !== rows.length) {
243
317
  invalidPayload(builder, source);
244
318
  return;
245
319
  }
@@ -257,12 +331,16 @@ export function adaptListResources(
257
331
  : undefined;
258
332
  const title = options.title ?? (namespace ? `${noun} in ${namespace}` : noun);
259
333
  if (resources.length === 0) {
260
- // list_resources intentionally returns [] for some RBAC-filtered reads;
261
- // even a successful transport outcome therefore cannot prove absence.
334
+ // An older Radar returns [] for some RBAC-filtered reads, so a bare array
335
+ // cannot prove absence. Otherwise the copy is the server's summary: the
336
+ // requested kind may be an alias ("svc"), and the summary names the
337
+ // resource it resolved.
262
338
  builder.limit(
263
339
  source,
264
340
  "Resource inventory",
265
- `Radar found no matching resources for ${scope}. Anything you do not have permission to read was not searched.`,
341
+ !coverage
342
+ ? `Radar found no matching resources for ${scope}. Anything you do not have permission to read was not searched.`
343
+ : coverage.summary,
266
344
  "unknown",
267
345
  );
268
346
  return;
@@ -288,8 +366,29 @@ export function adaptListResources(
288
366
  relevance: "broader",
289
367
  tone: hasAdverseResource ? "warning" : "neutral",
290
368
  title,
291
- summary: `${resources.length} returned${nonEmptyString(args?.group) ? ` · ${args.group}` : ""}`,
292
- data: { type: "inventory", resources, scope },
369
+ summary: [
370
+ `${resources.length} returned`,
371
+ nonEmptyString(args?.group) ? args.group : undefined,
372
+ namespacesRead && (coverage?.partial || coverage?.narrowed)
373
+ ? `only ${namespacesReadCount > 2 ? `${namespacesReadCount} namespaces` : namespacesRead.join(", ")} read`
374
+ : undefined,
375
+ ]
376
+ .filter(Boolean)
377
+ .join(" · "),
378
+ data: {
379
+ type: "inventory",
380
+ resources,
381
+ scope,
382
+ ...(namespacesRead
383
+ ? {
384
+ namespacesRead,
385
+ namespacesReadOmitted: coverage!.namespacesReadOmitted,
386
+ }
387
+ : {}),
388
+ ...(coverage && (coverage.partial || coverage.narrowed)
389
+ ? { coverageNote: coverage.summary }
390
+ : {}),
391
+ },
293
392
  },
294
393
  );
295
394
  }
@@ -0,0 +1,323 @@
1
+ {
2
+ "compacted": {
3
+ "changes": [
4
+ {
5
+ "kind": "Deployment",
6
+ "apiVersion": "apps/v1",
7
+ "namespace": "shop",
8
+ "name": "checkout",
9
+ "changeType": "update",
10
+ "summary": "env(checkout/CART_ADDR) changed",
11
+ "timestamp": "2026-10-16T04:55:24+03:00",
12
+ "change_category": "spec_config",
13
+ "rank_reason": "application configuration field changed",
14
+ "application_configuration_change": true,
15
+ "fields": [
16
+ {
17
+ "path": "spec.template.spec.containers[checkout].env[CART_ADDR]",
18
+ "oldValue": "cart:7070",
19
+ "newValue": "localhost:7070"
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ "kind": "Deployment",
25
+ "apiVersion": "apps/v1",
26
+ "namespace": "shop",
27
+ "name": "debug",
28
+ "changeType": "add",
29
+ "summary": "add",
30
+ "timestamp": "2026-10-16T04:53:24+03:00",
31
+ "change_category": "lifecycle",
32
+ "rank_reason": "resource create/delete for config or desired state"
33
+ },
34
+ {
35
+ "kind": "NetworkPolicy",
36
+ "apiVersion": "networking.k8s.io/v1",
37
+ "namespace": "shop",
38
+ "name": "deny-all",
39
+ "changeType": "add",
40
+ "summary": "add",
41
+ "timestamp": "2026-10-16T04:43:28+03:00",
42
+ "change_category": "lifecycle",
43
+ "rank_reason": "resource create/delete for config or desired state"
44
+ },
45
+ {
46
+ "kind": "Service",
47
+ "apiVersion": "v1",
48
+ "namespace": "shop",
49
+ "name": "legacy",
50
+ "changeType": "delete",
51
+ "summary": "delete",
52
+ "timestamp": "2026-10-16T04:43:26+03:00",
53
+ "change_category": "lifecycle",
54
+ "rank_reason": "resource create/delete for config or desired state"
55
+ },
56
+ {
57
+ "kind": "Deployment",
58
+ "apiVersion": "apps/v1",
59
+ "namespace": "shop",
60
+ "name": "cart",
61
+ "changeType": "update",
62
+ "summary": "ready: 0→1",
63
+ "timestamp": "2026-10-16T04:43:54+03:00",
64
+ "change_category": "runtime_status",
65
+ "rank_reason": "status field changed",
66
+ "fields": [
67
+ {
68
+ "path": "status.readyReplicas",
69
+ "oldValue": 0,
70
+ "newValue": 1
71
+ }
72
+ ]
73
+ }
74
+ ],
75
+ "created": [
76
+ {
77
+ "namespace": "shop",
78
+ "first": "2026-10-16T04:43:24+03:00",
79
+ "count": 13,
80
+ "apiVersions": {
81
+ "ConfigMap": "v1",
82
+ "Deployment": "apps/v1",
83
+ "Service": "v1"
84
+ },
85
+ "objects": [
86
+ "+0s Deployment/cart",
87
+ "+0s Service/cart",
88
+ "+1s Deployment/checkout",
89
+ "+1s Service/checkout",
90
+ "+2s Deployment/frontend",
91
+ "+2s Service/frontend",
92
+ "+3s ConfigMap/checkout-config (used by Deployment/checkout)",
93
+ "+3s Deployment/payment",
94
+ "+3s Service/payment",
95
+ "+4s Deployment/shipping",
96
+ "+4s Service/shipping",
97
+ "+5s Deployment/catalog",
98
+ "+5s Service/catalog"
99
+ ]
100
+ }
101
+ ]
102
+ },
103
+ "original": {
104
+ "changes": [
105
+ {
106
+ "kind": "Deployment",
107
+ "apiVersion": "apps/v1",
108
+ "namespace": "shop",
109
+ "name": "checkout",
110
+ "changeType": "update",
111
+ "summary": "env(checkout/CART_ADDR) changed",
112
+ "timestamp": "2026-10-16T04:55:24+03:00",
113
+ "change_category": "spec_config",
114
+ "rank_reason": "application configuration field changed",
115
+ "application_configuration_change": true,
116
+ "fields": [
117
+ {
118
+ "path": "spec.template.spec.containers[checkout].env[CART_ADDR]",
119
+ "oldValue": "cart:7070",
120
+ "newValue": "localhost:7070"
121
+ }
122
+ ]
123
+ },
124
+ {
125
+ "kind": "Deployment",
126
+ "apiVersion": "apps/v1",
127
+ "namespace": "shop",
128
+ "name": "debug",
129
+ "changeType": "add",
130
+ "summary": "add",
131
+ "timestamp": "2026-10-16T04:53:24+03:00",
132
+ "change_category": "lifecycle",
133
+ "rank_reason": "resource create/delete for config or desired state"
134
+ },
135
+ {
136
+ "kind": "Deployment",
137
+ "apiVersion": "apps/v1",
138
+ "namespace": "shop",
139
+ "name": "catalog",
140
+ "changeType": "add",
141
+ "summary": "add",
142
+ "timestamp": "2026-10-16T04:43:29+03:00",
143
+ "change_category": "lifecycle",
144
+ "rank_reason": "resource create/delete for config or desired state"
145
+ },
146
+ {
147
+ "kind": "Service",
148
+ "apiVersion": "v1",
149
+ "namespace": "shop",
150
+ "name": "catalog",
151
+ "changeType": "add",
152
+ "summary": "add",
153
+ "timestamp": "2026-10-16T04:43:29+03:00",
154
+ "change_category": "lifecycle",
155
+ "rank_reason": "resource create/delete for config or desired state"
156
+ },
157
+ {
158
+ "kind": "Deployment",
159
+ "apiVersion": "apps/v1",
160
+ "namespace": "shop",
161
+ "name": "shipping",
162
+ "changeType": "add",
163
+ "summary": "add",
164
+ "timestamp": "2026-10-16T04:43:28+03:00",
165
+ "change_category": "lifecycle",
166
+ "rank_reason": "resource create/delete for config or desired state"
167
+ },
168
+ {
169
+ "kind": "NetworkPolicy",
170
+ "apiVersion": "networking.k8s.io/v1",
171
+ "namespace": "shop",
172
+ "name": "deny-all",
173
+ "changeType": "add",
174
+ "summary": "add",
175
+ "timestamp": "2026-10-16T04:43:28+03:00",
176
+ "change_category": "lifecycle",
177
+ "rank_reason": "resource create/delete for config or desired state"
178
+ },
179
+ {
180
+ "kind": "Service",
181
+ "apiVersion": "v1",
182
+ "namespace": "shop",
183
+ "name": "shipping",
184
+ "changeType": "add",
185
+ "summary": "add",
186
+ "timestamp": "2026-10-16T04:43:28+03:00",
187
+ "change_category": "lifecycle",
188
+ "rank_reason": "resource create/delete for config or desired state"
189
+ },
190
+ {
191
+ "kind": "ConfigMap",
192
+ "apiVersion": "v1",
193
+ "namespace": "shop",
194
+ "name": "checkout-config",
195
+ "changeType": "add",
196
+ "summary": "add",
197
+ "timestamp": "2026-10-16T04:43:27+03:00",
198
+ "change_category": "lifecycle",
199
+ "rank_reason": "resource create/delete for config or desired state",
200
+ "consumed_by": [
201
+ "Deployment/checkout"
202
+ ]
203
+ },
204
+ {
205
+ "kind": "Deployment",
206
+ "apiVersion": "apps/v1",
207
+ "namespace": "shop",
208
+ "name": "payment",
209
+ "changeType": "add",
210
+ "summary": "add",
211
+ "timestamp": "2026-10-16T04:43:27+03:00",
212
+ "change_category": "lifecycle",
213
+ "rank_reason": "resource create/delete for config or desired state"
214
+ },
215
+ {
216
+ "kind": "Service",
217
+ "apiVersion": "v1",
218
+ "namespace": "shop",
219
+ "name": "payment",
220
+ "changeType": "add",
221
+ "summary": "add",
222
+ "timestamp": "2026-10-16T04:43:27+03:00",
223
+ "change_category": "lifecycle",
224
+ "rank_reason": "resource create/delete for config or desired state"
225
+ },
226
+ {
227
+ "kind": "Deployment",
228
+ "apiVersion": "apps/v1",
229
+ "namespace": "shop",
230
+ "name": "frontend",
231
+ "changeType": "add",
232
+ "summary": "add",
233
+ "timestamp": "2026-10-16T04:43:26+03:00",
234
+ "change_category": "lifecycle",
235
+ "rank_reason": "resource create/delete for config or desired state"
236
+ },
237
+ {
238
+ "kind": "Service",
239
+ "apiVersion": "v1",
240
+ "namespace": "shop",
241
+ "name": "frontend",
242
+ "changeType": "add",
243
+ "summary": "add",
244
+ "timestamp": "2026-10-16T04:43:26+03:00",
245
+ "change_category": "lifecycle",
246
+ "rank_reason": "resource create/delete for config or desired state"
247
+ },
248
+ {
249
+ "kind": "Service",
250
+ "apiVersion": "v1",
251
+ "namespace": "shop",
252
+ "name": "legacy",
253
+ "changeType": "delete",
254
+ "summary": "delete",
255
+ "timestamp": "2026-10-16T04:43:26+03:00",
256
+ "change_category": "lifecycle",
257
+ "rank_reason": "resource create/delete for config or desired state"
258
+ },
259
+ {
260
+ "kind": "Deployment",
261
+ "apiVersion": "apps/v1",
262
+ "namespace": "shop",
263
+ "name": "checkout",
264
+ "changeType": "add",
265
+ "summary": "add",
266
+ "timestamp": "2026-10-16T04:43:25+03:00",
267
+ "change_category": "lifecycle",
268
+ "rank_reason": "resource create/delete for config or desired state"
269
+ },
270
+ {
271
+ "kind": "Service",
272
+ "apiVersion": "v1",
273
+ "namespace": "shop",
274
+ "name": "checkout",
275
+ "changeType": "add",
276
+ "summary": "add",
277
+ "timestamp": "2026-10-16T04:43:25+03:00",
278
+ "change_category": "lifecycle",
279
+ "rank_reason": "resource create/delete for config or desired state"
280
+ },
281
+ {
282
+ "kind": "Deployment",
283
+ "apiVersion": "apps/v1",
284
+ "namespace": "shop",
285
+ "name": "cart",
286
+ "changeType": "add",
287
+ "summary": "add",
288
+ "timestamp": "2026-10-16T04:43:24+03:00",
289
+ "change_category": "lifecycle",
290
+ "rank_reason": "resource create/delete for config or desired state"
291
+ },
292
+ {
293
+ "kind": "Service",
294
+ "apiVersion": "v1",
295
+ "namespace": "shop",
296
+ "name": "cart",
297
+ "changeType": "add",
298
+ "summary": "add",
299
+ "timestamp": "2026-10-16T04:43:24+03:00",
300
+ "change_category": "lifecycle",
301
+ "rank_reason": "resource create/delete for config or desired state"
302
+ },
303
+ {
304
+ "kind": "Deployment",
305
+ "apiVersion": "apps/v1",
306
+ "namespace": "shop",
307
+ "name": "cart",
308
+ "changeType": "update",
309
+ "summary": "ready: 0→1",
310
+ "timestamp": "2026-10-16T04:43:54+03:00",
311
+ "change_category": "runtime_status",
312
+ "rank_reason": "status field changed",
313
+ "fields": [
314
+ {
315
+ "path": "status.readyReplicas",
316
+ "oldValue": 0,
317
+ "newValue": 1
318
+ }
319
+ ]
320
+ }
321
+ ]
322
+ }
323
+ }
@@ -9,9 +9,6 @@ import {
9
9
  import { listingRowNamesSubject, sameKind } from "../../investigationCase";
10
10
  import type { EvidenceDataOf } from "../cardParts";
11
11
 
12
- // The rows the citations on a card name, in citation order: one row when the
13
- // name picks exactly one entry, otherwise a line saying the entry is absent
14
- // or which entries the name could mean.
15
12
  export function listingScopeNamespace(
16
13
  source: InvestigationEvidenceSource,
17
14
  ): string | undefined {
@@ -19,24 +16,45 @@ export function listingScopeNamespace(
19
16
  return typeof namespace === "string" && namespace ? namespace : undefined;
20
17
  }
21
18
 
19
+ export interface NamedInventoryRow {
20
+ key: string;
21
+ label: string;
22
+ matches: number;
23
+ row?: InvestigationResourceSummary;
24
+ /** No row matches, and the subject's namespace is one the listing did not read. */
25
+ notRead?: string;
26
+ /**
27
+ * No row matches, on a listing that read `count` namespaces without naming
28
+ * them. With a `namespace`, the subject's namespace may not have been one
29
+ * of them; without, the subject is only known to be absent from those.
30
+ */
31
+ readUnnamed?: { count: number; namespace?: string };
32
+ /**
33
+ * No row matches a subject that names no namespace, on a listing that read
34
+ * only these namespaces.
35
+ */
36
+ readOnlyIn?: readonly string[];
37
+ }
38
+
39
+ // The rows the citations on a card name, in citation order: one row when the
40
+ // name picks exactly one entry, otherwise a line saying the entry is absent,
41
+ // that where it would be was not read, or which entries the name could mean.
22
42
  export function namedInventoryRows(
23
43
  resources: InvestigationResourceSummary[],
24
44
  items: readonly { subject?: DiagnosisEvidenceSubject }[],
25
45
  /** The namespace the listing call was scoped to; rows omit it then. */
26
46
  scopeNamespace?: string,
27
- ): {
28
- key: string;
29
- label: string;
30
- matches: number;
31
- row?: InvestigationResourceSummary;
32
- }[] {
47
+ /** Set when Radar's collector read the listed kind only in these namespaces. */
48
+ namespacesRead?: readonly string[],
49
+ namespacesReadOmitted = 0,
50
+ ): NamedInventoryRow[] {
51
+ const observedNamespaces = new Set(
52
+ resources
53
+ .map((resource) => resource.namespace ?? scopeNamespace)
54
+ .filter(Boolean),
55
+ );
33
56
  const seen = new Set<string>();
34
- const out: {
35
- key: string;
36
- label: string;
37
- matches: number;
38
- row?: InvestigationResourceSummary;
39
- }[] = [];
57
+ const out: NamedInventoryRow[] = [];
40
58
  for (const item of items) {
41
59
  const subject = item.subject;
42
60
  if (!subject?.name) continue;
@@ -64,11 +82,36 @@ export function namedInventoryRows(
64
82
  declaringObject(resource) ||
65
83
  (resource.namespace ?? scopeNamespace) === namespace),
66
84
  );
85
+ // A name the rows lack is absent only where the listing looked.
86
+ const unread = namespacesRead && matches.length === 0;
67
87
  out.push({
68
88
  key,
69
89
  label: namespace ? `${namespace}/${subject.name}` : subject.name,
70
90
  matches: matches.length,
71
91
  row: matches.length === 1 ? matches[0] : undefined,
92
+ notRead:
93
+ unread &&
94
+ namespace &&
95
+ namespacesReadOmitted === 0 &&
96
+ !namespacesRead.includes(namespace) &&
97
+ !observedNamespaces.has(namespace)
98
+ ? namespace
99
+ : undefined,
100
+ readOnlyIn:
101
+ unread && !namespace && namespacesReadOmitted === 0
102
+ ? namespacesRead
103
+ : undefined,
104
+ readUnnamed:
105
+ unread &&
106
+ namespacesReadOmitted > 0 &&
107
+ (!namespace ||
108
+ (!namespacesRead.includes(namespace) &&
109
+ !observedNamespaces.has(namespace)))
110
+ ? {
111
+ count: namespacesRead.length + namespacesReadOmitted,
112
+ namespace,
113
+ }
114
+ : undefined,
72
115
  });
73
116
  }
74
117
  return out;
@@ -143,7 +186,7 @@ export function InventoryBody({
143
186
  ...lead,
144
187
  ...data.resources.filter((resource) => !lead.includes(resource)),
145
188
  ];
146
- return (
189
+ const list = (
147
190
  <div className="max-h-72 overflow-y-auto rounded-md border border-theme-border">
148
191
  {rows.map((resource, index) => (
149
192
  <InventoryRow
@@ -155,4 +198,11 @@ export function InventoryBody({
155
198
  ))}
156
199
  </div>
157
200
  );
201
+ if (!data.coverageNote) return list;
202
+ return (
203
+ <div className="flex flex-col gap-2">
204
+ <p className="text-xs text-theme-text-secondary">{data.coverageNote}</p>
205
+ {list}
206
+ </div>
207
+ );
158
208
  }