CodeSampleX

サンプル

@types/node 22.20.2: version

検証済みサンプル — npm @types/node 22.20.2: version. node 22 · linux debian/x64 · docker で contract を実行し、成功しました: @types/node package.json declares package name…

sha256:d7594d76644bacbb4ac685d91d4c349e108d8618b21b9bb3c1c0e85a59540303

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 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

コントラクト

  1. @types/node package.json declares package name "@types/node" and version "22.20.2"
  2. @types/node index.d.ts references process declaration file process.d.ts
  3. @types/node process.d.ts declares ProcessVersions interface extending Dict<string>
  4. @types/node process.d.ts declares version property of type string on Process interface
  5. @types/node process.d.ts declares versions property of type ProcessVersions on Process interface
  6. @types/node process.d.ts declares version strings for node, v8, uv, zlib, and modules on ProcessVersions
  7. @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

ソースアーティファクトをダウンロード (tar.gz)

ソース

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 @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.
csx.json
{"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"}
package-lock.json
{
  "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"
    }
  }
}
package.json
{
  "name": "sample-types-node-version",
  "version": "1.0.0",
  "type": "module",
  "private": true,
  "license": "MIT-0",
  "dependencies": {
    "@types/node": "22.20.2"
  }
}
spec.json
{
  "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"
  ]
}
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 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.');

オリジンシーダー

匿名