샘플
range-parser 1.3.0
검증된 샘플 — npm range-parser 1.3.0. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: parseRange(size, str) parses single byte range and sets type…
sha256:9c2b35d0b230f67252f5da82f536bf8f472e2b46a0c7f0b5d41f69701e26b7e2
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-20 |
케이스
HOW- 목표
- verify pkg:npm/range-parser@1.3.0
- 생성일
- 2026-08-20T13:59:10Z
컨트랙트
- parseRange(size, str) parses single byte range and sets type property to 'bytes'
- parseRange(size, str) parses multiple non-overlapping ranges
- parseRange(size, str) parses suffix range relative to total size
- parseRange(size, str) parses open-ended range to end of size
- parseRange(size, str) caps range ending at total size minus one
- parseRange(size, str, { combine: true }) combines overlapping and adjacent ranges
- parseRange(size, str) returns -1 for unsatisfiable ranges
- parseRange(size, str) returns -2 for invalid or malformed range strings
파일
- PROMPT.md
- csx.json
- 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/range-parser@1.3.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/range-parser@1.3.0
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:327c2b138eac6d2433694491a6241a56ec89684c2cd2088860f6bedd7a1a8fb8","contract":["parseRange(size, str) parses single byte range and sets type property to 'bytes'","parseRange(size, str) parses multiple non-overlapping ranges","parseRange(size, str) parses suffix range relative to total size","parseRange(size, str) parses open-ended range to end of size","parseRange(size, str) caps range ending at total size minus one","parseRange(size, str, { combine: true }) combines overlapping and adjacent ranges","parseRange(size, str) returns -1 for unsatisfiable ranges","parseRange(size, str) returns -2 for invalid or malformed range strings"],"goal":"verify pkg:npm/range-parser@1.3.0","kind":"HOW","packages":["pkg:npm/range-parser@1.3.0"],"schemaVersion":1},"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/range-parser@1.3.0"],"schemaVersion":1,"verifierAdapter":"node-typescript@1"}
{
"name": "sample-range-parser",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-range-parser",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"range-parser": "1.3.0"
}
},
"node_modules/range-parser": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz",
"integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
}
}
}
{
"name": "sample-range-parser",
"version": "1.0.0",
"type": "module",
"license": "MIT-0",
"dependencies": {
"range-parser": "1.3.0"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/range-parser@1.3.0",
"kind": "HOW",
"packages": [
"pkg:npm/range-parser@1.3.0"
]
}
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const parseRange = require('range-parser');
// 1. Function export verification
assert.equal(typeof parseRange, 'function', 'parseRange must be a function');
// 2. parseRange(size, str) parses single byte range and sets type property to 'bytes'
const single = parseRange(1000, 'bytes=0-499');
assert.equal(single.type, 'bytes');
assert.equal(single.length, 1);
assert.deepEqual(single[0], { start: 0, end: 499 });
// 3. parseRange(size, str) parses multiple non-overlapping ranges
const multiple = parseRange(1000, 'bytes=0-100, 200-300');
assert.equal(multiple.type, 'bytes');
assert.equal(multiple.length, 2);
assert.deepEqual(multiple[0], { start: 0, end: 100 });
assert.deepEqual(multiple[1], { start: 200, end: 300 });
// 4. parseRange(size, str) parses suffix range relative to total size
const suffix = parseRange(1000, 'bytes=-100');
assert.equal(suffix.type, 'bytes');
assert.equal(suffix.length, 1);
assert.deepEqual(suffix[0], { start: 900, end: 999 });
// 5. parseRange(size, str) parses open-ended range to end of size
const openEnded = parseRange(1000, 'bytes=500-');
assert.equal(openEnded.type, 'bytes');
assert.equal(openEnded.length, 1);
assert.deepEqual(openEnded[0], { start: 500, end: 999 });
// 6. parseRange(size, str) caps range ending at total size minus one
const capped = parseRange(1000, 'bytes=0-2000');
assert.equal(capped.type, 'bytes');
assert.equal(capped.length, 1);
assert.deepEqual(capped[0], { start: 0, end: 999 });
// 7. parseRange(size, str, { combine: true }) combines overlapping and adjacent ranges
const combined = parseRange(1000, 'bytes=0-100, 50-150', { combine: true });
assert.equal(combined.type, 'bytes');
assert.equal(combined.length, 1);
assert.deepEqual(combined[0], { start: 0, end: 150 });
// 8. parseRange(size, str) returns -1 for unsatisfiable ranges
assert.equal(parseRange(1000, 'bytes=1000-2000'), -1);
assert.equal(parseRange(1000, 'bytes=500-400'), -1);
// 9. parseRange(size, str) returns -2 for invalid or malformed range strings
assert.equal(parseRange(1000, 'invalid'), -2);
assert.equal(parseRange(1000, 'bytes='), -2);
assert.equal(parseRange(1000, 'bytes=-'), -2);
assert.equal(parseRange(1000, 'bytes=abc-def'), -2);
오리진 시더
익명