Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Keep backup completion separate from guest safety
pulse-triage[bot]269b9d95baab
diff --git a/frontend-modern/browser-tests/backup-safety.cjs b/frontend-modern/browser-tests/backup-safety.cjsnew file mode 100644index 0000000000..7a652ac50e--- /dev/null+++ b/frontend-modern/browser-tests/backup-safety.cjs@@ -0,0 +1,527 @@+// Read-only synthetic Resources responses consumed by the real production UI.+const assert = require('node:assert/strict');+const crypto = require('node:crypto');+const fs = require('node:fs');+const http = require('node:http');+const path = require('node:path');+const { chromium, webkit } = require('playwright');+const root = '/workspace';+const frontend = path.join(root, 'frontend-modern');+const compiled = path.join(root, 'tmp/backup-safety-static/final');+const output = path.join(root, 'tmp/backup-safety/browser');+const origin = 'http://127.0.0.1:5298';+const hash = (data) => crypto.createHash('sha256').update(data).digest('hex');+const binding = JSON.parse(fs.readFileSync(path.join(compiled, 'binding.json')));+const result = {+ base: '29a8636037e801fff6536cbaef94d3b84ba57df8',+ scope:+ 'Canonical Resources API/useWorkloads -> GuestRow -> both BackupStatusCell disclosures; actual shipped Docs. No guest command, backup, thaw, credential or recovery operation.',+ playwright: require('playwright/package.json').version,+ buildBinding: binding,+ harnessSha256: hash(fs.readFileSync(__filename)),+ results: [],+ requests: [],+ captures: [],+ served: {},+ errors: [],+ cleanup: {},+};+const resource = (vmid, observation = {}) => {+ const name =+ vmid === 101+ ? 'windows-backup-server-with-a-long-name'+ : vmid === 102+ ? 'healthy-peer'+ : vmid === 103+ ? 'linux-container'+ : 'vsphere-control';+ const total = 10 * 1024 ** 3;+ return {+ id: `lab-pve-a-${vmid}`,+ vmid,+ name,+ type: vmid === 103 ? 'system-container' : 'vm',+ status: 'online',+ sources: vmid === 104 ? ['vsphere'] : ['proxmox'],+ platformScopes: vmid === 104 ? ['vmware-vsphere'] : ['proxmox-pve'],+ lastSeen: '2026-10-13T01:00:00Z',+ metrics: {+ cpu: { percent: 10 },+ memory: { percent: 25, used: total / 4, total },+ disk: { percent: 50, used: total / 2, total },+ },+ ...(vmid === 104+ ? {+ vmware: {+ managedObjectId: 'vm-104',+ powerState: 'running',+ runtimeHostName: 'vsphere-a',+ },+ }+ : {+ proxmox: {+ vmid,+ instance: 'lab',+ nodeName: 'pve-a',+ runtimeStatus: 'running',+ lastBackup: '2026-10-13T00:30:00Z',+ backupInProgress: false,+ guestAgentStatus: 'available',+ lock: '',+ diskStatusReason: '',+ ...observation,+ },+ }),+ ...(vmid === 101+ ? {+ agent: {+ agentId: 'synthetic-agent',+ agentVersion: '6.5.0',+ stale: false,+ osName: 'Windows',+ },+ }+ : {}),+ };+};+let server;+let browser;+(async () => {+ fs.mkdirSync(output, { recursive: true });+ assert.equal(+ result.playwright,+ JSON.parse(fs.readFileSync(path.join(root, 'tests/integration/package-lock.json'))).packages[+ 'node_modules/@playwright/test'+ ].version,+ );+ assert.equal(binding.graph, hash(fs.readFileSync(path.join(frontend, 'package-lock.json'))));+ for (const [file, digest] of Object.entries(binding.sources))+ assert.equal(+ hash(fs.readFileSync(path.join(frontend, file))),+ digest,+ `source changed: ${file}`,+ );+ for (const file of [+ 'src/components/Workloads/GuestRow.tsx',+ 'src/components/Workloads/GuestRowCells.tsx',+ 'src/components/Workloads/guestDrawerModel.ts',+ 'src/hooks/useWorkloads.ts',+ 'src/hooks/useUnifiedResources.ts',+ 'src/pages/Docs.tsx',+ ])+ assert(binding.sources[file], `source not compiled: ${file}`);+ const assets = new Map();+ for (const [file, digest] of Object.entries(binding.artifacts)) {+ const bytes = fs.readFileSync(path.join(compiled, file));+ assert.equal(hash(bytes), digest, `artifact changed: ${file}`);+ assets.set('/' + file, bytes);+ }+ server = http.createServer((request, response) => {+ let file = new URL(request.url, origin).pathname;+ if (file === '/docs/VM_DISK_MONITORING') file = '/browser-tests/backup-safety.html';+ const bytes = assets.get(file);+ if (!bytes || !['GET', 'HEAD'].includes(request.method)) {+ response.writeHead(404);+ response.end();+ return;+ }+ result.served[file] = hash(bytes);+ response.writeHead(200, {+ 'Content-Type':+ {+ '.html': 'text/html',+ '.js': 'text/javascript',+ '.css': 'text/css',+ '.md': 'text/markdown',+ }[path.extname(file)] || 'application/octet-stream',+ });+ response.end(request.method === 'HEAD' ? undefined : bytes);+ });+ await new Promise((resolve, reject) => {+ server.once('error', reject);+ server.listen(5298, '127.0.0.1', resolve);+ });+ for (const spec of [+ { name: 'desktop', engine: chromium, width: 1280, height: 900, colorScheme: 'light' },+ { name: 'phone', engine: webkit, width: 375, height: 812, colorScheme: 'dark' },+ ]) {+ browser = await spec.engine.launch(+ spec.engine === chromium+ ? { headless: true, channel: 'chromium', args: ['--no-sandbox'] }+ : { headless: true },+ );+ const page = await browser.newPage({+ viewport: { width: spec.width, height: spec.height },+ hasTouch: spec.name === 'phone',+ isMobile: spec.name === 'phone',+ locale: 'en-GB',+ timezoneId: 'UTC',+ colorScheme: spec.colorScheme,+ });+ page.setDefaultTimeout(12000);+ await page.clock.setFixedTime(new Date('2026-10-13T01:00:00Z'));+ if (spec.colorScheme === 'dark')+ await page.addInitScript(() =>+ document.addEventListener('DOMContentLoaded', () =>+ document.documentElement.classList.add('dark'),+ ),+ );+ let observation = {};+ let primaryPresent = true;+ const checks = [];+ const errors = [];+ const queries = [];+ const evidence = [];+ page.on('pageerror', (error) => errors.push(error.message));+ await page.route('**/*', async (route) => {+ const request = route.request();+ const url = new URL(request.url());+ assert.equal(url.origin, origin, 'no off-origin request');+ if (!url.pathname.startsWith('/api/')) return route.continue();+ assert.equal(request.method(), 'GET', 'no mutating operation');+ let body;+ if (url.pathname === '/api/resources')+ body = {+ data: [+ ...(primaryPresent ? [resource(101, observation)] : []),+ resource(102),+ resource(103, { lock: 'backup', backupInProgress: true, guestAgentStatus: 'deferred' }),+ resource(104),+ ],+ meta: { totalPages: 1 },+ };+ else if (url.pathname === '/api/license/runtime-capabilities')+ body = { plan: 'free', capabilities: {}, features: [] };+ else if (url.pathname === '/api/alerts/activation') body = { enabled: false };+ else if (url.pathname === '/api/alerts/config')+ body = { guestDefaults: {}, hostDefaults: {} };+ else if (url.pathname === '/api/alerts/active') body = [];+ else if (url.pathname === '/api/ai/intelligence/anomalies')+ body = { anomalies: [], count: 0 };+ else if (url.pathname.startsWith('/api/guests/metadata/')) body = { customUrl: '' };+ else if (+ url.pathname.startsWith('/api/resources/') &&+ url.pathname.endsWith('/operator-state')+ )+ body = { configured: false, state: null };+ else {+ throw new Error(`unmatched API read: ${url.pathname}`);+ }+ queries.push(url.pathname);+ result.requests.push({+ browser: spec.name,+ path: url.pathname,+ method: request.method(),+ bodySha256: hash(JSON.stringify(body)),+ ...(url.pathname === '/api/resources' ? { body } : {}),+ });+ await route.fulfill({ json: body });+ });+ await page.goto(origin + '/browser-tests/backup-safety.html');+ const row = page.getByRole('region', { name: 'Guest 101 row' });+ const badge = row.getByRole('button', { name: /^Backup status:/ });+ const dialog = page.getByRole('dialog', { name: /^Backup status details for windows-backup/ });+ const close = () => dialog.getByRole('button', { name: 'Close backup details' });+ const activate = (element) => (spec.name === 'phone' ? element.tap() : element.click());+ const settle = async () => {+ await dialog.waitFor({ state: 'visible' });+ await dialog.evaluate(async (el) => {+ await Promise.all(+ el+ .getAnimations({ subtree: true })+ .filter((animation) => Number.isFinite(animation.effect?.getTiming().iterations))+ .map((animation) => animation.finished.catch(() => {})),+ );+ });+ const rect = await dialog.boundingBox();+ assert(+ rect.x >= 0 &&+ rect.y >= 0 &&+ rect.x + rect.width <= spec.width &&+ rect.y + rect.height <= spec.height,+ 'settled dialog fits viewport',+ );+ assert.equal(+ await page.evaluate(() => window.__backupSafety.actions()),+ 0,+ 'evidence disclosure never dispatches row action',+ );+ };+ const capture = async (state) => {+ const file = path.join(output, `${spec.name}-${state}.png`);+ await page.screenshot({ path: file, fullPage: false });+ result.captures.push({+ path: path.relative(root, file),+ sha256: hash(fs.readFileSync(file)),+ bytes: fs.statSync(file).size,+ state,+ browser: spec.name,+ });+ };+ const refetch = async (value) => {+ observation = value;+ await page.evaluate(() => window.__backupSafety.refetch());+ evidence.push(await page.evaluate(() => window.__backupSafety.evidence()));+ };+ const noExtraReads = async (action) => {+ const before = queries.length;+ await action();+ assert.equal(queries.length, before, 'disclosing retained evidence adds no API read');+ };+ await badge.waitFor();+ assert.equal((await badge.innerText()).trim(), '', 'fresh badge remains compact');+ if (spec.name === 'desktop') {+ await page.keyboard.press('Tab'); // existing column control+ await page.keyboard.press('Tab'); // row disclosure+ await page.keyboard.press('Tab'); // backup evidence+ assert(await badge.evaluate((el) => document.activeElement === el));+ await noExtraReads(() => page.keyboard.press('Enter'));+ checks.push('sequential Tab/Enter discloses backup, not row');+ } else {+ const rect = await badge.boundingBox();+ assert(rect.height >= 44 && rect.width >= 44);+ await noExtraReads(() => activate(badge));+ checks.push('ordinary first tap on 44px badge discloses backup, not row');+ }+ await settle();+ await dialog.getByText('Guest-agent reads: Reported available', { exact: true }).waitFor();+ assert(+ (await dialog.innerText()).includes(+ 'does not independently confirm thaw or filesystem writes',+ ),+ );+ assert.equal(await dialog.getByRole('link').count(), 0);+ const time = await dialog.locator('time').getAttribute('datetime');+ assert.equal(time, '2026-10-13T00:30:00.000Z');+ await capture('available');+ checks.push('fresh completion and reported availability remain distinct from thaw/write proof');+ await refetch({+ lock: 'backup',+ backupInProgress: true,+ guestAgentStatus: 'available',+ diskStatusReason: 'prev-vm-locked',+ });+ await dialog.getByText('Guest-agent reads: Deferred', { exact: true }).waitFor();+ await settle();+ assert(+ (await dialog.innerText()).includes('An OK backup or a running VM does not prove thaw.'),+ );+ assert.equal(await dialog.locator('time').getAttribute('datetime'), time);+ assert(+ (await dialog.innerText()).includes('Using last known disk stats.') === false,+ 'the caution is about current requests, not inherited disk figures',+ );+ await capture('locked');+ checks.push('same open disclosure follows lock and running backup without renewing completion');+ if (spec.name === 'desktop') {+ await close().click();+ await dialog.waitFor({ state: 'hidden' });+ await badge.hover();+ const tooltip = page.locator('[data-tooltip-portal="true"]');+ await tooltip.waitFor({ state: 'visible' });+ assert(+ (await tooltip.innerText()).includes('An OK backup or a running VM does not prove thaw.'),+ );+ assert.equal(+ await tooltip.getByRole('link').count(),+ 0,+ 'hover has no unreachable interaction',+ );+ const rect = await tooltip.boundingBox();+ assert(+ rect.x >= 0 &&+ rect.y >= 0 &&+ rect.x + rect.width <= spec.width &&+ rect.y + rect.height <= spec.height,+ 'safety hover fits viewport',+ );+ await capture('hover-locked');+ await activate(badge);+ await settle();+ checks.push(+ 'fine-pointer hover preserves the same precaution, without a dead interactive link',+ );+ }++ // Follow the actual existing guidance link through the shipped Docs renderer.+ const link = dialog.getByRole('link', { name: 'Backup safety guidance' });+ assert.equal(await link.getAttribute('href'), '/docs/VM_DISK_MONITORING');+ if (spec.name === 'desktop') {+ await close().focus();+ await page.keyboard.press('Tab');+ assert(await link.evaluate((el) => document.activeElement === el));+ await page.keyboard.press('Enter');+ } else await link.tap();+ await page.waitForURL(origin + '/docs/VM_DISK_MONITORING');+ await page.getByRole('heading', { name: 'Backup safety', exact: true }).waitFor();+ assert(+ (await page.locator('main').innerText()).includes(+ 'Pulse monitoring and alerts are unavailable while it',+ ),+ );+ assert((await page.locator('main').innerText()).includes('does not prove thaw succeeded'));+ assert.equal(await page.locator('[data-dialog-layer]').count(), 0);+ await page+ .getByRole('heading', { name: 'Backup safety', exact: true })+ .scrollIntoViewIfNeeded();+ await capture('guidance');+ checks.push(+ 'keyboard/touch link opens actual shipped safety guidance and releases dialog isolation',+ );+ await page.goBack();+ await badge.waitFor();+ await activate(badge);+ await settle();+ // A fresh backup/absent lock/reporting agent must not clear uncertain request completion.+ await refetch({+ lock: '',+ backupInProgress: false,+ guestAgentStatus: 'available',+ diskStatusReason: 'prev-agent-timeout',+ });+ await dialog.getByText(/Guest request timed out\. Completion is uncertain\./).waitFor();+ assert(+ (await dialog.innerText()).includes(+ 'Confirm thaw and writes to the filesystems covered by the backup independently.',+ ),+ );+ assert.equal(await dialog.locator('time').getAttribute('datetime'), time);+ const mapped = await page.evaluate(() => window.__backupSafety.evidence());+ assert.equal(mapped.agentKind, 'pulse');+ assert.equal(mapped.agentStale, undefined); // the adapter omits a false stale flag+ assert.equal(mapped.agentVersion, '6.5.0');+ await settle();+ await capture('uncertain');+ checks.push('unlocked fresh backup plus reporting Pulse Agent cannot erase QGA uncertainty');+ await noExtraReads(() => page.keyboard.press('Escape'));+ await dialog.waitFor({ state: 'hidden' });+ assert(await badge.evaluate((el) => document.activeElement === el));+ await page.getByRole('button', { name: 'Hide Backup column' }).click();+ const indicator = row.getByRole('button', { name: /^Last backup:/ });+ await noExtraReads(() => activate(indicator));+ await settle();+ assert((await dialog.innerText()).includes('Completion is uncertain.'));+ assert.equal(await dialog.locator('time').getAttribute('datetime'), time);+ await capture('hidden-column');+ checks.push(+ 'hidden-column shield shows identical safety/completion evidence without row dispatch',+ );+ await refetch({+ guestAgentStatus: 'https://synthetic.invalid/private=fixture',+ diskStatusReason: 'unrecognised-fixture-reason',+ });+ await dialog.getByText('Guest-agent reads: Unknown', { exact: true }).waitFor();+ assert(!(await dialog.innerText()).includes('synthetic.invalid'));+ assert(!(await dialog.innerText()).includes('unrecognised-fixture-reason'));+ assert(!(await dialog.innerText()).includes('Completion is uncertain.'));+ await refetch({ guestAgentStatus: 'available', diskStatusReason: '' });+ await dialog.getByText('Guest-agent reads: Reported available', { exact: true }).waitFor();+ assert.equal(await dialog.getByRole('link').count(), 0);+ assert(!(await dialog.innerText()).includes('Completion is uncertain.'));+ checks.push(+ 'unknown raw values stay private; replacement availability withdraws old caution, never proves thaw',+ );+ await activate(close());+ await dialog.waitFor({ state: 'hidden' });+ assert(await indicator.evaluate((el) => document.activeElement === el));+ const peer = page+ .getByRole('region', { name: 'Guest 102 row' })+ .getByRole('button', { name: /^Last backup:/ });+ await activate(peer);+ const peerDialog = page.getByRole('dialog', { name: 'Backup status details for healthy-peer' });+ await peerDialog.getByText('Guest-agent reads: Reported available', { exact: true }).waitFor();+ assert(!(await peerDialog.innerText()).includes('Completion is uncertain.'));+ await peerDialog.getByRole('button', { name: 'Close backup details' }).click();+ const container = page+ .getByRole('region', { name: 'Guest 103 row' })+ .getByRole('button', { name: /^Backup running now/ });+ await activate(container);+ const ctDialog = page.getByRole('dialog', {+ name: 'Backup status details for linux-container',+ });+ await ctDialog.waitFor();+ assert(!(await ctDialog.innerText()).includes('Guest-agent reads:'));+ await ctDialog.getByRole('button', { name: 'Close backup details' }).click();+ assert.equal(+ await page+ .getByRole('region', { name: 'Guest 104 row' })+ .getByRole('button', { name: /backup/i })+ .count(),+ 0,+ );+ checks.push('peer, LXC and vSphere retain independent interpretation and provider scope');+ await activate(indicator);+ await settle();+ primaryPresent = false;+ await page.evaluate(() => window.__backupSafety.refetch());+ await dialog.waitFor({ state: 'hidden' });+ assert.equal(await page.locator('[data-dialog-layer]').count(), 0);+ assert.equal(+ await page.locator('main').evaluate((el) => el.closest('body > *').hasAttribute('inert')),+ false,+ );+ assert.equal(await page.evaluate(() => document.body.style.overflow), '');+ checks.push('resource removal unmounts disclosure and restores background scrolling/inertness');+ assert.equal(await page.evaluate(() => window.__backupSafety.actions()), 0);+ await page+ .getByRole('region', { name: 'Guest 102 row' })+ .getByText('healthy-peer', { exact: true })+ .click();+ assert.equal(await page.evaluate(() => window.__backupSafety.actions()), 1);+ assert.deepEqual(errors, []);+ assert(+ !queries.some((query) => /\/agent|probe|diagnostic|backup|history/.test(query)),+ 'no collector, history or live-probe reads',+ );+ assert(+ await page.locator('main').evaluate((el) => el.scrollWidth <= window.innerWidth),+ 'no horizontal overflow',+ );+ result.results.push({+ name: spec.name,+ browser: browser.version(),+ viewport: { width: spec.width, height: spec.height },+ colorScheme: spec.colorScheme,+ checks,+ mappedEvidence: evidence,+ queries,+ errors,+ });+ await page.close();+ await browser.close();+ browser = undefined;+ }+ result.result = 'passed';+})()+ .catch(async (error) => {+ result.result = 'failed';+ result.errors.push(error.stack || String(error));+ process.exitCode = 1;+ if (browser) {+ const pages = browser.contexts().flatMap((context) => context.pages());+ if (pages[0])+ await pages[0]+ .screenshot({ path: path.join(output, 'failure.png'), fullPage: true })+ .catch(() => {});+ }+ })+ .finally(async () => {+ if (browser) await browser.close();+ result.cleanup.browserClosed = true;+ if (server)+ await new Promise((resolve, reject) =>+ server.close((error) => (error ? reject(error) : resolve())),+ );+ result.cleanup.serverClosed = true;+ fs.writeFileSync(path.join(output, 'result.json'), JSON.stringify(result, null, 2) + '\n');+ console.log(+ JSON.stringify({+ result: result.result,+ viewports: result.results.length,+ checks: result.results.reduce((count, entry) => count + entry.checks.length, 0),+ captures: result.captures.length,+ errors: result.errors,+ cleanup: result.cleanup,+ }),+ );+ });diff --git a/frontend-modern/browser-tests/backup-safety.html b/frontend-modern/browser-tests/backup-safety.htmlnew file mode 100644index 0000000000..86d66d68a8--- /dev/null+++ b/frontend-modern/browser-tests/backup-safety.html@@ -0,0 +1,12 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Backup guest-safety verification</title>+ </head>+ <body>+ <div id="root"></div>+ <script type="module" src="./backup-safety.tsx"></script>+ </body>+</html>diff --git a/frontend-modern/browser-tests/backup-safety.tsx b/frontend-modern/browser-tests/backup-safety.tsxnew file mode 100644index 0000000000..c8228c6f08--- /dev/null+++ b/frontend-modern/browser-tests/backup-safety.tsx@@ -0,0 +1,101 @@+// Canonical Resources API -> useWorkloads -> production row and backup disclosure.+// Synthetic observations only: no backup, guest request, thaw or recovery action.+import { createSignal, For, Show } from 'solid-js';+import { render } from 'solid-js/web';+import { Router, Route } from '@solidjs/router';+import { useWorkloads } from '../src/hooks/useWorkloads';+import { GuestRow } from '../src/components/Workloads/GuestRow';+import { GuestDrawer } from '../src/components/Workloads/GuestDrawer';+import Docs from '../src/pages/Docs';+import { DarkModeContext } from '../src/contexts/appRuntime';+import '../src/index.css';++function Fixture() {+ const state = useWorkloads(() => true);+ const [showBackup, setShowBackup] = createSignal(true);+ const [actions, setActions] = createSignal(0);+ const [expanded, setExpanded] = createSignal(false);+ const primary = () => state.workloads().find((guest) => guest.vmid === 101);+ const layout = window.innerWidth <= 768 ? 'phone' : 'wide';+ (window as any).__backupSafety = {+ refetch: state.refetch,+ evidence: () => primary(),+ actions,+ expanded,+ };+ return (+ <main class="min-h-screen space-y-3 bg-surface p-3 text-base-content pulse-wide-data-surface">+ <h1 class="text-base font-semibold">Backup completion and guest safety</h1>+ <p class="text-xs text-muted">Synthetic resource observations; no guest commands.</p>+ <button+ class="min-h-11 rounded-sm border border-border px-3 text-xs"+ onClick={() => setShowBackup(!showBackup())}+ >+ {showBackup() ? 'Hide Backup column' : 'Show Backup column'}+ </button>+ <For each={[101, 102, 103, 104]}>+ {(vmid) => {+ const guest = () => state.workloads().find((value) => value.vmid === vmid);+ return (+ <Show when={guest()}>+ <section aria-label={`Guest ${vmid} row`}>+ <table class="w-full table-fixed workload-table">+ <tbody>+ <GuestRow+ guest={guest()!}+ visibleColumnIds={showBackup() ? ['name', 'backup'] : ['name']}+ workloadTableLayoutMode={layout}+ isExpanded={vmid === 101 && expanded()}+ onClick={() => {+ setActions((value) => value + 1);+ if (vmid === 101) setExpanded((value) => !value);+ }}+ />+ </tbody>+ </table>+ </section>+ </Show>+ );+ }}+ </For>+ <Show when={expanded() && primary()}>+ <section aria-label="Guest details">+ <GuestDrawer guest={primary()!} onClose={() => setExpanded(false)} />+ </section>+ </Show>+ <p role="status" aria-label="Row action count">+ {actions()}+ </p>+ </main>+ );+}+const WithDarkMode = (props: { children: any }) => (+ <DarkModeContext.Provider value={() => document.documentElement.classList.contains('dark')}>+ {props.children}+ </DarkModeContext.Provider>+);+render(+ () => (+ <Router>+ <Route+ path="/docs/*docPath"+ component={() => (+ <WithDarkMode>+ <main class="min-h-screen bg-surface p-3 text-base-content">+ <Docs />+ </main>+ </WithDarkMode>+ )}+ />+ <Route+ path="*"+ component={() => (+ <WithDarkMode>+ <Fixture />+ </WithDarkMode>+ )}+ />+ </Router>+ ),+ document.getElementById('root')!,+);diff --git a/frontend-modern/browser-tests/build-backup-safety.mjs b/frontend-modern/browser-tests/build-backup-safety.mjsnew file mode 100644index 0000000000..da21a3e819--- /dev/null+++ b/frontend-modern/browser-tests/build-backup-safety.mjs@@ -0,0 +1,92 @@+// Compile the real backup-safety fixture before bounded browser execution.+// Only a bounded static preview runs in the browser tree; no live compiler or guest command.+import { build } from 'vite';+import solid from 'vite-plugin-solid';+import tailwindcss from '@tailwindcss/vite';+import { stop } from 'esbuild';+import fs from 'node:fs';+import path from 'node:path';+import crypto from 'node:crypto';+import { fileURLToPath } from 'node:url';++const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const output = path.resolve(root, '../tmp/backup-safety-static');+const hash = (data) => crypto.createHash('sha256').update(data).digest('hex');++try {+ for (const variant of ['final']) {+ const sources = {};+ const artifacts = {};+ const outDir = path.join(output, variant);+ await build({+ root,+ // Root-relative assets keep the real shipped Docs viewer functional in a new tab.+ base: '/',+ configFile: false,+ publicDir: false,+ plugins: [+ {+ name: 'exact-backup-safety-fixture-binding',+ enforce: 'pre',+ generateBundle(_options, bundle) {+ for (const id of this.getModuleIds()) {+ if (!id.startsWith(root + '/') || id.includes('/node_modules/')) continue;+ const file = id.split('?')[0];+ if (!fs.existsSync(file) || !fs.statSync(file).isFile()) continue;+ sources[path.relative(root, file)] = hash(fs.readFileSync(file));+ }+ for (const [file, asset] of Object.entries(bundle)) {+ artifacts[file] = hash(asset.type === 'chunk' ? asset.code : asset.source);+ }+ },+ },+ tailwindcss(),+ solid(),+ ],+ resolve: {+ alias: { '@': path.join(root, 'src') },+ conditions: ['import', 'browser', 'default'],+ },+ build: {+ // Match the application's declared target, not Vite's older default.+ target: 'esnext',+ outDir,+ emptyOutDir: true,+ rollupOptions: { input: path.join(root, 'browser-tests/backup-safety.html') },+ },+ });+ const doc = 'public/docs/VM_DISK_MONITORING.md';+ const docBytes = fs.readFileSync(path.join(root, doc));+ sources[doc] = hash(docBytes);+ fs.mkdirSync(path.join(outDir, 'docs'), { recursive: true });+ fs.writeFileSync(path.join(outDir, 'docs/VM_DISK_MONITORING.md'), docBytes);+ sources['browser-tests/build-backup-safety.mjs'] = hash(+ fs.readFileSync(fileURLToPath(import.meta.url)),+ );+ // Hash the bytes actually written, including HTML post-processing.+ const walk = (dir) => {+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {+ const file = path.join(dir, entry.name);+ if (entry.isDirectory()) walk(file);+ else artifacts[path.relative(outDir, file)] = hash(fs.readFileSync(file));+ }+ };+ walk(outDir);+ fs.writeFileSync(+ path.join(outDir, 'binding.json'),+ JSON.stringify(+ {+ variant,+ graph: hash(fs.readFileSync(path.join(root, 'package-lock.json'))),+ builder: hash(fs.readFileSync(fileURLToPath(import.meta.url))),+ sources,+ artifacts,+ },+ null,+ 2,+ ) + '\n',+ );+ }+} finally {+ stop();+}diff --git a/frontend-modern/browser-verification/2836211f340dabc5.json b/frontend-modern/browser-verification/2836211f340dabc5.jsonnew file mode 100644index 0000000000..ef1b5d65cd--- /dev/null+++ b/frontend-modern/browser-verification/2836211f340dabc5.json@@ -0,0 +1,68 @@+{+ "version": 1,+ "result": "passed",+ "base_sha": "29a8636037e801fff6536cbaef94d3b84ba57df8",+ "changed_paths": [+ "frontend-modern/src/components/Workloads/GuestRow.tsx",+ "frontend-modern/src/components/Workloads/GuestRowCells.tsx"+ ],+ "content_sha256": {+ "frontend-modern/src/components/Workloads/GuestRow.tsx": "da2faa0ffa15f32c80d44bcaedf573dc65557218038527e33c4cbe33cb820c6c",+ "frontend-modern/src/components/Workloads/GuestRowCells.tsx": "9c370f674e0982a46029442539758faa58f980f8b7771b3294f6176da29cf7bd"+ },+ "routes": [+ "/browser-tests/backup-safety.html (canonical Resources API/useWorkloads to production Workloads row/backup disclosure)",+ "/docs/VM_DISK_MONITORING"+ ],+ "states": [+ "Fresh completed backup and reported QGA availability do not confirm thaw/writes",+ "Current backup lock/running status over existing completed backup",+ "Absent lock and fresh backup with uncertain QGA completion, alongside reporting Pulse Agent",+ "Unknown raw read values, subsequent availability and original caution withdrawal",+ "Same evidence via hidden Backup column shield",+ "Independent healthy peer, LXC and vSphere controls",+ "Primary resource removal"+ ],+ "interactions": [+ "Desktop sequential Tab/Enter; narrow WebKit first tap on backup badge",+ "Fine-pointer hover carries same precaution with no interactive link in tooltip",+ "Same open disclosure responds to explicit synthetic API refresh without renewing completion",+ "Escape/Close return focus; disclosure adds no API reads or guest commands",+ "Actual keyboard/touch safety link opens shipped Docs and releases dialog isolation",+ "Hidden-column shield discloses current safety context without opening enclosing row",+ "Removal restores scroll/inertness; ordinary row action remains separate"+ ],+ "viewports": [+ {+ "width": 1280,+ "height": 900,+ "browser": "Chromium",+ "color_scheme": "light"+ },+ {+ "width": 375,+ "height": 812,+ "browser": "WebKit",+ "color_scheme": "dark",+ "has_touch": true+ }+ ],+ "verified_at": "2026-10-13T01:03:13.378294Z",+ "playwright_version": "1.56.1",+ "checks": 19,+ "pixel_review": "All eleven final viewport captures opened with native view_image; completion/state/caution remain distinct and legible, tooltip and narrow dialog fit, and safety guidance wraps without horizontal overflow.",+ "capture_sha256": {+ "desktop-available.png": "2bd23f6bb249e65bbc901a1069376ef218bfd4e613aadbe93ac6f1a03b757db5",+ "desktop-locked.png": "b856f207629fef98b24bf7376469027fadee3e60aa0eeb35886e1411b2bb218d",+ "desktop-hover-locked.png": "0ed6672304a5cb1aa8c324c252b76018172051dc7b575a6896bfce19957582ea",+ "desktop-guidance.png": "fe52c748d2473a951cfdd826317d1d0c81ea3a1b98f1f83966900d020fad3109",+ "desktop-uncertain.png": "525a86bd903df72053a30a95c4a067b2d867a4fe527bd4c12dfb068c2f60e51a",+ "desktop-hidden-column.png": "9fafaaec72013b9b2ff1d40fe2bacc5a0e00d38abda5a312f6e4a1ccda3f0655",+ "phone-available.png": "c71eb742e10fc6165f347df102d6a2f46d9e96d80775300a0cf7f6723ee6224a",+ "phone-locked.png": "440f1848d7209966caa248117b68b534ec0371dfe54f064e6a712f060611c9a6",+ "phone-guidance.png": "bd6b4b3d65e3df647d8fcdd6c49377751fd77e3b4e544d798a6ad03fd5296982",+ "phone-uncertain.png": "7a0b02a55f4252a0ebcf7e9ab2e691a9c9e47f2ba7b3df74571ebdc71ceb5445",+ "phone-hidden-column.png": "f0ab46395100856514a6eb61014d5f406bf2058361a3a4d956de558259a707ff"+ },+ "scope_limit": "Synthetic frontend presentation, not native guest recovery, independent thaw, first-party provider or published/released availability."+}diff --git a/frontend-modern/src/components/Workloads/GuestRow.tsx b/frontend-modern/src/components/Workloads/GuestRow.tsxindex 9a2053c3cb..d0c3c2637c 100644--- a/frontend-modern/src/components/Workloads/GuestRow.tsx+++ b/frontend-modern/src/components/Workloads/GuestRow.tsx@@ -448,6 +448,7 @@ export function GuestRow(props: GuestRowProps) {lastBackup={props.guest.lastBackup}isTemplate={props.guest.template}backupRunning={props.guest.backupInProgress}+ guestReadEvidence={props.guest}/></Show><Show when={nestedWorkloadCueLabel()}>@@ -885,6 +886,7 @@ export function GuestRow(props: GuestRowProps) {guestName={props.guest.name}lastBackup={props.guest.lastBackup}backupRunning={props.guest.backupInProgress}+ guestReadEvidence={props.guest}/></Show><Show when={props.guest.template}>diff --git a/frontend-modern/src/components/Workloads/GuestRowCells.tsx b/frontend-modern/src/components/Workloads/GuestRowCells.tsxindex f6f1c1cc18..f6cfbaca44 100644--- a/frontend-modern/src/components/Workloads/GuestRowCells.tsx+++ b/frontend-modern/src/components/Workloads/GuestRowCells.tsx@@ -1,6 +1,13 @@import { createMemo, createSignal, For, Show } from 'solid-js';import { Dialog } from '@/components/shared/Dialog';+import { getShippedDocUrl } from '@/utils/docsLinks';+import {+ GUEST_DRAWER_BACKUP_PRECAUTION,+ getGuestDrawerGuestReadPrecaution,+ getGuestDrawerGuestReadPresentation,+ type GuestDrawerGuestReadEvidence,+} from './guestDrawerModel';import { TooltipPortal } from '@/components/shared/TooltipPortal';import { useTooltip } from '@/hooks/useTooltip';@@ -57,6 +64,7 @@ function BackupIndicator(props: {isTemplate: boolean;guestName?: string;backupRunning?: boolean;+ guestReadEvidence?: GuestDrawerGuestReadEvidence;}) {if (props.isTemplate) return null;@@ -65,6 +73,7 @@ function BackupIndicator(props: {lastBackup={props.lastBackup}backupRunning={props.backupRunning}guestName={props.guestName}+ guestReadEvidence={props.guestReadEvidence}indicator/>);@@ -319,6 +328,7 @@ function BackupStatusCell(props: {backupRunning?: boolean;indicator?: boolean;guestName?: string;+ guestReadEvidence?: GuestDrawerGuestReadEvidence;}) {const now = useRelativeTimeNow();const tip = useTooltip();@@ -371,7 +381,14 @@ function BackupStatusCell(props: {// Both entry points reveal the same retained completion evidence. Hover// stays a shortcut on a fine pointer; the native button opens a read-only// dialog for keyboard/touch without stealing the enclosing row action.- const Evidence = () => (+ // Backup completion and current guest-read state are separate evidence.+ // Reuse the drawer's allowlisted interpretation; never infer thaw from a+ // fresh timestamp, retained metadata or a reporting Pulse Agent.+ const guestReadPresentation = () =>+ props.guestReadEvidence ? getGuestDrawerGuestReadPresentation(props.guestReadEvidence) : null;+ const guestReadPrecaution = () =>+ props.guestReadEvidence ? getGuestDrawerGuestReadPrecaution(props.guestReadEvidence) : null;+ const Evidence = (evidenceProps: { dialog?: boolean }) => (<div class="space-y-2 text-xs"><Show when={props.guestName}><p class="font-medium text-base-content wrap-break-word">{props.guestName}</p>@@ -403,6 +420,39 @@ function BackupStatusCell(props: {: 'No backup has ever been recorded for this guest.'}</p></Show>+ <Show when={guestReadPresentation()}>+ {(reading) => (+ <div class="space-y-2 border-t border-border pt-2" data-backup-guest-read-evidence>+ <p+ class={+ reading().tone === 'warning'+ ? 'font-medium text-amber-700 dark:text-amber-300'+ : 'font-medium text-base-content'+ }+ >+ Guest-agent reads: {reading().label}+ </p>+ <p class="whitespace-normal wrap-break-word leading-relaxed text-base-content">+ {guestReadPrecaution() || reading().detail}+ </p>+ <Show when={reading().precaution}>+ <p class="whitespace-normal wrap-break-word leading-relaxed text-base-content">+ {GUEST_DRAWER_BACKUP_PRECAUTION}+ </p>+ {/* A hover tooltip is not an interactive surface. The same+ read-only guidance is reachable by keyboard/touch here. */}+ <Show when={evidenceProps.dialog}>+ <a+ href={getShippedDocUrl('VM_DISK_MONITORING.md')}+ class="inline-flex min-h-6 items-center font-medium text-blue-600 dark:text-blue-400 underline underline-offset-2 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-500"+ >+ Backup safety guidance+ </a>+ </Show>+ </Show>+ </div>+ )}+ </Show></div>);const focusClass =@@ -469,7 +519,7 @@ function BackupStatusCell(props: {</button></div><div class="overflow-y-auto p-4">- <Evidence />+ <Evidence dialog /></div></Dialog></Show>diff --git a/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsxindex 2f9afa1007..6eb1bd0ac0 100644--- a/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx+++ b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx@@ -1,9 +1,10 @@import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';-import { render, screen, fireEvent, cleanup } from '@solidjs/testing-library';+import { render, screen, fireEvent, cleanup, within } from '@solidjs/testing-library';import { createSignal } from 'solid-js';import type { WorkloadGuest } from '@/types/workloads';import type { Memory, Disk } from '@/types/api';import { guestDiskDeferrals } from '../__fixtures__/guestDiskDeferrals';+import { GUEST_DRAWER_BACKUP_PRECAUTION } from '../guestDrawerModel';// ── Hoisted mocks ──────────────────────────────────────────────────────@@ -3243,3 +3244,167 @@ describe('GuestRow accessible reading explanations', () => {expect(screen.queryByRole('dialog')).toBeNull();});});++describe('backup disclosures keep completion separate from guest safety', () => {+ const backup = Date.now() - 3600_000;++ function openBackup(backupColumn: boolean) {+ fireEvent.click(+ screen.getByRole('button', { name: backupColumn ? /^Backup status:/ : /^Last backup:/ }),+ );+ return screen.getByRole('dialog');+ }++ it.each([true, false])(+ 'keeps the same open evidence truthful through lock, uncertain completion and recovery, column=%s',+ (backupColumn) => {+ const onClick = vi.fn();+ const [guest, setGuest] = createSignal(+ makeGuest({ lastBackup: backup, guestAgentStatus: 'available', agentVersion: '9.2' }),+ );+ render(() => (+ <table>+ <tbody>+ <GuestRow+ guest={guest()}+ visibleColumnIds={backupColumn ? ['name', 'backup'] : ['name']}+ onClick={onClick}+ />+ </tbody>+ </table>+ ));+ const dialog = openBackup(backupColumn);+ expect(dialog).toHaveTextContent('Last completed backup');+ expect(dialog).toHaveTextContent('Guest-agent reads: Reported available');+ expect(dialog).toHaveTextContent('does not independently confirm thaw or filesystem writes');+ expect(within(dialog).queryByRole('link')).toBeNull();++ setGuest({+ ...guest(),+ lock: 'backup',+ backupInProgress: true,+ diskStatusReason: 'prev-vm-locked',+ });+ expect(screen.getByRole('dialog')).toBe(dialog);+ expect(dialog).toHaveTextContent('Backup running now');+ expect(dialog).toHaveTextContent('Guest-agent reads: Deferred');+ expect(dialog).toHaveTextContent(+ 'Guest reads paused while Proxmox reports a VM operation lock',+ );+ expect(dialog).toHaveTextContent(GUEST_DRAWER_BACKUP_PRECAUTION);+ expect(dialog).not.toHaveTextContent('Reported available');+ expect(within(dialog).getByRole('link', { name: 'Backup safety guidance' })).toHaveAttribute(+ 'href',+ '/docs/VM_DISK_MONITORING',+ );++ // An unlocked VM and fresh backup are not evidence that an uncertain+ // guest request completed. A reporting Pulse Agent cannot clear it.+ setGuest({+ ...guest(),+ lock: '',+ backupInProgress: false,+ diskStatusReason: 'prev-agent-timeout',+ agentKind: 'pulse',+ agentVersion: '6.5.0',+ agentStale: false,+ });+ expect(dialog).toHaveTextContent('Guest request timed out. Completion is uncertain.');+ expect(dialog).toHaveTextContent(GUEST_DRAWER_BACKUP_PRECAUTION);+ expect(dialog).toHaveTextContent('Last completed backup');+ expect(dialog).not.toHaveTextContent('VM operation lock');++ setGuest({ ...guest(), diskStatusReason: '', guestAgentStatus: 'available' });+ expect(dialog).toHaveTextContent('Guest-agent reads: Reported available');+ expect(dialog).not.toHaveTextContent('timed out');+ expect(dialog).not.toHaveTextContent(GUEST_DRAWER_BACKUP_PRECAUTION);+ expect(within(dialog).queryByRole('link')).toBeNull();+ expect(onClick).not.toHaveBeenCalled();+ },+ );++ it.each(guestDiskDeferrals)(+ 'carries the existing allowlisted %s precaution into backup evidence',+ (reason, detail) => {+ renderGuestRow({+ guest: makeGuest({+ lastBackup: backup,+ guestAgentStatus: 'deferred',+ diskStatusReason: reason,+ }),+ visibleColumnIds: ['name', 'backup'],+ });+ const dialog = openBackup(true);+ expect(dialog).toHaveTextContent(detail);+ expect(dialog).toHaveTextContent(GUEST_DRAWER_BACKUP_PRECAUTION);+ },+ );++ it.each([+ 'available',+ 'expected-unreachable',+ 'not-running',+ 'disabled',+ 'unrecognised-private-value',+ '',+ ])(+ 'shows the recognised interpretation of %s, never raw unknown state or a health verdict',+ (state) => {+ renderGuestRow({+ guest: makeGuest({ lastBackup: backup, guestAgentStatus: state, agentVersion: '9.2' }),+ visibleColumnIds: ['name', 'backup'],+ });+ const dialog = openBackup(true);+ expect(dialog).toHaveTextContent('Guest-agent reads:');+ expect(dialog).not.toHaveTextContent('unrecognised-private-value');+ expect(dialog).not.toHaveTextContent('Guest agent connected');+ expect(dialog).not.toHaveTextContent(GUEST_DRAWER_BACKUP_PRECAUTION);+ },+ );++ it.each(['lxc', 'vm'] as const)(+ 'does not fabricate QEMU read state for a %s non-QEMU control',+ (type) => {+ renderGuestRow({+ guest: makeGuest({+ lastBackup: backup,+ type,+ platformType: type === 'vm' ? 'vmware-vsphere' : 'proxmox-pve',+ platformScopes: type === 'vm' ? ['vmware-vsphere'] : ['proxmox-pve'],+ lock: 'backup',+ agentKind: 'pulse',+ agentVersion: '6.5.0',+ }),+ visibleColumnIds: ['name', 'backup'],+ });+ if (type === 'vm') {+ expect(screen.queryByRole('button', { name: /^Backup status:/ })).toBeNull();+ return;+ }+ const dialog = openBackup(true);+ expect(dialog).toHaveTextContent('Last completed backup');+ expect(dialog).not.toHaveTextContent('Guest-agent reads:');+ expect(dialog).not.toHaveTextContent(GUEST_DRAWER_BACKUP_PRECAUTION);+ },+ );++ it.each([0, NaN, Date.now() + 86400_000])(+ 'keeps a precaution independent of missing or uncertain backup evidence %s',+ (lastBackup) => {+ renderGuestRow({+ guest: makeGuest({+ lastBackup,+ guestAgentStatus: 'deferred',+ diskStatusReason: 'lock-unverified',+ }),+ visibleColumnIds: ['name', 'backup'],+ });+ const trigger = screen.getByRole('button', { name: /^Backup status:/ });+ fireEvent.click(trigger);+ const dialog = screen.getByRole('dialog');+ expect(dialog).not.toHaveTextContent('Last completed backup');+ expect(dialog).toHaveTextContent('Pulse cannot verify that the VM is unlocked');+ expect(dialog).toHaveTextContent(GUEST_DRAWER_BACKUP_PRECAUTION);+ },+ );+});