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

@statecrafting/governance-native

v0.1.0

Published

The control plane's governance spine (canonical JSON, attest-ledger record chain, action gate, trust window) as a napi-rs native addon. AGPL-3.0: a control-plane internal, not substrate for stamped apps. Prebuilt per-platform binaries ship as optional dep

Readme

@statecrafting/governance-native

The control plane's governance spine as a napi-rs addon (statecrafting spec 005). It wraps four crates.io crates (extracted from OAP's policy-kernel, published under the statecrafting org) and exposes them to an Encore.ts governance/ service as plain-JSON-in / plain-JSON-out functions:

AGPL-3.0. This is a control-plane internal: no stamped customer app loads it, so it keeps statecraft's copyleft shield (statecrafting spec 001 §3). It must never be depended on by @statecrafting/toolchain, hiqlite-native, or kernel-native, which are Apache-2.0 substrate (spec 001 §3.2).

| crate | primitive | |---|---| | canonical-keysort-json | byte-identical canonical JSON | | attest-ledger | tamper-evident record chain + Ed25519 anchors | | action-gate | deterministic gate over an ordered check registry | | trust-window | rolling-window trust scorer |

Surface

canonicalize(json)                 -> { canonical, sha256 }
ledgerAppend(stateDir, record)     -> { seq, recordHash, chainHash }
ledgerVerify(stateDir)             -> { ok, seq, error? }
ledgerAnchor(stateDir, keyRef)     -> anchor JSON   (keyRef: base64 32-byte Ed25519 seed)
gateEvaluate(configJson, ctxJson)  -> { outcome, reason, checkIds, blocking, configHash }
trustSample(snapshotJson, sample)  -> snapshot JSON  (snapshotJson may be null)
trustLevel(snapshotJson)           -> { level, score }

The ledger file store (<stateDir>/records.jsonl + anchor.json, the seq counter, the genesis anchor) lives here: attest-ledger is storage-agnostic by design. The gate config schema and the four v1 checks (posture-required, confirm-name-required, tenant-active, actor-authenticated) live here too: action-gate ships the machinery, not the domain policy.

config/gate.v1.json is the canonical v1 roster, vendored here so the crate is self-contained. The consuming service keeps its own deployed copy; both are pinned to the same asserted config hash, so a drift in either fails a test.

Build & test

cargo test --no-default-features   # pure-logic tests, no Node C API linkage
npm install && npm run build       # build the per-platform .node (needs @napi-rs/cli)

The #[napi] bindings are behind the default node feature; cargo test turns it off so the test harness links without Node's symbols. All four governance crates are exact-pinned (=0.1.0) per statecraft spec 008 §1.