Skip to content

armgit / Pulse

Public Imported from GitHub
0

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

Harden external probe outage alerting

[email protected]a53d45e2d303
diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md
index 5ce1be2ad7..925d68d98d 100644
--- a/docs/CONFIGURATION.md
+++ b/docs/CONFIGURATION.md
@@ -509,7 +509,16 @@ its signed agent configuration, runs it on the configured interval, and
reports results back with its reports; results are only accepted from the
currently assigned agent. An assigned check is not also run locally. If no
report arrives for several intervals the check shows as indeterminate
-("no recent report from probe agent"), and if the entitlement lapses the
+("no recent report from probe agent"). After at least five minutes without a
+report, Pulse raises one warning per disconnected probe through the normal
+notification routes, even when that probe owns several checks. The incident is
+keyed to the probe agent rather than an arbitrary check, so changing assignments
+does not reopen it. If the agent heartbeat is also offline, the existing
+host-offline alert owns the incident instead of producing a duplicate probe
+warning. A paired Pulse Mobile client receives a privacy-safe
+`external_probe_offline` Relay push linked to that canonical alert. If the whole
+Pulse instance becomes unreachable, Relay's independent five-minute
+instance-offline push covers the dark-site case. If the entitlement lapses, the
check automatically resumes running from the Pulse server. Checks without an
assignment are unaffected and remain available in every edition.
diff --git a/docs/UNIFIED_AGENT.md b/docs/UNIFIED_AGENT.md
index d96e42b630..a075a8c1c9 100644
--- a/docs/UNIFIED_AGENT.md
+++ b/docs/UNIFIED_AGENT.md
@@ -95,17 +95,39 @@ Pulse can be assigned to run from a specific agent instead of the Pulse
server (Settings -> Monitoring -> Availability checks -> "Run from"). This is
how you monitor a site from the outside: deploy the agent on a machine
elsewhere — a cloud VM, a Docker host at another location — and assign checks
-to it. Alerting still happens on the Pulse server through your normal alert
-routes.
+to it. Target failures are evaluated on the Pulse server through your normal
+alert routes.
There is nothing to configure on the agent itself. Assignments arrive through
the agent's signed remote configuration, the agent runs each check on its
configured interval, and results are delivered with its regular reports.
Results survive temporary connectivity loss to the Pulse server in a bounded
in-memory queue; if the agent cannot deliver for several check intervals the
-check shows as indeterminate in Pulse until reports resume. The module
-appears as `availability` in the agent's module status when at least one
-check is assigned.
+check shows as indeterminate in Pulse until reports resume. After the
+five-minute minimum grace window, Pulse raises one
+`availability_probe_unavailable` warning per disconnected probe, regardless of
+how many checks it owns. That warning uses the normal email, webhook, Apprise,
+and recovery-notification pipeline. When Pulse Mobile is paired through Relay,
+Pulse also sends a privacy-safe `external_probe_offline` push linked to the
+canonical mobile attention item without exposing target names or addresses.
+The alert identity belongs to the probe agent, so adding or removing an
+assigned check does not resolve and reopen it.
+
+When the host heartbeat itself is offline, Pulse keeps the existing
+host-offline alert as the single canonical incident and suppresses the
+probe-results warning. Assigned probe hosts still receive the external-probe
+mobile push, but operators do not get two normal alerts for the same agent
+failure.
+
+This has a complementary dark-site path: if the entire Pulse instance or its
+site goes offline, Pulse Relay independently sends its existing instance
+offline push after five minutes. Together, probe-loss alerts while Pulse is
+online and Relay's instance-loss alert while Pulse is dark ensure the
+outside-monitoring path cannot disappear silently. Relay does not evaluate
+individual target results while the Pulse server is offline.
+
+The module appears as `availability` in the agent's module status when at
+least one check is assigned.
Note for ICMP (ping) checks: the probe uses the system `ping` binary. In
containers or hardened service units without `CAP_NET_RAW`, ICMP checks fail;
diff --git a/docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json b/docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json
index e194ca5cfa..96f5cdb730 100644
--- a/docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json
+++ b/docs/release-control/v6/internal/MOBILE_COMPATIBILITY_MANIFEST.json
@@ -46,6 +46,7 @@
"types": [
{ "value": "patrol_finding", "go_symbol": "PushTypePatrolFinding" },
{ "value": "patrol_critical", "go_symbol": "PushTypePatrolCritical" },
+ { "value": "external_probe_offline", "go_symbol": "PushTypeExternalProbeOffline" },
{ "value": "approval_request", "go_symbol": "PushTypeApprovalRequest" },
{ "value": "fix_completed", "go_symbol": "PushTypeFixCompleted" }
],
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 8170f8f489..33394ab3fb 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -54,6 +54,13 @@ rather than a zero value that reads as a real measurement: an absent
physical-disk view projects `Wearout` as `unifiedresources.WearoutUnreported`,
never `0`, which would announce a spent disk the agent never reported.
+An enabled availability target assigned to a host agent creates an
+agent-lifecycle lease for that exact target/agent pairing. First assignment
+and reassignment start a fresh reporting grace window; a result from the
+previous agent must not satisfy the new lease. Once the host heartbeat itself
+is unhealthy, the canonical host-offline lifecycle owns the outage so the
+availability-probe lifecycle cannot create a duplicate whole-agent incident.
+
## Canonical Files
1. `internal/api/agent_install_command_shared.go`
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index 84c9f5c5c3..33fe2d96ce 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -107,6 +107,14 @@ state out of an empty input: a cleared box is mid-edit, and coercing it to `0`
disabled the metric in the engine while the row still showed On. Disabling is
the toggle's job, and the toggle writes the canonical `-1`.
+External availability-probe reporting loss owns one canonical
+`external-probe-unavailable` alert per assigned agent, not one alert per target.
+The lifecycle waits for the assignment grace floor before firing, keeps target
+IDs as bounded supporting metadata, yields to the existing host-offline
+lifecycle when the agent heartbeat is unhealthy, and resolves only when a
+fresh result from the currently assigned agent arrives. Notification delivery,
+acknowledgement, history, and recovery reuse the normal alert pipeline.
+
## Canonical Files
1. `internal/alerts/specs/types.go`
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 3bce091317..325821c85c 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -38,6 +38,14 @@ and must not suppress the endpoint from type filters, totals, REST reloads, or
websocket snapshots. Plural machine projections use `availabilityChecks`; the
singular `availability` field remains only a compatibility projection.
+The API-owned Relay adapter may translate a canonical external-probe outage
+into the governed Pulse Mobile push contract only after alert identity is
+established. The push carries the stable alert ID and the generated
+`external_probe_offline` type with the existing `view_alert` action; it carries
+no infrastructure name, target, address, error text, or arbitrary alert
+metadata. A host-offline alert is eligible only when that host currently owns
+an enabled external-probe assignment.
+
## Canonical Files
1. `internal/api/contract_test.go`
diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.md
index 8702933e71..91041fe84d 100644
--- a/docs/release-control/v6/internal/subsystems/monitoring.md
+++ b/docs/release-control/v6/internal/subsystems/monitoring.md
@@ -323,6 +323,15 @@ the scanner reaches whichever address it reaches. A host that cannot be resolved
yields no entry and must say so in the log rather than passing silently, and it
must never prevent the remaining configured hosts from being suppressed.
+External availability-probe freshness is evaluated against the effective
+target cadence with a five-minute minimum grace. Missing, stale, or
+wrong-agent results are indeterminate monitoring evidence: their
+`network-endpoint` resources degrade to warning without manufacturing a target
+reachability incident. Monitoring aggregates stale targets by current agent,
+updates the single canonical probe alert lifecycle, and treats a fresh result
+from that same assignment as recovery. Assignment trackers are removed with
+their targets and reset when agent identity changes.
+
## Canonical Files
1. `internal/monitoring/monitor.go`
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index a4c475969a..afd7150223 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -24,6 +24,12 @@ admission coordinator; the broker must not add policy-history scans, resource
registry walks after admission, or network probes before the executor. Failed
admission records a stable refusal without invoking executor or network code.
+External-probe alert synchronization is linear in configured availability
+targets and assigned agents during the existing availability snapshot pass.
+It must aggregate to one alert and at most one mobile notification per agent
+outage, retain only bounded target identifiers needed for diagnosis, and never
+start a goroutine, timer, or notification lifecycle per target.
+
## Canonical Files
1. `pkg/metrics/store.go`
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 6503c5d24f..22ab36f9ff 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -1358,6 +1358,7 @@
"internal/api/host_agent_removal_lifecycle_integration_test.go",
"internal/config/host_continuity_test.go",
"internal/models/metrics_types_test.go",
+ "internal/monitoring/availability_probe_agent_test.go",
"internal/monitoring/monitor_host_agent_removal_lifecycle_test.go",
"internal/monitoring/monitor_host_agents_test.go",
"scripts/installtests/agent_state_dir_lifecycle_test.go",
@@ -2412,6 +2413,7 @@
"internal/alerts/callback_config_coverage_test.go",
"internal/alerts/canonical_override_migration_test.go",
"internal/alerts/config_validation_test.go",
+ "internal/alerts/external_probe_test.go",
"internal/alerts/filter_evaluation_test.go",
"internal/alerts/guest_snapshot_test.go",
"internal/alerts/history_concurrency_test.go",
@@ -2872,6 +2874,7 @@
"internal/api/audit_handlers_test.go",
"internal/api/contract_test.go",
"internal/api/docker_agents_report_size_test.go",
+ "internal/api/external_probe_notifications_test.go",
"internal/api/host_agent_removal_lifecycle_integration_test.go",
"internal/api/issue1640_readiness_gate_test.go",
"internal/api/issue1640_readiness_transport_test.go",
@@ -5635,6 +5638,7 @@
"internal/config/docker_metadata_test.go",
"internal/config/guest_metadata_test.go",
"internal/monitoring/availability_poller_test.go",
+ "internal/monitoring/availability_probe_agent_test.go",
"internal/monitoring/availability_udp_test.go",
"internal/monitoring/canonical_guardrails_test.go",
"internal/monitoring/ceph_test.go",
diff --git a/docs/release-control/v6/internal/subsystems/relay-runtime.md b/docs/release-control/v6/internal/subsystems/relay-runtime.md
index e617e5d9cb..67fa0f0c9f 100644
--- a/docs/release-control/v6/internal/subsystems/relay-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/relay-runtime.md
@@ -22,6 +22,14 @@ boundaries, the server-owned mobile relay capability boundary, and the
canonical reconnect, encryption, protocol, proxy, and relay-trust behavior
for Pulse instance bridging.
+The generated mobile push vocabulary includes
+`external_probe_offline` for a Pulse instance that is still connected while
+one of its assigned external probes stops reporting. Desktop Relay sends only
+generic copy, the canonical alert ID, and the existing `view_alert` action;
+resource names, addresses, targets, and probe errors remain inside Pulse.
+Relay's independent whole-instance disconnect notification remains the sole
+dark-site signal and must not be conflated with this per-agent alert.
+
## Canonical Files
1. `internal/relay/client.go`
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index a1737d4f70..ccf739dd4d 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -30,6 +30,14 @@ retained identity ledger and aliases. Those labels never become authentication
principals, API-token ownership, credential lookup, TLS identity, routing
authority, audit actor identity, or organization scope.
+External-probe mobile notifications are a metadata-minimization boundary.
+Only the generated event type, generic operator copy, canonical alert ID,
+severity/category, and `view_alert` action may leave the instance through
+Relay. Agent names, hostnames, target names, URLs, IP addresses, failure text,
+and target lists must remain local. Detection remains behind the existing
+Pulse Pro availability entitlement; the push adapter cannot turn Relay access
+into availability-probe entitlement.
+
## Canonical Files
1. `SECURITY.md`
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 1ace793dd9..813476d993 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -79,6 +79,13 @@ server applies. `-1` is unreported and renders as a muted placeholder, a `0`
from an endurance-reporting device is a spent disk and renders critical, and a
`0` from a rotational or untyped disk is absence rather than a fault.
+An external availability probe that stops reporting contributes only
+indeterminate reachability evidence. Even when its target is a NAS, PBS,
+datastore, or other storage resource, the resulting warning and canonical
+probe alert are not backup failure, protection drift, snapshot damage,
+recovery-point loss, or restore-readiness evidence. Storage/recovery consumers
+must wait for their domain-owned observations.
+
## Canonical Files
1. `internal/recovery/index.go`
diff --git a/frontend-modern/public/docs/CONFIGURATION.md b/frontend-modern/public/docs/CONFIGURATION.md
index 5ce1be2ad7..925d68d98d 100644
--- a/frontend-modern/public/docs/CONFIGURATION.md
+++ b/frontend-modern/public/docs/CONFIGURATION.md
@@ -509,7 +509,16 @@ its signed agent configuration, runs it on the configured interval, and
reports results back with its reports; results are only accepted from the
currently assigned agent. An assigned check is not also run locally. If no
report arrives for several intervals the check shows as indeterminate
-("no recent report from probe agent"), and if the entitlement lapses the
+("no recent report from probe agent"). After at least five minutes without a
+report, Pulse raises one warning per disconnected probe through the normal
+notification routes, even when that probe owns several checks. The incident is
+keyed to the probe agent rather than an arbitrary check, so changing assignments
+does not reopen it. If the agent heartbeat is also offline, the existing
+host-offline alert owns the incident instead of producing a duplicate probe
+warning. A paired Pulse Mobile client receives a privacy-safe
+`external_probe_offline` Relay push linked to that canonical alert. If the whole
+Pulse instance becomes unreachable, Relay's independent five-minute
+instance-offline push covers the dark-site case. If the entitlement lapses, the
check automatically resumes running from the Pulse server. Checks without an
assignment are unaffected and remain available in every edition.
diff --git a/internal/alerts/external_probe.go b/internal/alerts/external_probe.go
new file mode 100644
index 0000000000..55addf8aa9
--- /dev/null
+++ b/internal/alerts/external_probe.go
@@ -0,0 +1,223 @@
+package alerts
+
+import (
+ "fmt"
+ "sort"
+ "strings"
+
+ alertspecs "github.com/rcourtman/pulse-go-rewrite/internal/alerts/specs"
+ "github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources"
+ "github.com/rs/zerolog/log"
+)
+
+const (
+ ExternalProbeUnavailableAlertType = "external-probe-unavailable"
+ ExternalProbeUnavailableIncidentCode = "availability_probe_unavailable"
+ ExternalProbeIncidentSource = "external-probe"
+ externalProbeUnavailableStateKey = "external-probe-unavailable"
+ externalProbeUnavailableTrackingPrefix = "external-probe:"
+)
+
+type ExternalProbeState string
+
+const (
+ // ExternalProbeStateGrace means no result has arrived yet, but the
+ // assignment is still within its first-report window. Existing active
+ // alerts are intentionally preserved across restart grace.
+ ExternalProbeStateGrace ExternalProbeState = "grace"
+ // ExternalProbeStateHealthy means at least one enabled assignment has a
+ // fresh result, none are stale, and any active probe-specific alert can
+ // resolve while newly assigned checks remain in grace.
+ ExternalProbeStateHealthy ExternalProbeState = "healthy"
+ // ExternalProbeStateUnavailable means one or more assigned checks have
+ // stopped producing results after their grace window.
+ ExternalProbeStateUnavailable ExternalProbeState = "unavailable"
+ // ExternalProbeStateHostOffline means the agent heartbeat is offline. The
+ // canonical host-offline lifecycle owns that incident, so the
+ // probe-specific alert must not duplicate it.
+ ExternalProbeStateHostOffline ExternalProbeState = "host-offline"
+)
+
+// ExternalProbeSnapshot is the alert-owned view of one agent's availability
+// assignments. Target IDs are operational context for the self-hosted alert
+// only; mobile push payloads remain generic.
+type ExternalProbeSnapshot struct {
+ AgentID string
+ Name string
+ State ExternalProbeState
+ TargetIDs []string
+ StaleTargetIDs []string
+}
+
+// SyncExternalProbes reconciles the complete set of licensed, enabled probe
+// assignments. Alert identity is keyed only by agent ID, so adding, deleting,
+// or reordering targets cannot churn the incident.
+func (m *Manager) SyncExternalProbes(snapshots []ExternalProbeSnapshot) {
+ if m == nil {
+ return
+ }
+
+ seen := make(map[string]struct{}, len(snapshots))
+ for _, snapshot := range snapshots {
+ agentID := strings.TrimSpace(snapshot.AgentID)
+ if agentID == "" {
+ continue
+ }
+ snapshot.AgentID = agentID
+ seen[agentID] = struct{}{}
+ m.checkExternalProbe(snapshot)
+ }
+
+ retiredAgentIDs := make(map[string]struct{})
+ m.mu.RLock()
+ for _, alert := range m.activeAlerts {
+ if alert == nil || alert.Type != ExternalProbeUnavailableAlertType {
+ continue
+ }
+ agentID := alertMetadataString(alert, "hostId")
+ if _, ok := seen[agentID]; !ok {
+ retiredAgentIDs[agentID] = struct{}{}
+ }
+ }
+ m.mu.RUnlock()
+ for agentID := range retiredAgentIDs {
+ m.clearExternalProbeAlert(agentID)
+ }
+}
+
+func (m *Manager) checkExternalProbe(snapshot ExternalProbeSnapshot) {
+ m.mu.RLock()
+ enabled := m.config.Enabled
+ disabled := m.config.DisableAllAgentsOffline
+ thresholds := m.resolveHostThresholdsNoLock(snapshot.AgentID, "", "", "")
+ m.mu.RUnlock()
+ if !enabled || disabled || thresholds.Disabled || thresholds.DisableConnectivity {
+ m.clearExternalProbeAlert(snapshot.AgentID)
+ return
+ }
+
+ switch snapshot.State {
+ case ExternalProbeStateHealthy, ExternalProbeStateHostOffline:
+ m.clearExternalProbeAlert(snapshot.AgentID)
+ return
+ case ExternalProbeStateGrace:
+ return
+ case ExternalProbeStateUnavailable:
+ // Continue below.
+ default:
+ return
+ }
+
+ resourceID := hostResourceID(snapshot.AgentID)
+ alertID := canonicalDiscreteStateStateID(resourceID, externalProbeUnavailableStateKey)
+ trackingKey := externalProbeUnavailableTrackingPrefix + snapshot.AgentID
+
+ targetIDs := normalizedExternalProbeTargetIDs(snapshot.TargetIDs)
+ staleTargetIDs := normalizedExternalProbeTargetIDs(snapshot.StaleTargetIDs)
+ name := strings.TrimSpace(snapshot.Name)
+ if name == "" {
+ name = snapshot.AgentID
+ }
+
+ spec, err := buildCanonicalDiscreteStateSpec(
+ resourceID,
+ name,
+ unifiedresources.ResourceTypeAgent,
+ AlertLevelWarning,
+ 1,
+ false,
+ externalProbeUnavailableStateKey,
+ []string{string(ExternalProbeStateUnavailable)},
+ )
+ if err != nil {
+ log.Warn().
+ Err(err).
+ Str("hostID", snapshot.AgentID).
+ Msg("Skipping invalid external probe availability spec")
+ return
+ }
+
+ message := fmt.Sprintf("External probe '%s' stopped reporting availability results", name)
+ if len(staleTargetIDs) > 0 && len(staleTargetIDs) < len(targetIDs) {
+ message = fmt.Sprintf(
+ "External probe '%s' stopped reporting results for %d of %d assigned checks",
+ name,
+ len(staleTargetIDs),
+ len(targetIDs),
+ )
+ }
+
+ _, _ = m.evaluateCanonicalLifecycleAlert(canonicalLifecycleAlertParams{
+ Spec: spec,
+ Evidence: alertspecs.AlertEvidence{
+ ObservedAt: m.now(),
+ DiscreteState: &alertspecs.DiscreteStateEvidence{
+ StateKey: externalProbeUnavailableStateKey,
+ Observed: string(ExternalProbeStateUnavailable),
+ },
+ },
+ Tracking: m.offlineConfirmations,
+ TrackingKey: trackingKey,
+ AlertID: alertID,
+ AlertType: ExternalProbeUnavailableAlertType,
+ ResourceID: resourceID,
+ ResourceName: name,
+ Instance: name,
+ Message: message,
+ Metadata: map[string]interface{}{
+ "resourceType": string(unifiedresources.ResourceTypeAgent),
+ "hostId": snapshot.AgentID,
+ "incidentCode": ExternalProbeUnavailableIncidentCode,
+ "incidentSource": ExternalProbeIncidentSource,
+ "incidentCategory": string(unifiedresources.IncidentCategoryAvailability),
+ "incidentNativeID": snapshot.AgentID,
+ "assignedTargetIds": targetIDs,
+ "staleTargetIds": staleTargetIDs,
+ "assignedTargets": len(targetIDs),
+ "staleTargets": len(staleTargetIDs),
+ },
+ AddToRecent: true,
+ AddToHistory: true,
+ RateLimit: true,
+ DispatchAsync: false,
+ })
+}
+
+func (m *Manager) clearExternalProbeAlert(agentID string) {
+ agentID = strings.TrimSpace(agentID)
+ if agentID == "" {
+ return
+ }
+ resourceID := hostResourceID(agentID)
+ alertID := canonicalDiscreteStateStateID(resourceID, externalProbeUnavailableStateKey)
+ trackingKey := externalProbeUnavailableTrackingPrefix + agentID
+
+ m.mu.Lock()
+ delete(m.offlineConfirmations, trackingKey)
+ exists := m.hasActiveAlertNoLock(alertID)
+ m.mu.Unlock()
+ if exists {
+ m.clearAlert(alertID)
+ }
+}
+
+func normalizedExternalProbeTargetIDs(values []string) []string {
+ if len(values) == 0 {
+ return nil
+ }
+ seen := make(map[string]struct{}, len(values))
+ out := make([]string, 0, len(values))
+ for _, value := range values {
+ value = strings.TrimSpace(value)
+ if value == "" {
+ continue
+ }
+ if _, ok := seen[value]; ok {
+ continue
+ }
+ seen[value] = struct{}{}
+ out = append(out, value)
+ }
+ sort.Strings(out)
+ return out
+}
diff --git a/internal/alerts/external_probe_test.go b/internal/alerts/external_probe_test.go
new file mode 100644
index 0000000000..42900b31f3
--- /dev/null
+++ b/internal/alerts/external_probe_test.go
@@ -0,0 +1,123 @@
+package alerts
+
+import "testing"
+
+func externalProbeSnapshot(agentID string, state ExternalProbeState, targets ...string) ExternalProbeSnapshot {
+ return ExternalProbeSnapshot{
+ AgentID: agentID,
+ Name: "Probe " + agentID,
+ State: state,
+ TargetIDs: targets,
+ StaleTargetIDs: targets,
+ }
+}
+
+func activeExternalProbeAlerts(manager *Manager) []Alert {
+ var out []Alert
+ for _, alert := range manager.GetActiveAlerts() {
+ if alert.Type == ExternalProbeUnavailableAlertType {
+ out = append(out, alert)
+ }
+ }
+ return out
+}
+
+func TestSyncExternalProbesUsesStablePerAgentIdentity(t *testing.T) {
+ manager := newTestManager(t)
+ manager.SyncExternalProbes([]ExternalProbeSnapshot{
+ externalProbeSnapshot("agent-1", ExternalProbeStateUnavailable, "target-b", "target-a"),
+ externalProbeSnapshot("agent-2", ExternalProbeStateUnavailable, "target-c"),
+ })
+
+ active := activeExternalProbeAlerts(manager)
+ if len(active) != 2 {
+ t.Fatalf("active alerts = %+v, want one per unavailable probe", active)
+ }
+ var agentOne Alert
+ for _, alert := range active {
+ if alert.Metadata["hostId"] == "agent-1" {
+ agentOne = alert
+ break
+ }
+ }
+ if agentOne.ID == "" {
+ t.Fatalf("agent-1 alert missing from %+v", active)
+ }
+ if agentOne.ResourceID != "agent:agent-1" ||
+ agentOne.Metadata["incidentCode"] != ExternalProbeUnavailableIncidentCode ||
+ agentOne.Metadata["incidentSource"] != ExternalProbeIncidentSource {
+ t.Fatalf("agent-1 alert = %+v, want stable external-probe metadata", agentOne)
+ }
+ firstID := agentOne.ID
+
+ // Deleting the target that happened to sort first must update the same
+ // per-agent alert instead of resolving and reopening a new incident.
+ manager.SyncExternalProbes([]ExternalProbeSnapshot{
+ externalProbeSnapshot("agent-1", ExternalProbeStateUnavailable, "target-z"),
+ externalProbeSnapshot("agent-2", ExternalProbeStateUnavailable, "target-c"),
+ })
+ active = activeExternalProbeAlerts(manager)
+ if len(active) != 2 {
+ t.Fatalf("active alerts after target replacement = %+v, want two", active)
+ }
+ for _, alert := range active {
+ if alert.Metadata["hostId"] == "agent-1" && alert.ID != firstID {
+ t.Fatalf("agent-1 alert ID changed from %q to %q", firstID, alert.ID)
+ }
+ }
+}
+
+func TestSyncExternalProbesAvoidsHostOfflineDuplicationAndRecovers(t *testing.T) {
+ manager := newTestManager(t)
+ unavailable := externalProbeSnapshot(
+ "agent-1",
+ ExternalProbeStateUnavailable,
+ "target-a",
+ )
+ manager.SyncExternalProbes([]ExternalProbeSnapshot{unavailable})
+ if got := activeExternalProbeAlerts(manager); len(got) != 1 {
+ t.Fatalf("active alerts = %+v, want one unavailable alert", got)
+ }
+
+ hostOffline := unavailable
+ hostOffline.State = ExternalProbeStateHostOffline
+ manager.SyncExternalProbes([]ExternalProbeSnapshot{hostOffline})
+ if got := activeExternalProbeAlerts(manager); len(got) != 0 {
+ t.Fatalf("probe alerts while host-offline owns lifecycle = %+v, want none", got)
+ }
+
+ manager.SyncExternalProbes([]ExternalProbeSnapshot{unavailable})
+ if got := activeExternalProbeAlerts(manager); len(got) != 1 {
+ t.Fatalf("active alerts after recurrence = %+v, want one", got)
+ }
+ healthy := unavailable
+ healthy.State = ExternalProbeStateHealthy
+ healthy.StaleTargetIDs = nil
+ manager.SyncExternalProbes([]ExternalProbeSnapshot{healthy})
+ if got := activeExternalProbeAlerts(manager); len(got) != 0 {
+ t.Fatalf("active alerts after fresh results = %+v, want none", got)
+ }
+}
+
+func TestSyncExternalProbesGracePreservesActiveAlertAndRemovalClearsIt(t *testing.T) {
+ manager := newTestManager(t)
+ unavailable := externalProbeSnapshot(
+ "agent-1",
+ ExternalProbeStateUnavailable,
+ "target-a",
+ )
+ manager.SyncExternalProbes([]ExternalProbeSnapshot{unavailable})
+
+ grace := unavailable
+ grace.State = ExternalProbeStateGrace
+ grace.StaleTargetIDs = nil
+ manager.SyncExternalProbes([]ExternalProbeSnapshot{grace})
+ if got := activeExternalProbeAlerts(manager); len(got) != 1 {
+ t.Fatalf("restart grace cleared an existing outage: %+v", got)
+ }
+
+ manager.SyncExternalProbes(nil)
+ if got := activeExternalProbeAlerts(manager); len(got) != 0 {
+ t.Fatalf("unassigned probe alerts = %+v, want none", got)
+ }
+}
diff --git a/internal/alerts/host.go b/internal/alerts/host.go
index 0541b6abcb..bb4825f22a 100644
--- a/internal/alerts/host.go
+++ b/internal/alerts/host.go
@@ -12,6 +12,8 @@ import (
"github.com/rs/zerolog/log"
)
+const HostOfflineAlertType = "host-offline"
+
func hostResourceID(hostID string) string {
trimmed := strings.TrimSpace(hostID)
if trimmed == "" {
@@ -763,7 +765,7 @@ func (m *Manager) HandleHostOffline(host models.Host) {
Tracking: m.offlineConfirmations,
TrackingKey: resourceKey,
AlertID: alertID,
- AlertType: "host-offline",
+ AlertType: HostOfflineAlertType,
ResourceID: resourceKey,
ResourceName: resourceName,
Node: nodeName,
diff --git a/internal/api/external_probe_notifications.go b/internal/api/external_probe_notifications.go
new file mode 100644
index 0000000000..cbb0e1e6f9
--- /dev/null
+++ b/internal/api/external_probe_notifications.go
@@ -0,0 +1,34 @@
+package api
+
+import (
+ "strings"
+
+ "github.com/rcourtman/pulse-go-rewrite/internal/alerts"
+ "github.com/rcourtman/pulse-go-rewrite/internal/relay"
+)
+
+// externalProbePushNotification keeps mobile payloads deliberately generic:
+// alert metadata selects the event, while infrastructure names and addresses
+// remain inside the self-hosted Pulse instance.
+func externalProbePushNotification(
+ alert *alerts.Alert,
+ hasProbeAssignments func(string) bool,
+) (relay.PushNotificationPayload, bool) {
+ if alert == nil || alert.Metadata == nil {
+ return relay.PushNotificationPayload{}, false
+ }
+ code, _ := alert.Metadata["incidentCode"].(string)
+ source, _ := alert.Metadata["incidentSource"].(string)
+ probeSpecific := strings.TrimSpace(code) == alerts.ExternalProbeUnavailableIncidentCode &&
+ strings.TrimSpace(source) == alerts.ExternalProbeIncidentSource
+
+ hostOffline := false
+ if alert.Type == alerts.HostOfflineAlertType && hasProbeAssignments != nil {
+ hostID, _ := alert.Metadata["hostId"].(string)
+ hostOffline = hasProbeAssignments(strings.TrimSpace(hostID))
+ }
+ if !probeSpecific && !hostOffline {
+ return relay.PushNotificationPayload{}, false
+ }
+ return relay.NewExternalProbeUnavailableNotification(alert.ID), true
+}
diff --git a/internal/api/external_probe_notifications_test.go b/internal/api/external_probe_notifications_test.go
new file mode 100644
index 0000000000..3a8fa85f86
--- /dev/null
+++ b/internal/api/external_probe_notifications_test.go
@@ -0,0 +1,66 @@
+package api
+
+import (
+ "testing"
+
+ "github.com/rcourtman/pulse-go-rewrite/internal/alerts"
+ "github.com/rcourtman/pulse-go-rewrite/internal/relay"
+)
+
+func TestExternalProbePushNotificationSelectsOnlyProbeLoss(t *testing.T) {
+ alert := &alerts.Alert{
+ ID: "alert-1",
+ Metadata: map[string]interface{}{
+ "incidentCode": alerts.ExternalProbeUnavailableIncidentCode,
+ "incidentSource": alerts.ExternalProbeIncidentSource,
+ },
+ }
+ notification, ok := externalProbePushNotification(alert, nil)
+ if !ok {
+ t.Fatal("external probe loss did not produce a push notification")
+ }
+ if notification.Type != relay.PushTypeExternalProbeOffline ||
+ notification.ActionType != relay.PushActionViewAlert ||
+ notification.ActionID != alert.ID {
+ t.Fatalf("notification = %#v, want dedicated type routed to canonical mobile attention", notification)
+ }
+
+ for _, other := range []*alerts.Alert{
+ nil,
+ {ID: "missing-metadata"},
+ {ID: "local-availability", Metadata: map[string]interface{}{
+ "incidentCode": "availability_unreachable",
+ "incidentSource": "availability",
+ }},
+ {ID: "external-target-failure", Metadata: map[string]interface{}{
+ "incidentCode": "availability_unreachable",
+ "incidentSource": alerts.ExternalProbeIncidentSource,
+ }},
+ } {
+ if got, ok := externalProbePushNotification(other, nil); ok {
+ t.Fatalf("unrelated alert %#v produced push %#v", other, got)
+ }
+ }
+}
+
+func TestExternalProbePushNotificationSelectsAssignedHostOffline(t *testing.T) {
+ alert := &alerts.Alert{
+ ID: "host-offline-agent-1",
+ Type: alerts.HostOfflineAlertType,
+ Metadata: map[string]interface{}{
+ "hostId": "agent-1",
+ },
+ }
+ ownsAssignments := func(agentID string) bool { return agentID == "agent-1" }
+ notification, ok := externalProbePushNotification(alert, ownsAssignments)
+ if !ok {
+ t.Fatal("assigned probe host-offline alert did not produce a push")
+ }
+ if notification.ActionID != alert.ID || notification.Type != relay.PushTypeExternalProbeOffline {
+ t.Fatalf("notification = %#v, want external probe mobile routing", notification)
+ }
+
+ if got, ok := externalProbePushNotification(alert, func(string) bool { return false }); ok {
+ t.Fatalf("ordinary host-offline alert produced external probe push %#v", got)
+ }
+}
diff --git a/internal/api/relay_mobile_capability_generated.go b/internal/api/relay_mobile_capability_generated.go
index dc88720139..1955157759 100644
--- a/internal/api/relay_mobile_capability_generated.go
+++ b/internal/api/relay_mobile_capability_generated.go
@@ -1,5 +1,5 @@
// Code generated by scripts/release_control/generate_mobile_compatibility.py. DO NOT EDIT.
-// Source SHA256: 85bf17ae6e6fa50233dadc7447624e1aded31b31a28339d9db1d4a0401ece107
+// Source SHA256: a01ae5ea3367976f07ee8110dffb99d6c878fff8377c38b3614c5c4f6536ca1c
package api
diff --git a/internal/api/relay_mobile_capability_test.go b/internal/api/relay_mobile_capability_test.go
index e3d5d6670a..80cf80be6d 100644
--- a/internal/api/relay_mobile_capability_test.go
+++ b/internal/api/relay_mobile_capability_test.go
@@ -16,14 +16,23 @@ func TestRelayMobileRuntimeProjectionMatchesManifestDigest(t *testing.T) {
if err != nil {
t.Fatalf("read mobile compatibility manifest: %v", err)
}
- generated, err := os.ReadFile("relay_mobile_capability_generated.go")
+ apiGenerated, err := os.ReadFile("relay_mobile_capability_generated.go")
if err != nil {
t.Fatalf("read generated mobile route projection: %v", err)
}
+ relayGenerated, err := os.ReadFile("../relay/mobile_compatibility_generated.go")
+ if err != nil {
+ t.Fatalf("read generated mobile push projection: %v", err)
+ }
digest := fmt.Sprintf("%x", sha256.Sum256(manifest))
- if !strings.Contains(string(generated), "Source SHA256: "+digest) {
- t.Fatalf("generated mobile route projection does not match manifest digest %s", digest)
+ for name, generated := range map[string][]byte{
+ "mobile route": apiGenerated,
+ "mobile push": relayGenerated,
+ } {
+ if !strings.Contains(string(generated), "Source SHA256: "+digest) {
+ t.Fatalf("generated %s projection does not match manifest digest %s", name, digest)
+ }
}
}
diff --git a/internal/api/router.go b/internal/api/router.go
index c0c3782720..a3275e0c95 100644
--- a/internal/api/router.go
+++ b/internal/api/router.go
@@ -961,6 +961,33 @@ func (r *Router) setupRoutes() {
}
return monitorLicSvc.HasFeature(feature)
})
+ // A probe that stops reporting is a first-class availability incident.
+ // Normal notification routes are handled by the monitor; Relay adds a
+ // privacy-safe mobile push while the Pulse instance is still online.
+ // If the whole instance is offline, Relay's independent disconnect
+ // timer supplies the complementary dark-site notification.
+ r.monitor.SetAlertPushCallback(func(alert *alerts.Alert) {
+ notification, ok := externalProbePushNotification(
+ alert,
+ r.monitor.HasExternalProbeAssignments,
+ )
+ if !ok {
+ return
+ }
+ r.relayMu.RLock()
+ client := r.relayClient
+ r.relayMu.RUnlock()
+ if client == nil {
+ return
+ }
+ if err := client.SendPushNotification(notification); err != nil {
+ log.Warn().
+ Err(err).
+ Str("alertID", notification.ActionID).
+ Str("type", notification.Type).
+ Msg("External probe push notification send failed")
+ }
+ })
}
// Initialize recovery token store and capture the exact worker this router owns.
diff --git a/internal/monitoring/availability_poller.go b/internal/monitoring/availability_poller.go
index 0953bbc992..d248ed9e7b 100644
--- a/internal/monitoring/availability_poller.go
+++ b/internal/monitoring/availability_poller.go
@@ -157,6 +157,8 @@ func (availabilityPollProvider) SupplementalRecords(m *Monitor, orgID string) []
targets := m.availabilityTargets()
now := time.Now().UTC()
statuses := m.availabilityStatusSnapshotForTargets(targets, now)
+ m.syncAvailabilityProbeAlerts(targets, statuses, now)
+
records := make([]unifiedresources.IngestRecord, 0, len(targets))
for _, target := range targets {
status := statuses[target.ID]
@@ -237,7 +239,10 @@ func (m *Monitor) availabilityStatusSnapshotForTargets(targets []config.Availabi
for _, target := range targets {
status, ok := out[target.ID]
if !ok {
- continue
+ if m.effectiveProbeAgentID(target) == "" {
+ continue
+ }
+ status = availabilityStatusFromTarget(target)
}
out[target.ID] = m.deriveAvailabilityProbeStaleness(target, status, now)
}
@@ -250,9 +255,14 @@ func (m *Monitor) RefreshAvailabilityTargets() {
}
targets := m.availabilityTargets()
activeIDs := make(map[string]struct{}, len(targets))
+ activeProbeIDs := make(map[string]struct{}, len(targets))
now := time.Now()
for _, target := range targets {
activeIDs[target.ID] = struct{}{}
+ if agentID := m.effectiveProbeAgentID(target); agentID != "" {
+ activeProbeIDs[target.ID] = struct{}{}
+ m.availabilityProbeAssignmentReference(target.ID, agentID, now)
+ }
if m.taskQueue == nil {
continue
}
@@ -278,6 +288,11 @@ func (m *Monitor) RefreshAvailabilityTargets() {
removedIDs = append(removedIDs, id)
}
}
+ for id := range m.availabilityProbeTrackers {
+ if _, ok := activeProbeIDs[id]; !ok {
+ delete(m.availabilityProbeTrackers, id)
+ }
+ }
m.mu.Unlock()
for _, id := range removedIDs {
m.removeProviderConnectionHealth(InstanceTypeAvailability, id)
@@ -532,6 +547,9 @@ func availabilityResourceStatus(target config.AvailabilityTarget, status Availab
if !target.Enabled {
return unifiedresources.StatusUnknown
}
+ if availabilityProbeStatusIsStale(status) {
+ return unifiedresources.StatusWarning
+ }
if status.LastChecked.IsZero() {
return unifiedresources.StatusUnknown
}
@@ -545,7 +563,13 @@ func availabilityResourceStatus(target config.AvailabilityTarget, status Availab
}
func availabilityIncident(target config.AvailabilityTarget, status AvailabilityProbeStatus, startedAt time.Time) *unifiedresources.ResourceIncident {
- if !target.Enabled || status.Available || status.LastChecked.IsZero() {
+ if !target.Enabled || status.Available {
+ return nil
+ }
+ if availabilityProbeStatusIsStale(status) {
+ return nil
+ }
+ if status.LastChecked.IsZero() {
return nil
}
if status.ConsecutiveFailures < target.EffectiveFailureThreshold() {
@@ -555,12 +579,16 @@ func availabilityIncident(target config.AvailabilityTarget, status AvailabilityP
if status.LastError != "" {
summary = summary + ": " + status.LastError
}
+ source := string(unifiedresources.SourceAvailability)
+ if strings.TrimSpace(status.ProbeAgentID) != "" {
+ source = "external-probe"
+ }
return &unifiedresources.ResourceIncident{
Provider: string(unifiedresources.SourceAvailability),
NativeID: target.ID,
Code: "availability_unreachable",
Severity: storagehealth.RiskCritical,
- Source: string(unifiedresources.SourceAvailability),
+ Source: source,
Summary: summary,
StartedAt: startedAt,
}
diff --git a/internal/monitoring/availability_probe_agent.go b/internal/monitoring/availability_probe_agent.go
index 2c65d6a39f..b8b2a977ce 100644
--- a/internal/monitoring/availability_probe_agent.go
+++ b/internal/monitoring/availability_probe_agent.go
@@ -30,6 +30,14 @@ type ProbeAvailabilityResult struct {
Error string
}
+// availabilityProbeAssignmentTracker provides a grace reference for a newly
+// assigned target before its first report. AgentID is retained so reassigning
+// the same target to a different probe starts a fresh grace window.
+type availabilityProbeAssignmentTracker struct {
+ AgentID string
+ Since time.Time
+}
+
// probeAvailabilityResultsFromReport converts the wire results carried by a
// host agent report. Outcome vocabulary is normalized here so the ingestion
// path never has to trust an agent's spelling; probeResultOutcome then decides
@@ -159,10 +167,20 @@ func (m *Monitor) deriveAvailabilityProbeStaleness(
status AvailabilityProbeStatus,
now time.Time,
) AvailabilityProbeStatus {
- if m.effectiveProbeAgentID(target) == "" {
+ agentID := m.effectiveProbeAgentID(target)
+ if agentID == "" {
return status
}
- if !availabilityProbeReportIsStale(target, status.LastChecked, now) {
+ reportingAgentID := strings.TrimSpace(status.ProbeAgentID)
+ if reportingAgentID != agentID {
+ status = availabilityStatusFromTarget(target)
+ }
+ status.ProbeAgentID = agentID
+ reference := status.LastChecked
+ if reference.IsZero() {
+ reference = m.availabilityProbeAssignmentReference(target.ID, agentID, now)
+ }
+ if !availabilityProbeReportIsStale(target, reference, now) {
return status
}
status.Outcome = string(AvailabilityProbeIndeterminate)
@@ -172,6 +190,36 @@ func (m *Monitor) deriveAvailabilityProbeStaleness(
return status
}
+func (m *Monitor) availabilityProbeAssignmentReference(targetID, agentID string, now time.Time) time.Time {
+ if m == nil {
+ return now
+ }
+ targetID = strings.TrimSpace(targetID)
+ agentID = strings.TrimSpace(agentID)
+ if targetID == "" || agentID == "" {
+ return now
+ }
+
+ m.mu.Lock()
+ defer m.mu.Unlock()
+ if m.availabilityProbeTrackers == nil {
+ m.availabilityProbeTrackers = make(map[string]availabilityProbeAssignmentTracker)
+ }
+ if tracker, ok := m.availabilityProbeTrackers[targetID]; ok && tracker.AgentID == agentID && !tracker.Since.IsZero() {
+ return tracker.Since
+ }
+ m.availabilityProbeTrackers[targetID] = availabilityProbeAssignmentTracker{
+ AgentID: agentID,
+ Since: now,
+ }
+ return now
+}
+
+func availabilityProbeStatusIsStale(status AvailabilityProbeStatus) bool {
+ return status.Outcome == string(AvailabilityProbeIndeterminate) &&
+ strings.EqualFold(strings.TrimSpace(status.LastError), availabilityProbeStaleError)
+}
+
func availabilityProbeReportIsStale(target config.AvailabilityTarget, lastChecked time.Time, now time.Time) bool {
if lastChecked.IsZero() {
return true
diff --git a/internal/monitoring/availability_probe_agent_test.go b/internal/monitoring/availability_probe_agent_test.go
index 6ce9ef9cd8..1d94e2b804 100644
--- a/internal/monitoring/availability_probe_agent_test.go
+++ b/internal/monitoring/availability_probe_agent_test.go
@@ -7,6 +7,7 @@ import (
"github.com/rcourtman/pulse-go-rewrite/internal/alerts"
"github.com/rcourtman/pulse-go-rewrite/internal/config"
"github.com/rcourtman/pulse-go-rewrite/internal/models"
+ "github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources"
agentshost "github.com/rcourtman/pulse-go-rewrite/pkg/agents/host"
pkglicensing "github.com/rcourtman/pulse-go-rewrite/pkg/licensing"
)
@@ -222,8 +223,16 @@ func TestApplyProbeAvailabilityResultsRejectsForeignAgents(t *testing.T) {
{TargetID: "local", Outcome: AvailabilityProbeReachable, LatencyMillis: 5, CheckedAt: checkedAt},
{TargetID: "missing", Outcome: AvailabilityProbeReachable, LatencyMillis: 5, CheckedAt: checkedAt},
})
- if statuses := monitor.AvailabilityStatusSnapshot(); len(statuses) != 0 {
- t.Fatalf("statuses = %+v, want no state from an agent that owns nothing", statuses)
+ statuses := monitor.AvailabilityStatusSnapshot()
+ remote, ok := statuses["remote"]
+ if !ok {
+ t.Fatal("assigned remote target missing from first-report grace state")
+ }
+ if !remote.LastChecked.IsZero() || remote.Outcome != "" || remote.Available {
+ t.Fatalf("remote status = %+v, want no observation from an agent that owns nothing", remote)
+ }
+ if _, ok := statuses["local"]; ok {
+ t.Fatalf("local status = %+v, want no state from an agent that owns nothing", statuses["local"])
}
// The owning agent may not claim a locally executed target either.
@@ -398,6 +407,12 @@ func TestAvailabilitySupplementalRecordsPresentStaleProbeAsIndeterminate(t *test
if data.ProbeAgentID != "agent-1" {
t.Fatalf("availability probe agent = %q, want agent-1 so the UI can attribute the source", data.ProbeAgentID)
}
+ if len(records[0].Resource.Incidents) != 0 {
+ t.Fatalf("stale target incidents = %+v, probe lifecycle must not be tied to an arbitrary target", records[0].Resource.Incidents)
+ }
+ if records[0].Resource.Status != unifiedresources.StatusWarning {
+ t.Fatalf("stale resource status = %q, want warning", records[0].Resource.Status)
+ }
statuses := availabilityPollProvider{}.ConnectionStatuses(monitor)
if statuses["availability-remote"] {
@@ -405,6 +420,165 @@ func TestAvailabilitySupplementalRecordsPresentStaleProbeAsIndeterminate(t *test
}
}
+func TestAvailabilityProbeFirstReportGraceThenStale(t *testing.T) {
+ target := config.NormalizeAvailabilityTarget(probeAgentTarget("remote", "agent-1"))
+ monitor := newProbeAgentTestMonitor(t, target)
+ monitor.SetLicenseChecker(licenseWithExternalProbe(true))
+
+ assignedAt := time.Now().UTC()
+ fresh := monitor.availabilityStatusSnapshotForTargets(
+ []config.AvailabilityTarget{target},
+ assignedAt,
+ )
+ if availabilityProbeStatusIsStale(fresh["remote"]) {
+ t.Fatalf("new assignment status = %+v, must receive the first-report grace window", fresh["remote"])
+ }
+
+ stale := monitor.availabilityStatusSnapshotForTargets(
+ []config.AvailabilityTarget{target},
+ assignedAt.Add(availabilityProbeStaleFloor+time.Second),
+ )
+ if !availabilityProbeStatusIsStale(stale["remote"]) {
+ t.Fatalf("post-grace assignment status = %+v, want stale without a first report", stale["remote"])
+ }
+ if stale["remote"].ProbeAgentID != "agent-1" {
+ t.Fatalf("post-grace probe agent = %q, want agent-1", stale["remote"].ProbeAgentID)
+ }
+}
+
+func TestAvailabilityProbeReassignmentReceivesFreshGrace(t *testing.T) {
+ target := config.NormalizeAvailabilityTarget(probeAgentTarget("remote", "agent-2"))
+ monitor := newProbeAgentTestMonitor(t, target)
+ monitor.SetLicenseChecker(licenseWithExternalProbe(true))
+ old := time.Now().UTC().Add(-time.Hour)
+ monitor.availabilityStatuses["remote"] = AvailabilityProbeStatus{
+ TargetID: "remote",
+ ProbeAgentID: "agent-1",
+ LastChecked: old,
+ Outcome: string(AvailabilityProbeReachable),
+ Available: true,
+ }
+
+ reassignedAt := time.Now().UTC()
+ statuses := monitor.availabilityStatusSnapshotForTargets(
+ []config.AvailabilityTarget{target},
+ reassignedAt,
+ )
+ status := statuses["remote"]
+ if availabilityProbeStatusIsStale(status) {
+ t.Fatalf("reassigned status = %+v, must receive a fresh first-report grace window", status)
+ }
+ if status.ProbeAgentID != "agent-2" {
+ t.Fatalf("reassigned probe agent = %q, want agent-2", status.ProbeAgentID)
+ }
+ if !status.LastChecked.IsZero() || status.Outcome != "" || status.Available {
+ t.Fatalf("reassigned status = %+v, must not present the old probe's observation as current", status)
+ }
+}
+
+func TestAvailabilityProbeStaleIncidentDeduplicatesPerAgent(t *testing.T) {
+ monitor := newProbeAgentTestMonitor(t,
+ probeAgentTarget("remote-a", "agent-1"),
+ probeAgentTarget("remote-b", "agent-1"),
+ probeAgentTarget("remote-c", "agent-2"),
+ )
+ monitor.SetLicenseChecker(licenseWithExternalProbe(true))
+ alertManager := alerts.NewManagerWithDataDir(t.TempDir())
+ t.Cleanup(alertManager.Stop)
+ monitor.alertManager = alertManager
+ old := time.Now().UTC().Add(-time.Hour)
+ monitor.ApplyProbeAvailabilityResults("agent-1", []ProbeAvailabilityResult{
+ {TargetID: "remote-a", Outcome: AvailabilityProbeReachable, CheckedAt: old},
+ {TargetID: "remote-b", Outcome: AvailabilityProbeReachable, CheckedAt: old},
+ })
+ monitor.ApplyProbeAvailabilityResults("agent-2", []ProbeAvailabilityResult{
+ {TargetID: "remote-c", Outcome: AvailabilityProbeReachable, CheckedAt: old},
+ })
+
+ _ = (availabilityPollProvider{}).SupplementalRecords(monitor, "")
+ alertsByAgent := make(map[string]int)
+ for _, alert := range alertManager.GetActiveAlerts() {
+ if alert.Type != alerts.ExternalProbeUnavailableAlertType {
+ continue
+ }
+ agentID, _ := alert.Metadata["hostId"].(string)
+ alertsByAgent[agentID]++
+ }
+ if alertsByAgent["agent-1"] != 1 || alertsByAgent["agent-2"] != 1 {
+ t.Fatalf("stale alerts by agent = %+v, want exactly one per disconnected probe", alertsByAgent)
+ }
+}
+
+func TestAvailabilityProbeFreshReportResolvesStaleIncident(t *testing.T) {
+ monitor := newProbeAgentTestMonitor(t, probeAgentTarget("remote", "agent-1"))
+ monitor.SetLicenseChecker(licenseWithExternalProbe(true))
+ alertManager := alerts.NewManagerWithDataDir(t.TempDir())
+ t.Cleanup(alertManager.Stop)
+ monitor.alertManager = alertManager
+ monitor.ApplyProbeAvailabilityResults("agent-1", []ProbeAvailabilityResult{
+ {TargetID: "remote", Outcome: AvailabilityProbeReachable, CheckedAt: time.Now().UTC().Add(-time.Hour)},
+ })
+ _ = (availabilityPollProvider{}).SupplementalRecords(monitor, "")
+ if got := alertManager.GetActiveAlerts(); len(got) != 1 || got[0].Type != alerts.ExternalProbeUnavailableAlertType {
+ t.Fatalf("stale alerts = %+v, want one before recovery", got)
+ }
+
+ monitor.ApplyProbeAvailabilityResults("agent-1", []ProbeAvailabilityResult{
+ {TargetID: "remote", Outcome: AvailabilityProbeReachable, CheckedAt: time.Now().UTC()},
+ })
+ recovered := (availabilityPollProvider{}).SupplementalRecords(monitor, "")[0].Resource
+ if got := alertManager.GetActiveAlerts(); len(got) != 0 {
+ t.Fatalf("active alerts after recovery = %+v, want none", got)
+ }
+ if recovered.Status != "online" {
+ t.Fatalf("recovered resource = %+v, want online", recovered)
+ }
+}
+
+func TestAvailabilityProbeHostOfflineOwnsConnectivityLifecycle(t *testing.T) {
+ monitor := newProbeAgentTestMonitor(t, probeAgentTarget("remote", "agent-1"))
+ monitor.SetLicenseChecker(licenseWithExternalProbe(true))
+ alertManager := alerts.NewManagerWithDataDir(t.TempDir())
+ t.Cleanup(alertManager.Stop)
+ monitor.alertManager = alertManager
+ monitor.state.UpsertHost(models.Host{
+ ID: "agent-1",
+ Hostname: "probe.local",
+ LastSeen: time.Now().UTC().Add(-time.Hour),
+ IntervalSeconds: 30,
+ })
+ monitor.ApplyProbeAvailabilityResults("agent-1", []ProbeAvailabilityResult{
+ {TargetID: "remote", Outcome: AvailabilityProbeReachable, CheckedAt: time.Now().UTC().Add(-time.Hour)},
+ })
+
+ _ = (availabilityPollProvider{}).SupplementalRecords(monitor, "")
+ for _, alert := range alertManager.GetActiveAlerts() {
+ if alert.Type == alerts.ExternalProbeUnavailableAlertType {
+ t.Fatalf("probe-specific alert duplicated host-offline lifecycle: %+v", alert)
+ }
+ }
+}
+
+func TestHasExternalProbeAssignmentsRequiresEnabledLicensedTarget(t *testing.T) {
+ enabled := probeAgentTarget("enabled", "agent-1")
+ disabled := probeAgentTarget("disabled", "agent-2")
+ disabled.Enabled = false
+ monitor := newProbeAgentTestMonitor(t, enabled, disabled)
+
+ monitor.SetLicenseChecker(licenseWithExternalProbe(true))
+ if !monitor.HasExternalProbeAssignments("agent-1") {
+ t.Fatal("licensed agent with an enabled assignment was not recognized")
+ }
+ if monitor.HasExternalProbeAssignments("agent-2") {
+ t.Fatal("disabled assignment was treated as an active external probe")
+ }
+
+ monitor.SetLicenseChecker(licenseWithExternalProbe(false))
+ if monitor.HasExternalProbeAssignments("agent-1") {
+ t.Fatal("lapsed entitlement retained external probe notification routing")
+ }
+}
+
func TestApplyHostReportIngestsAssignedAvailabilityResults(t *testing.T) {
monitor := newProbeAgentTestMonitor(t,
probeAgentTarget("remote", "probe-host"),
@@ -454,8 +628,12 @@ func TestApplyHostReportIngestsAssignedAvailabilityResults(t *testing.T) {
if !status.LastChecked.Equal(checkedAt) {
t.Fatalf("last checked = %v, want %v", status.LastChecked, checkedAt)
}
- if _, ok := statuses["foreign"]; ok {
- t.Fatal("a report claimed a target assigned to another agent")
+ foreign, ok := statuses["foreign"]
+ if !ok {
+ t.Fatal("foreign assigned target missing from first-report grace state")
+ }
+ if !foreign.LastChecked.IsZero() || foreign.Outcome != "" || foreign.Available {
+ t.Fatalf("foreign status = %+v, a report claimed a target assigned to another agent", foreign)
}
}
diff --git a/internal/monitoring/availability_probe_alerts.go b/internal/monitoring/availability_probe_alerts.go
new file mode 100644
index 0000000000..a75c26c359
--- /dev/null
+++ b/internal/monitoring/availability_probe_alerts.go
@@ -0,0 +1,141 @@
+package monitoring
+
+import (
+ "sort"
+ "strings"
+ "time"
+
+ "github.com/rcourtman/pulse-go-rewrite/internal/alerts"
+ "github.com/rcourtman/pulse-go-rewrite/internal/config"
+ "github.com/rcourtman/pulse-go-rewrite/internal/models"
+)
+
+type availabilityProbeAlertAccumulator struct {
+ targetIDs []string
+ staleTargetIDs []string
+ hasFreshResult bool
+}
+
+// syncAvailabilityProbeAlerts projects target-level reporting state into one
+// stable alert lifecycle per agent. Host heartbeat loss remains owned by the
+// existing host-offline alert; this lifecycle covers a never-started probe or
+// availability results that stall while the host path is otherwise alive.
+func (m *Monitor) syncAvailabilityProbeAlerts(
+ targets []config.AvailabilityTarget,
+ statuses map[string]AvailabilityProbeStatus,
+ now time.Time,
+) {
+ if m == nil || m.alertManager == nil {
+ return
+ }
+
+ byAgent := make(map[string]*availabilityProbeAlertAccumulator)
+ for _, target := range targets {
+ if !target.Enabled {
+ continue
+ }
+ agentID := m.effectiveProbeAgentID(target)
+ if agentID == "" {
+ continue
+ }
+ accumulator := byAgent[agentID]
+ if accumulator == nil {
+ accumulator = &availabilityProbeAlertAccumulator{}
+ byAgent[agentID] = accumulator
+ }
+ accumulator.targetIDs = append(accumulator.targetIDs, target.ID)
+
+ status := statuses[target.ID]
+ switch {
+ case availabilityProbeStatusIsStale(status):
+ accumulator.staleTargetIDs = append(accumulator.staleTargetIDs, target.ID)
+ case !status.LastChecked.IsZero() && strings.TrimSpace(status.ProbeAgentID) == agentID:
+ accumulator.hasFreshResult = true
+ }
+ }
+
+ agentIDs := make([]string, 0, len(byAgent))
+ for agentID := range byAgent {
+ agentIDs = append(agentIDs, agentID)
+ }
+ sort.Strings(agentIDs)
+
+ snapshots := make([]alerts.ExternalProbeSnapshot, 0, len(agentIDs))
+ for _, agentID := range agentIDs {
+ accumulator := byAgent[agentID]
+ name, hostKnown, hostHealthy := m.availabilityProbeHostHealth(agentID, now)
+ state := alerts.ExternalProbeStateGrace
+ switch {
+ case hostKnown && !hostHealthy:
+ state = alerts.ExternalProbeStateHostOffline
+ case len(accumulator.staleTargetIDs) > 0:
+ state = alerts.ExternalProbeStateUnavailable
+ case accumulator.hasFreshResult:
+ state = alerts.ExternalProbeStateHealthy
+ }
+ snapshots = append(snapshots, alerts.ExternalProbeSnapshot{
+ AgentID: agentID,
+ Name: name,
+ State: state,
+ TargetIDs: accumulator.targetIDs,
+ StaleTargetIDs: accumulator.staleTargetIDs,
+ })
+ }
+ m.alertManager.SyncExternalProbes(snapshots)
+}
+
+func (m *Monitor) availabilityProbeHostHealth(agentID string, now time.Time) (string, bool, bool) {
+ agentID = strings.TrimSpace(agentID)
+ if m == nil || agentID == "" {
+ return agentID, false, false
+ }
+ if m.state != nil {
+ for _, host := range m.state.GetHosts() {
+ if strings.TrimSpace(host.ID) != agentID {
+ continue
+ }
+ return availabilityProbeHostDisplayName(host),
+ true,
+ !host.LastSeen.IsZero() && now.Sub(host.LastSeen) <= hostAgentHealthWindow(host.IntervalSeconds)
+ }
+ }
+ for _, entry := range m.recentStandaloneHostContinuityEntries() {
+ if strings.TrimSpace(entry.HostID) != agentID {
+ continue
+ }
+ host := hostFromContinuityEntry(entry)
+ return availabilityProbeHostDisplayName(host),
+ true,
+ !host.LastSeen.IsZero() && now.Sub(host.LastSeen) <= hostAgentHealthWindow(host.IntervalSeconds)
+ }
+ return agentID, false, false
+}
+
+func availabilityProbeHostDisplayName(host models.Host) string {
+ if name := strings.TrimSpace(host.DisplayName); name != "" {
+ return name
+ }
+ if name := strings.TrimSpace(host.Hostname); name != "" {
+ return name
+ }
+ if id := strings.TrimSpace(host.ID); id != "" {
+ return id
+ }
+ return "External Probe"
+}
+
+// HasExternalProbeAssignments allows notification routing to recognize the
+// canonical host-offline alert for an agent that currently owns enabled Pro
+// availability checks.
+func (m *Monitor) HasExternalProbeAssignments(agentID string) bool {
+ agentID = strings.TrimSpace(agentID)
+ if m == nil || agentID == "" {
+ return false
+ }
+ for _, target := range m.availabilityTargets() {
+ if target.Enabled && m.effectiveProbeAgentID(target) == agentID {
+ return true
+ }
+ }
+ return false
+}
diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.go
index 11bd0ca3d9..12b9e8fc34 100644
--- a/internal/monitoring/monitor.go
+++ b/internal/monitoring/monitor.go
@@ -1059,6 +1059,7 @@ type Monitor struct {
pbsClients map[string]*pbs.Client
pmgClients map[string]*pmg.Client
availabilityStatuses map[string]AvailabilityProbeStatus
+ availabilityProbeTrackers map[string]availabilityProbeAssignmentTracker
pollProviders map[InstanceType]PollProvider
pollMetrics *PollMetrics
scheduler *AdaptiveScheduler
@@ -1086,6 +1087,7 @@ type Monitor struct {
alertManager *alerts.Manager
alertResolvedAICallback func(*alerts.Alert)
alertTriggeredAICallback func(*alerts.Alert)
+ alertPushCallback func(*alerts.Alert)
connectionsSnapshotLister func() []alerts.ConnectionSnapshot // returns platform connection snapshots for the connection-degraded check
incidentStore *memory.IncidentStore
notificationMgr *notifications.NotificationManager
@@ -1619,6 +1621,7 @@ func New(cfg *config.Config) (*Monitor, error) {
pbsClients: make(map[string]*pbs.Client),
pmgClients: make(map[string]*pmg.Client),
availabilityStatuses: make(map[string]AvailabilityProbeStatus),
+ availabilityProbeTrackers: make(map[string]availabilityProbeAssignmentTracker),
pollProviders: make(map[InstanceType]PollProvider),
pollMetrics: getPollMetrics(),
scheduler: scheduler,
diff --git a/internal/monitoring/monitor_alert_handling_test.go b/internal/monitoring/monitor_alert_handling_test.go
index 4c4ba66712..ce93717b66 100644
--- a/internal/monitoring/monitor_alert_handling_test.go
+++ b/internal/monitoring/monitor_alert_handling_test.go
@@ -41,12 +41,32 @@ func TestMonitor_HandleAlertFired_Extra(t *testing.T) {
Level: alerts.AlertLevelWarning,
}
+ var pushed atomic.Bool
+ m2.SetAlertPushCallback(func(got *alerts.Alert) {
+ if got == alert {
+ pushed.Store(true)
+ }
+ })
m2.handleAlertFired(alert)
+ if !pushed.Load() {
+ t.Fatal("alert push callback was not invoked")
+ }
// We are just verifying it doesn't crash and calls methods.
// Hub doesn't expose way to check broadcasts easily without client.
// NotificationMgr might spin up goroutine.
}
+func TestMonitor_HandleAlertFired_RecoversFromPushCallbackPanic(t *testing.T) {
+ m := &Monitor{}
+ m.SetAlertPushCallback(func(*alerts.Alert) {
+ panic("push transport failure")
+ })
+
+ // A transport adapter must not be able to abort the canonical alert
+ // lifecycle or its remaining persistence callbacks.
+ m.handleAlertFired(&alerts.Alert{ID: "alert-push-panic"})
+}
+
func TestMonitor_HandleAlertLifecycle_WritesCanonicalChanges(t *testing.T) {
store := unifiedresources.NewMemoryStore()
m := &Monitor{
diff --git a/internal/monitoring/monitor_alerts.go b/internal/monitoring/monitor_alerts.go
index 77ba6752e6..d7a8d06c56 100644
--- a/internal/monitoring/monitor_alerts.go
+++ b/internal/monitoring/monitor_alerts.go
@@ -48,6 +48,18 @@ func (m *Monitor) SetAlertResolvedAICallback(callback func(*alerts.Alert)) {
log.Info().Msg("alert-resolved AI callback registered")
}
+// SetAlertPushCallback wires best-effort mobile push delivery for canonical
+// alerts. The callback is intentionally transport-agnostic; the API layer owns
+// Relay and decides which alert classes are safe and useful to send.
+func (m *Monitor) SetAlertPushCallback(callback func(*alerts.Alert)) {
+ if m == nil {
+ return
+ }
+ m.mu.Lock()
+ m.alertPushCallback = callback
+ m.mu.Unlock()
+}
+
// SetConnectionsSnapshotLister registers the closure that produces platform
// connection snapshots once per monitor poll cycle. The api layer owns the
// closure because it owns the config + persistence inputs the aggregator
@@ -93,6 +105,22 @@ func (m *Monitor) handleAlertFired(alert *alerts.Alert) {
if m.notificationMgr != nil {
go m.notificationMgr.SendAlert(alert)
}
+ m.mu.RLock()
+ pushCallback := m.alertPushCallback
+ m.mu.RUnlock()
+ if pushCallback != nil {
+ func() {
+ defer func() {
+ if recovered := recover(); recovered != nil {
+ log.Error().
+ Interface("panic", recovered).
+ Str("alertID", alert.ID).
+ Msg("panic in alert push callback")
+ }
+ }()
+ pushCallback(alert)
+ }()
+ }
if m.incidentStore != nil {
m.incidentStore.RecordAlertFired(alert)
diff --git a/internal/relay/client_managed_runtime_test.go b/internal/relay/client_managed_runtime_test.go
index 94727b6aa5..161aa04d3e 100644
--- a/internal/relay/client_managed_runtime_test.go
+++ b/internal/relay/client_managed_runtime_test.go
@@ -49,10 +49,28 @@ func (b *safeBuffer) String() string {
}
func TestManagedRuntimeRelayRegistrationReconnectDrain(t *testing.T) {
- t.Parallel()
-
pulseRoot, pulseProRelayDir := managedRelayWorkspaceRoots(t)
relayBinary := buildManagedRelayBinary(t, pulseProRelayDir)
+ const revocationFeedToken = "managed-runtime-revocation-feed-token"
+ revocationFeed := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ if r.URL.Path != "/v1/revocations" {
+ http.NotFound(w, r)
+ return
+ }
+ if r.Header.Get("Authorization") != "Bearer "+revocationFeedToken {
+ http.Error(w, "unauthorized", http.StatusUnauthorized)
+ return
+ }
+ w.Header().Set("Content-Type", "application/json")
+ _ = json.NewEncoder(w).Encode(map[string]any{
+ "next_seq": 0,
+ "has_more": false,
+ "events": []any{},
+ })
+ }))
+ defer revocationFeed.Close()
+ t.Setenv("PULSE_RELAY_LICENSE_SERVER_URL", revocationFeed.URL)
+ t.Setenv("PULSE_RELAY_REVOCATION_FEED_TOKEN", revocationFeedToken)
publicKey, privateKey, err := ed25519.GenerateKey(nil)
if err != nil {
diff --git a/internal/relay/mobile_compatibility_generated.go b/internal/relay/mobile_compatibility_generated.go
index c11914790f..8d09c1489e 100644
--- a/internal/relay/mobile_compatibility_generated.go
+++ b/internal/relay/mobile_compatibility_generated.go
@@ -1,14 +1,15 @@
// Code generated by scripts/release_control/generate_mobile_compatibility.py. DO NOT EDIT.
-// Source SHA256: 85bf17ae6e6fa50233dadc7447624e1aded31b31a28339d9db1d4a0401ece107
+// Source SHA256: a01ae5ea3367976f07ee8110dffb99d6c878fff8377c38b3614c5c4f6536ca1c
package relay
// Notification type constants consumed by Pulse Mobile.
const (
- PushTypePatrolFinding = "patrol_finding"
- PushTypePatrolCritical = "patrol_critical"
- PushTypeApprovalRequest = "approval_request"
- PushTypeFixCompleted = "fix_completed"
+ PushTypePatrolFinding = "patrol_finding"
+ PushTypePatrolCritical = "patrol_critical"
+ PushTypeExternalProbeOffline = "external_probe_offline"
+ PushTypeApprovalRequest = "approval_request"
+ PushTypeFixCompleted = "fix_completed"
)
// Priority constants consumed by Pulse Mobile.
diff --git a/internal/relay/push.go b/internal/relay/push.go
index 1eddb5760a..4356f9e5f8 100644
--- a/internal/relay/push.go
+++ b/internal/relay/push.go
@@ -86,6 +86,22 @@ func NewPatrolFindingNotification(findingID, severity, category, title string) P
}
}
+// NewExternalProbeUnavailableNotification creates the privacy-safe mobile push
+// used when a remote availability probe stops reporting. Resource names,
+// addresses, and target details intentionally stay inside Pulse.
+func NewExternalProbeUnavailableNotification(alertID string) PushNotificationPayload {
+ return PushNotificationPayload{
+ Type: PushTypeExternalProbeOffline,
+ Priority: PushPriorityHigh,
+ Title: "External Probe Offline",
+ Body: "An external Pulse probe stopped reporting. Open Pulse for details.",
+ ActionType: PushActionViewAlert,
+ ActionID: strings.TrimSpace(alertID),
+ Category: "availability",
+ Severity: "warning",
+ }
+}
+
// NewApprovalRequestNotification creates a push notification for a fix needing approval.
func NewApprovalRequestNotification(approvalID, findingTitle, riskLevel string) PushNotificationPayload {
body := "A proposed fix requires your approval"
diff --git a/internal/relay/push_test.go b/internal/relay/push_test.go
index 1d8da2e5ac..7141251dd2 100644
--- a/internal/relay/push_test.go
+++ b/internal/relay/push_test.go
@@ -101,6 +101,25 @@ func TestNewPatrolFindingNotification(t *testing.T) {
})
}
+func TestNewExternalProbeUnavailableNotification(t *testing.T) {
+ n := NewExternalProbeUnavailableNotification(" alert-123 ")
+ if n.Type != PushTypeExternalProbeOffline || n.Priority != PushPriorityHigh {
+ t.Fatalf("notification posture = %#v", n)
+ }
+ if n.Title != "External Probe Offline" {
+ t.Fatalf("notification presentation = %#v", n)
+ }
+ if n.ActionType != PushActionViewAlert || n.ActionID != "alert-123" {
+ t.Fatalf("notification must route the canonical alert into mobile attention: %#v", n)
+ }
+ if n.Category != "availability" || n.Severity != "warning" {
+ t.Fatalf("notification routing = %#v", n)
+ }
+ if strings.Contains(n.Body, "agent-") || strings.Contains(n.Body, ".local") {
+ t.Fatalf("notification leaked infrastructure context: %#v", n)
+ }
+}
+
func TestNewApprovalRequestNotification(t *testing.T) {
t.Run("with risk level", func(t *testing.T) {
n := NewApprovalRequestNotification("approval-789", "Fix disk space", "high")
diff --git a/scripts/release_control/canonical_completion_guard_test.py b/scripts/release_control/canonical_completion_guard_test.py
index a161fac686..7cd4c444a2 100644
--- a/scripts/release_control/canonical_completion_guard_test.py
+++ b/scripts/release_control/canonical_completion_guard_test.py
@@ -217,6 +217,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
"internal/api/host_agent_removal_lifecycle_integration_test.go",
"internal/config/host_continuity_test.go",
"internal/models/metrics_types_test.go",
+ "internal/monitoring/availability_probe_agent_test.go",
"internal/monitoring/monitor_host_agent_removal_lifecycle_test.go",
"internal/monitoring/monitor_host_agents_test.go",
"scripts/installtests/agent_state_dir_lifecycle_test.go",
@@ -285,6 +286,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
"internal/config/docker_metadata_test.go",
"internal/config/guest_metadata_test.go",
"internal/monitoring/availability_poller_test.go",
+ "internal/monitoring/availability_probe_agent_test.go",
"internal/monitoring/availability_udp_test.go",
"internal/monitoring/canonical_guardrails_test.go",
"internal/monitoring/ceph_test.go",
@@ -401,6 +403,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
"internal/api/host_agent_removal_lifecycle_integration_test.go",
"internal/config/host_continuity_test.go",
"internal/models/metrics_types_test.go",
+ "internal/monitoring/availability_probe_agent_test.go",
"internal/monitoring/monitor_host_agent_removal_lifecycle_test.go",
"internal/monitoring/monitor_host_agents_test.go",
"scripts/installtests/agent_state_dir_lifecycle_test.go",
@@ -1170,6 +1173,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):
"internal/api/audit_handlers_test.go",
"internal/api/contract_test.go",
"internal/api/docker_agents_report_size_test.go",
+ "internal/api/external_probe_notifications_test.go",
"internal/api/host_agent_removal_lifecycle_integration_test.go",
"internal/api/issue1640_readiness_gate_test.go",
"internal/api/issue1640_readiness_transport_test.go",
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index 31adba722c..27d4f49eb5 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -4176,6 +4176,7 @@ class SubsystemLookupTest(unittest.TestCase):
"internal/api/host_agent_removal_lifecycle_integration_test.go",
"internal/config/host_continuity_test.go",
"internal/models/metrics_types_test.go",
+ "internal/monitoring/availability_probe_agent_test.go",
"internal/monitoring/monitor_host_agent_removal_lifecycle_test.go",
"internal/monitoring/monitor_host_agents_test.go",
"scripts/installtests/agent_state_dir_lifecycle_test.go",