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

@uvrn/delta-engine-core

v1.0.0

Published

UVRN Delta Engine — deterministic multi-source comparison engine with canonical hashing

Readme

@uvrn/delta-engine-core

Deterministic multi-source comparison engine with canonical hashing.

Compares data from multiple sources, computes per-metric deltas using the Δ formula, and produces a canonical, SHA-256 hash-verified DeltaReceipt.

Install

npm install @uvrn/delta-engine-core

Quick Start

import { runDeltaEngine } from '@uvrn/delta-engine-core';

const result = runDeltaEngine({
  bundleId: 'comparison-001',
  claim: 'Page views should match across providers',
  thresholdPct: 0.10, // 10% tolerance
  dataSpecs: [
    {
      id: 'ga4',
      label: 'Google Analytics 4',
      sourceKind: 'report',
      originDocIds: ['ga4-export-001'],
      metrics: [
        { key: 'pageviews', value: 10000 },
        { key: 'sessions', value: 5200 },
      ],
    },
    {
      id: 'plausible',
      label: 'Plausible Analytics',
      sourceKind: 'report',
      originDocIds: ['plausible-export-001'],
      metrics: [
        { key: 'pageviews', value: 10300 },
        { key: 'sessions', value: 5100 },
      ],
    },
  ],
});

console.log(result.outcome);    // 'consensus' or 'indeterminate'
console.log(result.deltaFinal); // Max delta across all metrics
console.log(result.hash);       // SHA-256 of canonical receipt

The Delta Formula

For each comparable metric across sources:

Δ = |a - b| / ((a + b) / 2)

Edge cases:

  • Both values zero → Δ = 0 (perfect agreement)
  • One value zero → Δ = 1.0 (maximum variance)

Convergence: If all metric deltas are ≤ thresholdPct, the outcome is consensus. Otherwise the engine runs up to maxRounds (default: 5) before returning indeterminate.

API

runDeltaEngine(bundle, opts?)

Runs the comparison engine on a DeltaBundle and returns a DeltaReceipt.

validateBundle(bundle)

Structural validation of a DeltaBundle. Returns { valid: boolean, error?: string }.

verifyDeltaReceipt(receipt)

Recomputes the hash of a DeltaReceipt and verifies it matches the stored hash.

canonicalSerialize(obj)

RFC 8785 (JCS) canonical serialization using json-canonicalize.

hashDeltaReceipt(payload)

SHA-256 hash of the canonical serialization of a receipt payload (excluding the hash field itself).

Types

| Type | Description | |---|---| | DeltaBundle | Input: bundleId, claim, dataSpecs, thresholdPct, maxRounds | | DeltaReceipt | Output: bundleId, deltaFinal, sources, rounds, outcome, hash | | DeltaRound | Per-round detail: deltasByMetric, withinThreshold | | DataSpec | Single data source: id, label, sourceKind, metrics | | MetricPoint | Key-value metric: key, value, optional unit and timestamp | | Outcome | 'consensus' \| 'indeterminate' | | EngineOpts | Optional engine configuration (e.g., inject timestamp) |

Build

npm run build     # ESM + CJS + DTS via tsup
npm run typecheck  # tsc --noEmit

UVRN Protocol · github.com/UVRN-org