CodeSampleX

Sample

node-releases 2.0.56: find

Verified sample for npm node-releases 2.0.56: find. The contract ran on node 22 · linux debian/x64 · docker and passed: importing…

sha256:e37dd28117d2023f0a4e15bb8ac2d57736b8f3e9a4292f70fc89c6f82c02b6f7

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

Case

HOW
Goal
verify node-releases.find in pkg:npm/node-releases@2.0.56
Packages
Symbols
  • node-releases.find
Created
2026-10-17T00:18:38Z

Contract

  1. importing node-releases/data/processed/envs.json provides an array of release records supporting Array.prototype.find
  2. node-releases.find locates a specific Node.js release record by exact semantic version string 22.0.0
  3. node-releases.find retrieves the first active LTS release entry for Node.js 20 with codename Iron
  4. node-releases.find retrieves the first active LTS release entry for Node.js 22 with codename Jod
  5. node-releases.find locates a security release entry matching Node.js 20
  6. node-releases.find returns undefined when no release record matches the predicate

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 node-releases.find in pkg:npm/node-releases@2.0.56
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/node-releases@2.0.56
Demonstrate these symbols/APIs:
  - node-releases.find

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:7b64023547be3b3826dd29796a3d0e62ced3aa2e3fd8a84d861774f1637c27dd","contract":["importing node-releases/data/processed/envs.json provides an array of release records supporting Array.prototype.find","node-releases.find locates a specific Node.js release record by exact semantic version string 22.0.0","node-releases.find retrieves the first active LTS release entry for Node.js 20 with codename Iron","node-releases.find retrieves the first active LTS release entry for Node.js 22 with codename Jod","node-releases.find locates a security release entry matching Node.js 20","node-releases.find returns undefined when no release record matches the predicate"],"goal":"verify node-releases.find in pkg:npm/node-releases@2.0.56","kind":"HOW","packages":["pkg:npm/node-releases@2.0.56"],"schemaVersion":1,"symbols":["node-releases.find"]},"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/node-releases@2.0.56"],"schemaVersion":1,"subject":"pkg:npm/node-releases@2.0.56","symbols":["node-releases.find"],"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-node-releases-find",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-node-releases-find",
      "version": "1.0.0",
      "dependencies": {
        "node-releases": "2.0.56"
      }
    },
    "node_modules/node-releases": {
      "version": "2.0.56",
      "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.56.tgz",
      "integrity": "sha512-x0InOIyzgdk+eyaWaRJFH5snEtiImgBgblZ2CyPrLmqqcuMQkEvcDPHbzqbD8eDsSeJbVOjn+crzyzHaM4D+/A==",
      "license": "MIT",
      "engines": {
        "node": ">=18"
      }
    }
  }
}
package.json
{
  "name": "sample-node-releases-find",
  "version": "1.0.0",
  "type": "module",
  "private": true,
  "dependencies": {
    "node-releases": "2.0.56"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify node-releases.find in pkg:npm/node-releases@2.0.56",
  "kind": "HOW",
  "packages": [
    "pkg:npm/node-releases@2.0.56"
  ],
  "symbols": [
    "node-releases.find"
  ]
}
test/contract.mjs
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
import nodeReleases from 'node-releases/data/processed/envs.json' with { type: 'json' };

// 1. importing node-releases/data/processed/envs.json provides an array of release records supporting Array.prototype.find
assert.ok(Array.isArray(nodeReleases));
assert.ok(nodeReleases.length > 300);
assert.equal(typeof nodeReleases.find, 'function');

// 2. node-releases.find locates a specific Node.js release record by exact semantic version string 22.0.0
const v22Release = nodeReleases.find((entry) => entry.version === '22.0.0');
assert.ok(v22Release, 'Release record for 22.0.0 must exist');
assert.equal(v22Release.name, 'nodejs');
assert.equal(v22Release.version, '22.0.0');
assert.equal(v22Release.date, '2024-04-24');
assert.equal(v22Release.lts, false);
assert.equal(v22Release.v8, '12.4.254.14');

// 3. node-releases.find retrieves the first active LTS release entry for Node.js 20 with codename Iron
const v20Lts = nodeReleases.find((entry) => entry.version.startsWith('20.') && entry.lts);
assert.ok(v20Lts, 'Node 20 LTS release entry must exist');
assert.equal(v20Lts.lts, 'Iron');
assert.equal(typeof v20Lts.date, 'string');

// 4. node-releases.find retrieves the first active LTS release entry for Node.js 22 with codename Jod
const v22Lts = nodeReleases.find((entry) => entry.version.startsWith('22.') && entry.lts);
assert.ok(v22Lts, 'Node 22 LTS release entry must exist');
assert.equal(v22Lts.lts, 'Jod');
assert.equal(v22Lts.version, '22.11.0');

// 5. node-releases.find locates a security release entry matching Node.js 20
const v20Security = nodeReleases.find((entry) => entry.version.startsWith('20.') && entry.security === true);
assert.ok(v20Security, 'Node 20 security release entry must exist');
assert.equal(v20Security.security, true);
assert.equal(typeof v20Security.version, 'string');

// 6. node-releases.find returns undefined when no release record matches the predicate
const missingRelease = nodeReleases.find((entry) => entry.version === '999.0.0');
assert.equal(missingRelease, undefined);

// Verify CommonJS require compatibility as well
const require = createRequire(import.meta.url);
const cjsReleases = require('node-releases/data/processed/envs.json');
const cjsV22 = cjsReleases.find((entry) => entry.version === '22.0.0');
assert.ok(cjsV22);
assert.equal(cjsV22.version, '22.0.0');

Origin Seeder

anonymous