Sample
minipass 3.3.6
Verified sample for npm minipass 3.3.6. The contract ran on node 22 · linux alpine/x64 · docker and passed: Minipass synchronous write and read operations…
sha256:1cd7f581e922c8f8edbc48a8c3cdb58235ec0e708d022927aa295e2cb01c7694
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 alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-21 |
Case
HOW- Goal
- verify pkg:npm/minipass@3.3.6
- Packages
- Environment
- node 22.23.2
- Created
- 2026-08-21T18:06:21Z
Contract
- Minipass synchronous write and read operations handle string and buffer chunks with encoding conversion
- Minipass pipe forwards data between stream instances with automatic flow control and event forwarding
- Minipass objectMode preserves JavaScript objects without buffer coercion or serialization
- Minipass collect and concat asynchronously accumulate streamed chunks into arrays and strings
- Minipass promise resolves on stream completion and rejects on stream destruction with error
- Minipass pause and resume manage flowing state and buffer drained chunks
Files
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- 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/minipass@3.3.6
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/minipass@3.3.6
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.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:384e28a77b381f7eab09644fb7897f0d36adf8f75cd425ecae12f8390e555567","constraints":{"executionContext":"node"},"contract":["Minipass synchronous write and read operations handle string and buffer chunks with encoding conversion","Minipass pipe forwards data between stream instances with automatic flow control and event forwarding","Minipass objectMode preserves JavaScript objects without buffer coercion or serialization","Minipass collect and concat asynchronously accumulate streamed chunks into arrays and strings","Minipass promise resolves on stream completion and rejects on stream destruction with error","Minipass pause and resume manage flowing state and buffer drained chunks"],"goal":"verify pkg:npm/minipass@3.3.6","kind":"HOW","packages":["pkg:npm/minipass@3.3.6"],"schemaVersion":1},"contractCommand":["node","test/contract.js"],"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/minipass@3.3.6"],"schemaVersion":1,"subject":"pkg:npm/minipass@3.3.6","verifierAdapter":"node-typescript@1"}
{
"name": "sample-minipass",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-minipass",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"minipass": "3.3.6"
}
},
"node_modules/minipass": {
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
"integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
"license": "ISC",
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"license": "ISC"
}
}
}
{
"name": "sample-minipass",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification sample for minipass",
"main": "src/index.js",
"scripts": {
"test": "node test/contract.js"
},
"dependencies": {
"minipass": "3.3.6"
},
"license": "MIT-0"
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/minipass@3.3.6",
"kind": "HOW",
"packages": [
"pkg:npm/minipass@3.3.6"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
const Minipass = require('minipass');
/**
* Creates a standard Minipass stream with optional configuration.
* @param {object} [options]
* @returns {Minipass}
*/
function createStream(options) {
return new Minipass(options);
}
/**
* Pipes data from source stream to destination stream.
* @param {Minipass} src
* @param {Minipass} dest
* @returns {Minipass}
*/
function pipeStream(src, dest) {
return src.pipe(dest);
}
/**
* Collects all chunks from a stream into an array.
* @param {Minipass} stream
* @returns {Promise<Array>}
*/
async function collectStream(stream) {
return stream.collect();
}
/**
* Concatenates all chunks from a stream into a single string or Buffer.
* @param {Minipass} stream
* @returns {Promise<string|Buffer>}
*/
async function concatStream(stream) {
return stream.concat();
}
module.exports = {
Minipass,
createStream,
pipeStream,
collectStream,
concatStream
};
const assert = require('node:assert/strict');
const {
Minipass,
createStream,
pipeStream,
collectStream,
concatStream
} = require('../src/index.js');
async function main() {
// 1. Minipass synchronous write and read operations handle string and buffer chunks with encoding conversion
{
const stream = createStream({ encoding: 'utf8' });
assert.equal(stream.encoding, 'utf8');
assert.equal(stream.bufferLength, 0);
stream.write(Buffer.from('hello '));
stream.write('world');
assert.equal(stream.bufferLength, 11);
const chunk = stream.read();
assert.equal(chunk, 'hello world');
assert.equal(stream.bufferLength, 0);
stream.end();
assert.equal(stream.emittedEnd, true);
}
// 2. Minipass pipe forwards data between stream instances with automatic flow control and event forwarding
{
const src = createStream();
const dest = createStream();
pipeStream(src, dest);
const received = [];
dest.on('data', (chunk) => {
received.push(chunk.toString());
});
src.write('pipeline-');
src.write('data');
src.end();
assert.equal(dest.emittedEnd, true);
assert.equal(received.join(''), 'pipeline-data');
}
// 3. Minipass objectMode preserves JavaScript objects without buffer coercion or serialization
{
const stream = createStream({ objectMode: true });
assert.equal(stream.objectMode, true);
const payload1 = { id: 101, type: 'event' };
const payload2 = { id: 102, type: 'metric' };
stream.write(payload1);
stream.write(payload2);
stream.end();
const items = [];
for (const item of stream) {
items.push(item);
}
assert.deepEqual(items, [payload1, payload2]);
}
// 4. Minipass collect and concat asynchronously accumulate streamed chunks into arrays and strings
{
const stream1 = createStream({ encoding: 'utf8' });
stream1.write('chunk-1');
stream1.write('chunk-2');
stream1.end();
const collected = await collectStream(stream1);
assert.equal(collected.length, 2);
assert.equal(collected[0], 'chunk-1');
assert.equal(collected[1], 'chunk-2');
assert.equal(collected.dataLength, 14);
const stream2 = createStream({ encoding: 'utf8' });
stream2.write('partA');
stream2.write('partB');
stream2.end();
const concatenated = await concatStream(stream2);
assert.equal(concatenated, 'partApartB');
}
// 5. Minipass promise resolves on stream completion and rejects on stream destruction with error
{
const stream1 = createStream();
const p1 = stream1.promise();
stream1.write('data');
stream1.end();
await p1;
const stream2 = createStream();
const p2 = stream2.promise();
const failureErr = new Error('simulated failure');
stream2.destroy(failureErr);
await assert.rejects(p2, { message: 'simulated failure' });
}
// 6. Minipass pause and resume manage flowing state and buffer drained chunks
{
const stream = createStream({ encoding: 'utf8' });
stream.pause();
assert.equal(stream.paused, true);
const chunks = [];
stream.on('data', (chunk) => {
chunks.push(chunk);
});
stream.write('delayed-content');
assert.equal(chunks.length, 0);
assert.equal(stream.bufferLength, 15);
stream.resume();
assert.equal(stream.paused, false);
assert.equal(chunks.length, 1);
assert.equal(chunks[0], 'delayed-content');
assert.equal(stream.bufferLength, 0);
stream.end();
}
console.log('Contract assertions passed.');
}
main().catch((err) => {
console.error(err);
process.exit(1);
});
Origin Seeder
anonymous