Sample
node-releases 2.0.58: filter
Verified sample for npm node-releases 2.0.58: filter. The contract ran on node 22 · linux debian/x64 · docker and passed…
sha256:91efa57ce4d4513c732a1a06c8938a2b93c21e02596618bfece01c04a0b2549c
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-11-22 |
Case
HOW- Goal
- verify node-releases.filter in pkg:npm/node-releases@2.0.58
- Packages
- Symbols
-
- node-releases.filter
- Environment
- node 22.23.2
- Created
- 2026-11-22T00:01:55Z
Contract
- require('node-releases/data/processed/envs.json') returns a non-empty array of Node.js release records
- envs.filter by string lts codename returns only LTS releases and partitions all records with lts === false
- envs.filter by security === true returns a non-empty strict subset of security patch releases
- envs.filter by version prefix and date selects matching major releases such as 22.x, 20.x Iron LTS, and 2026 releases
- envs.filter with a non-matching predicate returns an empty array without throwing
- envs.filter passes element, index, and source array with thisArg support without mutating the source envs array
Files
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.cjs
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.58
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/node-releases@2.0.58
Demonstrate these symbols/APIs:
- node-releases.filter
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.2
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:3ded4aad41553f5161083540f51b8eb5d808b14ebbc9783832f6fbeb6080f617","constraints":{"executionContext":"node"},"contract":["require('node-releases/data/processed/envs.json') returns a non-empty array of Node.js release records","envs.filter by string lts codename returns only LTS releases and partitions all records with lts === false","envs.filter by security === true returns a non-empty strict subset of security patch releases","envs.filter by version prefix and date selects matching major releases such as 22.x, 20.x Iron LTS, and 2026 releases","envs.filter with a non-matching predicate returns an empty array without throwing","envs.filter passes element, index, and source array with thisArg support without mutating the source envs array"],"goal":"verify node-releases.filter in pkg:npm/node-releases@2.0.58","kind":"HOW","packages":["pkg:npm/node-releases@2.0.58"],"schemaVersion":1,"symbols":["node-releases.filter"]},"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-releases@2.0.58"],"schemaVersion":1,"subject":"pkg:npm/node-releases@2.0.58","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.58"
}
},
"node_modules/node-releases": {
"version": "2.0.58",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.58.tgz",
"integrity": "sha512-BdiKAgbfRlvfMq/XzO/AF9NPmaA8a+YpLAyAFTVFBj3gARrAIfWvNq7Q7NE4se3KgFu0KkrvQMxTS0XVnsGzHg==",
"license": "MIT",
"engines": {
"node": ">=18"
}
}
}
}
{
"name": "sample-node-releases-filter",
"version": "1.0.0",
"private": true,
"scripts": {
"test": "node test/contract.cjs"
},
"dependencies": {
"node-releases": "2.0.58"
}
}
{
"schemaVersion": 1,
"goal": "verify node-releases.filter in pkg:npm/node-releases@2.0.58",
"kind": "HOW",
"packages": [
"pkg:npm/node-releases@2.0.58"
],
"symbols": [
"node-releases.filter"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
'use strict';
const assert = require('node:assert/strict');
const envs = require('node-releases/data/processed/envs.json');
// Verify source data shape from node-releases@2.0.58
assert.ok(Array.isArray(envs), 'envs.json must load as an Array');
const originalLength = envs.length;
assert.ok(originalLength > 0, 'envs.json must contain release records');
const snapshotFirst = { ...envs[0] };
const snapshotLast = { ...envs[originalLength - 1] };
// 1. Filter LTS releases returning only records with string codenames
const ltsReleases = envs.filter((entry) => typeof entry.lts === 'string' && entry.lts.length > 0);
assert.ok(ltsReleases.length > 0, 'LTS filter must return at least one release');
assert.ok(ltsReleases.length < originalLength, 'LTS filter must exclude non-LTS releases');
for (const entry of ltsReleases) {
assert.equal(typeof entry.lts, 'string');
assert.ok(entry.lts.length > 0);
}
const nonLtsReleases = envs.filter((entry) => entry.lts === false);
assert.equal(
ltsReleases.length + nonLtsReleases.length,
originalLength,
'LTS and non-LTS partitions must cover all entries'
);
// 2. Filter security releases where security flag is strictly true
const securityReleases = envs.filter((entry) => entry.security === true);
assert.ok(securityReleases.length > 0, 'security filter must return security patch releases');
assert.ok(securityReleases.length < originalLength, 'security filter must be a strict subset');
assert.ok(securityReleases.every((entry) => entry.security === true));
// 3. Filter by major version prefix and release date string
const v22Releases = envs.filter((entry) => entry.version.startsWith('22.'));
assert.ok(v22Releases.length > 0, 'must find Node.js 22.x releases');
assert.ok(v22Releases.every((entry) => entry.version.startsWith('22.')));
const v20LtsReleases = envs.filter(
(entry) => entry.version.startsWith('20.') && entry.lts === 'Iron'
);
assert.ok(v20LtsReleases.length > 0, 'must find Node.js 20.x Iron LTS releases');
assert.ok(v20LtsReleases.every((entry) => entry.version.startsWith('20.') && entry.lts === 'Iron'));
const releasesFrom2026 = envs.filter((entry) => entry.date >= '2026-01-01');
assert.ok(releasesFrom2026.length > 0, 'must find 2026 releases in node-releases@2.0.58');
assert.ok(releasesFrom2026.every((entry) => entry.date >= '2026-01-01'));
// 4. Non-matching predicate returns an empty array without throwing
const noMatches = envs.filter((entry) => entry.name !== 'nodejs');
assert.ok(Array.isArray(noMatches));
assert.equal(noMatches.length, 0);
// 5. Callback receives (element, index, array) and respects thisArg without mutating envs
const matcher = { targetLts: 'Argon', calls: 0 };
const argonReleases = envs.filter(function (entry, index, array) {
this.calls += 1;
assert.equal(array, envs, 'third callback argument must be the source array');
assert.equal(array[index], entry, 'array[index] must equal current element');
return entry.lts === this.targetLts;
}, matcher);
assert.equal(matcher.calls, originalLength, 'predicate must visit every element');
assert.ok(argonReleases.length > 0, 'must find Argon LTS releases via thisArg');
assert.ok(argonReleases.every((entry) => entry.lts === 'Argon'));
// 6. Filtering does not mutate source envs array length or boundary elements
assert.equal(envs.length, originalLength);
assert.deepEqual(envs[0], snapshotFirst);
assert.deepEqual(envs[originalLength - 1], snapshotLast);
Origin Seeder
anonymous