Exemple
neo-async 2.6.2: waterfall
Échantillon vérifié pour npm neo-async 2.6.2: waterfall. Le contrat s'est exécuté sur node 22 · linux alpine/x64 · docker et a réussi.
sha256:2088ca1d933ef7c6ba0b3ea0c9555e3b759a653d7114ca5091cfbdd16d28b1bb
Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré.
Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes.
MIT-0
Preuves d'exécution
L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.
- Base de preuve
- Contrat signé réussi
- Reçus de vérification
- 1
- Clés de signature qui l’ont compilé
- 1
Environnement déclaré
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Environnements des exécutions de vérification
| Environnement | Contrat | Étapes | Exécution |
|---|---|---|---|
| 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-08-27 |
Cas
HOW- Objectif
- verify neo-async.waterfall in pkg:npm/neo-async@2.6.2
- Paquets
- Symboles
-
- neo-async.waterfall
- Environnement
- node 22.23.2
- Créé
- 2026-08-27T23:09:17Z
Contrat
- neo-async.waterfall executes an array of functions in series passing the results of each function to the next
- neo-async.waterfall passes multiple arguments between successive tasks in the pipeline
- neo-async.waterfall halts execution and invokes final callback immediately when a task returns an error
- neo-async.waterfall invokes final callback with undefined result when given an empty task array
- neo-async.waterfall passes an error to callback when tasks argument is not an array
- neo-async.waterfall supports asynchronous tasks completing on different event loop ticks
Fichiers
- PROMPT.md
- csx.json
- index.js
- package-lock.json
- package.json
- spec.json
- test/contract.cjs
Code 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 neo-async.waterfall in pkg:npm/neo-async@2.6.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/neo-async@2.6.2
Demonstrate these symbols/APIs:
- neo-async.waterfall
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:cea8ae1471acad79720ec5353b592bccfb8074cc6feab076543994b156e6a44f","contract":["neo-async.waterfall executes an array of functions in series passing the results of each function to the next","neo-async.waterfall passes multiple arguments between successive tasks in the pipeline","neo-async.waterfall halts execution and invokes final callback immediately when a task returns an error","neo-async.waterfall invokes final callback with undefined result when given an empty task array","neo-async.waterfall passes an error to callback when tasks argument is not an array","neo-async.waterfall supports asynchronous tasks completing on different event loop ticks"],"goal":"verify neo-async.waterfall in pkg:npm/neo-async@2.6.2","kind":"HOW","packages":["pkg:npm/neo-async@2.6.2"],"schemaVersion":1,"symbols":["neo-async.waterfall"]},"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/neo-async@2.6.2"],"schemaVersion":1,"subject":"pkg:npm/neo-async@2.6.2","symbols":["neo-async.waterfall"],"verifierAdapter":"node-typescript@1"}
'use strict';
const async = require('neo-async');
function runWaterfall(tasks, callback) {
return async.waterfall(tasks, callback);
}
module.exports = {
runWaterfall,
waterfall: async.waterfall,
async
};
{
"name": "sample-neo-async-waterfall",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-neo-async-waterfall",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"neo-async": "2.6.2"
}
},
"node_modules/neo-async": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
"license": "MIT"
}
}
}
{
"name": "sample-neo-async-waterfall",
"version": "1.0.0",
"private": true,
"description": "verify neo-async.waterfall in pkg:npm/neo-async@2.6.2",
"main": "index.js",
"scripts": {
"test": "node test/contract.cjs"
},
"dependencies": {
"neo-async": "2.6.2"
},
"license": "MIT-0"
}
{
"schemaVersion": 1,
"goal": "verify neo-async.waterfall in pkg:npm/neo-async@2.6.2",
"kind": "HOW",
"packages": [
"pkg:npm/neo-async@2.6.2"
],
"symbols": [
"neo-async.waterfall"
]
}
'use strict';
const assert = require('assert');
const async = require('neo-async');
const { runWaterfall } = require('../index.js');
async function testSequentialExecution() {
return new Promise((resolve, reject) => {
const order = [];
async.waterfall([
(cb) => {
order.push(1);
cb(null, 'step1');
},
(arg1, cb) => {
order.push(2);
assert.strictEqual(arg1, 'step1');
cb(null, 'step2');
},
(arg2, cb) => {
order.push(3);
assert.strictEqual(arg2, 'step2');
cb(null, 'finalResult');
}
], (err, result) => {
if (err) return reject(err);
try {
assert.strictEqual(result, 'finalResult');
assert.deepStrictEqual(order, [1, 2, 3]);
resolve();
} catch (e) {
reject(e);
}
});
});
}
async function testMultipleArgumentsPassing() {
return new Promise((resolve, reject) => {
async.waterfall([
(cb) => {
cb(null, 'alpha', 'beta', 42);
},
(a, b, c, cb) => {
assert.strictEqual(a, 'alpha');
assert.strictEqual(b, 'beta');
assert.strictEqual(c, 42);
cb(null, `${a}-${b}-${c}`, true);
},
(combined, flag, cb) => {
assert.strictEqual(combined, 'alpha-beta-42');
assert.strictEqual(flag, true);
cb(null, { combined, flag });
}
], (err, result) => {
if (err) return reject(err);
try {
assert.deepStrictEqual(result, { combined: 'alpha-beta-42', flag: true });
resolve();
} catch (e) {
reject(e);
}
});
});
}
async function testErrorHaltsExecution() {
return new Promise((resolve, reject) => {
let secondTaskRan = false;
const testError = new Error('waterfall failed in step 1');
async.waterfall([
(cb) => {
cb(testError);
},
(cb) => {
secondTaskRan = true;
cb(null, 'should not happen');
}
], (err, result) => {
try {
assert.strictEqual(err, testError);
assert.strictEqual(result, undefined);
assert.strictEqual(secondTaskRan, false);
resolve();
} catch (e) {
reject(e);
}
});
});
}
async function testEmptyTasksArray() {
return new Promise((resolve, reject) => {
async.waterfall([], (err, result) => {
if (err) return reject(err);
try {
assert.strictEqual(result, undefined);
resolve();
} catch (e) {
reject(e);
}
});
});
}
async function testNonArrayTasksError() {
return new Promise((resolve, reject) => {
async.waterfall(null, (err, result) => {
try {
assert(err instanceof Error);
assert.strictEqual(err.message, 'First argument to waterfall must be an array of functions');
assert.strictEqual(result, undefined);
resolve();
} catch (e) {
reject(e);
}
});
});
}
async function testAsynchronousTasks() {
return new Promise((resolve, reject) => {
const executionOrder = [];
runWaterfall([
(cb) => {
setTimeout(() => {
executionOrder.push('first');
cb(null, 10);
}, 10);
},
(val, cb) => {
setImmediate(() => {
executionOrder.push('second');
cb(null, val * 3);
});
},
(val, cb) => {
process.nextTick(() => {
executionOrder.push('third');
cb(null, val + 5);
});
}
], (err, result) => {
if (err) return reject(err);
try {
assert.strictEqual(result, 35);
assert.deepStrictEqual(executionOrder, ['first', 'second', 'third']);
resolve();
} catch (e) {
reject(e);
}
});
});
}
async function main() {
await testSequentialExecution();
await testMultipleArgumentsPassing();
await testErrorHaltsExecution();
await testEmptyTasksArray();
await testNonArrayTasksError();
await testAsynchronousTasks();
console.log('All neo-async.waterfall contract assertions passed successfully.');
}
main().catch((err) => {
console.error('Contract test failed:', err);
process.exit(1);
});
Seeder d'origine
anonyme