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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
feat(alerts): add per-alert snooze
rcourtmanff507a6e4438
diff --git a/docs/API.md b/docs/API.mdindex 6cb1eecf3b..7de7f4d590 100644--- a/docs/API.md+++ b/docs/API.md@@ -634,8 +634,10 @@ Alert configuration and history (requires `monitoring:read`/`monitoring:write`).- `POST /api/alerts/incidents/note`- `POST /api/alerts/bulk/acknowledge`- `POST /api/alerts/bulk/clear`-- `POST /api/alerts/acknowledge` (body: `{ "id": "alert-id" }`)-- `POST /api/alerts/unacknowledge` (body: `{ "id": "alert-id" }`)+- `POST /api/alerts/acknowledge` (body: `{ "alertIdentifier": "alert-id" }`)+- `POST /api/alerts/unacknowledge` (body: `{ "alertIdentifier": "alert-id" }`)+- `POST /api/alerts/snooze` (body: `{ "alertIdentifier": "alert-id", "until": "RFC3339 timestamp" }`; pauses delivery and escalation for up to 30 days while monitoring continues)+- `POST /api/alerts/unsnooze` (body: `{ "alertIdentifier": "alert-id" }`; resumes normal policy without resolving the incident)- `POST /api/alerts/clear` (body: `{ "id": "alert-id" }`)---diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex e088f85338..7d8ce48950 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -507,6 +507,11 @@ The authenticated `GET /api/updates/release-notes` projection follows the sameserver-only boundary: it reads the exact published notes for the running Pulseserver release and must not be used as agent version, enrollment, updateavailability, or fleet rollout evidence.+The alerts-owned `POST /api/alerts/snooze` and+`POST /api/alerts/unsnooze` handlers share `internal/api/` routing only. They+pause and resume notification and escalation policy for one existing incident;+they grant no agent enrollment, liveness, command, update, removal, or+fleet-control authority, and agent lifecycle state must not key off them.Workflow starter counts on that endpoint,contextual Assistant/external-agent collaboration counts inside the Assistantstep, the content-free Patrol control starter split, and Patrol controldiff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex 967eaa9084..f65a3f1f81 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -6240,6 +6240,11 @@ for those events now belongs to canonical `ResourceChange` kinds such as`command_executed` and `runbook_executed`, keyed by canonical resource ID andlinked back to the alert through metadata instead of being stored only in AImemory.+Alert snooze and resume entries follow the same projection rule: AI incident+memory may present `alert_snoozed` and `alert_unsnoozed` for operator context,+including actor and exact expiry metadata, but it must read them from canonical+resource history. Those events pause and restore alert operations; they do not+infer acknowledgement, resolution, or a new incident identity.The patrol-local `memory.ChangeDetector.GetChangesSummary` path now alsodelegates to the shared memory recent-change presentation helper, so anyfuture fallback summary entry point inherits the same heading, resourcediff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.mdindex 2132feb984..fa6f28a780 100644--- a/docs/release-control/v6/internal/subsystems/alerts.md+++ b/docs/release-control/v6/internal/subsystems/alerts.md@@ -1919,6 +1919,18 @@ remains inspectable. Expiry or explicit unsuppression returns the record to itsdetector-owned state; it never resolves it. Only fresh sufficient recoveryevidence may enter resolving, and only detector recovery may resolve.+Per-alert snooze is the customer-facing bounded suppression contract, not a+page-local timer. `SnoozeAlert` writes the same canonical operational record,+requires a future expiry no more than 30 days away, and appends a durable+`snoozed` lifecycle snapshot. While active, notification dispatch, recovery+delivery, delivery diagnosis, and escalation all consult that one record.+Expiry runs as an explicit `unsnoozed` transition and restores `acknowledged`+or `open` according to the underlying alert without resolving the incident.+Skipped escalation levels are not replayed in a burst: the remaining schedule+resumes from the unsnooze transition while the incident's original start time+and duration remain intact. The alerts overview exposes preset bounded holds,+the exact local expiry, and an explicit Resume action over this API-owned state.+### Canonical threshold-override successionAlert threshold overrides are persisted under the current canonical resourcediff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 236a6fe3f1..34b89981f3 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -4461,6 +4461,18 @@ window as its delivery-attempt log, with an explicit bounded limit. That eventrequest runs independently of `GET /api/notifications/delivery-log`; failureof either API must not recast the other response as empty or unavailable.+Per-alert snooze is a monitoring-write mutation over canonical alert identity.+`POST /api/alerts/snooze` accepts `alertIdentifier` and an RFC 3339 `until`,+rejects missing, past, or more-than-30-day expiries, and returns the normalized+UTC expiry. `POST /api/alerts/unsnooze` accepts the same canonical identifier.+Both routes require `monitoring:write`, synchronize and broadcast active alert+state, and return `404` for an unknown occurrence. They pause or resume delivery+policy only; neither route resolves, clears, or changes detector truth.+The durable lifecycle events also project to canonical resource-change kinds+`alert_snoozed` and `alert_unsnoozed`, which typed clients must retain in+resource history and incident-timeline filters rather than collapsing into an+unknown generic event.+The generated PVE setup-script temperature wrapper is part of the API contractfor legacy SSH sensor collection. Discovery uses non-opening `smartctl --scan`and merges typed scan targets with `lsblk` transport evidence. Direct Linuxdiff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 2991224cf3..9924fde4ab 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -406,6 +406,12 @@ wizard shell, or page-local preview renderer for monitored-system impact.Frontend localization is a shared primitive boundary. Locale support must flowthrough typed message catalogs with an English fallback and explicit seedlocale coverage rather than page-local string switches.+Alert snooze and resume copy follows that same boundary: action labels, bounded+duration presets, monitoring-continuity wording, exact-expiry presentation,+failure feedback, and timeline labels must stay in the typed English, German,+and Spanish catalogs. The product surface may format the chosen instant in the+viewer locale, but must not duplicate those lifecycle strings inside the alert+card or dialog component.Date and number formatting is part of that boundary and is separate from themessage catalog. Every `toLocaleString`, `toLocaleDateString`,diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.mdindex 6b8cfa5150..0dc18a8217 100644--- a/docs/release-control/v6/internal/subsystems/monitoring.md+++ b/docs/release-control/v6/internal/subsystems/monitoring.md@@ -2075,8 +2075,12 @@ live monitoring updates and historical inspection stay aligned.That same ownership now includes the resource-history projection of canonicalalert-lifecycle facts. The alerts-owned SQLite event log is the lifecycle sourceof truth; monitoring consumes its delivery-independent lifecycle seam and-materializes fired, acknowledged, unacknowledged, and resolved breadcrumbs in-the unified-resource change store. Projection IDs derive deterministically from+materializes fired, acknowledged, unacknowledged, snoozed, unsnoozed, and+resolved breadcrumbs in the unified-resource change store. Snooze projections+carry their actor and exact expiry so timelines explain both who paused+operations and when automatic delivery and escalation will resume; neither+transition changes acknowledgement, resolution, or incident identity.+Projection IDs derive deterministically fromalert identity, canonical resource, transition kind, and occurrence time, sorestart repair and duplicate consumer delivery are idempotent. Notificationactivation, quiet hours, grouping, throttling, and destination health may neverdiff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.mdindex d438caf6fa..5dcc80e210 100644--- a/docs/release-control/v6/internal/subsystems/security-privacy.md+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md@@ -412,6 +412,11 @@ the `white_label` branding entitlement.security/privacy terminology and destination confidentiality. Pausingdelivery changes no authorization, tenant boundary, destination secret, oractive-alert evidence access rule.+ Per-alert snooze and resume remain authenticated `monitoring:write`+ operations. Their canonical lifecycle projection may retain the authenticated+ actor and exact expiry needed for auditability, but must not copy destination+ credentials, recipient details, alert evidence, or other tenant-private+ notification configuration into the resource or incident timeline.6. Change operator-facing telemetry/adoption reporting through `scripts/telemetry_adoption_report.py` together with the privacy disclosure whenever release-identity interpretation changes.The adoption report excludes mock-fixture-fleet-signature rows (120×NKubernetes pods with 7×N VMware hosts, the `internal/mock` template) fromdiff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 4a6076010d..36f413ddbc 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -5582,6 +5582,11 @@ delivery outcomes and the delivery gate state only; they add no storage,backup, snapshot, restore, retention, cleanup, or recovery capability, writenothing, and leave storage and recovery state, evidence freshness,persistence, and admission contracts unchanged.+The alerts-owned per-incident snooze and resume routes share the same boundary:+they pause and restore notification and escalation policy while monitoring and+resolution detection continue. A snooze is not a recovery point, backup hold,+retention override, restore admission, or storage-action approval, and its+expiry must not be interpreted as recovery evidence.### Docker command-session identity recovery does not grant storage authoritydiff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex 4804041e13..5dbb464036 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -3103,8 +3103,12 @@ another capability.The canonical resource timeline now also owns durable incident-response factsthat materially changed resource investigation state. `ResourceChange` kindssuch as `alert_fired`, `alert_acknowledged`, `alert_unacknowledged`,-`alert_resolved`, `command_executed`, and `runbook_executed` are part of the-canonical history contract, not optional AI-local annotations. Alert-scoped+`alert_snoozed`, `alert_unsnoozed`, `alert_resolved`, `command_executed`, and+`runbook_executed` are part of the canonical history contract, not optional+AI-local annotations. Snooze and resume projections must preserve the actor+and exact suppression expiry when present; they pause delivery and escalation+without acknowledging, resolving, or replacing the underlying incident.+Alert-scopedincident memory may still project those events for one investigation thread,but the durable source of truth for resource-affecting alert lifecycle andremediation activity now belongs to unified-resource history keyed bydiff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.jsonindex 116bcb4dd5..d8e11e6920 100644--- a/frontend-modern/browser-verification.json+++ b/frontend-modern/browser-verification.json@@ -1,48 +1,53 @@{"version": 1,- "base_sha": "f6773f262a7ace6418fc3ab6f890307290a3de99",- "verified_at": "2026-08-27T15:02:27Z",+ "base_sha": "553592d2bd59d7983bb988700576ba2d2a3a945c",+ "verified_at": "2026-08-27T16:12:00Z","result": "passed","changed_paths": ["frontend-modern/src/api/alerts.ts",- "frontend-modern/src/types/alerts.ts",- "frontend-modern/src/features/alerts/AlertDeadManDestinationSection.tsx",- "frontend-modern/src/features/alerts/AlertsConfigurationSurface.tsx",- "frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx",- "frontend-modern/src/features/alerts/useAlertDestinationsState.ts",- "frontend-modern/src/features/alerts/useAlertsConfigurationState.ts"+ "frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx",+ "frontend-modern/src/features/alerts/AlertSnoozeAction.tsx",+ "frontend-modern/src/features/alerts/types.ts",+ "frontend-modern/src/features/alerts/useAlertOverviewState.ts",+ "frontend-modern/src/features/alerts/useAlertSnoozeState.ts",+ "frontend-modern/src/i18n/messages.de.ts",+ "frontend-modern/src/i18n/messages.es.ts",+ "frontend-modern/src/i18n/messages.ts",+ "frontend-modern/src/types/resource.ts",+ "frontend-modern/src/utils/alertOverviewPresentation.ts",+ "frontend-modern/src/utils/resourceChangePresentation.ts"],"content_sha256": {- "frontend-modern/src/api/alerts.ts": "0158e753c8d590e62551069458659ff95eee07bb48f5fb95d43f395cae3d5b48",- "frontend-modern/src/types/alerts.ts": "1b63d2b690ad43267a23271f0d3244fcb8a51ceaab85b9266182f8033c242495",- "frontend-modern/src/features/alerts/AlertDeadManDestinationSection.tsx": "4f7e355bfaa025b2645e74ec43a81489d3709fa5aae6c44c86d33c3946ae03c7",- "frontend-modern/src/features/alerts/AlertsConfigurationSurface.tsx": "6ec0e78c6383ce62a1f55b1adac341d6cae0667e4a052ee276cc4a6c68015bf3",- "frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx": "0f70dd5cbf6cb962fe2474d3932b7e79c7d868ea3aad97280aae8d03a1b3c4fa",- "frontend-modern/src/features/alerts/useAlertDestinationsState.ts": "28fd0ab1312e2d599bad73dc8a269aebc9de2a8a85e91b188c8566fb68586dbb",- "frontend-modern/src/features/alerts/useAlertsConfigurationState.ts": "0d81fabff6da2f2d044f74d60c69f02a17989d241015ac7d134bd6840a8db34d"+ "frontend-modern/src/api/alerts.ts": "bfd0ee6c8076e0f75308578d11c33c519340b17a23c604037fe8536d3d54f2be",+ "frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx": "662d6f7b47418e1c80cf916f5ac818159a545d3f7716e908491a55e042be2873",+ "frontend-modern/src/features/alerts/AlertSnoozeAction.tsx": "339db07fb2b236f970dd3f79bd81517b82281a2871149fec7f4d5df0c8a17842",+ "frontend-modern/src/features/alerts/types.ts": "e57351b3e8c56a3d15c7c486b8b8049f3bb7181fc30479fa398ede489aea6816",+ "frontend-modern/src/features/alerts/useAlertOverviewState.ts": "02b5eae728ede490710d5ba334537193c89bfe9e25a8df26aa574f03b80936ad",+ "frontend-modern/src/features/alerts/useAlertSnoozeState.ts": "5857a30196c2bd8156dfbace5d0d006f348f5d7eb1ef4720108eb1f43f2118e2",+ "frontend-modern/src/i18n/messages.de.ts": "652fefe6547386203ea749febd518d12d0a9538d112485bd87f8bfee5218d95c",+ "frontend-modern/src/i18n/messages.es.ts": "21adb4aff365b5f588fa48b9390dc4524a4954decc63ad366d492212f13c2dbc",+ "frontend-modern/src/i18n/messages.ts": "2979a81f676e50499302a89e7adb4a2b6c618258debf1d4ea09a67f9c153a7e8",+ "frontend-modern/src/types/resource.ts": "81d378c5923075dbdbf983083a896b28db11da894814904725456c508854cd10",+ "frontend-modern/src/utils/alertOverviewPresentation.ts": "82cf34fd090e39b51545c8cc90abf7fb1edfb5fbec3d23cbbe79e2d7fd02752f",+ "frontend-modern/src/utils/resourceChangePresentation.ts": "b7ddcd8401da17c264ad5804d93187b733faa2668f81df1fb81098f773235d17"},- "routes": ["/alerts/notifications"],+ "routes": ["/alerts/overview"],"viewports": [- {- "width": 1280,- "height": 800- },- {- "width": 390,- "height": 844- }+ { "width": 1280, "height": 800 },+ { "width": 390, "height": 844 }],"states": [- "unconfigured external watchdog with one-minute heartbeat and three-minute grace guidance",- "configured external watchdog with credential-masked replacement placeholder and explicit removal control",- "unreachable external watchdog with delivery-failure status, monitoring progress, and sanitized error",- "removed external watchdog returning atomically to the unconfigured state"+ "active unacknowledged incident with Snooze action",+ "preset snooze dialog with one-hour, two-hour, eight-hour, tomorrow-morning, and seven-day holds",+ "snoozed incident with exact local expiry, Resume action, and suppressed delivery diagnosis",+ "resumed incident with normal actions restored",+ "expanded incident timeline containing Snoozed and Resumed lifecycle events"],"interactions": [- "opened Alerts Notifications and confirmed the external watchdog panel is part of the destination workflow",- "entered a healthchecks-compatible URL, toggled reveal and conceal, saved, reloaded, and confirmed the credential was replaced by a masked placeholder",- "confirmed an unreachable watchdog reports delivery failure without exposing its URL or token",- "verified the panel layout and status grid at 390x844 with no horizontal control overflow",- "removed the destination, saved, reloaded, and confirmed Not configured state, normal placeholder, and no browser errors"+ "opened Alerts Overview and confirmed every eligible active incident exposes Snooze beside acknowledgement and Timeline",+ "opened the preset dialog and confirmed its monitoring-continues contract and bounded duration choices",+ "snoozed a live local incident and confirmed the exact expiry, Resume action, toast, and durable timeline event",+ "resumed the incident and confirmed the open timeline refreshed immediately with Alert notifications resumed",+ "verified the dialog and alert workflow at 390x844 with readable copy and no horizontal control overflow"]}diff --git a/frontend-modern/public/docs/API.md b/frontend-modern/public/docs/API.mdindex 6cb1eecf3b..7de7f4d590 100644--- a/frontend-modern/public/docs/API.md+++ b/frontend-modern/public/docs/API.md@@ -634,8 +634,10 @@ Alert configuration and history (requires `monitoring:read`/`monitoring:write`).- `POST /api/alerts/incidents/note`- `POST /api/alerts/bulk/acknowledge`- `POST /api/alerts/bulk/clear`-- `POST /api/alerts/acknowledge` (body: `{ "id": "alert-id" }`)-- `POST /api/alerts/unacknowledge` (body: `{ "id": "alert-id" }`)+- `POST /api/alerts/acknowledge` (body: `{ "alertIdentifier": "alert-id" }`)+- `POST /api/alerts/unacknowledge` (body: `{ "alertIdentifier": "alert-id" }`)+- `POST /api/alerts/snooze` (body: `{ "alertIdentifier": "alert-id", "until": "RFC3339 timestamp" }`; pauses delivery and escalation for up to 30 days while monitoring continues)+- `POST /api/alerts/unsnooze` (body: `{ "alertIdentifier": "alert-id" }`; resumes normal policy without resolving the incident)- `POST /api/alerts/clear` (body: `{ "id": "alert-id" }`)---diff --git a/frontend-modern/src/api/__tests__/alerts.test.ts b/frontend-modern/src/api/__tests__/alerts.test.tsindex 8cb1663726..c4e804930f 100644--- a/frontend-modern/src/api/__tests__/alerts.test.ts+++ b/frontend-modern/src/api/__tests__/alerts.test.ts@@ -249,4 +249,27 @@ describe('AlertsAPI', () => {expect(result).toEqual({ success: true, results: [] });});});++ describe('incident snooze', () => {+ it('snoozes and resumes by canonical alert identifier', async () => {+ vi.mocked(apiFetchJSON)+ .mockResolvedValueOnce({ success: true, snoozedUntil: '2026-08-27T14:00:00Z' })+ .mockResolvedValueOnce({ success: true });++ await AlertsAPI.snooze('cpu:vm/100', '2026-08-27T14:00:00Z');+ await AlertsAPI.unsnooze('cpu:vm/100');++ expect(apiFetchJSON).toHaveBeenNthCalledWith(1, '/api/alerts/snooze', {+ method: 'POST',+ body: JSON.stringify({+ alertIdentifier: 'cpu:vm/100',+ until: '2026-08-27T14:00:00Z',+ }),+ });+ expect(apiFetchJSON).toHaveBeenNthCalledWith(2, '/api/alerts/unsnooze', {+ method: 'POST',+ body: JSON.stringify({ alertIdentifier: 'cpu:vm/100' }),+ });+ });+ });});diff --git a/frontend-modern/src/api/alerts.ts b/frontend-modern/src/api/alerts.tsindex bbc2331211..1b7cf8d35b 100644--- a/frontend-modern/src/api/alerts.ts+++ b/frontend-modern/src/api/alerts.ts@@ -109,6 +109,23 @@ export class AlertsAPI {});}+ static async snooze(+ alertIdentifier: string,+ until: string,+ ): Promise<{ success: boolean; snoozedUntil: string }> {+ return apiFetchJSON(`${this.baseUrl}/snooze`, {+ method: 'POST',+ body: JSON.stringify({ alertIdentifier, until }),+ });+ }++ static async unsnooze(alertIdentifier: string): Promise<{ success: boolean }> {+ return apiFetchJSON(`${this.baseUrl}/unsnooze`, {+ method: 'POST',+ body: JSON.stringify({ alertIdentifier }),+ });+ }+// Alert configuration methodsstatic async getConfig(): Promise<AlertConfig> {return apiFetchJSON(`${this.baseUrl}/config`) as Promise<AlertConfig>;diff --git a/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx b/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsxindex f6e4a2d262..4b3890c4da 100644--- a/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx+++ b/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx@@ -15,6 +15,8 @@ import {getAlertOverviewStartedAtLabel,getAlertOverviewStartedAtClass,getAlertOverviewTimelineActionLabel,+ getAlertOverviewSnoozedUntilLabel,+ getAlertOverviewSnoozeLabel,} from '@/utils/alertOverviewPresentation';import { alertTypeDisplayLabel } from './helpers';@@ -23,6 +25,8 @@ import { getCanonicalAlertId } from './identity';import type { AlertIncidentTimelineState } from './useAlertIncidentTimelineState';import type { AlertOverviewState } from './useAlertOverviewState';import { ResourceMonitoringPolicyAction } from './ResourceMonitoringPolicyAction';+import { AlertSnoozeAction } from './AlertSnoozeAction';+import { isAlertSnoozed } from './useAlertSnoozeState';interface AlertOverviewAlertCardProps {alert: Alert;@@ -32,11 +36,14 @@ interface AlertOverviewAlertCardProps {export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {const alertKey = () => getCanonicalAlertId(props.alert);+ const processing = () =>+ props.state.processingAlerts().has(alertKey()) ||+ props.state.snoozeProcessingAlerts().has(alertKey());const alertCardPresentation = () =>getAlertOverviewCardPresentation(props.alert.level ?? 'warning',props.alert.acknowledged,- props.state.processingAlerts().has(alertKey()),+ processing(),);const deliveryDiagnosis = () => props.state.deliveryDiagnoses()[alertKey()];@@ -144,6 +151,11 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {{getAlertOverviewAcknowledgedBadgeLabel()}</span></Show>+ <Show when={isAlertSnoozed(props.alert)}>+ <span class="shrink-0 rounded bg-blue-100 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-blue-700 dark:bg-blue-900/50 dark:text-blue-300">+ {getAlertOverviewSnoozeLabel()}+ </span>+ </Show></div><p class="text-sm text-base-content mt-1 break-words">{props.alert.message}</p><div class="flex flex-wrap items-center gap-x-3 gap-y-0.5 mt-1">@@ -170,13 +182,27 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {{deliveryStatusLine()?.label}</span></Show>+ <Show+ when={+ isAlertSnoozed(props.alert) &&+ props.alert.operationalRecord?.suppression?.expiresAt+ }+ >+ <span class="text-xs text-blue-600 dark:text-blue-400">+ {getAlertOverviewSnoozedUntilLabel(+ new Date(+ props.alert.operationalRecord!.suppression!.expiresAt!,+ ).toLocaleString(),+ )}+ </span>+ </Show></div></div></div><div class="flex flex-wrap items-center gap-1.5 sm:gap-2 mt-3 sm:mt-0 sm:ml-4 self-end sm:self-start justify-end"><buttonclass={getAlertOverviewPrimaryActionClass(props.alert.acknowledged)}- disabled={props.state.processingAlerts().has(alertKey())}+ disabled={processing()}onClick={async (e) => {e.preventDefault();e.stopPropagation();@@ -185,9 +211,16 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {>{getAlertOverviewPrimaryActionLabel({acknowledged: props.alert.acknowledged,- processing: props.state.processingAlerts().has(alertKey()),+ processing: processing(),})}</button>+ <Show when={!props.alert.acknowledged || isAlertSnoozed(props.alert)}>+ <AlertSnoozeAction+ alert={props.alert}+ state={props.state}+ timelineState={props.timelineState}+ />+ </Show><buttonclass={getAlertOverviewSecondaryActionClass()}onClick={() => {diff --git a/frontend-modern/src/features/alerts/AlertSnoozeAction.tsx b/frontend-modern/src/features/alerts/AlertSnoozeAction.tsxnew file mode 100644index 0000000000..705fd7b78d--- /dev/null+++ b/frontend-modern/src/features/alerts/AlertSnoozeAction.tsx@@ -0,0 +1,112 @@+import { For, createSignal } from 'solid-js';++import { Dialog } from '@/components/shared/Dialog';+import type { Alert } from '@/types/api';+import {+ getAlertOverviewCancelLabel,+ getAlertOverviewResumeLabel,+ getAlertOverviewSnoozeDescription,+ getAlertOverviewSnoozeLabel,+ getAlertOverviewSnoozeOptionLabel,+ getAlertOverviewSnoozeTitle,+} from '@/utils/alertOverviewPresentation';++import { getCanonicalAlertId } from './identity';+import { isAlertSnoozed } from './useAlertSnoozeState';+import type { AlertOverviewState } from './useAlertOverviewState';+import type { AlertIncidentTimelineState } from './useAlertIncidentTimelineState';++type SnoozePreset = 'oneHour' | 'twoHours' | 'eightHours' | 'tomorrowMorning' | 'sevenDays';++export function snoozePresetExpiry(preset: SnoozePreset, now = new Date()): Date {+ if (preset === 'tomorrowMorning') {+ const result = new Date(now);+ result.setDate(result.getDate() + 1);+ result.setHours(9, 0, 0, 0);+ return result;+ }+ const hours = { oneHour: 1, twoHours: 2, eightHours: 8, sevenDays: 24 * 7 }[preset];+ return new Date(now.getTime() + hours * 60 * 60 * 1000);+}++export function AlertSnoozeAction(props: {+ alert: Alert;+ state: AlertOverviewState;+ timelineState: AlertIncidentTimelineState;+}) {+ const [open, setOpen] = createSignal(false);+ const id = () => getCanonicalAlertId(props.alert);+ const busy = () =>+ props.state.snoozeProcessingAlerts().has(id()) || props.state.processingAlerts().has(id());+ const presets: SnoozePreset[] = [+ 'oneHour',+ 'twoHours',+ 'eightHours',+ 'tomorrowMorning',+ 'sevenDays',+ ];+ const refreshOpenTimeline = async () => {+ if (props.timelineState.expandedIncidents().has(id())) {+ await props.timelineState.loadIncidentTimeline(id(), id(), props.alert.startTime);+ }+ };++ return (+ <>+ <button+ class="px-2.5 py-1.5 text-xs font-medium rounded border border-border text-muted hover:text-base-content hover:bg-surface-alt transition-colors disabled:opacity-50"+ disabled={busy()}+ onClick={() => {+ if (isAlertSnoozed(props.alert)) {+ void props.state+ .handleUnsnooze(props.alert)+ .then(refreshOpenTimeline)+ .catch(() => undefined);+ } else {+ setOpen(true);+ }+ }}+ >+ {isAlertSnoozed(props.alert)+ ? getAlertOverviewResumeLabel()+ : getAlertOverviewSnoozeLabel()}+ </button>+ <Dialog+ isOpen={open()}+ onClose={() => setOpen(false)}+ panelClass="max-w-md"+ ariaLabel={getAlertOverviewSnoozeTitle()}+ >+ <div class="p-5">+ <h2 class="text-lg font-semibold text-base-content">{getAlertOverviewSnoozeTitle()}</h2>+ <p class="mt-1 text-sm text-muted">{getAlertOverviewSnoozeDescription()}</p>+ <div class="mt-4 grid gap-2">+ <For each={presets}>+ {(preset) => (+ <button+ class="w-full rounded-lg border border-border px-3 py-2 text-left text-sm text-base-content hover:border-primary hover:bg-primary/5 transition-colors"+ onClick={async () => {+ try {+ await props.state.handleSnooze(props.alert, snoozePresetExpiry(preset));+ await refreshOpenTimeline();+ setOpen(false);+ } catch {+ // State owns rollback and user-visible failure reporting.+ }+ }}+ >+ {getAlertOverviewSnoozeOptionLabel(preset)}+ </button>+ )}+ </For>+ </div>+ <div class="mt-4 flex justify-end">+ <button class="btn btn-ghost btn-sm" onClick={() => setOpen(false)}>+ {getAlertOverviewCancelLabel()}+ </button>+ </div>+ </div>+ </Dialog>+ </>+ );+}diff --git a/frontend-modern/src/features/alerts/__tests__/alertsLocalization.guardrails.test.ts b/frontend-modern/src/features/alerts/__tests__/alertsLocalization.guardrails.test.tsindex d48044cf8d..96dd0c9553 100644--- a/frontend-modern/src/features/alerts/__tests__/alertsLocalization.guardrails.test.ts+++ b/frontend-modern/src/features/alerts/__tests__/alertsLocalization.guardrails.test.ts@@ -4,6 +4,7 @@ import activeAlertsSectionSource from '@/features/alerts/AlertOverviewActiveAlerimport alertCardSource from '@/features/alerts/AlertOverviewAlertCard.tsx?raw';import statsCardsSource from '@/features/alerts/AlertOverviewStatsCards.tsx?raw';import acknowledgementStateSource from '@/features/alerts/useAlertAcknowledgementState.ts?raw';+import snoozeActionSource from '@/features/alerts/AlertSnoozeAction.tsx?raw';import incidentFiltersSource from '@/components/Alerts/IncidentEventFilters.tsx?raw';import incidentTimelineSource from '@/components/Alerts/IncidentTimelinePanel.tsx?raw';import investigateButtonSource from '@/components/Alerts/InvestigateAlertButton.tsx?raw';@@ -15,6 +16,7 @@ const migratedAlertsSurfaceSources = [alertCardSource,statsCardsSource,acknowledgementStateSource,+ snoozeActionSource,incidentFiltersSource,incidentTimelineSource,investigateButtonSource,@@ -56,6 +58,9 @@ const migratedAlertsOverviewCopy = ['Filter events:','Incident note','Save Note',+ 'Snooze this alert',+ 'Pause notifications and escalation',+ 'Until tomorrow at 9:00',] as const;describe('alerts overview localization guardrails', () => {diff --git a/frontend-modern/src/features/alerts/__tests__/useAlertSnoozeState.test.tsx b/frontend-modern/src/features/alerts/__tests__/useAlertSnoozeState.test.tsxnew file mode 100644index 0000000000..c1760d4fcb--- /dev/null+++ b/frontend-modern/src/features/alerts/__tests__/useAlertSnoozeState.test.tsx@@ -0,0 +1,74 @@+import { renderHook } from '@solidjs/testing-library';+import { createSignal } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';++import { AlertsAPI } from '@/api/alerts';+import { notificationStore } from '@/stores/notifications';+import type { Alert } from '@/types/api';++import { isAlertSnoozed, useAlertSnoozeState } from '../useAlertSnoozeState';++vi.mock('@/api/alerts', () => ({ AlertsAPI: { snooze: vi.fn(), unsnooze: vi.fn() } }));+vi.mock('@/stores/notifications', () => ({+ notificationStore: { success: vi.fn(), error: vi.fn() },+}));+vi.mock('@/utils/logger', () => ({ logger: { error: vi.fn() } }));++function makeAlert(): Alert {+ return {+ id: 'cpu:vm/100',+ type: 'cpu',+ level: 'critical',+ resourceId: 'vm/100',+ resourceName: 'vm-100',+ message: 'CPU is critical',+ startTime: '2026-08-27T11:00:00Z',+ acknowledged: false,+ } as Alert;+}++describe('useAlertSnoozeState', () => {+ beforeEach(() => {+ vi.useFakeTimers();+ vi.setSystemTime(new Date('2026-08-27T12:00:00Z'));+ vi.clearAllMocks();+ });++ afterEach(() => vi.useRealTimers());++ it('optimistically snoozes and resumes the canonical operational record', async () => {+ const [alerts] = createSignal([makeAlert()]);+ const updateAlert = vi.fn();+ vi.mocked(AlertsAPI.snooze).mockResolvedValue({+ success: true,+ snoozedUntil: '2026-08-27T14:00:00Z',+ });+ vi.mocked(AlertsAPI.unsnooze).mockResolvedValue({ success: true });+ const { result } = renderHook(() => useAlertSnoozeState({ alerts, updateAlert }));++ await result.handleSnooze(alerts()[0], new Date('2026-08-27T14:00:00Z'));+ expect(isAlertSnoozed(result.effectiveAlerts()[0])).toBe(true);+ expect(AlertsAPI.snooze).toHaveBeenCalledWith('cpu:vm/100', '2026-08-27T14:00:00.000Z');+ expect(notificationStore.success).toHaveBeenCalledWith(+ expect.stringMatching(/^Alert snoozed until /),+ );++ await result.handleUnsnooze(result.effectiveAlerts()[0]);+ expect(isAlertSnoozed(result.effectiveAlerts()[0])).toBe(false);+ expect(result.effectiveAlerts()[0].operationalRecord?.state).toBe('open');+ expect(AlertsAPI.unsnooze).toHaveBeenCalledWith('cpu:vm/100');+ });++ it('restores the prior record when snooze persistence fails', async () => {+ const [alerts] = createSignal([makeAlert()]);+ const updateAlert = vi.fn();+ vi.mocked(AlertsAPI.snooze).mockRejectedValue(new Error('offline'));+ const { result } = renderHook(() => useAlertSnoozeState({ alerts, updateAlert }));++ await expect(+ result.handleSnooze(alerts()[0], new Date('2026-08-27T14:00:00Z')),+ ).rejects.toThrow('offline');+ expect(result.effectiveAlerts()[0].operationalRecord).toBeUndefined();+ expect(notificationStore.error).toHaveBeenCalledWith('Failed to snooze alert');+ });+});diff --git a/frontend-modern/src/features/alerts/types.ts b/frontend-modern/src/features/alerts/types.tsindex 8527873285..ee5f5339b4 100644--- a/frontend-modern/src/features/alerts/types.ts+++ b/frontend-modern/src/features/alerts/types.ts@@ -59,6 +59,8 @@ export const INCIDENT_EVENT_TYPES = ['alert_fired','alert_acknowledged','alert_unacknowledged',+ 'alert_snoozed',+ 'alert_unsnoozed','alert_resolved','ai_analysis','command',@@ -70,6 +72,8 @@ export const INCIDENT_EVENT_LABELS: Record<(typeof INCIDENT_EVENT_TYPES)[number]alert_fired: 'Fired',alert_acknowledged: 'Ack',alert_unacknowledged: 'Unack',+ alert_snoozed: 'Snoozed',+ alert_unsnoozed: 'Resumed',alert_resolved: 'Resolved',ai_analysis: 'Patrol',command: 'Cmd',diff --git a/frontend-modern/src/features/alerts/useAlertOverviewState.ts b/frontend-modern/src/features/alerts/useAlertOverviewState.tsindex 39119ab388..23617a1d31 100644--- a/frontend-modern/src/features/alerts/useAlertOverviewState.ts+++ b/frontend-modern/src/features/alerts/useAlertOverviewState.ts@@ -5,6 +5,7 @@ import { AlertsAPI } from '@/api/alerts';import type { Alert, AlertDeliveryDiagnosis } from '@/types/api';import type { Override } from './types';import { useAlertAcknowledgementState } from './useAlertAcknowledgementState';+import { useAlertSnoozeState } from './useAlertSnoozeState';export interface AlertGroup {key: string;@@ -33,7 +34,7 @@ export function useAlertOverviewState(props: UseAlertOverviewStateProps) {const tickInterval = setInterval(() => setTick(Date.now()), 60_000);const activeAlerts = createMemo(() => Object.values(props.activeAlerts()));const {- effectiveAlerts,+ effectiveAlerts: acknowledgedAlerts,unacknowledgedAlerts,processingAlerts,bulkAckProcessing,@@ -45,6 +46,12 @@ export function useAlertOverviewState(props: UseAlertOverviewStateProps) {updateAlert: props.updateAlert,allowRestore: true,});+ const {+ effectiveAlerts,+ processing: snoozeProcessingAlerts,+ handleSnooze,+ handleUnsnooze,+ } = useAlertSnoozeState({ alerts: acknowledgedAlerts, updateAlert: props.updateAlert });onCleanup(() => {clearInterval(tickInterval);@@ -149,12 +156,15 @@ export function useAlertOverviewState(props: UseAlertOverviewStateProps) {groupedAlerts,unacknowledgedAlerts,processingAlerts,+ snoozeProcessingAlerts,bulkAckProcessing,deliveryDiagnoses,refreshDeliveryDiagnoses,handleAlertAcknowledgement,handleBulkAcknowledge,handleGroupAcknowledge,+ handleSnooze,+ handleUnsnooze,};}diff --git a/frontend-modern/src/features/alerts/useAlertSnoozeState.ts b/frontend-modern/src/features/alerts/useAlertSnoozeState.tsnew file mode 100644index 0000000000..85d3936176--- /dev/null+++ b/frontend-modern/src/features/alerts/useAlertSnoozeState.ts@@ -0,0 +1,163 @@+import { createEffect, createMemo, createSignal } from 'solid-js';+import type { Accessor } from 'solid-js';++import { AlertsAPI } from '@/api/alerts';+import { notificationStore } from '@/stores/notifications';+import type { Alert } from '@/types/api';+import type { OperationalRecord } from '@/types/operationalTrust';+import {+ getAlertOverviewResumedNotification,+ getAlertOverviewSnoozeFailureNotification,+ getAlertOverviewSnoozedNotification,+} from '@/utils/alertOverviewPresentation';+import { logger } from '@/utils/logger';++import { getCanonicalAlertId } from './identity';++function recordForSnooze(alert: Alert, until: string, now: string): OperationalRecord {+ const existing = alert.operationalRecord;+ return {+ id: existing?.id ?? `alert:${getCanonicalAlertId(alert)}`,+ canonicalSpecId: existing?.canonicalSpecId ?? alert.type,+ subjectResourceId: existing?.subjectResourceId ?? alert.resourceId,+ state: 'suppressed',+ severity: existing?.severity ?? alert.level ?? 'unknown',+ firstObservedAt: existing?.firstObservedAt ?? alert.startTime,+ lastObservedAt: existing?.lastObservedAt ?? alert.lastSeen ?? alert.startTime,+ stateChangedAt: now,+ resolvedAt: existing?.resolvedAt,+ acknowledgement: existing?.acknowledgement,+ suppression: { at: now, by: 'current-user', reason: 'user_snooze', expiresAt: until },+ evidenceIds: existing?.evidenceIds ?? [],+ causeKey: existing?.causeKey ?? getCanonicalAlertId(alert),+ relatedResourceIds: existing?.relatedResourceIds ?? [],+ impactSummary: existing?.impactSummary,+ recommendedNextStep: existing?.recommendedNextStep,+ };+}++export function isAlertSnoozed(alert: Alert, now = Date.now()): boolean {+ const suppression = alert.operationalRecord?.suppression;+ if (alert.operationalRecord?.state !== 'suppressed' || !suppression?.expiresAt) return false;+ const expiry = Date.parse(suppression.expiresAt);+ return Number.isFinite(expiry) && expiry > now;+}++export function useAlertSnoozeState(props: {+ alerts: Accessor<Alert[]>;+ updateAlert: (alertIdentifier: string, updates: Partial<Alert>) => void;+}) {+ type SnoozeOverride = {+ record: OperationalRecord | undefined;+ baseline: OperationalRecord | undefined;+ };+ const [overrides, setOverrides] = createSignal<Record<string, SnoozeOverride>>({});+ const [processing, setProcessing] = createSignal<Set<string>>(new Set());++ const effectiveAlerts = createMemo(() =>+ props.alerts().map((alert) => {+ const id = getCanonicalAlertId(alert);+ return Object.prototype.hasOwnProperty.call(overrides(), id)+ ? { ...alert, operationalRecord: overrides()[id].record }+ : alert;+ }),+ );++ // The optimistic record only bridges the request to the shared alert-state+ // update. Once that source advances beyond the baseline, it resumes sole+ // ownership so websocket expiry and server-normalized actor data cannot be+ // masked by a stale local override.+ createEffect(() => {+ const incoming = props.alerts();+ const current = overrides();+ let next: Record<string, SnoozeOverride> | undefined;+ for (const [id, override] of Object.entries(current)) {+ const alert = incoming.find((candidate) => getCanonicalAlertId(candidate) === id);+ if (alert && alert.operationalRecord !== override.baseline) {+ next ??= { ...current };+ delete next[id];+ }+ }+ if (next) setOverrides(next);+ });++ const setProcessingAlert = (id: string, value: boolean) => {+ setProcessing((current) => {+ const next = new Set(current);+ value ? next.add(id) : next.delete(id);+ return next;+ });+ };++ const handleSnooze = async (alert: Alert, until: Date) => {+ const id = getCanonicalAlertId(alert);+ const previous = alert.operationalRecord;+ const sourceBaseline = props+ .alerts()+ .find((candidate) => getCanonicalAlertId(candidate) === id)?.operationalRecord;+ const untilISO = until.toISOString();+ const optimistic = recordForSnooze(alert, untilISO, new Date().toISOString());+ setProcessingAlert(id, true);+ setOverrides((current) => ({+ ...current,+ [id]: { record: optimistic, baseline: sourceBaseline },+ }));+ props.updateAlert(id, { operationalRecord: optimistic });+ try {+ await AlertsAPI.snooze(id, untilISO);+ notificationStore.success(getAlertOverviewSnoozedNotification(until.toLocaleString()));+ } catch (error) {+ setOverrides((current) => {+ const next = { ...current };+ delete next[id];+ return next;+ });+ props.updateAlert(id, { operationalRecord: previous });+ logger.error('Failed to snooze alert:', error);+ notificationStore.error(getAlertOverviewSnoozeFailureNotification(false));+ throw error;+ } finally {+ setProcessingAlert(id, false);+ }+ };++ const handleUnsnooze = async (alert: Alert) => {+ const id = getCanonicalAlertId(alert);+ const previous = alert.operationalRecord;+ const sourceBaseline = props+ .alerts()+ .find((candidate) => getCanonicalAlertId(candidate) === id)?.operationalRecord;+ const resumed = previous+ ? {+ ...previous,+ state: alert.acknowledged ? ('acknowledged' as const) : ('open' as const),+ stateChangedAt: new Date().toISOString(),+ suppression: undefined,+ }+ : undefined;+ setProcessingAlert(id, true);+ setOverrides((current) => ({+ ...current,+ [id]: { record: resumed, baseline: sourceBaseline },+ }));+ props.updateAlert(id, { operationalRecord: resumed });+ try {+ await AlertsAPI.unsnooze(id);+ notificationStore.success(getAlertOverviewResumedNotification());+ } catch (error) {+ setOverrides((current) => {+ const next = { ...current };+ delete next[id];+ return next;+ });+ props.updateAlert(id, { operationalRecord: previous });+ logger.error('Failed to resume alert:', error);+ notificationStore.error(getAlertOverviewSnoozeFailureNotification(true));+ throw error;+ } finally {+ setProcessingAlert(id, false);+ }+ };++ return { effectiveAlerts, processing, handleSnooze, handleUnsnooze };+}diff --git a/frontend-modern/src/i18n/__tests__/i18n.test.ts b/frontend-modern/src/i18n/__tests__/i18n.test.tsindex bbce17ebfb..fc5a3f812b 100644--- a/frontend-modern/src/i18n/__tests__/i18n.test.ts+++ b/frontend-modern/src/i18n/__tests__/i18n.test.ts@@ -102,6 +102,19 @@ describe('i18n foundation', () => {}});+ it('localizes the alert snooze lifecycle across every supported locale', () => {+ expect(t('alerts.overview.action.snooze', undefined, 'en')).toBe('Snooze');+ expect(t('alerts.overview.action.snooze', undefined, 'de')).toBe('Zurueckstellen');+ expect(t('alerts.overview.action.snooze', undefined, 'es')).toBe('Posponer');+ expect(t('alerts.overview.action.resume', undefined, 'de')).toBe('Fortsetzen');+ expect(t('alerts.overview.action.resume', undefined, 'es')).toBe('Reanudar');+ for (const locale of SUPPORTED_LOCALES) {+ expect(t('alerts.overview.snooze.description', undefined, locale)).toBeTruthy();+ expect(t('alerts.timeline.event.alertSnoozed', undefined, locale)).toBeTruthy();+ expect(t('alerts.timeline.event.alertUnsnoozed', undefined, locale)).toBeTruthy();+ }+ });+it('captures the first and next localization waves without enabling unsupported locales', () => {expect(FIRST_LOCALIZATION_LOCALES).toEqual(['de', 'es']);expect(NEXT_LOCALIZATION_LOCALES).toEqual(['fr', 'pt-BR', 'ja', 'zh-Hans', 'ko']);diff --git a/frontend-modern/src/i18n/messages.de.ts b/frontend-modern/src/i18n/messages.de.tsindex 8dcb348eb2..e07792c96e 100644--- a/frontend-modern/src/i18n/messages.de.ts+++ b/frontend-modern/src/i18n/messages.de.ts@@ -60,11 +60,14 @@ export const DE_MESSAGE_OVERRIDES = {'alerts.overview.action.acknowledge': 'Bestaetigen','alerts.overview.action.acknowledgeAll': 'Alle bestaetigen ({count})','alerts.overview.action.acknowledging': 'Wird bestaetigt...',+ 'alerts.overview.action.cancel': 'Abbrechen','alerts.overview.action.hideAcknowledged': 'Bestaetigte ausblenden','alerts.overview.action.hideTimeline': 'Zeitleiste ausblenden','alerts.overview.action.processing': 'Wird verarbeitet...',+ 'alerts.overview.action.resume': 'Fortsetzen','alerts.overview.action.showAcknowledged': 'Bestaetigte anzeigen','alerts.overview.action.timeline': 'Zeitleiste',+ 'alerts.overview.action.snooze': 'Zurueckstellen','alerts.overview.action.unacknowledge': 'Bestaetigung aufheben','alerts.overview.acknowledgedBadge': 'Bestaetigt','alerts.overview.empty.description':@@ -85,10 +88,23 @@ export const DE_MESSAGE_OVERRIDES = {'alerts.overview.notification.bulkSuccess.plural': '{count} Warnmeldungen bestaetigt.','alerts.overview.notification.restored': 'Warnmeldung wiederhergestellt','alerts.overview.notification.restoreFailed': 'Warnmeldung konnte nicht wiederhergestellt werden',+ 'alerts.overview.notification.resumed': 'Warnmeldungen werden fortgesetzt',+ 'alerts.overview.notification.resumeFailed': 'Warnmeldungen konnten nicht fortgesetzt werden',+ 'alerts.overview.notification.snoozed': 'Warnmeldung zurueckgestellt bis {until}',+ 'alerts.overview.notification.snoozeFailed': 'Warnmeldung konnte nicht zurueckgestellt werden','alerts.overview.paused.description':'Schalten Sie Warnmeldungen ein, um die Ueberwachung fortzusetzen und Konfigurationstabs freizugeben','alerts.overview.paused.title': 'Warnmeldungen sind pausiert','alerts.overview.section.activeAlerts': 'Aktive Warnmeldungen',+ 'alerts.overview.snooze.description':+ 'Pausiert Benachrichtigungen und Eskalationen fuer diesen Vorfall. Ueberwachung und Erkennung der Behebung laufen weiter.',+ 'alerts.overview.snooze.option.eightHours': 'Fuer 8 Stunden',+ 'alerts.overview.snooze.option.oneHour': 'Fuer 1 Stunde',+ 'alerts.overview.snooze.option.sevenDays': 'Fuer 7 Tage',+ 'alerts.overview.snooze.option.tomorrowMorning': 'Bis morgen um 9:00',+ 'alerts.overview.snooze.option.twoHours': 'Fuer 2 Stunden',+ 'alerts.overview.snooze.title': 'Warnmeldung zurueckstellen',+ 'alerts.overview.snoozedUntil': 'Zurueckgestellt bis {until}','alerts.overview.startedAt': 'Gestartet: {startedAt}','alerts.overview.stats.acknowledged': 'Bestaetigt','alerts.overview.stats.triggered24h': 'Ausgeloest (24h)',@@ -134,6 +150,8 @@ export const DE_MESSAGE_OVERRIDES = {'alerts.timeline.event.alertFired': 'Ausgeloest','alerts.timeline.event.alertResolved': 'Behoben','alerts.timeline.event.alertUnacknowledged': 'Unbestaetigt',+ 'alerts.timeline.event.alertSnoozed': 'Zurueckgestellt',+ 'alerts.timeline.event.alertUnsnoozed': 'Fortgesetzt','alerts.timeline.event.aiAnalysis': 'Patrol','alerts.timeline.event.command': 'Befehl','alerts.timeline.event.note': 'Notiz',diff --git a/frontend-modern/src/i18n/messages.es.ts b/frontend-modern/src/i18n/messages.es.tsindex 155937b3c3..87b0e3df9c 100644--- a/frontend-modern/src/i18n/messages.es.ts+++ b/frontend-modern/src/i18n/messages.es.ts@@ -59,11 +59,14 @@ export const ES_MESSAGE_OVERRIDES = {'alerts.overview.action.acknowledge': 'Reconocer','alerts.overview.action.acknowledgeAll': 'Reconocer todas ({count})','alerts.overview.action.acknowledging': 'Reconociendo...',+ 'alerts.overview.action.cancel': 'Cancelar','alerts.overview.action.hideAcknowledged': 'Ocultar reconocidas','alerts.overview.action.hideTimeline': 'Ocultar linea de tiempo','alerts.overview.action.processing': 'Procesando...',+ 'alerts.overview.action.resume': 'Reanudar','alerts.overview.action.showAcknowledged': 'Mostrar reconocidas','alerts.overview.action.timeline': 'Linea de tiempo',+ 'alerts.overview.action.snooze': 'Posponer','alerts.overview.action.unacknowledge': 'Quitar reconocimiento','alerts.overview.acknowledgedBadge': 'Reconocida','alerts.overview.empty.description': 'Las alertas apareceran aqui cuando se superen los umbrales',@@ -80,10 +83,23 @@ export const ES_MESSAGE_OVERRIDES = {'alerts.overview.notification.bulkSuccess.plural': '{count} alertas reconocidas.','alerts.overview.notification.restored': 'Alerta restaurada','alerts.overview.notification.restoreFailed': 'No se pudo restaurar la alerta',+ 'alerts.overview.notification.resumed': 'Notificaciones de alerta reanudadas',+ 'alerts.overview.notification.resumeFailed': 'No se pudieron reanudar las notificaciones',+ 'alerts.overview.notification.snoozed': 'Alerta pospuesta hasta {until}',+ 'alerts.overview.notification.snoozeFailed': 'No se pudo posponer la alerta','alerts.overview.paused.description':'Activa las alertas para reanudar la monitorizacion y desbloquear las pestañas de configuracion','alerts.overview.paused.title': 'Las alertas estan pausadas','alerts.overview.section.activeAlerts': 'Alertas activas',+ 'alerts.overview.snooze.description':+ 'Pausa las notificaciones y el escalado de este incidente. La monitorizacion continua y la resolucion se sigue detectando.',+ 'alerts.overview.snooze.option.eightHours': 'Durante 8 horas',+ 'alerts.overview.snooze.option.oneHour': 'Durante 1 hora',+ 'alerts.overview.snooze.option.sevenDays': 'Durante 7 dias',+ 'alerts.overview.snooze.option.tomorrowMorning': 'Hasta manana a las 9:00',+ 'alerts.overview.snooze.option.twoHours': 'Durante 2 horas',+ 'alerts.overview.snooze.title': 'Posponer esta alerta',+ 'alerts.overview.snoozedUntil': 'Pospuesta hasta {until}','alerts.overview.startedAt': 'Inicio: {startedAt}','alerts.overview.stats.acknowledged': 'Reconocidas','alerts.overview.stats.triggered24h': 'Activadas (24h)',@@ -128,6 +144,8 @@ export const ES_MESSAGE_OVERRIDES = {'alerts.timeline.event.alertFired': 'Activada','alerts.timeline.event.alertResolved': 'Resuelta','alerts.timeline.event.alertUnacknowledged': 'Sin reconocer',+ 'alerts.timeline.event.alertSnoozed': 'Pospuesta',+ 'alerts.timeline.event.alertUnsnoozed': 'Reanudada','alerts.timeline.event.aiAnalysis': 'Patrol','alerts.timeline.event.command': 'Comando','alerts.timeline.event.note': 'Nota',diff --git a/frontend-modern/src/i18n/messages.ts b/frontend-modern/src/i18n/messages.tsindex a9d774fb08..379c00b75c 100644--- a/frontend-modern/src/i18n/messages.ts+++ b/frontend-modern/src/i18n/messages.ts@@ -152,11 +152,14 @@ export const EN_MESSAGES = {'alerts.overview.action.acknowledge': 'Acknowledge','alerts.overview.action.acknowledgeAll': 'Acknowledge all ({count})','alerts.overview.action.acknowledging': 'Acknowledging...',+ 'alerts.overview.action.cancel': 'Cancel','alerts.overview.action.hideAcknowledged': 'Hide acknowledged','alerts.overview.action.hideTimeline': 'Hide Timeline','alerts.overview.action.processing': 'Processing...',+ 'alerts.overview.action.resume': 'Resume','alerts.overview.action.showAcknowledged': 'Show acknowledged','alerts.overview.action.timeline': 'Timeline',+ 'alerts.overview.action.snooze': 'Snooze','alerts.overview.action.unacknowledge': 'Unacknowledge','alerts.overview.acknowledgedBadge': 'Acknowledged','alerts.overview.empty.description': 'Alerts will appear here when thresholds are exceeded',@@ -173,10 +176,23 @@ export const EN_MESSAGES = {'alerts.overview.notification.bulkSuccess.plural': 'Acknowledged {count} alerts.','alerts.overview.notification.restored': 'Alert restored','alerts.overview.notification.restoreFailed': 'Failed to restore alert',+ 'alerts.overview.notification.resumed': 'Alert notifications resumed',+ 'alerts.overview.notification.resumeFailed': 'Failed to resume alert notifications',+ 'alerts.overview.notification.snoozed': 'Alert snoozed until {until}',+ 'alerts.overview.notification.snoozeFailed': 'Failed to snooze alert','alerts.overview.paused.description':'Toggle alerts on to resume monitoring and unlock configuration tabs','alerts.overview.paused.title': 'Alerting is paused','alerts.overview.section.activeAlerts': 'Active Alerts',+ 'alerts.overview.snooze.description':+ 'Pause notifications and escalation for this incident. Monitoring continues and resolution is still detected.',+ 'alerts.overview.snooze.option.eightHours': 'For 8 hours',+ 'alerts.overview.snooze.option.oneHour': 'For 1 hour',+ 'alerts.overview.snooze.option.sevenDays': 'For 7 days',+ 'alerts.overview.snooze.option.tomorrowMorning': 'Until tomorrow at 9:00',+ 'alerts.overview.snooze.option.twoHours': 'For 2 hours',+ 'alerts.overview.snooze.title': 'Snooze this alert',+ 'alerts.overview.snoozedUntil': 'Snoozed until {until}','alerts.overview.startedAt': 'Started: {startedAt}','alerts.overview.stats.acknowledged': 'Acknowledged','alerts.overview.stats.triggered24h': 'Triggered (24h)',@@ -220,6 +236,8 @@ export const EN_MESSAGES = {'alerts.timeline.event.alertFired': 'Fired','alerts.timeline.event.alertResolved': 'Resolved','alerts.timeline.event.alertUnacknowledged': 'Unack',+ 'alerts.timeline.event.alertSnoozed': 'Snoozed',+ 'alerts.timeline.event.alertUnsnoozed': 'Resumed','alerts.timeline.event.aiAnalysis': 'Patrol','alerts.timeline.event.command': 'Cmd','alerts.timeline.event.note': 'Note',@@ -729,11 +747,14 @@ export const ALERTS_OVERVIEW_MIGRATED_MESSAGE_KEYS = ['alerts.overview.action.acknowledge','alerts.overview.action.acknowledgeAll','alerts.overview.action.acknowledging',+ 'alerts.overview.action.cancel','alerts.overview.action.hideAcknowledged','alerts.overview.action.hideTimeline','alerts.overview.action.processing',+ 'alerts.overview.action.resume','alerts.overview.action.showAcknowledged','alerts.overview.action.timeline',+ 'alerts.overview.action.snooze','alerts.overview.action.unacknowledge','alerts.overview.acknowledgedBadge','alerts.overview.empty.description',@@ -750,9 +771,21 @@ export const ALERTS_OVERVIEW_MIGRATED_MESSAGE_KEYS = ['alerts.overview.notification.bulkSuccess.plural','alerts.overview.notification.restored','alerts.overview.notification.restoreFailed',+ 'alerts.overview.notification.resumed',+ 'alerts.overview.notification.resumeFailed',+ 'alerts.overview.notification.snoozed',+ 'alerts.overview.notification.snoozeFailed','alerts.overview.paused.description','alerts.overview.paused.title','alerts.overview.section.activeAlerts',+ 'alerts.overview.snooze.description',+ 'alerts.overview.snooze.option.eightHours',+ 'alerts.overview.snooze.option.oneHour',+ 'alerts.overview.snooze.option.sevenDays',+ 'alerts.overview.snooze.option.tomorrowMorning',+ 'alerts.overview.snooze.option.twoHours',+ 'alerts.overview.snooze.title',+ 'alerts.overview.snoozedUntil','alerts.overview.startedAt','alerts.overview.stats.acknowledged','alerts.overview.stats.triggered24h',@@ -790,6 +823,8 @@ export const ALERTS_OVERVIEW_MIGRATED_MESSAGE_KEYS = ['alerts.timeline.event.alertFired','alerts.timeline.event.alertResolved','alerts.timeline.event.alertUnacknowledged',+ 'alerts.timeline.event.alertSnoozed',+ 'alerts.timeline.event.alertUnsnoozed','alerts.timeline.event.aiAnalysis','alerts.timeline.event.command','alerts.timeline.event.note',diff --git a/frontend-modern/src/types/__tests__/resource.test.ts b/frontend-modern/src/types/__tests__/resource.test.tsindex 65cf2d5e41..07e75366cc 100644--- a/frontend-modern/src/types/__tests__/resource.test.ts+++ b/frontend-modern/src/types/__tests__/resource.test.ts@@ -711,6 +711,8 @@ describe('Resource Interface', () => {'alert_fired','alert_acknowledged','alert_unacknowledged',+ 'alert_snoozed',+ 'alert_unsnoozed','alert_resolved','command_executed','runbook_executed',@@ -720,6 +722,8 @@ describe('Resource Interface', () => {'alert_fired','alert_acknowledged','alert_unacknowledged',+ 'alert_snoozed',+ 'alert_unsnoozed','alert_resolved','command_executed','runbook_executed',diff --git a/frontend-modern/src/types/resource.ts b/frontend-modern/src/types/resource.tsindex b8d0df99b8..c8b64210de 100644--- a/frontend-modern/src/types/resource.ts+++ b/frontend-modern/src/types/resource.ts@@ -244,6 +244,8 @@ export type ResourceChangeKind =| 'alert_fired'| 'alert_acknowledged'| 'alert_unacknowledged'+ | 'alert_snoozed'+ | 'alert_unsnoozed'| 'alert_resolved'| 'command_executed'| 'runbook_executed';diff --git a/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts b/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.tsindex 10d5705bab..2a5838ef7b 100644--- a/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts+++ b/frontend-modern/src/utils/__tests__/alertOverviewPresentation.test.ts@@ -46,7 +46,15 @@ import {getAlertOverviewPrimaryActionClass,getAlertOverviewPrimaryActionLabel,getAlertOverviewRestoredNotification,+ getAlertOverviewResumeLabel,getAlertOverviewSecondaryActionClass,+ getAlertOverviewSnoozeDescription,+ getAlertOverviewSnoozeFailureNotification,+ getAlertOverviewSnoozeLabel,+ getAlertOverviewSnoozeOptionLabel,+ getAlertOverviewSnoozedUntilLabel,+ getAlertOverviewSnoozedNotification,+ getAlertOverviewResumedNotification,getAlertOverviewStartedAtLabel,getAlertOverviewStartedAtClass,getAlertOverviewStatsLabels,@@ -110,6 +118,27 @@ describe('alertOverviewPresentation', () => {});});+ it('presents snooze as a bounded delivery hold while monitoring continues', () => {+ expect(getAlertOverviewSnoozeLabel()).toBe('Snooze');+ expect(getAlertOverviewResumeLabel()).toBe('Resume');+ expect(getAlertOverviewSnoozeDescription()).toBe(+ 'Pause notifications and escalation for this incident. Monitoring continues and resolution is still detected.',+ );+ expect(getAlertOverviewSnoozeOptionLabel('oneHour')).toBe('For 1 hour');+ expect(getAlertOverviewSnoozeOptionLabel('tomorrowMorning')).toBe('Until tomorrow at 9:00');+ expect(getAlertOverviewSnoozedUntilLabel('27/08/2026, 17:00')).toBe(+ 'Snoozed until 27/08/2026, 17:00',+ );+ expect(getAlertOverviewSnoozedNotification('27/08/2026, 17:00')).toBe(+ 'Alert snoozed until 27/08/2026, 17:00',+ );+ expect(getAlertOverviewResumedNotification()).toBe('Alert notifications resumed');+ expect(getAlertOverviewSnoozeFailureNotification(false)).toBe('Failed to snooze alert');+ expect(getAlertOverviewSnoozeFailureNotification(true)).toBe(+ 'Failed to resume alert notifications',+ );+ });+it('returns canonical alert history search and empty-state copy', () => {expect(ALERT_HISTORY_SEARCH_PLACEHOLDER).toBe('Search alerts...');expect(getAlertHistorySearchPlaceholder()).toBe('Search alerts...');diff --git a/frontend-modern/src/utils/__tests__/docsLinks.test.ts b/frontend-modern/src/utils/__tests__/docsLinks.test.tsindex 725e6d8bf5..a010ea7aec 100644--- a/frontend-modern/src/utils/__tests__/docsLinks.test.ts+++ b/frontend-modern/src/utils/__tests__/docsLinks.test.ts@@ -131,6 +131,22 @@ describe('docsLinks', () => {}});+ it('ships the per-alert snooze and resume API contract', () => {+ const apiReference = readFileSync(path.join(repoRoot, 'docs', 'API.md'), 'utf8');+ const shippedAPIReference = readFileSync(+ path.join(frontendRoot, 'public', 'docs', 'API.md'),+ 'utf8',+ );++ expect(shippedAPIReference).toBe(apiReference);+ expect(apiReference).toContain('`POST /api/alerts/snooze`');+ expect(apiReference).toContain('`POST /api/alerts/unsnooze`');+ expect(apiReference).toContain(+ 'pauses delivery and escalation for up to 30 days while monitoring continues',+ );+ expect(apiReference).toContain('resumes normal policy without resolving the incident');+ });+it('ships the readable SSO identity and user deprovisioning contract', () => {const apiReference = readFileSync(path.join(repoRoot, 'docs', 'API.md'), 'utf8');const rbacGuide = readFileSync(path.join(repoRoot, 'docs', 'RBAC.md'), 'utf8');diff --git a/frontend-modern/src/utils/__tests__/resourceChangePresentation.test.ts b/frontend-modern/src/utils/__tests__/resourceChangePresentation.test.tsindex d18ccd2703..c6539e2bbf 100644--- a/frontend-modern/src/utils/__tests__/resourceChangePresentation.test.ts+++ b/frontend-modern/src/utils/__tests__/resourceChangePresentation.test.ts@@ -17,6 +17,8 @@ describe('resourceChangePresentation utils', () => {expect(formatResourceChangeKind('metric_anomaly')).toBe('Metric anomaly');expect(formatResourceChangeKind('relationship_change')).toBe('Relationship change');expect(formatResourceChangeKind('alert_fired')).toBe('Alert fired');+ expect(formatResourceChangeKind('alert_snoozed')).toBe('Alert snoozed');+ expect(formatResourceChangeKind('alert_unsnoozed')).toBe('Alert resumed');expect(formatResourceChangeKind('runbook_executed')).toBe('Runbook executed');});@@ -66,6 +68,14 @@ describe('resourceChangePresentation utils', () => {label: 'Alert resolved',plural: 'Alerts resolved',});+ expect(getResourceChangeKindPresentation('alert_snoozed')).toMatchObject({+ label: 'Alert snoozed',+ plural: 'Alerts snoozed',+ });+ expect(getResourceChangeKindPresentation('alert_unsnoozed')).toMatchObject({+ label: 'Alert resumed',+ plural: 'Alerts resumed',+ });expect(getResourceChangeSourceTypePresentation('platform_event')).toMatchObject({label: 'Platform event',plural: 'Platform events',diff --git a/frontend-modern/src/utils/alertOverviewPresentation.ts b/frontend-modern/src/utils/alertOverviewPresentation.tsindex 5564564dc6..40dbbcd96b 100644--- a/frontend-modern/src/utils/alertOverviewPresentation.ts+++ b/frontend-modern/src/utils/alertOverviewPresentation.ts@@ -147,6 +147,52 @@ export function getAlertOverviewTimelineActionLabel(isExpanded: boolean): string: t('alerts.overview.action.timeline');}+export function getAlertOverviewSnoozeLabel(): string {+ return t('alerts.overview.action.snooze');+}++export function getAlertOverviewResumeLabel(): string {+ return t('alerts.overview.action.resume');+}++export function getAlertOverviewCancelLabel(): string {+ return t('alerts.overview.action.cancel');+}++export function getAlertOverviewSnoozeTitle(): string {+ return t('alerts.overview.snooze.title');+}++export function getAlertOverviewSnoozeDescription(): string {+ return t('alerts.overview.snooze.description');+}++export function getAlertOverviewSnoozeOptionLabel(+ preset: 'oneHour' | 'twoHours' | 'eightHours' | 'tomorrowMorning' | 'sevenDays',+): string {+ return t(`alerts.overview.snooze.option.${preset}`);+}++export function getAlertOverviewSnoozedUntilLabel(until: string): string {+ return t('alerts.overview.snoozedUntil', { until });+}++export function getAlertOverviewSnoozedNotification(until: string): string {+ return t('alerts.overview.notification.snoozed', { until });+}++export function getAlertOverviewResumedNotification(): string {+ return t('alerts.overview.notification.resumed');+}++export function getAlertOverviewSnoozeFailureNotification(resuming: boolean): string {+ return t(+ resuming+ ? 'alerts.overview.notification.resumeFailed'+ : 'alerts.overview.notification.snoozeFailed',+ );+}+export function getAlertOverviewRestoredNotification(): string {return t('alerts.overview.notification.restored');}@@ -211,6 +257,10 @@ export function getAlertTimelineEventTypeLabel(type: string): string {return t('alerts.timeline.event.alertAcknowledged');case 'alert_unacknowledged':return t('alerts.timeline.event.alertUnacknowledged');+ case 'alert_snoozed':+ return t('alerts.timeline.event.alertSnoozed');+ case 'alert_unsnoozed':+ return t('alerts.timeline.event.alertUnsnoozed');case 'alert_resolved':return t('alerts.timeline.event.alertResolved');case 'ai_analysis':diff --git a/frontend-modern/src/utils/resourceChangePresentation.ts b/frontend-modern/src/utils/resourceChangePresentation.tsindex 8852fe043e..45bc693fa6 100644--- a/frontend-modern/src/utils/resourceChangePresentation.ts+++ b/frontend-modern/src/utils/resourceChangePresentation.ts@@ -19,6 +19,8 @@ export const RESOURCE_CHANGE_KIND_ORDER: ResourceChangeKind[] = ['alert_fired','alert_acknowledged','alert_unacknowledged',+ 'alert_snoozed',+ 'alert_unsnoozed','alert_resolved','command_executed','runbook_executed',@@ -78,6 +80,16 @@ const RESOURCE_CHANGE_KIND_PRESENTATIONS: Record<plural: 'Alerts unacknowledged',className: 'bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-300',},+ alert_snoozed: {+ label: 'Alert snoozed',+ plural: 'Alerts snoozed',+ className: 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300',+ },+ alert_unsnoozed: {+ label: 'Alert resumed',+ plural: 'Alerts resumed',+ className: 'bg-cyan-100 text-cyan-700 dark:bg-cyan-900 dark:text-cyan-300',+ },alert_resolved: {label: 'Alert resolved',plural: 'Alerts resolved',@@ -238,6 +250,10 @@ export function formatResourceChangeKind(kind: ResourceChange['kind']): string {return 'Alert acknowledged';case 'alert_unacknowledged':return 'Alert unacknowledged';+ case 'alert_snoozed':+ return 'Alert snoozed';+ case 'alert_unsnoozed':+ return 'Alert resumed';case 'alert_resolved':return 'Alert resolved';case 'command_executed':diff --git a/internal/ai/memory/incidents.go b/internal/ai/memory/incidents.goindex 4948747998..5902061bfc 100644--- a/internal/ai/memory/incidents.go+++ b/internal/ai/memory/incidents.go@@ -29,6 +29,8 @@ const (IncidentEventAlertFired IncidentEventType = "alert_fired"IncidentEventAlertAcknowledged IncidentEventType = "alert_acknowledged"IncidentEventAlertUnacknowledged IncidentEventType = "alert_unacknowledged"+ IncidentEventAlertSnoozed IncidentEventType = "alert_snoozed"+ IncidentEventAlertUnsnoozed IncidentEventType = "alert_unsnoozed"IncidentEventAlertResolved IncidentEventType = "alert_resolved"IncidentEventAnalysis IncidentEventType = "ai_analysis"IncidentEventCommand IncidentEventType = "command"@@ -990,7 +992,8 @@ func incidentEventFromResourceChange(change unifiedresources.ResourceChange) (Indetails := cloneIncidentEventDetails(change.Metadata)if user := strings.TrimSpace(change.Actor); user != "" {switch eventType {- case IncidentEventAlertAcknowledged, IncidentEventAlertUnacknowledged:+ case IncidentEventAlertAcknowledged, IncidentEventAlertUnacknowledged,+ IncidentEventAlertSnoozed, IncidentEventAlertUnsnoozed:details["user"] = user}}@@ -1012,6 +1015,10 @@ func incidentEventTypeFromChangeKind(kind unifiedresources.ChangeKind) (Incidentreturn IncidentEventAlertAcknowledged, truecase unifiedresources.ChangeAlertUnacknowledged:return IncidentEventAlertUnacknowledged, true+ case unifiedresources.ChangeAlertSnoozed:+ return IncidentEventAlertSnoozed, true+ case unifiedresources.ChangeAlertUnsnoozed:+ return IncidentEventAlertUnsnoozed, truecase unifiedresources.ChangeAlertResolved:return IncidentEventAlertResolved, truecase unifiedresources.ChangeCommandExecuted:@@ -1042,6 +1049,10 @@ func incidentEventSummaryFromChange(change unifiedresources.ResourceChange, evenreturn "Alert acknowledged"case IncidentEventAlertUnacknowledged:return "Alert unacknowledged"+ case IncidentEventAlertSnoozed:+ return "Alert snoozed"+ case IncidentEventAlertUnsnoozed:+ return "Alert notifications resumed"case IncidentEventAlertResolved:return "Alert resolved"default:@@ -1124,6 +1135,8 @@ func isCanonicalProjectedIncidentEventType(eventType IncidentEventType) bool {case IncidentEventAlertFired,IncidentEventAlertAcknowledged,IncidentEventAlertUnacknowledged,+ IncidentEventAlertSnoozed,+ IncidentEventAlertUnsnoozed,IncidentEventAlertResolved,IncidentEventCommand,IncidentEventRunbook:diff --git a/internal/ai/memory/incidents_test.go b/internal/ai/memory/incidents_test.goindex 44aef239b5..2acf20d137 100644--- a/internal/ai/memory/incidents_test.go+++ b/internal/ai/memory/incidents_test.go@@ -136,6 +136,19 @@ func TestIncidentStore_ProjectsCanonicalTimelineWhenAttached(t *testing.T) {AlertValue: alert.Value,AlertThreshold: alert.Threshold,})+ snoozedAt := alert.StartTime.Add(2 * time.Minute)+ snoozedUntil := snoozedAt.Add(time.Hour).Format(time.RFC3339)+ snoozed := unifiedresources.BuildAlertTimelineChange(alert.ResourceID, unifiedresources.ChangeAlertSnoozed, snoozedAt, "[email protected]", unifiedresources.AlertTimelineChange{+ AlertIdentifier: alert.ID,+ AlertType: alert.Type,+ AlertLevel: string(alert.Level),+ AlertMetadata: map[string]any{"snoozedUntil": snoozedUntil},+ })+ unsnoozed := unifiedresources.BuildAlertTimelineChange(alert.ResourceID, unifiedresources.ChangeAlertUnsnoozed, snoozedAt.Add(time.Minute), "[email protected]", unifiedresources.AlertTimelineChange{+ AlertIdentifier: alert.ID,+ AlertType: alert.Type,+ AlertLevel: string(alert.Level),+ })runbook := unifiedresources.BuildRunbookExecutionChange(alert.ResourceID, alert.ID, "agent:pulse-patrol", "rb-1", "Restart service", "resolved", true, "Recovered", nil)resolvedAt := alert.StartTime.Add(5 * time.Minute)resolved := unifiedresources.BuildAlertTimelineChange(alert.ResourceID, unifiedresources.ChangeAlertResolved, resolvedAt, "", unifiedresources.AlertTimelineChange{@@ -144,7 +157,7 @@ func TestIncidentStore_ProjectsCanonicalTimelineWhenAttached(t *testing.T) {AlertLevel: string(alert.Level),AlertMessage: "CPU normalized",})- for _, change := range []*unifiedresources.ResourceChange{fired, runbook, resolved} {+ for _, change := range []*unifiedresources.ResourceChange{fired, snoozed, unsnoozed, runbook, resolved} {if err := canonicalStore.RecordChange(*change); err != nil {t.Fatalf("RecordChange(%s): %v", change.ID, err)}@@ -160,12 +173,18 @@ func TestIncidentStore_ProjectsCanonicalTimelineWhenAttached(t *testing.T) {foundAnalysis := falsefoundRunbook := false+ foundSnoozed := false+ foundUnsnoozed := falsefor _, event := range timeline.Events {switch event.Type {case IncidentEventAnalysis:foundAnalysis = truecase IncidentEventRunbook:foundRunbook = true+ case IncidentEventAlertSnoozed:+ foundSnoozed = event.Details["user"] == "[email protected]" && event.Details["snoozedUntil"] == snoozedUntil+ case IncidentEventAlertUnsnoozed:+ foundUnsnoozed = event.Details["user"] == "[email protected]"}}if !foundAnalysis {@@ -174,6 +193,9 @@ func TestIncidentStore_ProjectsCanonicalTimelineWhenAttached(t *testing.T) {if !foundRunbook {t.Fatal("expected runbook event to be projected from canonical history")}+ if !foundSnoozed || !foundUnsnoozed {+ t.Fatalf("expected snooze lifecycle with actor and expiry, snoozed=%v unsnoozed=%v", foundSnoozed, foundUnsnoozed)+ }}func TestIncidentStore_CanonicalProjectionOverridesLegacyLifecycleState(t *testing.T) {diff --git a/internal/alerts/active_lifecycle.go b/internal/alerts/active_lifecycle.goindex d65571cb8c..1ea0c699cf 100644--- a/internal/alerts/active_lifecycle.go+++ b/internal/alerts/active_lifecycle.go@@ -6,6 +6,7 @@ import ("strings""time"+ "github.com/rcourtman/pulse-go-rewrite/internal/alerts/eventlog""github.com/rcourtman/pulse-go-rewrite/internal/alerts/reducer""github.com/rcourtman/pulse-go-rewrite/internal/operationaltrust""github.com/rs/zerolog/log"@@ -224,7 +225,7 @@ func (m *Manager) SuppressOperationalAlert(return fmt.Errorf("suppression reason is required")}- now := time.Now().UTC()+ now := m.policyNow().UTC()if expiresAt != nil {value := expiresAt.UTC()if !value.After(now) {@@ -269,7 +270,14 @@ func (m *Manager) SuppressOperationalAlert(alert.OperationalRecord.EvidenceIDs,)m.setActiveAlertNoLock(key, alert)+ alertCopy := alert.Clone()m.mu.Unlock()+ details := map[string]string{"actor": actor}+ if expiresAt != nil {+ details["until"] = expiresAt.UTC().Format(time.RFC3339Nano)+ }+ m.recordAlertEvent(eventlog.TypeSnoozed, alertCopy, alertID, reason,+ "Alert notifications and escalations snoozed.", details)m.saveActiveAlertsAsync("operational suppression")return nil}@@ -277,16 +285,103 @@ func (m *Manager) SuppressOperationalAlert(// UnsuppressOperationalAlert returns a suppressed record to the detector-owned// active state. It does not resolve or erase the underlying alert.func (m *Manager) UnsuppressOperationalAlert(alertID string) error {- return m.updateExplicitOperationalState(- alertID,- operationaltrust.OperationalOpen,- operationaltrust.TransitionSuppressionExpired,- "suppression_removed",- nil,- func(record *operationaltrust.OperationalRecord) {- record.Suppression = nil- },- )+ return m.unsuppressOperationalAlert(alertID, "suppression_removed", "system")+}++// SnoozeAlert is the user-facing, bounded alert hold. It deliberately reuses+// the canonical operational suppression record so every surface observes one+// lifecycle state rather than a UI-only timer.+func (m *Manager) SnoozeAlert(alertID, actor string, until time.Time) error {+ now := m.policyNow().UTC()+ until = until.UTC()+ if !until.After(now) {+ return fmt.Errorf("snooze expiry must be in the future")+ }+ if until.After(now.Add(30 * 24 * time.Hour)) {+ return fmt.Errorf("snooze expiry cannot be more than 30 days away")+ }+ return m.SuppressOperationalAlert(alertID, actor, "user_snooze", &until)+}++// UnsnoozeAlert resumes normal delivery policy without resolving the finding.+func (m *Manager) UnsnoozeAlert(alertID, actor string) error {+ actor = strings.TrimSpace(actor)+ if actor == "" {+ return fmt.Errorf("unsnooze actor is required")+ }+ return m.unsuppressOperationalAlert(alertID, "user_resumed", actor)+}++func (m *Manager) unsuppressOperationalAlert(alertID, reason, actor string) error {+ now := m.policyNow().UTC()+ m.mu.Lock()+ key, exists := m.resolveActiveAlertKeyNoLock(alertID)+ if !exists {+ m.mu.Unlock()+ return fmt.Errorf("%w: %s", ErrAlertNotFound, alertID)+ }+ alert, ok := m.getActiveAlertNoLock(key)+ if !ok || alert == nil {+ m.mu.Unlock()+ return fmt.Errorf("%w: %s", ErrAlertNotFound, alertID)+ }+ ensureOperationalContract(alert, now)+ if alert.OperationalRecord == nil || alert.OperationalRecord.State != operationaltrust.OperationalSuppressed {+ m.mu.Unlock()+ return nil+ }+ from := alert.OperationalRecord.State+ to := operationaltrust.OperationalOpen+ if alert.Acknowledged {+ to = operationaltrust.OperationalAcknowledged+ }+ alert.OperationalRecord.State = to+ alert.OperationalRecord.StateChangedAt = now+ alert.OperationalRecord.Suppression = nil+ appendExplicitOperationalTransition(alert, from, to, now,+ operationaltrust.TransitionSuppressionExpired, reason, alert.OperationalRecord.EvidenceIDs)+ m.setActiveAlertNoLock(key, alert)+ alertCopy := alert.Clone()+ m.mu.Unlock()+ m.recordAlertEvent(eventlog.TypeUnsnoozed, alertCopy, alertID, reason,+ "Alert snooze ended; normal delivery policy resumed.", map[string]string{"actor": actor})+ m.saveActiveAlertsAsync("operational unsuppression")+ return nil+}++func alertSnoozeUntil(alert *Alert, now time.Time) (*time.Time, bool) {+ if alert == nil || alert.OperationalRecord == nil ||+ alert.OperationalRecord.State != operationaltrust.OperationalSuppressed ||+ alert.OperationalRecord.Suppression == nil {+ return nil, false+ }+ if alert.OperationalRecord.Suppression.ExpiresAt == nil {+ return nil, true+ }+ until := alert.OperationalRecord.Suppression.ExpiresAt.UTC()+ if !until.After(now) {+ return &until, false+ }+ return &until, true+}++// expireOperationalSuppressions makes time-based lifecycle changes explicit+// and durable. Reads never silently mutate an expired suppression.+func (m *Manager) expireOperationalSuppressions() {+ now := m.policyNow().UTC()+ m.mu.RLock()+ ids := make([]string, 0)+ for key, alert := range m.activeAlerts {+ if until, active := alertSnoozeUntil(alert, now); until != nil && !active {+ ids = append(ids, effectiveAlertID(alert, key))+ }+ }+ m.mu.RUnlock()+ for _, id := range ids {+ if err := m.unsuppressOperationalAlert(id, "snooze_expired", "system"); err != nil {+ log.Warn().Err(err).Str("alertID", id).Msg("failed to expire alert snooze")+ }+ }}// MarkOperationalCollectionStale preserves an open finding when its source isdiff --git a/internal/alerts/escalation.go b/internal/alerts/escalation.goindex af5bbe4191..03212b6f54 100644--- a/internal/alerts/escalation.go+++ b/internal/alerts/escalation.go@@ -3,6 +3,7 @@ package alertsimport ("time"+ "github.com/rcourtman/pulse-go-rewrite/internal/operationaltrust""github.com/rs/zerolog/log")@@ -27,6 +28,7 @@ func (m *Manager) escalationChecker() {// checkEscalations checks all active alerts for escalationfunc (m *Manager) checkEscalations() {+ m.expireOperationalSuppressions()m.mu.Lock()defer m.mu.Unlock()@@ -40,14 +42,26 @@ func (m *Manager) checkEscalations() {return}- now := time.Now()+ now := m.policyNow()for _, alert := range m.activeAlerts {// Skip acknowledged alertsif alert.Acknowledged {continue}+ if _, snoozed := alertSnoozeUntil(alert, now); snoozed {+ continue+ }// Check each escalation level+ escalationBaseline := alert.StartTime+ if transition := alert.LatestTransition; transition != nil &&+ transition.Cause == operationaltrust.TransitionSuppressionExpired &&+ transition.At.After(escalationBaseline) {+ // Snoozed escalation levels are deliberately skipped, not replayed in+ // a burst. After resume, the remaining escalation schedule starts+ // from the explicit resume transition while incident age is preserved.+ escalationBaseline = transition.At+ }for i, level := range m.config.Schedule.Escalation.Levels {// Skip if we've already escalated to this levelif alert.LastEscalation >= i+1 {@@ -55,7 +69,7 @@ func (m *Manager) checkEscalations() {}// Check if it's time to escalate- escalateTime := alert.StartTime.Add(time.Duration(level.After) * time.Minute)+ escalateTime := escalationBaseline.Add(time.Duration(level.After) * time.Minute)if now.After(escalateTime) {// Update alert escalation statealert.LastEscalation = i + 1diff --git a/internal/alerts/event_emission.go b/internal/alerts/event_emission.goindex fe0b9229a3..2b9238bab0 100644--- a/internal/alerts/event_emission.go+++ b/internal/alerts/event_emission.go@@ -90,6 +90,8 @@ func (m *Manager) ReplayLifecycleEvents(visit func(LifecycleEvent) error) erroreventlog.TypeResolved,eventlog.TypeAcknowledged,eventlog.TypeUnacknowledged,+ eventlog.TypeSnoozed,+ eventlog.TypeUnsnoozed,}}, func(event eventlog.Event) error {if len(event.Snapshot) == 0 {return nil@@ -206,7 +208,8 @@ func cloneStringMap(input map[string]string) map[string]string {func eventCarriesAlertSnapshot(eventType string) bool {switch eventType {case eventlog.TypeFired, eventlog.TypeRefired, eventlog.TypeResolved,- eventlog.TypeAcknowledged, eventlog.TypeUnacknowledged, eventlog.TypeEscalated:+ eventlog.TypeAcknowledged, eventlog.TypeUnacknowledged, eventlog.TypeSnoozed,+ eventlog.TypeUnsnoozed, eventlog.TypeEscalated:return truedefault:return falsediff --git a/internal/alerts/eventlog/active_state.go b/internal/alerts/eventlog/active_state.goindex 71a10b7247..02987d4674 100644--- a/internal/alerts/eventlog/active_state.go+++ b/internal/alerts/eventlog/active_state.go@@ -264,7 +264,7 @@ func projectLifecycleActiveState(tx *sql.Tx, event Event) error {return nil}switch event.Type {- case TypeFired, TypeRefired, TypeAcknowledged, TypeUnacknowledged, TypeEscalated:+ case TypeFired, TypeRefired, TypeAcknowledged, TypeUnacknowledged, TypeSnoozed, TypeUnsnoozed, TypeEscalated:snapshot, err := activeSnapshotFromEvent(event)if err != nil {return errdiff --git a/internal/alerts/eventlog/eventlog.go b/internal/alerts/eventlog/eventlog.goindex 6370e5bab3..471633dabe 100644--- a/internal/alerts/eventlog/eventlog.go+++ b/internal/alerts/eventlog/eventlog.go@@ -35,6 +35,8 @@ const (TypeResolved = "resolved"TypeAcknowledged = "acknowledged"TypeUnacknowledged = "unacknowledged"+ TypeSnoozed = "snoozed"+ TypeUnsnoozed = "unsnoozed"TypeEscalated = "escalated"TypeFlappingDetected = "flapping_detected"TypeNotificationDispatched = "notification_dispatched"@@ -69,7 +71,8 @@ type Event struct {Details map[string]string `json:"details,omitempty"`// Snapshot is the full alert state at the moment of the event, recorded// for lifecycle transitions (fired, refired, resolved, acknowledged,- // unacknowledged) so alert history can be projected from the log alone.+ // unacknowledged, snoozed, unsnoozed) so alert history can be projected+ // from the log alone.Snapshot json.RawMessage `json:"snapshot,omitempty"`}diff --git a/internal/alerts/history_projection.go b/internal/alerts/history_projection.goindex fca798373b..d59994c126 100644--- a/internal/alerts/history_projection.go+++ b/internal/alerts/history_projection.go@@ -51,6 +51,8 @@ func (m *Manager) AlertHistoryFromEvents(since time.Time, limit int) ([]Alert, beventlog.TypeResolved,eventlog.TypeAcknowledged,eventlog.TypeUnacknowledged,+ eventlog.TypeSnoozed,+ eventlog.TypeUnsnoozed,eventlog.TypeEscalated,eventlog.TypeHistoryImported,eventlog.TypeHistoryCleared,diff --git a/internal/alerts/notification_policy.go b/internal/alerts/notification_policy.goindex ec67dc594f..933ab659a3 100644--- a/internal/alerts/notification_policy.go+++ b/internal/alerts/notification_policy.go@@ -29,6 +29,7 @@ const (AlertDeliveryReasonReady = "ready"AlertDeliveryReasonAcknowledged = "acknowledged"+ AlertDeliveryReasonSnoozed = "snoozed"AlertDeliveryReasonNotificationsDisabled = "notifications_disabled"AlertDeliveryReasonNotificationsInactive = "notifications_inactive"AlertDeliveryReasonSuppressionWindow = "suppression_window"@@ -172,6 +173,16 @@ func (m *Manager) dispatchAlert(alert *Alert, async bool) bool {AlertDeliveryReasonAcknowledged, "Notification suppressed: alert is acknowledged.", nil)return false}+ if until, snoozed := alertSnoozeUntil(alert, m.policyNow()); snoozed {+ details := map[string]string(nil)+ if until != nil {+ details = map[string]string{"until": until.Format(time.RFC3339Nano)}+ }+ m.recordAlertEvent(eventlog.TypeNotificationSuppressed, alert, "",+ AlertDeliveryReasonSnoozed, "Notification suppressed: alert is snoozed.",+ details)+ return false+ }trackingKey := canonicalTrackingKeyForAlert(alert)@@ -566,6 +577,10 @@ func (m *Manager) ShouldSuppressNotification(alert *Alert) bool {m.mu.RLock()defer m.mu.RUnlock()+ if _, snoozed := alertSnoozeUntil(alert, m.policyNow()); snoozed {+ clearQuietHoursNotificationReplay(alert)+ return true+ }if suppressed, reason := m.operatorSuppressionForAlertNoLock(alert, time.Now().UTC()); suppressed {clearQuietHoursNotificationReplay(alert)@@ -614,6 +629,11 @@ func (m *Manager) ShouldSuppressResolvedNotification(alert *Alert) bool {Msg("Recovery notification suppressed for acknowledged alert")return true}+ if _, snoozed := alertSnoozeUntil(alert, m.policyNow()); snoozed {+ clearQuietHoursNotificationReplay(alert)+ log.Debug().Str("alertID", alert.ID).Msg("Recovery notification suppressed for snoozed alert")+ return true+ }if suppressed, reason := m.operatorSuppressionForAlertNoLock(alert, time.Now().UTC()); suppressed {clearQuietHoursNotificationReplay(alert)log.Debug().@@ -765,6 +785,15 @@ func (m *Manager) diagnoseActiveAlertLocked(alert *Alert) AlertDeliveryDiagnosisswitch {case alert.Acknowledged:diagnosis.setSuppressed(AlertDeliveryReasonAcknowledged, "Alert is acknowledged, so firing notifications are suppressed.")+ case func() bool {+ until, snoozed := alertSnoozeUntil(alert, now)+ if !snoozed {+ return false+ }+ diagnosis.SuppressedUntil = until+ diagnosis.setSuppressed(AlertDeliveryReasonSnoozed, "Alert is snoozed, so notifications and escalations are paused until the selected time.")+ return true+ }():case !m.config.Enabled:diagnosis.setSuppressed(AlertDeliveryReasonNotificationsDisabled, "Alert notifications are disabled in the alert configuration.")case m.config.ActivationState != ActivationActive:diff --git a/internal/alerts/operational_contract.go b/internal/alerts/operational_contract.goindex 98176d2f6d..695e04c36e 100644--- a/internal/alerts/operational_contract.go+++ b/internal/alerts/operational_contract.go@@ -524,7 +524,9 @@ func operationalStateForAlert(alert *Alert) operationaltrust.OperationalState {if suppression.ExpiresAt == nil || suppression.ExpiresAt.After(time.Now()) {return operationaltrust.OperationalSuppressed}- alert.OperationalRecord.Suppression = nil+ // Expiry is a lifecycle transition owned by the manager timer. Reads+ // must not silently mutate the canonical record or erase its audit trail.+ return operationaltrust.OperationalSuppressed}if alert.OperationalRecord != nil {switch alert.OperationalRecord.State {diff --git a/internal/alerts/operational_contract_test.go b/internal/alerts/operational_contract_test.goindex bed29d1889..e0e5c68a31 100644--- a/internal/alerts/operational_contract_test.go+++ b/internal/alerts/operational_contract_test.go@@ -76,6 +76,29 @@ func TestEnsureOperationalContractBackfillsLegacyAlertHonestly(t *testing.T) {}}+func TestIndefiniteOperationalSuppressionRemainsDeliverySafe(t *testing.T) {+ m := newTestManager(t)+ now := time.Now().UTC()+ cfg := m.GetConfig()+ cfg.Enabled = true+ cfg.ActivationState = ActivationActive+ m.UpdateConfig(cfg)+ alert := &Alert{ID: "maintenance:vm/100", CanonicalState: "maintenance:vm/100", CanonicalSpecID: "maintenance", Type: "maintenance", Level: AlertLevelWarning, ResourceID: "vm/100", ResourceName: "vm-100", StartTime: now, LastSeen: now}+ m.mu.Lock()+ m.setActiveAlertNoLock(alert.ID, alert)+ m.mu.Unlock()+ if err := m.SuppressOperationalAlert(alert.ID, "[email protected]", "maintenance", nil); err != nil {+ t.Fatal(err)+ }+ if m.dispatchAlert(activeAlert(t, m, alert.ID), false) {+ t.Fatal("indefinitely suppressed alert was dispatched")+ }+ diagnosis, ok := m.DiagnoseAlertDelivery(alert.ID)+ if !ok || diagnosis.Reason != AlertDeliveryReasonSnoozed || diagnosis.SuppressedUntil != nil {+ t.Fatalf("diagnosis = %+v, exists=%v", diagnosis, ok)+ }+}+func TestEnsureOperationalContractUsesCanonicalIncidentAction(t *testing.T) {now := time.Date(2026, 7, 19, 1, 0, 0, 0, time.UTC)alert := &Alert{diff --git a/internal/alerts/snooze_lifecycle_test.go b/internal/alerts/snooze_lifecycle_test.gonew file mode 100644index 0000000000..30ad67650c--- /dev/null+++ b/internal/alerts/snooze_lifecycle_test.go@@ -0,0 +1,149 @@+package alerts++import (+ "encoding/json"+ "testing"+ "time"++ "github.com/rcourtman/pulse-go-rewrite/internal/alerts/eventlog"+ "github.com/rcourtman/pulse-go-rewrite/internal/operationaltrust"+)++func TestAlertSnoozeIsDurableAndEnforcedByDeliveryPolicy(t *testing.T) {+ m := newTestManager(t)+ store, err := eventlog.OpenInMemory()+ if err != nil {+ t.Fatal(err)+ }+ m.SetEventLog(store)++ now := time.Date(2026, 8, 27, 12, 0, 0, 0, time.UTC)+ m.now = func() time.Time { return now }+ cfg := m.GetConfig()+ cfg.Enabled = true+ cfg.ActivationState = ActivationActive+ m.UpdateConfig(cfg)++ alert := &Alert{+ ID: "cpu:vm/100", CanonicalState: "cpu:vm/100", CanonicalSpecID: "cpu",+ Type: "cpu", Level: AlertLevelCritical, ResourceID: "vm/100", ResourceName: "vm-100",+ StartTime: now.Add(-time.Hour), LastSeen: now, Message: "CPU is critical.",+ }+ m.mu.Lock()+ m.setActiveAlertNoLock(alert.ID, alert)+ m.mu.Unlock()++ deliveries := 0+ m.SetAlertCallback(func(*Alert) { deliveries++ })+ until := now.Add(2 * time.Hour)+ if err := m.SnoozeAlert(alert.ID, "[email protected]", until); err != nil {+ t.Fatalf("SnoozeAlert() error = %v", err)+ }+ m.NotifyExistingAlert(alert.ID)+ if deliveries != 0 {+ t.Fatalf("snoozed alert delivered %d notifications, want 0", deliveries)+ }++ diagnosis, ok := m.DiagnoseAlertDelivery(alert.ID)+ if !ok || diagnosis.Reason != AlertDeliveryReasonSnoozed {+ t.Fatalf("diagnosis = %+v, exists=%v", diagnosis, ok)+ }+ if diagnosis.SuppressedUntil == nil || !diagnosis.SuppressedUntil.Equal(until) {+ t.Fatalf("suppressedUntil = %v, want %v", diagnosis.SuppressedUntil, until)+ }++ snapshots, err := store.LoadActiveState()+ if err != nil || len(snapshots) != 1 {+ t.Fatalf("LoadActiveState() = %d snapshots, %v", len(snapshots), err)+ }+ var durable Alert+ if err := json.Unmarshal(snapshots[0].Snapshot, &durable); err != nil {+ t.Fatal(err)+ }+ if durable.OperationalRecord == nil || durable.OperationalRecord.State != operationaltrust.OperationalSuppressed {+ t.Fatalf("durable operational record = %+v", durable.OperationalRecord)+ }++ if err := m.UnsnoozeAlert(alert.ID, "[email protected]"); err != nil {+ t.Fatal(err)+ }+ resumed := activeAlert(t, m, alert.ID)+ if resumed.OperationalRecord.State != operationaltrust.OperationalOpen || resumed.OperationalRecord.Suppression != nil {+ t.Fatalf("resumed record = %+v", resumed.OperationalRecord)+ }+ events, err := m.AlertEvents(eventlog.Filter{AlertID: alert.ID})+ if err != nil {+ t.Fatal(err)+ }+ seenSnoozed, seenUnsnoozed := false, false+ for _, event := range events {+ seenSnoozed = seenSnoozed || event.Type == eventlog.TypeSnoozed+ seenUnsnoozed = seenUnsnoozed || event.Type == eventlog.TypeUnsnoozed+ }+ if !seenSnoozed || !seenUnsnoozed {+ t.Fatalf("snooze lifecycle events = %+v", events)+ }+}++func TestUnsnoozeRestoresAcknowledgedState(t *testing.T) {+ m := newTestManager(t)+ now := time.Now().UTC()+ alert := &Alert{ID: "memory:vm/100", CanonicalState: "memory:vm/100", CanonicalSpecID: "memory", Type: "memory", Level: AlertLevelWarning, ResourceID: "vm/100", ResourceName: "vm-100", StartTime: now, LastSeen: now}+ m.mu.Lock()+ m.setActiveAlertNoLock(alert.ID, alert)+ m.mu.Unlock()+ if err := m.AcknowledgeAlert(alert.ID, "[email protected]"); err != nil {+ t.Fatal(err)+ }+ if err := m.SnoozeAlert(alert.ID, "[email protected]", now.Add(time.Hour)); err != nil {+ t.Fatal(err)+ }+ if err := m.UnsnoozeAlert(alert.ID, "[email protected]"); err != nil {+ t.Fatal(err)+ }+ got := activeAlert(t, m, alert.ID)+ if got.OperationalRecord.State != operationaltrust.OperationalAcknowledged || !got.Acknowledged {+ t.Fatalf("restored state = %q, acknowledged=%v", got.OperationalRecord.State, got.Acknowledged)+ }+}++func TestSnoozeExpiryResumesEscalationWithoutReplayingMissedLevels(t *testing.T) {+ m := newTestManager(t)+ now := time.Date(2026, 8, 27, 12, 0, 0, 0, time.UTC)+ m.now = func() time.Time { return now }+ cfg := m.GetConfig()+ cfg.Enabled = true+ cfg.ActivationState = ActivationActive+ cfg.Schedule.Escalation.Enabled = true+ cfg.Schedule.Escalation.Levels = []EscalationLevel{{After: 1, Notify: "all"}}+ m.UpdateConfig(cfg)+ alert := &Alert{ID: "disk:vm/100", CanonicalState: "disk:vm/100", CanonicalSpecID: "disk", Type: "disk", Level: AlertLevelCritical, ResourceID: "vm/100", ResourceName: "vm-100", StartTime: now.Add(-time.Hour), LastSeen: now}+ m.mu.Lock()+ m.setActiveAlertNoLock(alert.ID, alert)+ m.mu.Unlock()++ escalations := make(chan struct{}, 2)+ m.SetEscalateCallback(func(*Alert, int) { escalations <- struct{}{} })+ until := now.Add(2 * time.Hour)+ if err := m.SnoozeAlert(alert.ID, "[email protected]", until); err != nil {+ t.Fatal(err)+ }+ now = until.Add(time.Second)+ m.checkEscalations()+ select {+ case <-escalations:+ t.Fatal("expiry replayed a missed escalation level")+ case <-time.After(100 * time.Millisecond):+ }+ if activeAlert(t, m, alert.ID).OperationalRecord.State != operationaltrust.OperationalOpen {+ t.Fatal("expired snooze did not reopen the alert")+ }++ now = now.Add(2 * time.Minute)+ m.checkEscalations()+ select {+ case <-escalations:+ case <-time.After(time.Second):+ t.Fatal("post-resume escalation did not run")+ }+}diff --git a/internal/api/alerting/alerts.go b/internal/api/alerting/alerts.goindex b2cac895ad..2b4aea8c72 100644--- a/internal/api/alerting/alerts.go+++ b/internal/api/alerting/alerts.go@@ -39,6 +39,8 @@ type AlertManager interface {ClearAlertHistory() errorUnacknowledgeAlert(id string) errorAcknowledgeAlert(id, user string) error+ SnoozeAlert(id, user string, until time.Time) error+ UnsnoozeAlert(id, user string) errorClearAlert(id string) boolGetAlertHistory(limit int) []alerts.AlertGetAlertHistorySince(since time.Time, limit int) []alerts.Alert@@ -1026,6 +1028,11 @@ type alertIdentifierRequest struct {AlertIdentifier string `json:"alertIdentifier"`}+type snoozeAlertRequest struct {+ AlertIdentifier string `json:"alertIdentifier"`+ Until time.Time `json:"until"`+}+func (r alertIdentifierRequest) identifier() string {return strings.TrimSpace(r.AlertIdentifier)}@@ -1141,6 +1148,78 @@ func (h *AlertHandlers) UnacknowledgeAlertByBody(w http.ResponseWriter, r *http.}}+// SnoozeAlertByBody pauses this occurrence's notifications and escalations.+// POST /api/alerts/snooze with {"alertIdentifier":"alert-id","until":"RFC3339"}+func (h *AlertHandlers) SnoozeAlertByBody(w http.ResponseWriter, r *http.Request) {+ r.Body = http.MaxBytesReader(w, r.Body, 16<<10)+ var req snoozeAlertRequest+ decoder := json.NewDecoder(r.Body)+ decoder.DisallowUnknownFields()+ if err := decoder.Decode(&req); err != nil {+ http.Error(w, "Invalid request body", http.StatusBadRequest)+ return+ }+ alertID := strings.TrimSpace(req.AlertIdentifier)+ if alertID == "" || !validateAlertIdentifier(alertID) || req.Until.IsZero() {+ http.Error(w, "Valid alert identifier and snooze expiry are required", http.StatusBadRequest)+ return+ }+ user := w.Header().Get("X-Authenticated-User")+ if user == "" {+ user = "unknown"+ }+ if err := h.getMonitor(r.Context()).GetAlertManager().SnoozeAlert(alertID, user, req.Until); err != nil {+ status := http.StatusBadRequest+ if errors.Is(err, alerts.ErrAlertNotFound) {+ status = http.StatusNotFound+ }+ http.Error(w, err.Error(), status)+ return+ }+ h.getMonitor(r.Context()).SyncAlertState()+ if err := utils.WriteJSONResponse(w, map[string]any{"success": true, "snoozedUntil": req.Until.UTC()}); err != nil {+ log.Error().Err(err).Str("alertID", alertID).Msg("Failed to write snooze response")+ }+ if h.wsHub != nil {+ ctx := r.Context()+ go h.broadcastStateForContext(ctx)+ }+}++// UnsnoozeAlertByBody resumes normal policy without resolving the alert.+func (h *AlertHandlers) UnsnoozeAlertByBody(w http.ResponseWriter, r *http.Request) {+ var req alertIdentifierRequest+ if err := json.NewDecoder(http.MaxBytesReader(w, r.Body, 16<<10)).Decode(&req); err != nil {+ http.Error(w, "Invalid request body", http.StatusBadRequest)+ return+ }+ alertID := req.identifier()+ if alertID == "" || !validateAlertIdentifier(alertID) {+ http.Error(w, "Valid alert identifier is required", http.StatusBadRequest)+ return+ }+ user := w.Header().Get("X-Authenticated-User")+ if user == "" {+ user = "unknown"+ }+ if err := h.getMonitor(r.Context()).GetAlertManager().UnsnoozeAlert(alertID, user); err != nil {+ status := http.StatusBadRequest+ if errors.Is(err, alerts.ErrAlertNotFound) {+ status = http.StatusNotFound+ }+ http.Error(w, err.Error(), status)+ return+ }+ h.getMonitor(r.Context()).SyncAlertState()+ if err := utils.WriteJSONResponse(w, map[string]bool{"success": true}); err != nil {+ log.Error().Err(err).Str("alertID", alertID).Msg("Failed to write unsnooze response")+ }+ if h.wsHub != nil {+ ctx := r.Context()+ go h.broadcastStateForContext(ctx)+ }+}+// ClearAlertByBody clears an alert using a canonical alert identifier from the request body.// POST /api/alerts/clear with {"alertIdentifier": "alert-id"}func (h *AlertHandlers) ClearAlertByBody(w http.ResponseWriter, r *http.Request) {@@ -1420,6 +1499,16 @@ func (h *AlertHandlers) HandleAlerts(w http.ResponseWriter, r *http.Request) {return}h.UnacknowledgeAlertByBody(w, r)+ case path == "snooze" && r.Method == http.MethodPost:+ if !apihttp.EnsureScope(w, r, config.ScopeMonitoringWrite) {+ return+ }+ h.SnoozeAlertByBody(w, r)+ case path == "unsnooze" && r.Method == http.MethodPost:+ if !apihttp.EnsureScope(w, r, config.ScopeMonitoringWrite) {+ return+ }+ h.UnsnoozeAlertByBody(w, r)case path == "clear" && r.Method == http.MethodPost:if !apihttp.EnsureScope(w, r, config.ScopeMonitoringWrite) {returndiff --git a/internal/api/alerting/alerts_test.go b/internal/api/alerting/alerts_test.goindex b93eecab8e..9c609061d2 100644--- a/internal/api/alerting/alerts_test.go+++ b/internal/api/alerting/alerts_test.go@@ -112,6 +112,14 @@ func (m *MockAlertManager) AcknowledgeAlert(id, user string) error {return args.Error(0)}+func (m *MockAlertManager) SnoozeAlert(id, user string, until time.Time) error {+ return m.Called(id, user, until).Error(0)+}++func (m *MockAlertManager) UnsnoozeAlert(id, user string) error {+ return m.Called(id, user).Error(0)+}+func (m *MockAlertManager) ClearAlert(id string) bool {args := m.Called(id)return args.Bool(0)@@ -986,6 +994,45 @@ func TestUnacknowledgeAlertByBody_CanonicalIdentifierSuccess(t *testing.T) {assert.Equal(t, 200, w.Code)}+func TestSnoozeAlertByBody_Success(t *testing.T) {+ mockMonitor := new(MockAlertMonitor)+ mockManager := new(MockAlertManager)+ mockMonitor.On("GetAlertManager").Return(mockManager)+ mockMonitor.On("SyncAlertState").Return()+ h := NewAlertHandlers(nil, mockMonitor, nil)+ until := time.Now().UTC().Add(2 * time.Hour).Truncate(time.Second)+ mockManager.On("SnoozeAlert", "canonical:a1", "[email protected]", until).Return(nil)+ req := httptest.NewRequest(http.MethodPost, "/api/alerts/snooze", strings.NewReader(fmt.Sprintf(`{"alertIdentifier":"canonical:a1","until":%q}`, until.Format(time.RFC3339))))+ w := httptest.NewRecorder()+ w.Header().Set("X-Authenticated-User", "[email protected]")+ h.SnoozeAlertByBody(w, req)+ assert.Equal(t, http.StatusOK, w.Code)+ mockManager.AssertExpectations(t)+}++func TestSnoozeAlertByBody_RejectsInvalidExpiry(t *testing.T) {+ h := NewAlertHandlers(nil, new(MockAlertMonitor), nil)+ req := httptest.NewRequest(http.MethodPost, "/api/alerts/snooze", strings.NewReader(`{"alertIdentifier":"a1","until":"not-a-time"}`))+ w := httptest.NewRecorder()+ h.SnoozeAlertByBody(w, req)+ assert.Equal(t, http.StatusBadRequest, w.Code)+}++func TestUnsnoozeAlertByBody_Success(t *testing.T) {+ mockMonitor := new(MockAlertMonitor)+ mockManager := new(MockAlertManager)+ mockMonitor.On("GetAlertManager").Return(mockManager)+ mockMonitor.On("SyncAlertState").Return()+ mockManager.On("UnsnoozeAlert", "a1", "[email protected]").Return(nil)+ h := NewAlertHandlers(nil, mockMonitor, nil)+ req := httptest.NewRequest(http.MethodPost, "/api/alerts/unsnooze", strings.NewReader(`{"alertIdentifier":"a1"}`))+ w := httptest.NewRecorder()+ w.Header().Set("X-Authenticated-User", "[email protected]")+ h.UnsnoozeAlertByBody(w, req)+ assert.Equal(t, http.StatusOK, w.Code)+ mockManager.AssertExpectations(t)+}+func TestClearAlertByBody_Success(t *testing.T) {mockMonitor := new(MockAlertMonitor)mockManager := new(MockAlertManager)diff --git a/internal/api/alerts_endpoints_test.go b/internal/api/alerts_endpoints_test.goindex e76d5a3403..eb4c80326d 100644--- a/internal/api/alerts_endpoints_test.go+++ b/internal/api/alerts_endpoints_test.go@@ -6,6 +6,7 @@ import ("fmt""net/http""testing"+ "time""github.com/rcourtman/pulse-go-rewrite/internal/alerts""github.com/rcourtman/pulse-go-rewrite/internal/alerts/eventlog"@@ -371,6 +372,30 @@ func TestAlertsEndpoints(t *testing.T) {}})+ t.Run("SnoozeAndUnsnoozeAlert", func(t *testing.T) {+ until := time.Now().UTC().Add(time.Hour).Format(time.RFC3339)+ for _, request := range []struct {+ path string+ body map[string]string+ }{+ {path: "snooze", body: map[string]string{"alertIdentifier": "missing-alert", "until": until}},+ {path: "unsnooze", body: map[string]string{"alertIdentifier": "missing-alert"}},+ } {+ jsonBody, err := json.Marshal(request.body)+ if err != nil {+ t.Fatal(err)+ }+ res, err := http.Post(srv.server.URL+"/api/alerts/"+request.path, "application/json", bytes.NewReader(jsonBody))+ if err != nil {+ t.Fatalf("%s request failed: %v", request.path, err)+ }+ res.Body.Close()+ if res.StatusCode != http.StatusNotFound {+ t.Fatalf("%s status = %d, want %d", request.path, res.StatusCode, http.StatusNotFound)+ }+ }+ })+// 8. Bulk Acknowledget.Run("BulkAcknowledge", func(t *testing.T) {body := map[string]interface{}{diff --git a/internal/api/security_regression_test.go b/internal/api/security_regression_test.goindex cbe1ec0431..ba5981d603 100644--- a/internal/api/security_regression_test.go+++ b/internal/api/security_regression_test.go@@ -1939,6 +1939,8 @@ func TestAlertMutationEndpointsRequireMonitoringWriteScope(t *testing.T) {{method: http.MethodPost, path: "/api/alerts/bulk/clear", body: `{}`},{method: http.MethodPost, path: "/api/alerts/acknowledge", body: `{}`},{method: http.MethodPost, path: "/api/alerts/unacknowledge", body: `{}`},+ {method: http.MethodPost, path: "/api/alerts/snooze", body: `{}`},+ {method: http.MethodPost, path: "/api/alerts/unsnooze", body: `{}`},{method: http.MethodPost, path: "/api/alerts/clear", body: `{}`},{method: http.MethodPost, path: "/api/alerts/incidents/note", body: `{}`},}diff --git a/internal/monitoring/monitor_alert_handling_test.go b/internal/monitoring/monitor_alert_handling_test.goindex 8c645e20c2..b7ed5de654 100644--- a/internal/monitoring/monitor_alert_handling_test.go+++ b/internal/monitoring/monitor_alert_handling_test.go@@ -114,6 +114,21 @@ func TestMonitor_HandleAlertLifecycle_WritesCanonicalChanges(t *testing.T) {Alert: alert,Details: map[string]string{"user": "admin"},})+ m.handleAlertLifecycleEvent(alerts.LifecycleEvent{+ Type: eventlog.TypeSnoozed,+ OccurredAt: ackAt.Add(2 * time.Minute),+ Alert: alert,+ Details: map[string]string{+ "actor": "admin",+ "until": ackAt.Add(2 * time.Hour).Format(time.RFC3339),+ },+ })+ m.handleAlertLifecycleEvent(alerts.LifecycleEvent{+ Type: eventlog.TypeUnsnoozed,+ OccurredAt: ackAt.Add(3 * time.Minute),+ Alert: alert,+ Details: map[string]string{"actor": "admin"},+ })m.handleAlertLifecycleEvent(alerts.LifecycleEvent{Type: eventlog.TypeUnacknowledged,OccurredAt: ackAt.Add(time.Minute),@@ -125,11 +140,13 @@ func TestMonitor_HandleAlertLifecycle_WritesCanonicalChanges(t *testing.T) {if err != nil {t.Fatalf("GetRecentChanges: %v", err)}- if len(changes) != 3 {- t.Fatalf("expected 3 canonical changes, got %d", len(changes))+ if len(changes) != 5 {+ t.Fatalf("expected 5 canonical changes, got %d", len(changes))}wantKinds := []unifiedresources.ChangeKind{unifiedresources.ChangeAlertUnacknowledged,+ unifiedresources.ChangeAlertUnsnoozed,+ unifiedresources.ChangeAlertSnoozed,unifiedresources.ChangeAlertAcknowledged,unifiedresources.ChangeAlertFired,}@@ -138,10 +155,10 @@ func TestMonitor_HandleAlertLifecycle_WritesCanonicalChanges(t *testing.T) {t.Fatalf("changes[%d].Kind = %q, want %q", idx, changes[idx].Kind, want)}}- if got := changes[2].Metadata["alert_identifier"]; got != "alert-canonical-1" {+ if got := changes[4].Metadata["alert_identifier"]; got != "alert-canonical-1" {t.Fatalf("alert_identifier = %#v, want alert-canonical-1", got)}- if got := changes[2].Metadata["incidentCategory"]; got != "health" {+ if got := changes[4].Metadata["incidentCategory"]; got != "health" {t.Fatalf("incidentCategory = %#v, want health", got)}if got := changes[2].Metadata["vmwareConnectionId"]; got != "vc-1" {diff --git a/internal/monitoring/monitor_alerts.go b/internal/monitoring/monitor_alerts.goindex 9751beac49..95da5cbfee 100644--- a/internal/monitoring/monitor_alerts.go+++ b/internal/monitoring/monitor_alerts.go@@ -317,6 +317,9 @@ func (m *Monitor) handleAlertLifecycleEvent(event alerts.LifecycleEvent) {}actor := event.Details["user"]+ if strings.TrimSpace(actor) == "" {+ actor = event.Details["actor"]+ }timelineAlert := alertif alerts.IsSystemAlert(alert) && strings.TrimSpace(alert.ResourceID) == "" {timelineAlert = alert.Clone()@@ -346,6 +349,17 @@ func (m *Monitor) handleAlertLifecycleEvent(event alerts.LifecycleEvent) {m.incidentStore.RecordAlertUnacknowledged(timelineAlert, actor)}m.recordAlertTimelineChange(timelineAlert, unifiedresources.ChangeAlertUnacknowledged, event.OccurredAt, actor)+ case eventlog.TypeSnoozed:+ timelineAlert = timelineAlert.Clone()+ if timelineAlert.Metadata == nil {+ timelineAlert.Metadata = make(map[string]any)+ }+ if until := strings.TrimSpace(event.Details["until"]); until != "" {+ timelineAlert.Metadata["snoozedUntil"] = until+ }+ m.recordAlertTimelineChange(timelineAlert, unifiedresources.ChangeAlertSnoozed, event.OccurredAt, actor)+ case eventlog.TypeUnsnoozed:+ m.recordAlertTimelineChange(timelineAlert, unifiedresources.ChangeAlertUnsnoozed, event.OccurredAt, actor)case eventlog.TypeResolved:if m.incidentStore != nil {m.incidentStore.RecordAlertResolved(timelineAlert, event.OccurredAt)diff --git a/internal/unifiedresources/change_filters.go b/internal/unifiedresources/change_filters.goindex 30ac1a4d8d..1dc10d11f7 100644--- a/internal/unifiedresources/change_filters.go+++ b/internal/unifiedresources/change_filters.go@@ -67,6 +67,10 @@ func parseResourceChangeKinds(values []string) ([]ChangeKind, error) {parsed = append(parsed, ChangeAlertAcknowledged)case string(ChangeAlertUnacknowledged):parsed = append(parsed, ChangeAlertUnacknowledged)+ case string(ChangeAlertSnoozed):+ parsed = append(parsed, ChangeAlertSnoozed)+ case string(ChangeAlertUnsnoozed):+ parsed = append(parsed, ChangeAlertUnsnoozed)case string(ChangeAlertResolved):parsed = append(parsed, ChangeAlertResolved)case string(ChangeCommandExecuted):diff --git a/internal/unifiedresources/change_presentation.go b/internal/unifiedresources/change_presentation.goindex 0da47793d0..6eb323e417 100644--- a/internal/unifiedresources/change_presentation.go+++ b/internal/unifiedresources/change_presentation.go@@ -46,6 +46,10 @@ func ChangeKindLabel(kind ChangeKind) string {return "Alert acknowledged"case ChangeAlertUnacknowledged:return "Alert unacknowledged"+ case ChangeAlertSnoozed:+ return "Alert snoozed"+ case ChangeAlertUnsnoozed:+ return "Alert resumed"case ChangeAlertResolved:return "Alert resolved"case ChangeCommandExecuted:diff --git a/internal/unifiedresources/changes.go b/internal/unifiedresources/changes.goindex 1bd067be27..c4f80e4327 100644--- a/internal/unifiedresources/changes.go+++ b/internal/unifiedresources/changes.go@@ -27,6 +27,8 @@ const (ChangeAlertFired ChangeKind = "alert_fired"ChangeAlertAcknowledged ChangeKind = "alert_acknowledged"ChangeAlertUnacknowledged ChangeKind = "alert_unacknowledged"+ ChangeAlertSnoozed ChangeKind = "alert_snoozed"+ ChangeAlertUnsnoozed ChangeKind = "alert_unsnoozed"ChangeAlertResolved ChangeKind = "alert_resolved"ChangeCommandExecuted ChangeKind = "command_executed"ChangeRunbookExecuted ChangeKind = "runbook_executed"diff --git a/internal/unifiedresources/code_standards_test.go b/internal/unifiedresources/code_standards_test.goindex f4481d60c3..2507a25ad1 100644--- a/internal/unifiedresources/code_standards_test.go+++ b/internal/unifiedresources/code_standards_test.go@@ -1583,6 +1583,20 @@ func TestResourceChangePresentationUsesCanonicalLabels(t *testing.T) {}}+func TestAlertSnoozeChangeKindsRemainCanonical(t *testing.T) {+ filters, err := ParseResourceChangeFilters([]string{"alert_snoozed,alert_unsnoozed"}, nil, nil)+ if err != nil {+ t.Fatal(err)+ }+ want := []ChangeKind{ChangeAlertSnoozed, ChangeAlertUnsnoozed}+ if !reflect.DeepEqual(filters.Kinds, want) {+ t.Fatalf("snooze filters = %#v, want %#v", filters.Kinds, want)+ }+ if ChangeKindLabel(ChangeAlertSnoozed) != "Alert snoozed" || ChangeKindLabel(ChangeAlertUnsnoozed) != "Alert resumed" {+ t.Fatalf("snooze labels = %q, %q", ChangeKindLabel(ChangeAlertSnoozed), ChangeKindLabel(ChangeAlertUnsnoozed))+ }+}+func TestResourceRelationshipContextUsesCanonicalRelationshipPresentation(t *testing.T) {data, err := os.ReadFile(filepath.Join("..", "ai", "service.go"))if err != nil {diff --git a/internal/unifiedresources/incident_changes.go b/internal/unifiedresources/incident_changes.goindex a31b112a02..6503e1ee00 100644--- a/internal/unifiedresources/incident_changes.go+++ b/internal/unifiedresources/incident_changes.go@@ -168,6 +168,10 @@ func alertChangeReason(kind ChangeKind, alert AlertTimelineChange) string {return fmt.Sprintf("Alert unacknowledged: %s", message)}return "Alert unacknowledged"+ case ChangeAlertSnoozed:+ return "Alert snoozed"+ case ChangeAlertUnsnoozed:+ return "Alert notifications resumed"case ChangeAlertResolved:if message != "" {return fmt.Sprintf("Alert resolved: %s", message)