Sample
@types/istanbul-lib-report 3.0.3
Verified sample for npm @types/istanbul-lib-report 3.0.3. The contract ran on node 22 · linux alpine/x64 · docker and passed: package manifest specifies…
sha256:d0934fb9286004d01e582eefa81f8a280bf98dd76645a3fe8e7413909101feeb
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| 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 |
Case
HOW- Goal
- verify pkg:npm/%40types/istanbul-lib-report@3.0.3
- Packages
- Environment
- node 22.23.2
- Created
- 2026-08-21T05:34:55Z
Contract
- package manifest specifies index.d.ts type declarations and TypeScript version
- declares createContext, getDefaultWatermarks functions and ReportBase class
- declares Context and ContextOptions interfaces for reporting execution
- declares ContentWriter, FileContentWriter, ConsoleWriter, and FileWriter classes
- declares Tree, Node, ReportNode, and Visitor interfaces for coverage report tree traversal
Files
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
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/istanbul-lib-report@3.0.3
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/istanbul-lib-report@3.0.3
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:2b862de6396459d7fdd1fb3792bab298b1cca6543599f974fd98e828a38c98e5","constraints":{"executionContext":"node"},"contract":["package manifest specifies index.d.ts type declarations and TypeScript version","declares createContext, getDefaultWatermarks functions and ReportBase class","declares Context and ContextOptions interfaces for reporting execution","declares ContentWriter, FileContentWriter, ConsoleWriter, and FileWriter classes","declares Tree, Node, ReportNode, and Visitor interfaces for coverage report tree traversal"],"goal":"verify pkg:npm/%40types/istanbul-lib-report@3.0.3","kind":"HOW","packages":["pkg:npm/%40types/istanbul-lib-report@3.0.3"],"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-lib-report@3.0.3"],"schemaVersion":1,"subject":"pkg:npm/%40types/istanbul-lib-report@3.0.3","verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-istanbul-lib-report",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-istanbul-lib-report",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/istanbul-lib-report": "3.0.3"
}
},
"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": "*"
}
}
}
}
{
"name": "sample-types-istanbul-lib-report",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@types/istanbul-lib-report": "3.0.3"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40types/istanbul-lib-report@3.0.3",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/istanbul-lib-report@3.0.3"
],
"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-lib-report package manifest and verify type declaration entry points
const pkgPath = require.resolve('@types/istanbul-lib-report/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, '@types/istanbul-lib-report', 'Package name must be @types/istanbul-lib-report');
assert.equal(pkg.version, '3.0.3', 'Package version must be 3.0.3');
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');
const typesDir = path.dirname(pkgPath);
const dtsContent = fs.readFileSync(path.join(typesDir, 'index.d.ts'), 'utf8');
// 2. Verify createContext, getDefaultWatermarks functions and ReportBase class
assert.ok(
dtsContent.includes('export function createContext(options?: Partial<ContextOptions>): Context;'),
'createContext function must be declared'
);
assert.ok(
dtsContent.includes('export function getDefaultWatermarks(): Watermarks;'),
'getDefaultWatermarks function must be declared'
);
assert.ok(
dtsContent.includes('export class ReportBase {') &&
dtsContent.includes('constructor(options?: Partial<ReportBaseOptions>);') &&
dtsContent.includes('execute(context: Context): void;'),
'ReportBase class must declare constructor and execute methods'
);
// 3. Verify Context and ContextOptions interfaces for reporting execution
assert.ok(
dtsContent.includes('export interface ContextOptions {') &&
dtsContent.includes('coverageMap: CoverageMap;') &&
dtsContent.includes('defaultSummarizer: Summarizers;') &&
dtsContent.includes('dir: string;') &&
dtsContent.includes('watermarks: Partial<Watermarks>;') &&
dtsContent.includes('sourceFinder(filepath: string): string;'),
'ContextOptions interface must declare coverageMap, defaultSummarizer, dir, watermarks, and sourceFinder'
);
assert.ok(
dtsContent.includes('export interface Context {') &&
dtsContent.includes('data: any;') &&
dtsContent.includes('dir: string;') &&
dtsContent.includes('watermarks: Watermarks;') &&
dtsContent.includes('writer: FileWriter;') &&
dtsContent.includes('classForPercent(type: keyof Watermarks, value: number): string;') &&
dtsContent.includes('getSource(filepath: string): string;') &&
dtsContent.includes('getTree(summarizer?: Summarizers): Tree;') &&
dtsContent.includes('getVisitor<N extends Node = Node>(visitor: Partial<Visitor<N>>): Visitor<N>;') &&
dtsContent.includes('getWriter(): FileWriter;') &&
dtsContent.includes('getXmlWriter(contentWriter: ContentWriter): XmlWriter;'),
'Context interface must declare reporting methods and properties'
);
// 4. Verify ContentWriter, FileContentWriter, ConsoleWriter, and FileWriter classes
assert.ok(
dtsContent.includes('export class ContentWriter {') &&
dtsContent.includes('colorize(str: string, clazz?: string): string;') &&
dtsContent.includes('println(str: string): void;') &&
dtsContent.includes('close(): void;'),
'ContentWriter class must declare colorize, println, and close'
);
assert.ok(
dtsContent.includes('export class FileContentWriter extends ContentWriter {') &&
dtsContent.includes('constructor(fileDescriptor: number);') &&
dtsContent.includes('write(str: string): void;'),
'FileContentWriter class must extend ContentWriter'
);
assert.ok(
dtsContent.includes('export class ConsoleWriter extends ContentWriter {') &&
dtsContent.includes('write(str: string): void;'),
'ConsoleWriter class must extend ContentWriter'
);
assert.ok(
dtsContent.includes('export class FileWriter {') &&
dtsContent.includes('constructor(baseDir: string);') &&
dtsContent.includes('static startCapture(): void;') &&
dtsContent.includes('static stopCapture(): void;') &&
dtsContent.includes('static getOutput(): string;') &&
dtsContent.includes('static resetOutput(): void;') &&
dtsContent.includes('writeForDir(subdir: string): FileWriter;') &&
dtsContent.includes('copyFile(source: string, dest: string, header?: string): void;') &&
dtsContent.includes('writeFile(file: string | null): ContentWriter;'),
'FileWriter class must declare static capture methods and file writing methods'
);
// 5. Verify Tree, Node, ReportNode, and Visitor interfaces for coverage report tree traversal
assert.ok(
dtsContent.includes('export interface Node {') &&
dtsContent.includes('isRoot(): boolean;') &&
dtsContent.includes('visit(visitor: Visitor, state: any): void;'),
'Node interface must declare isRoot and visit'
);
assert.ok(
dtsContent.includes('export interface ReportNode extends Node {') &&
dtsContent.includes('path: string;') &&
dtsContent.includes('parent: ReportNode | null;') &&
dtsContent.includes('fileCoverage: FileCoverage;') &&
dtsContent.includes('children: ReportNode[];') &&
dtsContent.includes('addChild(child: ReportNode): void;') &&
dtsContent.includes('asRelative(p: string): string;') &&
dtsContent.includes('getQualifiedName(): string;') &&
dtsContent.includes('getRelativeName(): string;') &&
dtsContent.includes('getParent(): Node;') &&
dtsContent.includes('getChildren(): Node[];') &&
dtsContent.includes('isSummary(): boolean;') &&
dtsContent.includes('getFileCoverage(): FileCoverage;') &&
dtsContent.includes('getCoverageSummary(filesOnly: boolean): CoverageSummary;') &&
dtsContent.includes('visit(visitor: Visitor<ReportNode>, state: any): void;'),
'ReportNode interface must extend Node with report node traversal and summary methods'
);
assert.ok(
dtsContent.includes('export interface Visitor<N extends Node = Node> {') &&
dtsContent.includes('onStart(root: N, state: any): void;') &&
dtsContent.includes('onSummary(root: N, state: any): void;') &&
dtsContent.includes('onDetail(root: N, state: any): void;') &&
dtsContent.includes('onSummaryEnd(root: N, state: any): void;') &&
dtsContent.includes('onEnd(root: N, state: any): void;'),
'Visitor interface must declare traversal lifecycle callbacks'
);
assert.ok(
dtsContent.includes('export interface Tree<N extends Node = Node> {') &&
dtsContent.includes('getRoot(): N;') &&
dtsContent.includes('visit(visitor: Partial<Visitor<N>>, state: any): void;'),
'Tree interface must declare getRoot and visit methods'
);
console.log('Contract tests passed successfully.');
Origin Seeder
anonymous