Sample
ipaddr.js 2.5.0
Verified sample for npm ipaddr.js 2.5.0. The contract ran on node 22 · linux debian/x64 · docker and passed: ipaddr.isValid validates IPv4 and IPv6 string…
sha256:0f7933f1d1fd913f0a4ec87695dc763bb2f85e688557d6206330a944a86134b9
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-09-13 |
Case
HOW- Goal
- verify pkg:npm/ipaddr.js@2.5.0
- Packages
- Environment
- node 22.23.2
- Created
- 2026-09-13T13:47:47Z
Contract
- ipaddr.isValid validates IPv4 and IPv6 string formats
- ipaddr.IPv4.isValid and ipaddr.IPv6.isValid validate specific IP versions
- ipaddr.parse parses IPv4 address into object with kind ipv4, octets array, and private range
- ipaddr.parse parses IPv6 address into object with kind ipv6 and normalized string representation
- ipaddr.parseCIDR and match evaluate CIDR subnet membership
- ipaddr.process correctly processes IPv4-mapped IPv6 addresses to IPv4
- ipaddr.parse throws error on invalid IP format
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 pkg:npm/ipaddr.js@2.5.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/ipaddr.js@2.5.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:590c39798283d12328b46a133d3fd23c61af87c7d3a8b3f995f5bf9e2638592a","contract":["ipaddr.isValid validates IPv4 and IPv6 string formats","ipaddr.IPv4.isValid and ipaddr.IPv6.isValid validate specific IP versions","ipaddr.parse parses IPv4 address into object with kind ipv4, octets array, and private range","ipaddr.parse parses IPv6 address into object with kind ipv6 and normalized string representation","ipaddr.parseCIDR and match evaluate CIDR subnet membership","ipaddr.process correctly processes IPv4-mapped IPv6 addresses to IPv4","ipaddr.parse throws error on invalid IP format"],"goal":"verify pkg:npm/ipaddr.js@2.5.0","kind":"HOW","packages":["pkg:npm/ipaddr.js@2.5.0"],"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","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/ipaddr.js@2.5.0"],"schemaVersion":1,"subject":"pkg:npm/ipaddr.js@2.5.0","verifierAdapter":"node-typescript@1"}
{
"name": "ipaddr-verification",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ipaddr-verification",
"version": "1.0.0",
"dependencies": {
"ipaddr.js": "2.5.0"
}
},
"node_modules/ipaddr.js": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.5.0.tgz",
"integrity": "sha512-aq+t5NAc+cS6rZQQVWC2x98CPqGtKKTMDd4Gaodv0wShnItdKg/51djkGJ1hqH+Oy0ivDftCbSLCQob8zso01w==",
"license": "MIT",
"engines": {
"node": ">= 10"
}
}
}
}
{
"name": "ipaddr-verification",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification for ipaddr.js",
"dependencies": {
"ipaddr.js": "2.5.0"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/ipaddr.js@2.5.0",
"kind": "HOW",
"packages": [
"pkg:npm/ipaddr.js@2.5.0"
]
}
import assert from "node:assert";
import ipaddr from "ipaddr.js";
// 1. Validate IP address strings
assert.strictEqual(ipaddr.isValid("127.0.0.1"), true);
assert.strictEqual(ipaddr.isValid("2001:db8::1"), true);
assert.strictEqual(ipaddr.isValid("not-an-ip"), false);
// 2. Validate specific IP version strings
assert.strictEqual(ipaddr.IPv4.isValid("127.0.0.1"), true);
assert.strictEqual(ipaddr.IPv4.isValid("2001:db8::1"), false);
assert.strictEqual(ipaddr.IPv6.isValid("2001:db8::1"), true);
assert.strictEqual(ipaddr.IPv6.isValid("127.0.0.1"), false);
// 3. IPv4 address parsing and attributes
const v4 = ipaddr.parse("192.168.1.1");
assert.strictEqual(v4.kind(), "ipv4");
assert.strictEqual(v4.toString(), "192.168.1.1");
assert.deepStrictEqual(v4.octets, [192, 168, 1, 1]);
assert.strictEqual(v4.range(), "private");
// 4. IPv6 address parsing and attributes
const v6 = ipaddr.parse("2001:db8::1");
assert.strictEqual(v6.kind(), "ipv6");
assert.strictEqual(v6.toNormalizedString(), "2001:db8:0:0:0:0:0:1");
assert.strictEqual(v6.range(), "reserved");
// 5. CIDR parsing and matching
const cidr = ipaddr.parseCIDR("192.168.1.0/24");
assert.strictEqual(cidr[0].toString(), "192.168.1.0");
assert.strictEqual(cidr[1], 24);
assert.strictEqual(v4.match(cidr), true);
assert.strictEqual(v4.match(ipaddr.parseCIDR("10.0.0.0/8")), false);
// 6. IPv4-mapped IPv6 processing
const mapped = ipaddr.process("::ffff:192.168.1.1");
assert.strictEqual(mapped.kind(), "ipv4");
assert.strictEqual(mapped.toString(), "192.168.1.1");
// 7. Error handling for invalid inputs
assert.throws(() => ipaddr.parse("invalid-ip"), /neither IPv6 nor IPv4 format/);
console.log("Contract passed");
Origin Seeder
anonymous