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/measure

v4.0.0

Published

Pluggable relationship measurements for UVRN evidence

Readme

@uvrn/measure

Pluggable relationship measurements for UVRN evidence. This package implements the first-party agree, disagree, conflict, and potential modules over the Measurement contract exported by @uvrn/core.

Package provides: first-party measurement objects, MeasurementRegistry, defaultRegistry, and convenience re-exports of the core measurement types. Pure logic only: no storage, signer, network call, or provider default.

You provide: a claim, evidence sources, and optional measurement context such as thresholds or agreement history.

Install

npm install @uvrn/measure @uvrn/core

Or with pnpm:

pnpm add @uvrn/measure @uvrn/core

Measurements

  • Agree: emits agree when comparable sources converge at or above context.agreeThreshold (default 0.9), otherwise no-agreement. Fewer than two comparable sources emits insufficient-data.
  • Disagree: emits disagree when numeric spread exceeds context.divergenceThreshold (default 0.1), otherwise none. Pure numeric spread is never conflict. Fewer than two numeric values emits insufficient-data.
  • Conflict: emits conflict when two sources on the same field assert mutually exclusive categorical/boolean values or ranges separated by more than context.conflictRangeTolerance (default 0), otherwise none. Fewer than two categorical, boolean, or range assertions emits insufficient-data.
  • Potential: emits potential when at least context.minObservations (default 3) agreement observations are rising over the last context.windowSize (default 3) points but still below the agree threshold. Confidence is scaled by sample size and trend strength; thin history or a signal below context.confidenceFloor (default 0.25) emits insufficient-data so weak early signals are never overstated.

Every measurement emits insufficient-data per SPEC/uvrn-measurement-v1.md §4 when it cannot measure, with an explanation stating what was missing. UIs should render it as "Not enough evidence", never as agreement or as an error.

Context keys

| Key | Default | Used by | |---|---|---| | agreeThreshold | 0.9 | agree, potential | | divergenceThreshold | 0.1 | disagree | | conflictRangeTolerance | 0 | conflict | | minObservations | 3 | potential | | windowSize | 3 | potential | | history / agreementHistory | — | potential (scores 0..1, oldest first) | | confidenceFloor | 0.25 | potential |

Usage

import { defaultRegistry } from '@uvrn/measure';

const registry = defaultRegistry();

const results = registry.runAll({
  claim: 'Two sources report similar revenue.',
  sources: [
    { id: 'source-a', kind: 'numeric', value: 100, label: 'Source A' },
    { id: 'source-b', kind: 'numeric', value: 104, label: 'Source B' },
  ],
  context: {
    agreeThreshold: 0.9,
    divergenceThreshold: 0.1,
    history: [0.55, 0.62, 0.74],
  },
});

Custom measurements

Core owns the interface; this package owns starter implementations. A host can add or replace measurement logic by implementing Measurement and registering it.

import { Measurement, MeasurementRegistry } from '@uvrn/measure';

const customMeasurement: Measurement = {
  type: 'custom',
  evaluate(input) {
    return {
      type: 'custom',
      verdict: input.sources.length > 0 ? 'observed' : 'none',
      confidence: input.sources.length > 0 ? 1 : 0,
      explanation: 'Custom measurement checked whether any evidence was present.',
      evidenceRefs: input.sources.map((source) => source.id),
    };
  },
};

const registry = new MeasurementRegistry();
registry.register(customMeasurement);

Package Boundary

@uvrn/measure depends only on the shared measurement contract from @uvrn/core. Hosts can adapt consensus, compare, drift, or other package outputs into measurement input before calling this package, but v1 ships no adapter-backed peer surface.

Links

Source code and issues: GitHub (uvrn-packages). Project landing: UVRN.