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.

Bound uncertain backup task evidence on disclosure

pulse-triage[bot]47c1c4b297c5
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 700845be31..f137b4d9eb 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -8448,3 +8448,30 @@ External-agent activity telemetry now skips first-party browser requests
(`Sec-Fetch-Site: same-origin`) before writing `external_agent_activity.json`.
It writes fewer records to the same file and opens no new storage, backup or
recovery path.
+
+### Uncertain task histories use bounded, complete inspection
+
+When missing, future or tied start times leave multiple possible latest tasks,
+Coverage initially renders eight task detail cards, not the whole provider
+history. The preview includes a witness of each observed outcome (including
+error text) and known/unknown-start group, preserving the model's deterministic,
+explicitly non-chronological order. Full-candidate status, error-text and unknown-
+start counts remain visible, and every candidate stays available through an
+explicit eight-at-a-time control without more API reads. Search continues to
+match the complete workload evidence, not just its preview.
+
+Deliberate preview expansion survives ordinary polling of the open workload.
+The same control retains focus when the list shrinks, becomes ordered or empties;
+its exhausted state is guarded. Opening another workload or reopening the panel
+starts bounded again. No candidate is discarded, no latest task is chosen from
+ambiguous times, and neither task success nor disclosure establishes protection,
+a restore or guest responsiveness. Identity, posture, provider collection and
+polling semantics are unchanged.
+
+Normal-suite `backupTaskEvidence.test.tsx` exercises the parsed inventory consumer
+with a 200-task history, adverse status/error witnesses, complete inspection,
+search and polling/focus. The registered `ProxmoxCoverageTable.test.tsx` verifies
+per-workload reset. Desktop and narrow browser proof must exercise the actual
+inventory consumer, the bounded disclosure, keyboard/touch expansion and live
+shrink/ordering with actual pixel inspection. This is an inspection/rendering
+bound, not a measured installed CPU improvement or original guest recovery.
diff --git a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
index e735f91f50..59d9627f72 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
@@ -11,6 +11,7 @@ import {
import {
InlineDetailPanel,
+ DetailSectionTable,
compactDetailRows,
compactDetailSections,
makeDetailRow,
@@ -66,6 +67,8 @@ import {
getCoverageLayoutForContainer,
isCoverageEvidenceColumnVisible,
selectCoverageRestoreEvidence,
+ selectCoverageTaskEvidence,
+ COVERAGE_TASK_EVIDENCE_PAGE_SIZE,
COVERAGE_RESTORE_EVIDENCE_PAGE_SIZE,
type CoverageColumnId,
} from './proxmoxBackupsTablePresentation';
@@ -279,6 +282,95 @@ const buildCoverageTaskSection = (task: CoverageTask, label: string): DetailSect
),
});
+function CoverageTaskCandidates(props: { tasks: readonly CoverageTask[] }) {
+ const [limit, setLimit] = createSignal(COVERAGE_TASK_EVIDENCE_PAGE_SIZE);
+ const [retainControl, setRetainControl] = createSignal(false);
+ createEffect(() => {
+ if (props.tasks.length > COVERAGE_TASK_EVIDENCE_PAGE_SIZE) setRetainControl(true);
+ });
+ const preview = createMemo(() => selectCoverageTaskEvidence(props.tasks, limit()));
+ const counts = createMemo(() => {
+ const tasks = props.tasks;
+ return [
+ ['Failed', tasks.filter((task) => task.label === 'Failed').length],
+ ['Running', tasks.filter((task) => task.label === 'Running').length],
+ ['OK', tasks.filter((task) => task.label === 'OK').length],
+ [
+ 'Other status',
+ tasks.filter((task) => !['Failed', 'Running', 'OK'].includes(task.label)).length,
+ ],
+ ['With error text', tasks.filter((task) => task.error?.trim()).length],
+ ['Unknown start', tasks.filter((task) => task.startedMs === undefined).length],
+ ]
+ .filter(([, count]) => count)
+ .map(([label, count]) => `${label}: ${count}`)
+ .join(' · ');
+ });
+ return (
+ <Show when={props.tasks.length > 0 || retainControl()}>
+ <div class="space-y-2" data-coverage-task-candidates>
+ <p class="text-[11px] text-muted whitespace-normal wrap-anywhere" role="status">
+ Showing {preview().length} of {props.tasks.length} possible latest tasks.
+ <Show when={props.tasks.length === 0}> No uncertain tasks remain in this read.</Show>
+ </p>
+ <Show when={props.tasks.length > 0}>
+ <p class="text-[11px] text-muted whitespace-normal wrap-anywhere">{counts()}</p>
+ <Show when={props.tasks.length > preview().length}>
+ <p class="text-[11px] text-muted whitespace-normal wrap-anywhere">
+ The preview includes each observed outcome and known or unknown start group. It is not
+ a time order.
+ </p>
+ </Show>
+ </Show>
+ {/* Outside rebuilt detail sections: the same control keeps keyboard focus
+ through expansion, polling, exhaustion and candidate withdrawal. */}
+ <Show when={retainControl()}>
+ <button
+ type="button"
+ class="rounded-sm px-2 py-1 text-xs font-medium text-accent hover:bg-surface-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent"
+ aria-disabled={preview().length >= props.tasks.length}
+ onClick={() => {
+ if (preview().length < props.tasks.length)
+ setLimit(preview().length + COVERAGE_TASK_EVIDENCE_PAGE_SIZE);
+ }}
+ >
+ <Show
+ when={preview().length < props.tasks.length}
+ fallback={<>All {preview().length} possible latest tasks shown</>}
+ >
+ Show{' '}
+ {Math.min(COVERAGE_TASK_EVIDENCE_PAGE_SIZE, props.tasks.length - preview().length)}{' '}
+ more possible latest tasks
+ </Show>
+ </button>
+ </Show>
+ <Show when={props.tasks.length > 0}>
+ <DetailSectionTable
+ wrapValues
+ sections={[
+ {
+ label: 'Task order',
+ rows: [makeDetailRow('Latest task', 'Unknown', { tone: 'warning' })],
+ footerContent: (
+ <p class="whitespace-normal text-[11px] leading-snug text-muted wrap-anywhere">
+ {TASK_ORDER_NOTICE}
+ </p>
+ ),
+ },
+ ...preview().map((task) =>
+ buildCoverageTaskSection(
+ task,
+ `Possible latest task ${props.tasks.indexOf(task) + 1}`,
+ ),
+ ),
+ ]}
+ />
+ </Show>
+ </div>
+ </Show>
+ );
+}
+
// Provider evidence quality (did the job run, is history complete, can Pulse
// read it) explains a posture; it is detail, not the answer.
const buildCoverageDetailSections = (row: WorkloadCoverageRow): DetailSection[] =>
@@ -314,20 +406,6 @@ const buildCoverageDetailSections = (row: WorkloadCoverageRow): DetailSection[]
),
}
: null,
- row.taskCandidates?.length
- ? {
- label: 'Task order',
- rows: compactDetailRows([makeDetailRow('Latest task', 'Unknown', { tone: 'warning' })]),
- footerContent: (
- <p class="whitespace-normal text-[11px] leading-snug text-muted wrap-anywhere">
- {TASK_ORDER_NOTICE}
- </p>
- ),
- }
- : null,
- ...(row.taskCandidates ?? []).map((task, index) =>
- buildCoverageTaskSection(task, `Possible latest task ${index + 1}`),
- ),
row.latestTask ? buildCoverageTaskSection(row.latestTask, 'Latest task') : null,
{
label: 'Provider evidence',
@@ -1016,6 +1094,7 @@ export function ProxmoxCoverageTable(props: {
</div>
</Show>
</div>
+ <CoverageTaskCandidates tasks={row.taskCandidates ?? []} />
</InlineDetailPanel>
</InlineDetailTableRow>
</Show>
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxCoverageTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxCoverageTable.test.tsx
index de7d5217ed..1532d65cfb 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxCoverageTable.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxCoverageTable.test.tsx
@@ -70,6 +70,55 @@ const headerTexts = () =>
afterEach(cleanup);
describe('ProxmoxCoverageTable column visibility', () => {
+ it('resets a deliberate task preview when another workload is opened, not on a refresh', () => {
+ const tasks = Array.from({ length: 24 }, (_, index) =>
+ identityTask({ id: `candidate-${index}`, startTime: 'invalid' }),
+ );
+ const model = buildProxmoxBackupRecoveryModel({
+ workloads: [identityGuest('east-100', 'east', 'pve-1')],
+ tasks,
+ pbsBackups: [],
+ archives: [],
+ snapshots: [],
+ nowMs: BACKUP_IDENTITY_NOW,
+ });
+ const first = model.coverageRows[0];
+ const second = {
+ ...first,
+ key: 'second',
+ workload: { ...first.workload, key: 'second', name: 'second' },
+ };
+ const [expanded, setExpanded] = createSignal<string | null>(first.key);
+ renderInRouter(() => (
+ <ProxmoxCoverageTable
+ rows={[first, second]}
+ hasAnyRows
+ emptyIcon={<span />}
+ emptyTitle=""
+ emptyDescription=""
+ sortKey={() => 'posture'}
+ sortDirection={() => 'asc'}
+ onSort={() => {}}
+ expandedKey={expanded()}
+ onToggleExpand={(key) => setExpanded(expanded() === key ? null : key)}
+ showTaskColumn
+ />
+ ));
+ fireEvent.click(screen.getByRole('button', { name: 'Show 8 more possible latest tasks' }));
+ expect(screen.getByTestId('proxmox-coverage-detail')).toHaveTextContent(
+ 'Showing 16 of 24 possible latest tasks.',
+ );
+ setExpanded(second.key);
+ expect(screen.getByTestId('proxmox-coverage-detail')).toHaveTextContent(
+ 'Showing 8 of 24 possible latest tasks.',
+ );
+ setExpanded(null);
+ setExpanded(first.key);
+ expect(screen.getByTestId('proxmox-coverage-detail')).toHaveTextContent(
+ 'Showing 8 of 24 possible latest tasks.',
+ );
+ });
+
it('keeps malformed assessment dates unknown instead of normalising them or borrowing a clock', () => {
renderInRouter(() => (
<ProxmoxCoverageTable
diff --git a/frontend-modern/src/features/proxmox/__tests__/backupTaskEvidence.test.tsx b/frontend-modern/src/features/proxmox/__tests__/backupTaskEvidence.test.tsx
index 066e9f795a..51c77107f9 100644
--- a/frontend-modern/src/features/proxmox/__tests__/backupTaskEvidence.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/backupTaskEvidence.test.tsx
@@ -326,3 +326,120 @@ describe('uncertain task chronology through the inventory consumer', () => {
expect(api.fetch).toHaveBeenCalledTimes(2);
});
});
+
+// A provider history can contribute 200 tasks per node. If its clock is wrong,
+// none of those starts can rule out a task as latest. Keep the complete evidence
+// searchable without creating hundreds of detail cards on a single disclosure.
+describe('bounded uncertain-task inspection', () => {
+ const history = () =>
+ Array.from({ length: 200 }, (_, index) =>
+ identityTask({
+ id: `history-${String(index).padStart(3, '0')}`,
+ startTime: index === 199 ? '2026-10-04T11:00:00Z' : 'invalid',
+ status:
+ index === 198 ? 'failed' : index === 199 ? 'running' : index === 197 ? 'warning' : 'OK',
+ error: index === 198 ? failure : undefined,
+ }),
+ );
+ const cards = (panel: HTMLElement) =>
+ within(panel).queryAllByText(/^Possible latest task \d+$/, { selector: 'th' });
+
+ it.each([320, 1200])(
+ 'bounds a 200-task disclosure and preserves outcome witnesses at %ipx',
+ async (width) => {
+ api.width = width;
+ tasks = history();
+ mount();
+ const panel = await open();
+ expect(cards(panel)).toHaveLength(8);
+ expect(panel).toHaveTextContent('Showing 8 of 200 possible latest tasks.');
+ expect(panel).toHaveTextContent(
+ 'Failed: 1 · Running: 1 · OK: 197 · Other status: 1 · With error text: 1 · Unknown start: 199',
+ );
+ for (const id of ['history-197', 'history-198', 'history-199'])
+ expect(panel).toHaveTextContent(id);
+ expect(panel.textContent).toContain(failure);
+ expect(panel.querySelector('svg[onload]')).toBeNull();
+ expect(panel).toHaveTextContent('It is not a time order.');
+ expect(panel).not.toHaveTextContent('history-150');
+ expect(screen.getByRole('button', { name: '2 unknown' })).toBeInTheDocument();
+ expect(api.fetch).toHaveBeenCalledTimes(2);
+ },
+ );
+
+ it('allows deliberate complete inspection without more reads, and keeps the same focused control', async () => {
+ tasks = history();
+ mount();
+ const panel = await open();
+ const more = within(panel).getByRole('button', { name: 'Show 8 more possible latest tasks' });
+ more.focus();
+ for (let expected = 16; expected <= 200; expected += 8) {
+ fireEvent.click(more);
+ expect(cards(panel)).toHaveLength(expected);
+ expect(document.activeElement).toBe(more);
+ }
+ expect(more).toHaveTextContent('All 200 possible latest tasks shown');
+ expect(more).toHaveAttribute('aria-disabled', 'true');
+ fireEvent.click(more);
+ expect(cards(panel)).toHaveLength(200);
+ for (const task of tasks) expect(panel).toHaveTextContent(task.id);
+ expect(api.fetch).toHaveBeenCalledTimes(2);
+ expect(api.json).toHaveBeenCalledTimes(1);
+ });
+
+ it('retains expansion and focus through replacement, shrink, ordered and empty polling', async () => {
+ tasks = history();
+ mount();
+ const panel = await open();
+ const more = within(panel).getByRole('button', { name: 'Show 8 more possible latest tasks' });
+ more.focus();
+ fireEvent.click(more);
+ expect(cards(panel)).toHaveLength(16);
+
+ tasks = history().map((task) => ({
+ ...task,
+ error: task.error ? 'updated literal <b>failure</b>' : undefined,
+ }));
+ await vi.advanceTimersByTimeAsync(30_000);
+ await waitFor(() => expect(panel).toHaveTextContent('updated literal <b>failure</b>'));
+ expect(cards(panel)).toHaveLength(16);
+ expect(document.activeElement).toBe(more);
+ tasks = tasks.slice(0, 3);
+ await vi.advanceTimersByTimeAsync(30_000);
+ await waitFor(() => expect(more).toHaveTextContent('All 3 possible latest tasks shown'));
+ expect(cards(panel)).toHaveLength(3);
+ expect(panel.textContent).not.toContain(failure);
+ expect(document.activeElement).toBe(more);
+ tasks = [identityTask({ id: 'now-ordered' })];
+ await vi.advanceTimersByTimeAsync(30_000);
+ await waitFor(() => expect(panel).toHaveTextContent('now-ordered'));
+ expect(cards(panel)).toHaveLength(0);
+ expect(more).toHaveTextContent('All 0 possible latest tasks shown');
+ expect(panel).toHaveTextContent('No uncertain tasks remain in this read.');
+ expect(panel).not.toHaveTextContent('Task order');
+ expect(document.activeElement).toBe(more);
+ tasks = [];
+ await vi.advanceTimersByTimeAsync(30_000);
+ await waitFor(() => expect(panel).not.toHaveTextContent('now-ordered'));
+ expect(document.activeElement).toBe(more);
+ expect(screen.getByTestId('proxmox-coverage-detail')).toBe(panel);
+ expect(api.fetch).toHaveBeenCalledTimes(10);
+ });
+
+ it('continues to find an undisplayed candidate through saved-view workload search', async () => {
+ vi.useRealTimers();
+ vi.useFakeTimers({ now: BACKUP_IDENTITY_NOW, toFake: ['Date'] });
+ tasks = history();
+ mount();
+ const panel = await open();
+ const search = screen.getByPlaceholderText(
+ 'Search backups by workload, node, source, or status',
+ );
+ fireEvent.input(search, { target: { value: 'history-150' } });
+ await waitFor(() => expect(window.location.search).toContain('q=history-150'));
+ expect(document.querySelectorAll('[data-proxmox-backup-row="coverage"]')).toHaveLength(1);
+ expect(cards(panel)).toHaveLength(8);
+ expect(panel).toHaveTextContent('Showing 8 of 200 possible latest tasks.');
+ expect(api.fetch).toHaveBeenCalledTimes(2);
+ });
+});
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts b/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts
index dfc9dbd8da..b1a159535a 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts
@@ -419,3 +419,37 @@ export const selectCoverageRestoreEvidence = <
}
return newestFirst.filter((artifact) => picked.has(artifact.id));
};
+
+export const COVERAGE_TASK_EVIDENCE_PAGE_SIZE = 8;
+
+// Unknown/tied starts can leave an entire provider history as possible latest
+// tasks. Bound the initial disclosure, but keep a witness of each outcome and
+// known/unknown start group so an OK prefix cannot hide failure or uncertainty.
+// Preserve the model's deterministic, explicitly non-chronological order.
+export const selectCoverageTaskEvidence = <
+ T extends { id: string; label: string; startedMs?: number; error?: string },
+>(
+ tasks: readonly T[],
+ limit = COVERAGE_TASK_EVIDENCE_PAGE_SIZE,
+): T[] => {
+ const picked = new Set<string>();
+ const groups = new Set<string>();
+ for (const task of tasks) {
+ const outcome = task.error?.trim()
+ ? 'Failed'
+ : ['Failed', 'Running', 'OK'].includes(task.label)
+ ? task.label
+ : 'other';
+ const group = `${outcome}:${task.startedMs === undefined ? 'unknown' : 'known'}`;
+ if (!groups.has(group)) {
+ groups.add(group);
+ picked.add(task.id);
+ }
+ }
+ const cap = Math.max(limit, picked.size);
+ for (const task of tasks) {
+ if (picked.size >= cap) break;
+ picked.add(task.id);
+ }
+ return tasks.filter((task) => picked.has(task.id));
+};