サンプル
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
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
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');
オリジンシーダー
匿名