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

@cobusgreyling/loop-gate

v1.0.0

Published

Mechanical enforcement of LOOP.md/docs/safety.md's path denylist and auto-merge allowlist — evaluate a proposed change against static policy and block or allow it.

Readme

loop-gate

Mechanical enforcement of static safety policy — the code behind docs/safety.md's Path Denylist and Auto-Merge Policy, and LOOP.md's "No auto-merge on main except trivial dependency patches" / "Denylist... without human review" rules. Nothing evaluated a proposed change against that prose before; loop-gate does.

Deliberately has no knowledge of run history. Stagnation, repeated failures, and token/daily budgets already belong to loop-context's circuit breaker — loop-gate only looks at what is being proposed (which paths, what action type), not how the run has behaved so far. Chain the two:

loop-context --check --ledger run.json ...            || exit 2   # run-history based
loop-gate check --action auto-merge --paths a.ts,b.ts  || exit 2   # policy based
do-the-merge

Install & Run

npx @cobusgreyling/loop-gate check --action auto-merge --paths docs/guide.md

From this repo:

cd tools/loop-gate
npm install
npm test

Usage

loop-gate check --action <commit|merge|auto-merge> --paths <f1,f2,...> [--gate-file gate.yaml] [--json]

| Flag | Default | Meaning | |------|---------|---------| | --action <commit\|merge\|auto-merge> | required | What the loop is about to do | | --paths <f1,f2,...> | required | Comma-separated changed file paths | | --gate-file <path> | gate.yaml (cwd) | Policy file to evaluate against | | --json | off | Machine-readable decision output |

Exit codes: 0 allowed · 2 escalate · 1 error (bad flags, missing/invalid config).

Policy file

gate.yaml is the machine-readable twin of docs/safety.md — see templates/gate.yaml.template to scaffold your own, or this repo's own dogfood gate.yaml:

version: 1
denylist:
  - ".env"
  - "**/secrets/**"
  - "auth/**"
maxFiles: 10
autoMergeAllowlist:
  - "docs/**"
  - "**/*.md"

Checked in order (first match wins, same "most specific trigger first" convention loop-context's circuit breaker uses):

  1. denylist — any changed path matching a glob here escalates, regardless of --action.
  2. maxFiles — more changed paths than this escalates (matches docs/safety.md's "Changes touching >N files" human gate).
  3. autoMergeAllowlist — only checked when --action auto-merge; every changed path must match one of these globs, or it escalates.

Glob matching is via minimatch (the same semantics .gitignore-style globs use — ** matches across path segments).

What this does not do

  • Does not read a run ledger, and never will — that keeps it decoupled from loop-context at the source level, the same way loop-worktree and loop-context stay independent while still being paired by convention in a control script.
  • Does not produce its own escalation summary format — fold its JSON decision into whatever your control script already assembles from loop-context --inject when escalating to a human.
  • Does not enforce anything by itself — like loop-worktree's locks, this is advisory: a control script that skips calling loop-gate is not physically blocked. The mechanism is only as good as the scripts that call it.

See docs/safety.md for the policy this codifies, and docs/primitives.md for where safety gates fit in the Five Building Blocks + Memory model.