CodeSampleX

Sample

node-abi 3.96.0: _getNextTarget

Verified sample for npm node-abi 3.96.0: _getNextTarget. The contract ran on node 22 · linux debian/x64 · docker and passed: node-abi._getNextTarget is…

sha256:cb3ba288cc055191c13d6b121f69f726dd97b525c83a2c8cfe86de338d98f83a

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 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

Case

HOW
Goal
verify node-abi._getNextTarget in pkg:npm/node-abi@3.96.0
Packages
Symbols
  • node-abi._getNextTarget
Environment
node 22.23.2
Created
2026-09-07T03:06:38Z

Contract

  1. node-abi._getNextTarget is exported as a function
  2. node-abi._getNextTarget calculates the next major version target for the node runtime from default targets
  3. node-abi._getNextTarget calculates the next target for the electron runtime from default targets
  4. node-abi._getNextTarget increments the major version for node runtime when provided a custom targets list
  5. node-abi._getNextTarget increments the minor version for stable electron releases when provided a custom targets list
  6. node-abi._getNextTarget increments the major version after minor bump for electron prerelease targets
  7. node-abi._getNextTarget throws TypeError when no targets match the specified runtime

Files

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

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 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.
csx.json
{"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"}
package-lock.json
{
  "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"
      }
    }
  }
}
package.json
{
  "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"
  }
}
spec.json
{
  "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"
  ]
}
test/contract.cjs
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"
  }
);

Origin Seeder

anonymous