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.

Fix connected-system and profile diagnostics regressions

rcourtman86d6b56988f0
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 2a8138fe0e..eb78fd27fa 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -2468,14 +2468,17 @@ for IP literals), so short-name vs fully-qualified drift does not break
admission. Legacy pre-v6.1.1 hostname-bound records still migrate exactly
once on hostname match.
-### PBS connection health does not create agent lifecycle evidence
+### PBS connection composition does not create agent lifecycle evidence
The shared API connections ledger and diagnostics now project PBS health from
the monitoring scheduler's completed poll result and keep immediate diagnostics
probes separate. This does not enroll a PBS host as a Pulse Agent, extend an
agent heartbeat, prove command reachability, or create update/repair authority.
Agent lifecycle consumers continue to use agent-source identity and report
-freshness only; same-hostname PBS connections remain distinct provider rows.
+freshness only. When normalized host identity uniquely proves that a PBS API
+source and a Pulse Agent describe the same machine, the grouped systems
+payload composes them into one source row with API + Agent coverage; provider
+health and agent lifecycle facts remain independently authored inside that row.
### Docker and Podman report sizes share one exact-byte contract
@@ -3935,15 +3938,16 @@ have been merged. `/api/agents/agent/{id}/config` must keep the existing
config `signature` backward-compatible with installed agents by signing the
legacy canonical payload shape only; newer clients validate `desiredConfig` by
recomputing it from the signed command decision and signed settings payload,
-restricted to the agent-applied settings key schema. Broader applied-state
-reporting remains the next contract gap for managed config: until the runtime
-report carries a comparable applied config fingerprint for an assigned managed
-desired config, `/api/connections` must surface that desired config metadata as
-pending or unknown and must not claim rollout convergence from host report
-fields such as `commandsEnabled` or `diskExclude`. The empty default desired
-config is different: it may be signed and served for compatibility, but without
-a managed command decision or agent-applied setting it is not a rollout and
-must project as `configDrift: not-applicable` with a current applied rollout.
+restricted to the agent-applied settings key schema. Current Unified Agent
+reports carry the comparable applied fingerprint, and `/api/connections` owns
+managed-config convergence by comparing those fingerprints. Agent Doctor must
+not demand the separate legacy profile-deployment acknowledgement that current
+agents do not emit or label its absence as deployed version zero; it may still
+surface explicit persisted failed, pending, or version-drift records. The empty
+default desired config is different: it may be signed and served for
+compatibility, but without a managed command decision or agent-applied setting
+it is not a rollout and must project as `configDrift: not-applicable` with a
+current applied rollout.
Command policy follows the same lifecycle truth boundary: the server desired
command setting is not applied runtime truth until a current agent report
confirms it. `/api/connections` must expose desired command policy, applied
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 69791dcf27..11fd9f9440 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -2987,10 +2987,17 @@ a new API state machine, queue contract, or verification-accounting field.
views of the same enrolled machine instead of showing a second
"discovered" candidate row for an already represented source member or
API-plus-agent source row. Exact host-agent matches for a configured
- Proxmox primary source must also attach through the backend systems
+ single-host platform source (PVE, PBS, PMG, or TrueNAS) must also attach
+ through the backend systems
payload when workload node inventory is absent because credentials or
reachability are blocked, so the infrastructure ledger does not split the
same physical host into an API row plus a standalone host-agent row.
+ Host matching uses normalized names, addresses, and aliases and fails
+ closed when more than one enabled platform source matches; VMware remains
+ excluded because a vCenter connection is not the ESXi host on which an
+ agent would run. Composition adds agent telemetry to the source row without
+ converting provider health, credentials, or polling freshness into agent
+ lifecycle evidence.
Agent-backed
connections also own canonical version/update facts on that same payload:
when a source or attachment is backed by Pulse Agent, `/api/connections`
diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.md
index be5eb6f62f..64b3795969 100644
--- a/docs/release-control/v6/internal/subsystems/monitoring.md
+++ b/docs/release-control/v6/internal/subsystems/monitoring.md
@@ -798,11 +798,16 @@ changes.
inventory instead of flattening them into pods, deployments, or generic
networking, storage, configuration, or controller rows.
Agent Fleet Doctor diagnostics must derive from the current monitoring
- `StateSnapshot`, agent-profile assignments, and profile deployment
- acknowledgements only. `internal/monitoring/agent_fleet_doctor.go` may
- explain liveness, version drift, identity splits, expected telemetry gaps,
- and profile drift, but it must remain read-only and must not become a
- separate collector, repair executor, or replacement for the canonical
+ `StateSnapshot`, agent-profile assignments, and any persisted legacy
+ profile deployment acknowledgements only. Absence of that legacy
+ acknowledgement is not failure evidence: current managed-config
+ convergence is owned by the desired-versus-applied fingerprint projected
+ through `/api/connections`. A persisted acknowledgement may still explain
+ explicit failed, pending, or version-drift state.
+ `internal/monitoring/agent_fleet_doctor.go` may explain liveness, version
+ drift, identity splits, expected telemetry gaps, and evidenced profile
+ drift, but it must remain read-only and must not become a separate
+ collector, repair executor, or replacement for the canonical
`/api/connections` fleet projection.
19. Add or change unified-resource alert synchronization through
`internal/monitoring/monitor_alert_sync.go` and the alerts subsystem
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 14400c7fcf..fbbe96170b 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -994,6 +994,12 @@ recovery scope, or a storage/recovery-owned secret source.
observe the same node by hostname and IP, so storage- and
recovery-adjacent consumers inherit one canonical represented-host identity
instead of inventing local merge heuristics.
+ When those aliases uniquely identify one enabled single-host API source
+ (including PBS) and one Pulse Agent, the API-owned grouped systems payload
+ must compose them into one source row rather than expose duplicate machine
+ rows. This is presentation and collection-method composition only: agent
+ liveness cannot become PBS reachability, backup freshness, protection, or
+ recovery evidence.
The settings-level manual discovery refresh at `/api/discovery/run` belongs
to that adjacent discovery/API boundary. Storage and recovery surfaces may
consume refreshed workload discovery records, but they must not reinterpret
diff --git a/frontend-modern/src/components/Settings/__tests__/infrastructureAgentDoctorModel.test.ts b/frontend-modern/src/components/Settings/__tests__/infrastructureAgentDoctorModel.test.ts
index 3bcd272701..d3db229cb4 100644
--- a/frontend-modern/src/components/Settings/__tests__/infrastructureAgentDoctorModel.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/infrastructureAgentDoctorModel.test.ts
@@ -121,6 +121,30 @@ describe('Agent Doctor model', () => {
expect(targets[0].commandBlockedReason).toBeUndefined();
});
+ it('does not invent a deployed v0 profile version when no legacy acknowledgement exists', () => {
+ const connection = connectionFixture({
+ agentUpdateAvailable: false,
+ agentVersion: '6.2.0',
+ expectedAgentVersion: '6.2.0',
+ });
+ const targets = collectInfrastructureAgentDoctorTargets({
+ rows: [rowFixture(connection)],
+ connections: [connection],
+ diagnostics: [
+ diagnosticFixture({
+ status: 'healthy',
+ reasons: [],
+ profileVersion: 4,
+ deployedProfileVersion: undefined,
+ }),
+ ],
+ diagnosticsAvailable: true,
+ targetVersion: '6.2.0',
+ });
+
+ expect(targets[0]?.profileVersionLabel).toBe('Assigned v4');
+ });
+
it('does not report healthy when telemetry is fresh but command admission is disconnected', () => {
const connection = connectionFixture({
agentUpdateAvailable: false,
diff --git a/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov0720pm.test.ts b/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov0720pm.test.ts
index 8b3078ee7e..89f663ce73 100644
--- a/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov0720pm.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov0720pm.test.ts
@@ -1220,7 +1220,7 @@ describe('collectInfrastructureAgentDoctorTargets (evidence + profile labels)',
expect(none?.profileLabel).toBeUndefined();
});
- it('builds profileVersionLabel when profileVersion is present (defaulting deployed to 0)', () => {
+ it('builds profileVersionLabel without inventing a missing deployed version', () => {
const withDeployed = runDoctor([agentConnection()], {
diagnostics: [diagnostic({ profileVersion: 4, deployedProfileVersion: 3 })],
diagnosticsAvailable: true,
@@ -1233,7 +1233,7 @@ describe('collectInfrastructureAgentDoctorTargets (evidence + profile labels)',
diagnosticsAvailable: true,
targetVersion: '6.2.0',
})[0];
- expect(noDeployed?.profileVersionLabel).toBe('Expected v4 · deployed v0');
+ expect(noDeployed?.profileVersionLabel).toBe('Assigned v4');
const absent = runDoctor([agentConnection()], {
diagnostics: [diagnostic({ profileVersion: undefined })],
diff --git a/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov0722am.test.ts b/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov0722am.test.ts
index e3eeb9238e..f708682f2e 100644
--- a/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov0722am.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov0722am.test.ts
@@ -366,12 +366,11 @@ describe('collectInfrastructureAgentDoctorTargets (diagnostic-only orphan shapin
expect(target?.reasons).toEqual([]);
});
- it('defaults deployedProfileVersion to 0 in the orphan profileVersionLabel', () => {
- // `deployedProfileVersion || 0` alternate arm on the diagnostic-only path.
+ it('does not invent deployed v0 in the orphan profileVersionLabel', () => {
const [target] = runOrphans([
orphanDiagnostic({ profileVersion: 7, deployedProfileVersion: undefined }),
]);
- expect(target?.profileVersionLabel).toBe('Expected v7 · deployed v0');
+ expect(target?.profileVersionLabel).toBe('Assigned v7');
});
});
diff --git a/frontend-modern/src/components/Settings/infrastructureAgentUpdateCommandsModel.ts b/frontend-modern/src/components/Settings/infrastructureAgentUpdateCommandsModel.ts
index a890b00005..1a4ada44ff 100644
--- a/frontend-modern/src/components/Settings/infrastructureAgentUpdateCommandsModel.ts
+++ b/frontend-modern/src/components/Settings/infrastructureAgentUpdateCommandsModel.ts
@@ -547,9 +547,7 @@ const doctorTargetFromBinding = (
const profileLabel =
diagnostic?.profileName?.trim() || diagnostic?.profileId?.trim() || undefined;
- const profileVersionLabel = diagnostic?.profileVersion
- ? `Expected v${diagnostic.profileVersion} · deployed v${diagnostic.deployedProfileVersion || 0}`
- : undefined;
+ const profileVersionLabel = diagnosticProfileVersionLabel(diagnostic);
return {
key: connection.id,
@@ -604,6 +602,14 @@ const diagnosticContextLabel = (
return `${labels.join(' + ')} agent`;
};
+const diagnosticProfileVersionLabel = (
+ diagnostic?: AgentFleetAgentDiagnostic,
+): string | undefined => {
+ if (!diagnostic?.profileVersion) return undefined;
+ if (!diagnostic.deployedProfileVersion) return `Assigned v${diagnostic.profileVersion}`;
+ return `Expected v${diagnostic.profileVersion} · deployed v${diagnostic.deployedProfileVersion}`;
+};
+
const diagnosticOnlyDoctorTarget = (
diagnostic: AgentFleetAgentDiagnostic,
): InfrastructureAgentDoctorTarget => {
@@ -622,9 +628,7 @@ const diagnosticOnlyDoctorTarget = (
needsUpdate: false,
commandPlatform: resolveKnownAgentCommandPlatform(diagnostic.platform),
profileLabel: diagnostic.profileName?.trim() || diagnostic.profileId?.trim() || undefined,
- profileVersionLabel: diagnostic.profileVersion
- ? `Expected v${diagnostic.profileVersion} · deployed v${diagnostic.deployedProfileVersion || 0}`
- : undefined,
+ profileVersionLabel: diagnosticProfileVersionLabel(diagnostic),
lastSeen: diagnostic.lastSeen,
source: removed ? 'removed' : 'diagnostics',
};
diff --git a/internal/api/connections_alerts_branchcov0722am_test.go b/internal/api/connections_alerts_branchcov0722am_test.go
index 5643008439..6e40e156db 100644
--- a/internal/api/connections_alerts_branchcov0722am_test.go
+++ b/internal/api/connections_alerts_branchcov0722am_test.go
@@ -261,7 +261,7 @@ func TestBranchcov0722UniqueMatch(t *testing.T) {
// When two connections normalise to the same host string the match is
// ambiguous; uniqueMatch returns "" so primaryConnectionIDForResource
// does not silently pick whichever ID happened to be appended last.
- // This mirrors directProxmoxHostAttachment's "more than one → no match"
+ // This mirrors directPlatformHostAttachment's "more than one → no match"
// contract, and is the reason the helper is named unique*Match.
t.Run("ambiguous_match_returns_empty", func(t *testing.T) {
idx := buildConnectionHostIndex([]Connection{
diff --git a/internal/api/connections_grouping.go b/internal/api/connections_grouping.go
index 6a271e33cd..b076477fd1 100644
--- a/internal/api/connections_grouping.go
+++ b/internal/api/connections_grouping.go
@@ -598,7 +598,7 @@ func resolveAgentAttachments(
if _, exists := attachments[agent.ID]; exists {
continue
}
- if primaryID := directProxmoxHostAttachment(agent, connectionByID); primaryID != "" {
+ if primaryID := directPlatformHostAttachment(agent, connectionByID); primaryID != "" {
register(agent.ID, primaryID, false, false)
}
}
@@ -623,7 +623,7 @@ func sortedConnectionsByID(connectionByID map[string]Connection) []Connection {
return connections
}
-func directProxmoxHostAttachment(
+func directPlatformHostAttachment(
agent Connection,
connectionByID map[string]Connection,
) string {
@@ -633,7 +633,7 @@ func directProxmoxHostAttachment(
var matchedID string
for _, primary := range sortedConnectionsByID(connectionByID) {
- if primary.Type != ConnectionTypePVE || !primary.Enabled {
+ if !isSingleHostPlatformConnectionType(primary.Type) || !primary.Enabled {
continue
}
if !connectionsShareHost(agent, primary) {
@@ -647,6 +647,15 @@ func directProxmoxHostAttachment(
return matchedID
}
+func isSingleHostPlatformConnectionType(typ ConnectionType) bool {
+ switch typ {
+ case ConnectionTypePVE, ConnectionTypePBS, ConnectionTypePMG, ConnectionTypeTrueNAS:
+ return true
+ default:
+ return false
+ }
+}
+
func buildProxmoxClusterNames(
connectionByID map[string]Connection,
monitor *monitoring.Monitor,
diff --git a/internal/api/connections_grouping_test.go b/internal/api/connections_grouping_test.go
index c746a2e3f5..5b55a419da 100644
--- a/internal/api/connections_grouping_test.go
+++ b/internal/api/connections_grouping_test.go
@@ -538,6 +538,69 @@ func TestBuildConnectionSystems_AttachesHostAgentToMatchingProxmoxSourceWithoutN
}
}
+func TestDirectPlatformHostAttachmentSupportsSingleHostAPISources(t *testing.T) {
+ tests := []struct {
+ name string
+ typ ConnectionType
+ }{
+ {name: "Proxmox VE", typ: ConnectionTypePVE},
+ {name: "Proxmox Backup Server", typ: ConnectionTypePBS},
+ {name: "Proxmox Mail Gateway", typ: ConnectionTypePMG},
+ {name: "TrueNAS", typ: ConnectionTypeTrueNAS},
+ }
+
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ connections := map[string]Connection{
+ "platform:source": {
+ ID: "platform:source",
+ Type: test.typ,
+ Name: "source-01",
+ Address: "https://192.0.2.30:8443",
+ HostAliases: []string{"source-01", "192.0.2.30"},
+ Enabled: true,
+ },
+ "agent:source": {
+ ID: "agent:source",
+ Type: ConnectionTypeAgent,
+ Name: "source-01",
+ Address: "192.0.2.30",
+ HostAliases: []string{"source-01", "192.0.2.30"},
+ Enabled: true,
+ },
+ }
+ if got := directPlatformHostAttachment(connections["agent:source"], connections); got != "platform:source" {
+ t.Fatalf("directPlatformHostAttachment() = %q, want %q", got, "platform:source")
+ }
+ })
+ }
+
+ t.Run("ambiguous platform sources fail closed", func(t *testing.T) {
+ agent := Connection{ID: "agent:source", Type: ConnectionTypeAgent, Name: "source-01"}
+ connections := map[string]Connection{
+ agent.ID: agent,
+ "pve:source": {ID: "pve:source", Type: ConnectionTypePVE, Name: "source-01", Enabled: true},
+ "pbs:source": {ID: "pbs:source", Type: ConnectionTypePBS, Name: "source-01", Enabled: true},
+ "vmware:source": {ID: "vmware:source", Type: ConnectionTypeVMware, Name: "source-01", Enabled: true},
+ "disabled:source": {ID: "disabled:source", Type: ConnectionTypePMG, Name: "source-01"},
+ }
+ if got := directPlatformHostAttachment(agent, connections); got != "" {
+ t.Fatalf("directPlatformHostAttachment() = %q, want an ambiguous fail-closed result", got)
+ }
+ })
+
+ t.Run("vCenter is not a single-host attachment", func(t *testing.T) {
+ agent := Connection{ID: "agent:source", Type: ConnectionTypeAgent, Name: "source-01"}
+ connections := map[string]Connection{
+ agent.ID: agent,
+ "vmware:source": {ID: "vmware:source", Type: ConnectionTypeVMware, Name: "source-01", Enabled: true},
+ }
+ if got := directPlatformHostAttachment(agent, connections); got != "" {
+ t.Fatalf("directPlatformHostAttachment() = %q, want no vCenter attachment", got)
+ }
+ })
+}
+
// One vCenter connection spans many ESXi hosts, so vSphere host resources
// compose as members of their owning vmware connection the way Proxmox
// cluster nodes compose under their cluster source. Resources pointing at an
diff --git a/internal/api/contract_test.go b/internal/api/contract_test.go
index 1efe9f3477..216b6877c6 100644
--- a/internal/api/contract_test.go
+++ b/internal/api/contract_test.go
@@ -15721,6 +15721,52 @@ func TestContract_ConnectionSystemHostAgentAttachmentPayloadShapeStaysCanonical(
assertJSONSnapshot(t, body, want)
}
+func TestContract_PBSHostAgentComposesIntoOwningSystem(t *testing.T) {
+ cfg := &config.Config{DataPath: t.TempDir()}
+ monitor, err := monitoring.New(cfg)
+ if err != nil {
+ t.Fatalf("monitoring.New: %v", err)
+ }
+ t.Cleanup(func() { monitor.Stop() })
+
+ connections := []Connection{
+ {
+ ID: "pbs:pbs01",
+ Type: ConnectionTypePBS,
+ Name: "pbs01",
+ Address: "https://pbs01:8007",
+ HostAliases: []string{"pbs01", "192.0.2.20"},
+ State: ConnectionStateActive,
+ Enabled: true,
+ },
+ {
+ ID: "agent:agent-pbs01",
+ Type: ConnectionTypeAgent,
+ Name: "pbs01",
+ Address: "192.0.2.20",
+ HostAliases: []string{"pbs01", "192.0.2.20"},
+ State: ConnectionStateActive,
+ Enabled: true,
+ },
+ }
+
+ systems := buildConnectionSystems(connections, monitor)
+ if len(systems) != 1 {
+ t.Fatalf("systems = %+v, want one composed PBS system", systems)
+ }
+ want := ConnectionSystem{
+ ID: "pbs:pbs01",
+ Type: ConnectionTypePBS,
+ Components: []ConnectionSystemComponent{
+ {ConnectionID: "pbs:pbs01", Type: ConnectionTypePBS, Role: ConnectionSystemComponentRolePrimary},
+ {ConnectionID: "agent:agent-pbs01", Type: ConnectionTypeAgent, Role: ConnectionSystemComponentRoleAttachment},
+ },
+ }
+ if !reflect.DeepEqual(systems[0], want) {
+ t.Fatalf("system = %+v, want %+v", systems[0], want)
+ }
+}
+
func TestContract_AgentConnectionPayloadIncludesVersionFields(t *testing.T) {
conn := Connection{
ID: "agent:host-1",
diff --git a/internal/monitoring/agent_fleet_doctor.go b/internal/monitoring/agent_fleet_doctor.go
index 7456374c96..b3080e45c4 100644
--- a/internal/monitoring/agent_fleet_doctor.go
+++ b/internal/monitoring/agent_fleet_doctor.go
@@ -881,15 +881,13 @@ func diagnoseProfileDeployment(
deployment, ok := deploymentByAgentProfile[deploymentKey(assignment.AgentID, assignment.ProfileID)]
if !ok {
- return []AgentFleetDiagnosticReason{{
- Code: "profile_deployment_missing",
- Severity: AgentFleetStatusWarning,
- Message: "A profile is assigned, but no deployment acknowledgement exists for this agent.",
- Evidence: []string{
- fmt.Sprintf("Assigned profile: %s", firstNonEmpty(profile.Name, profile.ID)),
- fmt.Sprintf("Expected profile version: %d", expectedVersion),
- },
- }}
+ // ProfileDeploymentStatus predates the applied-config fingerprint carried
+ // by current Unified Agent reports. Absence is therefore not failure
+ // evidence: config convergence is owned by the desired-versus-applied
+ // fingerprint contract projected through /api/connections. Retain real
+ // legacy acknowledgements below so explicit failed, pending, and stale
+ // deployments remain useful diagnostics.
+ return nil
}
reasons := []AgentFleetDiagnosticReason{}
diff --git a/internal/monitoring/agent_fleet_doctor_test.go b/internal/monitoring/agent_fleet_doctor_test.go
index 9aa444ad1a..f70a1f57f2 100644
--- a/internal/monitoring/agent_fleet_doctor_test.go
+++ b/internal/monitoring/agent_fleet_doctor_test.go
@@ -296,6 +296,47 @@ func TestAgentFleetDiagnosticsDetectsProfileVersionDrift(t *testing.T) {
}
}
+func TestAgentFleetDiagnosticsDoesNotRequireLegacyProfileDeploymentAcknowledgement(t *testing.T) {
+ now := time.Date(2026, 8, 1, 12, 0, 0, 0, time.UTC)
+ monitor := newAgentFleetDoctorTestMonitor(t)
+ monitor.state.UpsertHost(models.Host{
+ ID: "agent-1",
+ Hostname: "profile-node",
+ Status: "online",
+ LastSeen: now.Add(-30 * time.Second),
+ IntervalSeconds: 30,
+ AgentVersion: "6.2.0",
+ })
+ saveAgentFleetProfileState(t, monitor.persistence,
+ []models.AgentProfile{{
+ ID: "profile-current",
+ Name: "Current profile",
+ Version: 4,
+ Config: models.AgentConfigMap{},
+ }},
+ []models.AgentProfileAssignment{{
+ AgentID: "agent-1",
+ ProfileID: "profile-current",
+ ProfileVersion: 4,
+ UpdatedAt: now,
+ }},
+ nil,
+ )
+
+ agent := requireAgentDiagnostic(t, monitor.GetAgentFleetDiagnostics("6.2.0", now), "agent-agent-1")
+ if agent.Status != AgentFleetStatusHealthy {
+ t.Fatalf("status = %q, want %q; reasons = %#v", agent.Status, AgentFleetStatusHealthy, agent.Reasons)
+ }
+ if agent.ProfileVersion != 4 || agent.DeployedProfileVersion != 0 {
+ t.Fatalf("profile versions = assigned %d deployed %d, want assigned 4 with no legacy deployment version", agent.ProfileVersion, agent.DeployedProfileVersion)
+ }
+ for _, reason := range agent.Reasons {
+ if reason.Code == "profile_deployment_missing" {
+ t.Fatalf("missing legacy deployment acknowledgement must not create attention: %#v", agent.Reasons)
+ }
+ }
+}
+
func TestAgentFleetDiagnosticsRetainPlatformForRemovedAgents(t *testing.T) {
now := time.Date(2026, 7, 22, 12, 0, 0, 0, time.UTC)
monitor := newAgentFleetDoctorTestMonitor(t)