Sample
node-releases 2.0.56: filter
Verified sample for npm node-releases 2.0.56: filter. The contract ran on node 22 · linux debian/x64 · docker and passed: filter on envs array filters…
sha256:c6d9f2226cd02ef7329e82b5f863d701d39d1b91104d83ba9113211d2c80f18e
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 linux 24 · ubuntu · glibc 2.39 x64 node javascript 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-16 |
Case
HOW- Goal
- verify node-releases.filter in pkg:npm/node-releases@2.0.56
- Packages
- Symbols
-
- node-releases.filter
- Environment
- node
- Created
- 2026-10-16T23:25:07Z
Contract
- filter on envs array filters releases by lts status returning only LTS releases with string codenames
- filter on envs array filters releases by security flag returning only security patch releases
- filter on envs array filters releases by version prefix to select specific major versions like v20 and v22
- filter on envs array with non-matching predicate returns an empty array without throwing
- filter on envs array provides element index and source array references to predicate callback
- filter does not mutate the source envs array from node-releases preserving original release records count
Files
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
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-releases.filter 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.filter
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:75ece2610d7069a0a7db0aac0e6cff3f829e3604dc58671db758c5dfe94cadc5","contract":["filter on envs array filters releases by lts status returning only LTS releases with string codenames","filter on envs array filters releases by security flag returning only security patch releases","filter on envs array filters releases by version prefix to select specific major versions like v20 and v22","filter on envs array with non-matching predicate returns an empty array without throwing","filter on envs array provides element index and source array references to predicate callback","filter does not mutate the source envs array from node-releases preserving original release records count"],"goal":"verify node-releases.filter in pkg:npm/node-releases@2.0.56","kind":"HOW","packages":["pkg:npm/node-releases@2.0.56"],"schemaVersion":1,"symbols":["node-releases.filter"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","runtime":"node","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.filter"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-node-releases-filter",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-node-releases-filter",
"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"
}
}
}
}
{
"name": "sample-node-releases-filter",
"version": "1.0.0",
"type": "module",
"private": true,
"dependencies": {
"node-releases": "2.0.56"
}
}
{
"schemaVersion": 1,
"goal": "verify node-releases.filter in pkg:npm/node-releases@2.0.56",
"kind": "HOW",
"packages": [
"pkg:npm/node-releases@2.0.56"
],
"symbols": [
"node-releases.filter"
]
}
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
import envs from 'node-releases/data/processed/envs.json' with { type: 'json' };
// Ensure source data is valid array
assert.ok(Array.isArray(envs), 'envs must be an array');
const initialLength = envs.length;
assert.ok(initialLength > 0, 'envs must contain records');
// 1. filter on envs array filters releases by lts status returning only LTS releases with string codenames
const ltsReleases = envs.filter((release) => Boolean(release.lts));
assert.ok(ltsReleases.length > 0, 'LTS releases should not be empty');
assert.ok(ltsReleases.length < initialLength, 'LTS releases should be subset of all releases');
for (const rel of ltsReleases) {
assert.equal(typeof rel.lts, 'string', 'LTS property must be a string codename');
}
// 2. filter on envs array filters releases by security flag returning only security patch releases
const securityReleases = envs.filter((release) => release.security === true);
assert.ok(securityReleases.length > 0, 'Security releases should not be empty');
assert.ok(securityReleases.length < initialLength, 'Security releases should be subset of all releases');
for (const rel of securityReleases) {
assert.equal(rel.security, true, 'security flag must be true');
}
// 3. filter on envs array filters releases by version prefix to select specific major versions like v20 and v22
const node22Releases = envs.filter((release) => release.version.startsWith('22.'));
assert.ok(node22Releases.length > 0, 'Node 22 releases must be found');
assert.ok(node22Releases.every((rel) => rel.version.startsWith('22.')), 'All filtered releases must start with 22.');
const node20Releases = envs.filter((release) => release.version.startsWith('20.'));
assert.ok(node20Releases.length > 0, 'Node 20 releases must be found');
assert.ok(node20Releases.every((rel) => rel.version.startsWith('20.')), 'All filtered releases must start with 20.');
// 4. filter on envs array with non-matching predicate returns an empty array without throwing
const emptyMatch = envs.filter((release) => release.name !== 'nodejs');
assert.ok(Array.isArray(emptyMatch), 'Result should be an array');
assert.equal(emptyMatch.length, 0, 'Non-matching predicate should return empty array');
// 5. filter on envs array provides element, index, and source array references to the predicate callback
let callbackInvocations = 0;
const firstFive = envs.filter((release, index, array) => {
callbackInvocations++;
assert.equal(array, envs, 'Third callback argument must match source array');
assert.equal(array[index], release, 'Element at index must equal first argument');
return index < 5;
});
assert.equal(callbackInvocations, initialLength, 'Callback must be called once per entry');
assert.equal(firstFive.length, 5, 'Should filter exactly 5 elements');
// 6. filter does not mutate the source envs array from node-releases preserving original release records count
assert.equal(envs.length, initialLength, 'Source envs array length must remain unchanged');
// CommonJS compatibility check
const require = createRequire(import.meta.url);
const cjsEnvs = require('node-releases/data/processed/envs.json');
const cjsFiltered = cjsEnvs.filter((r) => r.lts === 'Iron');
assert.ok(cjsFiltered.length > 0, 'CommonJS required envs should support filter');
assert.ok(cjsFiltered.every((r) => r.lts === 'Iron'));
Origin Seeder
anonymous