Exemplo
json-schema-traverse 0.4.1
Amostra verificada para npm json-schema-traverse 0.4.1. O contrato rodou em node 22 · linux alpine/x64 · docker e passou: traverse recursively visits root…
sha256:724ed455fcbef38e0f40566db0ccc7124ccc9b8e9966afd6ec06c96d1479589c
Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu.
Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas.
MIT-0
Evidência de execução
O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.
- Base da evidência
- Contrato assinado aprovado
- Recibos de verificação
- 2
- Chaves de assinatura que o compilaram
- 1
Ambiente declarado
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Ambientes das execuções de verificação
| Ambiente | Contrato | Etapas | Execução |
|---|---|---|---|
| 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 | 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/json-schema-traverse@0.4.1
- Pacotes
- Ambiente
- node 22.23.2
- Criado
- 2026-08-23T06:56:05Z
Contrato
- traverse recursively visits root and nested schema definitions with standard JSON pointer paths
- callback receives schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, and keyIndex
- supports separate pre and post traversal callbacks on schema nodes
- allKeys option traverses custom keywords while ignoring scalar skip keywords
- properly escapes special characters tilde and slash in property JSON pointers
Arquivos
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Código-fonte
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/json-schema-traverse@0.4.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/json-schema-traverse@0.4.1
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:cf3969bcf5ce492603c6c2e4ca612c755fbb876698db00aeafaf038f34360149","constraints":{"executionContext":"node"},"contract":["traverse recursively visits root and nested schema definitions with standard JSON pointer paths","callback receives schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, and keyIndex","supports separate pre and post traversal callbacks on schema nodes","allKeys option traverses custom keywords while ignoring scalar skip keywords","properly escapes special characters tilde and slash in property JSON pointers"],"goal":"verify pkg:npm/json-schema-traverse@0.4.1","kind":"HOW","packages":["pkg:npm/json-schema-traverse@0.4.1"],"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/json-schema-traverse@0.4.1"],"schemaVersion":1,"subject":"pkg:npm/json-schema-traverse@0.4.1","verifierAdapter":"node-typescript@1"}
{
"name": "sample-json-schema-traverse",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-json-schema-traverse",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"json-schema-traverse": "0.4.1"
}
},
"node_modules/json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"license": "MIT"
}
}
}
{
"name": "sample-json-schema-traverse",
"version": "1.0.0",
"type": "module",
"license": "MIT-0",
"dependencies": {
"json-schema-traverse": "0.4.1"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/json-schema-traverse@0.4.1",
"kind": "HOW",
"packages": [
"pkg:npm/json-schema-traverse@0.4.1"
],
"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';
const require = createRequire(import.meta.url);
const traverse = require('json-schema-traverse');
// 1. traverse recursively visits root and nested schema definitions with standard JSON pointer paths
const schema = {
type: 'object',
properties: {
name: { type: 'string' },
tags: {
type: 'array',
items: [{ type: 'string' }, { type: 'number' }]
}
},
definitions: {
custom: { type: 'boolean' }
},
allOf: [
{ required: ['name'] }
]
};
const visitedPointers = [];
traverse(schema, (subSchema, jsonPtr) => {
visitedPointers.push(jsonPtr);
});
assert.deepEqual(visitedPointers, [
'',
'/properties/name',
'/properties/tags',
'/properties/tags/items/0',
'/properties/tags/items/1',
'/definitions/custom',
'/allOf/0'
]);
// 2. callback receives schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, and keyIndex
const details = [];
traverse(schema, (subSchema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) => {
details.push({
jsonPtr,
isRoot: rootSchema === schema,
parentJsonPtr,
parentKeyword,
keyIndex
});
});
assert.deepEqual(details[0], {
jsonPtr: '',
isRoot: true,
parentJsonPtr: undefined,
parentKeyword: undefined,
keyIndex: undefined
});
assert.deepEqual(details[1], {
jsonPtr: '/properties/name',
isRoot: true,
parentJsonPtr: '',
parentKeyword: 'properties',
keyIndex: 'name'
});
assert.deepEqual(details[3], {
jsonPtr: '/properties/tags/items/0',
isRoot: true,
parentJsonPtr: '/properties/tags',
parentKeyword: 'items',
keyIndex: 0
});
// 3. supports separate pre and post traversal callbacks on schema nodes
const prePostLog = [];
const smallSchema = {
properties: {
a: { type: 'string' }
}
};
traverse(smallSchema, {
cb: {
pre: (subSchema, jsonPtr) => prePostLog.push(`pre:${jsonPtr}`),
post: (subSchema, jsonPtr) => prePostLog.push(`post:${jsonPtr}`)
}
});
assert.deepEqual(prePostLog, [
'pre:',
'pre:/properties/a',
'post:/properties/a',
'post:'
]);
// 4. allKeys option traverses custom keywords while ignoring scalar skip keywords
const customSchema = {
customSection: {
subProperty: { type: 'number' }
},
title: 'Sample Title',
minimum: 10
};
const customVisited = [];
traverse(customSchema, { allKeys: true }, (subSchema, jsonPtr) => {
customVisited.push(jsonPtr);
});
assert.deepEqual(customVisited, [
'',
'/customSection',
'/customSection/subProperty'
]);
// 5. properly escapes special characters tilde and slash in property JSON pointers
const specialKeysSchema = {
properties: {
'a~b': { type: 'string' },
'c/d': { type: 'number' },
'e~/f': { type: 'boolean' }
}
};
const specialPointers = [];
traverse(specialKeysSchema, (subSchema, jsonPtr) => {
specialPointers.push(jsonPtr);
});
assert.deepEqual(specialPointers, [
'',
'/properties/a~0b',
'/properties/c~1d',
'/properties/e~0~1f'
]);
Seeder de origem
anônimo