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 Proxmox backup chronology uncertain until dated

pulse-triage[bot]f0217613ae73
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 8f582d0b22..b43e1bb73f 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -810,6 +810,22 @@ display label or permission to describe every preview as release-ready.
Automatic stable updates remain unavailable while Preview is selected, and
that manual-channel consequence must stay visible at desktop and narrow widths.
+
+### Backup date uncertainty uses existing age cells
+
+Proxmox Coverage and By date age cells label unorderable restore-point dates
+as cautionary Unknown with fixed hover and accessible explanations, rather
+than using the generic relative-time formatter's future-to-now fallback.
+Valid ages still use the shared relative-time primitive and existing table
+layouts. Coverage distinguishes unknown chronology from None in each source
+and the independent-backup slot; expansion preserves every artifact and its
+separate completion/verification state. No new route or native safety claim.
+Production-component browser verification covers desktop and 390/320px phone
+layouts, scoped filtering, day selection and later inventory replacement.
+
+
+Compact Coverage age cells use the existing metadata-size text and reclaim numeric-age gutters so the full Unknown word stays visible even beside a Job column at 320px; text-range checks account for cell padding, not only the outer box.
+
## Canonical Files
1. `frontend-modern/src/components/shared/`
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 9b5beb9ec9..0ebf9d1c10 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -403,6 +403,44 @@ grant no backup mutation, restore, or recovery-state authority; `agent:exec`
appears only when the operator explicitly requests the transitional
command-capable profile.
+### Restore-point chronology is not completion or protection
+
+The existing Proxmox Backups Coverage and By date views preserve completed
+artifacts with missing, unusable, zero-time or future dates as unknown age,
+not a current/green backup or an absent point. Unknown chronology cannot elect
+an arbitrary or older dated artifact as the latest completed point. PBS, PVE,
+guest-snapshot and independent-backup selections each retain this uncertainty;
+the same selector owns full-inventory and location-filtered Coverage. Running
+and failed artifacts remain listed but never contaminate completed chronology.
+Guest-local snapshots still cannot fill the independent-backup slot.
+
+Unknown ages have a fixed explanation and accessible name; no invalid-date or
+raw malformed timestamp is displayed. Dated ages keep their existing 7/30-day
+bands and reported timestamp. Unknown dates remain in the artifact list, but
+are omitted from the activity chart and day filters, including future events
+on today's date. The page explains that omission instead of claiming no
+activity from an unreadable date. Inventory replacement refreshes its reference
+clock, so a newly completed point is not compared with the page-mount time.
+Server-owned protection, verification and completion facts remain independent;
+this presentation proves no native restore, thaw or workload liveness.
+
+Verification: the `backup-date-evidence` families in the recovery-model,
+activity, shared-age and mounted backup-table tests cover invalid/future dates,
+known-plus-unknown ordering, independent sources, scoped filtering, incomplete
+artifacts, valid boundaries and later inventory replacement. The production
+fixture `browser-tests/backup-date-chronology.cjs` uses the existing router,
+API readers, components and CSS with synthetic HTTP in desktop Chromium and
+phone-emulated WebKit, not native appliance or published-release acceptance.
+
+Coverage owns independent scalar copies of each latest-artifact pointer.
+In-place stable-row reconciliation must not let an older source pointer mutate
+the last-backup value after a newer point arrives from another source.
+Connected replacement controls and inspected renders cover that boundary.
+
+The compact By date layout reserves enough age space for the full cautionary Unknown word rather than the former numeric-age-only allocation, while keeping independent task/state labels legible and the canonical identity anchor. Both 390px and 320px browser checks measure age text and state clipping, supplemented by inspected renders.
+
+Compact Coverage age cells use the existing metadata-size text and reclaim numeric-age gutters so the full Unknown word stays visible even beside a Job column at 320px; text-range checks account for cell padding, not only the outer box.
+
## Canonical Files
1. `internal/recovery/index.go`
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 930352d3b4..ce79bd7a83 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -565,6 +565,33 @@ distinction afterwards. The unified risk projection gates wearout on
`storagehealth.WearoutReported` so its verdict and the server-side alert verdict
about the same disk cannot diverge.
+
+### Coverage rows preserve unknown backup chronology
+
+The existing Proxmox backup Coverage projection carries unknown-date flags
+separately for PBS, PVE files, guest snapshots and independent backups. A
+completed point with an unavailable or future date remains evidence, but
+cannot elect a latest point or be displayed as absence. Full and location-
+scoped projections share this selection rule, refresh the inventory observation
+clock and clear uncertainty on valid replacement. Provider-owned protection
+and verification remain untouched; guest-local snapshots are never independent
+backups. This is a local view model, not new wire or identity/correlation policy.
+
+Verification: recovery-model and connected backup-table `backup-date-evidence`
+cases plus the production browser fixture cover mixed chronology, source-scoped
+uncertainty, independent posture and valid replacement. Native guest/backup
+acceptance and containing release delivery remain with their existing owners.
+
+
+Coverage owns independent scalar copies of each latest-artifact pointer.
+In-place stable-row reconciliation must not let an older source pointer mutate
+the last-backup value after a newer point arrives from another source.
+Connected replacement controls and inspected renders cover that boundary.
+
+The compact By date layout reserves enough age space for the full cautionary Unknown word rather than the former numeric-age-only allocation, while keeping independent task/state labels legible and the canonical identity anchor. Both 390px and 320px browser checks measure age text and state clipping, supplemented by inspected renders.
+
+Compact Coverage age cells use the existing metadata-size text and reclaim numeric-age gutters so the full Unknown word stays visible even beside a Job column at 320px; text-range checks account for cell padding, not only the outer box.
+
## Canonical Files
1. `internal/unifiedresources/types.go`
diff --git a/frontend-modern/browser-tests/backup-date-chronology.cjs b/frontend-modern/browser-tests/backup-date-chronology.cjs
new file mode 100644
index 0000000000..b4ee90fa9f
--- /dev/null
+++ b/frontend-modern/browser-tests/backup-date-chronology.cjs
@@ -0,0 +1,479 @@
+// Existing production router, inventory readers, backup tables and CSS.
+// Synthetic timestamps and HTTP; no native restore, thaw or published result.
+// Bound Tailwind's native preview scanner, rather than size its thread pool
+// from the shared host's CPU count. This changes no executor capacity policy.
+process.env.RAYON_NUM_THREADS = '2';
+const assert = require('node:assert/strict');
+const fs = require('node:fs');
+const path = require('node:path');
+const crypto = require('node:crypto');
+const { chromium, webkit } = require('playwright');
+const root = '/workspace/frontend-modern';
+const output = '/workspace/tmp/backup-dates/browser';
+const origin = 'http://127.0.0.1:5316';
+const sha256 = (file) => crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex');
+const emptyPVE = { data: { backupTasks: [], storageBackups: [], guestSnapshots: [] } };
+const archive = {
+ id: 'archive-112',
+ vmid: 112,
+ type: 'ct',
+ instance: 'pve-a',
+ node: 'pve-a',
+ storage: 'local',
+ format: 'zst',
+ time: '2026-09-01T01:00:00Z',
+ size: 1024,
+ protected: false,
+};
+const pbs = {
+ id: 'pbs-112',
+ vmid: '112',
+ backupType: 'ct',
+ instance: 'pbs-main',
+ datastore: 'main',
+ namespace: '',
+ files: ['index.json.blob'],
+ backupTime: 'not-a-date',
+ size: 1024,
+ protected: false,
+ verified: true,
+};
+const posture = {
+ subjectResourceId: 'ct-112',
+ state: 'protected',
+ freshness: 'current',
+ verification: 'verified',
+ coverage: 'complete',
+ evidenceIds: [],
+ repositoryResourceIds: [],
+ providerStates: [],
+ explanation: 'Synthetic provider-owned protection judgment, independent of inventory date.',
+ evaluatedAt: '2026-10-04T12:00:00Z',
+};
+const runtime = [
+ 'src/features/proxmox/proxmoxBackupRecoveryModel.ts',
+ 'src/features/proxmox/proxmoxBackupActivityPresentation.ts',
+ 'src/features/proxmox/proxmoxBackupsTableShared.tsx',
+ 'src/features/proxmox/ProxmoxCoverageTable.tsx',
+ 'src/features/proxmox/ProxmoxBackupsTable.tsx',
+ 'src/features/proxmox/proxmoxBackupsTablePresentation.ts',
+];
+(async () => {
+ fs.mkdirSync(output, { recursive: true });
+ process.chdir(root);
+ const playwrightVersion = require('playwright/package.json').version;
+ assert.equal(
+ playwrightVersion,
+ JSON.parse(fs.readFileSync('/workspace/tests/integration/package-lock.json')).packages[
+ 'node_modules/@playwright/test'
+ ].version,
+ );
+ const { createServer } = await import(path.join(root, 'node_modules/vite/dist/node/index.js'));
+ const server = await createServer({
+ cacheDir: path.join(output, 'vite-cache'),
+ optimizeDeps: { entries: ['browser-tests/backup-inventory.html'] },
+ server: { host: '127.0.0.1', port: 5316, strictPort: true },
+ });
+ const observations = [];
+ let browser;
+ let currentChecks = [];
+ try {
+ await server.listen();
+ for (const [name, engine, width] of [
+ ['chromium-desktop', chromium, 1365],
+ ['webkit-phone', webkit, 390],
+ ['webkit-narrow-phone', webkit, 320],
+ ]) {
+ const phone = engine === webkit;
+ browser = await engine.launch(
+ engine === chromium
+ ? { headless: true, channel: 'chromium', args: ['--no-sandbox'] }
+ : { headless: true },
+ );
+ const viewport = { width, height: phone ? 844 : 900 };
+ const page = await browser.newPage({
+ viewport,
+ isMobile: phone,
+ hasTouch: phone,
+ locale: 'en-GB',
+ timezoneId: 'UTC',
+ });
+ page.setDefaultTimeout(20000);
+ await page.clock.setFixedTime(new Date('2026-10-04T12:00:00Z'));
+ const errors = [],
+ requests = [],
+ offOrigin = [],
+ screenshots = [];
+ const checks = (currentChecks = []);
+ const sources = {
+ pve: {
+ data: {
+ ...emptyPVE.data,
+ storageBackups: [archive],
+ backupTasks: [
+ {
+ id: 'task-112',
+ vmid: 112,
+ type: 'ct',
+ node: 'pve-a',
+ instance: 'pve-a',
+ status: 'OK',
+ startTime: '2026-10-04T11:00:00Z',
+ endTime: '2026-10-04T11:05:00Z',
+ },
+ ],
+ },
+ },
+ pbs: { data: { backups: [pbs] } },
+ };
+ page.on('pageerror', (error) => errors.push(error.message));
+ await page.route('**/*', async (route) => {
+ const request = route.request();
+ const url = new URL(request.url());
+ if (url.origin !== origin) {
+ offOrigin.push(url.origin);
+ return route.abort();
+ }
+ if (!url.pathname.startsWith('/api/')) return route.continue();
+ requests.push({ path: url.pathname, method: request.method() });
+ const payload =
+ url.pathname === '/api/backups/pve'
+ ? sources.pve
+ : url.pathname === '/api/backups/pbs'
+ ? sources.pbs
+ : { data: [posture], policy: {}, meta: { total: 1, totalPages: 1 } };
+ await route.fulfill({
+ status: 200,
+ contentType: 'application/json',
+ body: JSON.stringify(payload),
+ });
+ });
+ const rows = (kind) => page.locator(`[data-proxmox-backup-row="${kind}"]`);
+ const ageCell = async () => {
+ const table = page.locator('[data-proxmox-backups-table="coverage"] table').first();
+ const headers = await table.locator('thead th').allTextContents();
+ const index = headers.findIndex((text) => /^(Age|Backup|Last backup)$/.test(text.trim()));
+ assert(index >= 0, headers.join(' | '));
+ return rows('coverage').first().locator('td').nth(index);
+ };
+ const load = async (view) => {
+ await page.goto(`${origin}/browser-tests/backup-inventory.html?view=${view}`, {
+ waitUntil: 'domcontentloaded',
+ timeout: 90000,
+ });
+ if (phone) await page.evaluate(() => document.documentElement.classList.add('dark'));
+ await rows(view === 'coverage' ? 'coverage' : 'recoverable')
+ .first()
+ .waitFor();
+ if (view === 'coverage') {
+ await page.getByRole('link', { name: 'Coverage', exact: true }).click();
+ await page.waitForURL('**/proxmox/backups/coverage');
+ }
+ };
+ const capture = async (suffix) => {
+ await page.evaluate(() => {
+ for (const animation of document.getAnimations()) {
+ try {
+ animation.finish();
+ } catch {}
+ }
+ });
+ const file = path.join(output, `${name}-${suffix}.png`);
+ await page.screenshot({ path: file, fullPage: true, animations: 'disabled' });
+ screenshots.push({ path: file, sha256: sha256(file) });
+ };
+ const assertUnknown = async (element) => {
+ const unknown = element.getByText('Unknown', { exact: true });
+ await unknown.waitFor();
+ assert.match(await unknown.getAttribute('class'), /text-amber/);
+ assert.match(await unknown.getAttribute('aria-label'), /Unknown age/);
+ assert.match(await unknown.getAttribute('title'), /unavailable or in the future/);
+ assert(!String(await unknown.getAttribute('title')).includes('not-a-date'));
+ const clipping = await unknown.evaluate((text) => {
+ const range = document.createRange();
+ range.selectNodeContents(text);
+ const rect = range.getBoundingClientRect();
+ const cell = text.closest('td');
+ const bounds = cell.getBoundingClientRect();
+ const style = getComputedStyle(cell);
+ return {
+ left: rect.left,
+ right: rect.right,
+ availableLeft: bounds.left + parseFloat(style.paddingLeft),
+ availableRight: bounds.right - parseFloat(style.paddingRight),
+ };
+ });
+ assert(
+ clipping.left >= clipping.availableLeft - 0.1 &&
+ clipping.right <= clipping.availableRight + 0.1,
+ JSON.stringify(clipping),
+ );
+ };
+ const assertFits = async () => {
+ const geometry = await rows('coverage')
+ .first()
+ .locator('td')
+ .evaluateAll((cells) =>
+ cells
+ .map((cell) => {
+ const text = cell.querySelector('span[aria-label^="Unknown age"]');
+ if (!text) return null;
+ const range = document.createRange();
+ range.selectNodeContents(text);
+ const rect = range.getBoundingClientRect(),
+ container = cell.getBoundingClientRect();
+ return {
+ left: rect.left,
+ right: rect.right,
+ cellLeft: container.left,
+ cellRight: container.right,
+ };
+ })
+ .filter(Boolean),
+ );
+ for (const box of geometry)
+ assert(
+ box.left >= box.cellLeft - 1 && box.right <= box.cellRight + 1,
+ JSON.stringify(box),
+ );
+ assert.equal(
+ await page.evaluate(() => document.documentElement.scrollWidth > innerWidth + 1),
+ false,
+ );
+ checks.push({
+ check: 'Unknown ages fit their existing cells without overlap or page overflow',
+ geometry,
+ });
+ };
+
+ await load('coverage');
+ await assertUnknown(await ageCell());
+ await rows('coverage')
+ .getByText(phone ? 'Prot.' : 'Protected', { exact: true })
+ .waitFor();
+ await assertFits();
+ await capture('mixed-coverage');
+ checks.push({
+ check:
+ 'Known older PVE plus undated completed PBS cannot assert newest backup; server posture stays independent',
+ });
+
+ const callCount = requests.length;
+ if (phone) await page.getByRole('button', { name: /Filters/, exact: false }).tap();
+ const filter = page.getByRole('combobox', { name: 'Filter', exact: true });
+ const value = await filter
+ .locator('option')
+ .filter({ hasText: 'Backup location: pve-a / local' })
+ .getAttribute('value');
+ await filter.selectOption(value);
+ await page.waitForFunction(
+ () => new URLSearchParams(location.search).get('location') === 'archive:pve-a:local',
+ );
+ assert.equal(await (await ageCell()).getByText('Unknown', { exact: true }).count(), 0);
+ assert.match(await (await ageCell()).innerText(), /33d/);
+ assert.equal(requests.length, callCount);
+ checks.push({
+ check:
+ 'Location filtering restores known archive age without another read or global date contamination',
+ });
+
+ await page.getByRole('button', { name: 'Clear filters', exact: true }).click();
+ await assertUnknown(await ageCell());
+ await page.clock.setFixedTime(new Date('2026-10-04T12:02:00Z'));
+ sources.pbs = { data: { backups: [{ ...pbs, backupTime: '2026-10-04T12:01:00Z' }] } };
+ await page.evaluate(() => window.__switchBackupOrg('date-replacement'));
+ await page.waitForFunction(() =>
+ [...document.querySelectorAll('[data-proxmox-backup-row="coverage"] td')].some(
+ (cell) => cell.textContent.trim() === '1m' || cell.textContent.trim() === '1m ago',
+ ),
+ );
+ await (await ageCell()).getByText(/^1m( ago)?$/).waitFor();
+ assert.equal(await (await ageCell()).getByText('Unknown', { exact: true }).count(), 0);
+ const replacementGap = await rows('coverage')
+ .first()
+ .evaluate((row) => {
+ const ages = [...row.querySelectorAll('td > span')].filter((span) =>
+ /^1m( ago)?$/.test(span.textContent.trim()),
+ );
+ if (ages.length < 2) return null;
+ const range1 = document.createRange(),
+ range2 = document.createRange();
+ range1.selectNodeContents(ages[0]);
+ range2.selectNodeContents(ages[1]);
+ return range2.getBoundingClientRect().left - range1.getBoundingClientRect().right;
+ });
+ assert(replacementGap >= 3.5, String(replacementGap));
+ await capture('replaced-coverage');
+ checks.push({
+ check:
+ 'Later valid inventory replaces uncertainty using its new observation time, not page-mount time',
+ });
+
+ await page.clock.setFixedTime(new Date('2026-10-04T12:00:00Z'));
+ sources.pve = {
+ data: {
+ ...emptyPVE.data,
+ storageBackups: [{ ...archive, time: 'not-a-date' }],
+ guestSnapshots: [
+ {
+ id: 'guest-snapshot',
+ type: 'ct',
+ vmid: 112,
+ node: 'pve-a',
+ instance: 'pve-a',
+ time: '0001-01-01T00:00:00Z',
+ name: 'local-snapshot',
+ },
+ ],
+ },
+ };
+ sources.pbs = {
+ data: {
+ backups: [
+ { ...pbs, id: 'known', backupTime: '2026-10-04T11:00:00Z', size: 256 },
+ { ...pbs, id: 'future', backupTime: '2026-10-04T12:00:01Z' },
+ { ...pbs, id: 'running', inProgress: true, backupTime: '', verified: false },
+ {
+ ...pbs,
+ id: 'failed',
+ inProgress: true,
+ writeActivityObserved: true,
+ writeActive: false,
+ backupTime: '',
+ verified: false,
+ },
+ ],
+ },
+ };
+ await load('date');
+ await page.waitForFunction(
+ () => document.querySelectorAll('[data-proxmox-backup-row="recoverable"]').length === 6,
+ );
+ await page
+ .getByRole('status')
+ .filter({ hasText: 'Restore points with unavailable or future dates remain listed' })
+ .waitFor();
+ assert.equal(await rows('recoverable').getByText('Unknown', { exact: true }).count(), 5);
+ const today = page.getByRole('button', { name: /: 1 backup$/ });
+ await today.waitFor();
+ await page.getByText('Running', { exact: true }).waitFor();
+ await page.getByText('Failed', { exact: true }).waitFor();
+ assert.equal(await page.getByText('not-a-date', { exact: true }).count(), 0);
+ assert(!(await page.locator('body').innerText()).includes('Invalid Date'));
+ const dateGeometry = await rows('recoverable').evaluateAll((rows) =>
+ rows.flatMap((row) => {
+ const spans = [...row.querySelectorAll('span[aria-label^="Unknown age"]')];
+ return spans.map((text) => {
+ const range = document.createRange();
+ range.selectNodeContents(text);
+ const bounds = range.getBoundingClientRect();
+ const cell = text.closest('td').getBoundingClientRect();
+ return {
+ left: bounds.left,
+ right: bounds.right,
+ cellLeft: cell.left,
+ cellRight: cell.right,
+ };
+ });
+ }),
+ );
+ for (const box of dateGeometry)
+ assert(box.left >= box.cellLeft - 1 && box.right <= box.cellRight - 4, JSON.stringify(box));
+ const clippedStateLabels = await rows('recoverable').evaluateAll((rows) =>
+ rows
+ .map((row) => {
+ const cell = row.lastElementChild;
+ const text = cell.querySelector('span');
+ return text && text.scrollWidth > text.clientWidth + 1 ? cell.textContent : null;
+ })
+ .filter(Boolean),
+ );
+ assert.deepEqual(clippedStateLabels, []);
+ checks.push({
+ check:
+ 'By date unknown-age words and independent state labels remain unclipped at phone widths',
+ geometry: dateGeometry,
+ });
+ await capture('date-evidence');
+ checks.push({
+ check:
+ 'PBS/PVE/guest snapshots keep unknown ages, running/failed/verified states and all artifacts; today counts one dated observation only',
+ });
+
+ const beforeDay = requests.length;
+ if (phone) await today.tap();
+ else {
+ await today.focus();
+ await page.keyboard.press('Enter');
+ }
+ await page.waitForFunction(
+ () =>
+ document.querySelectorAll('[data-proxmox-backup-row="recoverable"]').length === 1 &&
+ new URLSearchParams(location.search).get('day') === '2026-10-04',
+ );
+ assert.equal(await rows('recoverable').getByText('Unknown', { exact: true }).count(), 0);
+ assert.equal(requests.length, beforeDay);
+ await page.getByRole('button', { name: 'Clear date filter', exact: true }).click();
+ await page.waitForFunction(
+ () => document.querySelectorAll('[data-proxmox-backup-row="recoverable"]').length === 6,
+ );
+ checks.push({
+ check:
+ 'Keyboard/touch day selection omits unknown/future dates; clearing restores all six without another read',
+ });
+ assert.deepEqual(errors, []);
+ assert.deepEqual(offOrigin, []);
+ assert(requests.every((request) => request.method === 'GET'));
+ observations.push({
+ name,
+ browserVersion: browser.version(),
+ viewport,
+ checks,
+ requests,
+ errors,
+ offOrigin,
+ screenshots,
+ });
+ await browser.close();
+ browser = null;
+ }
+ fs.writeFileSync(
+ path.join(output, 'result.json'),
+ JSON.stringify(
+ {
+ result: 'passed',
+ playwrightVersion,
+ runtimeSha256: Object.fromEntries(
+ runtime.map((file) => [`frontend-modern/${file}`, sha256(path.join(root, file))]),
+ ),
+ observations,
+ },
+ null,
+ 2,
+ ) + '\n',
+ );
+ console.log(`${observations.length} browser contexts passed; receipts at ${output}`);
+ } catch (error) {
+ fs.writeFileSync(
+ path.join(output, 'failure.json'),
+ JSON.stringify(
+ {
+ result: 'failed',
+ message: error.message,
+ stack: error.stack,
+ completedContexts: observations,
+ currentChecks,
+ },
+ null,
+ 2,
+ ) + '\n',
+ );
+ throw error;
+ } finally {
+ if (browser) await browser.close();
+ await server.close();
+ }
+})().catch((error) => {
+ console.error(error);
+ process.exitCode = 1;
+});
diff --git a/frontend-modern/browser-verification/994700300911aa64.json b/frontend-modern/browser-verification/994700300911aa64.json
new file mode 100644
index 0000000000..bb47a00533
--- /dev/null
+++ b/frontend-modern/browser-verification/994700300911aa64.json
@@ -0,0 +1,58 @@
+{
+ "version": 1,
+ "result": "passed",
+ "base_sha": "1ff46c4261e11b4a8edcd573df415a217ecd34cd",
+ "content_sha256": {
+ "frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts": "a6aa5af3dd99b02b373facbc12ddfbcbe496d4d1d4c004a7ef120660e37bd2e9",
+ "frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts": "e2baa45cc6ac3d3f936ed28523dde741b9ef7c6426b3e36884b8b5338c2a7781",
+ "frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx": "adc0ef66540233d281b4a589750996e9b31a0f477bad166e657bf39d60264f58",
+ "frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx": "6f61304d998450c77b1a18c77d188d2667a384fbbcd0eb65897fa55e7a703fb4",
+ "frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx": "4ae82b8e48fef3eeda13d7ad41a85d6120e3b44fc35cb4ebaf7974fcd7f5e47d",
+ "frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts": "782d1fae95d709e83eb6e57587878009c428c9ef2bde7221cd507952c5e5be44"
+ },
+ "changed_paths": [
+ "frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx",
+ "frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx",
+ "frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts",
+ "frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts",
+ "frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts",
+ "frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx"
+ ],
+ "routes": [
+ "Existing Proxmox Backups Coverage and By date via production-component/router fixture"
+ ],
+ "states": [
+ "Mixed dated/unknown completed PBS and PVE backups",
+ "Future/malformed/Go zero-time dates",
+ "Independent server Protected posture and verified/running/failed artifact states",
+ "Valid newest PBS replacement with older archive companion",
+ "Known and unknown date groups, observed activity only"
+ ],
+ "interactions": [
+ "Actual Coverage navigation",
+ "Client-side backup-location filter and clear without new reads",
+ "Organization inventory replacement with advancing observation time",
+ "Keyboard/touch day filter and clear without new reads"
+ ],
+ "viewports": [
+ {
+ "width": 1365,
+ "height": 900
+ },
+ {
+ "width": 390,
+ "height": 844
+ },
+ {
+ "width": 320,
+ "height": 844
+ }
+ ],
+ "verified_at": "2026-10-04T09:32:11.797203Z",
+ "browsers": [
+ "Chromium desktop",
+ "WebKit 390px and 320px phone emulation, not native iOS"
+ ],
+ "command": "pulse-worker-browser frontend-modern/browser-tests/backup-date-chronology.cjs",
+ "proof": "Three contexts, 21 recorded check groups and nine individually inspected screenshots. Synthetic inventory/HTTP only; no native backup, restore, thaw or release acceptance."
+}
diff --git a/frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx
index c0bf4513ea..3fca203d50 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx
@@ -43,7 +43,7 @@ import {
import {
buildProxmoxBackupRecoveryModel,
coverageRowMatchesSearch,
- isBackupArtifact,
+ selectWorkloadRecoveryArtifacts,
recoverableArtifactMatchesSearch,
type RecoverableArtifact,
type WorkloadCoverageRow,
@@ -310,9 +310,14 @@ export const ProxmoxBackupsTable: Component<{
backups.error() ? [] : (backups.value().backupTasks ?? []),
);
- // Render-time `now` snapshot so all age comparisons within a render share a
- // reference moment; not reactive to ticking time (fine for sysadmin grouping).
- const nowMs = createMemo(() => Date.now());
+ // Share the observation moment, refreshing it when inventory is replaced.
+ // A newly completed backup must not be "future" relative to page mount.
+ const nowMs = createMemo(() => {
+ pbsArtifacts();
+ archives();
+ snapshots();
+ return Date.now();
+ });
const recoveryModel = createMemo(() =>
buildProxmoxBackupRecoveryModel({
@@ -380,33 +385,14 @@ export const ProxmoxBackupsTable: Component<{
const coverageRowsForLocation = createMemo<WorkloadCoverageRow[]>(() => {
const selected = locationFilter();
if (!selected) return recoveryModel().coverageRows;
- const newestArtifact = (artifacts: RecoverableArtifact[]): RecoverableArtifact | undefined =>
- artifacts.reduce<RecoverableArtifact | undefined>((latest, artifact) => {
- if (!latest) return artifact;
- return (artifact.createdMs ?? Number.NEGATIVE_INFINITY) >
- (latest.createdMs ?? Number.NEGATIVE_INFINITY)
- ? artifact
- : latest;
- }, undefined);
-
return recoveryModel().coverageRows.flatMap((row) => {
const artifacts = row.artifacts.filter(locationMatches);
if (artifacts.length === 0) return [];
- // Same rule as the model: running or failed artifacts stay listed but
- // never become a "latest" pointer, and snapshots never become the backup.
- const completed = artifacts.filter((artifact) => !artifact.running && !artifact.failed);
return [
{
...row,
artifacts,
- latestBackup: newestArtifact(completed.filter(isBackupArtifact)),
- latestPBS: newestArtifact(completed.filter((artifact) => artifact.sourceKind === 'pbs')),
- latestArchive: newestArtifact(
- completed.filter((artifact) => artifact.sourceKind === 'archive'),
- ),
- latestSnapshot: newestArtifact(
- completed.filter((artifact) => artifact.sourceKind === 'snapshot'),
- ),
+ ...selectWorkloadRecoveryArtifacts(artifacts, nowMs()),
pbsCount: artifacts.filter((artifact) => artifact.sourceKind === 'pbs').length,
archiveCount: artifacts.filter((artifact) => artifact.sourceKind === 'archive').length,
snapshotCount: artifacts.filter((artifact) => artifact.sourceKind === 'snapshot').length,
@@ -521,6 +507,7 @@ export const ProxmoxBackupsTable: Component<{
? 'archive'
: 'snapshot',
{
+ now: new Date(nowMs()),
getValue:
recoverableMetricMode() === 'volume'
? (artifact) => (artifact.size && artifact.size > 0 ? artifact.size : 0)
@@ -809,11 +796,21 @@ export const ProxmoxBackupsTable: Component<{
/>
<Show when={view() === 'date' && recoveryModel().recoverableArtifacts.length > 0}>
+ <Show
+ when={recoveryModel().recoverableArtifacts.some(
+ (artifact) => artifact.createdMs === undefined,
+ )}
+ >
+ <p class="text-xs text-amber-700 dark:text-amber-300" role="status">
+ Restore points with unavailable or future dates remain listed. Their ages are
+ unknown; they are excluded from the activity chart and day filters.
+ </p>
+ </Show>
<Show
when={hasRecoverableActivityInRange()}
fallback={
<div class="flex flex-col gap-2 rounded-md border border-border-subtle px-3 py-3 text-xs text-muted sm:flex-row sm:items-center sm:justify-between">
- <span>No backup activity in the selected {chartRange()}-day window.</span>
+ <span>No dated backup activity in the selected {chartRange()}-day window.</span>
<div class="flex items-center gap-2">
<button
type="button"
diff --git a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
index ce0c4e3d86..b5194b22b0 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
@@ -55,6 +55,23 @@ const COVERAGE_NO_BACKUP_TITLE = 'No PBS snapshot or PVE backup file';
const COVERAGE_SNAPSHOT_ONLY_TITLE =
'No PBS snapshot or PVE backup file. Guest snapshots alone do not prove independent recovery.';
+function CoverageAgeFallback(props: { unknown?: boolean; emptyTitle: string; compact?: boolean }) {
+ const title = () =>
+ props.unknown
+ ? 'One or more completed restore-point dates are unavailable or in the future. The latest point is unknown; expand this row to inspect the evidence.'
+ : props.emptyTitle;
+ return (
+ <span
+ class={props.unknown ? 'font-semibold text-amber-600 dark:text-amber-300' : 'text-muted'}
+ classList={{ 'text-[10px]': props.unknown && props.compact }}
+ title={title()}
+ aria-label={props.unknown ? `Unknown age. ${title()}` : undefined}
+ >
+ {props.unknown ? 'Unknown' : COVERAGE_EMPTY_LABEL}
+ </span>
+ );
+}
+
const coveragePostureVariant = (
posture: WorkloadCoverageRow['posture'],
): StatusIndicatorVariant => {
@@ -163,6 +180,10 @@ export function ProxmoxCoverageTable(props: {
const visibleColumnIds = createMemo(() => visibleColumns().map((column) => column.id));
const columnVisible = (column: CoverageColumnId) => visibleColumnIds().includes(column);
const columnCount = () => visibleColumns().length;
+ // Full uncertainty words must fit even beside a Job column at 320px. Numeric
+ // ages were short enough for the usual gutters; compact ages use that space.
+ const ageCellClass = (kind: 'text' | 'numeric-value') =>
+ `${layoutMode() === 'compact' ? `px-0.5 py-1 ${kind === 'numeric-value' ? 'text-right' : ''}` : getPlatformTableCellClassForKind(kind)} text-base-content`;
const pbsSource = getProxmoxBackupSourcePresentation('pbs');
const archiveSource = getProxmoxBackupSourcePresentation('archive');
const snapshotSource = getProxmoxBackupSourcePresentation('snapshot');
@@ -413,22 +434,19 @@ export function ProxmoxCoverageTable(props: {
</span>
</div>
</TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
- >
+ <TableCell class={ageCellClass('numeric-value')}>
<Show
when={row.latestBackup}
fallback={
- <span
- class="text-muted"
- title={
- row.latestSnapshot
+ <CoverageAgeFallback
+ unknown={row.ageUnknown?.backup}
+ compact={layoutMode() === 'compact'}
+ emptyTitle={
+ row.snapshotCount > 0
? COVERAGE_SNAPSHOT_ONLY_TITLE
: COVERAGE_NO_BACKUP_TITLE
}
- >
- {COVERAGE_EMPTY_LABEL}
- </span>
+ />
}
>
{(artifact) => (
@@ -440,15 +458,15 @@ export function ProxmoxCoverageTable(props: {
</Show>
</TableCell>
<Show when={columnVisible('pbs')}>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
+ <TableCell class={ageCellClass('text')}>
<Show
when={row.latestPBS}
fallback={
- <span class="text-muted" title={pbsSource.coverageFallbackLabel}>
- {COVERAGE_EMPTY_LABEL}
- </span>
+ <CoverageAgeFallback
+ unknown={row.ageUnknown?.pbs}
+ compact={layoutMode() === 'compact'}
+ emptyTitle={pbsSource.coverageFallbackLabel}
+ />
}
>
{(artifact) => (
@@ -461,18 +479,15 @@ export function ProxmoxCoverageTable(props: {
</TableCell>
</Show>
<Show when={columnVisible('archive')}>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
+ <TableCell class={ageCellClass('text')}>
<Show
when={row.latestArchive}
fallback={
- <span
- class="text-muted"
- title={archiveSource.coverageFallbackLabel}
- >
- {COVERAGE_EMPTY_LABEL}
- </span>
+ <CoverageAgeFallback
+ unknown={row.ageUnknown?.archive}
+ compact={layoutMode() === 'compact'}
+ emptyTitle={archiveSource.coverageFallbackLabel}
+ />
}
>
{(artifact) => <ProxmoxBackupAgeText artifact={artifact()} />}
@@ -480,18 +495,15 @@ export function ProxmoxCoverageTable(props: {
</TableCell>
</Show>
<Show when={columnVisible('snapshot')}>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
+ <TableCell class={ageCellClass('text')}>
<Show
when={row.latestSnapshot}
fallback={
- <span
- class="text-muted"
- title={snapshotSource.coverageFallbackLabel}
- >
- {COVERAGE_EMPTY_LABEL}
- </span>
+ <CoverageAgeFallback
+ unknown={row.ageUnknown?.snapshot}
+ compact={layoutMode() === 'compact'}
+ emptyTitle={snapshotSource.coverageFallbackLabel}
+ />
}
>
{(artifact) => <ProxmoxBackupAgeText artifact={artifact()} />}
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
index 72df095cc2..e27e0b532c 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
@@ -979,3 +979,116 @@ describe('independent Proxmox backup inventory reads', () => {
pending.resolve(jsonResponse(emptyPVE));
});
});
+
+describe('backup-date-evidence connected inventory', () => {
+ const now = Date.parse('2026-10-04T12:00:00Z');
+ beforeEach(() => {
+ vi.useFakeTimers({ toFake: ['Date'] });
+ vi.setSystemTime(now);
+ });
+ afterEach(() => vi.useRealTimers());
+ const coverageRow = () =>
+ document.querySelector('[data-proxmox-backup-row="coverage"]')! as HTMLElement;
+ const lastBackupCell = () => {
+ const row = coverageRow();
+ const table = row.closest('table')!;
+ const index = [...table.querySelectorAll('thead th')].findIndex((cell) =>
+ /Last backup/.test(cell.textContent ?? ''),
+ );
+ expect(index).toBeGreaterThanOrEqual(0);
+ return row.querySelectorAll('td')[index] as HTMLElement;
+ };
+ const supply = (date: string, withOlderArchive = false) => {
+ mockBackupAPIs(); // actual posture client stays independent
+ apiFetchMock.mockImplementation((url: string) =>
+ Promise.resolve(
+ jsonResponse(
+ url.endsWith('/pbs')
+ ? { data: { backups: [{ ...pbsPayload.data.backups[0], backupTime: date }] } }
+ : {
+ data: {
+ backupTasks: [],
+ guestSnapshots: [],
+ storageBackups: withOlderArchive ? pvePayload.data.storageBackups : [],
+ },
+ },
+ ),
+ ),
+ );
+ };
+ const mount = () =>
+ renderInRouter(() => (
+ <ProxmoxBackupsTable emptyIcon={<span />} workloads={[workloadResource]} />
+ ));
+
+ it.each(['not-a-date', '0001-01-01T00:00:00Z', '2026-10-04T12:00:01Z'])(
+ '[regression] Coverage preserves %s uncertainty instead of absence or healthy age',
+ async (date) => {
+ window.history.replaceState({}, '', '/?view=coverage');
+ supply(date);
+ mount();
+ await waitFor(() => expect(lastBackupCell()).toHaveTextContent('Unknown'));
+ expect(lastBackupCell().textContent).not.toContain('None');
+ expect(within(lastBackupCell()).getByText('Unknown')).toHaveClass('text-amber-600');
+ expect(within(coverageRow()).getByText('Protected')).toBeInTheDocument();
+ await fireEvent.click(within(coverageRow()).getByRole('button'));
+ expect(document.querySelector('[data-inline-detail-for]')).toHaveTextContent('Unknown');
+ expect(document.body).not.toHaveTextContent('Invalid Date');
+ },
+ );
+
+ it('[regression] all-locations Coverage does not advertise an older known backup as the latest', async () => {
+ window.history.replaceState({}, '', '/?view=coverage');
+ supply('not-a-date', true);
+ mount();
+ await waitFor(() => expect(lastBackupCell()).toHaveTextContent('Unknown'));
+ const calls = apiFetchMock.mock.calls.length;
+ const filter = screen.getByRole('combobox', { name: 'Filter' });
+ const option = screen.getByRole('option', {
+ name: 'Backup location: pve-a / local',
+ }) as HTMLOptionElement;
+ await fireEvent.change(filter, { target: { value: option.value } });
+ await waitFor(() => expect(lastBackupCell()).not.toHaveTextContent('Unknown'));
+ expect(lastBackupCell()).not.toHaveTextContent('None');
+ expect(apiFetchMock).toHaveBeenCalledTimes(calls); // filtering is not another read
+ });
+
+ it('[regression] location-scoped Coverage preserves unknown chronology, not a known older point', async () => {
+ window.history.replaceState({}, '', '/?view=coverage&location=pbs%3Apbs-main%3Amain');
+ supply('2026-10-04T12:00:01Z', true);
+ mount();
+ await waitFor(() => expect(lastBackupCell()).toHaveTextContent('Unknown'));
+ });
+
+ it('[regression] By date retains future artifacts but excludes them from today activity and day filtering', async () => {
+ window.history.replaceState({}, '', '/?view=date');
+ supply('2026-10-04T12:00:01Z', true);
+ mount();
+ await waitFor(() =>
+ expect(document.querySelectorAll('[data-proxmox-backup-row="recoverable"]')).toHaveLength(2),
+ );
+ expect(screen.getByRole('status')).toHaveTextContent('remain listed');
+ expect(screen.getByRole('status')).toHaveTextContent(
+ 'excluded from the activity chart and day filters',
+ );
+ expect(screen.getByText(/No dated backup activity/)).toBeInTheDocument();
+ const future = [...document.querySelectorAll('[data-proxmox-backup-row="recoverable"]')].find(
+ (row) => row.textContent?.includes('PBS'),
+ )! as HTMLElement;
+ expect(within(future).getByText('Unknown')).toHaveAccessibleName(/Unknown age/);
+ });
+
+ it('[regression] new inventory after page mount uses its observation time and clears age uncertainty', async () => {
+ window.history.replaceState({}, '', '/?view=coverage');
+ supply('not-a-date', true);
+ mount();
+ await waitFor(() => expect(lastBackupCell()).toHaveTextContent('Unknown'));
+ vi.setSystemTime(now + 120000);
+ supply('2026-10-04T12:01:00Z', true);
+ eventBus.emit('org_switched', 'date-replacement');
+ await waitFor(() => expect(lastBackupCell()).toHaveTextContent('1m ago'));
+ expect(lastBackupCell()).not.toHaveTextContent('None');
+ expect(lastBackupCell()).not.toHaveTextContent('Unknown');
+ expect(within(coverageRow()).getByText('Protected')).toBeInTheDocument();
+ });
+});
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts
index f77766c51f..8a827e04c5 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts
@@ -26,7 +26,8 @@ const DAY_MS = 24 * 60 * 60 * 1000;
// transition (DST never changes in February in either hemisphere). Every
// timestamp below is built with the local Date constructor, matching the
// module's local-day bucketing, so the assertions are timezone-independent.
-const NOW = new Date(2026, 1, 13, 10, 30, 0);
+// Observe after the same-day mixed-outcome/value fixtures below (up to 14:00).
+const NOW = new Date(2026, 1, 13, 15, 30, 0);
const localMs = (year: number, month: number, day: number, hours = 0, minutes = 0): number =>
new Date(year, month, day, hours, minutes, 0).getTime();
@@ -498,3 +499,40 @@ describe('proxmoxBackupActivityPresentation', () => {
});
});
});
+
+describe('backup-date-evidence timeline', () => {
+ it.each(['count', 'volume'] as const)(
+ '[regression] does not count future same-day activity in %s mode',
+ (mode) => {
+ const now = new Date('2026-10-04T12:00:00Z');
+ const timeline = buildBackupActivityTimeline(
+ 7,
+ [
+ { ts: now.getTime() - 1000, kind: 'pbs' as const, bytes: 2 },
+ { ts: now.getTime() + 1000, kind: 'pbs' as const, bytes: 5 },
+ ],
+ itemMs,
+ classify,
+ { now, getValue: mode === 'volume' ? (item) => item.bytes ?? 0 : undefined },
+ );
+ expect(timeline.points.reduce((total, point) => total + point.total, 0)).toBe(
+ mode === 'volume' ? 2 : 1,
+ );
+ },
+ );
+ it('[control] counts exactly observed now and leaves invalid/unavailable dates out', () => {
+ const now = new Date('2026-10-04T12:00:00Z');
+ const timeline = buildBackupActivityTimeline(
+ 7,
+ [
+ { ts: now.getTime(), kind: 'pbs' as const },
+ { ts: NaN, kind: 'pbs' as const },
+ { ts: undefined, kind: 'pbs' as const },
+ ],
+ itemMs,
+ classify,
+ { now },
+ );
+ expect(timeline.points.reduce((total, point) => total + point.total, 0)).toBe(1);
+ });
+});
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts
index 43fc7e5a41..c7873682de 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts
@@ -486,3 +486,110 @@ describe('proxmoxBackupRecoveryModel', () => {
expect(model.coverageSummary.totalWorkloads).toBe(0);
});
});
+
+describe('backup-date-evidence model', () => {
+ const nowMs = Date.parse('2026-10-04T12:00:00Z');
+ const invalidDates = ['', 'not-a-date', '0001-01-01T00:00:00Z', '2026-10-04T12:00:01Z'];
+ const modelFor = (kind: 'pbs' | 'archive' | 'snapshot', date: string) =>
+ buildProxmoxBackupRecoveryModel({
+ workloads: [workload({})],
+ pbsBackups: kind === 'pbs' ? [pbsBackup({ backupTime: date })] : [],
+ archives: kind === 'archive' ? [archive({ time: date })] : [],
+ snapshots: kind === 'snapshot' ? [snapshot({ time: date })] : [],
+ tasks: [],
+ nowMs,
+ protectionPostures: new Map([['vm-112', protectionPosture('vm-112', 'protected')]]),
+ });
+
+ for (const kind of ['pbs', 'archive', 'snapshot'] as const) {
+ it.each(invalidDates)('[regression] keeps %s date uncertainty in ' + kind, (date) => {
+ const model = modelFor(kind, date);
+ const row = model.coverageRows[0];
+ expect(model.recoverableArtifacts).toHaveLength(1);
+ expect(model.recoverableArtifacts[0].createdAt).toBe(date);
+ expect(model.recoverableArtifacts[0].createdMs).toBeUndefined();
+ expect(row.ageUnknown?.[kind]).toBe(true);
+ expect(row.ageUnknown?.backup).toBe(kind !== 'snapshot');
+ expect(row.latestBackup).toBeUndefined();
+ expect(row.posture).toBe('protected'); // server posture is a separate fact
+ });
+ }
+
+ it('[regression] cannot call a dated older backup the latest beside an undated completion', () => {
+ const model = buildProxmoxBackupRecoveryModel({
+ workloads: [workload({})],
+ pbsBackups: [pbsBackup({ backupTime: 'not-a-date' })],
+ archives: [archive()],
+ snapshots: [],
+ tasks: [],
+ nowMs,
+ });
+ expect(model.coverageRows[0].latestBackup).toBeUndefined();
+ expect(model.coverageRows[0].latestArchive?.nativeId).toBe('archive-112');
+ expect(model.coverageRows[0].ageUnknown?.backup).toBe(true);
+ });
+
+ it.each([nowMs + 1, 0, -1, 9e15])(
+ '[regression] rejects unorderable age %s rather than current/stale',
+ (createdMs) => expect(getRecoveryAgeBand(createdMs, nowMs)).toBe('unknown'),
+ );
+
+ it('[control] keeps valid newest completed backup and guest-local snapshot separate', () => {
+ const model = buildProxmoxBackupRecoveryModel({
+ workloads: [workload({})],
+ pbsBackups: [pbsBackup()],
+ archives: [archive()],
+ snapshots: [snapshot({ time: '2026-10-04T11:00:00Z' })],
+ tasks: [],
+ nowMs,
+ });
+ expect(model.coverageRows[0].latestBackup?.sourceKind).toBe('pbs');
+ expect(model.coverageRows[0].latestSnapshot?.sourceKind).toBe('snapshot');
+ });
+
+ it('[control] incomplete unknown-date artifacts do not contaminate completed backup chronology', () => {
+ const model = buildProxmoxBackupRecoveryModel({
+ workloads: [workload({})],
+ pbsBackups: [
+ pbsBackup({ id: 'running', inProgress: true, backupTime: 'not-a-date' }),
+ pbsBackup({
+ id: 'failed',
+ inProgress: true,
+ writeActivityObserved: true,
+ writeActive: false,
+ backupTime: '',
+ }),
+ ],
+ archives: [archive()],
+ snapshots: [],
+ tasks: [],
+ nowMs,
+ });
+ expect(model.coverageRows[0].latestBackup?.nativeId).toBe('archive-112');
+ expect(model.recoverableArtifacts).toHaveLength(3);
+ expect(
+ model.recoverableArtifacts.find((artifact) => artifact.nativeId === 'running')?.running,
+ ).toBe(true);
+ expect(
+ model.recoverableArtifacts.find((artifact) => artifact.nativeId === 'failed')?.failed,
+ ).toBe(true);
+ });
+
+ it('[control] keeps explicit absence and snapshot-only inventory distinct', () => {
+ const row = modelFor('snapshot', '2026-10-04T11:00:00Z').coverageRows[0];
+ expect(row.latestBackup).toBeUndefined();
+ expect(row.pbsCount + row.archiveCount).toBe(0);
+ expect(row.latestSnapshot).toBeDefined();
+ });
+
+ it('[control] preserves age-band boundaries and an exactly current completion', () => {
+ expect(getRecoveryAgeBand(Infinity, nowMs)).toBe('unknown');
+ expect(getRecoveryAgeBand(NaN, nowMs)).toBe('unknown');
+ expect(getRecoveryAgeBand(nowMs, NaN)).toBe('unknown');
+ expect(getRecoveryAgeBand(nowMs, nowMs)).toBe('current');
+ expect(getRecoveryAgeBand(nowMs - 7 * 86400000, nowMs)).toBe('current');
+ expect(getRecoveryAgeBand(nowMs - 7 * 86400000 - 1, nowMs)).toBe('aging');
+ expect(getRecoveryAgeBand(nowMs - 30 * 86400000, nowMs)).toBe('aging');
+ expect(getRecoveryAgeBand(nowMs - 30 * 86400000 - 1, nowMs)).toBe('stale');
+ });
+});
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTablePresentation.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTablePresentation.test.ts
index a52bd7c075..ac7c723426 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTablePresentation.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTablePresentation.test.ts
@@ -128,7 +128,8 @@ describe('Proxmox backups responsive table presentation', () => {
'state',
]);
expect(getRecoverableColumnWidthStyle('workload', 'compact')).toEqual({ width: '40%' });
- expect(getRecoverableColumnWidthStyle('state', 'compact')).toEqual({ width: '30%' });
+ expect(getRecoverableColumnWidthStyle('created', 'compact')).toEqual({ width: '21%' });
+ expect(getRecoverableColumnWidthStyle('state', 'compact')).toEqual({ width: '23%' });
expect(ids(getRecoverableColumns('basic'))).toEqual([
'workload',
'source',
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableShared.test.tsx b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableShared.test.tsx
index 4ffe9073bd..594501f26a 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableShared.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableShared.test.tsx
@@ -1,4 +1,4 @@
-import { afterEach, describe, expect, it } from 'vitest';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { cleanup, render, screen } from '@solidjs/testing-library';
import { WorkloadTypeBadge } from '@/components/shared/WorkloadTypeBadge';
import proxmoxBackupServersTableSource from '../ProxmoxBackupServersTable.tsx?raw';
@@ -165,3 +165,43 @@ function artifact(overrides: Partial<RecoverableArtifact> = {}): RecoverableArti
...overrides,
};
}
+
+describe('backup-date-evidence age cell', () => {
+ const now = Date.parse('2026-10-04T12:00:00Z');
+ beforeEach(() => {
+ vi.useFakeTimers({ toFake: ['Date'] });
+ vi.setSystemTime(now);
+ });
+ afterEach(() => vi.useRealTimers());
+ for (const compact of [false, true]) {
+ it.each(['not-a-date', '0001-01-01T00:00:00Z', '2026-10-04T12:00:01Z'])(
+ '[regression] labels %s unknown in ' + (compact ? 'compact' : 'full') + ' age cells',
+ (createdAt) => {
+ render(() => (
+ <ProxmoxBackupAgeText
+ artifact={artifact({ createdAt, createdMs: Date.parse(createdAt) })}
+ compact={compact}
+ />
+ ));
+ const value = screen.getByText('Unknown');
+ expect(value).toHaveClass('text-amber-600');
+ if (compact) expect(value).toHaveClass('text-[10px]');
+ expect(value).toHaveAccessibleName(/Unknown age/);
+ expect(value.title).not.toContain(createdAt);
+ expect(value.title).toContain('unavailable or in the future');
+ },
+ );
+ }
+ it('[control] valid completed dates retain relative age and their reported timestamp', () => {
+ const createdAt = '2026-10-04T11:00:00Z';
+ render(() => (
+ <ProxmoxBackupAgeText
+ artifact={artifact({ createdAt, createdMs: Date.parse(createdAt) })}
+ compact
+ />
+ ));
+ const value = screen.getByText('1h');
+ expect(value).toHaveClass('text-emerald-600');
+ expect(value.title).toContain(createdAt);
+ });
+});
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts b/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts
index a7bde2a46e..f11ab09f2a 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts
@@ -116,6 +116,8 @@ export function buildBackupActivityTimeline<T>(
for (const item of items) {
const ts = getTimestampMs(item);
if (ts === undefined || !Number.isFinite(ts)) continue;
+ // A future time on today's date is still not observed past activity.
+ if (ts > now.getTime()) continue;
if (ts < windowStart) continue;
if (ts >= todayStart + 24 * 60 * 60 * 1000) continue;
const kind = classify(item);
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts b/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
index b4288cf9f6..3f0262a4a6 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
@@ -73,7 +73,8 @@ export interface WorkloadCoverageRow {
workload: WorkloadReference;
artifacts: RecoverableArtifact[];
/**
- * Newest completed PBS snapshot or PVE backup file. Guest snapshots never
+ * Newest completed PBS snapshot or PVE backup file, only when all completed
+ * backup dates can be ordered. Guest snapshots never
* fill this slot: they live on the guest's own storage and the protection
* posture engine does not count them as independent recovery, so a fresh
* snapshot must not read as a fresh backup beside a stale posture.
@@ -82,6 +83,8 @@ export interface WorkloadCoverageRow {
latestPBS?: RecoverableArtifact;
latestArchive?: RecoverableArtifact;
latestSnapshot?: RecoverableArtifact;
+ /** Unknown chronology is not an absent backup, nor an older dated backup. */
+ ageUnknown?: Record<'backup' | 'pbs' | 'archive' | 'snapshot', boolean>;
latestTask?: CoverageTask;
pbsCount: number;
archiveCount: number;
@@ -138,9 +141,10 @@ export function getRecoveryAgeBand(
createdMs: number | undefined,
nowMs: number = Date.now(),
): RecoveryAgeBand {
- if (createdMs === undefined || !Number.isFinite(createdMs)) return 'unknown';
+ if (createdMs === undefined || createdMs <= 0 || !Number.isFinite(new Date(createdMs).getTime()))
+ return 'unknown';
const ageMs = nowMs - createdMs;
- if (!Number.isFinite(ageMs)) return 'unknown';
+ if (!Number.isFinite(ageMs) || ageMs < 0) return 'unknown';
if (ageMs <= CURRENT_RECOVERY_MS) return 'current';
if (ageMs <= STALE_RECOVERY_MS) return 'aging';
return 'stale';
@@ -450,6 +454,48 @@ function newest<T>(items: readonly T[], getMs: (item: T) => number | undefined):
return best;
}
+/** Shared by the full inventory and the location-filtered Coverage view. */
+export function selectWorkloadRecoveryArtifacts(
+ artifacts: readonly RecoverableArtifact[],
+ nowMs: number,
+): Pick<
+ WorkloadCoverageRow,
+ 'latestBackup' | 'latestPBS' | 'latestArchive' | 'latestSnapshot' | 'ageUnknown'
+> {
+ // Completion remains independent of age. Keep every artifact listed, but
+ // don't guess the latest when even one completed date cannot be ordered.
+ const completed = artifacts.filter((artifact) => !artifact.running && !artifact.failed);
+ const select = (items: RecoverableArtifact[]) => {
+ const unknown = items.some(
+ (artifact) => getRecoveryAgeBand(artifact.createdMs, nowMs) === 'unknown',
+ );
+ const latest = unknown ? undefined : newest(items, (artifact) => artifact.createdMs);
+ return {
+ unknown,
+ // Coverage reconciles its row store in place. Each pointer needs its
+ // own scalar fields: otherwise updating latestArchive can mutate the
+ // same object also held by latestBackup after a newer PBS point arrives.
+ latest: latest ? { ...latest } : undefined,
+ };
+ };
+ const backup = select(completed.filter(isBackupArtifact));
+ const pbs = select(completed.filter((artifact) => artifact.sourceKind === 'pbs'));
+ const archive = select(completed.filter((artifact) => artifact.sourceKind === 'archive'));
+ const snapshot = select(completed.filter((artifact) => artifact.sourceKind === 'snapshot'));
+ return {
+ latestBackup: backup.latest,
+ latestPBS: pbs.latest,
+ latestArchive: archive.latest,
+ latestSnapshot: snapshot.latest,
+ ageUnknown: {
+ backup: backup.unknown,
+ pbs: pbs.unknown,
+ archive: archive.unknown,
+ snapshot: snapshot.unknown,
+ },
+ };
+}
+
function taskLabel(task: BackupTask): string {
const normalized = normalizeKey(task.status);
if (normalized === 'ok' || normalized === 'success' || normalized === 'completed') return 'OK';
@@ -545,7 +591,9 @@ export function buildProxmoxBackupRecoveryModel(
backup.namespace,
backup.datastore,
]);
- const createdMs = parseTimestampMs(backup.backupTime);
+ const parsedMs = parseTimestampMs(backup.backupTime);
+ const createdMs =
+ getRecoveryAgeBand(parsedMs, input.nowMs) === 'unknown' ? undefined : parsedMs;
const running =
backup.inProgress === true &&
(backup.writeActivityObserved !== true || backup.writeActive === true);
@@ -580,7 +628,9 @@ export function buildProxmoxBackupRecoveryModel(
archive.instance,
archive.node,
]);
- const createdMs = parseTimestampMs(archive.time);
+ const parsedMs = parseTimestampMs(archive.time);
+ const createdMs =
+ getRecoveryAgeBand(parsedMs, input.nowMs) === 'unknown' ? undefined : parsedMs;
addArtifact({
id: `archive:${archive.id}`,
nativeId: archive.id,
@@ -611,7 +661,9 @@ export function buildProxmoxBackupRecoveryModel(
snapshot.instance,
snapshot.node,
]);
- const createdMs = parseTimestampMs(snapshot.time);
+ const parsedMs = parseTimestampMs(snapshot.time);
+ const createdMs =
+ getRecoveryAgeBand(parsedMs, input.nowMs) === 'unknown' ? undefined : parsedMs;
addArtifact({
id: `snapshot:${snapshot.id}`,
nativeId: snapshot.id,
@@ -648,23 +700,7 @@ export function buildProxmoxBackupRecoveryModel(
}
for (const row of rows.values()) {
- // Running and terminally incomplete artifacts cannot be restored from, so
- // the "latest" pointers (which answer "what can I recover to?") skip them.
- // The artifacts themselves stay listed with an honest state.
- const completed = row.artifacts.filter((artifact) => !artifact.running && !artifact.failed);
- row.latestBackup = newest(completed.filter(isBackupArtifact), (artifact) => artifact.createdMs);
- row.latestPBS = newest(
- completed.filter((artifact) => artifact.sourceKind === 'pbs'),
- (artifact) => artifact.createdMs,
- );
- row.latestArchive = newest(
- completed.filter((artifact) => artifact.sourceKind === 'archive'),
- (artifact) => artifact.createdMs,
- );
- row.latestSnapshot = newest(
- completed.filter((artifact) => artifact.sourceKind === 'snapshot'),
- (artifact) => artifact.createdMs,
- );
+ Object.assign(row, selectWorkloadRecoveryArtifacts(row.artifacts, input.nowMs));
}
const coverageRows = Array.from(rows.values()).map((row) => {
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts b/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts
index 92e3e2f3a0..e2299253bc 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts
@@ -205,7 +205,7 @@ const COVERAGE_WEIGHTS: Record<
// Posture keeps its whole compact word ("Unknown"), the two age cells hold
// the suffix-free compact age, and the job dot takes what a "Job" header
// needs.
- compact: { workload: 40, posture: 21, latest: 14.5, pbs: 14.5, task: 10 },
+ compact: { workload: 40, posture: 20, latest: 15, pbs: 15, task: 10 },
// Above the phone projection the identity columns (workload, node) take the
// slack that the short type badge, target id, and age cells cannot use, so
// names stay whole instead of truncating beside empty space.
@@ -308,10 +308,10 @@ const RECOVERABLE_WEIGHTS: Record<
ProxmoxBackupsTableLayoutMode,
Partial<Record<RecoverableColumnId, number>>
> = {
- // Reserve enough phone-width space for complete state badges (including
- // Failed and Running) rather than clipping the recovery answer at the
- // scroll edge. Identity remains on the canonical 40% anchor.
- compact: { workload: 40, source: 16, created: 14, state: 30 },
+ // Unknown is a safety answer, not an abbreviated age: reserve room for
+ // the whole word alongside complete state badges (including Failed and
+ // Running). Identity remains on the canonical 40% anchor.
+ compact: { workload: 40, source: 16, created: 21, state: 23 },
basic: { workload: 28, source: 14, location: 23, created: 18, state: 17 },
operational: {
workload: 24,
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx b/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx
index e3651c157f..a82b9c27eb 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx
@@ -45,14 +45,14 @@ const recoveryAgeClassByBand: Record<RecoveryAgeBand, string> = {
current: 'text-emerald-600 dark:text-emerald-300',
aging: 'text-amber-600 dark:text-amber-300',
stale: 'text-red-600 dark:text-red-300',
- unknown: 'text-muted',
+ unknown: 'text-amber-600 dark:text-amber-300',
};
const recoveryAgeTitleByBand: Record<RecoveryAgeBand, string> = {
current: 'Current backup age',
aging: 'Aging backup age',
stale: 'Stale backup age',
- unknown: 'Backup age unavailable',
+ unknown: 'Restore-point date is unavailable or in the future. Its age is unknown.',
};
export const ARCHIVE_STATUS_FILTERS: FilterOption<
@@ -233,17 +233,25 @@ export function formatCompactBackupAge(createdAt: string): string {
export function ProxmoxBackupAgeText(props: { artifact: RecoverableArtifact; compact?: boolean }) {
const band = () => getRecoveryAgeBand(props.artifact.createdMs);
const title = () => {
+ if (band() === 'unknown') return recoveryAgeTitleByBand.unknown;
const parts = [recoveryAgeTitleByBand[band()], props.artifact.createdAt].filter(Boolean);
return parts.join(' · ');
};
return (
- <span class={`font-semibold tabular-nums ${recoveryAgeClassByBand[band()]}`} title={title()}>
- <Show
- when={props.compact}
- fallback={<PlatformTableRelativeTimeValue value={props.artifact.createdAt} />}
- >
- {formatCompactBackupAge(props.artifact.createdAt)}
+ <span
+ class={`font-semibold tabular-nums ${recoveryAgeClassByBand[band()]}`}
+ classList={{ 'text-[10px]': props.compact && band() === 'unknown' }}
+ title={title()}
+ aria-label={band() === 'unknown' ? `Unknown age. ${title()}` : undefined}
+ >
+ <Show when={band() !== 'unknown'} fallback="Unknown">
+ <Show
+ when={props.compact}
+ fallback={<PlatformTableRelativeTimeValue value={props.artifact.createdAt} />}
+ >
+ {formatCompactBackupAge(props.artifact.createdAt)}
+ </Show>
</Show>
</span>
);