Sample
update-browserslist-db 1.3.0
Verified sample for npm update-browserslist-db 1.3.0. The contract ran on node 22 · linux alpine/x64 · docker and passed: update-browserslist-db exports a…
sha256:66fa5dfcae315c25f20270d693991f9cb9c6848fd24275f19c8f5be3c250fa97
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
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-26 |
Case
HOW- Goal
- verify pkg:npm/update-browserslist-db@1.3.0
- Packages
- Environment
- node 22.23.2
- Created
- 2026-08-26T07:56:41Z
Contract
- update-browserslist-db exports a callable update function that accepts a custom print handler
- update-browserslist-db detectLockfile throws BrowserslistUpdateError with browserslist flag when executed outside a project directory
- update-browserslist-db detectLockfile throws BrowserslistUpdateError when package.json exists without any supported lockfile
Files
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.js
Source
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/update-browserslist-db@1.3.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/update-browserslist-db@1.3.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.
{"case":{"caseId":"case:sha256:d7f640bd248349489de5b0e77c557c2c8526d611d8e9f9185a19cbd55cbb9b69","constraints":{"executionContext":"node"},"contract":["update-browserslist-db exports a callable update function that accepts a custom print handler","update-browserslist-db detectLockfile throws BrowserslistUpdateError with browserslist flag when executed outside a project directory","update-browserslist-db detectLockfile throws BrowserslistUpdateError when package.json exists without any supported lockfile"],"goal":"verify pkg:npm/update-browserslist-db@1.3.0","kind":"HOW","packages":["pkg:npm/update-browserslist-db@1.3.0"],"schemaVersion":1},"contractCommand":["node","test/contract.js"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/update-browserslist-db@1.3.0"],"schemaVersion":1,"subject":"pkg:npm/update-browserslist-db@1.3.0","verifierAdapter":"node-typescript@1"}
{
"name": "update-browserslist-db-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "update-browserslist-db-sample",
"version": "1.0.0",
"dependencies": {
"update-browserslist-db": "1.3.0"
}
},
"node_modules/baseline-browser-mapping": {
"version": "2.11.19",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.19.tgz",
"integrity": "sha512-Grytf1xOxOEMTGRwx6rLGKkTabd4vMg3VrKdj/7joCmV0qgh4QwMMO6xh34YEXQqirAuUdgQGa5orJQQ+69RBw==",
"license": "Apache-2.0",
"peer": true,
"bin": {
"baseline-browser-mapping": "dist/cli.cjs"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/browserslist": {
"version": "4.28.8",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.8.tgz",
"integrity": "sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.11.12",
"caniuse-lite": "^1.0.30001809",
"electron-to-chromium": "^1.5.402",
"node-releases": "^2.0.53",
"update-browserslist-db": "^1.3.0"
},
"bin": {
"browserslist": "cli.js"
},
"engines": {
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001810",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz",
"integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "CC-BY-4.0",
"peer": true
},
"node_modules/electron-to-chromium": {
"version": "1.5.415",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.415.tgz",
"integrity": "sha512-958V+Kbhtgz+SxXeEVKBjrlKRBIDAYvUJfwhjxMZ5S6ut9jAl7l9ZKBkBrvjyjZE36PabLUo2L8kEeV5O4vgJg==",
"license": "ISC",
"peer": true
},
"node_modules/escalade": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
"integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/node-releases": {
"version": "2.0.53",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.53.tgz",
"integrity": "sha512-D9UOmYG3UH1V+ENW56t5QXBwJw1YEY18ruVeus89Rw+SyIgjPkCO84bRzO3uNIYosJbNwiabWVn48o3uJLjxFQ==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=18"
}
},
"node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
"license": "ISC"
},
"node_modules/update-browserslist-db": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.0.tgz",
"integrity": "sha512-x/M6q3w4Ybp91CNaS4S69UnliqR3BzRpOT6LWbksjth0S/+jhfaPJsWjt/TewpT8j9eLIojUf5jr29WextHroA==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"escalade": "^3.2.0",
"picocolors": "^1.1.1"
},
"bin": {
"update-browserslist-db": "cli.js"
},
"peerDependencies": {
"browserslist": ">= 4.21.0"
}
}
}
}
{
"name": "update-browserslist-db-sample",
"version": "1.0.0",
"private": true,
"dependencies": {
"update-browserslist-db": "1.3.0"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/update-browserslist-db@1.3.0",
"kind": "HOW",
"packages": [
"pkg:npm/update-browserslist-db@1.3.0"
]
}
const updateDb = require('update-browserslist-db');
/**
* Runs the browserslist DB update procedure with an optional print handler.
*
* @param {Function} [printFn] - Custom print handler receiving log strings.
*/
function runUpdateDb(printFn) {
if (printFn) {
updateDb(printFn);
} else {
updateDb();
}
}
/**
* Validates if an error is a BrowserslistUpdateError.
*
* @param {Error|*} err - The error object to check.
* @returns {boolean} True if the error is from Browserslist update routines.
*/
function isBrowserslistUpdateError(err) {
return Boolean(
err &&
typeof err === 'object' &&
err.name === 'BrowserslistUpdateError' &&
err.browserslist === true
);
}
module.exports = {
updateDb,
runUpdateDb,
isBrowserslistUpdateError,
};
const assert = require('node:assert/strict');
const os = require('node:os');
const fs = require('node:fs');
const path = require('node:path');
const {
updateDb,
runUpdateDb,
isBrowserslistUpdateError,
} = require('../src/index.js');
// Contract 1: update-browserslist-db exports a callable update function that accepts a custom print handler
{
assert.strictEqual(typeof updateDb, 'function', 'updateDb should be an exported function');
assert.strictEqual(typeof runUpdateDb, 'function', 'runUpdateDb should be a helper function');
}
// Contract 2: update-browserslist-db detectLockfile throws BrowserslistUpdateError with browserslist flag when executed outside a project directory
{
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'contract-empty-'));
const prevCwd = process.cwd();
try {
process.chdir(tempDir);
let logs = [];
const customPrint = (msg) => logs.push(msg);
assert.throws(
() => {
runUpdateDb(customPrint);
},
(err) => {
assert.ok(isBrowserslistUpdateError(err), 'Should be BrowserslistUpdateError');
assert.strictEqual(err.name, 'BrowserslistUpdateError');
assert.strictEqual(err.browserslist, true);
assert.ok(err.message.includes('Cannot find package.json'), 'Message should indicate missing package.json');
return true;
}
);
} finally {
process.chdir(prevCwd);
fs.rmSync(tempDir, { recursive: true, force: true });
}
}
// Contract 3: update-browserslist-db detectLockfile throws BrowserslistUpdateError when package.json exists without any supported lockfile
{
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'contract-nolock-'));
const prevCwd = process.cwd();
try {
fs.writeFileSync(path.join(tempDir, 'package.json'), '{}');
process.chdir(tempDir);
let logs = [];
const customPrint = (msg) => logs.push(msg);
assert.throws(
() => {
runUpdateDb(customPrint);
},
(err) => {
assert.ok(isBrowserslistUpdateError(err), 'Should be BrowserslistUpdateError');
assert.strictEqual(err.name, 'BrowserslistUpdateError');
assert.strictEqual(err.browserslist, true);
assert.ok(err.message.includes('No lockfile found'), 'Message should indicate missing lockfile');
return true;
}
);
} finally {
process.chdir(prevCwd);
fs.rmSync(tempDir, { recursive: true, force: true });
}
}
console.log('All pkg:npm/update-browserslist-db@1.3.0 contracts passed successfully.');
Origin Seeder
anonymous