Sample
@eslint-community/regexpp 4.12.2
Verified sample for npm @eslint-community/regexpp 4.12.2. The contract ran on node 22 · linux alpine/x64 · docker and passed: assert parseRegExpLiteral…
sha256:1304c2c3101fbf9e9bb6eb1792d78aa7b33575c8f65c46cc29680691ca5a4087
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
linux 24 · ubuntu · glibc 2.39 x64 npm
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@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-27 |
Case
HOW- Goal
- verify pkg:npm/%40eslint-community/regexpp@4.12.2
- Packages
- Created
- 2026-08-27T16:14:25Z
Contract
- assert parseRegExpLiteral parses regular expression literal into AST with pattern and flags
- assert RegExpParser parses ECMAScript regular expression patterns with configurable options
- assert RegExpValidator validates regular expression literals and triggers callbacks
- assert validateRegExpLiteral validates regular expressions and throws RegExpSyntaxError on syntax errors
- assert visitRegExpAST traverses AST nodes and invokes visitor callbacks
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/%40eslint-community/regexpp@4.12.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40eslint-community/regexpp@4.12.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:2cf8200628cde3a87e742e7a7b270665b310b5ab2028f4232153a8b983a5ed77","contract":["assert parseRegExpLiteral parses regular expression literal into AST with pattern and flags","assert RegExpParser parses ECMAScript regular expression patterns with configurable options","assert RegExpValidator validates regular expression literals and triggers callbacks","assert validateRegExpLiteral validates regular expressions and throws RegExpSyntaxError on syntax errors","assert visitRegExpAST traverses AST nodes and invokes visitor callbacks"],"goal":"verify pkg:npm/%40eslint-community/regexpp@4.12.2","kind":"HOW","packages":["pkg:npm/%40eslint-community/regexpp@4.12.2"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40eslint-community/regexpp@4.12.2"],"schemaVersion":1,"subject":"pkg:npm/%40eslint-community/regexpp@4.12.2","verifierAdapter":"node-typescript@1"}
{
"name": "sample-eslint-community-regexpp",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-eslint-community-regexpp",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@eslint-community/regexpp": "4.12.2"
}
},
"node_modules/@eslint-community/regexpp": {
"version": "4.12.2",
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",
"integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",
"license": "MIT",
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
}
}
}
{
"name": "sample-eslint-community-regexpp",
"version": "1.0.0",
"type": "module",
"license": "MIT-0",
"dependencies": {
"@eslint-community/regexpp": "4.12.2"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40eslint-community/regexpp@4.12.2",
"kind": "HOW",
"packages": [
"pkg:npm/%40eslint-community/regexpp@4.12.2"
]
}
import assert from 'node:assert/strict';
import {
parseRegExpLiteral,
validateRegExpLiteral,
visitRegExpAST,
RegExpParser,
RegExpValidator,
RegExpSyntaxError
} from '@eslint-community/regexpp';
// 1. parseRegExpLiteral parses regular expression literal into AST with pattern and flags
const ast = parseRegExpLiteral('/(?<year>\\d{4})-(?<month>\\d{2})/gu');
assert.equal(ast.type, 'RegExpLiteral');
assert.equal(ast.flags.unicode, true);
assert.equal(ast.flags.global, true);
assert.equal(ast.pattern.alternatives.length, 1);
assert.equal(ast.pattern.alternatives[0].elements.length, 3);
assert.equal(ast.pattern.alternatives[0].elements[0].type, 'CapturingGroup');
assert.equal(ast.pattern.alternatives[0].elements[0].name, 'year');
assert.equal(ast.pattern.alternatives[0].elements[2].type, 'CapturingGroup');
assert.equal(ast.pattern.alternatives[0].elements[2].name, 'month');
// 2. RegExpParser parses ECMAScript regular expression patterns with configurable options
const parser = new RegExpParser({ ecmaVersion: 2024 });
const patternStr = '^[a-z]+$';
const patternAst = parser.parsePattern(patternStr, 0, patternStr.length, { unicode: true });
assert.equal(patternAst.type, 'Pattern');
assert.equal(patternAst.alternatives[0].elements.length, 3);
assert.equal(patternAst.alternatives[0].elements[0].type, 'Assertion');
assert.equal(patternAst.alternatives[0].elements[0].kind, 'start');
assert.equal(patternAst.alternatives[0].elements[1].type, 'Quantifier');
assert.equal(patternAst.alternatives[0].elements[2].type, 'Assertion');
assert.equal(patternAst.alternatives[0].elements[2].kind, 'end');
// 3. RegExpValidator validates regular expression literals and triggers callbacks
let groupCount = 0;
const names = [];
const validator = new RegExpValidator({
onCapturingGroupEnter(start, name) {
groupCount++;
if (name) names.push(name);
}
});
validator.validateLiteral('/(?<first>[a-z]+)-(?<second>[0-9]+)/u');
assert.equal(groupCount, 2);
assert.deepEqual(names, ['first', 'second']);
// 4. validateRegExpLiteral validates regular expressions and throws RegExpSyntaxError on syntax errors
assert.doesNotThrow(() => validateRegExpLiteral('/[0-9]+/i'));
assert.throws(
() => validateRegExpLiteral('/[0-9+/i'),
(err) => err instanceof RegExpSyntaxError || err.name === 'RegExpSyntaxError'
);
// 5. visitRegExpAST traverses AST nodes and invokes visitor callbacks
const visitedGroups = [];
visitRegExpAST(ast, {
onCapturingGroupEnter(node) {
visitedGroups.push(node.name);
}
});
assert.deepEqual(visitedGroups, ['year', 'month']);
Origin Seeder
anonymous