샘플
@types/js-yaml 4.0.9: version
검증된 샘플 — npm @types/js-yaml 4.0.9: version. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: @types/js-yaml package.json declares package version…
sha256:201c6c0b265b7bfffc955af2da954b638aae2d91a242ba7f3b3746523f499c9e
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
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.version in pkg:npm/%40types/js-yaml@4.0.9
- 심벌
-
- @types/js-yaml.version
- 환경
- node 22.23.2
- 생성일
- 2026-08-26T12:36:13Z
컨트랙트
- @types/js-yaml package.json declares package version 4.0.9 and types entry point index.d.ts
- @types/js-yaml exports map exposes root types and ./package.json subpath
- @types/js-yaml index.d.ts declares State interface with version property typed as null | number
- inspectVersionDefinitions validates package version matching 4.0.9 and declaration structure
파일
- 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.version 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.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:c72692a72a5622334772f85f517089377a3e8b27e9372452bc8bb4bf4057037d","contract":["@types/js-yaml package.json declares package version 4.0.9 and types entry point index.d.ts","@types/js-yaml exports map exposes root types and ./package.json subpath","@types/js-yaml index.d.ts declares State interface with version property typed as null | number","inspectVersionDefinitions validates package version matching 4.0.9 and declaration structure"],"goal":"verify @types/js-yaml.version 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.version"]},"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.version"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-js-yaml-version",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-js-yaml-version",
"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-version",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification sample for @types/js-yaml version",
"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.version in pkg:npm/%40types/js-yaml@4.0.9",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/js-yaml@4.0.9"
],
"symbols": [
"@types/js-yaml.version"
]
}
const fs = require('node:fs');
const path = require('node:path');
/**
* Resolves the path to the @types/js-yaml package.json file.
* @returns {string} Absolute path to package.json
*/
function getPackageJsonPath() {
return require.resolve('@types/js-yaml/package.json');
}
/**
* Loads the package.json content of @types/js-yaml.
* @returns {object} The parsed package.json manifest
*/
function loadPackageManifest() {
const pkgPath = getPackageJsonPath();
const raw = fs.readFileSync(pkgPath, 'utf8');
return JSON.parse(raw);
}
/**
* Resolves the path to the @types/js-yaml declaration file.
* @returns {string} Absolute path to index.d.ts
*/
function getDeclarationPath() {
const pkgDir = path.dirname(getPackageJsonPath());
return path.join(pkgDir, 'index.d.ts');
}
/**
* Loads the declaration file content from @types/js-yaml.
* @returns {string} The text content of index.d.ts
*/
function loadDeclarationContent() {
const declPath = getDeclarationPath();
return fs.readFileSync(declPath, 'utf8');
}
/**
* Verifies version metadata and declaration constructs for @types/js-yaml.
* @returns {object} Summary of discovered version and type declarations
*/
function inspectVersionDefinitions() {
const manifest = loadPackageManifest();
const content = loadDeclarationContent();
const isVersionMatching = manifest.version === '4.0.9';
const hasTypesField = manifest.types === 'index.d.ts';
const hasExports = Boolean(manifest.exports && manifest.exports['.']);
const hasStateVersionProperty = content.includes('version: null | number;');
const hasNamespace = content.includes('export as namespace jsyaml;');
return {
packageName: manifest.name,
packageVersion: manifest.version,
isVersionMatching,
hasTypesField,
hasExports,
hasStateVersionProperty,
hasNamespace
};
}
module.exports = {
getPackageJsonPath,
loadPackageManifest,
getDeclarationPath,
loadDeclarationContent,
inspectVersionDefinitions
};
const assert = require('node:assert/strict');
const fs = require('node:fs');
const {
getPackageJsonPath,
loadPackageManifest,
getDeclarationPath,
loadDeclarationContent,
inspectVersionDefinitions
} = require('../src/index.js');
// 1. Verify package manifest metadata and version definition
const manifest = loadPackageManifest();
assert.strictEqual(manifest.name, '@types/js-yaml', 'package name should match @types/js-yaml');
assert.strictEqual(manifest.version, '4.0.9', 'package version should match 4.0.9');
assert.strictEqual(manifest.types, 'index.d.ts', 'package types entry should point to index.d.ts');
assert.ok(manifest.exports && manifest.exports['.'], 'exports entry point should be configured');
assert.strictEqual(manifest.exports['./package.json'], './package.json', 'package.json subpath export should be exposed');
// 2. Verify declaration file existence on disk
const declPath = getDeclarationPath();
assert.strictEqual(fs.existsSync(declPath), true, 'index.d.ts should exist on disk');
// 3. Verify declaration content contains namespace and version type in State interface
const content = loadDeclarationContent();
assert.strictEqual(typeof content, 'string', 'declaration content should be a string');
assert.strictEqual(content.includes('export as namespace jsyaml;'), true, 'declaration should declare jsyaml namespace');
assert.strictEqual(
content.includes('version: null | number;'),
true,
'State interface should declare version property as null | number'
);
// 4. Verify inspection helper results
const inspection = inspectVersionDefinitions();
assert.strictEqual(inspection.packageName, '@types/js-yaml', 'inspection packageName must match');
assert.strictEqual(inspection.packageVersion, '4.0.9', 'inspection packageVersion must match 4.0.9');
assert.strictEqual(inspection.isVersionMatching, true, 'isVersionMatching must be true');
assert.strictEqual(inspection.hasTypesField, true, 'hasTypesField must be true');
assert.strictEqual(inspection.hasExports, true, 'hasExports must be true');
assert.strictEqual(inspection.hasStateVersionProperty, true, 'hasStateVersionProperty must be true');
assert.strictEqual(inspection.hasNamespace, true, 'hasNamespace must be true');
console.log('Contract tests passed successfully.');
오리진 시더
익명