Ejemplo
rrweb-cssom 0.7.1: parse
Muestra verificada para npm rrweb-cssom 0.7.1: parse. El contrato se ejecutó en node 22 · linux debian/x64 · docker y pasó: rrweb-cssom package.json declares…
sha256:c97ae5bbb3f3ff4f42f1f0a65684b322a2da4cc4502d16bd1145cb0f096c23de
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
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
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-01 |
Caso
HOW- Objetivo
- verify parse in pkg:npm/rrweb-cssom@0.7.1
- Paquetes
- Símbolos
-
- parse
- Entorno
- node 22.23.2
- Creado
- 2026-09-01T22:05:23Z
Contrato
- rrweb-cssom package.json declares main entry point and version 0.7.1
- rrweb-cssom exports parse as a function
- parse returns a CSSStyleSheet instance containing parsed CSSStyleRules with selectors and style properties
- parse correctly handles multiple style rules in a single CSS stylesheet
- parse returns an empty CSSStyleSheet when given an empty CSS string
- parse parses @media at-rules into CSSMediaRule with mediaText and nested rules
- parse parses @import at-rules into CSSImportRule with href and media
- parse parses @keyframes at-rules into CSSKeyframesRule with animation name and keyframe rules
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 parse in pkg:npm/rrweb-cssom@0.7.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/rrweb-cssom@0.7.1
Demonstrate these symbols/APIs:
- parse
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:90e94a5b1a7bbe5281a41caa8a8ac23d4265449309f64595f043cd3faee5705b","constraints":{"executionContext":"node"},"contract":["rrweb-cssom package.json declares main entry point and version 0.7.1","rrweb-cssom exports parse as a function","parse returns a CSSStyleSheet instance containing parsed CSSStyleRules with selectors and style properties","parse correctly handles multiple style rules in a single CSS stylesheet","parse returns an empty CSSStyleSheet when given an empty CSS string","parse parses @media at-rules into CSSMediaRule with mediaText and nested rules","parse parses @import at-rules into CSSImportRule with href and media","parse parses @keyframes at-rules into CSSKeyframesRule with animation name and keyframe rules"],"goal":"verify parse in pkg:npm/rrweb-cssom@0.7.1","kind":"HOW","packages":["pkg:npm/rrweb-cssom@0.7.1"],"schemaVersion":1,"symbols":["parse"]},"contractCommand":["node","test/contract.mjs"],"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/rrweb-cssom@0.7.1"],"schemaVersion":1,"subject":"pkg:npm/rrweb-cssom@0.7.1","symbols":["parse"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-rrweb-cssom-parse",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-rrweb-cssom-parse",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"rrweb-cssom": "0.7.1"
}
},
"node_modules/rrweb-cssom": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz",
"integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==",
"license": "MIT"
}
}
}
{
"name": "sample-rrweb-cssom-parse",
"version": "1.0.0",
"type": "module",
"private": true,
"license": "MIT-0",
"dependencies": {
"rrweb-cssom": "0.7.1"
}
}
{
"schemaVersion": 1,
"goal": "verify parse in pkg:npm/rrweb-cssom@0.7.1",
"kind": "HOW",
"packages": [
"pkg:npm/rrweb-cssom@0.7.1"
],
"symbols": [
"parse"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
import assert from 'node:assert/strict';
import fs from 'node:fs';
import { createRequire } from 'node:module';
import {
parse,
CSSStyleSheet,
CSSStyleRule,
CSSMediaRule,
CSSImportRule,
CSSKeyframesRule
} from 'rrweb-cssom';
const require = createRequire(import.meta.url);
// Contract 1: rrweb-cssom package.json declares main entry point and version 0.7.1
{
const pkgJsonPath = require.resolve('rrweb-cssom/package.json');
assert.ok(fs.existsSync(pkgJsonPath));
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
assert.strictEqual(pkgJson.name, 'rrweb-cssom');
assert.strictEqual(pkgJson.version, '0.7.1');
assert.ok(pkgJson.main);
}
// Contract 2: rrweb-cssom exports parse as a function
{
assert.strictEqual(typeof parse, 'function');
}
// Contract 3: parse returns a CSSStyleSheet instance containing parsed CSSStyleRules with selectors and style properties
{
const sheet = parse('body { color: red; font-size: 16px; }');
assert.ok(sheet instanceof CSSStyleSheet);
assert.strictEqual(sheet.cssRules.length, 1);
const rule = sheet.cssRules[0];
assert.ok(rule instanceof CSSStyleRule);
assert.strictEqual(rule.selectorText, 'body');
assert.strictEqual(rule.style.color, 'red');
assert.strictEqual(rule.style.getPropertyValue('font-size'), '16px');
}
// Contract 4: parse correctly handles multiple style rules in a single CSS stylesheet
{
const css = 'h1 { margin: 0; } p { line-height: 1.5; }';
const sheet = parse(css);
assert.strictEqual(sheet.cssRules.length, 2);
assert.strictEqual(sheet.cssRules[0].selectorText, 'h1');
assert.strictEqual(sheet.cssRules[0].style.margin, '0');
assert.strictEqual(sheet.cssRules[1].selectorText, 'p');
assert.strictEqual(sheet.cssRules[1].style.getPropertyValue('line-height'), '1.5');
}
// Contract 5: parse returns an empty CSSStyleSheet when given an empty CSS string
{
const sheet = parse('');
assert.ok(sheet instanceof CSSStyleSheet);
assert.strictEqual(sheet.cssRules.length, 0);
}
// Contract 6: parse parses @media at-rules into CSSMediaRule with mediaText and nested rules
{
const css = '@media screen and (min-width: 600px) { .container { width: 100%; } }';
const sheet = parse(css);
assert.strictEqual(sheet.cssRules.length, 1);
const mediaRule = sheet.cssRules[0];
assert.ok(mediaRule instanceof CSSMediaRule);
assert.strictEqual(mediaRule.media.mediaText, 'screen and (min-width: 600px)');
assert.strictEqual(mediaRule.cssRules.length, 1);
assert.strictEqual(mediaRule.cssRules[0].selectorText, '.container');
assert.strictEqual(mediaRule.cssRules[0].style.width, '100%');
}
// Contract 7: parse parses @import at-rules into CSSImportRule with href and media
{
const css = '@import url("style.css") screen;';
const sheet = parse(css);
assert.strictEqual(sheet.cssRules.length, 1);
const importRule = sheet.cssRules[0];
assert.ok(importRule instanceof CSSImportRule);
assert.strictEqual(importRule.href, 'style.css');
assert.strictEqual(importRule.media.mediaText, 'screen');
}
// Contract 8: parse parses @keyframes at-rules into CSSKeyframesRule with animation name and keyframe rules
{
const css = '@keyframes slidein { from { transform: translateX(0%); } to { transform: translateX(100%); } }';
const sheet = parse(css);
assert.strictEqual(sheet.cssRules.length, 1);
const keyframesRule = sheet.cssRules[0];
assert.ok(keyframesRule instanceof CSSKeyframesRule);
assert.strictEqual(keyframesRule.name, 'slidein');
assert.strictEqual(keyframesRule.cssRules.length, 2);
assert.strictEqual(keyframesRule.cssRules[0].keyText, 'from');
assert.strictEqual(keyframesRule.cssRules[1].keyText, 'to');
}
console.log('All rrweb-cssom parse contract tests passed.');
Seeder de origen
anónimo