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

@zanii/constitution

v0.1.0

Published

Machine-checkable behavioral constraints as signed policy - publish an agent's rules (forbid / require_approval / allow over scope patterns), stamp the constitution hash on every receipt via the existing manifest_hash field, then PROVE each action was gov

Readme

@zanii/constitution

Machine-checkable behavioral constraints as signed policy. The walls packages (fta, walls) each hard-code one vertical's rules; this is the framework: publish the agent's rules as a signed document, then prove every action was evaluated against them — and prove they didn't change mid-process.

The mechanism reuses what already exists (zero server changes): a constitution's canonical hash IS the manifest_hash an agent stamps on its receipts.

npm install @zanii/constitution @zanii/core
import { createConstitution, constitutionHash, evaluate, verifyGovernance, governanceTrail } from '@zanii/constitution';

const c = createConstitution({
  issuer: owner.did,
  name: 'support-agent-rules',
  rules: [                                              // FIRST MATCH WINS
    { id: 'no-payments',   effect: 'forbid',           targets: ['payments.*'] },
    { id: 'gate-outbound', effect: 'require_approval', targets: ['email.send', 'sms.*'] },
    { id: 'crm-ok',        effect: 'allow',            targets: ['crm.*'] },
  ],
  defaultEffect: 'allow',                               // 'forbid' = deny-by-default (strict form)
  createdAt: now,
}, ownerKey);

// at act time: evaluate + stamp the hash on every receipt
evaluate(c, 'payments.transfer');                       // { effect: 'forbid', rule: {...} }
await zanii.record({ target, payload, provenance: { manifestHash: constitutionHash(c) } });

// at audit time: the deterministic governance verdict
const report = verifyGovernance(c, receipts);
report.violations;          // 'forbidden' (stamped AND hit a forbid rule — self-incriminating)
                            // 'ungoverned' (missing/foreign stamp — visible, not silently fine)
report.approvals_required;  // demand the owner-signed confirmations for these

governanceTrail(receipts);  // which rulebooks governed the stream; interleaving = red flag

Python: from zanii.constitution import create_constitution, verify_governance, governance_trail, ... — byte-identical JCS objects and hashes.

Why this closes the loop

  1. Prove the rules — issuer-signed, content-addressed: change one rule and every subsequent receipt visibly points at a different rulebook.
  2. Prove they were followed — a stamped receipt whose target hits a forbid rule is a provable violation the agent recorded itself.
  3. Prove they heldgovernanceTrail flags interleaved rulebooks (A,B,A): the same red flag @zanii/gov raises when a state algorithm's rules change mid-process.

The limit, stated up front

The stamp proves an action was recorded as governed — act-time enforcement is @zanii/runtime/@zanii/policy's job, and require_approval verification (matching owner-signed confirmations) stays with the runtime; we report which actions required approval so the auditor can demand the confirmations. An agent holding raw credentials can still act off the rails entirely — credential custody, unchanged. A constitution binds only when the verifier demands the stamp.