Exemplo
electron-to-chromium 1.5.402: versions
Amostra verificada para npm electron-to-chromium 1.5.402: versions. O contrato rodou em node 22 · linux alpine/x64 · docker e passou.
sha256:681cd09e5cd57e22367bcaaa322f7c2214564360e15d6a33ca230e6f8fde33d6
Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu.
Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas.
MIT-0
Evidência de execução
O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.
- Base da evidência
- Contrato assinado aprovado
- Recibos de verificação
- 1
- Chaves de assinatura que o compilaram
- 1
Ambiente declarado
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Ambientes das execuções de verificação
| Ambiente | Contrato | Etapas | Execução |
|---|---|---|---|
| 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-27 |
Caso
HOW- Objetivo
- verify versions in pkg:npm/electron-to-chromium@1.5.402
- Pacotes
- Símbolos
-
- versions
- Ambiente
- node 22.23.2
- Criado
- 2026-08-27T09:12:39Z
Contrato
- versions is an object mapping Electron version strings to Chromium major version strings
- versions maps legacy Electron versions to Chromium versions
- versions maps modern Electron versions to Chromium versions
- versions returns undefined for unmapped or non-existent Electron versions
- versions contains only string keys and string values
Arquivos
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.js
Código-fonte
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 versions in pkg:npm/electron-to-chromium@1.5.402
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/electron-to-chromium@1.5.402
Demonstrate these symbols/APIs:
- versions
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:dacd080755eb40b9d95a55fdd2a982fdbf1817831363fb4ff192f44ab1d60a72","contract":["versions is an object mapping Electron version strings to Chromium major version strings","versions maps legacy Electron versions to Chromium versions","versions maps modern Electron versions to Chromium versions","versions returns undefined for unmapped or non-existent Electron versions","versions contains only string keys and string values"],"goal":"verify versions in pkg:npm/electron-to-chromium@1.5.402","kind":"HOW","packages":["pkg:npm/electron-to-chromium@1.5.402"],"schemaVersion":1,"symbols":["versions"]},"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/electron-to-chromium@1.5.402"],"schemaVersion":1,"subject":"pkg:npm/electron-to-chromium@1.5.402","symbols":["versions"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-electron-to-chromium-versions",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-electron-to-chromium-versions",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"electron-to-chromium": "1.5.402"
}
},
"node_modules/electron-to-chromium": {
"version": "1.5.402",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.402.tgz",
"integrity": "sha512-/oOpMaPT6Yg+6/1XQhyIPlzgj7Ye9zf+nNM2Uh6OcE2G2oNptWazFa+qB2Pdqqbsc9KnIDzgAntoYN0dbwOXwA==",
"license": "ISC"
}
}
}
{
"name": "sample-electron-to-chromium-versions",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification sample for versions in electron-to-chromium",
"main": "src/index.js",
"scripts": {
"test": "node test/contract.js"
},
"dependencies": {
"electron-to-chromium": "1.5.402"
},
"license": "MIT-0"
}
{
"schemaVersion": 1,
"goal": "verify versions in pkg:npm/electron-to-chromium@1.5.402",
"kind": "HOW",
"packages": [
"pkg:npm/electron-to-chromium@1.5.402"
],
"symbols": [
"versions"
]
}
const { versions } = require('electron-to-chromium');
/**
* Looks up the Chromium major version for a given Electron version string.
* @param {string} electronVersion Electron version string (e.g. '0.20', '33.0')
* @returns {string|undefined} Chromium major version string or undefined if not found
*/
function getChromiumVersionForElectron(electronVersion) {
if (typeof electronVersion !== 'string') {
return undefined;
}
return versions[electronVersion];
}
module.exports = {
versions,
getChromiumVersionForElectron
};
const assert = require('node:assert');
const { versions, getChromiumVersionForElectron } = require('../src/index.js');
const rawEtc = require('electron-to-chromium');
// Verify export matches raw electron-to-chromium export
assert.strictEqual(versions, rawEtc.versions, 'versions should match module export');
assert.strictEqual(typeof versions, 'object', 'versions must be an object');
assert.ok(versions !== null, 'versions must not be null');
// 1. versions is an object mapping Electron version strings to Chromium major version strings
const keys = Object.keys(versions);
assert.ok(keys.length > 50, 'versions contains major version mappings');
assert.ok(keys.every(k => typeof k === 'string'), 'all keys in versions are string version numbers');
assert.ok(Object.values(versions).every(v => typeof v === 'string'), 'all values in versions are string version numbers');
// 2. versions maps legacy Electron versions to Chromium versions
assert.strictEqual(versions['0.20'], '39', 'electron 0.20 maps to chromium 39');
assert.strictEqual(versions['1.1'], '50', 'electron 1.1 maps to chromium 50');
assert.strictEqual(versions['1.4'], '53', 'electron 1.4 maps to chromium 53');
assert.strictEqual(getChromiumVersionForElectron('0.20'), '39', 'helper getChromiumVersionForElectron resolves 0.20');
assert.strictEqual(getChromiumVersionForElectron('1.4'), '53', 'helper getChromiumVersionForElectron resolves 1.4');
// 3. versions maps modern Electron versions to Chromium versions
assert.strictEqual(versions['10.0'], '85', 'electron 10.0 maps to chromium 85');
assert.strictEqual(versions['20.0'], '104', 'electron 20.0 maps to chromium 104');
assert.strictEqual(versions['30.0'], '124', 'electron 30.0 maps to chromium 124');
assert.strictEqual(versions['33.0'], '130', 'electron 33.0 maps to chromium 130');
assert.strictEqual(versions['34.0'], '132', 'electron 34.0 maps to chromium 132');
assert.strictEqual(getChromiumVersionForElectron('33.0'), '130', 'helper getChromiumVersionForElectron resolves 33.0');
// 4. versions returns undefined for unmapped or non-existent Electron versions
assert.strictEqual(versions['9999'], undefined, 'non-existent version returns undefined');
assert.strictEqual(versions['invalid-version'], undefined, 'invalid version key returns undefined');
assert.strictEqual(getChromiumVersionForElectron('9999'), undefined, 'helper returns undefined for non-existent version');
assert.strictEqual(getChromiumVersionForElectron(null), undefined, 'helper returns undefined for non-string input');
assert.strictEqual(getChromiumVersionForElectron(33.0), undefined, 'helper returns undefined for numeric input');
console.log('Contract tests passed successfully.');
Seeder de origem
anônimo