Ejemplo
@jridgewell/gen-mapping 0.3.13: GenMapping
Muestra verificada para npm @jridgewell/gen-mapping 0.3.13: GenMapping. El contrato se ejecutó en node 22 · linux debian/x64 · docker y pasó.
sha256:7eb66ccfc8e74e25bb22370dc7258242dea081ba9b5fae03c365c989ecdff654
Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido.
Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas.
MIT-0
Evidencia de ejecución
El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.
- Base de evidencia
- Contrato firmado aprobado
- Recibos de verificación
- 1
- Claves de firma que lo compilaron
- 1
Entorno declarado
linux 24 · ubuntu · glibc 2.39 x64 npm
Entornos de las ejecuciones de verificación
| Entorno | Contrato | Etapas | Ejecución |
|---|---|---|---|
| node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-09-05 |
Caso
HOW- Objetivo
- verify @jridgewell/gen-mapping.GenMapping in pkg:npm/%40jridgewell/gen-mapping@0.3.13
- Paquetes
- Símbolos
-
- @jridgewell/gen-mapping.GenMapping
- Creado
- 2026-09-05T13:20:04Z
Contrato
- GenMapping initializes with optional file and sourceRoot metadata
- setSourceContent stores original file source text
- addMapping records 1-based generated lines with 0-based columns and symbol names
- addSegment records 0-based generated positions and produces decoded segments
- toEncodedMap generates valid VLQ-encoded Source Map v3 mappings
- fromMap reconstructs a GenMapping instance preserving mappings and metadata
- maybeAddMapping deduplicates mappings pointing to unchanged original locations
Archivos
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Código fuente
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 @jridgewell/gen-mapping.GenMapping in pkg:npm/%40jridgewell/gen-mapping@0.3.13
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40jridgewell/gen-mapping@0.3.13
Demonstrate these symbols/APIs:
- @jridgewell/gen-mapping.GenMapping
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:3730e2d68a9cb7e55e3159d72cad38e9244b048e445a5f437387554c3219ecf0","contract":["GenMapping initializes with optional file and sourceRoot metadata","setSourceContent stores original file source text","addMapping records 1-based generated lines with 0-based columns and symbol names","addSegment records 0-based generated positions and produces decoded segments","toEncodedMap generates valid VLQ-encoded Source Map v3 mappings","fromMap reconstructs a GenMapping instance preserving mappings and metadata","maybeAddMapping deduplicates mappings pointing to unchanged original locations"],"goal":"verify @jridgewell/gen-mapping.GenMapping in pkg:npm/%40jridgewell/gen-mapping@0.3.13","kind":"HOW","packages":["pkg:npm/%40jridgewell/gen-mapping@0.3.13"],"schemaVersion":1,"symbols":["@jridgewell/gen-mapping.GenMapping"]},"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/%40jridgewell/gen-mapping@0.3.13"],"schemaVersion":1,"subject":"pkg:npm/%40jridgewell/gen-mapping@0.3.13","symbols":["@jridgewell/gen-mapping.GenMapping"],"verifierAdapter":"node-typescript@1"}
{
"name": "gen-mapping-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "gen-mapping-sample",
"version": "1.0.0",
"dependencies": {
"@jridgewell/gen-mapping": "0.3.13"
}
},
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.13",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
"integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
"license": "MIT",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.5.0",
"@jridgewell/trace-mapping": "^0.3.24"
}
},
"node_modules/@jridgewell/resolve-uri": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
"license": "MIT",
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@jridgewell/sourcemap-codec": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
"integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
"license": "MIT"
},
"node_modules/@jridgewell/trace-mapping": {
"version": "0.3.31",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
"integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
"license": "MIT",
"dependencies": {
"@jridgewell/resolve-uri": "^3.1.0",
"@jridgewell/sourcemap-codec": "^1.4.14"
}
}
}
}
{
"name": "gen-mapping-sample",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification for @jridgewell/gen-mapping",
"dependencies": {
"@jridgewell/gen-mapping": "0.3.13"
}
}
{
"schemaVersion": 1,
"goal": "verify @jridgewell/gen-mapping.GenMapping in pkg:npm/%40jridgewell/gen-mapping@0.3.13",
"kind": "HOW",
"packages": [
"pkg:npm/%40jridgewell/gen-mapping@0.3.13"
],
"symbols": [
"@jridgewell/gen-mapping.GenMapping"
]
}
import assert from 'node:assert';
import {
GenMapping,
addMapping,
addSegment,
maybeAddMapping,
setSourceContent,
toDecodedMap,
toEncodedMap,
fromMap,
} from '@jridgewell/gen-mapping';
// 1. GenMapping initializes with optional file and sourceRoot metadata
const map = new GenMapping({
file: 'bundle.js',
sourceRoot: 'https://example.com/src/',
});
assert.strictEqual(map.file, 'bundle.js');
assert.strictEqual(map.sourceRoot, 'https://example.com/src/');
// 2. setSourceContent stores original file source text
setSourceContent(map, 'a.js', 'console.log("hello");');
const initialDecoded = toDecodedMap(map);
assert.deepStrictEqual(initialDecoded.sources, ['a.js']);
assert.deepStrictEqual(initialDecoded.sourcesContent, ['console.log("hello");']);
// 3. addMapping records 1-based generated lines with 0-based columns and symbol names
addMapping(map, {
generated: { line: 1, column: 0 },
source: 'a.js',
original: { line: 1, column: 0 },
});
addMapping(map, {
generated: { line: 1, column: 8 },
source: 'a.js',
original: { line: 1, column: 8 },
name: 'log',
});
const decoded = toDecodedMap(map);
assert.deepStrictEqual(decoded.names, ['log']);
assert.deepStrictEqual(decoded.mappings[0], [
[0, 0, 0, 0],
[8, 0, 0, 8, 0],
]);
// 4. addSegment records 0-based generated positions and produces decoded segments
const segMap = new GenMapping();
addSegment(segMap, 0, 0, 'b.js', 0, 0);
addSegment(segMap, 0, 5, 'b.js', 0, 5, 'foo');
const segDecoded = toDecodedMap(segMap);
assert.deepStrictEqual(segDecoded.mappings[0], [
[0, 0, 0, 0],
[5, 0, 0, 5, 0],
]);
assert.deepStrictEqual(segDecoded.names, ['foo']);
// 5. toEncodedMap generates valid VLQ-encoded Source Map v3 mappings
const encoded = toEncodedMap(map);
assert.strictEqual(encoded.version, 3);
assert.strictEqual(encoded.file, 'bundle.js');
assert.strictEqual(encoded.sourceRoot, 'https://example.com/src/');
assert.deepStrictEqual(encoded.sources, ['a.js']);
assert.strictEqual(typeof encoded.mappings, 'string');
assert.strictEqual(encoded.mappings, 'AAAA,QAAQA');
// 6. fromMap reconstructs a GenMapping instance preserving mappings and metadata
const imported = fromMap(encoded);
assert(imported instanceof GenMapping);
assert.deepStrictEqual(toEncodedMap(imported), encoded);
// 7. maybeAddMapping deduplicates mappings pointing to unchanged original locations
const dedupMap = new GenMapping();
maybeAddMapping(dedupMap, {
generated: { line: 1, column: 0 },
source: 'c.js',
original: { line: 1, column: 0 },
});
maybeAddMapping(dedupMap, {
generated: { line: 1, column: 4 },
source: 'c.js',
original: { line: 1, column: 0 },
});
const dedupDecoded = toDecodedMap(dedupMap);
assert.strictEqual(dedupDecoded.mappings[0].length, 1);
console.log('Contract passed');
Seeder de origen
anónimo