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

@qmilab/lodestar-memory-firewall

v0.3.0

Published

Lifecycle gates for claims and beliefs — four orthogonal axes (truth, retrieval, security, freshness) with per-axis transition rules. Part of Lodestar, the trust layer for AI agents.

Downloads

960

Readme

@qmilab/lodestar-memory-firewall

Lifecycle gates for claims and beliefs — four orthogonal axes (truth, retrieval, security, freshness) with per-axis transition rules. Part of Lodestar — the trust layer for AI agents.

The Memory Firewall is the gate between "an agent extracted something" and "the agent has adopted this as a belief it will act on." It is the answer to memory poisoning: agent-written memories cannot promote themselves.

Install

npm install @qmilab/lodestar-memory-firewall
# or
bun add @qmilab/lodestar-memory-firewall

The four lifecycle axes

A belief moves independently on four axes. Promoting on one does not promote on another.

| Axis | States | | --- | --- | | truth_status | unverifiedsupportedcontradicted | | retrieval_status | normalrestrictedhidden | | security_status | cleanquarantined (one-way without explicit clearance) | | freshness_status | freshstaleexpired |

The orthogonality is deliberate. A belief can be supported but stale, or clean but unverified, or quarantined but otherwise truthful. Collapsing the axes into a single enum throws away the information that makes informed retrieval possible.

Usage

import {
  MemoryFirewall,
  GatedRetrieval,
  InMemoryClaimStore,
  InMemoryBeliefStore,
  InMemoryEvidenceStore,
} from "@qmilab/lodestar-memory-firewall"

const claims = new InMemoryClaimStore()
const beliefs = new InMemoryBeliefStore()
const evidence = new InMemoryEvidenceStore()

const firewall = new MemoryFirewall(claims, beliefs, evidence, async (event) => {
  // route firewall audit events to your event log
})

// Promote one axis of an existing belief. The authority is what gives
// the firewall permission to make the transition; user_confirmation
// is one of the few authorities allowed to lift truth_status.
await firewall.transitionAxis({
  belief_id: belief.id,
  axis: "truth_status",
  to_value: "supported",
  by_authority: "user_confirmation",
  reason: "user confirmed in chat",
})

// Retrieval goes through the gate. It returns four buckets — what
// was accepted, what was rejected (and why), uncertainties surfaced
// per policy, and contradictions if the policy allows.
const retrieval = new GatedRetrieval(beliefs)
const result = await retrieval.retrieve(
  { scope: { level: "project", identifier: "my-project" } },
  contextPolicy,
)
// result.accepted, result.rejected, result.contradictions, result.uncertainties

Invariants

  1. No self-promotion. An agent's own success does not promote a belief from unverified to supported, or from restricted to normal. Promotion needs user confirmation, probe verification, or a narrow auto-promotion policy with logged evidence.
  2. Auto-observation gate. external_document and model_inference evidence cannot promote a claim to truth_status: supported automatically — only human or verifier-grade evidence can.
  3. Quarantine is one-way. A belief that enters security_status: quarantined does not return to clean without an explicit clearance event from an authorised actor.
  4. Retrieval respects ContextPolicy. No retrieval path silently bypasses the policy.
  5. Every transition produces an audit event. No silent state mutation — the audit sink passed to the constructor receives a structured event for every accepted claim, adopted belief, and axis transition.

License

Apache 2.0.