Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Label key-collision lifecycle events in the finding timeline

rcourtmanf4d57c683688
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index dd68e9138e..c2646abb46 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -2343,10 +2343,8 @@ old issue: both `content_replaced` and `regressed` events appear).
Rephrasings and identical re-detections stay event-free per the
heartbeat-not-transition rule. The shared lifecycle presentation
(`frontend-modern/src/utils/aiFindingPresentation.ts`,
-patrol-intelligence subsystem) renders unknown lifecycle types through the
-identifier-formatter fallback, so the event reads "Content replaced" today;
-a dedicated label is patrol-intelligence UI work and lands with that
-subsystem's own ceremony.
+patrol-intelligence subsystem) labels the event "Re-detected with different
+details" — see that contract's Current State entry for the UI-side rule.
`TestFindingsStore_KeyCollisionRecordsContentReplacedEvent` and its
companion tests (`internal/ai/findings_lifecycle_test.go`) pin the behavior.
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index 9cad14023f..8870bcf3c8 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -434,6 +434,18 @@ Patrol-specific presentation helpers.
## Current State
+The finding lifecycle timeline renders backend lifecycle event types through
+the shared label map in
+`frontend-modern/src/utils/aiFindingPresentation.ts`
+(`formatFindingLifecycleType`), with unknown types falling back to the
+identifier formatter. The `content_replaced` event — emitted by the
+ai-runtime findings store when a same-key re-detection's text is
+substantially different from the existing finding (a key collision; see the
+ai-runtime contract's Current State entry) — is labeled "Re-detected with
+different details" so the operator timeline explains the shift in plain
+language; the event's metadata carries the previous and new titles.
+`FindingsPanel.test.ts` (`lifecycleLabels`) pins the label.
+
The Patrol findings panel
(`frontend-modern/src/components/AI/FindingsPanel.tsx`) dropped its "Open
related infrastructure / workloads / storage / recovery" cross-jump chip
diff --git a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
index b4e113da89..70672e6cd8 100644
--- a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
+++ b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
@@ -1000,6 +1000,16 @@ describe('aiFindingPresentation', () => {
it('has dismissed label', () => {
expect(formatFindingLifecycleType('dismissed')).toBe('Dismissed');
});
+
+ it('labels a key-collision content replacement as a re-detection with different details', () => {
+ // Backend emits content_replaced when a same-key re-detection's text
+ // is substantially different from the existing finding (a key
+ // collision); the timeline label must explain the shift in operator
+ // language rather than the raw identifier fallback.
+ expect(formatFindingLifecycleType('content_replaced')).toBe(
+ 'Re-detected with different details',
+ );
+ });
});
describe('formatLifecycleType', () => {
diff --git a/frontend-modern/src/utils/aiFindingPresentation.ts b/frontend-modern/src/utils/aiFindingPresentation.ts
index 12ed024956..8100fb1e74 100644
--- a/frontend-modern/src/utils/aiFindingPresentation.ts
+++ b/frontend-modern/src/utils/aiFindingPresentation.ts
@@ -109,6 +109,7 @@ const FINDING_LIFECYCLE_LABELS: Record<string, string> = {
loop_state: 'Loop state changed',
seen_while_suppressed: 'Seen while suppressed',
loop_transition_violation: 'Invalid transition blocked',
+ content_replaced: 'Re-detected with different details',
};
const FINDING_STATUS_BADGE_CLASSES: Record<string, string> = {