Exemplo
crelt 1.0.7
Amostra verificada para npm crelt 1.0.7. O contrato rodou em node 22 · linux debian/x64 · docker e passou: crelt creates DOM elements with tag name and…
sha256:2902cc1bf29dd63c3581db82b693179d589b8a0b16753ca116abd0c63c5860c5
Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu.
Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas.
MIT-0
Evidência de execução
O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.
- Base da evidência
- Contrato assinado aprovado
- Recibos de verificação
- 1
- Chaves de assinatura que o compilaram
- 1
Ambiente declarado
linux 24 · ubuntu · glibc 2.39 x64 npm
Ambientes das execuções de verificação
| Ambiente | Contrato | Etapas | Execução |
|---|---|---|---|
| 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-15 |
Caso
HOW- Objetivo
- verify pkg:npm/crelt@1.0.7
- Pacotes
- Criado
- 2026-09-15T05:14:34Z
Contrato
- crelt creates DOM elements with tag name and attributes
- crelt wraps existing DOM elements when passed as first argument
- crelt appends string children as text nodes
- crelt appends element and node children
- crelt handles nested arrays of children flattening them recursively
- crelt ignores null and undefined children
- crelt throws RangeError for unsupported child node types
Arquivos
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Código-fonte
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/crelt@1.0.7
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/crelt@1.0.7
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:f3e046d0d45a0614977073cebfd46498b5660b76c94958c6314b0823b3ef0579","contract":["crelt creates DOM elements with tag name and attributes","crelt wraps existing DOM elements when passed as first argument","crelt appends string children as text nodes","crelt appends element and node children","crelt handles nested arrays of children flattening them recursively","crelt ignores null and undefined children","crelt throws RangeError for unsupported child node types"],"goal":"verify pkg:npm/crelt@1.0.7","kind":"HOW","packages":["pkg:npm/crelt@1.0.7"],"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/crelt@1.0.7"],"schemaVersion":1,"subject":"pkg:npm/crelt@1.0.7","verifierAdapter":"node-typescript@1"}
{
"name": "crelt-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "crelt-sample",
"version": "1.0.0",
"dependencies": {
"crelt": "1.0.7"
}
},
"node_modules/crelt": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.7.tgz",
"integrity": "sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA==",
"license": "MIT"
}
}
}
{
"name": "crelt-sample",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification for crelt",
"dependencies": {
"crelt": "1.0.7"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/crelt@1.0.7",
"kind": "HOW",
"packages": [
"pkg:npm/crelt@1.0.7"
]
}
import assert from 'node:assert';
// Minimal DOM mock for Node.js environment
class MockElement {
constructor(tagName) {
this.tagName = tagName.toUpperCase();
this.nodeType = 1;
this.attributes = {};
this.childNodes = [];
}
setAttribute(name, value) {
this.attributes[name] = String(value);
}
getAttribute(name) {
return Object.prototype.hasOwnProperty.call(this.attributes, name) ? this.attributes[name] : null;
}
appendChild(child) {
this.childNodes.push(child);
return child;
}
}
class MockTextNode {
constructor(text) {
this.nodeValue = String(text);
this.nodeType = 3;
}
}
globalThis.document = {
createElement(tag) {
return new MockElement(tag);
},
createTextNode(text) {
return new MockTextNode(text);
}
};
import crelt from 'crelt';
// 1. crelt creates DOM elements with tag name and attributes
const el1 = crelt('div', { id: 'test-id', class: 'container', tabIndex: 0 });
assert.strictEqual(el1.tagName, 'DIV');
assert.strictEqual(el1.getAttribute('id'), 'test-id');
assert.strictEqual(el1.getAttribute('class'), 'container');
assert.strictEqual(el1.tabIndex, 0);
// 2. crelt wraps existing DOM elements when passed as first argument
const existing = globalThis.document.createElement('section');
const el2 = crelt(existing, { 'data-mode': 'active' });
assert.strictEqual(el2, existing);
assert.strictEqual(el2.tagName, 'SECTION');
assert.strictEqual(el2.getAttribute('data-mode'), 'active');
// 3. crelt appends string children as text nodes
const el3 = crelt('p', null, 'hello', ' ', 'world');
assert.strictEqual(el3.childNodes.length, 3);
assert.strictEqual(el3.childNodes[0].nodeType, 3);
assert.strictEqual(el3.childNodes[0].nodeValue, 'hello');
assert.strictEqual(el3.childNodes[1].nodeValue, ' ');
assert.strictEqual(el3.childNodes[2].nodeValue, 'world');
// 4. crelt appends element and node children
const childSpan = crelt('span', null, 'inner');
const el4 = crelt('div', null, childSpan);
assert.strictEqual(el4.childNodes.length, 1);
assert.strictEqual(el4.childNodes[0], childSpan);
assert.strictEqual(el4.childNodes[0].childNodes[0].nodeValue, 'inner');
// 5. crelt handles nested arrays of children flattening them recursively
const el5 = crelt('ul', null, [
crelt('li', null, 'item 1'),
[crelt('li', null, 'item 2'), [crelt('li', null, 'item 3')]]
]);
assert.strictEqual(el5.childNodes.length, 3);
assert.strictEqual(el5.childNodes[0].childNodes[0].nodeValue, 'item 1');
assert.strictEqual(el5.childNodes[1].childNodes[0].nodeValue, 'item 2');
assert.strictEqual(el5.childNodes[2].childNodes[0].nodeValue, 'item 3');
// 6. crelt ignores null and undefined children
const el6 = crelt('div', null, null, 'valid', undefined);
assert.strictEqual(el6.childNodes.length, 1);
assert.strictEqual(el6.childNodes[0].nodeValue, 'valid');
// 7. crelt throws RangeError for unsupported child node types
assert.throws(
() => {
crelt('div', null, 42);
},
(err) => {
return err instanceof RangeError && err.message.includes('Unsupported child node: 42');
}
);
assert.throws(
() => {
crelt('div', null, { some: 'object' });
},
(err) => {
return err instanceof RangeError && err.message.includes('Unsupported child node:');
}
);
console.log('Contract passed');
Seeder de origem
anônimo