CodeSampleX

Beispiel

@types/node 26.6.6

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

sha256:615be265f9cfae98f92233f1cc955aa8fe11d2229113c0f7b1cdb608d3e19614

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 node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

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-11-21

Fall

HOW
Ziel
verify pkg:npm/%40types/node@26.6.6
Pakete
Umgebung
node 22.23.2
Erstellt
2026-11-21T20:33:01Z

Contract

  1. @types/node@26.6.6 package manifest exposes index.d.ts, TypeScript 5.6 metadata, typesVersions <=5.6 and <=5.7 mappings, and undici-types ~8.9.0
  2. undici-types 8.9.x resolves cleanly with a non-empty declaration entry point
  3. every triple-slash reference path in root index.d.ts resolves to a non-empty .d.ts file and ts5.6/ts5.7 index.d.ts trees exist
  4. core node:events, node:fs, node:fs/promises, node:crypto, and node:buffer declarations are present
  5. Node 26 node:ffi, node:vfs, node:stream/iter, node:zlib/iter, and web-globals/fetch.d.ts declarations are present

Dateien

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.cjs

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@26.6.6
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/%40types/node@26.6.6
Constraints:
  - executionContext: node
Required runtime conditions:
  - ecosystem: npm
  - language: javascript
  - moduleSystem: cjs
  - packageManager: npm@10.9.8
  - runtime: node@22.23.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:2af83d60ea62057e2a92cb0c4e9eec07257bb509021657f7109b832d8867239c","constraints":{"executionContext":"node"},"contract":["@types/node@26.6.6 package manifest exposes index.d.ts, TypeScript 5.6 metadata, typesVersions \u003c=5.6 and \u003c=5.7 mappings, and undici-types ~8.9.0","undici-types 8.9.x resolves cleanly with a non-empty declaration entry point","every triple-slash reference path in root index.d.ts resolves to a non-empty .d.ts file and ts5.6/ts5.7 index.d.ts trees exist","core node:events, node:fs, node:fs/promises, node:crypto, and node:buffer declarations are present","Node 26 node:ffi, node:vfs, node:stream/iter, node:zlib/iter, and web-globals/fetch.d.ts declarations are present"],"goal":"verify pkg:npm/%40types/node@26.6.6","kind":"HOW","packages":["pkg:npm/%40types/node@26.6.6"],"schemaVersion":1},"contractCommand":["node","test/contract.cjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40types/node@26.6.6"],"schemaVersion":1,"subject":"pkg:npm/%40types/node@26.6.6","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "types-node-sample",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "types-node-sample",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "@types/node": "26.6.6"
      }
    },
    "node_modules/@types/node": {
      "version": "26.6.6",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz",
      "integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==",
      "license": "MIT",
      "dependencies": {
        "undici-types": "~8.9.0"
      }
    },
    "node_modules/undici-types": {
      "version": "8.9.0",
      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
      "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
      "license": "MIT"
    }
  }
}
package.json
{
  "name": "types-node-sample",
  "version": "1.0.0",
  "private": true,
  "license": "MIT-0",
  "dependencies": {
    "@types/node": "26.6.6"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/%40types/node@26.6.6",
  "kind": "HOW",
  "packages": [
    "pkg:npm/%40types/node@26.6.6"
  ],
  "constraints": {
    "executionContext": "node"
  },
  "runtimeConditions": {
    "ecosystem": "npm",
    "language": "javascript",
    "moduleSystem": "cjs",
    "packageManager": "npm@10.9.8",
    "runtime": "node@22.23.2"
  }
}
test/contract.cjs
'use strict';

const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');

// 1. Verify @types/node@26.6.6 package manifest and versioned entry points
const typesNodePkgPath = require.resolve('@types/node/package.json');
const typesNodePkg = JSON.parse(fs.readFileSync(typesNodePkgPath, 'utf8'));
const typesNodeDir = path.dirname(typesNodePkgPath);

assert.equal(typesNodePkg.name, '@types/node');
assert.equal(typesNodePkg.version, '26.6.6');
assert.equal(typesNodePkg.types, 'index.d.ts');
assert.equal(typesNodePkg.typeScriptVersion, '5.6');
assert.deepEqual(typesNodePkg.typesVersions['<=5.6']['*'], ['ts5.6/*']);
assert.deepEqual(typesNodePkg.typesVersions['<=5.7']['*'], ['ts5.7/*']);
assert.equal(typesNodePkg.dependencies['undici-types'], '~8.9.0');

// 2. Verify undici-types dependency resolves and provides declarations
const undiciPkgPath = require.resolve('undici-types/package.json');
const undiciPkg = JSON.parse(fs.readFileSync(undiciPkgPath, 'utf8'));
assert.equal(undiciPkg.name, 'undici-types');
assert.match(undiciPkg.version, /^8\.9\./);
const undiciTypesPath = path.join(path.dirname(undiciPkgPath), undiciPkg.types || 'index.d.ts');
assert.ok(fs.statSync(undiciTypesPath).size > 0, 'undici-types declaration entry must be non-empty');

// 3. Verify every reference path in root index.d.ts and versioned ts5.6/ts5.7 trees exists
const indexDts = fs.readFileSync(path.join(typesNodeDir, 'index.d.ts'), 'utf8');
const refMatches = [...indexDts.matchAll(/^\/\/\/\s*<reference\s+path="([^"]+)"\s*\/>/gm)];
assert.ok(refMatches.length >= 50, 'index.d.ts should reference Node.js declaration modules');

for (const match of refMatches) {
  const targetPath = path.join(typesNodeDir, match[1]);
  assert.ok(fs.existsSync(targetPath), `referenced declaration file must exist: ${match[1]}`);
  assert.ok(fs.statSync(targetPath).size > 0, `referenced declaration file must be non-empty: ${match[1]}`);
}

for (const tsDir of ['ts5.6', 'ts5.7']) {
  const versionedIndex = path.join(typesNodeDir, tsDir, 'index.d.ts');
  assert.ok(fs.existsSync(versionedIndex), `${tsDir}/index.d.ts must exist`);
  assert.ok(fs.statSync(versionedIndex).size > 0, `${tsDir}/index.d.ts must be non-empty`);
}

function readDts(relPath) {
  return fs.readFileSync(path.join(typesNodeDir, relPath), 'utf8');
}

// 4. Verify core Node.js module declarations
const eventsDts = readDts('events.d.ts');
assert.ok(eventsDts.includes('declare module "node:events"'));
assert.ok(eventsDts.includes('class EventEmitter<T extends EventMap<T> = any>'));
assert.ok(eventsDts.includes('interface EventEmitterOptions'));
assert.ok(eventsDts.includes('interface EventEmitterEventMap'));

const fsDts = readDts('fs.d.ts');
assert.ok(fsDts.includes('declare module "node:fs"'));
assert.ok(fsDts.includes('interface Stats extends StatsBase<number> {}'));
assert.ok(fsDts.includes('class Dirent<Name extends string | Buffer = string>'));
assert.ok(fsDts.includes('function readFileSync('));

const fsPromisesDts = readDts(path.join('fs', 'promises.d.ts'));
assert.ok(fsPromisesDts.includes('declare module "node:fs/promises"'));

const cryptoDts = readDts('crypto.d.ts');
assert.ok(cryptoDts.includes('declare module "node:crypto"'));
assert.ok(cryptoDts.includes('function createHash(algorithm: string, options?: HashOptions): Hash;'));
assert.ok(cryptoDts.includes('function randomBytes(size: number): NonSharedBuffer;'));

const bufferDts = readDts('buffer.d.ts');
assert.ok(bufferDts.includes('declare module "node:buffer"'));
assert.ok(bufferDts.includes('export function isUtf8('));
assert.ok(bufferDts.includes('export function isAscii('));

// 5. Verify Node 26 declarations shipped in @types/node@26.6.6
const ffiDts = readDts('ffi.d.ts');
assert.ok(ffiDts.includes('declare module "node:ffi"'));
assert.ok(ffiDts.includes('function dlopen<'));
assert.ok(ffiDts.includes('function dlclose(handle: DynamicLibrary): void;'));
assert.ok(ffiDts.includes('function dlsym(handle: DynamicLibrary, symbol: string): bigint;'));
assert.ok(ffiDts.includes('class DynamicLibrary'));

const vfsDts = readDts('vfs.d.ts');
assert.ok(vfsDts.includes('declare module "node:vfs"'));
assert.ok(vfsDts.includes('function create(provider?: VirtualProvider, options?: VirtualFileSystemOptions): VirtualFileSystem;'));
assert.ok(vfsDts.includes('class VirtualFileSystem'));
assert.ok(vfsDts.includes('class MemoryProvider extends VirtualProvider'));
assert.ok(vfsDts.includes('class RealFSProvider extends VirtualProvider'));

const streamIterDts = readDts(path.join('stream', 'iter.d.ts'));
assert.ok(streamIterDts.includes('declare module "node:stream/iter"'));
assert.ok(streamIterDts.includes('type SyncSource ='));

const zlibIterDts = readDts(path.join('zlib', 'iter.d.ts'));
assert.ok(zlibIterDts.includes('declare module "node:zlib/iter"'));

const fetchDts = readDts(path.join('web-globals', 'fetch.d.ts'));
assert.ok(fetchDts.includes('import * as undici from "undici-types";'));
assert.ok(fetchDts.includes('function fetch('));

console.log('@types/node@26.6.6 contract passed');

Ursprungs-Seeder

anonym