Sample
es-errors 1.3.0: eval, range, ref
Verified sample for npm es-errors 1.3.0: eval, range, ref. The contract ran on node 22 · linux alpine/x64 · docker and passed.
sha256:50d251c0158c1a9fff164ec37da726cb3b4be3374319e7dec8135cc02d64cd72
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
- 2
- Signing keys that built it
- 2
Declared environment
node 22 linux x64 node 22 javascript npm 10
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-19 |
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-09-12 |
Case
HOW- Goal
- verify pkg:npm/es-errors@1.3.0
- Packages
- Symbols
-
- es-errors
- es-errors/eval
- es-errors/range
- es-errors/ref
- es-errors/syntax
- es-errors/type
- es-errors/uri
- Environment
- node 22
- Created
- 2026-08-18T18:05:07Z
Contract
- Root export returns the built-in Error constructor reference
- es-errors/eval subpath exports the built-in EvalError constructor reference
- es-errors/range subpath exports the built-in RangeError constructor reference
- es-errors/ref subpath exports the built-in ReferenceError constructor reference
- es-errors/syntax subpath exports the built-in SyntaxError constructor reference
- es-errors/type subpath exports the built-in TypeError constructor reference
- es-errors/uri subpath exports the built-in URIError constructor reference
- Constructed error instances inherit from Error and their specific constructor with expected name and message properties
- Constructors called as functions return valid error instances
- getErrorConstructor routes string identifiers to corresponding Error constructors
- createError constructs error instances matching expected constructors and messages
Files
- PROMPT.md
- csx.json
- index.js
- package-lock.json
- package.json
- spec.json
- test/contract.js
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/es-errors@1.3.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/es-errors@1.3.0
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@11.8.0
- runtime: node@24.13.1
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:8634ad3ac73653522b03f0a7603cfd24b80373db85e7e91d74be80fa1ec2ac3e","constraints":{"executionContext":"node"},"contract":["Root export returns the built-in Error constructor reference","es-errors/eval subpath exports the built-in EvalError constructor reference","es-errors/range subpath exports the built-in RangeError constructor reference","es-errors/ref subpath exports the built-in ReferenceError constructor reference","es-errors/syntax subpath exports the built-in SyntaxError constructor reference","es-errors/type subpath exports the built-in TypeError constructor reference","es-errors/uri subpath exports the built-in URIError constructor reference","Constructed error instances inherit from Error and their specific constructor with expected name and message properties","Constructors called as functions return valid error instances","getErrorConstructor routes string identifiers to corresponding Error constructors","createError constructs error instances matching expected constructors and messages"],"goal":"verify pkg:npm/es-errors@1.3.0","kind":"HOW","packages":["pkg:npm/es-errors@1.3.0"],"schemaVersion":1,"symbols":["es-errors","es-errors/eval","es-errors/range","es-errors/ref","es-errors/syntax","es-errors/type","es-errors/uri"]},"contractCommand":["node","test/contract.js"],"environment":{"arch":"x64","ecosystem":"npm","executionContext":"node","language":"javascript","moduleSystem":"cjs","os":"linux","packageManager":"npm","packageManagerVersion":"10","runtime":"node","runtimeVersion":"22","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/es-errors@1.3.0"],"schemaVersion":1,"symbols":["es-errors","es-errors/eval","es-errors/range","es-errors/ref","es-errors/syntax","es-errors/type","es-errors/uri"],"verifierAdapter":"node-typescript@1"}
'use strict';
var $Error = require('es-errors');
var $EvalError = require('es-errors/eval');
var $RangeError = require('es-errors/range');
var $RefError = require('es-errors/ref');
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var $URIError = require('es-errors/uri');
function getErrorConstructor(type) {
switch (type) {
case 'eval':
return $EvalError;
case 'range':
return $RangeError;
case 'ref':
case 'reference':
return $RefError;
case 'syntax':
return $SyntaxError;
case 'type':
return $TypeError;
case 'uri':
return $URIError;
default:
return $Error;
}
}
function createError(type, message) {
var Ctor = getErrorConstructor(type);
return new Ctor(message);
}
module.exports = {
Error: $Error,
EvalError: $EvalError,
RangeError: $RangeError,
ReferenceError: $RefError,
SyntaxError: $SyntaxError,
TypeError: $TypeError,
URIError: $URIError,
getErrorConstructor: getErrorConstructor,
createError: createError
};
{
"name": "sample-es-errors",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-es-errors",
"version": "1.0.0",
"dependencies": {
"es-errors": "1.3.0"
}
},
"node_modules/es-errors": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
}
}
}
{
"name": "sample-es-errors",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification of es-errors package",
"main": "index.js",
"scripts": {
"test": "node test/contract.js"
},
"dependencies": {
"es-errors": "1.3.0"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/es-errors@1.3.0",
"kind": "HOW",
"packages": [
"pkg:npm/es-errors@1.3.0"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@11.8.0",
"runtime": "node@24.13.1"
}
}
'use strict';
var assert = require('assert');
var sample = require('../index.js');
var $Error = sample.Error;
var $EvalError = sample.EvalError;
var $RangeError = sample.RangeError;
var $RefError = sample.ReferenceError;
var $SyntaxError = sample.SyntaxError;
var $TypeError = sample.TypeError;
var $URIError = sample.URIError;
var getErrorConstructor = sample.getErrorConstructor;
var createError = sample.createError;
// 1. Root and subpath intrinsic exports match global Error constructors
assert.strictEqual($Error, Error);
assert.strictEqual($EvalError, EvalError);
assert.strictEqual($RangeError, RangeError);
assert.strictEqual($RefError, ReferenceError);
assert.strictEqual($SyntaxError, SyntaxError);
assert.strictEqual($TypeError, TypeError);
assert.strictEqual($URIError, URIError);
// 2. Direct require checks from subpaths
assert.strictEqual(require('es-errors'), Error);
assert.strictEqual(require('es-errors/eval'), EvalError);
assert.strictEqual(require('es-errors/range'), RangeError);
assert.strictEqual(require('es-errors/ref'), ReferenceError);
assert.strictEqual(require('es-errors/syntax'), SyntaxError);
assert.strictEqual(require('es-errors/type'), TypeError);
assert.strictEqual(require('es-errors/uri'), URIError);
// 3. Constructed error instances have expected names, messages, and prototype chains
var err = new $Error('base error');
assert.strictEqual(err instanceof Error, true);
assert.strictEqual(err.name, 'Error');
assert.strictEqual(err.message, 'base error');
var evalErr = new $EvalError('eval failed');
assert.strictEqual(evalErr instanceof EvalError, true);
assert.strictEqual(evalErr instanceof Error, true);
assert.strictEqual(evalErr.name, 'EvalError');
assert.strictEqual(evalErr.message, 'eval failed');
var rangeErr = new $RangeError('out of bounds');
assert.strictEqual(rangeErr instanceof RangeError, true);
assert.strictEqual(rangeErr instanceof Error, true);
assert.strictEqual(rangeErr.name, 'RangeError');
assert.strictEqual(rangeErr.message, 'out of bounds');
var refErr = new $RefError('invalid reference');
assert.strictEqual(refErr instanceof ReferenceError, true);
assert.strictEqual(refErr instanceof Error, true);
assert.strictEqual(refErr.name, 'ReferenceError');
assert.strictEqual(refErr.message, 'invalid reference');
var syntaxErr = new $SyntaxError('unexpected token');
assert.strictEqual(syntaxErr instanceof SyntaxError, true);
assert.strictEqual(syntaxErr instanceof Error, true);
assert.strictEqual(syntaxErr.name, 'SyntaxError');
assert.strictEqual(syntaxErr.message, 'unexpected token');
var typeErr = new $TypeError('value is not expected type');
assert.strictEqual(typeErr instanceof TypeError, true);
assert.strictEqual(typeErr instanceof Error, true);
assert.strictEqual(typeErr.name, 'TypeError');
assert.strictEqual(typeErr.message, 'value is not expected type');
var uriErr = new $URIError('malformed URI sequence');
assert.strictEqual(uriErr instanceof URIError, true);
assert.strictEqual(uriErr instanceof Error, true);
assert.strictEqual(uriErr.name, 'URIError');
assert.strictEqual(uriErr.message, 'malformed URI sequence');
// 4. Calling constructor as a function (without new) returns Error instance
var calledTypeErr = $TypeError('called type error');
assert.strictEqual(calledTypeErr instanceof TypeError, true);
assert.strictEqual(calledTypeErr.message, 'called type error');
// 5. getErrorConstructor helper correctly routes error names
assert.strictEqual(getErrorConstructor('eval'), EvalError);
assert.strictEqual(getErrorConstructor('range'), RangeError);
assert.strictEqual(getErrorConstructor('ref'), ReferenceError);
assert.strictEqual(getErrorConstructor('reference'), ReferenceError);
assert.strictEqual(getErrorConstructor('syntax'), SyntaxError);
assert.strictEqual(getErrorConstructor('type'), TypeError);
assert.strictEqual(getErrorConstructor('uri'), URIError);
assert.strictEqual(getErrorConstructor('unknown'), Error);
// 6. createError helper creates instance matching target constructor
var helperErr = createError('range', 'helper index error');
assert.strictEqual(helperErr instanceof RangeError, true);
assert.strictEqual(helperErr.message, 'helper index error');
console.log('PASS: es-errors contract verified');
Origin Seeder
anonymous