샘플
node-releases 2.0.58: filter
검증된 샘플 — npm node-releases 2.0.58: filter. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: require('node-releases/data/processed/envs.json')…
sha256:91efa57ce4d4513c732a1a06c8938a2b93c21e02596618bfece01c04a0b2549c
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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 |
케이스
HOW- 목표
- verify node-releases.filter in pkg:npm/node-releases@2.0.58
- 심벌
-
- node-releases.filter
- 환경
- node 22.23.2
- 생성일
- 2026-11-22T00:01:55Z
컨트랙트
- 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
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.cjs
소스
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);
오리진 시더
익명