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

@alef-prime/penalty-ledger

v0.1.0-alpha.0

Published

Append-only public ledger of self-imposed penalties for AI-driven projects. Stacks-by-key dedupe, time-based expiry, score-aware aggregation. The accountability layer ALEF wears in public.

Readme

@alef-prime/penalty-ledger

The accountability layer ALEF wears in public.

An append-only ledger for self-imposed penalties on AI-driven projects. Use it to compute a "reality coefficient" that drops when your engine fails publicly and recovers when penalties expire — visible to your users instead of hidden in a config.

import {
  parseLedger, activeRows, totalPenalty,
  dedupeByKey, adjustedCoeff, alreadyActive, toJsonl,
} from "@alef-prime/penalty-ledger";

// Read from disk (or DB)
const rows = parseLedger(await fs.readFile("./penalties.jsonl", "utf8"));

// Before appending a new penalty, check if one already active for this key:
if (!alreadyActive(rows, { source: "build-failed", directive: "v2.3" })) {
  await fs.appendFile("./penalties.jsonl", toJsonl({
    ts: new Date().toISOString(),
    amount: 0.1,
    reason: "build failed twice in a row",
    source: "build-failed",
    directive: "v2.3",
    expires_at: new Date(Date.now() + 3 * 24 * 3600 * 1000).toISOString(),
  }));
}

// Compute the public-facing score:
const coeff = adjustedCoeff(0.95 /* baseline accuracy */, rows);
//  → 0.85   (after one -0.1 active penalty)

Why this exists

ALEF-PRIME's reality_coeff hit 0.00 in May 2026. The Truth Arbiter said "brain dead." The actual bug: purpose_guard appended a fresh -0.1 row every round of growth-in-deficit, never deduping. Ten stacked copies of the same penalty made the coeff read zero — an artifact, not the truth.

The fix was dedupeByKey + alreadyActive. After applying both: 13 active rows → 4, coeff: 0.00 → 0.45. The lesson became this package.

API

| Function | Returns | Notes | |---|---|---| | parseLedger(text) | PenaltyRow[] | Parse newline-delimited JSON. | | activeRows(rows, now?) | PenaltyRow[] | Filter to rows still in their expiry window. | | totalPenalty(rows) | number | Sum of amount across active rows. | | dedupeByKey(rows) | PenaltyRow[] | Walk in order; per (source, directive) keep only the most recent. | | adjustedCoeff(baseline, rows) | number | max(0, min(1, baseline) − totalPenalty). | | alreadyActive(rows, key) | boolean | Use this BEFORE appending to avoid stacking. | | toJsonl(row) | string | Append-ready line. |

Recommended row shape

{
  ts: "2026-05-14T13:45:00Z",
  amount: 0.1,                     // how much to subtract from baseline
  reason: "shipped without test",  // human-readable, public
  source: "build-monitor",         // who decided to penalize
  directive: "v2.3",               // which mandate/round
  expires_at: "2026-05-17T00:00Z", // optional; permanent if absent
  red_lock: false,                 // optional UI signal: "lock the warning state"
}

Status: alpha · 0.1.0

Born from ALEF-PRIME's glass-box evolution. Sibling of @alef-prime/deploy-verify, @alef-prime/i18n-pick, @alef-prime/units. MIT.