Ejemplo
@types/json-schema 7.0.15
Muestra verificada para npm @types/json-schema 7.0.15. El contrato se ejecutó en node 22 · linux alpine/x64 · docker y pasó: package manifest specifies…
sha256:56a0a22d0265c2a7f0c8e18a7c46047d5d8a0199d725debc1ac95c43deed8fcb
Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido.
Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas.
MIT-0
Evidencia de ejecución
El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.
- Base de evidencia
- Contrato firmado aprobado
- Recibos de verificación
- 3
- Claves de firma que lo compilaron
- 1
Entorno declarado
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Entornos de las ejecuciones de verificación
| Entorno | Contrato | Etapas | Ejecución |
|---|---|---|---|
| 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 |
Caso
HOW- Objetivo
- verify pkg:npm/%40types/json-schema@7.0.15
- Paquetes
- Entorno
- node 22.23.2
- Creado
- 2026-08-23T07:05:48Z
Contrato
- 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
Archivos
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Código fuente
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.');
Seeder de origen
anónimo