Exemple
@types/debug 4.1.13
Échantillon vérifié pour npm @types/debug 4.1.13. Le contrat s'est exécuté sur node 22 · linux alpine/x64 · docker et a réussi.
sha256:b55501f1c070a4a79f6eece85f8918baf0d045b2ad948e2bb5cf0cbdfcb0726f
Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré.
Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes.
MIT-0
Preuves d'exécution
L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.
- Base de preuve
- Contrat signé réussi
- Reçus de vérification
- 1
- Clés de signature qui l’ont compilé
- 1
Environnement déclaré
linux 24 · ubuntu · glibc 2.39 x64 npm
Environnements des exécutions de vérification
| Environnement | Contrat | Étapes | Exécution |
|---|---|---|---|
| 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 |
Cas
HOW- Objectif
- verify pkg:npm/%40types/debug@4.1.13
- Paquets
- Créé
- 2026-08-23T13:50:33Z
Contrat
- package manifest specifies index.d.ts type declarations and TypeScript version
- declares debug export as namespace and callable Debug interface returning Debugger
- declares Debug interface methods for enable, disable, enabled, coerce, formatArgs, log, and humanize
- declares Debugger interface with namespace, enabled, color, diff, log, destroy, and extend methods
- declares Formatters dictionary interface, IDebug and IDebugger type aliases, and inspectOpts configuration
Fichiers
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Code source
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/debug@4.1.13
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/debug@4.1.13
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:dc722cb8ed292cfb3774446a9a74e8f6a21c6542cc2c819a4027db9fda574d4d","contract":["package manifest specifies index.d.ts type declarations and TypeScript version","declares debug export as namespace and callable Debug interface returning Debugger","declares Debug interface methods for enable, disable, enabled, coerce, formatArgs, log, and humanize","declares Debugger interface with namespace, enabled, color, diff, log, destroy, and extend methods","declares Formatters dictionary interface, IDebug and IDebugger type aliases, and inspectOpts configuration"],"goal":"verify pkg:npm/%40types/debug@4.1.13","kind":"HOW","packages":["pkg:npm/%40types/debug@4.1.13"],"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/debug@4.1.13"],"schemaVersion":1,"subject":"pkg:npm/%40types/debug@4.1.13","verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-debug",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-debug",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/debug": "4.1.13"
}
},
"node_modules/@types/debug": {
"version": "4.1.13",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz",
"integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==",
"license": "MIT",
"dependencies": {
"@types/ms": "*"
}
},
"node_modules/@types/ms": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz",
"integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==",
"license": "MIT"
}
}
}
{
"name": "sample-types-debug",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@types/debug": "4.1.13"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40types/debug@4.1.13",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/debug@4.1.13"
]
}
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/debug package manifest and verify type declaration entry points
const pkgPath = require.resolve('@types/debug/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, '@types/debug', 'Package name must be @types/debug');
assert.equal(pkg.version, '4.1.13', 'Package version must be 4.1.13');
assert.equal(pkg.types, 'index.d.ts', 'Package types entry must point to index.d.ts');
assert.equal(pkg.typeScriptVersion, '5.2', 'TypeScript version must be 5.2');
const typesDir = path.dirname(pkgPath);
const dtsContent = fs.readFileSync(path.join(typesDir, 'index.d.ts'), 'utf8');
// 2. Verify debug export and namespace declarations
assert.ok(
dtsContent.includes('declare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };'),
'debug variable declaration must combine Debug interface with debug and default properties'
);
assert.ok(
dtsContent.includes('export = debug;') && dtsContent.includes('export as namespace debug;'),
'export = debug and export as namespace debug must be declared'
);
// 3. Verify Debug interface methods and properties
assert.ok(
dtsContent.includes('interface Debug {') &&
dtsContent.includes('(namespace: string): Debugger;') &&
dtsContent.includes('coerce: (val: any) => any;') &&
dtsContent.includes('disable: () => string;') &&
dtsContent.includes('enable: (namespaces: string) => void;') &&
dtsContent.includes('enabled: (namespaces: string) => boolean;') &&
dtsContent.includes('formatArgs: (this: Debugger, args: any[]) => void;') &&
dtsContent.includes('log: (...args: any[]) => any;') &&
dtsContent.includes('selectColor: (namespace: string) => string | number;') &&
dtsContent.includes('humanize: typeof import("ms");'),
'Debug interface must declare callable signature and management methods'
);
assert.ok(
dtsContent.includes('names: string[];') &&
dtsContent.includes('skips: string[];') &&
dtsContent.includes('formatters: Formatters;'),
'Debug interface must declare names, skips, and formatters'
);
// 4. Verify Debugger interface methods and properties
assert.ok(
dtsContent.includes('interface Debugger {') &&
dtsContent.includes('(formatter: any, ...args: any[]): void;') &&
dtsContent.includes('color: string;') &&
dtsContent.includes('diff: number;') &&
dtsContent.includes('enabled: boolean;') &&
dtsContent.includes('log: (...args: any[]) => any;') &&
dtsContent.includes('namespace: string;') &&
dtsContent.includes('destroy: () => boolean;') &&
dtsContent.includes('extend: (namespace: string, delimiter?: string) => Debugger;'),
'Debugger interface must declare invocation, formatting, lifecycle, and namespace extension'
);
// 5. Verify Formatters interface, type aliases, and inspectOpts
assert.ok(
dtsContent.includes('interface Formatters {') &&
dtsContent.includes('[formatter: string]: (v: any) => string;'),
'Formatters interface must map string keys to formatter functions'
);
assert.ok(
dtsContent.includes('type IDebug = Debug;') &&
dtsContent.includes('type IDebugger = Debugger;'),
'IDebug and IDebugger type aliases must be declared'
);
assert.ok(
dtsContent.includes('inspectOpts?: {') &&
dtsContent.includes('hideDate?: boolean | number | null;') &&
dtsContent.includes('colors?: boolean | number | null;') &&
dtsContent.includes('depth?: boolean | number | null;') &&
dtsContent.includes('showHidden?: boolean | number | null;'),
'inspectOpts configuration must be declared in Debug namespace'
);
console.log('Contract tests passed successfully.');
Seeder d'origine
anonyme