サンプル
@types/js-yaml 4.0.9: name
検証済みサンプル — npm @types/js-yaml 4.0.9: name. node 22 · linux alpine/x64 · docker で contract を実行し、成功しました: @types/js-yaml package.json defines package name…
sha256:ce90d5d546bcbba626926d68e868ad0fa80be8d7f73f88100decf563c7e3c116
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 2
- ビルドした署名鍵
- 1
宣言された環境
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-26 |
| 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-07 |
ケース
HOW- ゴール
- verify @types/js-yaml.name in pkg:npm/%40types/js-yaml@4.0.9
- パッケージ
- シンボル
-
- @types/js-yaml.name
- 環境
- node 22.23.2
- 作成日
- 2026-08-26T12:30:11Z
コントラクト
- @types/js-yaml package.json defines package name @types/js-yaml and version 4.0.9
- @types/js-yaml package.json configures types and exports entries pointing to declaration files
- @types/js-yaml index.d.ts declares jsyaml global namespace
- @types/js-yaml index.d.ts declares YAMLException error class with name property
- @types/js-yaml index.d.ts declares Mark interface with name property
- @types/js-yaml index.d.ts declares Type class with representName property
ファイル
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.js
ソース
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/js-yaml.name in pkg:npm/%40types/js-yaml@4.0.9
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/js-yaml@4.0.9
Demonstrate these symbols/APIs:
- @types/js-yaml.name
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:6977b677e416c1432bafdbbf8f15ac216f3d269fdcb9f31e8cee63ce3c608343","contract":["@types/js-yaml package.json defines package name @types/js-yaml and version 4.0.9","@types/js-yaml package.json configures types and exports entries pointing to declaration files","@types/js-yaml index.d.ts declares jsyaml global namespace","@types/js-yaml index.d.ts declares YAMLException error class with name property","@types/js-yaml index.d.ts declares Mark interface with name property","@types/js-yaml index.d.ts declares Type class with representName property"],"goal":"verify @types/js-yaml.name in pkg:npm/%40types/js-yaml@4.0.9","kind":"HOW","packages":["pkg:npm/%40types/js-yaml@4.0.9"],"schemaVersion":1,"symbols":["@types/js-yaml.name"]},"contractCommand":["node","test/contract.js"],"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/js-yaml@4.0.9"],"schemaVersion":1,"subject":"pkg:npm/%40types/js-yaml@4.0.9","symbols":["@types/js-yaml.name"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-js-yaml-name",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-js-yaml-name",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/js-yaml": "4.0.9"
}
},
"node_modules/@types/js-yaml": {
"version": "4.0.9",
"resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz",
"integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==",
"license": "MIT"
}
}
}
{
"name": "sample-types-js-yaml-name",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification sample for @types/js-yaml name",
"main": "src/index.js",
"scripts": {
"test": "node test/contract.js"
},
"dependencies": {
"@types/js-yaml": "4.0.9"
},
"license": "MIT-0"
}
{
"schemaVersion": 1,
"goal": "verify @types/js-yaml.name in pkg:npm/%40types/js-yaml@4.0.9",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/js-yaml@4.0.9"
],
"symbols": [
"@types/js-yaml.name"
]
}
const fs = require('node:fs');
const path = require('node:path');
/**
* Resolves the path to the @types/js-yaml package.json and declaration file.
* @returns {{ pkgJsonPath: string, declPath: string }} Paths to package.json and index.d.ts
*/
function resolvePackagePaths() {
const pkgJsonPath = require.resolve('@types/js-yaml/package.json');
const pkgDir = path.dirname(pkgJsonPath);
const declPath = path.join(pkgDir, 'index.d.ts');
return { pkgJsonPath, declPath };
}
/**
* Reads and parses the @types/js-yaml package.json manifest.
* @returns {object} Parsed package.json object
*/
function loadPackageManifest() {
const { pkgJsonPath } = resolvePackagePaths();
return JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
}
/**
* Loads the declaration file content from @types/js-yaml.
* @returns {string} The text content of index.d.ts
*/
function loadDeclarationContent() {
const { declPath } = resolvePackagePaths();
return fs.readFileSync(declPath, 'utf8');
}
/**
* Inspects name-related declarations and package metadata in @types/js-yaml.
* @returns {object} Detailed report of discovered symbols and manifest fields
*/
function inspectNameDefinitions() {
const manifest = loadPackageManifest();
const declContent = loadDeclarationContent();
const packageName = manifest.name;
const packageVersion = manifest.version;
const hasTypesField = Boolean(manifest.types && manifest.types === 'index.d.ts');
const hasExportsMapping = Boolean(
manifest.exports &&
manifest.exports['.'] &&
manifest.exports['.'].types
);
const hasNamespaceDeclaration = declContent.includes('export as namespace jsyaml;');
const hasYAMLExceptionName = declContent.includes('export class YAMLException extends Error') &&
declContent.includes('name: string;');
const hasMarkName = declContent.includes('export interface Mark') &&
declContent.includes('name: string;');
const hasTypeRepresentName = declContent.includes('export class Type') &&
declContent.includes('representName: ((data: object) => any) | null;');
return {
packageName,
packageVersion,
hasTypesField,
hasExportsMapping,
hasNamespaceDeclaration,
hasYAMLExceptionName,
hasMarkName,
hasTypeRepresentName
};
}
module.exports = {
resolvePackagePaths,
loadPackageManifest,
loadDeclarationContent,
inspectNameDefinitions
};
const assert = require('node:assert/strict');
const fs = require('node:fs');
const {
resolvePackagePaths,
loadPackageManifest,
loadDeclarationContent,
inspectNameDefinitions
} = require('../src/index.js');
// Contract 1: @types/js-yaml package.json defines package name @types/js-yaml and version 4.0.9
const manifest = loadPackageManifest();
assert.strictEqual(manifest.name, '@types/js-yaml', 'package name must be @types/js-yaml');
assert.strictEqual(manifest.version, '4.0.9', 'package version must be 4.0.9');
// Contract 2: @types/js-yaml package.json configures types and exports entries pointing to declaration files
assert.strictEqual(manifest.types, 'index.d.ts', 'types field must point to index.d.ts');
assert.ok(manifest.exports && manifest.exports['.'], 'exports dot entry must be defined');
assert.strictEqual(manifest.exports['.'].types.default, './index.d.ts', 'exports default types must point to ./index.d.ts');
assert.strictEqual(manifest.exports['.'].types.import, './index.d.mts', 'exports import types must point to ./index.d.mts');
// Contract 3: @types/js-yaml index.d.ts declares jsyaml global namespace
const { declPath } = resolvePackagePaths();
assert.strictEqual(fs.existsSync(declPath), true, 'index.d.ts declaration file must exist on disk');
const declContent = loadDeclarationContent();
assert.strictEqual(
declContent.includes('export as namespace jsyaml;'),
true,
'index.d.ts must declare global jsyaml namespace'
);
// Contract 4: @types/js-yaml index.d.ts declares YAMLException error class with name property
assert.strictEqual(
declContent.includes('export class YAMLException extends Error'),
true,
'index.d.ts must declare YAMLException class'
);
assert.strictEqual(
declContent.includes('name: string;'),
true,
'index.d.ts must declare name property on error/mark constructs'
);
// Contract 5: @types/js-yaml index.d.ts declares Mark interface with name property
assert.strictEqual(
declContent.includes('export interface Mark'),
true,
'index.d.ts must declare Mark interface'
);
// Contract 6: @types/js-yaml index.d.ts declares Type class with representName property
assert.strictEqual(
declContent.includes('export class Type'),
true,
'index.d.ts must declare Type class'
);
assert.strictEqual(
declContent.includes('representName: ((data: object) => any) | null;'),
true,
'Type class must declare representName property'
);
// High-level inspection verification
const inspection = inspectNameDefinitions();
assert.strictEqual(inspection.packageName, '@types/js-yaml');
assert.strictEqual(inspection.packageVersion, '4.0.9');
assert.strictEqual(inspection.hasTypesField, true);
assert.strictEqual(inspection.hasExportsMapping, true);
assert.strictEqual(inspection.hasNamespaceDeclaration, true);
assert.strictEqual(inspection.hasYAMLExceptionName, true);
assert.strictEqual(inspection.hasMarkName, true);
assert.strictEqual(inspection.hasTypeRepresentName, true);
console.log('Contract tests for @types/js-yaml.name in pkg:npm/%40types/js-yaml@4.0.9 passed successfully.');
オリジンシーダー
匿名