샘플
@types/node 22.19.1
검증된 샘플 — npm @types/node 22.19.1. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: @types/node@22.19.1 package.json declares version 22.19.1…
sha256:cfc5092aa16fda863a56c6994807d4de49bc79647937441c7b2916ce67207fab
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 typescript 5.9 npm 10
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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-28 |
케이스
HOW- 목표
- verify pkg:npm/%40types/node@22.19.1
- 환경
- node 22.23.2
- 생성일
- 2026-11-28T23:52:29Z
컨트랙트
- @types/node@22.19.1 package.json declares version 22.19.1, types entry index.d.ts, typeScriptVersion 5.2, and typesVersions['<=5.6'] mapped to ts5.6/*
- TypeScript 5.9.3 compiles strict Node.js code against @types/node@22.19.1 with skipLibCheck disabled and zero diagnostics
- Buffer.from(string, 'utf8') yields Buffer<ArrayBuffer> assignable to Uint8Array<ArrayBuffer>, while Buffer<SharedArrayBuffer> is rejected as Buffer<ArrayBuffer>
- node:assert Assert constructor overloads type strict (assert.AssertStrict) and non-strict (assert.Assert) instances with explicit annotations for TS2775 and reject invalid diff options, matching runtime coercion behavior
- process.threadCpuUsage(), node:zlib ZstdOptions.dictionary with zstdCompressSync/zstdDecompressSync, http.Server.keepAliveTimeoutBuffer, and typed EventEmitter compile strictly and match Node.js 22 runtime behavior
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.ts
- test/contract.mjs
- tsconfig.json
소스
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.19.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/node@22.19.1
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.
{"case":{"caseId":"case:sha256:ae52114c3c1d6c18fb74b567c3759ecee398afb3f14881852f7c6bab03233161","constraints":{"executionContext":"node"},"contract":["@types/node@22.19.1 package.json declares version 22.19.1, types entry index.d.ts, typeScriptVersion 5.2, and typesVersions['\u003c=5.6'] mapped to ts5.6/*","TypeScript 5.9.3 compiles strict Node.js code against @types/node@22.19.1 with skipLibCheck disabled and zero diagnostics","Buffer.from(string, 'utf8') yields Buffer\u003cArrayBuffer\u003e assignable to Uint8Array\u003cArrayBuffer\u003e, while Buffer\u003cSharedArrayBuffer\u003e is rejected as Buffer\u003cArrayBuffer\u003e","node:assert Assert constructor overloads type strict (assert.AssertStrict) and non-strict (assert.Assert) instances with explicit annotations for TS2775 and reject invalid diff options, matching runtime coercion behavior","process.threadCpuUsage(), node:zlib ZstdOptions.dictionary with zstdCompressSync/zstdDecompressSync, http.Server.keepAliveTimeoutBuffer, and typed EventEmitter compile strictly and match Node.js 22 runtime behavior"],"goal":"verify pkg:npm/%40types/node@22.19.1","kind":"HOW","packages":["pkg:npm/%40types/node@22.19.1"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"typescript","languageVersion":"5.9","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@22.19.1"],"schemaVersion":1,"subject":"pkg:npm/%40types/node@22.19.1","verifierAdapter":"node-typescript@1"}
{
"name": "types-node-verify",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "types-node-verify",
"version": "1.0.0",
"devDependencies": {
"@types/node": "22.19.1",
"typescript": "5.9.3"
}
},
"node_modules/@types/node": {
"version": "22.19.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.1.tgz",
"integrity": "sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"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==",
"dev": true,
"license": "MIT"
}
}
}
{
"name": "types-node-verify",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "tsc --project tsconfig.json",
"test": "node test/contract.mjs"
},
"devDependencies": {
"@types/node": "22.19.1",
"typescript": "5.9.3"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40types/node@22.19.1",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/node@22.19.1"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
import assert, { Assert } from "node:assert";
import { Buffer } from "node:buffer";
import { EventEmitter } from "node:events";
import http from "node:http";
import path from "node:path";
import process from "node:process";
import zlib from "node:zlib";
export interface TypedEventMap {
ready: [label: string, code: number];
closed: [];
}
export interface VerificationSummary {
bufferHex: string;
sharedLength: number;
strictAssertRejectedCoercion: boolean;
looseAssertAcceptedCoercion: boolean;
threadCpuDeltaUser: number;
threadCpuDeltaSystem: number;
zstdRoundTrip: string;
keepAliveTimeoutBuffer: number;
emittedLabel: string;
emittedCode: number;
joinedPath: string;
}
function acceptArrayBufferBacked(buf: Buffer<ArrayBuffer>): Uint8Array<ArrayBuffer> {
return buf;
}
export function runNodeTypesCheck(): VerificationSummary {
// 1. TypeScript 5.7+ generic Buffer<ArrayBuffer> vs Buffer<SharedArrayBuffer>
const heapBuf: Buffer<ArrayBuffer> = Buffer.from("node22", "utf8");
const view: Uint8Array<ArrayBuffer> = acceptArrayBufferBacked(heapBuf);
const shared = new SharedArrayBuffer(4);
const sharedBuf: Buffer<SharedArrayBuffer> = Buffer.from(shared);
// @ts-expect-error Buffer<SharedArrayBuffer> is not assignable to Buffer<ArrayBuffer>
acceptArrayBufferBacked(sharedBuf);
// 2. Node 22.19.0 Assert class constructor overloads (strict vs non-strict)
// Explicit type annotations are required by TS2775 before calling assertion-signature methods.
const strictAssert: assert.AssertStrict = new Assert({ diff: "full", strict: true });
const looseAssert: assert.Assert = new Assert({ diff: "simple", strict: false });
// @ts-expect-error diff only permits "simple" | "full"
const _badDiff: assert.AssertOptions = { diff: "verbose" };
void _badDiff;
let strictAssertRejectedCoercion = false;
try {
strictAssert.equal(1, "1");
} catch (err) {
strictAssertRejectedCoercion = err instanceof assert.AssertionError;
}
let looseAssertAcceptedCoercion = false;
looseAssert.equal(1, "1");
looseAssertAcceptedCoercion = true;
// 3. Node 22.19.0 process.threadCpuUsage()
const cpuStart: NodeJS.CpuUsage = process.threadCpuUsage();
const cpuDelta: NodeJS.CpuUsage = process.threadCpuUsage(cpuStart);
// @ts-expect-error threadCpuUsage requires a NodeJS.CpuUsage object
const _badCpuCall = () => process.threadCpuUsage({ user: "0", system: 0 });
void _badCpuCall;
// 4. Node 22.19.0 ZstdOptions.dictionary (ArrayBufferView) with zstdCompressSync/zstdDecompressSync
const dict: Buffer<ArrayBuffer> = Buffer.from("common-prefix-dictionary-payload", "utf8");
const zstdOpts: zlib.ZstdOptions = { dictionary: dict };
// @ts-expect-error dictionary must be NodeJS.ArrayBufferView, not string
const _badZstdOpts: zlib.ZstdOptions = { dictionary: "invalid" };
void _badZstdOpts;
const sourceText = "common-prefix-dictionary-payload:example-record";
const compressed: NonSharedBuffer = zlib.zstdCompressSync(sourceText, zstdOpts);
const decompressed: NonSharedBuffer = zlib.zstdDecompressSync(compressed, zstdOpts);
// 5. Node 22.19.0 http.Server.keepAliveTimeoutBuffer
const server: http.Server = http.createServer();
const keepAliveTimeoutBuffer: number = server.keepAliveTimeoutBuffer;
const _badTimeout = () => {
// @ts-expect-error keepAliveTimeoutBuffer must be a number
server.keepAliveTimeoutBuffer = "1000";
};
void _badTimeout;
// 6. Generic EventEmitter<TypedEventMap>
const emitter = new EventEmitter<TypedEventMap>();
let emittedLabel = "";
let emittedCode = 0;
emitter.on("ready", (label, code) => {
emittedLabel = label;
emittedCode = code;
});
emitter.emit("ready", "ok", 22);
// @ts-expect-error "ready" expects [string, number], not [number, string]
const _badEmit = () => emitter.emit("ready", 22, "ok");
void _badEmit;
return {
bufferHex: Buffer.from(view.buffer, view.byteOffset, view.byteLength).toString("hex"),
sharedLength: sharedBuf.byteLength,
strictAssertRejectedCoercion,
looseAssertAcceptedCoercion,
threadCpuDeltaUser: cpuDelta.user,
threadCpuDeltaSystem: cpuDelta.system,
zstdRoundTrip: decompressed.toString("utf8"),
keepAliveTimeoutBuffer,
emittedLabel,
emittedCode,
joinedPath: path.posix.join("pkg", "node", "22.19.1"),
};
}
import assert from "node:assert/strict";
import { execFileSync } from "node:child_process";
import fs from "node:fs";
import { createRequire } from "node:module";
import os from "node:os";
import path from "node:path";
import { fileURLToPath } from "node:url";
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const require = createRequire(import.meta.url);
// 1. Verify exact @types/node@22.19.1 package metadata and typesVersions layout
const typesNodePkgPath = path.join(rootDir, "node_modules", "@types", "node", "package.json");
const typesNodePkg = JSON.parse(fs.readFileSync(typesNodePkgPath, "utf8"));
assert.equal(typesNodePkg.name, "@types/node");
assert.equal(typesNodePkg.version, "22.19.1");
assert.equal(typesNodePkg.types, "index.d.ts");
assert.equal(typesNodePkg.typeScriptVersion, "5.2");
assert.deepEqual(typesNodePkg.typesVersions?.["<=5.6"]?.["*"], ["ts5.6/*"]);
assert.equal(
fs.existsSync(path.join(rootDir, "node_modules", "@types", "node", "ts5.6", "index.d.ts")),
true
);
// 2. Compile strict TypeScript against @types/node@22.19.1 with skipLibCheck disabled
const tscBin = path.join(rootDir, "node_modules", "typescript", "bin", "tsc");
const outDir = fs.mkdtempSync(path.join(os.tmpdir(), "types-node-22-19-1-"));
try {
execFileSync(
process.execPath,
[tscBin, "--project", path.join(rootDir, "tsconfig.json"), "--outDir", outDir],
{ cwd: rootDir, encoding: "utf8", stdio: "inherit" }
);
// 3. Execute compiled CommonJS module and assert runtime parity with declarations
const compiled = require(path.join(outDir, "index.js"));
const result = compiled.runNodeTypesCheck();
assert.equal(result.bufferHex, Buffer.from("node22", "utf8").toString("hex"));
assert.equal(result.sharedLength, 4);
assert.equal(result.strictAssertRejectedCoercion, true);
assert.equal(result.looseAssertAcceptedCoercion, true);
assert.equal(typeof result.threadCpuDeltaUser, "number");
assert.equal(result.threadCpuDeltaUser >= 0, true);
assert.equal(typeof result.threadCpuDeltaSystem, "number");
assert.equal(result.threadCpuDeltaSystem >= 0, true);
assert.equal(result.zstdRoundTrip, "common-prefix-dictionary-payload:example-record");
assert.equal(typeof result.keepAliveTimeoutBuffer, "number");
assert.equal(result.keepAliveTimeoutBuffer >= 0, true);
assert.equal(result.emittedLabel, "ok");
assert.equal(result.emittedCode, 22);
assert.equal(result.joinedPath, "pkg/node/22.19.1");
} finally {
fs.rmSync(outDir, { recursive: true, force: true });
}
{
"compilerOptions": {
"target": "ES2022",
"module": "CommonJS",
"moduleResolution": "Node",
"strict": true,
"skipLibCheck": false,
"noEmitOnError": true,
"esModuleInterop": true,
"types": ["node"],
"rootDir": "src",
"outDir": "dist"
},
"include": ["src/**/*.ts"]
}
오리진 시더
익명