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

@vorionsys/basis-scorer

v0.1.0

Published

BASIS reference scorer — deterministic evidence→score→tier with fail-closed effectiveTier = min(claimed, recomputed, observation ceiling, policy ceiling), the frozen CAR-5⇄T0–T7 projection, and golden vectors. Built on @vorionsys/basis-spec.

Downloads

64

Readme

@vorionsys/basis-scorer

The BASIS reference scorer — a deterministic evidence → score → tier function with a fail-closed authority binding. Built entirely on the canonical constants in @vorionsys/basis-spec.

This is the Stage-3 reference function that lets a trust tier stop being a bare client input. A relying party recomputes the tier locally and binds the lower of the claim and its own recomputation:

effectiveTier = verified
  ? min( claimed, recomputed, observationCeiling, localPolicyCeiling )
  : T0          // unverified / unmappable / unknown-observation → least privilege

Why

Historically the gate only checked claimedTier >= minimumTier, trusting a client-supplied tier — fail-open. This package makes the tier a computed output: pure integer/rational arithmetic over the canonical 8-tier / 16-factor lattice, so any party recomputes a byte-identical result and a divergence between claimed and recomputed makes the lower value bind.

Install

npm install @vorionsys/basis-scorer @vorionsys/basis-spec

Use

import { scoreTrust } from '@vorionsys/basis-scorer';

const result = scoreTrust({
  factorScores: { 'CT-COMP': 0.9, 'CT-REL': 0.8, /* … of the 16 canonical factors */ },
  observation: 'WHITE_BOX',   // observation tier → score ceiling + max reachable tier
  claimedTier: 'T6',          // optional client claim — coerced + min'd in
  verified: true,             // was the proof chain log-verified + re-derived?
});

result.compositeScore;          // mean over ALL 16 factors (missing → 0) × 1000
result.adjustedScore;           // min(composite, observation ceiling)
result.recomputedTier;          // tierFromScore(adjustedScore), e.g. 'T6'
result.effective.effectiveTier; // 'T6' — min(claimed, recomputed, ceiling, policy)
result.effective.binding;       // which term bound (or 'unverified' / 'unknown-observation')

Low-level pieces are exported too: effectiveTier, toT, the frozen CAR_TO_T / T_TO_CAR projection, OBS_MAXTIER (derived from canonical OBSERVATION_TIERS — no drift), and computeCompositeScore.

Design rules (faithful to TIER_RECONCILIATION)

  • No inflation. The composite averages over all 16 canonical factors (a missing factor is 0), so you cannot raise your tier by omitting a weak one. (@vorionsys/contracts currently averages over provided factors — a gap this reference function deliberately closes.)
  • Fail closed. Unverified, unmappable, or unknown-observation inputs → T0, never the claim.
  • Honest observation ceiling. TEE verifiers are stubs today, so attested-execution claims cap at WHITE_BOX (T6) until a real quote verifier lands. OBS_MAXTIER is derived from the spec.
  • Frozen projection. The legacy CAR-5 ⇄ T0–T7 table is frozen; coarsening (T→CAR→T) always rounds down — the safe direction for min().

Golden vectors

@vorionsys/basis-scorer/golden-vectors exports the canonical input→output pairs (CAR_PROJECTION_VECTORS, EFFECTIVE_TIER_VECTORS, COMPOSITE_VECTORS) so a downstream conformance suite can assert its build reproduces them. The test suite encodes the 11 tier-reconcile checks (no-drift, projection, fail-closed effectiveTier) plus determinism.

npm test        # vitest

License

Apache-2.0 — Copyright 2024-2026 Vorion LLC.