Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test: verify patched Playwright runtime through a real browser session
Alfredo Lopezd549db656209
diff --git a/.github/workflows/ci-public.yml b/.github/workflows/ci-public.ymlindex af78dc457..df243e7ce 100644--- a/.github/workflows/ci-public.yml+++ b/.github/workflows/ci-public.yml@@ -61,6 +61,9 @@ jobs:dockerfile: mcp-host/Dockerfile.desktopcontext: .host: true+ - name: playwright-test+ dockerfile: mcp-servers/playwright/Dockerfile+ context: mcp-servers/playwright- name: reference-hookdockerfile: hooks/reference-guardrail-hook/Dockerfilecontext: hooks/reference-guardrail-hook@@ -120,6 +123,11 @@ jobs:});NODE+ - name: Verify patched test Playwright with a real browser session+ if: matrix.variant.name == 'playwright-test'+ run: |+ timeout 90 docker run --rm -i --network none --entrypoint node --workdir /app runtime-smoke < mcp-servers/playwright/test/runtime-smoke.cjs+test:name: Build / test / typecheck (${{ matrix.service }})runs-on: ubuntu-latestdiff --git a/mcp-servers/package-lock.json b/mcp-servers/package-lock.jsonindex d3e100f86..a967175d2 100644--- a/mcp-servers/package-lock.json+++ b/mcp-servers/package-lock.json@@ -1,12 +1,12 @@{"name": "@clerum/mcp-servers",- "version": "1.0.11",+ "version": "1.0.12","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "@clerum/mcp-servers",- "version": "1.0.11",+ "version": "1.0.12","dependencies": {"js-yaml": "^4.1.1"},diff --git a/mcp-servers/package.json b/mcp-servers/package.jsonindex a33a19fbd..eb7af20a4 100644--- a/mcp-servers/package.json+++ b/mcp-servers/package.json@@ -1,6 +1,6 @@{"name": "@clerum/mcp-servers",- "version": "1.0.11",+ "version": "1.0.12","description": "MCP servers for Clerum testing","type": "module","main": "index.ts",diff --git a/mcp-servers/playwright/Dockerfile b/mcp-servers/playwright/Dockerfileindex e7060e4fc..5ef8d3f7e 100644--- a/mcp-servers/playwright/Dockerfile+++ b/mcp-servers/playwright/Dockerfile@@ -1,2 +1,9 @@+FROM node:24.22.1-slim@sha256:55fb5f5a527ea2c5c4a95f963e48ef90aa38c7b346054fdc8ee9957a2b55d205 AS node-runtime+FROM mcr.microsoft.com/playwright/mcp@sha256:a9d607e571d70954acc36de7a45e7f424a94cebdfba973b1f404435108c60f3f+# The pinned MCP image bundles Node 22.22.0. Keep its browser dependencies+# and application, but run them with the patched official glibc Node binary.+COPY --from=node-runtime /usr/local/bin/node /usr/local/bin/node+ENV NODE_VERSION=24.22.1+RUN node -e "if (process.versions.node !== '24.22.1') throw new Error('Unexpected Node runtime')"RUN node /app/node_modules/playwright/cli.js install chromiumdiff --git a/mcp-servers/playwright/README.md b/mcp-servers/playwright/README.mdindex cef10e527..6b3963ab0 100644--- a/mcp-servers/playwright/README.md+++ b/mcp-servers/playwright/README.md@@ -45,14 +45,19 @@ See [`mcpserver.yaml`](./mcpserver.yaml) for the full CRD spec. Key fields:Available; deployable via the makefile. No test suite in this directory (unlike `airtable/` and `mongodb/`). Referenced by `docs/crds/context.md` and `charts/clerum-crds/examples/context1.yaml` (a `Context` listing `playwright-server`), and by the `deploy-playwright` target in [`../makefile`](../makefile).-## Node security update status (2026-10-22)--The current upstream digest declares Node 22.22.0. The official `latest`-(`v0.0.83`), `v0.0.82` and `v0.0.81` image configurations declare Node 24.21.0-on both amd64 and arm64. These are below the applicable fixed versions in the-[October 2026 Node advisory](https://nodejs.org/en/blog/vulnerability/october-2026-security-releases).--Keep the official application image and verify an upstream security release-before updating the deployment digest. The platform's standalone Node upgrade-does not patch this bundled runtime. This repository does not replace the-upstream Node binary or publish a custom Node variant for this update.+## Temporary Node security patch for tests (2026-10-22)++The pinned official image declares Node 22.22.0. The latest official release+`v0.0.83` and the previous two stable tags declare Node 24.21.0 on amd64 and+arm64, below the current security floor.++For the test image, the Dockerfile keeps the pinned official application and+browser dependencies and replaces only Node with the official digest-pinned+24.22.1 glibc binary. This is temporary until a patched official Playwright+image is available. The deployment manifest retains its upstream digest.++`test/runtime-smoke.cjs` runs inside the isolated Linux container. It starts the+real MCP HTTP server and Chromium, navigates to a loopback fixture, clicks the+button through MCP, checks the updated page and verifies an actual PNG capture.+CI runs the image and this browser check on amd64 and arm64. CLI loading alone+is not a successful browser validation.diff --git a/mcp-servers/playwright/test/runtime-smoke.cjs b/mcp-servers/playwright/test/runtime-smoke.cjsnew file mode 100644index 000000000..490d0a7cc--- /dev/null+++ b/mcp-servers/playwright/test/runtime-smoke.cjs@@ -0,0 +1,143 @@+'use strict'++// Container-only compatibility test. The fixture stays on loopback and needs+// no credentials, external page, host mount or published container image.+const assert = require('node:assert/strict')+const { spawn, execFileSync } = require('node:child_process')+const fs = require('node:fs')+const { createServer } = require('node:http')+const { createRequire } = require('node:module')+const net = require('node:net')+const { setTimeout: delay } = require('node:timers/promises')++const fromApp = createRequire('/app/package.json')+const { Client } = fromApp('@modelcontextprotocol/sdk/client/index.js')+const { StreamableHTTPClientTransport } = fromApp(+ '@modelcontextprotocol/sdk/client/streamableHttp.js'+)+const outputDir = '/tmp/playwright-runtime-smoke'++async function portReady(port) {+ for (let attempt = 0; attempt < 40; attempt += 1) {+ const ready = await new Promise(resolve => {+ const socket = net.connect({ host: '127.0.0.1', port })+ socket.setTimeout(500)+ socket.once('connect', () => {+ socket.destroy()+ resolve(true)+ })+ socket.once('error', () => {+ socket.destroy()+ resolve(false)+ })+ socket.once('timeout', () => {+ socket.destroy()+ resolve(false)+ })+ })+ if (ready) return+ await delay(200)+ }+ throw new Error('Playwright MCP did not become ready')+}++async function main() {+ assert.equal(process.versions.node, '24.22.1')+ fs.mkdirSync(outputDir, { recursive: true, mode: 0o700 })+ const mcpVersion = execFileSync(process.execPath, ['/app/cli.js', '--version'], {+ encoding: 'utf8',+ }).trim()+ const fixture = createServer((_request, response) => {+ response.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' })+ response.end(+ "<!doctype html><html><head><title>Runtime smoke</title></head><body><button onclick=\"document.querySelector('output').textContent='check completed'\">Run check</button><output>waiting</output></body></html>"+ )+ })+ await new Promise(resolve => fixture.listen(0, '127.0.0.1', resolve))+ const server = spawn(+ process.execPath,+ [+ '/app/cli.js',+ '--headless',+ '--browser',+ 'chromium',+ '--no-sandbox',+ '--host',+ '127.0.0.1',+ '--port',+ '8931',+ '--allowed-hosts',+ '*',+ '--output-dir',+ outputDir,+ ],+ {+ cwd: '/app',+ stdio: ['ignore', 'ignore', 'inherit'],+ }+ )+ let spawnError+ server.once('error', error => {+ spawnError = error+ })+ const client = new Client({ name: 'runtime-smoke', version: '1.0.0' }, { capabilities: {} })+ const transport = new StreamableHTTPClientTransport(new URL('http://127.0.0.1:8931/mcp'))+ const text = result =>+ result.content+ .filter(row => row.type === 'text')+ .map(row => row.text)+ .join('\n')+ const call = async (name, args = {}) => {+ const result = await client.callTool({ name, arguments: args })+ assert.notEqual(result.isError, true, `${name}: ${text(result)}`)+ return result+ }+ try {+ await portReady(8931)+ if (spawnError) throw spawnError+ await client.connect(transport)+ const tools = new Set((await client.listTools()).tools.map(tool => tool.name))+ for (const name of [+ 'browser_navigate',+ 'browser_snapshot',+ 'browser_click',+ 'browser_take_screenshot',+ 'browser_evaluate',+ ])+ assert.ok(tools.has(name), `Missing real MCP tool: ${name}`)+ await call('browser_navigate', { url: `http://127.0.0.1:${fixture.address().port}` })+ const before = text(await call('browser_snapshot'))+ assert.match(before, /waiting/)+ const button = /button "Run check" \[ref=([^\]]+)\]/.exec(before)+ assert.ok(button, before)+ await call('browser_click', { element: 'Run check button', ref: button[1] })+ assert.match(text(await call('browser_snapshot')), /check completed/)+ const agent = text(await call('browser_evaluate', { function: '() => navigator.userAgent' }))+ const browserVersion = /(?:HeadlessChrome|Chrome)\/[\d.]+/.exec(agent)+ assert.ok(browserVersion, agent)+ await call('browser_take_screenshot', { filename: 'runtime.png' })+ const screenshot = fs.readFileSync(`${outputDir}/runtime.png`)+ assert.equal(screenshot.subarray(0, 8).toString('hex'), '89504e470d0a1a0a')+ console.log(+ JSON.stringify({+ status: 'PASS',+ nodeVersion: process.versions.node,+ mcpVersion,+ browserVersion: browserVersion[0],+ navigation: true,+ realClick: true,+ screenshotBytes: screenshot.length,+ })+ )+ } finally {+ await client.close()+ server.kill('SIGTERM')+ fixture.closeAllConnections()+ await new Promise(resolve => fixture.close(resolve))+ }+}++main().catch(error => {+ console.error(error)+ process.exitCode = 1+})