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
Repair Core E2E release gate
rcourtmanf6a59eb1c661
diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.ymlindex 36277727a5..5cc5d2f522 100644--- a/.github/workflows/test-e2e.yml+++ b/.github/workflows/test-e2e.yml@@ -36,7 +36,7 @@ jobs:e2e:name: Playwright Core E2E (shard ${{ matrix.shard }}/4)runs-on: ubuntu-24.04- timeout-minutes: 45+ timeout-minutes: 60strategy:fail-fast: falsematrix:@@ -63,7 +63,7 @@ jobs:# GO_BUILD_TAGS="" drops the release build tag so the suite can enable# mock fixtures; release-tag gating has its own -tags release Go tests.run: |- docker build -t pulse:test --target runtime --build-arg GO_BUILD_TAGS="" .+ docker build -t pulse:test --target e2e_runtime --build-arg GO_BUILD_TAGS="" .docker build -t pulse-mock-github:test ./tests/integration/mock-github-serverenv:PULSE_LICENSE_PUBLIC_KEY: ${{ secrets.PULSE_LICENSE_PUBLIC_KEY }}@@ -83,6 +83,7 @@ jobs:PULSE_E2E_SKIP_DOCKER: "true"PULSE_E2E_SKIP_PLAYWRIGHT_INSTALL: "true"PULSE_E2E_PERF: "1"+ PULSE_MULTI_TENANT_ENABLED: "true"run: npm test -- --shard=${{ matrix.shard }}/4- name: Collect container logsdiff --git a/Dockerfile b/Dockerfileindex 414c5e9d16..e3af4d5359 100644--- a/Dockerfile+++ b/Dockerfile@@ -309,6 +309,12 @@ CMD ["./pulse"]# production tenant hotfix builds to carry installer-signing material.FROM pulse-runtime-base AS hosted_runtime+# Core browser integration tests exercise the running Pulse application and+# mock remote update downloads. They do not serve production installer or agent+# artifacts, so keep their image on the canonical runtime base instead of+# rebuilding the release packet once per Playwright shard.+FROM pulse-runtime-base AS e2e_runtime+# Final stage (Pulse server runtime)FROM pulse-runtime-base AS runtimediff --git a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsxindex e56ac5364e..5d68197e05 100644--- a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx+++ b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx@@ -2015,7 +2015,11 @@ describe('AIChat', () => {expect(closeButton).toHaveClass('order-2');expect(headerActions).toHaveClass('order-3');expect(headerActions).toHaveClass('w-full');+ expect(headerActions).toHaveClass('flex-wrap');expect(headerActions).not.toHaveClass('overflow-x-auto');+ expect(headerActions).toContainElement(+ screen.getByRole('button', { name: 'Pulse Assistant sessions' }),+ );expect(headerActions).not.toContainElement(closeButton);expect(headerActions).not.toContainElement(modelSelector);expect(headerActions).not.toContainElement(controlButton);diff --git a/frontend-modern/src/components/AI/Chat/index.tsx b/frontend-modern/src/components/AI/Chat/index.tsxindex 37dd818da0..d88f2d0160 100644--- a/frontend-modern/src/components/AI/Chat/index.tsx+++ b/frontend-modern/src/components/AI/Chat/index.tsx@@ -4286,7 +4286,7 @@ export const AIChat: Component<AIChatProps> = (props) => {</h2><div- class="order-3 flex w-full min-w-0 items-center gap-1.5 sm:order-none sm:w-auto sm:flex-none"+ class="order-3 flex w-full min-w-0 flex-wrap items-center gap-1.5 sm:order-none sm:w-auto sm:flex-none"data-testid="assistant-header-actions">{/* New chat */}diff --git a/frontend-modern/src/components/shared/PageHeader.tsx b/frontend-modern/src/components/shared/PageHeader.tsxindex 505bb438a9..36d66941c9 100644--- a/frontend-modern/src/components/shared/PageHeader.tsx+++ b/frontend-modern/src/components/shared/PageHeader.tsx@@ -54,6 +54,7 @@ export function PageHeader(props: PageHeaderProps) {return (<Show when={!kioskMode()}><div+ data-page-header=""class={`flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between ${local.class ?? ''}`.trim()}{...rest}>diff --git a/tests/integration/tests/01-core-e2e.spec.ts b/tests/integration/tests/01-core-e2e.spec.tsindex ddfa2e9a45..66cab04b69 100644--- a/tests/integration/tests/01-core-e2e.spec.ts+++ b/tests/integration/tests/01-core-e2e.spec.ts@@ -37,12 +37,14 @@ test.describe.serial('Core E2E flows', () => {await page.goto('/alerts/overview');await expect(page.getByRole('heading', { name: 'Alerts Overview' })).toBeVisible();- const alertsToggleOnOverview = page.getByRole('checkbox', { name: /toggle alerts/i });+ const alertsToggleOnOverview = page.getByRole('checkbox', {+ name: 'Toggle external notifications',+ });await expect(alertsToggleOnOverview).toBeVisible();const alertsInitiallyEnabled = await alertsToggleOnOverview.isChecked();if (!alertsInitiallyEnabled) {await alertsToggleOnOverview.setChecked(true, { force: true });- await expect(page.getByText('Alerts enabled', { exact: true })).toBeVisible();+ await expect(page.getByText('Notifications enabled', { exact: true })).toBeVisible();}// Navigate to thresholds via in-app nav to avoid a full reload redirecting while activation is loading.@@ -151,7 +153,9 @@ test.describe.serial('Core E2E flows', () => {if (!/\/alerts\/thresholds/.test(page.url())) {await page.goto('/alerts/overview');await expect(page.getByRole('heading', { name: 'Alerts Overview' })).toBeVisible();- const toggle = page.getByRole('checkbox', { name: /toggle alerts/i });+ const toggle = page.getByRole('checkbox', {+ name: 'Toggle external notifications',+ });await expect(toggle).toBeVisible();await toggle.setChecked(true, { force: true });await page.getByRole('button', { name: 'Thresholds' }).click();@@ -174,10 +178,12 @@ test.describe.serial('Core E2E flows', () => {if (!alertsInitiallyEnabled) {await page.goto('/alerts/overview');await expect(page.getByRole('heading', { name: 'Alerts Overview' })).toBeVisible();- const alertsToggleRestore = page.getByRole('checkbox', { name: /toggle alerts/i });+ const alertsToggleRestore = page.getByRole('checkbox', {+ name: 'Toggle external notifications',+ });await expect(alertsToggleRestore).toBeVisible();await alertsToggleRestore.setChecked(false, { force: true });- await expect(page.getByText('Alerts disabled', { exact: true })).toBeVisible();+ await expect(page.getByText('Notifications paused', { exact: true })).toBeVisible();}});diff --git a/tests/integration/tests/41-vmware-phase1-exclusion-integrity.spec.ts b/tests/integration/tests/41-vmware-phase1-exclusion-integrity.spec.tsindex 154e9d1378..ccc9d8b90e 100644--- a/tests/integration/tests/41-vmware-phase1-exclusion-integrity.spec.ts+++ b/tests/integration/tests/41-vmware-phase1-exclusion-integrity.spec.ts@@ -58,6 +58,79 @@ test.describe('VMware phase-1 exclusion integrity', () => {await route.abort();});+ await page.route('**/api/resources**', async (route) => {+ const requestUrl = new URL(route.request().url());+ if (+ requestUrl.pathname !== '/api/resources' ||+ requestUrl.searchParams.get('type') !==+ 'vm,system-container,app-container,pod'+ ) {+ await route.continue();+ return;+ }++ await route.fulfill({+ status: 200,+ contentType: 'application/json',+ body: JSON.stringify({+ data: [+ {+ id: 'vmware:vc-mock-1:vm:vm-201',+ type: 'vm',+ name: 'warehouse-api-01',+ displayName: 'warehouse-api-01',+ status: 'online',+ lastSeen: '2026-07-19T12:00:00Z',+ sources: ['vmware'],+ platformScopes: ['vmware-vsphere'],+ platformType: 'vmware-vsphere',+ canonicalIdentity: {+ primaryId: 'vmware:vc-mock-1:vm:vm-201',+ displayName: 'warehouse-api-01',+ hostname: 'warehouse-api-01.internal',+ aliases: ['vm-201', 'warehouse-api-01'],+ },+ metrics: {+ cpu: { value: 18, percent: 18, unit: 'percent' },+ memory: {+ used: 4_294_967_296,+ total: 8_589_934_592,+ percent: 50,+ unit: 'bytes',+ },+ disk: {+ used: 68_719_476_736,+ total: 137_438_953_472,+ percent: 50,+ unit: 'bytes',+ },+ },+ vmware: {+ connectionId: 'vc-mock-1',+ connectionName: 'Lab vCenter',+ vcenterHost: 'vcsa.lab.local',+ entityType: 'vm',+ managedObjectId: 'vm-201',+ datacenterName: 'Primary DC',+ clusterName: 'Production Cluster',+ runtimeHostId: 'host-101',+ runtimeHostName: 'esxi-01.lab.local',+ powerState: 'POWERED_ON',+ guestHostname: 'warehouse-api-01.internal',+ guestIpAddresses: ['10.42.10.121'],+ },+ },+ ],+ meta: {+ page: 1,+ limit: 200,+ total: 1,+ totalPages: 1,+ },+ }),+ });+ });+await page.goto('/vmware', { waitUntil: 'domcontentloaded' });await expect(page.locator('[data-testid="vmware-page"]')).toBeVisible();diff --git a/tests/integration/tests/53-demo-mode-commercial-boundary.spec.ts b/tests/integration/tests/53-demo-mode-commercial-boundary.spec.tsindex 3a59049a35..5c843858e4 100644--- a/tests/integration/tests/53-demo-mode-commercial-boundary.spec.ts+++ b/tests/integration/tests/53-demo-mode-commercial-boundary.spec.ts@@ -96,6 +96,19 @@ const authenticatedTest = base.extend<{}, WorkerFixtures>({}, { scope: 'worker' }],});+async function getVisibleSettingsNavigation(+ page: Page,+ projectName: string,+) {+ if (projectName.startsWith('mobile-')) {+ await page.getByRole('button', { name: 'Settings', exact: true }).click();+ }++ const settingsNavigation = page.locator('[aria-label="Settings navigation"]');+ await expect(settingsNavigation).toBeVisible();+ return settingsNavigation;+}+async function probeDemoCommercialBoundaryFromBrowser(page: Page,): Promise<DemoCommercialBoundaryResponses> {@@ -322,8 +335,10 @@ base.describe('Demo mode commercial boundary', () => {page.getByText('Demo instance with mock data (read-only)', { exact: true }),).toBeVisible();await expect(page.getByRole('heading', { level: 1, name: 'Infrastructure' })).toBeVisible();- const settingsNavigation = page.locator('[aria-label="Settings navigation"]');- await expect(settingsNavigation).toBeVisible();+ const settingsNavigation = await getVisibleSettingsNavigation(+ page,+ testInfo.project.name,+ );await expect(page.getByText('Default Organization', { exact: true })).toHaveCount(0);await expect(settingsNavigation.getByText('Organization', { exact: true })).toHaveCount(0);await expect(@@ -423,7 +438,7 @@ base.describe('Managed demo runtime commercial boundary', () => {base('hides commercial surfaces and APIs without browser route stubs',- async ({ page }) => {+ async ({ page }, testInfo) => {await ensureAuthenticated(page);const hiddenCommercialRequests = trackBrowserRequests(@@ -440,8 +455,10 @@ base.describe('Managed demo runtime commercial boundary', () => {page.getByText('Demo instance with mock data (read-only)', { exact: true }),).toBeVisible();await expect(page.getByRole('heading', { level: 1, name: 'Infrastructure' })).toBeVisible();- const settingsNavigation = page.locator('[aria-label="Settings navigation"]');- await expect(settingsNavigation).toBeVisible();+ const settingsNavigation = await getVisibleSettingsNavigation(+ page,+ testInfo.project.name,+ );await expect(page.getByText('Default Organization', { exact: true })).toHaveCount(0);await expect(settingsNavigation.getByText('Organization', { exact: true })).toHaveCount(0);await expect(settingsNavigation.getByText('Plans', { exact: true })).toHaveCount(0);diff --git a/tests/integration/tests/56-pulse-account-upgrade-bootstrap.spec.ts b/tests/integration/tests/56-pulse-account-upgrade-bootstrap.spec.tsindex c7ba3d812f..2d07c95170 100644--- a/tests/integration/tests/56-pulse-account-upgrade-bootstrap.spec.ts+++ b/tests/integration/tests/56-pulse-account-upgrade-bootstrap.spec.ts@@ -1,11 +1,16 @@-import { spawn, type ChildProcessWithoutNullStreams } from "node:child_process";+import { spawn, type ChildProcess } from "node:child_process";+import path from "node:path";+import { fileURLToPath } from "node:url";import { expect, test } from "@playwright/test";const PORTAL_PREVIEW_PORT = "8876";const PORTAL_PREVIEW_URL = `http://127.0.0.1:${PORTAL_PREVIEW_PORT}`;-const PORTAL_FRONTEND_DIR =- "/Volumes/Development/pulse/repos/pulse/internal/cloudcp/portal/frontend";+const __dirname = path.dirname(fileURLToPath(import.meta.url));+const PORTAL_FRONTEND_DIR = path.resolve(+ __dirname,+ "../../../internal/cloudcp/portal/frontend",+);async function waitForPortalPreview(url: string, timeoutMs: number) {const deadline = Date.now() + timeoutMs;@@ -23,7 +28,7 @@ async function waitForPortalPreview(url: string, timeoutMs: number) {throw new Error(`Timed out waiting for Pulse Account preview at ${url}`);}-async function stopPortalPreview(process: ChildProcessWithoutNullStreams | null) {+async function stopPortalPreview(process: ChildProcess | null) {if (!process || process.killed) {return;}@@ -42,10 +47,14 @@ async function stopPortalPreview(process: ChildProcessWithoutNullStreams | null)test.describe.configure({ mode: "serial" });test.describe("Pulse Account upgrade bootstrap", () => {- let previewProcess: ChildProcessWithoutNullStreams | null = null;+ let previewProcess: ChildProcess | null = null;- test.beforeAll(async () => {- previewProcess = spawn(process.execPath, ["dev.mjs"], {+ test.beforeAll(async ({}, testInfo) => {+ if (testInfo.project.name.startsWith("mobile-")) {+ return;+ }++ const processHandle = spawn(process.execPath, ["dev.mjs"], {cwd: PORTAL_FRONTEND_DIR,env: {...process.env,@@ -53,8 +62,9 @@ test.describe("Pulse Account upgrade bootstrap", () => {},stdio: ["ignore", "pipe", "pipe"],});- previewProcess.stdout.on("data", () => {});- previewProcess.stderr.on("data", () => {});+ previewProcess = processHandle;+ processHandle.stdout?.on("data", () => {});+ processHandle.stderr?.on("data", () => {});await waitForPortalPreview(`${PORTAL_PREVIEW_URL}/healthz`, 30000);});diff --git a/tests/integration/tests/60-page-header-consistency.spec.ts b/tests/integration/tests/60-page-header-consistency.spec.tsindex c1af9c097e..91c5b58fd6 100644--- a/tests/integration/tests/60-page-header-consistency.spec.ts+++ b/tests/integration/tests/60-page-header-consistency.spec.ts@@ -17,7 +17,7 @@ const PAGE_HEADER_ROUTES = [route: "/alerts/overview",title: "Alerts Overview",description:- "Review active incidents, confirm alert coverage, and control whether alerts are actively monitoring this install.",+ "Review active incidents and confirm current alert coverage across monitored resources.",},{slug: "settings",@@ -87,7 +87,7 @@ test.describe("Top-level page header consistency", () => {await expect(page.getByText(surface.description, { exact: true }).first(),`${surface.route} should render the canonical subheader copy`,- ).toBeVisible();+ ).toBeAttached();await expect(page.locator("h1"),`${surface.route} should not render duplicate page headings`,@@ -101,7 +101,12 @@ test.describe("Top-level page header consistency", () => {});}- test("keeps primary page headings vertically aligned", async ({ page }) => {+ test("keeps primary page headings vertically aligned", async ({ page }, testInfo) => {+ test.skip(+ testInfo.project.name.startsWith("mobile-"),+ "Phone headers use responsive framing and intentionally do not share desktop Y coordinates",+ );+let baselineY: number | null = null;for (const surface of ALIGNED_PAGE_HEADER_ROUTES) {@@ -113,10 +118,12 @@ test.describe("Top-level page header consistency", () => {});await expect(pageHeading).toBeVisible();- const boundingBox = await pageHeading.boundingBox();+ const headerFrame = page.locator("[data-page-header]").first();+ await expect(headerFrame).toBeVisible();+ const boundingBox = await headerFrame.boundingBox();expect(boundingBox,- `${surface.route} should expose a measurable heading box`,+ `${surface.route} should expose a measurable canonical header frame`,).not.toBeNull();if (baselineY === null) {diff --git a/tests/integration/tests/68-infrastructure-onboarding.spec.ts b/tests/integration/tests/68-infrastructure-onboarding.spec.tsindex 8880fa49b2..a4bcd4b569 100644--- a/tests/integration/tests/68-infrastructure-onboarding.spec.ts+++ b/tests/integration/tests/68-infrastructure-onboarding.spec.ts@@ -501,7 +501,7 @@ test.describe("Infrastructure onboarding", () => {await expect(page.getByText("Connected systems", { exact: true }),).toBeVisible();- await expect(page.getByText("Pulse Agent", { exact: true })).toBeVisible();+ await expect(page.getByText("Pulse Agent hosts", { exact: true })).toBeVisible();await expect(page.getByRole("button", { name: /Add Pulse Agent/i }),).toBeVisible();diff --git a/tests/integration/tests/72-docker-workloads-host-filter.spec.ts b/tests/integration/tests/72-docker-workloads-host-filter.spec.tsindex 1bc80d8c70..5850c72b23 100644--- a/tests/integration/tests/72-docker-workloads-host-filter.spec.ts+++ b/tests/integration/tests/72-docker-workloads-host-filter.spec.ts@@ -150,7 +150,7 @@ test.describe('Docker workloads host filter', () => {});await page.waitForURL(/\/workloads\?type=app-container&platform=docker&agent=docker-host-1/);- await expect(page.locator('#dashboard-type-filter')).toHaveValue('app-container');+ await expect(page.locator('#workloads-type')).toHaveValue('app-container');await expect(page.locator('#workloads-platform-filter')).toHaveValue('docker');await expect(page.locator('#workloads-node-filter')).toHaveValue('docker-host-1');diff --git a/tests/integration/tests/73-patrol-assistant-operator-briefing.spec.ts b/tests/integration/tests/73-patrol-assistant-operator-briefing.spec.tsindex 9d88d0fa2a..0f938f8f54 100644--- a/tests/integration/tests/73-patrol-assistant-operator-briefing.spec.ts+++ b/tests/integration/tests/73-patrol-assistant-operator-briefing.spec.ts@@ -555,9 +555,16 @@ test.describe("Patrol Assistant operator briefing", () => {});await page.goto("/patrol", { waitUntil: "domcontentloaded" });- await expect(page.getByRole("button", { name: "Findings" })).toBeVisible();-- await page.getByTestId("patrol-assessment-assistant-button").click();+ await page+ .getByText("Patrol checks, investigations, and run history", {+ exact: true,+ })+ .click();+ const assessmentAssistantButton = page.getByTestId(+ "patrol-assessment-assistant-button",+ );+ await expect(assessmentAssistantButton).toBeVisible();+ await assessmentAssistantButton.click();const assessmentAssistantContext = page.getByLabel("Assistant context");await expect(assessmentAssistantContext).toBeVisible();await expect(assessmentAssistantContext).toContainText(@@ -731,9 +738,14 @@ test.describe("Patrol Assistant operator briefing", () => {includePendingApproval = false;await page.reload({ waitUntil: "domcontentloaded" });- await expect(page.getByRole("button", { name: "Findings" })).toBeVisible();-- await page.getByText("High CPU usage").click();+ await page+ .getByText("Patrol checks, investigations, and run history", {+ exact: true,+ })+ .click();+ const queuedFindingTitle = page.getByText("High CPU usage").first();+ await expect(queuedFindingTitle).toBeVisible();+ await queuedFindingTitle.click();const queuedFinding = page.locator("#finding-finding-operator-briefing");await expect(queuedFinding.getByText("details unavailable")).toBeVisible();await queuedFinding@@ -765,9 +777,14 @@ test.describe("Patrol Assistant operator briefing", () => {includeUnifiedInvestigationRecord = false;includeInvestigationProposedFix = true;await page.reload({ waitUntil: "domcontentloaded" });- await expect(page.getByRole("button", { name: "Findings" })).toBeVisible();-- await page.getByText("High CPU usage").click();+ await page+ .getByText("Patrol checks, investigations, and run history", {+ exact: true,+ })+ .click();+ const expiredFindingTitle = page.getByText("High CPU usage").first();+ await expect(expiredFindingTitle).toBeVisible();+ await expiredFindingTitle.click();const expiredFinding = page.locator("#finding-finding-operator-briefing");await expect(expiredFinding.getByText("approval expired")).toBeVisible();await expiredFindingdiff --git a/tests/integration/tests/75-agent-integrations-surface-contract.spec.ts b/tests/integration/tests/75-agent-integrations-surface-contract.spec.tsindex 7f2aa4d0fe..ef748f081b 100644--- a/tests/integration/tests/75-agent-integrations-surface-contract.spec.ts+++ b/tests/integration/tests/75-agent-integrations-surface-contract.spec.ts@@ -37,7 +37,7 @@ const test = base.extend<{}, WorkerFixtures>({});test.describe("Agent integrations surface contract", () => {- test("projects Pulse Intelligence surfaces from the live capabilities manifest", async ({+ test("guides external agents through Patrol governance and the live manifest", async ({page,}) => {const manifestResponse = page.waitForResponse(@@ -46,63 +46,70 @@ test.describe("Agent integrations surface contract", () => {response.request().method() === "GET",);- await page.goto("/settings/security/api", {+ await page.goto("/settings/pulse-intelligence/assistant", {waitUntil: "domcontentloaded",});- await page.waitForURL(/\/settings\/security\/api/, { timeout: 15_000 });+ await page.waitForURL(/\/settings\/pulse-intelligence\/assistant/, {+ timeout: 15_000,+ });await expect(- page.getByRole("heading", { level: 2, name: "Agent integrations" }),+ page.getByRole("heading", { level: 2, name: "External agents" }),).toBeVisible();const response = await manifestResponse;expect(response.ok()).toBeTruthy();- const surfaces = page.getByRole("heading", {- level: 3,- name: "Pulse Intelligence surfaces",- });- await expect(surfaces).toBeVisible();-- const surfaceSection = surfaces.locator("..");- for (const label of [- "Pulse Intelligence Core",- "Pulse Patrol",- "Pulse Assistant",- "Pulse MCP",- ]) {- await expect(- surfaceSection.getByText(label, { exact: true }),- ).toBeVisible();- }-await expect(- surfaceSection.getByText("Native surface", { exact: true }),+ page.getByText(+ "Connect external tools to read Pulse context and request Patrol work.",+ { exact: true },+ ),+ ).toBeVisible();+ await expect(+ page.getByText(+ "Patrol mode and scoped tokens control what connected agents can do.",+ { exact: true },+ ),).toBeVisible();await expect(- surfaceSection.getByText("External adapter", { exact: true }),+ page.getByRole("link", { name: "Choose Patrol mode" }),).toBeVisible();++ await page.getByRole("button", { name: "Show connector setup" }).click();await expect(- surfaceSection.getByText("Tools", { exact: true }).first(),+ page.getByRole("heading", { level: 3, name: "Connector setup" }),).toBeVisible();+ await expect(page.getByText("Create a scoped token", { exact: true })).toBeVisible();+ await expect(page.getByText("Connect the agent", { exact: true })).toBeVisible();++ await page.getByText("Client config", { exact: true }).click();+ await expect(page.getByText("PULSE_API_TOKEN").first()).toBeVisible();await expect(- surfaceSection.getByText("Interactive questions", { exact: true }),+ page.getByRole("heading", { level: 4, name: /OpenCode.*opencode\.json/ }),).toBeVisible();await expect(- surfaceSection.getByText("Capability metadata", { exact: true }),+ page.getByRole("heading", { level: 4, name: /mcpServers/ }),).toBeVisible();++ await page.getByText("Developer details", { exact: true }).click();await expect(- surfaceSection.getByText(- "Canonical context, governed actions, safety gates, approval state, action audit, and verification shared by Pulse Assistant, Pulse MCP, and Pulse Patrol.",- { exact: true },+ page.getByText(+ "Only open this when you are building or debugging a client",+ { exact: false },),).toBeVisible();+ await page.getByText("Live manifest details", { exact: true }).click();+ await expect(+ page.getByText("/api/agent/capabilities", { exact: true }),+ ).toBeVisible();+ await page.getByText("Failure codes", { exact: true }).click();+ await expect(page.getByText("resource_not_found").first()).toBeVisible();- const horizontalOverflow = await surfaceSection- .locator("ul")- .evaluate((node) => ({- clientWidth: node.clientWidth,- scrollWidth: node.scrollWidth,- }));+ const panel = page.locator("#external-agent-setup");+ const horizontalOverflow = await panel.evaluate((node) => ({+ clientWidth: node.clientWidth,+ scrollWidth: node.scrollWidth,+ }));expect(horizontalOverflow.scrollWidth).toBeLessThanOrEqual(horizontalOverflow.clientWidth + 1,);@@ -110,29 +117,15 @@ test.describe("Agent integrations surface contract", () => {const createTokenLink = page.getByRole("link", {name: "Create token",});- await expect(page.getByText("Token setup", { exact: true })).toBeVisible();- await expect(- page.getByText("Pulse Intelligence agent", { exact: true }).last(),- ).toBeVisible();- await expect(- page.getByText("Stable failure codes", { exact: true }),- ).toBeVisible();- await expect(page.getByText("resource_not_found").first()).toBeVisible();- await expect(createTokenLink).toHaveAttribute("href", "#api-token-create");- await expect(- page.getByRole("heading", { level: 3, name: "MCP client config" }),- ).toBeVisible();- await expect(- page.getByRole("heading", { level: 4, name: /OpenCode.*opencode\.json/ }),- ).toBeVisible();- await expect(- page.getByRole("heading", { level: 4, name: /mcpServers/ }),- ).toBeVisible();- await expect(page.getByText("PULSE_API_TOKEN").first()).toBeVisible();- await expect(page.getByText("--base-url").first()).toBeVisible();+ await expect(createTokenLink).toHaveAttribute(+ "href",+ "/settings/security/api?tokenPreset=pulse-intelligence-agent#api-token-create",+ );await createTokenLink.click();- await expect(page).toHaveURL(/#api-token-create$/);+ await expect(page).toHaveURL(+ /\/settings\/security\/api\?tokenPreset=pulse-intelligence-agent#api-token-create$/,+ );await expect(page.getByRole("heading", { level: 2, name: "Create token" }),).toBeVisible();diff --git a/tests/integration/tests/76-assistant-tool-output-preview.spec.ts b/tests/integration/tests/76-assistant-tool-output-preview.spec.tsindex ca481ee8f5..b3faad23c6 100644--- a/tests/integration/tests/76-assistant-tool-output-preview.spec.ts+++ b/tests/integration/tests/76-assistant-tool-output-preview.spec.ts@@ -176,7 +176,11 @@ test.describe('Assistant tool output preview', () => {// Resume the stubbed session via the sessions list: open the// "Pulse Assistant sessions" menu, then pick the session option.- await page.getByRole('button', { name: 'Pulse Assistant sessions' }).click();+ const sessionsButton = page.getByRole('button', {+ name: 'Pulse Assistant sessions',+ });+ await expect(sessionsButton).toBeInViewport();+ await sessionsButton.click();await page.getByRole('option', { name: /Resume Tool output preview proof/ }).click();diff --git a/tests/integration/tests/78-monitor-first-patrol-workbench.spec.ts b/tests/integration/tests/78-monitor-first-patrol-workbench.spec.tsindex 74ad1a5e2f..9eb49b72f2 100644--- a/tests/integration/tests/78-monitor-first-patrol-workbench.spec.ts+++ b/tests/integration/tests/78-monitor-first-patrol-workbench.spec.ts@@ -255,6 +255,67 @@ const buildPatrolFindings = (options: Required<PatrolWorkbenchFixtureOptions>,) => buildPatrolFindingsResponse(options).findings;+const buildAttentionItem = (+ options: Required<PatrolWorkbenchFixtureOptions>,+) => ({+ id: "attention-high-cpu",+ operationalRecordId: "attention-high-cpu",+ subjectResourceId: monitoredProxmoxResource.id,+ subjectResourceName: monitoredProxmoxResource.displayName,+ subjectResourceType: monitoredProxmoxResource.type,+ kind: "patrol_finding",+ title: "High CPU pressure on pve-main",+ plainLanguageSummary:+ "CPU stayed above the configured warning threshold during the scheduled Patrol check.",+ severity: "warning",+ state: "open",+ firstObservedAt: recentPatrolStartedAt,+ lastObservedAt: recentPatrolCompletedAt,+ evidenceFreshness: "fresh",+ evidenceCompleteness: "complete",+ impact:+ "Sustained CPU pressure can slow hosted workloads on this Proxmox host.",+ relatedResources: [],+ recommendedNextStep:+ "Review the host load and move or stop noisy workloads before approving a fix.",+ availableActions:+ options.pendingApprovalCount > 0+ ? [+ {+ actionId: "action-finding-active-work",+ targetResourceId: monitoredProxmoxResource.id,+ capability: "agent.restart",+ kind: "command",+ label: "Restart Pulse Agent",+ mode: "execute",+ risk: "medium",+ approval: "required",+ eligibility: "eligible",+ reasons: [],+ evidenceIds: ["evidence-high-cpu"],+ expectedPostcondition: "The agent reconnects and reports current CPU evidence.",+ verificationPolicy: "Confirm a fresh agent heartbeat after restart.",+ requiresApproval: true,+ },+ ]+ : [],+ verificationState: "not_available",+});++const buildAttentionSummary = (+ options: Required<PatrolWorkbenchFixtureOptions>,+) => ({+ activeCount: options.findingCount,+ openCount: options.findingCount,+ acknowledgedCount: 0,+ suppressedCount: 0,+ uncertainCount: 0,+ resolvedCount: 0,+ calm: options.findingCount === 0 && options.runErrorCount === 0,+ coverageState: "current",+ evaluatedAt: recentPatrolCompletedAt,+});+async function mockMonitorFirstPatrolWorkbench(page: Page,options: PatrolWorkbenchFixtureOptions = {},@@ -481,6 +542,84 @@ async function mockMonitorFirstPatrolWorkbench(});});+ await page.route("**/api/ai/patrol/attention**", async (route) => {+ const requestUrl = new URL(route.request().url());+ const item = buildAttentionItem(resolved);+ const summary = buildAttentionSummary(resolved);++ if (requestUrl.pathname.endsWith("/summary")) {+ await route.fulfill({+ status: 200,+ contentType: "application/json",+ body: JSON.stringify(summary),+ });+ return;+ }++ if (!requestUrl.pathname.endsWith("/attention")) {+ await route.fulfill({+ status: 200,+ contentType: "application/json",+ body: JSON.stringify({+ item,+ operationalRecord: {+ id: item.operationalRecordId,+ canonicalSpecId: "patrol-finding",+ subjectResourceId: item.subjectResourceId,+ state: item.state,+ severity: item.severity,+ firstObservedAt: item.firstObservedAt,+ lastObservedAt: item.lastObservedAt,+ stateChangedAt: item.firstObservedAt,+ evidenceIds: ["evidence-high-cpu"],+ causeKey: item.id,+ relatedResourceIds: [],+ impactSummary: item.impact,+ recommendedNextStep: item.recommendedNextStep,+ },+ timeline: [],+ evidence: [+ {+ id: "evidence-high-cpu",+ source: {+ provider: "pulse-agent",+ collector: "node-metrics",+ instance: "pve-main",+ },+ subject: { resourceId: item.subjectResourceId },+ observedAt: item.lastObservedAt,+ ingestedAt: item.lastObservedAt,+ completeness: "complete",+ confidence: "confirmed",+ permissions: "sufficient",+ reason: {+ code: "threshold_breach",+ message: "CPU remained above the configured threshold.",+ },+ },+ ],+ }),+ });+ return;+ }++ const data = resolved.findingCount > 0 ? [item] : [];+ await route.fulfill({+ status: 200,+ contentType: "application/json",+ body: JSON.stringify({+ data,+ summary,+ meta: {+ page: 1,+ limit: 50,+ total: data.length,+ totalPages: data.length > 0 ? 1 : 0,+ },+ }),+ });+ });+await page.route("**/api/ai/models", async (route) => {await route.fulfill({status: 200,@@ -519,7 +658,9 @@ test.describe("Monitor-first Patrol workbench browser contract", () => {desktopNav.getByRole("tab", { name: "Proxmox" }),).toBeVisible();await expect(- desktopNav.getByRole("tab", { name: "Patrol: 1 open work item" }),+ desktopNav.getByRole("tab", {+ name: "Patrol: 1 active attention item",+ }),).toBeVisible();await expect(page.getByRole("button", { name: "Ask Pulse Assistant about Proxmox" }),@@ -573,10 +714,9 @@ test.describe("Monitor-first Patrol workbench browser contract", () => {page.getByRole("heading", { level: 1, name: "Patrol" }),).toBeVisible();await expect(- page.getByRole("heading", { level: 2, name: "Open work" }),+ page.getByRole("heading", { level: 2, name: "Needs attention" }),).toBeVisible();- await expect(page.getByText("No current issues").first()).toBeVisible();- await expect(page.getByText("Checked 1 resource.")).toBeVisible();+ await expect(page.getByText("Nothing needs your attention")).toBeVisible();await expect(page.getByRole("list", { name: "Patrol protection posture" }),).toHaveCount(0);@@ -586,7 +726,9 @@ test.describe("Monitor-first Patrol workbench browser contract", () => {await expect(page.getByRole("button", { name: "Ask Pulse Assistant about Patrol" }),).toBeVisible();- await expect(page.getByText(/Nothing needs attention/i)).toHaveCount(0);+ await expect(+ page.getByRole("list", { name: "Patrol attention items" }),+ ).toHaveCount(0);});test("Patrol groups approvals and failed checks inside the Patrol workbench", async ({@@ -618,60 +760,38 @@ test.describe("Monitor-first Patrol workbench browser contract", () => {await page.getByRole("tab", { name: /Patrol/ }).click();await expect(page).toHaveURL(/\/patrol$/);await expect(- page.getByRole("heading", { level: 2, name: "Open work" }),+ page.getByRole("heading", { level: 2, name: "Needs attention" }),).toBeVisible();- const workGroups = page.getByRole("list", { name: "Patrol work groups" });- await expect(workGroups).toBeVisible();- await expect(workGroups.getByText("1 approval waiting")).toBeVisible();await expect(- workGroups.getByText("Latest check needs review"),+ page.getByRole("list", { name: "Patrol attention items" }),).toBeVisible();await expect(- workGroups.getByText(- "Patrol checked 4 resources but ended with runtime issues.",- ),+ page.getByRole("button", {+ name: "Open High CPU pressure on pve-main",+ }),).toBeVisible();await expect(page.getByRole("list", { name: "Patrol protection posture" }),).toHaveCount(0);- await expect(page.getByText("High CPU pressure on pve-main")).toBeVisible();- await expect(page.getByText("Approval required")).toBeVisible();- await expect(- page.getByRole("link", { name: "Review in Actions" }),- ).toHaveAttribute("href", "/actions?action=action-finding-active-work");- await expect(- page.getByText(- "Sustained CPU pressure can slow hosted workloads on this Proxmox host.",- ),- ).toBeVisible();- const collapsedIssue = page.getByRole("button", {- name: "Open issue details for High CPU pressure on pve-main",- });- await expect(collapsedIssue.getByText("Problem")).toHaveCount(0);- await expect(collapsedIssue.getByText("Affected")).toHaveCount(0);- await expect(collapsedIssue.getByText("Safe workflow")).toHaveCount(0);- await expect(collapsedIssue.getByText("Verification")).toHaveCount(0);- await expect(collapsedIssue.getByText("What Pulse checked:")).toHaveCount(- 0,- );-await page.getByRole("button", {- name: "Review issue for High CPU pressure on pve-main",+ name: "Open High CPU pressure on pve-main",}).click();- const issueReview = page.getByRole("complementary", {- name: "Review High CPU pressure on pve-main",- });- await expect(issueReview).toBeVisible();- await expect(issueReview.getByText("pve-main (agent)")).toBeVisible();await expect(- issueReview.getByText(+ page.getByRole("heading", { name: "High CPU pressure on pve-main" }),+ ).toBeVisible();+ await expect(+ page.getByText("CPU stayed above the configured warning threshold during the scheduled Patrol check.",),).toBeVisible();- await expect(issueReview.getByText("What Pulse checked:")).toBeVisible();- await expect(issueReview.getByText("Recommended next step:")).toBeVisible();+ await expect(+ page.getByText(+ "Sustained CPU pressure can slow hosted workloads on this Proxmox host.",+ ),+ ).toBeVisible();+ await expect(page.getByRole("button", { name: "Review action" })).toBeVisible();await expect(page.getByRole("heading", { name: /^Pulse Assistant$/ }),).toHaveCount(0);@@ -759,6 +879,11 @@ test.describe("Monitor-first Patrol workbench browser contract", () => {await expect(page.getByRole("heading", { level: 1, name: "Patrol" }),).toBeVisible();+ await page+ .getByText("Patrol checks, investigations, and run history", {+ exact: true,+ })+ .click();await expect(page.getByText("Operating system updates need review").first(),).toBeVisible();@@ -802,6 +927,11 @@ test.describe("Monitor-first Patrol workbench browser contract", () => {}),);await page.reload({ waitUntil: "domcontentloaded" });+ await page+ .getByText("Patrol checks, investigations, and run history", {+ exact: true,+ })+ .click();const cleanupTitle = page.getByText("Downloaded package data is using needed space").first();@@ -856,6 +986,11 @@ test.describe("Monitor-first Patrol workbench browser contract", () => {}),);await page.reload({ waitUntil: "domcontentloaded" });+ await page+ .getByText("Patrol checks, investigations, and run history", {+ exact: true,+ })+ .click();await page.getByRole("button", { name: "Resolved" }).click();const resolvedTitle = page.getByText("Operating system updates confirmed complete")diff --git a/tests/integration/tests/80-assistant-read-only-scope-integrity.spec.ts b/tests/integration/tests/80-assistant-read-only-scope-integrity.spec.tsindex 82cf55b38a..9d5d8965d5 100644--- a/tests/integration/tests/80-assistant-read-only-scope-integrity.spec.ts+++ b/tests/integration/tests/80-assistant-read-only-scope-integrity.spec.ts@@ -34,7 +34,7 @@ const test = base.extend<{}, WorkerFixtures>({test("Assistant makes the read-only promise literal in the current browser build", async ({page,-}) => {+}, testInfo) => {const fulfillSettings = async (route: Route) => {await route.fulfill({status: 200,@@ -86,7 +86,10 @@ test("Assistant makes the read-only promise literal in the current browser build).toHaveAttribute("aria-checked", "true");await expect(page.getByText("Observes only")).toBeVisible();- await page.getByRole("button", { name: "Collapse Pulse Assistant" }).click();+ const closeAssistant = testInfo.project.name.startsWith("mobile-")+ ? page.getByRole("button", { name: "Close Pulse Assistant" })+ : page.getByRole("button", { name: "Collapse Pulse Assistant" });+ await closeAssistant.click();await page.goto("/settings/security/api", { waitUntil: "domcontentloaded" });await page.getByRole("button", { name: "New token" }).click();await page.getByText("Custom scopes", { exact: true }).click();diff --git a/tests/integration/tests/91-operational-trust-attention-workbench.spec.ts b/tests/integration/tests/91-operational-trust-attention-workbench.spec.tsindex 9c4b4ec68e..bef79260a1 100644--- a/tests/integration/tests/91-operational-trust-attention-workbench.spec.ts+++ b/tests/integration/tests/91-operational-trust-attention-workbench.spec.ts@@ -5,6 +5,7 @@ type AttentionMode = "active" | "calm" | "failed";test.beforeEach(async ({ page }) => {const pageErrors: string[] = [];const consoleErrors: string[] = [];+ await page.routeWebSocket("**/ws?*", () => {});page.on("pageerror", (error) => pageErrors.push(error.message));page.on("console", (message) => {if (message.type() === "error") {