샘플
semver 6.3.2
검증된 샘플 — npm semver 6.3.2. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: assert semver.parse and semver.clean parse and normalize semantic…
sha256:0028b5444d6e744c50d3b64e823ff1dd89bb3301aa1c3f39c2e0aaab1e788155
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
node linux 24 · ubuntu · glibc 2.39 x64 node javascript npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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-08 |
케이스
HOW- 목표
- verify pkg:npm/semver@6.3.2
- 패키지
- 환경
- node
- 생성일
- 2026-11-08T07:07:54Z
컨트랙트
- assert semver.parse and semver.clean parse and normalize semantic version strings or return null on invalid input
- assert semver.inc increments major, minor, patch, and prerelease components
- assert semver.satisfies, semver.maxSatisfying, semver.minSatisfying, and semver.minVersion evaluate range constraints
- assert semver.coerce extracts valid SemVer instances from partial or dirty strings with standard and rtl options
- assert semver.intersects and semver.sort verify overlapping range sets and ascending version ordering
파일
- PROMPT.md
- csx.json
- index.mjs
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
소스
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 pkg:npm/semver@6.3.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/semver@6.3.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:d007ed7f025a680015c534fbc655fa4a70c32abdfc5d2750953fc98a1f903c9d","contract":["assert semver.parse and semver.clean parse and normalize semantic version strings or return null on invalid input","assert semver.inc increments major, minor, patch, and prerelease components","assert semver.satisfies, semver.maxSatisfying, semver.minSatisfying, and semver.minVersion evaluate range constraints","assert semver.coerce extracts valid SemVer instances from partial or dirty strings with standard and rtl options","assert semver.intersects and semver.sort verify overlapping range sets and ascending version ordering"],"goal":"verify pkg:npm/semver@6.3.2","kind":"HOW","packages":["pkg:npm/semver@6.3.2"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"esm","os":"linux","osVersionBucket":"24","packageManager":"npm","runtime":"node","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/semver@6.3.2"],"schemaVersion":1,"subject":"pkg:npm/semver@6.3.2","verifierAdapter":"node-typescript@1"}
import semver from 'semver';
export function parseVersion(version, options = {}) {
return semver.parse(version, options);
}
export function cleanVersion(version, options = {}) {
return semver.clean(version, options);
}
export function incrementVersion(version, release, options = {}, identifier = undefined) {
return semver.inc(version, release, options, identifier);
}
export function checkSatisfies(version, range, options = {}) {
return semver.satisfies(version, range, options);
}
export function findMaxSatisfying(versions, range, options = {}) {
return semver.maxSatisfying(versions, range, options);
}
export function findMinSatisfying(versions, range, options = {}) {
return semver.minSatisfying(versions, range, options);
}
export function getMinVersion(range, loose = false) {
return semver.minVersion(range, loose);
}
export function coerceVersion(version, options = {}) {
return semver.coerce(version, options);
}
export function rangesIntersect(r1, r2, options = {}) {
return semver.intersects(r1, r2, options);
}
export function sortVersions(versions, options = {}) {
return semver.sort(versions, options);
}
{
"name": "sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample",
"version": "1.0.0",
"dependencies": {
"semver": "6.3.2"
}
},
"node_modules/semver": {
"version": "6.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz",
"integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==",
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
}
}
}
}
{
"name": "sample",
"version": "1.0.0",
"type": "module",
"scripts": {
"test": "node test/contract.mjs"
},
"dependencies": {
"semver": "6.3.2"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/semver@6.3.2",
"kind": "HOW",
"packages": [
"pkg:npm/semver@6.3.2"
]
}
import assert from 'node:assert/strict';
import semver from 'semver';
import {
parseVersion,
cleanVersion,
incrementVersion,
checkSatisfies,
findMaxSatisfying,
findMinSatisfying,
getMinVersion,
coerceVersion,
rangesIntersect,
sortVersions
} from '../index.mjs';
// 1. assert semver.parse and semver.clean parse and normalize semantic version strings or return null on invalid input
{
const parsed = parseVersion('v2.4.6-beta.3+exp.sha.5114f85');
assert.notEqual(parsed, null);
assert.equal(parsed.major, 2);
assert.equal(parsed.minor, 4);
assert.equal(parsed.patch, 6);
assert.deepEqual(parsed.prerelease, ['beta', 3]);
assert.deepEqual(parsed.build, ['exp', 'sha', '5114f85']);
assert.equal(parsed.version, '2.4.6-beta.3');
assert.equal(parsed instanceof semver.SemVer, true);
assert.equal(parseVersion('invalid-semver'), null);
assert.equal(cleanVersion(' =v1.2.3 '), '1.2.3');
assert.equal(cleanVersion('not-valid'), null);
}
// 2. assert semver.inc increments major, minor, patch, and prerelease components
{
assert.equal(incrementVersion('1.2.3', 'major'), '2.0.0');
assert.equal(incrementVersion('1.2.3', 'minor'), '1.3.0');
assert.equal(incrementVersion('1.2.3', 'patch'), '1.2.4');
assert.equal(incrementVersion('1.2.3', 'prerelease', {}, 'alpha'), '1.2.4-alpha.0');
assert.equal(incrementVersion('1.2.4-alpha.0', 'prerelease', {}, 'alpha'), '1.2.4-alpha.1');
assert.equal(incrementVersion('invalid', 'patch'), null);
}
// 3. assert semver.satisfies, semver.maxSatisfying, semver.minSatisfying, and semver.minVersion evaluate range constraints
{
assert.equal(checkSatisfies('1.5.0', '^1.2.0 <1.6.0'), true);
assert.equal(checkSatisfies('1.6.0', '^1.2.0 <1.6.0'), false);
assert.equal(checkSatisfies('1.3.0-alpha.1', '^1.2.0', { includePrerelease: true }), true);
assert.equal(checkSatisfies('1.3.0-alpha.1', '^1.2.0', { includePrerelease: false }), false);
const candidates = ['1.0.0', '1.2.0', '1.2.5', '1.5.2', '2.0.0'];
assert.equal(findMaxSatisfying(candidates, '~1.2.0'), '1.2.5');
assert.equal(findMinSatisfying(candidates, '>=1.2.0 <2.0.0'), '1.2.0');
assert.equal(findMaxSatisfying(candidates, '>=3.0.0'), null);
const minVer = getMinVersion('^1.2.3');
assert.notEqual(minVer, null);
assert.equal(minVer.version, '1.2.3');
}
// 4. assert semver.coerce extracts valid SemVer instances from partial or dirty strings with standard and rtl options
{
const std = coerceVersion('v42.6.7.9.3-alpha');
assert.notEqual(std, null);
assert.equal(std.version, '42.6.7');
const rtl = coerceVersion('v42.6.7.9.3-alpha', { rtl: true });
assert.notEqual(rtl, null);
assert.equal(rtl.version, '7.9.3');
assert.equal(coerceVersion('no-digits-here'), null);
}
// 5. assert semver.intersects and semver.sort verify overlapping range sets and ascending version ordering
{
assert.equal(rangesIntersect('^1.2.0', '~1.5.0'), true);
assert.equal(rangesIntersect('^1.2.0', '>=2.0.0'), false);
const list = ['2.0.0', '1.0.0', '1.0.0-alpha.1', '1.10.0', '1.2.0'];
const sorted = sortVersions(list);
assert.deepEqual(sorted, ['1.0.0-alpha.1', '1.0.0', '1.2.0', '1.10.0', '2.0.0']);
}
console.log('PASS: all semver@6.3.2 contract assertions passed');
오리진 시더
익명