サンプル
@types/graceful-fs 4.1.9: gracefulify
検証済みサンプル — npm @types/graceful-fs 4.1.9: gracefulify. node 22 · linux alpine/x64 · docker で contract を実行し、成功しました: package manifest specifies index.d.ts type…
sha256:ddc319ace51338f86e9dc8d06c628e28997aea146942233e08d6ee0fc6e8e399
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux 24 · ubuntu · glibc 2.39 x64 npm
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| 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 |
ケース
HOW- ゴール
- verify pkg:npm/%40types/graceful-fs@4.1.9
- パッケージ
- シンボル
-
- gracefulify
- 作成日
- 2026-08-27T23:00:03Z
コントラクト
- package manifest specifies index.d.ts type declarations and TypeScript 4.5 minimum version
- declares node type dependency reference for Node.js fs module types
- re-exports all types and members from the fs module
- declares generic gracefulify function signature accepting and returning fsModule T
- documents gracefulify JSDoc annotations and parameter description
ファイル
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
ソース
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/graceful-fs@4.1.9
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/graceful-fs@4.1.9
Demonstrate these symbols/APIs:
- gracefulify
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:1eeee5e7b804650b00bd69ef75c57b2efee5f58c7f97912ec792f35eb8b4659b","contract":["package manifest specifies index.d.ts type declarations and TypeScript 4.5 minimum version","declares node type dependency reference for Node.js fs module types","re-exports all types and members from the fs module","declares generic gracefulify function signature accepting and returning fsModule T","documents gracefulify JSDoc annotations and parameter description"],"goal":"verify pkg:npm/%40types/graceful-fs@4.1.9","kind":"HOW","packages":["pkg:npm/%40types/graceful-fs@4.1.9"],"schemaVersion":1,"symbols":["gracefulify"]},"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/graceful-fs@4.1.9"],"schemaVersion":1,"subject":"pkg:npm/%40types/graceful-fs@4.1.9","symbols":["gracefulify"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-graceful-fs",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-graceful-fs",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/graceful-fs": "4.1.9"
}
},
"node_modules/@types/graceful-fs": {
"version": "4.1.9",
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz",
"integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==",
"license": "MIT",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/node": {
"version": "26.4.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.4.0.tgz",
"integrity": "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ==",
"license": "MIT",
"dependencies": {
"undici-types": "~8.3.0"
}
},
"node_modules/undici-types": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
"integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
"license": "MIT"
}
}
}
{
"name": "sample-types-graceful-fs",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@types/graceful-fs": "4.1.9"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40types/graceful-fs@4.1.9",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/graceful-fs@4.1.9"
],
"symbols": [
"gracefulify"
]
}
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/graceful-fs package manifest and verify type declaration entry points
const pkgPath = require.resolve('@types/graceful-fs/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, '@types/graceful-fs', 'Package name must be @types/graceful-fs');
assert.equal(pkg.version, '4.1.9', 'Package version must be 4.1.9');
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');
assert.ok(pkg.dependencies && pkg.dependencies['@types/node'], 'Package must declare dependency on @types/node');
const typesDir = path.dirname(pkgPath);
const dtsContent = fs.readFileSync(path.join(typesDir, 'index.d.ts'), 'utf8');
// 2. Verify triple-slash reference to node types
assert.ok(
dtsContent.includes('/// <reference types="node" />'),
'index.d.ts must reference node types'
);
// 3. Verify re-export of fs module members
assert.ok(
dtsContent.includes('export * from "fs";'),
'index.d.ts must re-export all members from fs'
);
// 4. Verify generic gracefulify function declaration
assert.ok(
dtsContent.includes('export function gracefulify<T>(fsModule: T): T;'),
'index.d.ts must declare generic gracefulify<T>(fsModule: T): T'
);
// 5. Verify JSDoc documentation annotations for gracefulify
assert.ok(
dtsContent.includes('Use this method to patch the global fs module (or any other fs-like module).'),
'index.d.ts must include JSDoc explanation for gracefulify'
);
assert.ok(
dtsContent.includes('@param fsModule The reference to the fs module or an fs-like module.'),
'index.d.ts must document the fsModule parameter'
);
console.log('Contract tests passed successfully.');
オリジンシーダー
匿名