Exemple
brace-expansion 5.0.9
Échantillon vérifié pour npm brace-expansion 5.0.9. Le contrat s'est exécuté sur node 22 · linux alpine/x64 · docker et a réussi.
sha256:bf8590caa4372963e7b6902bd95eb3dde734213af0c87f8845bc12aa2af2e5bc
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@1 |
2026-08-21 |
Cas
HOW- Objectif
- verify pkg:npm/brace-expansion@5.0.9
- Paquets
- Environnement
- node 22.23.2
- Créé
- 2026-08-21T09:45:00Z
Contrat
- expand expands comma-separated alternatives within curly braces into string combinations
- expand expands numeric and alphabetic sequences with optional step increments
- expand expands nested brace patterns and computes Cartesian products for adjacent brace groups
- expand handles numeric sequences with zero-padding and reverse ordering
- expand returns an empty array for empty input and preserves literal text when no braces are matched
- expand supports max and maxLength options and exports EXPANSION_MAX and EXPANSION_MAX_LENGTH constants
Fichiers
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.js
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 pkg:npm/brace-expansion@5.0.9
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/brace-expansion@5.0.9
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:6b065798ae18d21b41fc19f6cc8c24b3e16d410de7a9e987b93701bc798cb2fb","constraints":{"executionContext":"node"},"contract":["expand expands comma-separated alternatives within curly braces into string combinations","expand expands numeric and alphabetic sequences with optional step increments","expand expands nested brace patterns and computes Cartesian products for adjacent brace groups","expand handles numeric sequences with zero-padding and reverse ordering","expand returns an empty array for empty input and preserves literal text when no braces are matched","expand supports max and maxLength options and exports EXPANSION_MAX and EXPANSION_MAX_LENGTH constants"],"goal":"verify pkg:npm/brace-expansion@5.0.9","kind":"HOW","packages":["pkg:npm/brace-expansion@5.0.9"],"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/brace-expansion@5.0.9"],"schemaVersion":1,"subject":"pkg:npm/brace-expansion@5.0.9","verifierAdapter":"node-typescript@1"}
{
"name": "sample-brace-expansion",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-brace-expansion",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"brace-expansion": "5.0.9"
}
},
"node_modules/balanced-match": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
"license": "MIT",
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/brace-expansion": {
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
"integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
"node": "20 || >=22"
}
}
}
}
{
"name": "sample-brace-expansion",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification sample for brace-expansion",
"main": "src/index.js",
"scripts": {
"test": "node test/contract.js"
},
"dependencies": {
"brace-expansion": "5.0.9"
},
"license": "MIT-0"
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/brace-expansion@5.0.9",
"kind": "HOW",
"packages": [
"pkg:npm/brace-expansion@5.0.9"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
const { expand, EXPANSION_MAX, EXPANSION_MAX_LENGTH } = require('brace-expansion');
function expandPattern(pattern, options) {
return expand(pattern, options);
}
module.exports = {
expandPattern,
expand,
EXPANSION_MAX,
EXPANSION_MAX_LENGTH
};
const assert = require('node:assert/strict');
const { expand, EXPANSION_MAX, EXPANSION_MAX_LENGTH } = require('brace-expansion');
const { expandPattern } = require('../src/index.js');
// 1. Comma-separated alternatives within curly braces
assert.deepStrictEqual(expand('file.{js,ts}'), ['file.js', 'file.ts'], 'should expand comma alternatives');
assert.deepStrictEqual(expand('http://example.com/{foo,bar}'), ['http://example.com/foo', 'http://example.com/bar'], 'should expand URLs');
assert.deepStrictEqual(expandPattern('item-{a,b,c}'), ['item-a', 'item-b', 'item-c'], 'wrapper should expand comma alternatives');
// 2. Numeric and alphabetic sequences with optional step increments
assert.deepStrictEqual(expand('{1..3}'), ['1', '2', '3'], 'should expand ascending numeric sequence');
assert.deepStrictEqual(expand('{a..c}'), ['a', 'b', 'c'], 'should expand ascending alphabetic sequence');
assert.deepStrictEqual(expand('{1..5..2}'), ['1', '3', '5'], 'should expand numeric sequence with step increment');
assert.deepStrictEqual(expand('{a..e..2}'), ['a', 'c', 'e'], 'should expand alphabetic sequence with step increment');
// 3. Nested brace expressions and Cartesian products
assert.deepStrictEqual(expand('a{b,c{d,e}}f'), ['abf', 'acdf', 'acef'], 'should resolve nested brace expressions');
assert.deepStrictEqual(expand('{a,b}{1,2}'), ['a1', 'a2', 'b1', 'b2'], 'should compute Cartesian products of adjacent groups');
// 4. Zero-padding and reverse ordering
assert.deepStrictEqual(expand('{01..03}'), ['01', '02', '03'], 'should preserve zero-padding in numeric sequence');
assert.deepStrictEqual(expand('{3..1}'), ['3', '2', '1'], 'should expand descending numeric sequence');
assert.deepStrictEqual(expand('{c..a}'), ['c', 'b', 'a'], 'should expand descending alphabetic sequence');
// 5. Empty input and literal text without braces
assert.deepStrictEqual(expand(''), [], 'should return empty array for empty string');
assert.deepStrictEqual(expand('plain-text'), ['plain-text'], 'should preserve literal text without braces');
// 6. Max / maxLength options and exported constants
assert.strictEqual(EXPANSION_MAX, 100000, 'EXPANSION_MAX should be 100000');
assert.strictEqual(EXPANSION_MAX_LENGTH, 4000000, 'EXPANSION_MAX_LENGTH should be 4000000');
assert.deepStrictEqual(expand('{1..10}', { max: 3 }), ['1', '2', '3'], 'should respect max expansion option');
assert.deepStrictEqual(expand('{a,b,c}', { maxLength: 2 }), ['a', 'b'], 'should respect maxLength option');
console.log('Contract tests passed successfully.');
Seeder d'origine
anonyme