샘플
@types/json-schema 7.0.15
검증된 샘플 — npm @types/json-schema 7.0.15. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: package manifest specifies index.d.ts type declarations…
sha256:56a0a22d0265c2a7f0c8e18a7c46047d5d8a0199d725debc1ac95c43deed8fcb
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 3
- 빌드한 서명 키
- 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-23 |
| node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 | SKIPPED | compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-09-08 |
| 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-08 |
케이스
HOW- 목표
- verify pkg:npm/%40types/json-schema@7.0.15
- 환경
- node 22.23.2
- 생성일
- 2026-08-23T07:05:48Z
컨트랙트
- package manifest specifies index.d.ts type declarations and TypeScript version
- declares JSONSchema4 types and interfaces for draft-04 schema specifications
- declares JSONSchema6 types and interfaces for draft-06 schema specifications
- declares JSONSchema7 types, definitions, and keyword properties for draft-07 schema specifications
- declares validation utility function signatures and ValidationResult interfaces
파일
- 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 pkg:npm/%40types/json-schema@7.0.15
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/json-schema@7.0.15
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:d5ad61040eec0ccb7cd45fe9e60593038e64bf98034cc7695d0d6a315265eff5","constraints":{"executionContext":"node"},"contract":["package manifest specifies index.d.ts type declarations and TypeScript version","declares JSONSchema4 types and interfaces for draft-04 schema specifications","declares JSONSchema6 types and interfaces for draft-06 schema specifications","declares JSONSchema7 types, definitions, and keyword properties for draft-07 schema specifications","declares validation utility function signatures and ValidationResult interfaces"],"goal":"verify pkg:npm/%40types/json-schema@7.0.15","kind":"HOW","packages":["pkg:npm/%40types/json-schema@7.0.15"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"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/json-schema@7.0.15"],"schemaVersion":1,"subject":"pkg:npm/%40types/json-schema@7.0.15","verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-json-schema",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-json-schema",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/json-schema": "7.0.15"
}
},
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
"license": "MIT"
}
}
}
{
"name": "sample-types-json-schema",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@types/json-schema": "7.0.15"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40types/json-schema@7.0.15",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/json-schema@7.0.15"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
import fs from 'node:fs';
import path from 'node:path';
const require = createRequire(import.meta.url);
// 1. Resolve @types/json-schema package manifest and verify type declaration entry points
const pkgPath = require.resolve('@types/json-schema/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, '@types/json-schema', 'Package name must be @types/json-schema');
assert.equal(pkg.version, '7.0.15', 'Package version must be 7.0.15');
assert.equal(pkg.types, 'index.d.ts', 'Package types entry must point to index.d.ts');
assert.equal(pkg.typeScriptVersion, '4.5', 'TypeScript version must be 4.5');
const typesDir = path.dirname(pkgPath);
const dtsContent = fs.readFileSync(path.join(typesDir, 'index.d.ts'), 'utf8');
// 2. Verify JSONSchema4 types and interfaces for draft-04 schema specifications
assert.ok(
dtsContent.includes('export type JSONSchema4TypeName =') &&
dtsContent.includes('"string"') &&
dtsContent.includes('"number"') &&
dtsContent.includes('"integer"') &&
dtsContent.includes('"boolean"') &&
dtsContent.includes('"object"') &&
dtsContent.includes('"array"') &&
dtsContent.includes('"null"') &&
dtsContent.includes('"any";'),
'JSONSchema4TypeName must declare primitive type names including any'
);
assert.ok(
dtsContent.includes('export type JSONSchema4Type =') &&
dtsContent.includes('export interface JSONSchema4Object') &&
dtsContent.includes('export interface JSONSchema4Array extends Array<JSONSchema4Type>'),
'JSONSchema4Type, JSONSchema4Object, and JSONSchema4Array must be declared'
);
assert.ok(
dtsContent.includes('export interface JSONSchema4 {') &&
dtsContent.includes('id?: string | undefined;') &&
dtsContent.includes('$ref?: string | undefined;') &&
dtsContent.includes('$schema?: JSONSchema4Version | undefined;') &&
dtsContent.includes('multipleOf?: number | undefined;') &&
dtsContent.includes('maximum?: number | undefined;') &&
dtsContent.includes('exclusiveMaximum?: boolean | undefined;'),
'JSONSchema4 interface must declare draft-04 schema properties'
);
// 3. Verify JSONSchema6 types and interfaces for draft-06 schema specifications
assert.ok(
dtsContent.includes('export type JSONSchema6TypeName =') &&
dtsContent.includes('export type JSONSchema6Type =') &&
dtsContent.includes('export type JSONSchema6Definition = JSONSchema6 | boolean;') &&
dtsContent.includes('export interface JSONSchema6 {') &&
dtsContent.includes('$id?: string | undefined;') &&
dtsContent.includes('exclusiveMaximum?: number | undefined;') &&
dtsContent.includes('exclusiveMinimum?: number | undefined;'),
'JSONSchema6 types, definition, and numeric exclusive boundaries must be declared'
);
// 4. Verify JSONSchema7 types, definitions, and keyword properties for draft-07 schema specifications
assert.ok(
dtsContent.includes('export type JSONSchema7TypeName =') &&
dtsContent.includes('export type JSONSchema7Type =') &&
dtsContent.includes('export type JSONSchema7Definition = JSONSchema7 | boolean;') &&
dtsContent.includes('export interface JSONSchema7 {') &&
dtsContent.includes('$defs?: {') &&
dtsContent.includes('if?: JSONSchema7Definition | undefined;') &&
dtsContent.includes('then?: JSONSchema7Definition | undefined;') &&
dtsContent.includes('else?: JSONSchema7Definition | undefined;') &&
dtsContent.includes('readOnly?: boolean | undefined;') &&
dtsContent.includes('writeOnly?: boolean | undefined;'),
'JSONSchema7 interface must declare draft-07 condition keywords, $defs, and annotations'
);
// 5. Verify validation utility function signatures and ValidationResult interfaces
assert.ok(
dtsContent.includes('export interface ValidationResult {') &&
dtsContent.includes('valid: boolean;') &&
dtsContent.includes('errors: ValidationError[];') &&
dtsContent.includes('export interface ValidationError {') &&
dtsContent.includes('property: string;') &&
dtsContent.includes('message: string;'),
'ValidationResult and ValidationError interfaces must be declared'
);
assert.ok(
dtsContent.includes('export function validate(instance: {}, schema: JSONSchema4 | JSONSchema6 | JSONSchema7): ValidationResult;') &&
dtsContent.includes('export function checkPropertyChange(') &&
dtsContent.includes('export function mustBeValid(result: ValidationResult): void;'),
'validate, checkPropertyChange, and mustBeValid utility functions must be declared'
);
console.log('Contract tests passed successfully.');
오리진 시더
익명