Exemplo
@types/yargs-parser 21.0.3: yargsParser.detailed
Amostra verificada para npm @types/yargs-parser 21.0.3: yargsParser.detailed. O contrato rodou em node 22 · linux alpine/x64 · docker e passou.
sha256:ffd6e0576ae439ccedbea906029b1fd438e403fece28bf41228d115c71f0f429
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
- 1
- Chaves de assinatura que o compilaram
- 1
Ambiente declarado
linux 24 · ubuntu · glibc 2.39 x64 npm
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-27 |
Caso
HOW- Objetivo
- verify yargsParser.detailed in pkg:npm/%40types/yargs-parser@21.0.3
- Pacotes
- Símbolos
-
- yargsParser.detailed
- Criado
- 2026-08-27T15:03:49Z
Contrato
- declares detailed method signature on Parser interface taking string or string array argv and optional Options returning DetailedArguments
- declares DetailedArguments interface with argv, error, aliases, newAliases, and configuration fields
- declares Arguments interface on DetailedArguments.argv with positional array _, end-of-options array --, and string index signature
- declares Configuration interface on DetailedArguments.configuration with all boolean and string parser flags
- declares Options parameter interface supporting alias map and partial Configuration for detailed calls
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 yargsParser.detailed in pkg:npm/%40types/yargs-parser@21.0.3
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/yargs-parser@21.0.3
Demonstrate these symbols/APIs:
- yargsParser.detailed
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:71a5c6709df1a04375e8d4979aaa5dbe385aad4c848797f979ea6bece4432628","contract":["declares detailed method signature on Parser interface taking string or string array argv and optional Options returning DetailedArguments","declares DetailedArguments interface with argv, error, aliases, newAliases, and configuration fields","declares Arguments interface on DetailedArguments.argv with positional array _, end-of-options array --, and string index signature","declares Configuration interface on DetailedArguments.configuration with all boolean and string parser flags","declares Options parameter interface supporting alias map and partial Configuration for detailed calls"],"goal":"verify yargsParser.detailed in pkg:npm/%40types/yargs-parser@21.0.3","kind":"HOW","packages":["pkg:npm/%40types/yargs-parser@21.0.3"],"schemaVersion":1,"symbols":["yargsParser.detailed"]},"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/yargs-parser@21.0.3"],"schemaVersion":1,"subject":"pkg:npm/%40types/yargs-parser@21.0.3","symbols":["yargsParser.detailed"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-yargs-parser-detailed",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-yargs-parser-detailed",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/yargs-parser": "21.0.3"
}
},
"node_modules/@types/yargs-parser": {
"version": "21.0.3",
"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz",
"integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==",
"license": "MIT"
}
}
}
{
"name": "sample-yargs-parser-detailed",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@types/yargs-parser": "21.0.3"
}
}
{
"schemaVersion": 1,
"goal": "verify yargsParser.detailed in pkg:npm/%40types/yargs-parser@21.0.3",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/yargs-parser@21.0.3"
],
"symbols": [
"yargsParser.detailed"
]
}
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);
const pkgPath = require.resolve('@types/yargs-parser/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, '@types/yargs-parser', 'Package name must be @types/yargs-parser');
assert.equal(pkg.version, '21.0.3', 'Package version must be 21.0.3');
const typesDir = path.dirname(pkgPath);
const indexDts = fs.readFileSync(path.join(typesDir, 'index.d.ts'), 'utf8');
// 1. declares detailed method signature on Parser interface taking string or string array argv and optional Options returning DetailedArguments
assert.ok(
indexDts.includes('detailed(argv: string | string[], opts?: Options): DetailedArguments;'),
'Parser interface must declare detailed method taking string | string[] argv and optional Options returning DetailedArguments'
);
// 2. declares DetailedArguments interface with argv, error, aliases, newAliases, and configuration fields
assert.ok(
indexDts.includes('interface DetailedArguments {') &&
indexDts.includes('argv: Arguments;') &&
indexDts.includes('error: Error | null;') &&
indexDts.includes('aliases: { [alias: string]: string[] };') &&
indexDts.includes('newAliases: { [alias: string]: boolean };') &&
indexDts.includes('configuration: Configuration;'),
'DetailedArguments interface must declare argv, error, aliases, newAliases, and configuration properties'
);
// 3. declares Arguments interface on DetailedArguments.argv with positional array _, end-of-options array --, and string index signature
assert.ok(
indexDts.includes('interface Arguments {') &&
indexDts.includes('_: Array<string | number>;') &&
indexDts.includes('"--"?: Array<string | number>;') &&
indexDts.includes('[argName: string]: any;'),
'Arguments interface on DetailedArguments.argv must declare _, --, and index signature'
);
// 4. declares Configuration interface on DetailedArguments.configuration with all boolean and string parser flags
assert.ok(
indexDts.includes('interface Configuration {') &&
indexDts.includes('"boolean-negation": boolean;') &&
indexDts.includes('"camel-case-expansion": boolean;') &&
indexDts.includes('"combine-arrays": boolean;') &&
indexDts.includes('"dot-notation": boolean;') &&
indexDts.includes('"duplicate-arguments-array": boolean;') &&
indexDts.includes('"flatten-duplicate-arrays": boolean;') &&
indexDts.includes('"greedy-arrays": boolean;') &&
indexDts.includes('"nargs-eats-options": boolean;') &&
indexDts.includes('"halt-at-non-option": boolean;') &&
indexDts.includes('"negation-prefix": string;') &&
indexDts.includes('"parse-numbers": boolean;') &&
indexDts.includes('"parse-positional-numbers": boolean;') &&
indexDts.includes('"populate--": boolean;') &&
indexDts.includes('"set-placeholder-key": boolean;') &&
indexDts.includes('"short-option-groups": boolean;') &&
indexDts.includes('"strip-aliased": boolean;') &&
indexDts.includes('"strip-dashed": boolean;') &&
indexDts.includes('"unknown-options-as-args": boolean;'),
'Configuration interface must declare all boolean and string parser configuration options'
);
// 5. declares Options parameter interface supporting alias map and partial Configuration for detailed calls
assert.ok(
indexDts.includes('interface Options {') &&
indexDts.includes('alias?: { [key: string]: string | string[] } | undefined;') &&
indexDts.includes('configuration?: Partial<Configuration> | undefined;'),
'Options interface must support alias map and partial Configuration options'
);
console.log('Contract for yargsParser.detailed passed successfully.');
Seeder de origem
anônimo