샘플
@types/json-schema 7.0.15: verify JSONSchema7 type definitions and validation schema composition for draft-07
검증된 샘플 — npm @types/json-schema 7.0.15: verify JSONSchema7 type definitions and validation schema composition for draft-07. node 22 · linux alpine/x64 …
sha256:337bc845c00502740db9a295b0718f2018df9ff26a83186537c734d65680cbb6
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 3
- 빌드한 서명 키
- 1
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-20 |
| 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 JSONSchema7 type definitions and validation schema composition for draft-07
- 생성일
- 2026-08-20T17:39:48Z
컨트랙트
- package manifest specifies index.d.ts type declarations and TypeScript version
- declares JSONSchema7TypeName, JSONSchema7Type, and JSONSchema7Definition type definitions
- declares JSONSchema7 core metadata and definition properties including id, ref, schema, comment, and defs
- declares JSONSchema7 numerical and string validation keyword properties
- declares JSONSchema7 array and object constraint properties including items, properties, and dependencies
- declares JSONSchema7 conditional logic and composition keywords including if, then, else, allOf, anyOf, oneOf, and not
- declares ValidationResult and ValidationError interfaces and validate, checkPropertyChange, and mustBeValid utility functions
파일
- 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 JSONSchema7 type definitions and validation schema composition for draft-07
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/json-schema@7.0.15
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:2d5205ff4d6b8f55a247264340f85fb51039d80e8bac9c458a8254afc5516440","contract":["package manifest specifies index.d.ts type declarations and TypeScript version","declares JSONSchema7TypeName, JSONSchema7Type, and JSONSchema7Definition type definitions","declares JSONSchema7 core metadata and definition properties including id, ref, schema, comment, and defs","declares JSONSchema7 numerical and string validation keyword properties","declares JSONSchema7 array and object constraint properties including items, properties, and dependencies","declares JSONSchema7 conditional logic and composition keywords including if, then, else, allOf, anyOf, oneOf, and not","declares ValidationResult and ValidationError interfaces and validate, checkPropertyChange, and mustBeValid utility functions"],"goal":"verify JSONSchema7 type definitions and validation schema composition for draft-07","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","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","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 JSONSchema7 type definitions and validation schema composition for draft-07",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/json-schema@7.0.15"
]
}
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 JSONSchema7TypeName, JSONSchema7Type, and JSONSchema7Definition type definitions
assert.ok(
dtsContent.includes('export type JSONSchema7TypeName =') &&
dtsContent.includes('"string"') &&
dtsContent.includes('"number"') &&
dtsContent.includes('"integer"') &&
dtsContent.includes('"boolean"') &&
dtsContent.includes('"object"') &&
dtsContent.includes('"array"') &&
dtsContent.includes('"null"'),
'JSONSchema7TypeName union must declare primitive schema type names'
);
assert.ok(
dtsContent.includes('export type JSONSchema7Definition = JSONSchema7 | boolean;'),
'JSONSchema7Definition must be a union of JSONSchema7 and boolean'
);
assert.ok(
dtsContent.includes('export interface JSONSchema7Object {') &&
dtsContent.includes('[key: string]: JSONSchema7Type;') &&
dtsContent.includes('export interface JSONSchema7Array extends Array<JSONSchema7Type> {}'),
'JSONSchema7Object and JSONSchema7Array recursive type interfaces must be defined'
);
// 3. Verify JSONSchema7 core metadata and definition properties including id, ref, schema, comment, and defs
assert.ok(
dtsContent.includes('$id?: string | undefined;') &&
dtsContent.includes('$ref?: string | undefined;') &&
dtsContent.includes('$schema?: JSONSchema7Version | undefined;') &&
dtsContent.includes('$comment?: string | undefined;') &&
dtsContent.includes('$defs?: {') &&
dtsContent.includes('[key: string]: JSONSchema7Definition;'),
'JSONSchema7 core metadata and definition properties ($id, $ref, $schema, $comment, $defs) must be declared'
);
// 4. Verify JSONSchema7 numerical and string validation keyword properties
assert.ok(
dtsContent.includes('multipleOf?: number | undefined;') &&
dtsContent.includes('maximum?: number | undefined;') &&
dtsContent.includes('exclusiveMaximum?: number | undefined;') &&
dtsContent.includes('minimum?: number | undefined;') &&
dtsContent.includes('exclusiveMinimum?: number | undefined;') &&
dtsContent.includes('maxLength?: number | undefined;') &&
dtsContent.includes('minLength?: number | undefined;') &&
dtsContent.includes('pattern?: string | undefined;'),
'JSONSchema7 numerical and string validation keywords must be declared'
);
// 5. Verify JSONSchema7 array and object constraint properties including items, properties, and dependencies
assert.ok(
dtsContent.includes('items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;') &&
dtsContent.includes('additionalItems?: JSONSchema7Definition | undefined;') &&
dtsContent.includes('contains?: JSONSchema7Definition | undefined;') &&
dtsContent.includes('properties?: {') &&
dtsContent.includes('patternProperties?: {') &&
dtsContent.includes('additionalProperties?: JSONSchema7Definition | undefined;') &&
dtsContent.includes('dependencies?: {') &&
dtsContent.includes('propertyNames?: JSONSchema7Definition | undefined;'),
'JSONSchema7 array and object constraint keywords must be declared'
);
// 6. Verify JSONSchema7 conditional logic and composition keywords including if, then, else, allOf, anyOf, oneOf, and not
assert.ok(
dtsContent.includes('if?: JSONSchema7Definition | undefined;') &&
dtsContent.includes('then?: JSONSchema7Definition | undefined;') &&
dtsContent.includes('else?: JSONSchema7Definition | undefined;') &&
dtsContent.includes('allOf?: JSONSchema7Definition[] | undefined;') &&
dtsContent.includes('anyOf?: JSONSchema7Definition[] | undefined;') &&
dtsContent.includes('oneOf?: JSONSchema7Definition[] | undefined;') &&
dtsContent.includes('not?: JSONSchema7Definition | undefined;'),
'JSONSchema7 conditional (if/then/else) and combinator (allOf/anyOf/oneOf/not) keywords must be declared'
);
// 7. Verify ValidationResult and ValidationError interfaces and validate, checkPropertyChange, and mustBeValid utility functions
assert.ok(
dtsContent.includes('export interface ValidationResult {') &&
dtsContent.includes('valid: boolean;') &&
dtsContent.includes('errors: ValidationError[];') &&
dtsContent.includes('export interface ValidationError {') &&
dtsContent.includes('export function validate(instance: {}, schema: JSONSchema4 | JSONSchema6 | JSONSchema7): ValidationResult;') &&
dtsContent.includes('export function checkPropertyChange(') &&
dtsContent.includes('export function mustBeValid(result: ValidationResult): void;'),
'Validation utility functions and result structures must be declared'
);
console.log('Contract tests passed successfully.');
오리진 시더
익명