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

token-cascade

v0.2.1

Published

SigRank product facade over TTEOP canonical semantics — delegates metric computation to tteop-spec, adds SigRank aliases (SNR, 10xDEV), RS05 class taxonomy, operator signatures, and field ranking.

Readme

@sigrank/cascade

SigRank product facade over TTEOP canonical semantics. Pure functions only — no filesystem, no API, no auth, no transport.

Canonical TTEOP metric computation (Yield, Leverage, Velocity, output_fraction, log_leverage) is delegated to tteop-spec, the executable/reference implementation of the TTEOP protocol. This package preserves SigRank-facing aliases (SNR, 10xDEV), the 24-stage RS05 class taxonomy, operator signatures, and field ranking — all product extensions that do not redefine TTEOP semantics.

Authority chain

TTEOP (protocol specification)
  → [email protected] (canonical executable/reference semantics)
    → @sigrank/cascade (this package — SigRank product facade)
      → sigrank-mcp (product tooling)

This package owns:

  • SNR (display alias for TTEOP output_fraction) = output / (input + output)
  • 10xDEV (display alias for TTEOP log_leverage) = log10(cacheRead / input)
  • RS05 24-stage class taxonomy (product extension, not TTEOP)
  • Operator signatures, field ranking, percentile/rank helpers (product extensions)

Canonical TTEOP metrics (Υ Yield, Leverage, Velocity) and all null semantics, rounding (banker's rounding per SRP-METRIC-002), and edge-case behavior are owned by tteop-spec and delegated through this package.

Install

npm install @sigrank/cascade
# or
bun add @sigrank/cascade

Usage

cascade(input, output, cacheCreate, cacheRead)

Compute the full cascade from 4 token pillars. cacheCreate and cacheRead accept null for unavailable cache telemetry — null is passed through to tteop-spec so canonical null semantics apply directly (affected metrics are null, not 0). Passing 0 produces 0-valued metrics (e.g. leverage = 0/input = 0), preserving the null/zero distinction.

import { cascade } from "@sigrank/cascade";

const c = cascade(1_251_211, 11_296_121, 128_196_310, 2_555_179_769);

console.log(c.yield);     // 18436.98
console.log(c.leverage);  // 2042.2
console.log(c.velocity);  // 9.028
console.log(c.snr);       // 0.9003
console.log(c.dev10x);    // 3.31
console.log(c.class);     // "REFINER I"

// null cache = unavailable → metrics are null
const partial = cascade(1000, 5000, null, null);
console.log(partial.yield);     // null
console.log(partial.leverage);  // null
console.log(partial.dev10x);    // null
console.log(partial.velocity);  // 5
console.log(partial.snr);       // 0.8333

classify(totalTokens)

Classify an operator by total token volume into one of 24 RS05 stages.

import { classify } from "@sigrank/cascade";

classify(2_694_000_000);  // "BEARER I"
classify(0);              // "IGNITER III"

round(n, d)

Round to d decimal places using banker's rounding (round-half-to-even), delegated to tteop-spec's canonical roundHalfToEven (SRP-METRIC-002). Returns null for non-finite inputs.

import { round } from "@sigrank/cascade";

round(3.14159, 2);  // 3.14
round(Infinity, 2); // null

fieldStats(yields, leverages?, velocities?, snrs?)

Compute field statistics from an array of yields. Returns null if fewer than 5 data points.

import { fieldStats } from "@sigrank/cascade";

const stats = fieldStats([100, 200, 300, 400, 500, 600, 1000]);
// { count: 7, median_yield: 400, top_10_percent_yield: 1000, ... }

percentileOf(value, field)

Percentage of field values below the given value.

import { percentileOf } from "@sigrank/cascade";

percentileOf(900, [100, 200, 300, 400, 500, 600, 1000]); // 85.7

rankOf(value, field)

Rank of a value against a field (1 = best/highest).

import { rankOf } from "@sigrank/cascade";

rankOf(900, [100, 200, 300, 400, 500, 600, 1000]); // 2

operatorSignature(cascadeResult)

Generate a compact operating signature from cascade metrics.

import { cascade, operatorSignature } from "@sigrank/cascade";

const c = cascade(1_251_211, 11_296_121, 128_196_310, 2_555_179_769);
const sig = operatorSignature(c);
// { code: "L2042-V9.03-S0.90-C11.34", archetype: "BALANCED_ELITE", dominant_trait: "combined reuse + throughput" }

evaluateOperator(pillars, options?)

Build a full OperatorEvaluation from pillars, optionally with field data for benchmarking.

import { evaluateOperator } from "@sigrank/cascade";

const eval = evaluateOperator(
  { input: 1_251_211, output: 11_296_121, cache_read: 2_555_179_769, cache_write: 128_196_310 },
  {
    codename: "MOSES",
    fieldYields: [1000, 2000, 3000, 4000, 5000, 18436.98],
  }
);

Exports

| Export | Type | |--------|------| | cascade() | function | | classify() | function | | round() | function | | fieldStats() | function | | percentileOf() | function | | rankOf() | function | | operatorSignature() | function | | evaluateOperator() | function | | RS05_CLASS_THRESHOLDS | constant | | CascadeResult | interface | | OperatorEvaluation | interface | | FieldStats | interface | | ClassThreshold | interface |

Canonical reference

MO§ES Υ 18436.98 from (1251211, 11296121, 128196310, 2555179769).

License

UNLICENSED