CodeSampleX

Sample

playwright 1.63.0

Verified sample for npm playwright 1.63.0. The contract ran on node 22 · linux debian/x64 · docker and passed: chromium, firefox, and webkit browser types…

sha256:d5e9d11d35391f53bd06aa71c11eef57188f162b3d4547defb0ca3d142c212a5

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
1
Signing keys that built it
1
Declared environment linux 24 · ubuntu · glibc 2.39 x64 npm

Verification-run environments

Environment Contract Stages Run
node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2…
2026-09-10

Case

HOW
Goal
verify pkg:npm/playwright@1.63.0
Packages
Created
2026-09-10T17:27:14Z

Contract

  1. chromium, firefox, and webkit browser types provide expected type names
  2. devices dictionary exposes mobile device emulation profiles
  3. errors namespace exports TimeoutError error class
  4. request APIRequestContext sends HTTP GET requests and parses JSON responses
  5. request APIRequestContext supports POST requests with JSON payload
  6. request APIRequestContext handles non-ok status codes and text responses

Files

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.mjs

Download the source artifact (tar.gz)

Source

PROMPT.md
Clean-room public code sample — generation instructions

Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.

A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.

Goal: verify pkg:npm/playwright@1.63.0
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/playwright@1.63.0

Rules:
  - One focused purpose; the smallest project that proves the goal.
  - Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
  - Pin every dependency with a lockfile so resolution is reproducible.
  - No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
  - No personal names, emails, company names, or project identifiers of any kind.
  - No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
  - Keep it under 200 files and 256KB packed.
csx.json
{"case":{"caseId":"case:sha256:3942bed4780aa5fce744f527f2ccf432f45846b641749064350e55a87e22fbbb","contract":["chromium, firefox, and webkit browser types provide expected type names","devices dictionary exposes mobile device emulation profiles","errors namespace exports TimeoutError error class","request APIRequestContext sends HTTP GET requests and parses JSON responses","request APIRequestContext supports POST requests with JSON payload","request APIRequestContext handles non-ok status codes and text responses"],"goal":"verify pkg:npm/playwright@1.63.0","kind":"HOW","packages":["pkg:npm/playwright@1.63.0"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/playwright@1.63.0"],"schemaVersion":1,"subject":"pkg:npm/playwright@1.63.0","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "playwright-sample",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "playwright-sample",
      "version": "1.0.0",
      "dependencies": {
        "playwright": "1.63.0"
      }
    },
    "node_modules/playwright": {
      "version": "1.63.0",
      "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz",
      "integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==",
      "license": "Apache-2.0",
      "dependencies": {
        "playwright-core": "1.63.0"
      },
      "bin": {
        "playwright": "cli.js"
      },
      "engines": {
        "node": ">=20"
      }
    },
    "node_modules/playwright-core": {
      "version": "1.63.0",
      "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz",
      "integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==",
      "license": "Apache-2.0",
      "bin": {
        "playwright-core": "cli.js"
      },
      "engines": {
        "node": ">=20"
      }
    }
  }
}
package.json
{
  "name": "playwright-sample",
  "version": "1.0.0",
  "private": true,
  "description": "Clean-room verification for playwright",
  "dependencies": {
    "playwright": "1.63.0"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/playwright@1.63.0",
  "kind": "HOW",
  "packages": [
    "pkg:npm/playwright@1.63.0"
  ]
}
test/contract.mjs
import assert from 'node:assert';
import http from 'node:http';
import { chromium, firefox, webkit, devices, errors, request } from 'playwright';

// 1. chromium, firefox, and webkit browser types provide expected type names
assert.strictEqual(chromium.name(), 'chromium');
assert.strictEqual(firefox.name(), 'firefox');
assert.strictEqual(webkit.name(), 'webkit');

// 2. devices dictionary exposes mobile device emulation profiles
assert.ok('iPhone 12' in devices);
const iphone = devices['iPhone 12'];
assert.ok(iphone.userAgent.includes('iPhone'));
assert.strictEqual(typeof iphone.viewport.width, 'number');
assert.strictEqual(typeof iphone.viewport.height, 'number');
assert.strictEqual(iphone.isMobile, true);
assert.strictEqual(iphone.hasTouch, true);

// 3. errors namespace exports TimeoutError error class
assert.ok(errors.TimeoutError);
const timeoutErr = new errors.TimeoutError('operation timed out');
assert.ok(timeoutErr instanceof Error);
assert.strictEqual(timeoutErr.name, 'TimeoutError');

// 4. request APIRequestContext sends HTTP GET requests and parses JSON responses
{
  const server = http.createServer((req, res) => {
    if (req.url === '/api/status') {
      res.writeHead(200, { 'Content-Type': 'application/json' });
      res.end(JSON.stringify({ status: 'ok', version: '1.63.0' }));
      return;
    }
    res.writeHead(404);
    res.end();
  });
  await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));
  const port = server.address().port;

  try {
    const context = await request.newContext({ baseURL: `http://127.0.0.1:${port}` });
    const res = await context.get('/api/status');
    assert.strictEqual(res.status(), 200);
    assert.strictEqual(res.ok(), true);
    const data = await res.json();
    assert.strictEqual(data.status, 'ok');
    assert.strictEqual(data.version, '1.63.0');
    await context.dispose();
  } finally {
    await new Promise((resolve) => server.close(resolve));
  }
}

// 5. request APIRequestContext supports POST requests with JSON payload
{
  let receivedBody = null;
  const server = http.createServer((req, res) => {
    let body = '';
    req.on('data', (chunk) => {
      body += chunk;
    });
    req.on('end', () => {
      receivedBody = JSON.parse(body);
      res.writeHead(201, { 'Content-Type': 'application/json' });
      res.end(JSON.stringify({ received: true, echo: receivedBody }));
    });
  });
  await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));
  const port = server.address().port;

  try {
    const context = await request.newContext({ baseURL: `http://127.0.0.1:${port}` });
    const res = await context.post('/api/echo', {
      data: { test: 'playwright-contract' },
    });
    assert.strictEqual(res.status(), 201);
    const data = await res.json();
    assert.strictEqual(data.received, true);
    assert.deepStrictEqual(data.echo, { test: 'playwright-contract' });
    await context.dispose();
  } finally {
    await new Promise((resolve) => server.close(resolve));
  }
}

// 6. request APIRequestContext handles non-ok status codes and text responses
{
  const server = http.createServer((req, res) => {
    res.writeHead(404, { 'Content-Type': 'text/plain' });
    res.end('Not Found Here');
  });
  await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));
  const port = server.address().port;

  try {
    const context = await request.newContext({ baseURL: `http://127.0.0.1:${port}` });
    const res = await context.get('/missing');
    assert.strictEqual(res.status(), 404);
    assert.strictEqual(res.ok(), false);
    const text = await res.text();
    assert.strictEqual(text, 'Not Found Here');
    await context.dispose();
  } finally {
    await new Promise((resolve) => server.close(resolve));
  }
}

console.log('Contract passed');

Origin Seeder

anonymous