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

@habenula-ai/audit

v1.0.0

Published

Habenula audit-chain kernel — the SHA-256 entry hash, the canonical chain verifier, and the decision-closure check. Leaf package: no runtime dependencies.

Downloads

336

Readme

@habenula-ai/audit

The Habenula audit-chain kernel: the hash that makes the audit log tamper-evident, the verifier that checks it, and the closure check that reads whether a held decision was answered.

Install

Run this in your project directory, once per project:

npm i @habenula-ai/audit

computeEntryHash and GENESIS_SENTINEL build the SHA-256 hash chain. The engine's Durable Object calls computeEntryHash inside a transactionSync(), so each entry's hash covers the previous one atomically.

verifyChainRange(entries, options) → verdict is the canonical verifier. It is a pure function from a range of entries to a located verdict: it recomputes every hash and reports the oldest broken link it found, or reports the range as intact. It performs no I/O, makes no network calls, and logs nothing. habenula log verify runs this function over rows pulled from the engine, or over an exported dump file. The engine returns rows, never a verdict, so the party that wrote the log is not the party that judges it.

checkDecisionClosure(entries, options) → verdict reads the log's content rather than its integrity. It reports a decision that carries two or more closing answers as conflicted. That is a finding about what the log says, and it is distinct from a broken chain.

The same function verifies and writes. The engine and the CLI are built from one source tree, so "recompute with the function that wrote it" is a build fact rather than a promise.

It is a leaf package with no runtime dependencies: no engine imports, no Cloudflare bindings, no agents SDK. The engine consumes it as source (an exact-pinned workspace sibling, no build step) and owns everything environmental — the rows are persisted in the Durable Object's SQLite, and retention and archival are the engine's job.

hash.ts imports node:crypto for createHash. This is deliberate: the hash must be computed synchronously inside the Durable Object transaction, and Web Crypto's crypto.subtle.digest is async. nodejs_compat is enabled for this reason.

The chain format is documented, with test vectors, in audit-chain-format.md. A third party can write an independent verifier against that document without taking a dependency on this package.

Part of the Habenula OSS release. Licensed under the MIT License — permissive, unlike the AGPL v3 that covers the rest of the release. Verification is only worth something when the party checking a log is independent of the party that wrote it, so this package is licensed to let an auditor, a researcher, or a SIEM embed it in a codebase of their own.

The permissive license changes how you may use this code, not how the project takes changes. Contributions here follow the same model as the rest of the release, described in the repository's contributing guide.