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.

Keep retained monitoring status current

pulse-triage[bot]c317f8c2df3f
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 5fe2a4daba..355ac17c8e 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -4536,6 +4536,23 @@ resolves late` in
## Current State
+### Retained monitoring status remains reactive (11 October 2026)
+
+The existing Machines status dot subscribes to the shared relative-time clock
+for the unchanged five-minute agent-report fallback, agreeing with the
+standalone classification helper without a new report, row timer or API read.
+Attention sort classifies once per resource per call, preserving priority and
+numeric-name ordering without keeping a cross-call status cache. Debug source
+summaries read current status/error/last-seen by section ID, not a record captured
+when a retained payload section first mounted. Disclosure, focus and payload
+remain owned by that section.
+
+The Machines, standalone model and Debug relative-age regression controls,
+plus `browser-tests/pr2600-monitoring.cjs` on desktop and touch-phone engines,
+cover clock-only staleness and arriving status replacement. These are
+synthetic source/presentation checks, not collector, workload recovery,
+whole-fleet performance, installed or release acceptance.
+
### Manual update freshness
The update panel has a dedicated proof route to `updatesPresentation.test.ts`,
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 86b534a2fb..be9d9602a6 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -3144,6 +3144,29 @@ application resource-provider or WebSocket lifecycle.
## Current State
+### Retained Machines and Debug status (11 October 2026)
+
+The Machines row status reads the same existing shared clock as its posture
+summary. A held online agent becomes Stale only under the unchanged five-minute
+fallback; clock ticks neither renew its report nor set its canonical stale flag.
+The row retains identity and metric values, and an actual report or offline
+status still updates its presentation. Attention sorting classifies each input
+resource once per call, retains the priority/name order and never caches status
+across calls or mutates the input inventory.
+
+Debug source status, error and last-seen are reactive by section ID even when
+source payload sections stay mounted. New status records withdraw obsolete
+errors; absent/invalid timestamps do not acquire an age. Source payload,
+disclosure and focus survive status-only updates and quiet age ticks.
+
+Verification: the Machines table, standalone page-model and Debug relative-age
+tests cover the retained-row boundary, per-resource classification count and
+ordinary source-status replacement. `browser-tests/pr2600-monitoring.cjs`
+compares exact-parent and repaired production surfaces on desktop Chromium and
+touch-phone WebKit using synthetic local data. It establishes presentation,
+not a probe, guest thaw/writes/liveness/restoration, native collector recovery,
+whole-fleet CPU relief, publication or release availability.
+
### Interface-associated display addresses
VM and LXC projections retain the collector's interface-associated IP order in
diff --git a/frontend-modern/browser-tests/pr2600-monitoring.cjs b/frontend-modern/browser-tests/pr2600-monitoring.cjs
index ac66388ca6..4ce085a7db 100644
--- a/frontend-modern/browser-tests/pr2600-monitoring.cjs
+++ b/frontend-modern/browser-tests/pr2600-monitoring.cjs
@@ -156,14 +156,12 @@ const hash = (p) => crypto.createHash('sha256').update(fs.readFileSync(p)).diges
if (surface === 'machines') {
const row = page.locator('[data-agents-machine-row="fixture-agent"]');
const dot = row.locator('span[title="online"]');
- const posture = page.getByTestId('standalone-posture-summary');
+ // Machines no longer has a posture card. Compare with the production
+ // classification helper, not an obsolete UI from the old proposal.
+ const posture = page.getByTestId('fixture-posture-summary');
await row.waitFor();
await page.clock.runFor(20000); // Complete the ordinary initial canonical revalidation.
- await page.waitForFunction(() =>
- document
- .querySelector('[data-testid="standalone-posture-summary"]')
- ?.textContent.includes('reporting normally'),
- );
+ assert.match(await posture.innerText(), /0 need attention/);
assert.match(await dot.getAttribute('class'), /bg-emerald-500/);
await row.evaluate((el) => {
window.__originalRow = el;
@@ -176,7 +174,7 @@ const hash = (p) => crypto.createHash('sha256').update(fs.readFileSync(p)).diges
await page.clock.runFor(220000); // The original report is exactly five minutes old.
assert.match(await dot.getAttribute('class'), /bg-emerald-500/);
await page.clock.runFor(30000);
- assert.match(await posture.innerText(), /1 machine needs attention/);
+ assert.match(await posture.innerText(), /1 need attention/);
const heldClass = await dot.getAttribute('class');
assert.match(heldClass, binding.mode === 'parent' ? /bg-emerald-500/ : /bg-amber-500/);
assert.equal(await page.evaluate(() => window.__pr2600.snapshot()), snapshot);
@@ -282,6 +280,12 @@ const hash = (p) => crypto.createHash('sha256').update(fs.readFileSync(p)).diges
}
result.completed = true;
} finally {
+ if (currentPage) {
+ result.unfinishedPage = await currentPage
+ .locator('body')
+ .innerText()
+ .catch(() => 'unavailable');
+ }
if (currentPage) await currentPage.close();
if (browser) await browser.close();
result.cleanup.browserClosed = true;
diff --git a/frontend-modern/browser-tests/pr2600-monitoring.tsx b/frontend-modern/browser-tests/pr2600-monitoring.tsx
index 7c1b348ce7..88e7467b72 100644
--- a/frontend-modern/browser-tests/pr2600-monitoring.tsx
+++ b/frontend-modern/browser-tests/pr2600-monitoring.tsx
@@ -4,6 +4,8 @@ import { createStore, reconcile } from 'solid-js/store';
import { render } from 'solid-js/web';
import { Router, Route } from '@solidjs/router';
import { StandalonePageSurface } from '../src/features/standalone/StandalonePageSurface';
+import { buildStandalonePostureSummary } from '../src/features/standalone/standalonePageModel';
+import { useRelativeTimeNow } from '../src/utils/relativeTimeClock';
import { ResourceDetailDrawerDebugTab } from '../src/components/Infrastructure/ResourceDetailDrawerDebugTab';
import { useResourceDetailDrawerDerivedState } from '../src/components/Infrastructure/useResourceDetailDrawerDerivedState';
import type { UseResourceDetailDrawerStateResult } from '../src/components/Infrastructure/useResourceDetailDrawerState';
@@ -91,6 +93,7 @@ function DebugFixture() {
return <ResourceDetailDrawerDebugTab resource={debugResource} drawer={drawer} />;
}
function Fixture() {
+ const now = useRelativeTimeNow();
const [mounted, setMounted] = createSignal(true);
(window as any).__pr2600 = {
snapshot: () => JSON.stringify({ machine: wsState.resources[0], debugResource }),
@@ -124,6 +127,12 @@ function Fixture() {
<main class="mx-auto min-h-screen max-w-6xl space-y-3 bg-surface p-3 text-base-content">
<h1 class="text-base font-semibold">Retained monitoring evidence</h1>
<p class="text-xs text-muted">Synthetic local data. No collector or guest command is sent.</p>
+ <Show when={surface === 'machines'}>
+ <output data-testid="fixture-posture-summary" class="text-xs text-muted">
+ Classification control:{' '}
+ {buildStandalonePostureSummary(wsState.resources, now()).attention} need attention
+ </output>
+ </Show>
<Show when={mounted()}>
<Show when={surface === 'machines'} fallback={<DebugFixture />}>
<StandalonePageSurface />
diff --git a/frontend-modern/browser-verification/87e7634b6647dd78.json b/frontend-modern/browser-verification/87e7634b6647dd78.json
new file mode 100644
index 0000000000..94d924b194
--- /dev/null
+++ b/frontend-modern/browser-verification/87e7634b6647dd78.json
@@ -0,0 +1,39 @@
+{
+ "version": 1,
+ "base_sha": "e6276c755717d665067b8a0c16f54a8fe1698018",
+ "verified_at": "2026-10-11T17:09:42.515868Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx",
+ "frontend-modern/src/features/standalone/AgentsMachinesTable.tsx",
+ "frontend-modern/src/features/standalone/standalonePageModel.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/features/standalone/AgentsMachinesTable.tsx": "6bcf8552e8424c6eb84c646c71c2b40444ccfa33481452526064270a1437600c",
+ "frontend-modern/src/features/standalone/standalonePageModel.ts": "42cbf2e575918e2eb16ac40e1b600a66df3aa64d043a68ff15b86e09e5836ea2",
+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx": "7173f1c57fe9ed069f90a341149683fd003e6e5fc5b0ff49875c7b9a29db52db"
+ },
+ "routes": [
+ "/browser-tests/pr2600-monitoring.html?surface=machines (production Machines page plus production-helper classification control; not an application route or removed Machines posture card)",
+ "/browser-tests/pr2600-monitoring.html?surface=debug (production Debug component and derived state; synthetic local evidence)"
+ ],
+ "viewports": [
+ {
+ "width": 1680,
+ "height": 950
+ },
+ {
+ "width": 390,
+ "height": 950
+ }
+ ],
+ "states": [
+ "Playwright 1.56.1 matches integration lock; Chromium 141.0.7390.37 light desktop and WebKit 26.0 dark touch phone. Four exact-parent controls and four repaired groups, ten captures for each, all inspected. Not a physical phone, full application, native collector, guest recovery, installed result, publication or release.",
+ "After the unchanged five-minute report boundary a retained Machines dot turns amber and agrees with the production posture-classification helper and a same-instant remount; the parent retained dot stays green. The current Machines page has no posture card; this fixture does not restore one. Canonical online status/filter counts and agent stale flag are unchanged. Browser host metrics are unavailable in the synthetic REST projection; preservation of actual CPU bars is a component-test control, not a browser claim.",
+ "Quiet clock advancement preserves original snapshot, retained row and focus, without clock-triggered read or write. Ordinary initial canonical REST revalidation and remount reads remain. No unexpected API read, off-origin request, page error, console error or page-level horizontal overflow; browsers and server close."
+ ],
+ "interactions": [
+ "Desktop Enter and phone tap expand the Proxmox source. Numeric/ISO source status records arrive without replacing production-derived payload sections; status, error and last-seen update while section DOM, expansion, focus and original payload remain. Parent summaries retain old status/error despite the arriving record.",
+ "New source timestamps continue ageing. Invalid/withdrawn status records remove obsolete error/age without inventing freshness. The old guest deferral payload is preserved; source status availability is not independent thaw, every-covered writes/liveness or restoration."
+ ]
+}
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx
index 5bc6a86416..0d2d472cd7 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx
@@ -67,22 +67,22 @@ export const ResourceDetailDrawerDebugTab: Component<ResourceDetailDrawerDebugTa
<div class="space-y-2">
<For each={drawer.sourceSections()}>
{(section) => {
- const status = drawer.sourceStatus()[section.id];
- // A silent source keeps the same section mounted. Age its
- // original timestamp without renewing the reading or status.
- const lastSeenText = () => formatRelativeTime(status?.lastSeen, { now: now() });
+ // Status can arrive independently of this retained payload
+ // section. Read it reactively; only age its original timestamp.
+ const status = () => drawer.sourceStatus()[section.id];
+ const lastSeenText = () => formatRelativeTime(status()?.lastSeen, { now: now() });
return (
<details class="rounded-md border border-border bg-surface p-3">
<summary class="flex cursor-pointer list-none items-center justify-between text-sm font-medium text-base-content">
<span>{section.label}</span>
<span class="text-[11px] text-muted">
- {status?.status ?? 'unknown'}
+ {status()?.status ?? 'unknown'}
{lastSeenText() ? ` • ${lastSeenText()}` : ''}
</span>
</summary>
- <Show when={status?.error}>
+ <Show when={status()?.error}>
<div class="mt-2 text-[11px] text-amber-600 dark:text-amber-300">
- {status?.error}
+ {status()?.error}
</div>
</Show>
<pre class="mt-3 max-h-[220px] overflow-auto rounded-md bg-surface p-3 text-[11px] text-base-content">
diff --git a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
index 9285d7a9fa..0432e8a3eb 100644
--- a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
+++ b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
@@ -1568,7 +1568,7 @@ export const AgentsMachinesTable: Component<{
: '';
return `Agent has stopped reporting.${when} Re-run the install command from the Pulse UI to refresh its token.`;
};
- const indicator = () => getStandaloneResourceStatusIndicator(machine);
+ const indicator = () => getStandaloneResourceStatusIndicator(machine, now());
const canRenderMetrics = () => indicator().variant !== 'danger';
const telemetryFallback = () =>
canRenderMetrics()
diff --git a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
index 3533da764c..ba62d323bd 100644
--- a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
+++ b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
@@ -205,6 +205,9 @@ describe('AgentsMachinesTable', () => {
expect(screen.getByTestId('agent-machine-cpu-bar')).toBe(cpu);
expect(cpu).toHaveAttribute('data-usage', '24');
expect(JSON.stringify(machines)).toBe(original);
+ expect(deleteAgentMock).not.toHaveBeenCalled();
+ expect(deleteAgentMetadataMock).not.toHaveBeenCalled();
+ expect(getAllAgentMetadataMock).toHaveBeenCalledTimes(1);
setMounted(false);
setMounted(true);
diff --git a/frontend-modern/src/features/standalone/standalonePageModel.ts b/frontend-modern/src/features/standalone/standalonePageModel.ts
index de353bf940..b784a9a679 100644
--- a/frontend-modern/src/features/standalone/standalonePageModel.ts
+++ b/frontend-modern/src/features/standalone/standalonePageModel.ts
@@ -110,11 +110,18 @@ export function sortStandaloneResourcesByAttention(
resources: readonly Resource[],
nowMs = Date.now(),
): Resource[] {
+ // Clock ticks can re-sort retained resources. Classify each once for this
+ // sort, not twice per comparison, without caching across source updates.
+ const priority = new Map<Resource, number>();
+ for (const resource of resources) {
+ priority.set(
+ resource,
+ ATTENTION_SORT_PRIORITY[getStandaloneResourceStatusIndicator(resource, nowMs).variant],
+ );
+ }
return [...resources].sort((left, right) => {
- const leftPriority =
- ATTENTION_SORT_PRIORITY[getStandaloneResourceStatusIndicator(left, nowMs).variant];
- const rightPriority =
- ATTENTION_SORT_PRIORITY[getStandaloneResourceStatusIndicator(right, nowMs).variant];
+ const leftPriority = priority.get(left)!;
+ const rightPriority = priority.get(right)!;
if (leftPriority !== rightPriority) return leftPriority - rightPriority;
return left.displayName.localeCompare(right.displayName, undefined, { numeric: true });
});