Exemplo
@eslint/plugin-kit 0.7.3: CallMethodStep
Amostra verificada para npm @eslint/plugin-kit 0.7.3: CallMethodStep. O contrato rodou em node 22 · linux debian/x64 · docker e passou.
sha256:86224d5c28b14ac2c88baa8572109b67f38acf34be1dd71375d2e7040dd6cf1f
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 debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-09-05 |
Caso
HOW- Objetivo
- verify CallMethodStep in pkg:npm/%40eslint/plugin-kit@0.7.3
- Pacotes
- Símbolos
-
- CallMethodStep
- Criado
- 2026-09-05T16:39:44Z
Contrato
- instantiates CallMethodStep with target method name and arguments array
- exposes readonly type property set to 'call' and numeric kind property set to 2
- preserves target method identifier and argument array references
- dispatches rule listener method invocation with provided arguments during traversal
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 CallMethodStep in pkg:npm/%40eslint/plugin-kit@0.7.3
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40eslint/plugin-kit@0.7.3
Demonstrate these symbols/APIs:
- CallMethodStep
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:d1e45c062a023041362a48a1b0f1fa79358d352745a265e14aeef2493724f38f","contract":["instantiates CallMethodStep with target method name and arguments array","exposes readonly type property set to 'call' and numeric kind property set to 2","preserves target method identifier and argument array references","dispatches rule listener method invocation with provided arguments during traversal"],"goal":"verify CallMethodStep in pkg:npm/%40eslint/plugin-kit@0.7.3","kind":"HOW","packages":["pkg:npm/%40eslint/plugin-kit@0.7.3"],"schemaVersion":1,"symbols":["CallMethodStep"]},"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/%40eslint/plugin-kit@0.7.3"],"schemaVersion":1,"subject":"pkg:npm/%40eslint/plugin-kit@0.7.3","symbols":["CallMethodStep"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-eslint-plugin-kit-call-method-step",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-eslint-plugin-kit-call-method-step",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@eslint/plugin-kit": "0.7.3"
}
},
"node_modules/@eslint/core": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz",
"integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==",
"license": "Apache-2.0",
"dependencies": {
"@types/json-schema": "^7.0.15"
},
"engines": {
"node": "^20.19.0 || ^22.13.0 || >=24"
}
},
"node_modules/@eslint/plugin-kit": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.3.tgz",
"integrity": "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==",
"license": "Apache-2.0",
"dependencies": {
"@eslint/core": "^1.2.1",
"levn": "^0.4.1"
},
"engines": {
"node": "^20.19.0 || ^22.13.0 || >=24"
}
},
"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"
},
"node_modules/levn": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
"integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
"license": "MIT",
"dependencies": {
"prelude-ls": "^1.2.1",
"type-check": "~0.4.0"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
"license": "MIT",
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
"integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
"license": "MIT",
"dependencies": {
"prelude-ls": "^1.2.1"
},
"engines": {
"node": ">= 0.8.0"
}
}
}
}
{
"name": "sample-eslint-plugin-kit-call-method-step",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@eslint/plugin-kit": "0.7.3"
}
}
{
"schemaVersion": 1,
"goal": "verify CallMethodStep in pkg:npm/%40eslint/plugin-kit@0.7.3",
"kind": "HOW",
"packages": [
"pkg:npm/%40eslint/plugin-kit@0.7.3"
],
"symbols": [
"CallMethodStep"
]
}
import assert from "node:assert/strict";
import { CallMethodStep } from "@eslint/plugin-kit";
// 1. instantiates CallMethodStep with target method name and arguments array
const mockNode = { type: "Identifier", name: "foo" };
const mockContext = { id: "rule-1" };
const step1 = new CallMethodStep({
target: "onCodePathStart",
args: [mockNode, mockContext],
});
assert.ok(step1 instanceof CallMethodStep, "step1 must be an instance of CallMethodStep");
// 2. exposes readonly type property set to 'call' and numeric kind property set to 2
assert.equal(step1.type, "call", "step1.type must be 'call'");
assert.equal(step1.kind, 2, "step1.kind must be numeric 2");
// 3. preserves target method identifier and argument array references
assert.equal(step1.target, "onCodePathStart", "step1.target must match input target");
assert.equal(step1.args.length, 2, "step1.args length must be 2");
assert.equal(step1.args[0], mockNode, "step1.args[0] must preserve node reference");
assert.equal(step1.args[1], mockContext, "step1.args[1] must preserve context reference");
const stepEmpty = new CallMethodStep({
target: "onCodePathEnd",
args: [],
});
assert.equal(stepEmpty.target, "onCodePathEnd");
assert.deepEqual(stepEmpty.args, []);
// 4. dispatches rule listener method invocation with provided arguments during traversal
const calls = [];
const ruleVisitor = {
onCodePathStart(...args) {
calls.push({ method: "onCodePathStart", args });
},
onCodePathEnd(...args) {
calls.push({ method: "onCodePathEnd", args });
},
};
const steps = [
new CallMethodStep({ target: "onCodePathStart", args: ["path-1", { state: "entry" }] }),
new CallMethodStep({ target: "onCodePathEnd", args: ["path-1", { state: "exit" }] }),
];
for (const step of steps) {
assert.equal(step.type, "call");
assert.equal(step.kind, 2);
if (typeof ruleVisitor[step.target] === "function") {
ruleVisitor[step.target](...step.args);
}
}
assert.equal(calls.length, 2, "visitor must have recorded 2 method calls");
assert.deepEqual(calls[0], {
method: "onCodePathStart",
args: ["path-1", { state: "entry" }],
});
assert.deepEqual(calls[1], {
method: "onCodePathEnd",
args: ["path-1", { state: "exit" }],
});
console.log("CallMethodStep contract tests passed successfully.");
Seeder de origem
anônimo