npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@isl-lang/evidence-schema

v2.0.0

Published

Evidence schema with zod validation and stable canonical serialization for ISL verification reports

Readme

@isl-lang/evidence

Evidence schema with Zod validation and stable canonical serialization for ISL verification reports.

Installation

pnpm add @isl-lang/evidence

Features

  • Zod Validation: Runtime validation of evidence reports
  • TypeScript Types: Full type definitions for all evidence structures
  • Canonical Serialization: Deterministic JSON output for caching and hashing
  • Builder Helpers: Programmatic report construction

Usage

Validating Evidence Reports

import { validateEvidenceReport, safeValidateEvidenceReport } from '@isl-lang/evidence';

// Throws on invalid data
const report = validateEvidenceReport(jsonData);

// Returns result object
const result = safeValidateEvidenceReport(jsonData);
if (result.success) {
  console.log(result.data.verdict);
} else {
  console.error(result.error);
}

Serializing Reports

import { serialize, deserialize, computeHash } from '@isl-lang/evidence';

// Canonical JSON serialization (deterministic output)
const json = serialize(report);

// Compact serialization
const compact = serialize(report, { pretty: false });

// Compute content hash
const hash = await computeHash(report);

Building Reports Programmatically

import { 
  createReport, 
  createClause, 
  createEvidence,
  addClause,
  finalizeReport 
} from '@isl-lang/evidence';

// Create a new report
let report = createReport({
  contractName: 'UserAuthentication',
  contractFile: 'contracts/auth.isl',
  gitCommit: 'abc1234',
});

// Add clauses
const clause = createClause({
  id: 'auth-001',
  name: 'Valid credentials return token',
  status: 'PASS',
  durationMs: 50,
});

// Add evidence to clause
clause.evidence.push(createEvidence({
  type: 'assertion',
  description: 'Response contains valid JWT',
  location: {
    file: 'src/auth/login.ts',
    line: 42,
    snippet: 'return { token: jwt.sign(payload, secret) }',
  },
}));

// Add clause to report (updates summary and verdict)
report = addClause(report, clause);

// Or finalize manually
report = finalizeReport(report);

Comparing Reports

import { areEqual, diff, stripTimestamps } from '@isl-lang/evidence';

// Check equality (ignores property order)
const equal = areEqual(report1, report2);

// Get detailed diff
const changes = diff(before, after);
if (changes.verdictChanged) {
  console.log('Verdict changed!');
}

// Strip timestamps for snapshot testing
const stripped = stripTimestamps(report);

Schema Version

The current schema version is 1.0.0. Reports include a schemaVersion field for forward compatibility.

Types

Core Types

  • EvidenceReport - Complete verification report
  • ClauseResult - Individual clause verification result
  • EvidenceItem - Supporting evidence for a clause
  • Assumption - Documented assumption
  • OpenQuestion - Unresolved question
  • ReproCommand - Reproduction command

Enums

  • Verdict: 'SHIP' | 'NO_SHIP'
  • ClauseStatus: 'PASS' | 'PARTIAL' | 'FAIL'

API Reference

Validation

| Function | Description | |----------|-------------| | validateEvidenceReport(data) | Validate and parse data (throws on error) | | safeValidateEvidenceReport(data) | Validate and parse data (returns result object) | | validatePartialReport(data) | Validate partial report data |

Serialization

| Function | Description | |----------|-------------| | serialize(report, options?) | Serialize to canonical JSON | | deserialize(json) | Parse JSON to report | | computeHash(report) | Compute SHA-256 hash | | areEqual(a, b) | Compare reports for equality | | diff(before, after) | Compute differences between reports | | stripTimestamps(report) | Remove timestamps for testing |

Builder

| Function | Description | |----------|-------------| | createReport(options) | Create new empty report | | createClause(options) | Create clause result | | createEvidence(options) | Create evidence item | | addClause(report, clause) | Add clause and update summary | | addAssumption(report, assumption) | Add assumption | | addOpenQuestion(report, question) | Add open question | | addReproCommand(report, command) | Add reproduction command | | finalizeReport(report) | Compute summary and verdict |

License

MIT