CodeSampleX

Beispiel

@types/node 22.20.2

Verifiziertes Beispiel für npm @types/node 22.20.2. Der Vertrag lief auf node 22 · linux debian/x64 · docker und bestand: @types/node package.json declares…

sha256:131ed0e2028c47edd7b42cca3e7617697ecdf0706340b58f3b125147d866fae5

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 debian/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2…
2026-09-16

Fall

HOW
Ziel
verify pkg:npm/%40types/node@22.20.2
Pakete
Erstellt
2026-09-16T12:25:31Z

Contract

  1. @types/node package.json declares type definitions entry point index.d.ts and version 22.20.2
  2. @types/node index.d.ts references core declaration files including fs.d.ts, buffer.d.ts, events.d.ts, and path.d.ts
  3. @types/node events.d.ts declares EventEmitter class in module events and module node:events
  4. @types/node buffer.d.ts declares Buffer namespace and BufferConstructor with isBuffer and isEncoding methods
  5. @types/node fs.d.ts declares readFileSync, writeFileSync, and existsSync in module fs and node:fs
  6. @types/node path.d.ts declares PlatformPath interface with join, resolve, normalize, and matchesGlob methods

Dateien

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • 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/%40types/node@22.20.2
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/%40types/node@22.20.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.
csx.json
{"case":{"caseId":"case:sha256:b30fe7b91a86f7e022f0208db6487ca92cf8681b5291f403e446ed262300c0c2","contract":["@types/node package.json declares type definitions entry point index.d.ts and version 22.20.2","@types/node index.d.ts references core declaration files including fs.d.ts, buffer.d.ts, events.d.ts, and path.d.ts","@types/node events.d.ts declares EventEmitter class in module events and module node:events","@types/node buffer.d.ts declares Buffer namespace and BufferConstructor with isBuffer and isEncoding methods","@types/node fs.d.ts declares readFileSync, writeFileSync, and existsSync in module fs and node:fs","@types/node path.d.ts declares PlatformPath interface with join, resolve, normalize, and matchesGlob methods"],"goal":"verify pkg:npm/%40types/node@22.20.2","kind":"HOW","packages":["pkg:npm/%40types/node@22.20.2"],"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/%40types/node@22.20.2"],"schemaVersion":1,"subject":"pkg:npm/%40types/node@22.20.2","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-types-node",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-types-node",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "@types/node": "22.20.2"
      }
    },
    "node_modules/@types/node": {
      "version": "22.20.2",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.2.tgz",
      "integrity": "sha512-xlvWf4Vs9n1PEVYwP1n4vvG07M6y8WgvJ2t0vbrWTmijsIHp1cS+uJ2kMIRdY3nHZK0nCYKrPeD171+SzF4/zw==",
      "license": "MIT",
      "dependencies": {
        "undici-types": "~6.21.0"
      }
    },
    "node_modules/undici-types": {
      "version": "6.21.0",
      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
      "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
      "license": "MIT"
    }
  }
}
package.json
{
  "name": "sample-types-node",
  "version": "1.0.0",
  "type": "module",
  "private": true,
  "license": "MIT-0",
  "dependencies": {
    "@types/node": "22.20.2"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/%40types/node@22.20.2",
  "kind": "HOW",
  "packages": [
    "pkg:npm/%40types/node@22.20.2"
  ]
}
test/contract.mjs
import assert from 'node:assert/strict';
import fs from 'node:fs';
import { createRequire } from 'node:module';

const require = createRequire(import.meta.url);

// 1. @types/node package.json declares type definitions entry point index.d.ts and version 22.20.2
const pkgJson = require('@types/node/package.json');
assert.equal(pkgJson.name, '@types/node');
assert.equal(pkgJson.version, '22.20.2');
assert.equal(pkgJson.types, 'index.d.ts');

// 2. @types/node index.d.ts references core declaration files including fs.d.ts, buffer.d.ts, events.d.ts, and path.d.ts
const indexDtsPath = require.resolve('@types/node/index.d.ts');
assert.ok(fs.existsSync(indexDtsPath));
const indexDtsContent = fs.readFileSync(indexDtsPath, 'utf8');

assert.ok(indexDtsContent.includes('/// <reference path="fs.d.ts" />'));
assert.ok(indexDtsContent.includes('/// <reference path="buffer.d.ts" />'));
assert.ok(indexDtsContent.includes('/// <reference path="events.d.ts" />'));
assert.ok(indexDtsContent.includes('/// <reference path="path.d.ts" />'));

// 3. @types/node events.d.ts declares EventEmitter class in module events and module node:events
const eventsDtsPath = require.resolve('@types/node/events.d.ts');
assert.ok(fs.existsSync(eventsDtsPath));
const eventsDtsContent = fs.readFileSync(eventsDtsPath, 'utf8');

assert.ok(eventsDtsContent.includes('declare module "events" {'));
assert.ok(eventsDtsContent.includes('class EventEmitter<T extends EventMap<T> = DefaultEventMap> {'));
assert.ok(eventsDtsContent.includes('export = EventEmitter;'));
assert.ok(eventsDtsContent.includes('declare module "node:events" {'));

// 4. @types/node buffer.d.ts declares Buffer namespace and BufferConstructor with isBuffer and isEncoding methods
const bufferDtsPath = require.resolve('@types/node/buffer.d.ts');
assert.ok(fs.existsSync(bufferDtsPath));
const bufferDtsContent = fs.readFileSync(bufferDtsPath, 'utf8');

assert.ok(bufferDtsContent.includes('declare module "buffer" {'));
assert.ok(bufferDtsContent.includes('interface BufferConstructor {'));
assert.ok(bufferDtsContent.includes('isBuffer(obj: any): obj is Buffer;'));
assert.ok(bufferDtsContent.includes('isEncoding(encoding: string): encoding is BufferEncoding;'));

// 5. @types/node fs.d.ts declares readFileSync, writeFileSync, and existsSync in module fs and node:fs
const fsDtsPath = require.resolve('@types/node/fs.d.ts');
assert.ok(fs.existsSync(fsDtsPath));
const fsDtsContent = fs.readFileSync(fsDtsPath, 'utf8');

assert.ok(fsDtsContent.includes('declare module "fs" {'));
assert.ok(fsDtsContent.includes('export function readFileSync('));
assert.ok(fsDtsContent.includes('export function writeFileSync('));
assert.ok(fsDtsContent.includes('export function existsSync(path: PathLike): boolean;'));
assert.ok(fsDtsContent.includes('declare module "node:fs" {'));

// 6. @types/node path.d.ts declares PlatformPath interface with join, resolve, normalize, and matchesGlob methods
const pathDtsPath = require.resolve('@types/node/path.d.ts');
assert.ok(fs.existsSync(pathDtsPath));
const pathDtsContent = fs.readFileSync(pathDtsPath, 'utf8');

assert.ok(pathDtsContent.includes('declare module "path" {'));
assert.ok(pathDtsContent.includes('interface PlatformPath {'));
assert.ok(pathDtsContent.includes('join(...paths: string[]): string;'));
assert.ok(pathDtsContent.includes('resolve(...paths: string[]): string;'));
assert.ok(pathDtsContent.includes('matchesGlob(path: string, pattern: string): boolean;'));
assert.ok(pathDtsContent.includes('declare module "node:path" {'));

console.log('All contract tests passed.');

Ursprungs-Seeder

anonym