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

@moonglade/provenance

v2.7.0

Published

Local-first cryptographic proof for markdown files and agentic AI memory substrates.

Readme

@moonglade/provenance 2.7.0

Ed25519 signatures, canonical file hashes, RFC 3161 timestamp checks and Merkle inclusion proofs for Node 22 and 24.

Installation

Install directly from npm:

npm install @moonglade/provenance

Or install globally for the CLI and MCP tools:

npm install -g @moonglade/provenance

Build from source

Run these commands from the repository root:

npm ci
npm test

Run the built-in self-test with provenance test (no file argument; add --json for a machine-readable report). It exits non-zero on any failure. Programmatic access: require("@moonglade/provenance/self-test") exposes runSelfTests and printSelfTestReport. The WASM core is available as require("@moonglade/provenance/wasm"). provenance install-hooks [--pre-commit] [--mcp-verify-read] [--mcp-auto-seal] [--force] installs only what you select (it asks per option in a terminal, and does nothing without flags otherwise). An existing pre-commit hook that this tool did not install is never overwritten: the command refuses, and with --force first copies it to <hook>.bak-<UTC timestamp>. A hook counts as ours only if its whole content equals a known hook generated by this tool (including an unmodified 2.6.1 hook, which updates cleanly in place); an edited copy of it, or any other hook that merely mentions the tool, is refused (and backed up under --force). An existing .provenance-hooks.json that is not in the tool's own shape is backed up before it is rewritten, and MCP choices recorded earlier are kept. The generated hook needs bash. It reads NUL-delimited staged names, so names with spaces or non-ASCII characters are verified, and it blocks the commit if the staged list cannot be read. --mcp-verify-read and --mcp-auto-seal only record your choice in .provenance-hooks.json (npx -y --package=@moonglade/provenance provenance-gate) and print an MCP configuration snippet; nothing in this package reads that file yet. The hooks directory is resolved by git rev-parse --git-path hooks, so linked worktrees and core.hooksPath work. A hook installed from one linked worktree applies to every worktree of that repository, because they share one hooks directory. If core.hooksPath points at a shared or global directory, the hook is written there and affects every repository that uses it; the command prints the path it wrote. Ending input (Ctrl-D) at a prompt cancels with a non-zero exit and changes nothing.

Upgrading from 2.6.x to 2.7.0

  1. Package namespace: Retained as canonical @moonglade/provenance.
  2. Scoped npx MCP binary selection: Because the default bin of @moonglade/provenance is provenance (dist/artifact-cli.js), always start the MCP server via npx -y --package=@moonglade/provenance provenance-gate rather than npx -y @moonglade/provenance provenance-gate.
  3. Hook upgrades: Unmodified 2.6.1 pre-commit hooks upgrade cleanly in place on provenance install-hooks --pre-commit without leaving backup files; customized hooks refuse cleanly unless --force is supplied.
  4. Protocol draft baseline: Documentation and v3 JCS specification references track docs/draft-ottley-agentic-epistemic-provenance-01-mg2.7.0.md.

WASM core provenance & boundaries

wasm/ is generated from the Rust crate mgc-wasm (with mgc-core) in the private Moonglade monorepo at frozen source commit 1188ed841b5831bc743e4f23ccd505a08b108ee7, using rustc 1.98.1, wasm-bindgen 0.2.129, and wasm-bindgen --target nodejs (no wasm-opt pass). In this staging snapshot, wasm/ hashes and bindings await local wasm-bindgen --target nodejs generation from that frozen source archive prior to final release publishing and TypeScript test execution.

In addition to canonicalization and claims JSON helpers, the 2.7.0 mgc-wasm target exports:

  • parse_openpgp_armored_signature_hex(armored_asc): structural extraction only for RFC 4880 ASCII-armored V4 public-key algorithm 22 (EdDSALegacy, RFC 9580) detached signature packets (<= 1024 decoded bytes); does NOT verify Ed25519 signatures or construct OpenPGP V4 hash trailers.
  • verify_rfc3161_timestamp(tsr_bytes, expected_digest): structural DER TimeStampResp and messageImprint comparator ({28, 32, 48, 64}-byte digests); does NOT verify CMS signatures, X.509 certificates, EKU, ESSCertID/ESSCertIDv2, or trust anchors, does NOT bind MessageImprint.hashAlgorithm OID to digest length, ignores non-TSTInfo trailing inner DER bytes, and in frozen 1188ed8 rejects tokens containing an optional TSTInfo.accuracy sequence with ERR_TSR_DER_UNEXPECTED_TAG. Always use top-level verifyTimeStampToken with trustAnchors (or ProvenanceEngine.verifyDocument with timestampTrustAnchors) for cryptographic TSA trust.

Sign and verify

const { ProvenanceEngine } = require('@moonglade/provenance');
// Supply your own Ed25519 keys. Never use the release root key for artifacts.
async function example(file, privateKey, publicKey, root) {
  await ProvenanceEngine.sealDocument(file, privateKey, 'example-signer', 'local', { vaultRoot: root });
  return ProvenanceEngine.verifyDocument(file, publicKey, {
    expectedScope: ProvenanceEngine.scopeFor(file, root),
    requiredSigners: ['example-signer']
  });
}

Get trusted public keys through a channel you trust. An editable sidecar cannot establish a signer's identity. A valid signature establishes possession of a key and integrity of the signed payload. It does not prove the content is correct, identify its actual author, or grant the signer authority.

Supply expectedScope to bind verification to an expected location or namespace. Use requiredSigners when particular signatures are required. The low-level verifier does not infer either policy.

Canonicalization

For text, the engine removes one leading UTF-8 BOM, converts CRLF to LF and applies Unicode NFC. Bare CR is preserved. Invalid UTF-8 is rejected.

Known binary formats keep their exact bytes. For unknown extensions, a NUL in the first 1024 bytes selects binary handling; otherwise the engine requires valid UTF-8 text. Text integrity follows these normalization rules rather than raw byte identity.

Verification results

SEALED requires a verified Ed25519 signature. With no key supplied (options.publicKeyPem omitted in getArtifactBadge), a matching recorded hash is shown in amber as HASH_ONLY (⚠️ [HASH-ONLY · UNVERIFIED]). The sidecar is editable, so HASH_ONLY and formatHtmlBadge outputs built without a trusted public key provide structural/digest display only — zero cryptographic signature assurance — and MUST NOT be used for access control or authorization decisions. Malformed sidecars cannot produce a seal.

Timestamp results are separate: ABSENT, INVALID, INTEGRITY_ONLY or ANCHORED. Time comes from the verified token, never an unsigned sidecar field. ANCHORED requires caller-supplied CA certificates, chain validation at token time, ESSCertIDv2 and a critical timestamp-only EKU. Certificate revocation is not checked. Without anchors, a valid self-signed TSA token can provide integrity-only evidence. Network or host-clock observations without tokens do not become RFC 3161 attestations.

CLI

The installed names are provenance, provenance-artifact and provenance-gate. The last starts the MCP server. CLI commands are:

provenance --help
provenance --version
provenance verify <file>
provenance badge <file>
provenance observe <file>
provenance seal-provisional <file>
provenance move <source> <destination>
provenance install-hooks [--pre-commit] [--mcp-verify-read] [--mcp-auto-seal] [--force]
provenance test [--json]

Set MOONGLADE_PUBLIC_KEY_PEM for verification. Provisional sealing requires MOONGLADE_PRIVATE_KEY_PEM and MOONGLADE_SIGNER. The verification root is MOONGLADE_ROOT, or the current directory when unset. MOONGLADE_REQUIRED_SIGNERS is an optional comma-separated list.

Failed verification and refused sealing return a nonzero exit code. Move refuses destination collisions and any source sidecar. To relocate an attested artifact, copy it, explicitly reseal and verify the destination, then retire the original separately. Existing signatures keep their original scope.

MCP and filesystem access

The read-only MCP server exposes verify_artifact_provenance, audit_vault_merkle_root and assert_gate_status. It has no signing or hook tools. Each supplied path authorizes a local read under the operator's filesystem permissions. The process is not a sandbox. Connect it only to principals allowed that access.

Gate assertions check the supplied signature and policy; they do not establish human approval or signer authority. Input frames are limited to 1 MiB. File reads reject symlinks and have a 64 MiB limit; sidecars are limited to 1 MiB, and timestamp tokens and responses to 512 KiB. Protect workspace permissions. Concurrent hostile filesystem writers are outside the supported trust model.

API and limits

dist/index.d.ts declares the public exports: the engine, vault, verification policy, canonicalization and bounded reads; Merkle helpers; timestamp parsing, verification and acquisition; badge helpers; artifact and envelope utilities; read-only MCP tools and self-test.

When an openpgp or ssh-ed25519 attestation accompanies a declared Moonglade Ed25519 attestation, verifyDocument returns status: 'INDETERMINATE' (verified: false); bundles containing only openpgp or ssh-ed25519 return verified: false without a status field. The legacy library OpenPGP signing helper is not covered by the default test suite; its keyring selection is caller-controlled. Platform keystores and sibling packages are excluded. The optional hook installer (provenance install-hooks) installs only a git pre-commit verification gate and writes a manifest of the options you chose (using npx -y --package=@moonglade/provenance provenance-gate). Usage is described in the build section above.

See SPEC.md, TIMESTAMP.md, NOTICE.md and trust/README.md. GPG checks the OpenPGP release identity separately. Artifact verification uses raw Ed25519 SPKI PEM keys. Candidate documentation is intentionally unsealed. The root release key is not an agent key.