Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(qa-recorder): add video-evidence journeys for agent-access flows

Miguelon Peluchon4cf7ace8de6b
diff --git a/control-ui/e2e/qa-recorder-agent-connectors.spec.ts b/control-ui/e2e/qa-recorder-agent-connectors.spec.ts
new file mode 100644
index 000000000..0e5dce2f2
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-agent-connectors.spec.ts
@@ -0,0 +1,196 @@
+// control-ui/e2e/qa-recorder-agent-connectors.spec.ts
+//
+// Optional QA recorder journey (MUTATING). Requires QA_RECORDER_CONFIRM_MUTATIONS=1.
+// Video-tours the agent connectors story end to end: the Agents list hover
+// card (neutral "Connectors" heading + server names, never the private
+// context slug), the click-through to the agent's Connectors tab, the
+// "Add connector" picker dialog, and the kebab "Remove connector" confirm.
+// The seeded context, MCP servers, and host are deleted via the Control API
+// in a finally (host first, then servers and context).
+//
+// Contract: docs/testing/optional-playwright-qa-recorder.md ("Extending the recorder").
+import { expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ api,
+ assertAllowedTarget,
+ loginThroughUi,
+ requireRecorderConfirm,
+ screenshotAndLog,
+ uniqueE2EName,
+} from './qa-recorder-helpers'
+
+test.describe('optional QA recorder: Control UI agent connectors', () => {
+ test('optional QA recorder: Control UI agent connectors journey', async ({ page }, testInfo) => {
+ requireRecorderConfirm(
+ 'QA_RECORDER_CONFIRM_MUTATIONS',
+ 'This journey creates and deletes a context, MCP servers, and a host.'
+ )
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ const agentName = uniqueE2EName('qa-agent-conn-host')
+ const contextName = uniqueE2EName('qa-agent-conn-ctx')
+ // Two servers are attached to the agent's context so the hover card and
+ // the Connectors tab have real rows to show. A third catalog-only server
+ // exists because the "Add connector" picker hides connectors the agent
+ // already has — the add beat needs one that is not yet attached.
+ const serverAttachedOne = uniqueE2EName('qa-agent-conn-srv-a')
+ const serverAttachedTwo = uniqueE2EName('qa-agent-conn-srv-b')
+ const serverCatalogOnly = uniqueE2EName('qa-agent-conn-srv-c')
+
+ async function createMcpServer(serverName: string): Promise<void> {
+ const res = await api(page.request, 'POST', '/api/v1/admin/mcp-servers', {
+ metadata: { name: serverName },
+ spec: {
+ image: 'clerum/mock-mcp-server:test',
+ contextRef: contextName,
+ enabled: true,
+ managed: true,
+ transport: {
+ type: 'streamableHttp',
+ port: 3000,
+ url: `http://${serverName}.mcp-server.svc.cluster.local:3000/mcp`,
+ },
+ },
+ })
+ expect(res.status, `create mcp-server: ${JSON.stringify(res.data)}`).toBeLessThan(300)
+ }
+
+ try {
+ await loginThroughUi(page, credentials)
+
+ // Seed: context carrying the two attached servers, three catalog
+ // servers, and the host bound to the context.
+ const ctxRes = await api(page.request, 'POST', '/api/v1/admin/contexts', {
+ metadata: { name: contextName },
+ spec: {
+ contextId: contextName,
+ description: `QA recorder agent-connectors fixture for ${agentName}`,
+ mcpServers: [serverAttachedOne, serverAttachedTwo],
+ },
+ })
+ expect(ctxRes.status, `create context: ${JSON.stringify(ctxRes.data)}`).toBeLessThan(300)
+
+ for (const serverName of [serverAttachedOne, serverAttachedTwo, serverCatalogOnly]) {
+ await createMcpServer(serverName)
+ }
+
+ const hostRes = await api(page.request, 'POST', '/api/v1/admin/hosts', {
+ metadata: { name: agentName },
+ spec: {
+ host: agentName,
+ contextRef: contextName,
+ secretRef: '',
+ channels: [],
+ model: { provider: 'openai', name: 'gpt-5.4-mini' },
+ },
+ })
+ expect(hostRes.status, `create host: ${JSON.stringify(hostRes.data)}`).toBeLessThan(300)
+
+ // (a) Agents list row: hover the connectors count to reveal the card.
+ await page.getByRole('link', { name: 'Agents', exact: true }).click()
+ await expect(page.getByRole('columnheader', { name: 'Connectors', exact: true })).toBeVisible(
+ { timeout: 20_000 }
+ )
+
+ const row = page.getByRole('row', { name: new RegExp(agentName) })
+ await expect(row).toBeVisible({ timeout: 20_000 })
+
+ // The count reflects the context enrichment once the contexts fetch
+ // resolves — wait for the concrete value, not just the button.
+ const countButton = row.locator('.cu-host-connectors-count')
+ await expect(countButton).toHaveText('2', { timeout: 20_000 })
+
+ await countButton.hover()
+ const tooltip = page.getByRole('tooltip')
+ await expect(tooltip).toBeVisible({ timeout: 20_000 })
+ await expect(tooltip).toContainText('Connectors')
+ await expect(tooltip).toContainText(serverAttachedOne)
+ await expect(tooltip).toContainText(serverAttachedTwo)
+
+ // The private context slug is an implementation detail — never rendered.
+ const bodyText = await page.innerText('body')
+ expect(bodyText).not.toContain(contextName)
+ await screenshotAndLog(page, testInfo, 'agent-connectors-hover-card')
+
+ // (b) Clicking the count opens the agent's Connectors tab.
+ await countButton.click()
+ await expect(page).toHaveURL(new RegExp(`/agents/${agentName}/connectors/?$`), {
+ timeout: 20_000,
+ })
+ await expect(page.getByText(`Agent: ${agentName}`)).toBeVisible({ timeout: 20_000 })
+ await expect(page.getByRole('row', { name: new RegExp(serverAttachedOne) })).toBeVisible({
+ timeout: 20_000,
+ })
+ await expect(page.getByRole('row', { name: new RegExp(serverAttachedTwo) })).toBeVisible({
+ timeout: 20_000,
+ })
+ await screenshotAndLog(page, testInfo, 'agent-connectors-tab')
+
+ // (c) Add connector — the dialog offers catalog servers not yet
+ // attached; its confirm button repeats the "Add connector" label.
+ await page.getByRole('button', { name: 'Add connector', exact: true }).click()
+ const dialog = page.getByRole('dialog', { name: 'Add connectors' })
+ await expect(dialog).toBeVisible({ timeout: 20_000 })
+ await expect(
+ dialog.getByRole('option', { name: serverCatalogOnly, exact: true })
+ ).toBeVisible({ timeout: 20_000 })
+ await dialog.getByRole('option', { name: serverCatalogOnly, exact: true }).click()
+ await dialog.getByRole('button', { name: 'Add connector', exact: true }).click()
+
+ await expect(page.getByText('Connectors updated.')).toBeVisible({ timeout: 20_000 })
+ await expect(page.getByRole('row', { name: new RegExp(serverCatalogOnly) })).toBeVisible({
+ timeout: 20_000,
+ })
+ await screenshotAndLog(page, testInfo, 'agent-connectors-added')
+
+ // (d) Remove connector — kebab per connector row, then the confirm dialog.
+ await page.getByRole('button', { name: `Actions for connector ${serverCatalogOnly}` }).click()
+ await page.getByRole('menuitem', { name: 'Remove connector' }).click()
+ const confirmDialog = page.getByRole('alertdialog', {
+ name: 'Remove connector from this agent?',
+ })
+ await expect(confirmDialog).toBeVisible({ timeout: 20_000 })
+ await confirmDialog.getByRole('button', { name: 'Remove connector' }).click()
+
+ await expect(page.getByText('Connectors updated.')).toBeVisible({ timeout: 20_000 })
+ await expect(page.getByRole('row', { name: new RegExp(serverCatalogOnly) })).toHaveCount(0)
+
+ // The private context slug never renders on this page either.
+ await expect(page.getByText(contextName)).toHaveCount(0)
+ await screenshotAndLog(page, testInfo, 'agent-connectors-removed')
+ } finally {
+ // Best-effort cleanup; the disposable environment tolerates leftovers.
+ // The host must go before its context.
+ try {
+ await api(page.request, 'DELETE', `/api/v1/admin/hosts/${encodeURIComponent(agentName)}`)
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/mcp-servers/${encodeURIComponent(serverAttachedOne)}`
+ )
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/mcp-servers/${encodeURIComponent(serverAttachedTwo)}`
+ )
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/mcp-servers/${encodeURIComponent(serverCatalogOnly)}`
+ )
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/contexts/${encodeURIComponent(contextName)}`
+ )
+ } catch {
+ // Ignore cleanup failures.
+ }
+ }
+ })
+})
diff --git a/control-ui/e2e/qa-recorder-agent-files-mounted-by.spec.ts b/control-ui/e2e/qa-recorder-agent-files-mounted-by.spec.ts
new file mode 100644
index 000000000..7b48ef0ef
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-agent-files-mounted-by.spec.ts
@@ -0,0 +1,90 @@
+// control-ui/e2e/qa-recorder-agent-files-mounted-by.spec.ts
+//
+// Optional QA recorder journey (READ-ONLY) for the Agent Files section's
+// agent-facing mount vocabulary: the list's mount column header is
+// "Mounted by" (never "Mounted by Contexts") and the detail metadata chip
+// resolves mounts to agent display names ("mounted by ..." / "not mounted by
+// any agent"), never a raw scope slug (scope ids look like
+// "<kebab>-<5 digits>"). Ports the assertions from
+// tests/e2e/playwright/control-ui/agent-files-mounted-by.spec.ts.
+//
+// Creates nothing: SharedFileSystem provisioning is heavy, so detail
+// assertions run only against whatever already exists in the environment;
+// the empty state is recorded instead when none do.
+//
+// Contract: docs/testing/optional-playwright-qa-recorder.md ("Extending the
+// recorder").
+import { expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ api,
+ assertAllowedTarget,
+ loginThroughUi,
+ screenshotAndLog,
+} from './qa-recorder-helpers'
+
+type SharedFileSystemItem = {
+ metadata?: { name?: string }
+}
+
+test.describe('optional QA recorder: Control UI agent files mounted-by vocabulary', () => {
+ test('records the Agent Files list and detail mount vocabulary', async ({ page }, testInfo) => {
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ await loginThroughUi(page, credentials)
+
+ // "Agent Files" is hidden from the sidebar (the Files group only exposes
+ // its other children), so the section is reached directly by URL — the
+ // same way a bookmarked link would.
+ await page.goto(`${CONTROL_UI_URL}/agent-files`)
+ await expect(
+ page.getByText('Workspace volumes that agents can mount read-only into their pods.')
+ ).toBeVisible({ timeout: 20_000 })
+
+ // Branch on live data instead of seeding: with zero rows the table (and
+ // its header) is not rendered at all — the empty state replaces it.
+ const res = await api<{ items?: SharedFileSystemItem[] }>(
+ page.request,
+ 'GET',
+ '/api/v1/admin/shared-filesystems'
+ )
+ expect(res.status, `list shared filesystems: ${JSON.stringify(res.data)}`).toBeLessThan(300)
+ const sfsItems = res.data.items ?? []
+
+ if (sfsItems.length === 0) {
+ await expect(page.getByText(/No SharedFileSystems yet/)).toBeVisible({ timeout: 20_000 })
+ await screenshotAndLog(page, testInfo, 'control-ui-agent-files-mounted-by-empty')
+ return
+ }
+
+ await expect(page.locator('th:text-is("Mounted by")')).toBeVisible({ timeout: 20_000 })
+ // The pre-rename header must be gone everywhere, not just hidden.
+ await expect(page.locator('th:has-text("Mounted by Contexts")')).toHaveCount(0)
+ await screenshotAndLog(page, testInfo, 'control-ui-agent-files-mounted-by-list')
+
+ const firstName = sfsItems[0]?.metadata?.name ?? ''
+ expect(firstName).not.toBe('')
+
+ await page.goto(`${CONTROL_UI_URL}/agent-files/${encodeURIComponent(firstName)}`)
+ const chipRow = page.locator('.cu-chip-row[aria-label="Shared filesystem metadata"]')
+ await expect(chipRow).toBeVisible({ timeout: 20_000 })
+
+ const mountChip = chipRow.locator('.cu-chip', {
+ hasText: /not mounted by any agent|mounted by /u,
+ })
+ await expect(mountChip.first()).toBeVisible({ timeout: 20_000 })
+
+ const chipText = (await mountChip.first().innerText()).trim()
+ expect(chipText, 'mount chip must use agent-facing copy').toMatch(
+ /not mounted by any agent|mounted by /u
+ )
+ // Raw scope slugs look like "<kebab>-<5 digits>" — the chip must never
+ // leak one (unresolved scope ids are hidden by policy instead).
+ expect(chipText, 'mount chip must not leak a raw scope slug').not.toMatch(/[-]\d{5}/)
+ await screenshotAndLog(page, testInfo, 'control-ui-agent-files-mounted-by-detail')
+ })
+})
diff --git a/control-ui/e2e/qa-recorder-connector-create-access.spec.ts b/control-ui/e2e/qa-recorder-connector-create-access.spec.ts
new file mode 100644
index 000000000..cad1e9f68
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-connector-create-access.spec.ts
@@ -0,0 +1,217 @@
+// control-ui/e2e/qa-recorder-connector-create-access.spec.ts
+//
+// Optional QA recorder journey (MUTATING). Requires QA_RECORDER_CONFIRM_MUTATIONS=1.
+// Records the create-connector wizard's Access step twice: once with a seeded
+// agent selected (agent picker + "Access preview" + the post-create Agents
+// group binding on /connectors) and once with no agents ("No agents have
+// access yet."). A no-agent connector silently provisions a private scope
+// (<name>-#####); that scope is discovered through GET /api/v1/admin/contexts
+// and deleted in the finally along with both connectors, the seeded agent
+// host, and its context (hosts before contexts).
+//
+// Contract: docs/testing/optional-playwright-qa-recorder.md ("Extending the
+// recorder").
+import { type Page, type TestInfo, expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ api,
+ assertAllowedTarget,
+ loginThroughUi,
+ requireRecorderConfirm,
+ resourceName,
+ screenshotAndLog,
+ uniqueE2EName,
+} from './qa-recorder-helpers'
+
+type ContextListItem = { metadata?: { name?: string }; name?: string }
+
+async function continueWizard(page: Page): Promise<void> {
+ const next = page.getByRole('button', { name: 'Continue', exact: true })
+ await expect(next).toBeEnabled()
+ await next.click()
+}
+
+async function openCreateConnectorWizard(page: Page): Promise<void> {
+ await page.getByRole('link', { name: 'Installed Connectors', exact: true }).click()
+ await expect(page).toHaveURL(/\/connectors$/, { timeout: 20_000 })
+ await page.getByRole('button', { name: 'Create Connector', exact: true }).click()
+ await expect(page).toHaveURL(/\/connectors\/new$/, { timeout: 20_000 })
+}
+
+// Mirrors the proven port (tests/e2e/playwright/control-ui/
+// connector-create-access-step.spec.ts): identity placeholders → optional
+// Access step → Secrets keyless radio. With agentToSelect the agent picker is
+// opened (the trigger is matched by its placeholder, not a label) and that
+// agent chosen; without it the Access step is skipped, which is exactly the
+// branch that silently provisions a private scope.
+async function createConnectorThroughWizard(
+ page: Page,
+ testInfo: TestInfo,
+ journey: string,
+ connectorName: string,
+ agentToSelect?: string
+): Promise<void> {
+ await page.getByPlaceholder('my-mcp-server').fill(connectorName)
+ await page
+ .getByPlaceholder('us-central1-docker.pkg.dev/my-project/repo/mcp-server:latest')
+ .fill('qa-recorder/example:dev')
+ await page
+ .getByPlaceholder('Optional description of this connector')
+ .fill(`QA recorder access-step connector (${agentToSelect ? 'with agent' : 'no agents'})`)
+ await screenshotAndLog(page, testInfo, `${journey}-wizard-identity`)
+
+ await continueWizard(page)
+
+ await expect(page.getByRole('heading', { name: 'Agent access', exact: true })).toBeVisible({
+ timeout: 20_000,
+ })
+ if (agentToSelect) {
+ await page.getByRole('button', { name: 'Select agents...' }).click()
+ await page.getByRole('option', { name: agentToSelect, exact: true }).click()
+ await expect(page.getByText('Access preview', { exact: true })).toBeVisible()
+ await expect(
+ page
+ .getByRole('region', { name: 'Agent access preview' })
+ .getByText(agentToSelect, { exact: true })
+ ).toBeVisible()
+ await screenshotAndLog(page, testInfo, `${journey}-wizard-access-preview`)
+ } else {
+ await expect(
+ page.getByText(
+ 'No agents selected: the connector is created but cannot be used by any agent until you grant access.',
+ { exact: true }
+ )
+ ).toBeVisible()
+ await screenshotAndLog(page, testInfo, `${journey}-wizard-access-empty`)
+ }
+ await continueWizard(page)
+
+ await expect(page.getByRole('heading', { name: 'Secrets and environment' })).toBeVisible({
+ timeout: 20_000,
+ })
+ await page.getByRole('radio', { name: /No credentials required/ }).check()
+ await screenshotAndLog(page, testInfo, `${journey}-wizard-secrets`)
+
+ await page.getByRole('button', { name: 'Create connector', exact: true }).click()
+ await expect(page.getByText('Connector created successfully.', { exact: true })).toBeVisible({
+ timeout: 20_000,
+ })
+ await expect(page).toHaveURL(/\/connectors$/, { timeout: 20_000 })
+}
+
+async function expandConnector(page: Page, connectorName: string) {
+ const row = page.getByRole('row', { name: new RegExp(connectorName) })
+ await expect(row).toBeVisible({ timeout: 20_000 })
+ await row.click()
+ await expect(row).toHaveAttribute('aria-expanded', 'true', { timeout: 10_000 })
+ const detail = page.locator('.cu-connector-detail')
+ await expect(detail).toBeVisible({ timeout: 10_000 })
+ return detail
+}
+
+test.describe('optional QA recorder: Control UI connector create Access step', () => {
+ test('records creating a connector with an agent and one without any', async ({
+ page,
+ }, testInfo) => {
+ requireRecorderConfirm(
+ 'QA_RECORDER_CONFIRM_MUTATIONS',
+ 'This journey creates and deletes local context, host, and connector resources.'
+ )
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ const journey = 'control-ui-connector-create-access'
+ const contextName = uniqueE2EName('qa-recorder-context')
+ const agentName = uniqueE2EName('qa-recorder-agent')
+ const connectorWithAgent = uniqueE2EName('qa-recorder-conn-a')
+ const connectorWithoutAgent = uniqueE2EName('qa-recorder-conn-b')
+ let privateScopeName = ''
+
+ try {
+ await loginThroughUi(page, credentials)
+
+ // Seed an agent (context + host) so the wizard's agent picker has a
+ // target. The host display name equals the resource name so the picker
+ // option, preview, and Agents group all show the same label.
+ const ctxRes = await api(page.request, 'POST', '/api/v1/admin/contexts', {
+ metadata: { name: contextName },
+ spec: {
+ contextId: contextName,
+ description: 'QA recorder connector access context',
+ mcpServers: [],
+ },
+ })
+ expect(ctxRes.status, `create context: ${JSON.stringify(ctxRes.data)}`).toBeLessThan(300)
+
+ const hostRes = await api(page.request, 'POST', '/api/v1/admin/hosts', {
+ metadata: { name: agentName },
+ spec: {
+ host: agentName,
+ contextRef: contextName,
+ secretRef: '',
+ channels: [],
+ model: { provider: 'openai', name: 'gpt-5.4-mini' },
+ },
+ })
+ expect(hostRes.status, `create host: ${JSON.stringify(hostRes.data)}`).toBeLessThan(300)
+
+ // Connector #1 — WITH an agent selected on the Access step.
+ await openCreateConnectorWizard(page)
+ await createConnectorThroughWizard(page, testInfo, journey, connectorWithAgent, agentName)
+
+ const withAgentDetail = await expandConnector(page, connectorWithAgent)
+ await expect(
+ withAgentDetail.getByRole('heading', { name: 'Agents', exact: true })
+ ).toBeVisible()
+ await expect(withAgentDetail.getByText(agentName, { exact: true })).toBeVisible()
+ await screenshotAndLog(page, testInfo, `${journey}-with-agent`)
+
+ // Connector #2 — Access step skipped (no agents).
+ await openCreateConnectorWizard(page)
+ await createConnectorThroughWizard(page, testInfo, journey, connectorWithoutAgent)
+
+ const withoutAgentDetail = await expandConnector(page, connectorWithoutAgent)
+ await expect(
+ withoutAgentDetail.getByText('No agents have access yet.', { exact: true })
+ ).toBeVisible()
+ await screenshotAndLog(page, testInfo, `${journey}-without-agents`)
+
+ // The wizard never surfaces the private scope; discover it through the
+ // Control API so the finally can tear it down too.
+ const scopesRes = await api<{ items?: ContextListItem[] }>(
+ page.request,
+ 'GET',
+ '/api/v1/admin/contexts'
+ )
+ expect(scopesRes.status, `list contexts: ${JSON.stringify(scopesRes.data)}`).toBe(200)
+ privateScopeName =
+ (scopesRes.data.items ?? [])
+ .map(item => resourceName(item))
+ .find(name => new RegExp(`^${connectorWithoutAgent}-[0-9]{5}$`).test(name)) ?? ''
+ expect(privateScopeName, 'private scope context for the no-agent connector').toBeTruthy()
+ } finally {
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/mcp-servers/${encodeURIComponent(connectorWithoutAgent)}`
+ )
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/mcp-servers/${encodeURIComponent(connectorWithAgent)}`
+ )
+ if (privateScopeName) {
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/contexts/${encodeURIComponent(privateScopeName)}`
+ )
+ }
+ await api(page.request, 'DELETE', `/api/v1/admin/hosts/${encodeURIComponent(agentName)}`)
+ await api(page.request, 'DELETE', `/api/v1/admin/contexts/${encodeURIComponent(contextName)}`)
+ }
+ })
+})
diff --git a/control-ui/e2e/qa-recorder-connector-edit.spec.ts b/control-ui/e2e/qa-recorder-connector-edit.spec.ts
index 7a32d509f..7f470b3a9 100644
--- a/control-ui/e2e/qa-recorder-connector-edit.spec.ts
+++ b/control-ui/e2e/qa-recorder-connector-edit.spec.ts
@@ -138,6 +138,21 @@ test.describe('optional QA recorder: Control UI connector edit', () => {
})
await expect(page.getByLabel('Agent access')).toBeVisible()
+ // Legacy deep link: the removed Context tab's /edit/context URL must
+ // permanently redirect to the Access tab (next.config.js rewrite) so
+ // old bookmarks and shared links keep reaching the section.
+ await page.goto(
+ `${CONTROL_UI_URL}/connectors/${encodeURIComponent(connectorName)}/edit/context`
+ )
+ await expect(page).toHaveURL(
+ new RegExp(`/connectors/${encodeURIComponent(connectorName)}/edit/access$`),
+ { timeout: 20_000 }
+ )
+ await expect(page.getByRole('heading', { name: 'Agent access', exact: true })).toBeVisible({
+ timeout: 20_000,
+ })
+ await screenshotAndLog(page, testInfo, 'control-ui-connector-edit-legacy-redirect')
+
await page.getByRole('tab', { name: 'External Egress', exact: true }).click()
// Image is rendered as static read-only text (not an editable input).
diff --git a/control-ui/e2e/qa-recorder-connectors-agent-access.spec.ts b/control-ui/e2e/qa-recorder-connectors-agent-access.spec.ts
new file mode 100644
index 000000000..088088274
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-connectors-agent-access.spec.ts
@@ -0,0 +1,199 @@
+// control-ui/e2e/qa-recorder-connectors-agent-access.spec.ts
+//
+// Optional QA recorder journey (MUTATING). Requires QA_RECORDER_CONFIRM_MUTATIONS=1.
+// Video-tours the shared-scope connector access story on the Installed
+// Connectors list: expanding a connector row reveals the Agents/Teams/Users
+// access grid (display names only, never the private context slugs), a
+// single-agent removal lands a direct toast, the "Add agents" picker
+// re-grants access, and removing one agent of a shared two-agent context is
+// guarded by the "Remove Connector Access" confirm. The seeded server,
+// hosts, and contexts are deleted via the Control API in a finally
+// (server and hosts before contexts).
+//
+// Contract: docs/testing/optional-playwright-qa-recorder.md ("Extending the recorder").
+import { expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ api,
+ assertAllowedTarget,
+ loginThroughUi,
+ requireRecorderConfirm,
+ screenshotAndLog,
+ uniqueE2EName,
+} from './qa-recorder-helpers'
+
+test.describe('optional QA recorder: Control UI connectors agent access', () => {
+ test('optional QA recorder: Control UI connectors agent access journey', async ({
+ page,
+ }, testInfo) => {
+ requireRecorderConfirm(
+ 'QA_RECORDER_CONFIRM_MUTATIONS',
+ 'This journey creates and deletes MCP server, host, and context resources.'
+ )
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ const serverName = uniqueE2EName('qa-caa-srv')
+ const contextA = uniqueE2EName('qa-caa-ctx-a')
+ const contextB = uniqueE2EName('qa-caa-ctx-b')
+ const agentA = uniqueE2EName('qa-caa-agent-a')
+ const agentB1 = uniqueE2EName('qa-caa-agent-b1')
+ const agentB2 = uniqueE2EName('qa-caa-agent-b2')
+
+ async function createHost(agentName: string, contextRef: string): Promise<void> {
+ const res = await api(page.request, 'POST', '/api/v1/admin/hosts', {
+ metadata: { name: agentName },
+ spec: {
+ host: agentName,
+ contextRef,
+ secretRef: '',
+ channels: [],
+ model: { provider: 'openai', name: 'gpt-5.4-mini' },
+ },
+ })
+ expect(res.status, `create host: ${JSON.stringify(res.data)}`).toBeLessThan(300)
+ }
+
+ try {
+ await loginThroughUi(page, credentials)
+
+ // Seed: one connector carried by two private contexts — ctxA backs ONE
+ // agent, ctxB backs TWO (shared scope), so removing from ctxB must
+ // surface the "Remove Connector Access" confirm while removing from
+ // ctxA must not.
+ const serverRes = await api(page.request, 'POST', '/api/v1/admin/mcp-servers', {
+ metadata: { name: serverName },
+ spec: {
+ image: 'clerum/mock-mcp-server:test',
+ contextRef: contextA,
+ enabled: true,
+ managed: true,
+ transport: {
+ type: 'streamableHttp',
+ port: 3000,
+ url: `http://${serverName}.mcp-server.svc.cluster.local:3000/mcp`,
+ },
+ },
+ })
+ expect(serverRes.status, `create mcp-server: ${JSON.stringify(serverRes.data)}`).toBeLessThan(
+ 300
+ )
+
+ const ctxARes = await api(page.request, 'POST', '/api/v1/admin/contexts', {
+ metadata: { name: contextA },
+ spec: {
+ contextId: contextA,
+ description: 'Single-agent connector scope',
+ mcpServers: [serverName],
+ },
+ })
+ expect(ctxARes.status, `create context A: ${JSON.stringify(ctxARes.data)}`).toBeLessThan(300)
+
+ const ctxBRes = await api(page.request, 'POST', '/api/v1/admin/contexts', {
+ metadata: { name: contextB },
+ spec: {
+ contextId: contextB,
+ description: 'Shared two-agent connector scope',
+ mcpServers: [serverName],
+ },
+ })
+ expect(ctxBRes.status, `create context B: ${JSON.stringify(ctxBRes.data)}`).toBeLessThan(300)
+
+ await createHost(agentA, contextA)
+ await createHost(agentB1, contextB)
+ await createHost(agentB2, contextB)
+
+ await page.getByRole('link', { name: 'Installed Connectors', exact: true }).click()
+ await expect(page).toHaveURL(/\/connectors\/?$/, { timeout: 20_000 })
+ await expect(
+ page.getByText('Browse connector deployments and agent access.', { exact: true })
+ ).toBeVisible({ timeout: 20_000 })
+
+ const expandConnector = async () => {
+ const row = page.getByRole('row', { name: new RegExp(serverName) })
+ await expect(row).toBeVisible({ timeout: 20_000 })
+ await row.click()
+ await expect(row).toHaveAttribute('aria-expanded', 'true', { timeout: 20_000 })
+ const detail = page.locator('.cu-connector-detail')
+ await expect(detail).toBeVisible({ timeout: 20_000 })
+ return detail
+ }
+
+ // Expanded Access section: Agents/Teams/Users groups list all three
+ // agent display names — and no context slug anywhere on the page.
+ let detail = await expandConnector()
+ for (const groupTitle of ['Agents', 'Teams', 'Users']) {
+ await expect(detail.getByRole('heading', { name: groupTitle, exact: true })).toBeVisible()
+ }
+ for (const agentName of [agentA, agentB1, agentB2]) {
+ await expect(detail.getByText(agentName, { exact: true })).toBeVisible()
+ }
+ const bodyText = await page.innerText('body')
+ expect(bodyText).not.toContain(contextA)
+ expect(bodyText).not.toContain(contextB)
+ await screenshotAndLog(page, testInfo, 'connectors-agent-access-expanded')
+
+ // Remove the single-agent binding — no confirm dialog, direct toast.
+ await detail
+ .getByRole('button', { name: `Remove connector ${serverName} from agent ${agentA}` })
+ .click()
+ await expect(page.getByText(`Connector ${serverName} removed from ${agentA}.`)).toBeVisible({
+ timeout: 20_000,
+ })
+ await screenshotAndLog(page, testInfo, 'connectors-agent-access-removed-single')
+
+ // Re-grant agentA through the "Add agents" picker dialog.
+ await page.reload()
+ detail = await expandConnector()
+ await detail.getByRole('button', { name: 'Add agents' }).click()
+ const grantDialog = page.getByRole('dialog', {
+ name: 'Give agents access to this connector',
+ })
+ await expect(grantDialog).toBeVisible({ timeout: 20_000 })
+ await expect(grantDialog.getByLabel('Agents')).toBeVisible()
+ await grantDialog.getByRole('option', { name: agentA, exact: true }).click()
+ await grantDialog.getByRole('button', { name: 'Add to agent', exact: true }).click()
+ await expect(page.getByText(`Connector ${serverName} added to agent ${agentA}.`)).toBeVisible(
+ { timeout: 20_000 }
+ )
+ await screenshotAndLog(page, testInfo, 'connectors-agent-access-added-back')
+
+ // Remove one agent of the shared pair — the confirm dialog guards the
+ // change that would strip both agents at once.
+ await page.reload()
+ detail = await expandConnector()
+ await detail
+ .getByRole('button', { name: `Remove connector ${serverName} from agent ${agentB1}` })
+ .click()
+ const sharedConfirm = page.getByRole('alertdialog', {
+ name: 'Remove Connector Access',
+ })
+ await expect(sharedConfirm).toBeVisible({ timeout: 20_000 })
+ await sharedConfirm.getByRole('button', { name: 'Remove', exact: true }).click()
+ await expect(page.getByText(`Connector ${serverName} removed from 2 agents.`)).toBeVisible({
+ timeout: 20_000,
+ })
+ await screenshotAndLog(page, testInfo, 'connectors-agent-access-removed-shared')
+ } finally {
+ // Best-effort cleanup; the disposable environment tolerates leftovers.
+ // The server and hosts must go before the contexts.
+ try {
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/mcp-servers/${encodeURIComponent(serverName)}`
+ )
+ await api(page.request, 'DELETE', `/api/v1/admin/hosts/${encodeURIComponent(agentA)}`)
+ await api(page.request, 'DELETE', `/api/v1/admin/hosts/${encodeURIComponent(agentB1)}`)
+ await api(page.request, 'DELETE', `/api/v1/admin/hosts/${encodeURIComponent(agentB2)}`)
+ await api(page.request, 'DELETE', `/api/v1/admin/contexts/${encodeURIComponent(contextA)}`)
+ await api(page.request, 'DELETE', `/api/v1/admin/contexts/${encodeURIComponent(contextB)}`)
+ } catch {
+ // Ignore cleanup failures.
+ }
+ }
+ })
+})
diff --git a/control-ui/e2e/qa-recorder-context-redirects.spec.ts b/control-ui/e2e/qa-recorder-context-redirects.spec.ts
new file mode 100644
index 000000000..8909a06ef
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-context-redirects.spec.ts
@@ -0,0 +1,122 @@
+// control-ui/e2e/qa-recorder-context-redirects.spec.ts
+//
+// Optional QA recorder journey (MUTATING). Requires QA_RECORDER_CONFIRM_MUTATIONS=1.
+// Video-tours the legacy /contexts link story now that the Contexts section is
+// gone from the UI: the sidebar has no Contexts item, unknown legacy deep
+// links land on the Agents list, and a seeded context's deep links resolve to
+// the owning agent's Connectors tab. The throwaway context and host are
+// deleted via the Control API in a finally (host before context).
+//
+// Contract: docs/testing/optional-playwright-qa-recorder.md ("Extending the recorder").
+import { expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ api,
+ assertAllowedTarget,
+ loginThroughUi,
+ requireRecorderConfirm,
+ screenshotAndLog,
+ uniqueE2EName,
+} from './qa-recorder-helpers'
+
+test.describe('optional QA recorder: Control UI context redirects', () => {
+ test('optional QA recorder: Control UI context redirects journey', async ({ page }, testInfo) => {
+ requireRecorderConfirm(
+ 'QA_RECORDER_CONFIRM_MUTATIONS',
+ 'This journey creates and deletes a throwaway context and host.'
+ )
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ const contextName = uniqueE2EName('qa-ctx-redir')
+ const hostName = uniqueE2EName('qa-ctx-redir-host')
+ const unknownSlug = uniqueE2EName('qa-ctx-redir-unknown')
+
+ try {
+ await loginThroughUi(page, credentials)
+
+ // (a) The sidebar must not offer a Contexts destination anymore.
+ await expect(page.locator('.cu-sidebar__item', { hasText: 'Contexts' })).toHaveCount(0)
+ await expect(
+ page.getByRole('navigation', { name: 'Main sections' }).getByRole('link', {
+ name: 'Contexts',
+ exact: true,
+ })
+ ).toHaveCount(0)
+ await screenshotAndLog(page, testInfo, 'context-redirects-sidebar')
+
+ // (b) Bare /contexts redirects to the Agents list.
+ await page.goto(`${CONTROL_UI_URL}/contexts`)
+ await expect(page).toHaveURL(/\/agents\/?$/, { timeout: 20_000 })
+ await expect(
+ page.getByText('Manage available agents and their host mappings.', { exact: true })
+ ).toBeVisible({ timeout: 20_000 })
+ await screenshotAndLog(page, testInfo, 'context-redirects-legacy-root')
+
+ // (c) The legacy create-page deep link also lands on the Agents list.
+ await page.goto(`${CONTROL_UI_URL}/contexts/new`)
+ await expect(page).toHaveURL(/\/agents\/?$/, { timeout: 20_000 })
+ await screenshotAndLog(page, testInfo, 'context-redirects-legacy-new')
+
+ // (d) An unknown context slug still resolves instead of dead-ending.
+ await page.goto(`${CONTROL_UI_URL}/contexts/${encodeURIComponent(unknownSlug)}`)
+ await expect(page).toHaveURL(/\/agents\/?$/, { timeout: 20_000 })
+ await screenshotAndLog(page, testInfo, 'context-redirects-legacy-unknown')
+
+ // (e) Seed a throwaway context + host so the legacy detail links have a
+ // real owner to resolve to: the owning agent's Connectors tab.
+ const ctxRes = await api(page.request, 'POST', '/api/v1/admin/contexts', {
+ metadata: { name: contextName },
+ spec: {
+ contextId: contextName,
+ description: 'QA recorder legacy-link redirect fixture',
+ mcpServers: [],
+ },
+ })
+ expect(ctxRes.status, `create context: ${JSON.stringify(ctxRes.data)}`).toBeLessThan(300)
+
+ const hostRes = await api(page.request, 'POST', '/api/v1/admin/hosts', {
+ metadata: { name: hostName },
+ spec: {
+ host: hostName,
+ contextRef: contextName,
+ secretRef: '',
+ channels: [],
+ model: { provider: 'openai', name: 'gpt-5.4-mini' },
+ },
+ })
+ expect(hostRes.status, `create host: ${JSON.stringify(hostRes.data)}`).toBeLessThan(300)
+
+ await page.goto(`${CONTROL_UI_URL}/contexts/${encodeURIComponent(contextName)}`)
+ await expect(page).toHaveURL(new RegExp(`/agents/${hostName}/connectors/?$`), {
+ timeout: 20_000,
+ })
+ await expect(page.getByText(`Agent: ${hostName}`)).toBeVisible({ timeout: 20_000 })
+ await screenshotAndLog(page, testInfo, 'context-redirects-legacy-detail')
+
+ // Deep link carrying a tab suffix resolves to the same destination.
+ await page.goto(`${CONTROL_UI_URL}/contexts/${encodeURIComponent(contextName)}/connectors`)
+ await expect(page).toHaveURL(new RegExp(`/agents/${hostName}/connectors/?$`), {
+ timeout: 20_000,
+ })
+ await expect(page.getByText(`Agent: ${hostName}`)).toBeVisible({ timeout: 20_000 })
+ await screenshotAndLog(page, testInfo, 'context-redirects-landed-connectors-tab')
+ } finally {
+ // Best-effort cleanup; the disposable environment tolerates leftovers.
+ // Hosts must go before their contexts.
+ try {
+ await api(page.request, 'DELETE', `/api/v1/admin/hosts/${encodeURIComponent(hostName)}`)
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/contexts/${encodeURIComponent(contextName)}`
+ )
+ } catch {
+ // Ignore cleanup failures.
+ }
+ }
+ })
+})
diff --git a/control-ui/e2e/qa-recorder-context-vocab-sweep.spec.ts b/control-ui/e2e/qa-recorder-context-vocab-sweep.spec.ts
new file mode 100644
index 000000000..3949788aa
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-context-vocab-sweep.spec.ts
@@ -0,0 +1,169 @@
+// control-ui/e2e/qa-recorder-context-vocab-sweep.spec.ts
+//
+// Optional QA recorder journey (READ-ONLY): a video tour across the
+// surviving top-level sections asserting none of them mention contexts in
+// their chrome or copy after the Contexts-section removal. Ports the sweep
+// from tests/e2e/playwright/control-ui/global-no-context-vocab.spec.ts, but
+// navigates through the sidebar where an operator would (Users & Teams ->
+// Teams tab, Cost & Usage group -> Token Budgets) and only falls back to a
+// direct URL for /agent-files, which is hidden from the sidebar.
+//
+// Approach (one rule): every swept route renders through DashboardLayout's
+// <main>, so each page is asserted on its main-content text (body as
+// fallback). The single exception is /plugins, whose table rows show
+// user-authored recipe names we do not control — for that page only, the
+// assertion is scoped to product-owned static chrome (sidebar, panel
+// subtitles, headings), which cannot be polluted by data-derived names.
+//
+// Lines containing "context window" (legitimate LLM copy) are allowed.
+import { type Page, expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ assertAllowedTarget,
+ loginThroughUi,
+ screenshotAndLog,
+} from './qa-recorder-helpers'
+
+const CONTEXT_WORD_RE = /\bcontexts?\b/i
+
+const SWEPT_ROUTES = {
+ agents: '/agents',
+ connectors: '/connectors',
+ users: '/users-and-teams/users',
+ teams: '/users-and-teams/teams',
+ marketplace: '/marketplace/connectors',
+ agentFiles: '/agent-files',
+ tokenBudgets: '/cost-and-usage/token-budgets',
+ plugins: '/plugins',
+} as const
+
+// Product-owned chrome for the /plugins exception (see header comment).
+const STATIC_CHROME_SELECTOR = '.cu-sidebar, .cu-table-panel__subtitle, h1, h2, h3'
+
+function offendingLines(text: string): string[] {
+ return text
+ .split('\n')
+ .filter(line => CONTEXT_WORD_RE.test(line) && !/context window/i.test(line))
+ .map(line => line.trim())
+ .filter(Boolean)
+}
+
+async function mainText(page: Page): Promise<string> {
+ const main = page.locator('main')
+ if ((await main.count()) > 0) return main.first().innerText()
+ return page.locator('body').innerText()
+}
+
+function screenshotName(route: string): string {
+ return `control-ui-context-vocab-sweep${route.replace(/\//g, '-')}`
+}
+
+test.describe('optional QA recorder: Control UI context vocabulary sweep', () => {
+ test('records a sidebar-driven tour with no context vocabulary', async ({ page }, testInfo) => {
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ await loginThroughUi(page, credentials)
+
+ const mainNav = page.getByRole('navigation', { name: 'Main sections' })
+
+ async function recordAndSweep(route: string): Promise<void> {
+ await expect(page.locator('main').first()).toBeVisible({ timeout: 20_000 })
+ await screenshotAndLog(page, testInfo, screenshotName(route))
+ const text = await mainText(page)
+ const offending = offendingLines(text)
+ expect(
+ offending,
+ `"${route}" must not use context vocabulary; offending lines: ${offending.join(' | ')}`
+ ).toEqual([])
+ }
+
+ // /agents — the sidebar href is rewritten to the /hosts page (the browser
+ // URL is not stable across rewrites), so readiness is the page subtitle.
+ await mainNav.getByRole('link', { name: 'Agents', exact: true }).click()
+ await expect(
+ page.getByText('Manage available agents and their host mappings.', { exact: true })
+ ).toBeVisible({ timeout: 20_000 })
+ await recordAndSweep(SWEPT_ROUTES.agents)
+
+ // /connectors
+ await mainNav.getByRole('link', { name: 'Installed Connectors', exact: true }).click()
+ await expect(page).toHaveURL(/\/connectors\/?$/, { timeout: 20_000 })
+ await expect(
+ page.getByText('Browse connector deployments and agent access.', { exact: true })
+ ).toBeVisible({ timeout: 20_000 })
+ await recordAndSweep(SWEPT_ROUTES.connectors)
+
+ // /users-and-teams/users
+ await mainNav.getByRole('link', { name: 'Users & Teams', exact: true }).click()
+ await expect(page).toHaveURL(/\/users-and-teams\/users$/, { timeout: 20_000 })
+ await expect(
+ page.getByText(
+ 'Members and teams grant Desktop App access. Admins grant Control UI access.',
+ { exact: true }
+ )
+ ).toBeVisible({ timeout: 20_000 })
+ await recordAndSweep(SWEPT_ROUTES.users)
+
+ // /users-and-teams/teams — the Teams section is a tab on the Users page.
+ const teamsTab = page.getByRole('tab', { name: 'Teams', exact: true })
+ await expect(teamsTab).toBeEnabled({ timeout: 20_000 })
+ await teamsTab.click()
+ await expect(page).toHaveURL(/\/users-and-teams\/teams$/, { timeout: 20_000 })
+ await recordAndSweep(SWEPT_ROUTES.teams)
+
+ // /marketplace/connectors
+ await mainNav.getByRole('link', { name: 'Marketplace', exact: true }).click()
+ await expect(page).toHaveURL(/\/marketplace\/connectors$/, { timeout: 20_000 })
+ await expect(
+ page.getByText('Discover and install connectors from the Marketplace.')
+ ).toBeVisible({ timeout: 20_000 })
+ await recordAndSweep(SWEPT_ROUTES.marketplace)
+
+ // /agent-files — hidden from the sidebar (the Files group's children do
+ // not include it), so reach it the way a bookmarked link would.
+ await page.goto(`${CONTROL_UI_URL}/agent-files`)
+ await expect(
+ page.getByText('Workspace volumes that agents can mount read-only into their pods.')
+ ).toBeVisible({ timeout: 20_000 })
+ await recordAndSweep(SWEPT_ROUTES.agentFiles)
+
+ // /cost-and-usage/token-budgets — Cost & Usage is an expandable sidebar
+ // group rendered as a <button>; expand it (guarded on aria-expanded),
+ // then take the Token Budgets child link.
+ const costToggle = page.getByRole('button', { name: 'Cost & Usage', exact: true })
+ await expect(costToggle).toBeVisible({ timeout: 20_000 })
+ if ((await costToggle.getAttribute('aria-expanded')) !== 'true') {
+ await costToggle.click()
+ }
+ const tokenBudgetsLink = page.getByRole('link', { name: 'Token Budgets', exact: true })
+ await expect(tokenBudgetsLink).toBeVisible({ timeout: 20_000 })
+ await tokenBudgetsLink.click()
+ await expect(page).toHaveURL(/\/cost-and-usage\/token-budgets/, { timeout: 20_000 })
+ await recordAndSweep(SWEPT_ROUTES.tokenBudgets)
+
+ // /plugins — rows show user-authored recipe names, so the sweep is scoped
+ // to product-owned static chrome instead of the table rows.
+ await mainNav.getByRole('link', { name: 'Installed Plugins', exact: true }).click()
+ await expect(page).toHaveURL(/\/plugins\/?$/, { timeout: 20_000 })
+ await expect(page.locator('main').first()).toBeVisible({ timeout: 20_000 })
+ await expect(page.locator('.cu-panel-title').first()).toBeVisible({ timeout: 20_000 })
+ await screenshotAndLog(page, testInfo, screenshotName(SWEPT_ROUTES.plugins))
+
+ const chrome = page.locator(STATIC_CHROME_SELECTOR)
+ const count = await chrome.count()
+ const texts: string[] = []
+ for (let i = 0; i < count; i += 1) {
+ texts.push(await chrome.nth(i).innerText())
+ }
+
+ const chromeOffending = offendingLines(texts.join('\n'))
+ expect(
+ chromeOffending,
+ `"${SWEPT_ROUTES.plugins}" chrome must not use context vocabulary; offending lines: ${chromeOffending.join(' | ')}`
+ ).toEqual([])
+ })
+})
diff --git a/control-ui/e2e/qa-recorder-marketplace-install.spec.ts b/control-ui/e2e/qa-recorder-marketplace-install.spec.ts
new file mode 100644
index 000000000..ed2417f51
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-marketplace-install.spec.ts
@@ -0,0 +1,257 @@
+// control-ui/e2e/qa-recorder-marketplace-install.spec.ts
+//
+// Optional QA recorder journey (MUTATING). Requires QA_RECORDER_CONFIRM_MUTATIONS=1.
+// Installs a Marketplace MCP entry through the Package → Credentials →
+// Install wizard (asserting the step rail carries no Context step or button),
+// follows the success dialog's "Go to Connectors" action, expands the new
+// connector ("No agents have access yet."), and grants a seeded agent access
+// through the "Add agents" flow. The installed connector, its
+// silently-provisioned private scope, and the seeded host + context are
+// deleted via the Control API in the finally. Entry discovery mirrors
+// qa-recorder-marketplace-browse.spec.ts; the journey skips when no
+// installable MCP entry exists.
+//
+// Contract: docs/testing/optional-playwright-qa-recorder.md ("Extending the
+// recorder").
+import { expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ api,
+ assertAllowedTarget,
+ loginThroughUi,
+ requireRecorderConfirm,
+ resourceName,
+ screenshotAndLog,
+ uniqueE2EName,
+} from './qa-recorder-helpers'
+
+type RegistryEntrySummary = {
+ name: string
+ version: string
+ status?: string
+ entry_type?: string
+ server_mode?: string | null
+}
+
+type RegistryEntryListResponse = { data?: RegistryEntrySummary[] }
+
+type ContextListItem = { metadata?: { name?: string }; name?: string }
+
+test.describe('optional QA recorder: Control UI marketplace install', () => {
+ test('records installing a Marketplace connector and granting an agent access', async ({
+ page,
+ }, testInfo) => {
+ requireRecorderConfirm(
+ 'QA_RECORDER_CONFIRM_MUTATIONS',
+ 'This journey installs and deletes a Marketplace connector and seeds/deletes a host and context.'
+ )
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ const journey = 'control-ui-marketplace-install'
+ const serverName = uniqueE2EName('qa-recorder-install')
+ const contextName = uniqueE2EName('qa-recorder-context')
+ const agentName = uniqueE2EName('qa-recorder-agent')
+
+ try {
+ await loginThroughUi(page, credentials)
+
+ // Seed an agent (context + host) first so the "Add agents" grant on the
+ // Installed Connectors list has a target.
+ const ctxRes = await api(page.request, 'POST', '/api/v1/admin/contexts', {
+ metadata: { name: contextName },
+ spec: {
+ contextId: contextName,
+ description: 'QA recorder marketplace install context',
+ mcpServers: [],
+ },
+ })
+ expect(ctxRes.status, `create context: ${JSON.stringify(ctxRes.data)}`).toBeLessThan(300)
+
+ const hostRes = await api(page.request, 'POST', '/api/v1/admin/hosts', {
+ metadata: { name: agentName },
+ spec: {
+ host: agentName,
+ contextRef: contextName,
+ secretRef: '',
+ channels: [],
+ model: { provider: 'openai', name: 'gpt-5.4-mini' },
+ },
+ })
+ expect(hostRes.status, `create host: ${JSON.stringify(hostRes.data)}`).toBeLessThan(300)
+
+ // Entry discovery mirrors qa-recorder-marketplace-browse.spec.ts: probe
+ // the registry through the Control UI proxy, then prefer a local MCP
+ // entry (remote entries require egress before Continue).
+ await page.getByRole('link', { name: 'Marketplace', exact: true }).click()
+ await expect(page).toHaveURL(/\/marketplace\/connectors$/, { timeout: 20_000 })
+
+ const { status, data } = await api<RegistryEntryListResponse>(
+ page.request,
+ 'GET',
+ '/api/v1/admin/registry/entries'
+ )
+ const entries = status === 200 ? (data.data ?? []) : []
+ const mcpEntries = entries.filter(entry => entry.entry_type === 'mcp-server')
+ const localEntries = mcpEntries.filter(entry => entry.server_mode === 'local')
+ const candidates = localEntries.length > 0 ? localEntries : mcpEntries
+ test.skip(
+ candidates.length === 0,
+ 'No suitable Marketplace MCP entries in this environment; skipping install journey.'
+ )
+
+ // Find the first candidate whose catalog row still offers an enabled
+ // Install action (already-installed entries show a disabled "Installed").
+ const search = page.getByLabel('Search the Marketplace', { exact: true })
+ await expect(search).toBeEnabled({ timeout: 20_000 })
+ let target: RegistryEntrySummary | undefined
+ for (const candidate of candidates) {
+ await search.fill(candidate.name)
+ const row = page.locator('tr', { hasText: candidate.name }).first()
+ await expect(row).toBeVisible({ timeout: 20_000 })
+ const install = row.getByRole('button', { name: 'Install', exact: true })
+ if ((await install.count()) === 1 && (await install.isEnabled())) {
+ target = candidate
+ await install.click()
+ break
+ }
+ await search.clear()
+ }
+ if (!target) {
+ test.skip(
+ true,
+ 'Every Marketplace MCP entry is already installed; skipping install journey.'
+ )
+ return
+ }
+ const entry = target
+
+ await expect(page).toHaveURL(/\/marketplace\/install\?/, { timeout: 20_000 })
+ await expect(
+ page.getByRole('heading', { name: 'Install Connector from Marketplace' })
+ ).toBeVisible({ timeout: 20_000 })
+
+ // Step rail is exactly Package / Credentials / Install — no Context step.
+ const rail = page.locator('.cu-agent-step-rail')
+ await expect(rail.locator('.cu-agent-step-rail__title')).toHaveText([
+ 'Package',
+ 'Credentials',
+ 'Install',
+ ])
+ await expect(rail.getByText(/context/i)).toHaveCount(0)
+ await expect(page.getByRole('button').filter({ hasText: /context/i })).toHaveCount(0)
+
+ // Configuration disclosure: name the installed server uniquely.
+ const installForm = page.locator('form').filter({ has: page.locator('#ri-name') })
+ await expect(installForm).toBeVisible({ timeout: 20_000 })
+ await installForm.locator('summary', { hasText: 'Configuration' }).click()
+ await installForm.locator('#ri-name').clear()
+ await installForm.locator('#ri-name').fill(serverName)
+ await screenshotAndLog(page, testInfo, `${journey}-package`)
+
+ // Package → Credentials
+ await page.getByRole('button', { name: 'Continue', exact: true }).click()
+ await expect(rail.locator('.cu-agent-step-rail__item').nth(1)).toHaveAttribute(
+ 'data-state',
+ 'current'
+ )
+ await expect(page.locator('body')).not.toContainText(/Select a context|Context access/)
+
+ // Credentials → Install (fill or leave per schema).
+ const credentialInputs = installForm.locator('fieldset input')
+ const credentialCount = await credentialInputs.count()
+ for (let index = 0; index < credentialCount; index += 1) {
+ await credentialInputs.nth(index).fill('qa-recorder-credential')
+ }
+ await screenshotAndLog(page, testInfo, `${journey}-credentials`)
+ await page.getByRole('button', { name: 'Continue', exact: true }).click()
+ await expect(rail.locator('.cu-agent-step-rail__item').nth(2)).toHaveAttribute(
+ 'data-state',
+ 'current'
+ )
+
+ // Install summary names the server and the package.
+ const summary = page.getByRole('region', { name: 'Install summary' })
+ await expect(summary).toBeVisible({ timeout: 20_000 })
+ await expect(summary).toContainText(serverName)
+ await expect(summary).toContainText(entry.name)
+ await expect(page.locator('body')).not.toContainText(/Select a context|Context access/)
+ await screenshotAndLog(page, testInfo, `${journey}-summary`)
+
+ await page.getByRole('button', { name: 'Install', exact: true }).click()
+
+ const successDialog = page.getByRole('dialog', {
+ name: "Congratulations — you're ready to go",
+ })
+ await expect(
+ successDialog.getByRole('heading', { name: "Congratulations — you're ready to go" })
+ ).toBeVisible({ timeout: 60_000 })
+ await expect(
+ successDialog.getByText(/Give agents access from the Installed Connectors list/)
+ ).toBeVisible()
+ await screenshotAndLog(page, testInfo, `${journey}-success`)
+
+ await successDialog.getByRole('button', { name: 'Go to Connectors', exact: true }).click()
+ await expect(page).toHaveURL(/\/connectors$/, { timeout: 20_000 })
+
+ // The fresh install has no agents yet.
+ const row = page.getByRole('row', { name: new RegExp(serverName) })
+ await expect(row).toBeVisible({ timeout: 30_000 })
+ await row.click()
+ await expect(row).toHaveAttribute('aria-expanded', 'true', { timeout: 10_000 })
+ const detail = page.locator('.cu-connector-detail')
+ await expect(detail).toBeVisible({ timeout: 10_000 })
+ await expect(detail.getByText('No agents have access yet.', { exact: true })).toBeVisible()
+ await screenshotAndLog(page, testInfo, `${journey}-no-agents`)
+
+ // Grant the seeded agent from the Installed Connectors list.
+ await detail.getByRole('button', { name: 'Add agents', exact: true }).click()
+ const grantDialog = page.getByRole('dialog', { name: 'Give agents access to this connector' })
+ await expect(grantDialog).toBeVisible()
+ await grantDialog.getByRole('button', { name: 'Select agents', exact: true }).click()
+ await grantDialog.getByRole('option', { name: agentName, exact: true }).click()
+ await grantDialog.getByRole('button', { name: 'Add to agent', exact: true }).click()
+ await expect(
+ page
+ .getByRole('status')
+ .filter({ hasText: `Connector ${serverName} added to agent ${agentName}.` })
+ ).toBeVisible({ timeout: 20_000 })
+ await expect(detail.getByText(agentName, { exact: true })).toBeVisible({ timeout: 20_000 })
+ await screenshotAndLog(page, testInfo, `${journey}-agent-granted`)
+ } finally {
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/mcp-servers/${encodeURIComponent(serverName)}`
+ )
+ // The install silently provisions a private scope (<name>-#####); find
+ // it by prefix and tear it down too.
+ try {
+ const scopesRes = await api<{ items?: ContextListItem[] }>(
+ page.request,
+ 'GET',
+ '/api/v1/admin/contexts'
+ )
+ if (scopesRes.status === 200) {
+ const privateScope = (scopesRes.data.items ?? [])
+ .map(item => resourceName(item))
+ .find(name => new RegExp(`^${serverName}-[0-9]{5}$`).test(name))
+ if (privateScope) {
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/contexts/${encodeURIComponent(privateScope)}`
+ )
+ }
+ }
+ } catch {
+ // Best-effort private-scope discovery; the connector itself is gone.
+ }
+ await api(page.request, 'DELETE', `/api/v1/admin/hosts/${encodeURIComponent(agentName)}`)
+ await api(page.request, 'DELETE', `/api/v1/admin/contexts/${encodeURIComponent(contextName)}`)
+ }
+ })
+})
diff --git a/control-ui/e2e/qa-recorder-member-access.spec.ts b/control-ui/e2e/qa-recorder-member-access.spec.ts
new file mode 100644
index 000000000..d6b8e1d1b
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-member-access.spec.ts
@@ -0,0 +1,196 @@
+// control-ui/e2e/qa-recorder-member-access.spec.ts
+//
+// Optional QA recorder journey (MUTATING). Requires QA_RECORDER_CONFIRM_MUTATIONS=1.
+// Records the E6 "Access" rename evidence in Users & Teams — the Teams table
+// 'Access' column header (no 'Contexts' header on either table) — then the
+// member detail Access tab: a Control-API-seeded scope granted via PUT
+// /users/<id>/contexts is shown by its agent display name (never the raw
+// contextId), the 'Add access' picker modal opens and cancels, and removal
+// confirms ("Remove Access") → toasts "Access updated." → clears the row. The
+// member's original contextIds are restored and the seeded host + context are
+// deleted in the finally (hosts before contexts).
+//
+// Contract: docs/testing/optional-playwright-qa-recorder.md ("Extending the
+// recorder").
+import { expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ api,
+ assertAllowedTarget,
+ loginThroughUi,
+ requireRecorderConfirm,
+ screenshotAndLog,
+ uniqueE2EName,
+} from './qa-recorder-helpers'
+
+test.describe('optional QA recorder: Control UI member Access tab', () => {
+ test('records the Users & Teams Access headers and the member access round-trip', async ({
+ page,
+ }, testInfo) => {
+ requireRecorderConfirm(
+ 'QA_RECORDER_CONFIRM_MUTATIONS',
+ 'This journey grants and removes member access and seeds/deletes a host and context.'
+ )
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ const journey = 'control-ui-member-access'
+ const contextName = uniqueE2EName('qa-recorder-member-ctx')
+ const contextId = uniqueE2EName('qa-recorder-member-scope')
+ const hostName = uniqueE2EName('qa-recorder-member-host')
+ const hostDisplayName = uniqueE2EName('qa-recorder-member-agent')
+ let userId = ''
+ let originalContextIds: string[] | null = null
+
+ try {
+ await loginThroughUi(page, credentials)
+
+ // E6 evidence part 1 — Users table carries no 'Contexts' header.
+ await page.getByRole('link', { name: 'Users & Teams', exact: true }).click()
+ await expect(page).toHaveURL(/\/users-and-teams\/users$/, { timeout: 20_000 })
+ await expect(page.getByRole('button', { name: 'Create member', exact: true })).toBeVisible({
+ timeout: 20_000,
+ })
+ await expect(page.getByRole('columnheader', { name: 'Contexts' })).toHaveCount(0)
+ await screenshotAndLog(page, testInfo, `${journey}-users-table`)
+
+ // E6 evidence part 2 — Teams table column header is 'Access' (a sort
+ // button), still with no 'Contexts' header.
+ const teamsTab = page.getByRole('tab', { name: 'Teams', exact: true })
+ await expect(teamsTab).toBeEnabled({ timeout: 20_000 })
+ await teamsTab.click()
+ await expect(page).toHaveURL(/\/users-and-teams\/teams$/, { timeout: 20_000 })
+ await expect(
+ page.locator('table', { hasText: 'Team name' }).getByRole('button', { name: 'Access' })
+ ).toBeVisible({ timeout: 20_000 })
+ await expect(page.getByRole('columnheader', { name: 'Contexts' })).toHaveCount(0)
+ await screenshotAndLog(page, testInfo, `${journey}-teams-table`)
+
+ // Member detail — open the first user row from the directory.
+ const usersRes = await api<{ items?: Array<{ id: string }> }>(
+ page.request,
+ 'GET',
+ '/api/v1/admin/users'
+ )
+ expect(usersRes.status, `list users: ${JSON.stringify(usersRes.data)}`).toBe(200)
+ test.skip(
+ (usersRes.data.items ?? []).length === 0,
+ 'No users seeded in this environment; skipping member access journey.'
+ )
+
+ await page.goto(`${CONTROL_UI_URL}/users-and-teams/users`)
+ const firstMemberRow = page.locator('tr[aria-label^="Open member "]').first()
+ await expect(firstMemberRow).toBeVisible({ timeout: 20_000 })
+ await firstMemberRow.click()
+ await expect(page).toHaveURL(/\/users-and-teams\/users\/[^/]+/, { timeout: 20_000 })
+ const match = page.url().match(/\/users-and-teams\/users\/([^/?#]+)/)
+ userId = decodeURIComponent(match?.[1] || '')
+ expect(userId, 'member id from detail URL').toBeTruthy()
+
+ const memberTabs = page.getByRole('tablist', { name: 'Member sections' })
+ await expect(memberTabs).toBeVisible({ timeout: 20_000 })
+ const accessTab = memberTabs.getByRole('tab', { name: 'Access', exact: true })
+ await expect(accessTab).toBeVisible()
+ await accessTab.click()
+ await expect(page).toHaveURL(/\/users-and-teams\/users\/[^/]+\/access$/, {
+ timeout: 20_000,
+ })
+ await expect(
+ page.getByText('Agents and connector scopes this member may access.', { exact: true })
+ ).toBeVisible({ timeout: 20_000 })
+ await screenshotAndLog(page, testInfo, `${journey}-tab`)
+
+ // Seed a host-backed scope out-of-band, remember the member's original
+ // contextIds, then grant the scope through the admin context API.
+ const originalRes = await api<{ contextIds?: string[] }>(
+ page.request,
+ 'GET',
+ `/api/v1/admin/users/${encodeURIComponent(userId)}/contexts`
+ )
+ expect(
+ originalRes.status,
+ `get user contexts: ${JSON.stringify(originalRes.data)}`
+ ).toBeLessThan(300)
+ originalContextIds = originalRes.data.contextIds ?? []
+
+ const ctxRes = await api(page.request, 'POST', '/api/v1/admin/contexts', {
+ metadata: { name: contextName },
+ spec: {
+ contextId,
+ description: 'QA recorder member access scope',
+ mcpServers: [],
+ },
+ })
+ expect(ctxRes.status, `create context: ${JSON.stringify(ctxRes.data)}`).toBeLessThan(300)
+
+ const hostRes = await api(page.request, 'POST', '/api/v1/admin/hosts', {
+ metadata: { name: hostName },
+ spec: {
+ host: hostDisplayName,
+ contextRef: contextId,
+ secretRef: '',
+ channels: [],
+ model: { provider: 'openai', name: 'gpt-5.4-mini' },
+ },
+ })
+ expect(hostRes.status, `create host: ${JSON.stringify(hostRes.data)}`).toBeLessThan(300)
+
+ const grantRes = await api(
+ page.request,
+ 'PUT',
+ `/api/v1/admin/users/${encodeURIComponent(userId)}/contexts`,
+ { contextIds: [...originalContextIds, contextId] }
+ )
+ expect(grantRes.status, `grant user contexts: ${JSON.stringify(grantRes.data)}`).toBeLessThan(
+ 300
+ )
+
+ // Reload the tab: the row shows the host display name, never the raw
+ // wire contextId.
+ await page.reload()
+ await expect(
+ page.getByText('Agents and connector scopes this member may access.', { exact: true })
+ ).toBeVisible({ timeout: 20_000 })
+ const row = page
+ .getByRole('row')
+ .filter({ has: page.getByRole('cell', { name: hostDisplayName, exact: true }) })
+ await expect(row).toBeVisible({ timeout: 20_000 })
+ await expect(row).not.toContainText(contextId)
+ await screenshotAndLog(page, testInfo, `${journey}-granted`)
+
+ // 'Add access' picker modal opens and cancels.
+ await page.getByRole('button', { name: 'Add access', exact: true }).click()
+ const dialog = page.getByRole('dialog', { name: 'Add access' })
+ await expect(dialog).toBeVisible()
+ await expect(dialog.getByLabel('Access')).toBeVisible()
+ await screenshotAndLog(page, testInfo, `${journey}-add-modal`)
+ await dialog.getByRole('button', { name: 'Cancel', exact: true }).click()
+ await expect(dialog).toHaveCount(0)
+
+ // Remove the row: confirm dialog → toast → row gone.
+ await row.getByLabel('Remove access').click()
+ const confirmDialog = page.getByRole('alertdialog', { name: 'Remove Access' })
+ await expect(confirmDialog).toBeVisible()
+ await confirmDialog.getByRole('button', { name: 'Remove access', exact: true }).click()
+ await expect(page.getByRole('status').filter({ hasText: 'Access updated.' })).toBeVisible({
+ timeout: 20_000,
+ })
+ await expect(row).toHaveCount(0)
+ await screenshotAndLog(page, testInfo, `${journey}-removed`)
+ } finally {
+ if (userId && originalContextIds !== null) {
+ await api(
+ page.request,
+ 'PUT',
+ `/api/v1/admin/users/${encodeURIComponent(userId)}/contexts`,
+ { contextIds: originalContextIds }
+ )
+ }
+ await api(page.request, 'DELETE', `/api/v1/admin/hosts/${encodeURIComponent(hostName)}`)
+ await api(page.request, 'DELETE', `/api/v1/admin/contexts/${encodeURIComponent(contextName)}`)
+ }
+ })
+})
diff --git a/control-ui/e2e/qa-recorder-recipe-scope-copy.spec.ts b/control-ui/e2e/qa-recorder-recipe-scope-copy.spec.ts
new file mode 100644
index 000000000..431e07371
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-recipe-scope-copy.spec.ts
@@ -0,0 +1,214 @@
+// control-ui/e2e/qa-recorder-recipe-scope-copy.spec.ts
+//
+// Optional QA recorder journey (MUTATING). Requires
+// QA_RECORDER_CONFIRM_MUTATIONS=1. Ports the recipe-editor connector-scope
+// copy journey from
+// tests/e2e/playwright/control-ui/recipe-scope-copy.spec.ts (payload shapes
+// included):
+// - (a) an agentic recipe with spec.contextRef is seeded through the API
+// WITH security.allowContextRef (the API's policy gate only stores agentic
+// recipes that carry the opt-in), the editor's manifest textarea then
+// strips it, and the review step's policy banner must say "shared
+// connector scope" and "WRC will auto-create a private connector scope"
+// — never "private Context";
+// - (b) a transport-workload recipe WITHOUT spec.contextRef must show the
+// INFO note "Omitted — WRC will auto-create a private connector scope for
+// this recipe."
+// Both recipes and the staging context are deleted via the Control API in a
+// finally (recipes first, then the context they may reference).
+import { type Page, expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ api,
+ assertAllowedTarget,
+ loginThroughUi,
+ requireRecorderConfirm,
+ screenshotAndLog,
+ uniqueE2EName,
+} from './qa-recorder-helpers'
+
+const RECIPE_NAMESPACE_FALLBACK = 'sandbox-recipes'
+
+// A minimal agentic manifest (spec.steps[]) WITHOUT security.allowContextRef —
+// exactly the state the review-step banner must reject.
+function agenticManifestWithoutOptIn(recipeName: string, contextName: string): string {
+ return JSON.stringify(
+ {
+ apiVersion: 'clerum.io/v1alpha1',
+ kind: 'WorkflowRecipe',
+ metadata: { name: recipeName },
+ spec: {
+ contextRef: contextName,
+ workloads: [{ id: 'web', type: 'deployment', image: 'nginx:1.30.1-alpine' }],
+ steps: [
+ {
+ id: 'run',
+ run: { type: 'snippet', language: 'typescript', code: 'return { ok: true }' },
+ },
+ ],
+ },
+ },
+ null,
+ 2
+ )
+}
+
+// Transport (MCP) workload, no spec.contextRef — the shape that must produce
+// the INFO note about WRC's auto-created private connector scope.
+function transportManifest(recipeName: string): string {
+ return JSON.stringify(
+ {
+ apiVersion: 'clerum.io/v1alpha1',
+ kind: 'WorkflowRecipe',
+ metadata: { name: recipeName },
+ spec: {
+ workloads: [
+ {
+ id: 'mock-tools',
+ type: 'deployment',
+ image: 'clerum/mock-mcp-server:test',
+ port: 3000,
+ transport: { type: 'streamableHttp', path: '/mcp' },
+ },
+ ],
+ },
+ },
+ null,
+ 2
+ )
+}
+
+async function createRecipeViaApi(page: Page, manifest: string): Promise<string> {
+ const res = await api<{ metadata?: { namespace?: string } }>(
+ page.request,
+ 'POST',
+ '/api/v1/admin/recipes',
+ JSON.parse(manifest)
+ )
+ expect(res.status, `create recipe: ${JSON.stringify(res.data)}`).toBeLessThan(300)
+ return res.data.metadata?.namespace ?? RECIPE_NAMESPACE_FALLBACK
+}
+
+test.describe('optional QA recorder: Control UI recipe connector-scope copy', () => {
+ test('records the recipe editor connector-scope policy banner and omitted-scope info note', async ({
+ page,
+ }, testInfo) => {
+ requireRecorderConfirm(
+ 'QA_RECORDER_CONFIRM_MUTATIONS',
+ 'This journey creates and deletes two workflow recipes and a staging context.'
+ )
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ const contextName = uniqueE2EName('qa-recorder-recipe-ctx')
+ const agenticRecipeName = uniqueE2EName('qa-recorder-recipe-agentic')
+ const transportRecipeName = uniqueE2EName('qa-recorder-recipe-transport')
+
+ try {
+ await loginThroughUi(page, credentials)
+
+ const ctxRes = await api(page.request, 'POST', '/api/v1/admin/contexts', {
+ metadata: { name: contextName },
+ spec: {
+ contextId: contextName,
+ description: 'qa recorder recipe scope copy fixture',
+ mcpServers: [],
+ },
+ })
+ expect(ctxRes.status, `create context: ${JSON.stringify(ctxRes.data)}`).toBeLessThan(300)
+
+ // (a) Agentic recipe + spec.contextRef. Seeded WITH the
+ // security.allowContextRef opt-in (the API's policy gate only stores
+ // agentic recipes that carry it); the editor JSON below strips it,
+ // reproducing the exact state the review-step banner must reject.
+ const agenticNamespace = await createRecipeViaApi(
+ page,
+ JSON.stringify({
+ apiVersion: 'clerum.io/v1alpha1',
+ kind: 'WorkflowRecipe',
+ metadata: { name: agenticRecipeName },
+ spec: {
+ contextRef: contextName,
+ security: { allowContextRef: true },
+ workloads: [{ id: 'web', type: 'deployment', image: 'nginx:1.30.1-alpine' }],
+ steps: [
+ {
+ id: 'run',
+ run: { type: 'snippet', language: 'typescript', code: 'return { ok: true }' },
+ },
+ ],
+ },
+ })
+ )
+
+ await page.goto(
+ `${CONTROL_UI_URL}/plugins/${encodeURIComponent(agenticNamespace)}/${encodeURIComponent(agenticRecipeName)}?edit=1`
+ )
+ const editor = page.locator('textarea')
+ await expect(editor).toBeVisible({ timeout: 20_000 })
+
+ // Drop the opt-in flag — the manifest now sets spec.contextRef on an
+ // agentic recipe without security.allowContextRef.
+ await editor.fill(agenticManifestWithoutOptIn(agenticRecipeName, contextName))
+
+ const primaryAction = page.locator('.cu-create-actions button')
+ await primaryAction.filter({ hasText: 'Review manifest' }).click()
+ await expect(page.getByText(/Manifest review passed/)).toBeVisible()
+ await screenshotAndLog(page, testInfo, 'control-ui-recipe-agentic-manifest-review')
+
+ await primaryAction.filter({ hasText: 'Apply defaults' }).click()
+ await primaryAction.filter({ hasText: 'Continue to access' }).click()
+
+ const banner = page.locator('.cu-recipe-status-panel--error[role="alert"]')
+ await expect(banner).toBeVisible({ timeout: 20_000 })
+ await expect(banner).toContainText('Cannot deploy: policy violation')
+ await expect(banner).toContainText('shared connector scope')
+ await expect(banner).toContainText('WRC will auto-create a private connector scope')
+ await expect(banner).not.toContainText('private Context')
+ await screenshotAndLog(page, testInfo, 'control-ui-recipe-agentic-scope-banner')
+
+ // (b) Transport workload, no spec.contextRef — the INFO note about the
+ // auto-created private connector scope.
+ const transportNamespace = await createRecipeViaApi(
+ page,
+ transportManifest(transportRecipeName)
+ )
+
+ await page.goto(
+ `${CONTROL_UI_URL}/plugins/${encodeURIComponent(transportNamespace)}/${encodeURIComponent(transportRecipeName)}?edit=1`
+ )
+ const transportEditor = page.locator('textarea')
+ await expect(transportEditor).toBeVisible({ timeout: 20_000 })
+ await transportEditor.fill(transportManifest(transportRecipeName))
+
+ await page.locator('.cu-create-actions button').filter({ hasText: 'Review manifest' }).click()
+
+ await expect(page.getByText(/Manifest review passed/)).toBeVisible()
+ const infoGroup = page.locator('.cu-recipe-issue-group--info')
+ await expect(infoGroup).toBeVisible({ timeout: 20_000 })
+ await expect(infoGroup).toContainText('Informational notes')
+ await expect(
+ page.getByText(
+ /Omitted — WRC will auto-create a private connector scope for this recipe\./u
+ )
+ ).toBeVisible()
+ await expect(infoGroup).not.toContainText('private Context')
+ await screenshotAndLog(page, testInfo, 'control-ui-recipe-transport-scope-info')
+ } finally {
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/recipes/${encodeURIComponent(transportRecipeName)}`
+ )
+ await api(
+ page.request,
+ 'DELETE',
+ `/api/v1/admin/recipes/${encodeURIComponent(agenticRecipeName)}`
+ )
+ await api(page.request, 'DELETE', `/api/v1/admin/contexts/${encodeURIComponent(contextName)}`)
+ }
+ })
+})
diff --git a/control-ui/e2e/qa-recorder-team-access.spec.ts b/control-ui/e2e/qa-recorder-team-access.spec.ts
new file mode 100644
index 000000000..13eff2add
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-team-access.spec.ts
@@ -0,0 +1,185 @@
+// control-ui/e2e/qa-recorder-team-access.spec.ts
+//
+// Optional QA recorder journey (MUTATING). Requires QA_RECORDER_CONFIRM_MUTATIONS=1.
+// Creates a team through the Control API, seeds a host-backed access scope,
+// grants it via PUT /teams/<id>/contexts, then records the team detail Access
+// tab: subtitle "Members, connector access, and agents.", intro "Agents and
+// connector scopes this team may access.", the agent-display-name row (never
+// the raw contextId), the 'Add access' modal assertions, removal with the
+// "Team access updated." toast, and the legacy /contexts → /access redirect.
+// The team, host, and context are deleted via the Control API in the finally
+// (hosts before contexts).
+//
+// Contract: docs/testing/optional-playwright-qa-recorder.md ("Extending the
+// recorder").
+import { expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ api,
+ assertAllowedTarget,
+ loginThroughUi,
+ requireRecorderConfirm,
+ screenshotAndLog,
+ uniqueE2EName,
+} from './qa-recorder-helpers'
+
+test.describe('optional QA recorder: Control UI team Access tab', () => {
+ test('records granting, reviewing, and removing team access plus the legacy redirect', async ({
+ page,
+ }, testInfo) => {
+ requireRecorderConfirm(
+ 'QA_RECORDER_CONFIRM_MUTATIONS',
+ 'This journey creates and deletes a team, a host, and a context.'
+ )
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ const journey = 'control-ui-team-access'
+ const teamName = uniqueE2EName('qa-recorder-team-access')
+ const contextName = uniqueE2EName('qa-recorder-team-ctx')
+ const contextId = uniqueE2EName('qa-recorder-team-scope')
+ const hostName = uniqueE2EName('qa-recorder-team-host')
+ const hostDisplayName = uniqueE2EName('qa-recorder-team-agent')
+ let teamId = ''
+
+ try {
+ await loginThroughUi(page, credentials)
+
+ // Stage the team and its host-backed access scope out-of-band; the
+ // behavior under test is the Access tab round-trip.
+ const teamRes = await api<{ id?: string }>(page.request, 'POST', '/api/v1/admin/teams', {
+ name: teamName,
+ })
+ expect(teamRes.status, `create team: ${JSON.stringify(teamRes.data)}`).toBeLessThan(300)
+ teamId = String(teamRes.data.id ?? '')
+
+ const ctxRes = await api(page.request, 'POST', '/api/v1/admin/contexts', {
+ metadata: { name: contextName },
+ spec: {
+ contextId,
+ description: 'QA recorder team access scope',
+ mcpServers: [],
+ },
+ })
+ expect(ctxRes.status, `create context: ${JSON.stringify(ctxRes.data)}`).toBeLessThan(300)
+
+ const hostRes = await api(page.request, 'POST', '/api/v1/admin/hosts', {
+ metadata: { name: hostName },
+ spec: {
+ host: hostDisplayName,
+ contextRef: contextId,
+ secretRef: '',
+ channels: [],
+ model: { provider: 'openai', name: 'gpt-5.4-mini' },
+ },
+ })
+ expect(hostRes.status, `create host: ${JSON.stringify(hostRes.data)}`).toBeLessThan(300)
+
+ const grantRes = await api(
+ page.request,
+ 'PUT',
+ `/api/v1/admin/teams/${encodeURIComponent(teamId)}/contexts`,
+ { contextIds: [contextId] }
+ )
+ expect(grantRes.status, `grant team contexts: ${JSON.stringify(grantRes.data)}`).toBeLessThan(
+ 300
+ )
+
+ // Open the team from the Users & Teams directory and switch to Access.
+ await page.getByRole('link', { name: 'Users & Teams', exact: true }).click()
+ await expect(page).toHaveURL(/\/users-and-teams\/users$/, { timeout: 20_000 })
+ const teamsTab = page.getByRole('tab', { name: 'Teams', exact: true })
+ await expect(teamsTab).toBeEnabled({ timeout: 20_000 })
+ await teamsTab.click()
+ await expect(page).toHaveURL(/\/users-and-teams\/teams$/, { timeout: 20_000 })
+
+ const teamLink = page.getByRole('button', { name: teamName, exact: true })
+ await expect(teamLink).toBeVisible({ timeout: 20_000 })
+ await teamLink.click()
+ await expect(page).toHaveURL(/\/users-and-teams\/teams\/[^/]+\/members$/, {
+ timeout: 20_000,
+ })
+ if (!teamId) {
+ const match = page.url().match(/\/users-and-teams\/teams\/([^/]+)\//)
+ teamId = decodeURIComponent(match?.[1] || '')
+ }
+
+ const accessTab = page.getByRole('tab', { name: 'Access', exact: true })
+ await accessTab.click()
+ await expect(page).toHaveURL(/\/users-and-teams\/teams\/[^/]+\/access$/, {
+ timeout: 20_000,
+ })
+
+ // Exact subtitle and intro; the row shows the host display name, never
+ // the raw wire contextId.
+ await expect(
+ page.getByText('Members, connector access, and agents.', { exact: true })
+ ).toBeVisible({ timeout: 20_000 })
+ await expect(
+ page.getByText('Agents and connector scopes this team may access.', { exact: true })
+ ).toBeVisible()
+ const row = page
+ .getByRole('row')
+ .filter({ has: page.getByRole('cell', { name: hostDisplayName, exact: true }) })
+ await expect(row).toBeVisible({ timeout: 20_000 })
+ await expect(row).not.toContainText(contextId)
+ await screenshotAndLog(page, testInfo, `${journey}-granted`)
+
+ // 'Add access' picker modal assertions, then cancel.
+ await page.getByRole('button', { name: 'Add access', exact: true }).click()
+ const dialog = page.getByRole('dialog', { name: 'Add access' })
+ await expect(dialog).toBeVisible()
+ await expect(dialog.getByLabel('Access')).toBeVisible()
+ await expect(dialog.getByRole('button', { name: 'Add access', exact: true })).toBeVisible()
+ await screenshotAndLog(page, testInfo, `${journey}-add-modal`)
+ await dialog.getByRole('button', { name: 'Cancel', exact: true }).click()
+ await expect(dialog).toHaveCount(0)
+
+ // Remove the row: confirm dialog → toast → row gone.
+ await row.getByLabel('Remove access').click()
+ const confirmDialog = page.getByRole('alertdialog', { name: 'Remove Access' })
+ await expect(confirmDialog).toBeVisible()
+ await confirmDialog.getByRole('button', { name: 'Remove access', exact: true }).click()
+ await expect(
+ page.getByRole('status').filter({ hasText: 'Team access updated.' })
+ ).toBeVisible({ timeout: 20_000 })
+ await expect(row).toHaveCount(0)
+ await expect(page.getByText('No access assigned yet.', { exact: true })).toBeVisible()
+ await screenshotAndLog(page, testInfo, `${journey}-removed`)
+
+ // Legacy /contexts deep link redirects to /access.
+ await page.goto(
+ `${CONTROL_UI_URL}/users-and-teams/teams/${encodeURIComponent(teamId)}/contexts`
+ )
+ await expect(page).toHaveURL(/\/users-and-teams\/teams\/[^/]+\/access$/, {
+ timeout: 20_000,
+ })
+ await screenshotAndLog(page, testInfo, `${journey}-legacy-redirect`)
+ } finally {
+ try {
+ const request = page.request
+ let idToDelete = teamId
+ if (!idToDelete) {
+ const { status, data } = await api<{ items?: Array<{ id: string; name: string }> }>(
+ request,
+ 'GET',
+ '/api/v1/admin/teams'
+ )
+ if (status === 200) {
+ idToDelete = (data.items || []).find(team => team.name === teamName)?.id || ''
+ }
+ }
+ if (idToDelete) {
+ await api(request, 'DELETE', `/api/v1/admin/teams/${encodeURIComponent(idToDelete)}`)
+ }
+ } catch {
+ // Best-effort cleanup; the disposable environment tolerates leftovers.
+ }
+ await api(page.request, 'DELETE', `/api/v1/admin/hosts/${encodeURIComponent(hostName)}`)
+ await api(page.request, 'DELETE', `/api/v1/admin/contexts/${encodeURIComponent(contextName)}`)
+ }
+ })
+})
diff --git a/control-ui/e2e/qa-recorder-token-budget-scope.spec.ts b/control-ui/e2e/qa-recorder-token-budget-scope.spec.ts
new file mode 100644
index 000000000..c4663d331
--- /dev/null
+++ b/control-ui/e2e/qa-recorder-token-budget-scope.spec.ts
@@ -0,0 +1,99 @@
+// control-ui/e2e/qa-recorder-token-budget-scope.spec.ts
+//
+// Optional QA recorder journey (MUTATING). Requires
+// QA_RECORDER_CONFIRM_MUTATIONS=1. Ports the token-budget scope-label journey
+// from tests/e2e/playwright/control-ui/token-budget-scope-label.spec.ts: a
+// budget scoped on context_ref is created through the Control API, and the
+// Token Budgets table must render its scope as "Connector scope" — the
+// legacy "Context" wording must not appear in the budget's row. The budget
+// and its staging context are deleted via the Control API in a finally.
+import { expect, test } from '@playwright/test'
+import {
+ CONTROL_API_URL,
+ CONTROL_UI_URL,
+ adminCredentials,
+ api,
+ assertAllowedTarget,
+ loginThroughUi,
+ requireRecorderConfirm,
+ screenshotAndLog,
+ uniqueE2EName,
+} from './qa-recorder-helpers'
+
+test.describe('optional QA recorder: Control UI token budget connector scope label', () => {
+ test('records a context_ref budget rendering as "Connector scope"', async ({
+ page,
+ }, testInfo) => {
+ requireRecorderConfirm(
+ 'QA_RECORDER_CONFIRM_MUTATIONS',
+ 'This journey creates and deletes a token budget and a staging context.'
+ )
+ assertAllowedTarget('CONTROL_UI_URL', CONTROL_UI_URL)
+ assertAllowedTarget('CONTROL_API_URL', CONTROL_API_URL)
+
+ const credentials = adminCredentials()
+ const contextName = uniqueE2EName('qa-recorder-budget-ctx')
+ const budgetName = uniqueE2EName('qa-recorder-budget-scope')
+ let budgetId = ''
+
+ try {
+ await loginThroughUi(page, credentials)
+
+ const ctxRes = await api(page.request, 'POST', '/api/v1/admin/contexts', {
+ metadata: { name: contextName },
+ spec: {
+ contextId: contextName,
+ description: 'qa recorder token budget scope fixture',
+ mcpServers: [],
+ },
+ })
+ expect(ctxRes.status, `create context: ${JSON.stringify(ctxRes.data)}`).toBeLessThan(300)
+
+ const budgetRes = await api<{ id?: string }>(page.request, 'POST', '/api/v1/admin/budgets', {
+ name: budgetName,
+ enabled: true,
+ scope: { context_ref: [contextName] },
+ unit: 'tokens',
+ limit_amount: 1000000,
+ period: 'monthly',
+ timezone: 'UTC',
+ enforcement: 'warn',
+ })
+ expect(budgetRes.status, `create budget: ${JSON.stringify(budgetRes.data)}`).toBeLessThan(300)
+ budgetId = String(budgetRes.data.id || '')
+
+ // Cost & Usage is an expandable sidebar group rendered as a <button>
+ // (its children only enter the DOM when expanded). After login we land
+ // on /agents, so expand it — guarded on aria-expanded to stay resilient
+ // if the group is already open — then take the Token Budgets child
+ // link like an operator would.
+ const costToggle = page.getByRole('button', { name: 'Cost & Usage', exact: true })
+ await expect(costToggle).toBeVisible({ timeout: 20_000 })
+ if ((await costToggle.getAttribute('aria-expanded')) !== 'true') {
+ await costToggle.click()
+ }
+ const tokenBudgetsLink = page.getByRole('link', { name: 'Token Budgets', exact: true })
+ await expect(tokenBudgetsLink).toBeVisible({ timeout: 20_000 })
+ await tokenBudgetsLink.click()
+ await expect(page).toHaveURL(/\/cost-and-usage\/token-budgets/, { timeout: 20_000 })
+ await expect(
+ page.getByText('Spend caps per dimension, shown against live usage.')
+ ).toBeVisible({ timeout: 20_000 })
+
+ const row = page.locator('tr', { hasText: budgetName }).first()
+ await expect(row).toBeVisible({ timeout: 20_000 })
+
+ await expect(row.getByText('Connector scope', { exact: true })).toBeVisible()
+ const rowText = await row.innerText()
+ expect(rowText, 'budget row must not use the legacy "Context" wording').not.toMatch(
+ /\bContext\b/
+ )
+ await screenshotAndLog(page, testInfo, 'control-ui-token-budget-scope')
+ } finally {
+ if (budgetId) {
+ await api(page.request, 'DELETE', `/api/v1/admin/budgets/${encodeURIComponent(budgetId)}`)
+ }
+ await api(page.request, 'DELETE', `/api/v1/admin/contexts/${encodeURIComponent(contextName)}`)
+ }
+ })
+})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index f5980bc64..4f7c2c87d 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.464",
+ "version": "0.1.465",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.464",
+ "version": "0.1.465",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --git a/control-ui/package.json b/control-ui/package.json
index d8b025660..c3692f02f 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.464",
+ "version": "0.1.465",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
@@ -40,6 +40,17 @@
"qa:recorder:settings-email": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-settings-email.spec.ts",
"qa:recorder:create-form-smoke": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-create-form-smoke.spec.ts",
"qa:recorder:marketplace-browse": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-marketplace-browse.spec.ts",
+ "qa:recorder:context-redirects": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-context-redirects.spec.ts",
+ "qa:recorder:agent-connectors": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-agent-connectors.spec.ts",
+ "qa:recorder:connectors-agent-access": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-connectors-agent-access.spec.ts",
+ "qa:recorder:connector-create-access": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-connector-create-access.spec.ts",
+ "qa:recorder:marketplace-install": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-marketplace-install.spec.ts",
+ "qa:recorder:member-access": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-member-access.spec.ts",
+ "qa:recorder:team-access": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-team-access.spec.ts",
+ "qa:recorder:agent-files-mounted-by": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-agent-files-mounted-by.spec.ts",
+ "qa:recorder:recipe-scope-copy": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-recipe-scope-copy.spec.ts",
+ "qa:recorder:token-budget-scope": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-token-budget-scope.spec.ts",
+ "qa:recorder:context-vocab-sweep": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-context-vocab-sweep.spec.ts",
"qa:recorder:all": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts",
"test": "vitest run",
"test:watch": "vitest"
diff --git a/docs/features/control-ui-context-removal.md b/docs/features/control-ui-context-removal.md
index 42a774235..b87d03053 100644
--- a/docs/features/control-ui-context-removal.md
+++ b/docs/features/control-ui-context-removal.md
@@ -216,6 +216,24 @@ Tests updated in the same commit: `HostTable.test.tsx` (hover card now asserts a
| `global-no-context-vocab.spec.ts` | Global negative check across 7 routes |
Seeding goes through new `controlApi` helpers in `helpers/api-client.ts` (`createContext`, `createMcpServer`, user/team context GET/PUT, `createTeam`, `createBudget`, SFS list). Run with `make minikube-pf-all` then `cd tests/e2e/playwright && npx playwright test --project=control-ui <spec>`; env: `CONTROL_UI_URL` (default `:3000`), `CONTROL_API_URL` (default `:8090`), `TEST_ADMIN_USERNAME`/`TEST_ADMIN_PASSWORD` (default `admin`/`changeme123!`). Typecheck gate: `npx tsc -p tsconfig.typecheck.json` (added config — the package tsconfig lacks node types/rootDir for a clean standalone `tsc` run).
+- **QA-recorder video-evidence journeys** (`control-ui/e2e/qa-recorder-*.spec.ts`, built 2026-08-27) — one journey = one video (WebM) + named PNGs under `.local-notes/qa-recorder/runs/control-ui/`, each with its own `npm run qa:recorder:<name>` script:
+
+ | Script | Covers (§12) | Mutating |
+ | --- | --- | --- |
+ | `qa:recorder:context-redirects` | A1–A5 | yes (seeds throwaway ctx+host) |
+ | `qa:recorder:agent-connectors` | B1, B2, B4 | yes |
+ | `qa:recorder:connectors-agent-access` | C1–C4 incl. shared-scope confirm | yes |
+ | `qa:recorder:connector-create-access` | C5–C6 incl. silent private-scope capture | yes |
+ | `qa-recorder-connector-edit` (extended) | C7–C9 incl. legacy `/edit/context` redirect | yes |
+ | `qa:recorder:marketplace-install` | D1–D3 incl. post-install grant | yes (skips when no registry entry) |
+ | `qa:recorder:member-access` | E1–E3 + E6 column checks | yes (restores original mappings) |
+ | `qa:recorder:team-access` | E4 + legacy tab redirect | yes |
+ | `qa:recorder:agent-files-mounted-by` | F1–F2 | no |
+ | `qa:recorder:recipe-scope-copy` | G1–G2 | yes |
+ | `qa:recorder:token-budget-scope` | G3 | yes |
+ | `qa:recorder:context-vocab-sweep` | Global negative check, 8 routes | no |
+
+ Prerequisites for video evidence: `npm run qa:recorder:install` (once), `make minikube-pf-all`, and a repo-root `.env.qa-recorder` copied from the committed `.env.qa-recorder.example` containing the admin identity (`E2E_ADMIN_USER`/`E2E_ADMIN_PASSWORD`) and `QA_RECORDER_CONFIRM_MUTATIONS=1` for the mutating journeys. Journeys follow the recorder contract (`docs/testing/optional-playwright-qa-recorder.md`): loopback-only target guard, explicit opt-in before any write, and full API cleanup in `finally`.
- Verification per phase: `cd control-ui && npx tsc --noEmit && npm test` (no lint script exists in control-ui; typecheck via `tsc --noEmit`).
## 10. Progress log (append-only)
@@ -232,6 +250,7 @@ Tests updated in the same commit: `HostTable.test.tsx` (hover card now asserts a
| 2026-08-27 | audit | Fresh-eyes residual audit (independent pass) + fixes. **Backend re-verified untouched**: `git diff --name-only a584c259a..HEAD` contains zero files outside `control-ui/`, `docs/`, `tests/e2e/` (an apparent `host-context-controller` diff was `origin/dev` moving forward under us mid-run — PR #471, someone else's lane; our branch never touched it). Leaks fixed: (1) RecipeEditor L1 Option B still said "a private Context \"wf-<recipeName>\"" (earlier scripted replace had silently missed it) → "a private connector scope"; (2) `lib/recipeValidator.ts` INFO hint same reword; (3) `lib/contextMutation.ts` default messages neutralized ("A required version is unavailable…", "This access changed since it was loaded…") + `hosts/[name]` regex updated + connectors page now also intercepts the version-unavailable path; (4) token-budget dimension label `context_ref` "Context" → "Connector scope"; (5) "Stored context and provenance" trace-detail heading → "Stored details and provenance"; (6) stale qa-recorder-connector-edit assertion on the removed context-slug meta now asserts it does NOT render. Tests updated (RecipeEditor, GovernedTraceDetails). Remaining "context" words verified as §2.5 exclusions: kubectl `--context` flags in recipe-status hints (kubeconfig syntax), manifest `contextRef` prose (wire format), raw-id fallback labels (by design, muted), `host-context-controller` service label, LLM "User context" (USER.md), guardrail `may add context`, plus intentional legacy redirects in `next.config.js`. Full vitest 1700/1700, `tsc` clean. No backend changes. |
| 2026-08-27 | docs | Source-of-truth restructured after the audit: added §11 (audit report: backend-untouched proof incl. the `origin/dev`-moved warning, leak/fix table, verified intentional remnants), §12 (full click-by-click manual tester walkthrough, tables A–G + global negative check), renumbered open questions to §13; extended the §2.5 exclusion list to the complete audited set; corrected §4 E1 (hover card shows a neutral "Connectors" heading, not the agent name) and the §6.4 heading typo. |
| 2026-08-27 | e2e | Built the full e2e regression catalog for the §12 flows: 15 new specs + `contexts.spec.ts` extended with the real-slug resolver case (112 tests / 24 files listed for the control-ui project). Extended `helpers/api-client.ts` with context/mcp-server/user-team-contexts/team/budget seeding + teardown helpers (all against the unchanged wire API). Added `tests/e2e/playwright/tsconfig.typecheck.json` so the package typechecks standalone (`npx tsc -p tsconfig.typecheck.json` → clean; the shipped tsconfig lacks node types + a covering rootDir). No specs executed here (no cluster) — they run under the normal `make test-playwright-control-ui` / T2 lane. control-ui unit suite re-verified 1700/1700. No backend changes. |
+| 2026-08-27 | e2e | Built the QA-recorder video-evidence journeys: 11 new `qa-recorder-*` specs + `qa-recorder-connector-edit` extended with the legacy-tab redirect, each with a dedicated `qa:recorder:<name>` npm script (62 tests / 45 files listed under the recorder config). Journeys follow the recorder contract (loopback guard, `QA_RECORDER_CONFIRM_MUTATIONS` opt-in for mutating journeys, `screenshotAndLog` at every step, full API cleanup in `finally`). Committed the previously-missing `.env.qa-recorder.example` (referenced by the recorder doc but never tracked) with the exact keys the journeys need. Verification: control-ui `tsc --noEmit` clean, recorder `--list` clean, unit suite 1700/1700. No backend changes. |
## 11. Post-implementation audit (2026-08-27)