サンプル
@types/istanbul-reports 3.0.4
検証済みサンプル — npm @types/istanbul-reports 3.0.4. node 22 · linux alpine/x64 · docker で contract を実行し、成功しました: package manifest specifies index.d.ts type…
sha256:1968b6ae1ba0f12c93cab948232161f0f71309cf893136b646a490b6c9e59058
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-21 |
ケース
HOW- ゴール
- verify pkg:npm/%40types/istanbul-reports@3.0.4
- 環境
- node 22.23.2
- 作成日
- 2026-08-21T05:37:19Z
コントラクト
- package manifest specifies index.d.ts type declarations and TypeScript version
- declares create factory function returning ReportBase for each ReportType
- declares ReportOptions interface and ReportType type alias for all standard report formats
- declares FileOptions, ProjectOptions, CloverOptions, CoberturaOptions, HtmlOptions, HtmlSpaOptions, and TeamcityOptions interfaces
- declares LinkMapper interface for navigating report node paths and assets
ファイル
- 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/istanbul-reports@3.0.4
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/istanbul-reports@3.0.4
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:817bfba812c1d55ed07e3aed28632082fa13d7edc9e2c4cea5e1c161ff90936e","constraints":{"executionContext":"node"},"contract":["package manifest specifies index.d.ts type declarations and TypeScript version","declares create factory function returning ReportBase for each ReportType","declares ReportOptions interface and ReportType type alias for all standard report formats","declares FileOptions, ProjectOptions, CloverOptions, CoberturaOptions, HtmlOptions, HtmlSpaOptions, and TeamcityOptions interfaces","declares LinkMapper interface for navigating report node paths and assets"],"goal":"verify pkg:npm/%40types/istanbul-reports@3.0.4","kind":"HOW","packages":["pkg:npm/%40types/istanbul-reports@3.0.4"],"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/%40types/istanbul-reports@3.0.4"],"schemaVersion":1,"subject":"pkg:npm/%40types/istanbul-reports@3.0.4","verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-istanbul-reports",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-istanbul-reports",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/istanbul-reports": "3.0.4"
}
},
"node_modules/@types/istanbul-lib-coverage": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz",
"integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==",
"license": "MIT"
},
"node_modules/@types/istanbul-lib-report": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz",
"integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==",
"license": "MIT",
"dependencies": {
"@types/istanbul-lib-coverage": "*"
}
},
"node_modules/@types/istanbul-reports": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz",
"integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==",
"license": "MIT",
"dependencies": {
"@types/istanbul-lib-report": "*"
}
}
}
}
{
"name": "sample-types-istanbul-reports",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@types/istanbul-reports": "3.0.4"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40types/istanbul-reports@3.0.4",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/istanbul-reports@3.0.4"
],
"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';
import fs from 'node:fs';
import path from 'node:path';
const require = createRequire(import.meta.url);
// 1. Resolve @types/istanbul-reports package manifest and verify type declaration entry points
const pkgPath = require.resolve('@types/istanbul-reports/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, '@types/istanbul-reports', 'Package name must be @types/istanbul-reports');
assert.equal(pkg.version, '3.0.4', 'Package version must be 3.0.4');
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/istanbul-lib-report'],
'Package must declare dependency on @types/istanbul-lib-report'
);
const typesDir = path.dirname(pkgPath);
const dtsContent = fs.readFileSync(path.join(typesDir, 'index.d.ts'), 'utf8');
// 2. Verify imported types from istanbul-lib-report and create factory function
assert.ok(
dtsContent.includes('import { Node, ReportBase } from "istanbul-lib-report";'),
'Must import Node and ReportBase from istanbul-lib-report'
);
assert.ok(
dtsContent.includes('export function create<T extends keyof ReportOptions>(name: T, options?: Partial<ReportOptions[T]>): ReportBase;'),
'create factory function must accept report name and optional partial options, returning ReportBase'
);
// 3. Verify ReportOptions interface and ReportType type alias
assert.ok(
dtsContent.includes('export interface ReportOptions {') &&
dtsContent.includes('clover: CloverOptions;') &&
dtsContent.includes('cobertura: CoberturaOptions;') &&
dtsContent.includes('"html-spa": HtmlSpaOptions;') &&
dtsContent.includes('html: HtmlOptions;') &&
dtsContent.includes('json: JsonOptions;') &&
dtsContent.includes('"json-summary": JsonSummaryOptions;') &&
dtsContent.includes('lcov: LcovOptions;') &&
dtsContent.includes('lcovonly: LcovOnlyOptions;') &&
dtsContent.includes('none: never;') &&
dtsContent.includes('teamcity: TeamcityOptions;') &&
dtsContent.includes('text: TextOptions;') &&
dtsContent.includes('"text-lcov": TextLcovOptions;') &&
dtsContent.includes('"text-summary": TextSummaryOptions;'),
'ReportOptions interface must declare all standard istanbul report types'
);
assert.ok(
dtsContent.includes('export type ReportType = keyof ReportOptions;'),
'ReportType type alias must be keyof ReportOptions'
);
// 4. Verify base options and specific format option interfaces
assert.ok(
dtsContent.includes('export interface FileOptions {') &&
dtsContent.includes('file: string;'),
'FileOptions interface must declare file property'
);
assert.ok(
dtsContent.includes('export interface ProjectOptions {') &&
dtsContent.includes('projectRoot: string;'),
'ProjectOptions interface must declare projectRoot property'
);
assert.ok(
dtsContent.includes('export interface CloverOptions extends FileOptions, ProjectOptions {}') &&
dtsContent.includes('export interface CoberturaOptions extends FileOptions, ProjectOptions {}') &&
dtsContent.includes('export interface LcovOptions extends FileOptions, ProjectOptions {}') &&
dtsContent.includes('export interface LcovOnlyOptions extends FileOptions, ProjectOptions {}'),
'CloverOptions, CoberturaOptions, LcovOptions, and LcovOnlyOptions must extend FileOptions and ProjectOptions'
);
assert.ok(
dtsContent.includes('export interface HtmlOptions {') &&
dtsContent.includes('verbose: boolean;') &&
dtsContent.includes('skipEmpty: boolean;') &&
dtsContent.includes('subdir: string;') &&
dtsContent.includes('linkMapper: LinkMapper;'),
'HtmlOptions interface must declare verbose, skipEmpty, subdir, and linkMapper properties'
);
assert.ok(
dtsContent.includes('export interface HtmlSpaOptions extends HtmlOptions {') &&
dtsContent.includes('metricsToShow: Array<"lines" | "branches" | "functions" | "statements">;'),
'HtmlSpaOptions interface must extend HtmlOptions with metricsToShow array'
);
assert.ok(
dtsContent.includes('export type JsonOptions = FileOptions;') &&
dtsContent.includes('export type JsonSummaryOptions = FileOptions;') &&
dtsContent.includes('export type TextSummaryOptions = FileOptions;'),
'JsonOptions, JsonSummaryOptions, and TextSummaryOptions must alias FileOptions'
);
assert.ok(
dtsContent.includes('export type TextLcovOptions = ProjectOptions;'),
'TextLcovOptions must alias ProjectOptions'
);
assert.ok(
dtsContent.includes('export interface TeamcityOptions extends FileOptions {') &&
dtsContent.includes('blockName: string;'),
'TeamcityOptions interface must extend FileOptions with blockName property'
);
assert.ok(
dtsContent.includes('export interface TextOptions extends FileOptions {') &&
dtsContent.includes('maxCols: number;') &&
dtsContent.includes('skipEmpty: boolean;') &&
dtsContent.includes('skipFull: boolean;'),
'TextOptions interface must extend FileOptions with maxCols, skipEmpty, and skipFull properties'
);
// 5. Verify LinkMapper interface
assert.ok(
dtsContent.includes('export interface LinkMapper {') &&
dtsContent.includes('getPath(node: string | Node): string;') &&
dtsContent.includes('relativePath(source: string | Node, target: string | Node): string;') &&
dtsContent.includes('assetPath(node: Node, name: string): string;'),
'LinkMapper interface must declare getPath, relativePath, and assetPath methods'
);
console.log('Contract tests passed successfully.');
オリジンシーダー
匿名