Пример
@types/node 22.20.2: version
Проверенный пример — npm @types/node 22.20.2: version. Контракт выполнен на node 22 · linux debian/x64 · docker и пройден: @types/node package.json declares…
sha256:d7594d76644bacbb4ac685d91d4c349e108d8618b21b9bb3c1c0e85a59540303
Эта сеть предлагает одно: образец, который собирается. Она запустила его в песочнице и сохранила подписанную квитанцию. Она ничего не оценивает и ничего не гарантирует — собирается ли тот же код у вас, она не измеряла.
Сколько различных ключей подписи подали пройденную квитанцию контракта. Один — только автор; больше одного — значит, кто-то ещё тоже собрал. Ключ создаётся сам и не имеет зарегистрированной личности, поэтому считаются ключи, а не люди.
MIT-0
Свидетельства выполнения
Заявленное окружение и подписанные запуски разделены, чтобы вы точно видели, что этот образец запускал и где.
- Основа свидетельства
- Подписанный контракт пройден
- Квитанции проверки
- 1
- Ключи подписи, собравшие его
- 1
Заявленная среда
linux 24 · ubuntu · glibc 2.39 x64 npm
Среды запусков проверки
| Окружение | Контракт | Этапы | Запуск |
|---|---|---|---|
| node 22 · linux debian/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-09-17 |
Кейс
HOW- Цель
- verify @types/node.version in pkg:npm/%40types/node@22.20.2
- Пакеты
- Символы
-
- @types/node.version
- Создан
- 2026-09-16T23:23:23Z
Контракт
- @types/node package.json declares package name "@types/node" and version "22.20.2"
- @types/node index.d.ts references process declaration file process.d.ts
- @types/node process.d.ts declares ProcessVersions interface extending Dict<string>
- @types/node process.d.ts declares version property of type string on Process interface
- @types/node process.d.ts declares versions property of type ProcessVersions on Process interface
- @types/node process.d.ts declares version strings for node, v8, uv, zlib, and modules on ProcessVersions
- @types/node process.d.ts exports process object in both "process" and "node:process" module declarations
Файлы
- 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 @types/node.version in pkg:npm/%40types/node@22.20.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/node@22.20.2
Demonstrate these symbols/APIs:
- @types/node.version
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:4b1b7da61e8014c199424cda66d9ec958dccabfa890c18ec5aae8ad8f4cc3e41","contract":["@types/node package.json declares package name \"@types/node\" and version \"22.20.2\"","@types/node index.d.ts references process declaration file process.d.ts","@types/node process.d.ts declares ProcessVersions interface extending Dict\u003cstring\u003e","@types/node process.d.ts declares version property of type string on Process interface","@types/node process.d.ts declares versions property of type ProcessVersions on Process interface","@types/node process.d.ts declares version strings for node, v8, uv, zlib, and modules on ProcessVersions","@types/node process.d.ts exports process object in both \"process\" and \"node:process\" module declarations"],"goal":"verify @types/node.version in pkg:npm/%40types/node@22.20.2","kind":"HOW","packages":["pkg:npm/%40types/node@22.20.2"],"schemaVersion":1,"symbols":["@types/node.version"]},"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","symbols":["@types/node.version"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-node-version",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-node-version",
"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"
}
}
}
{
"name": "sample-types-node-version",
"version": "1.0.0",
"type": "module",
"private": true,
"license": "MIT-0",
"dependencies": {
"@types/node": "22.20.2"
}
}
{
"schemaVersion": 1,
"goal": "verify @types/node.version in pkg:npm/%40types/node@22.20.2",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/node@22.20.2"
],
"symbols": [
"@types/node.version"
]
}
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 package name "@types/node" 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');
// 2. @types/node index.d.ts references process declaration file process.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="process.d.ts" />'));
// 3. @types/node process.d.ts declares ProcessVersions interface extending Dict<string>
const processDtsPath = require.resolve('@types/node/process.d.ts');
assert.ok(fs.existsSync(processDtsPath));
const processDtsContent = fs.readFileSync(processDtsPath, 'utf8');
assert.ok(processDtsContent.includes('interface ProcessVersions extends Dict<string> {'));
// 4. @types/node process.d.ts declares version property of type string on Process interface
assert.ok(processDtsContent.includes('readonly version: string;'));
// 5. @types/node process.d.ts declares versions property of type ProcessVersions on Process interface
assert.ok(processDtsContent.includes('readonly versions: ProcessVersions;'));
// 6. @types/node process.d.ts declares version strings for node, v8, uv, zlib, and modules on ProcessVersions
assert.ok(processDtsContent.includes('node: string;'));
assert.ok(processDtsContent.includes('v8: string;'));
assert.ok(processDtsContent.includes('uv: string;'));
assert.ok(processDtsContent.includes('zlib: string;'));
assert.ok(processDtsContent.includes('modules: string;'));
// 7. @types/node process.d.ts exports process object in both "process" and "node:process" module declarations
assert.ok(processDtsContent.includes('declare module "process" {'));
assert.ok(processDtsContent.includes('declare module "node:process" {'));
console.log('All contract tests passed.');
Исходный сидер
аноним