CodeSampleX

Beispiel

side-channel-map 1.0.1

Verifiziertes Beispiel für npm side-channel-map 1.0.1. Der Vertrag lief auf node 22 · linux alpine/x64 · docker und bestand: getSideChannelMap creates a side…

sha256:18f8443a29cce5a12596e16ddf7879d191702335af9a5dcbe1c7d275d5e68956

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
1
Signaturschlüssel, die es gebaut haben
1
Deklarierte Umgebung linux 24 · ubuntu · glibc 2.39 x64 npm

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-20

Fall

HOW
Ziel
verify pkg:npm/side-channel-map@1.0.1
Pakete
Erstellt
2026-08-20T14:03:30Z

Contract

  1. getSideChannelMap creates a side channel map instance supporting set, get, has, delete, and assert methods
  2. side channel map stores and retrieves metadata for object keys without modifying the object itself
  3. side channel map stores and retrieves metadata for primitive keys such as strings, numbers, and symbols
  4. side channel map delete removes key-value associations and returns boolean status
  5. side channel map assert verifies key existence and throws TypeError when key is not present

Dateien

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • src/index.js
  • test/contract.mjs

Quellartefakt herunterladen (tar.gz)

Quelltext

PROMPT.md
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/side-channel-map@1.0.1
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/side-channel-map@1.0.1

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.
csx.json
{"case":{"caseId":"case:sha256:54a9ad25a43926cf15f4a8590e0a43135d75a9fbe6139ba8884803a606af89df","contract":["getSideChannelMap creates a side channel map instance supporting set, get, has, delete, and assert methods","side channel map stores and retrieves metadata for object keys without modifying the object itself","side channel map stores and retrieves metadata for primitive keys such as strings, numbers, and symbols","side channel map delete removes key-value associations and returns boolean status","side channel map assert verifies key existence and throws TypeError when key is not present"],"goal":"verify pkg:npm/side-channel-map@1.0.1","kind":"HOW","packages":["pkg:npm/side-channel-map@1.0.1"],"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/side-channel-map@1.0.1"],"schemaVersion":1,"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-side-channel-map",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-side-channel-map",
      "version": "1.0.0",
      "dependencies": {
        "side-channel-map": "1.0.1"
      }
    },
    "node_modules/call-bind-apply-helpers": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
      "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
      "license": "MIT",
      "dependencies": {
        "es-errors": "^1.3.0",
        "function-bind": "^1.1.2"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/call-bound": {
      "version": "1.0.4",
      "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
      "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
      "license": "MIT",
      "dependencies": {
        "call-bind-apply-helpers": "^1.0.2",
        "get-intrinsic": "^1.3.0"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/dunder-proto": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
      "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
      "license": "MIT",
      "dependencies": {
        "call-bind-apply-helpers": "^1.0.1",
        "es-errors": "^1.3.0",
        "gopd": "^1.2.0"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/es-define-property": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
      "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/es-errors": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
      "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/es-object-atoms": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
      "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
      "license": "MIT",
      "dependencies": {
        "es-errors": "^1.3.0"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/function-bind": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
      "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
      "license": "MIT",
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/get-intrinsic": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
      "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
      "license": "MIT",
      "dependencies": {
        "call-bind-apply-helpers": "^1.0.2",
        "es-define-property": "^1.0.1",
        "es-errors": "^1.3.0",
        "es-object-atoms": "^1.1.1",
        "function-bind": "^1.1.2",
        "get-proto": "^1.0.1",
        "gopd": "^1.2.0",
        "has-symbols": "^1.1.0",
        "hasown": "^2.0.2",
        "math-intrinsics": "^1.1.0"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/get-proto": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
      "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
      "license": "MIT",
      "dependencies": {
        "dunder-proto": "^1.0.1",
        "es-object-atoms": "^1.0.0"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/gopd": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
      "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/has-symbols": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
      "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/hasown": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
      "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
      "license": "MIT",
      "dependencies": {
        "function-bind": "^1.1.2"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/math-intrinsics": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
      "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/object-inspect": {
      "version": "1.13.4",
      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
      "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/side-channel-map": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
      "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
      "license": "MIT",
      "dependencies": {
        "call-bound": "^1.0.2",
        "es-errors": "^1.3.0",
        "get-intrinsic": "^1.2.5",
        "object-inspect": "^1.13.3"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    }
  }
}
package.json
{
  "name": "sample-side-channel-map",
  "version": "1.0.0",
  "private": true,
  "description": "Clean-room verification of side-channel-map",
  "main": "src/index.js",
  "dependencies": {
    "side-channel-map": "1.0.1"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/side-channel-map@1.0.1",
  "kind": "HOW",
  "packages": [
    "pkg:npm/side-channel-map@1.0.1"
  ]
}
src/index.js
const getSideChannelMap = require('side-channel-map');

/**
 * Create a new side channel map instance.
 * @returns {object} Side channel map instance
 */
function createSideChannelMap() {
  return getSideChannelMap();
}

/**
 * Store metadata associated with a key in a side channel map.
 * @param {object} channel - Side channel map instance
 * @param {*} key - Key object or primitive
 * @param {*} value - Value to associate with key
 */
function storeMetadata(channel, key, value) {
  channel.set(key, value);
}

/**
 * Retrieve metadata associated with a key from a side channel map.
 * @param {object} channel - Side channel map instance
 * @param {*} key - Key object or primitive
 * @returns {*} Stored metadata value or undefined
 */
function getMetadata(channel, key) {
  return channel.get(key);
}

module.exports = {
  getSideChannelMap,
  createSideChannelMap,
  storeMetadata,
  getMetadata
};
test/contract.mjs
import assert from 'node:assert';
import { createRequire } from 'node:module';

const require = createRequire(import.meta.url);
const {
  getSideChannelMap,
  createSideChannelMap,
  storeMetadata,
  getMetadata
} = require('../src/index.js');

// 1. Export and creation verification
assert.strictEqual(typeof getSideChannelMap, 'function', 'getSideChannelMap should be a function');
assert.strictEqual(typeof createSideChannelMap, 'function', 'createSideChannelMap should be a function');
assert.strictEqual(typeof storeMetadata, 'function', 'storeMetadata should be a function');
assert.strictEqual(typeof getMetadata, 'function', 'getMetadata should be a function');

const channel = createSideChannelMap();
assert.strictEqual(typeof channel.set, 'function', 'channel.set should be a function');
assert.strictEqual(typeof channel.get, 'function', 'channel.get should be a function');
assert.strictEqual(typeof channel.has, 'function', 'channel.has should be a function');
assert.strictEqual(typeof channel.delete, 'function', 'channel.delete should be a function');
assert.strictEqual(typeof channel.assert, 'function', 'channel.assert should be a function');

// 2. Object key storage and isolation (does not mutate object)
const objKey = Object.freeze({ id: 'map-key' });
assert.strictEqual(channel.has(objKey), false);
assert.strictEqual(channel.get(objKey), undefined);

storeMetadata(channel, objKey, { role: 'editor', permissions: ['read', 'write'] });
assert.strictEqual(channel.has(objKey), true);
assert.deepStrictEqual(getMetadata(channel, objKey), { role: 'editor', permissions: ['read', 'write'] });
assert.strictEqual(Object.keys(objKey).length, 1, 'Object should not be mutated with new properties');

// 3. Primitive key storage (string, number, symbol)
const stringKey = 'test-string-key';
const numberKey = 42;
const symbolKey = Symbol('test-symbol');

channel.set(stringKey, 'stringValue');
channel.set(numberKey, 'numberValue');
channel.set(symbolKey, 'symbolValue');

assert.strictEqual(channel.has(stringKey), true);
assert.strictEqual(channel.get(stringKey), 'stringValue');

assert.strictEqual(channel.has(numberKey), true);
assert.strictEqual(channel.get(numberKey), 'numberValue');

assert.strictEqual(channel.has(symbolKey), true);
assert.strictEqual(channel.get(symbolKey), 'symbolValue');

// 4. Deletion of associations
assert.strictEqual(channel.delete(numberKey), true);
assert.strictEqual(channel.has(numberKey), false);
assert.strictEqual(channel.get(numberKey), undefined);
assert.strictEqual(channel.delete(numberKey), false, 'Second delete should return false');

// 5. Assertion verification
assert.doesNotThrow(() => {
  channel.assert(objKey);
  channel.assert(stringKey);
});

assert.throws(() => {
  channel.assert({ nonExistent: true });
}, {
  name: 'TypeError',
  message: /Side channel does not contain/
});

assert.throws(() => {
  channel.assert('nonExistentKey');
}, {
  name: 'TypeError',
  message: /Side channel does not contain/
});

console.log('Contract tests passed successfully.');

Ursprungs-Seeder

anonym