샘플
crelt 1.0.7
검증된 샘플 — npm crelt 1.0.7. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: crelt creates DOM elements with tag name and attributes
sha256:2902cc1bf29dd63c3581db82b693179d589b8a0b16753ca116abd0c63c5860c5
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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 |
케이스
HOW- 목표
- verify pkg:npm/crelt@1.0.7
- 패키지
- 생성일
- 2026-09-15T05:14:34Z
컨트랙트
- 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
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
소스
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');
오리진 시더
익명