Exemple
node-abi 3.96.0: _getNextTarget
Échantillon vérifié pour npm node-abi 3.96.0: _getNextTarget. Le contrat s'est exécuté sur node 22 · linux debian/x64 · docker et a réussi.
sha256:cb3ba288cc055191c13d6b121f69f726dd97b525c83a2c8cfe86de338d98f83a
Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré.
Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes.
MIT-0
Preuves d'exécution
L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.
- Base de preuve
- Contrat signé réussi
- Reçus de vérification
- 1
- Clés de signature qui l’ont compilé
- 1
Environnement déclaré
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Environnements des exécutions de vérification
| Environnement | Contrat | Étapes | Exécution |
|---|---|---|---|
| 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-07 |
Cas
HOW- Objectif
- verify node-abi._getNextTarget in pkg:npm/node-abi@3.96.0
- Paquets
- Symboles
-
- node-abi._getNextTarget
- Environnement
- node 22.23.2
- Créé
- 2026-09-07T03:06:38Z
Contrat
- node-abi._getNextTarget is exported as a function
- node-abi._getNextTarget calculates the next major version target for the node runtime from default targets
- node-abi._getNextTarget calculates the next target for the electron runtime from default targets
- node-abi._getNextTarget increments the major version for node runtime when provided a custom targets list
- node-abi._getNextTarget increments the minor version for stable electron releases when provided a custom targets list
- node-abi._getNextTarget increments the major version after minor bump for electron prerelease targets
- node-abi._getNextTarget throws TypeError when no targets match the specified runtime
Fichiers
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.cjs
Code 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 node-abi._getNextTarget in pkg:npm/node-abi@3.96.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/node-abi@3.96.0
Demonstrate these symbols/APIs:
- node-abi._getNextTarget
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:23673a893a956b93aaedb022e1e640e4c29d22ce20840cdc26bc19cdf2fcb388","contract":["node-abi._getNextTarget is exported as a function","node-abi._getNextTarget calculates the next major version target for the node runtime from default targets","node-abi._getNextTarget calculates the next target for the electron runtime from default targets","node-abi._getNextTarget increments the major version for node runtime when provided a custom targets list","node-abi._getNextTarget increments the minor version for stable electron releases when provided a custom targets list","node-abi._getNextTarget increments the major version after minor bump for electron prerelease targets","node-abi._getNextTarget throws TypeError when no targets match the specified runtime"],"goal":"verify node-abi._getNextTarget in pkg:npm/node-abi@3.96.0","kind":"HOW","packages":["pkg:npm/node-abi@3.96.0"],"schemaVersion":1,"symbols":["node-abi._getNextTarget"]},"contractCommand":["node","test/contract.cjs"],"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/node-abi@3.96.0"],"schemaVersion":1,"subject":"pkg:npm/node-abi@3.96.0","symbols":["node-abi._getNextTarget"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-node-abi",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-node-abi",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"node-abi": "3.96.0"
}
},
"node_modules/node-abi": {
"version": "3.96.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.96.0.tgz",
"integrity": "sha512-rebQ/lz7i0EkoLzUVSrKRzA69zMkwLp95kKMWoMDkkM00Suxz0D7zEQPwRml5fQum24mj7bPvmlgLAmu2JCiYg==",
"license": "MIT",
"dependencies": {
"semver": "^7.3.5"
},
"engines": {
"node": ">=10"
}
},
"node_modules/semver": {
"version": "7.8.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
"integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
}
}
}
{
"name": "sample-node-abi",
"version": "1.0.0",
"private": true,
"description": "Clean-room code sample for node-abi@3.96.0",
"license": "MIT-0",
"dependencies": {
"node-abi": "3.96.0"
}
}
{
"schemaVersion": 1,
"goal": "verify node-abi._getNextTarget in pkg:npm/node-abi@3.96.0",
"kind": "HOW",
"packages": [
"pkg:npm/node-abi@3.96.0"
],
"symbols": [
"node-abi._getNextTarget"
]
}
const assert = require("node:assert/strict");
const nodeAbi = require("node-abi");
// 1. node-abi._getNextTarget is exported as a function
assert.equal(typeof nodeAbi._getNextTarget, "function");
// 2. node-abi._getNextTarget calculates the next major version target for the node runtime from default targets
const defaultNodeNext = nodeAbi._getNextTarget("node");
assert.equal(typeof defaultNodeNext, "string");
assert.equal(defaultNodeNext, "27.0.0");
// 3. node-abi._getNextTarget calculates the next target for the electron runtime from default targets
const defaultElectronNext = nodeAbi._getNextTarget("electron");
assert.equal(typeof defaultElectronNext, "string");
assert.equal(defaultElectronNext, "46.0.0");
// 4. node-abi._getNextTarget increments the major version for node runtime when provided a custom targets list
const customNodeTargets = [
{ runtime: "node", target: "18.0.0", abi: "108" },
{ runtime: "node", target: "20.5.0", abi: "115" },
{ runtime: "node", target: "22.0.0", abi: "127" }
];
assert.equal(nodeAbi._getNextTarget("node", customNodeTargets), "23.0.0");
// 5. node-abi._getNextTarget increments the minor version for stable electron releases when provided a custom targets list
const customElectronStable = [
{ runtime: "electron", target: "30.0.0", abi: "120" },
{ runtime: "electron", target: "31.2.0", abi: "124" }
];
assert.equal(nodeAbi._getNextTarget("electron", customElectronStable), "31.3.0");
// 6. node-abi._getNextTarget increments the major version after minor bump for electron prerelease targets
const customElectronPrerelease = [
{ runtime: "electron", target: "32.0.0", abi: "128" },
{ runtime: "electron", target: "33.0.0-beta.1", abi: "130" }
];
assert.equal(nodeAbi._getNextTarget("electron", customElectronPrerelease), "34.0.0");
// 7. node-abi._getNextTarget throws TypeError when no targets match the specified runtime
assert.throws(
() => nodeAbi._getNextTarget("unknown-runtime"),
{
name: "TypeError"
}
);
assert.throws(
() => nodeAbi._getNextTarget("node", []),
{
name: "TypeError"
}
);
Seeder d'origine
anonyme