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

@adlc/model-ratchet

v1.5.1

Published

Scheduled re-prosecution of hot paths — every frontier model release as a free re-audit (C12).

Downloads

1,571

Readme

@adlc/model-ratchet

Scheduled re-prosecution of hot paths — ADLC C12.

Every frontier model release is a free re-audit of the existing codebase: new models find what old ones missed. model-ratchet identifies the most valuable files to re-prosecute (high churn × high criticality), then either prints a prosecution plan or drives your review command over them, appending verified findings to the shared .adlc/findings ledger.

Run on every model release (or monthly) to ratchet codebase quality monotonically upward for the cost of a scheduled job.

ADLC Phase

C12 / D1–D3 maintenance ratchet. Pairs with:

  • C8 review-calibration — calibrate the new model's recall first, then aim it at hot paths.
  • C9 lesson-foundry — verified findings become lessons that compound into skills.

Installation

npm install -g @adlc/model-ratchet   # or use npx

Usage

model-ratchet [--top <n>] [--review-cmd <cmd>] [--churn-limit <n>] [--dry-run] [--json]

Flags

| Flag | Default | Description | |------|---------|-------------| | --top <n> | 10 | Number of hotspot files to select | | --review-cmd <cmd> | — | Shell command to run per file. Use {file} as placeholder. | | --churn-limit <n> | 1000 | Commit history depth for churn computation | | --dry-run | false | Print prosecution plan only; do not run review-cmd | | --json | false | Machine-readable JSON output | | --help | — | Show help |

Hot Score Formula

SCORE = churn(limit)[file] × (1 + inDegree)
  • churn(limit)[file] — number of distinct commits touching the file in the last --churn-limit commits (via git log).
  • inDegree — number of repo source files (.mjs/.js/.ts/.tsx/.py, walk skips node_modules/, .git/, dist/) whose import/require/from specifiers resolve (relative resolution, try extensions) to this file.

Test/spec files (.test.*, .spec.*, test/, __tests__/) and non-source files (.md, .json, lock files) are excluded from both the candidate set and the import graph.

Default Mode (no --review-cmd, or with --dry-run)

Prints the prosecution plan table and suggested charter lines per file:

model-ratchet — Prosecution Plan
====================================================================
FILE                        CHURN  IN-DEGREE  SCORE
--------------------------  -----  ---------  -----
src/auth.mjs                   42          3    168
src/db/query.mjs               31          5    186
src/utils.mjs                  25          1     50

Suggested charter lines:
  Refute correctness of src/auth.mjs — hotspot: changed 42 times, imported by 3 files
  ...

Review Mode (--review-cmd)

Runs the command for each selected file with {file} substituted. Captures stdout and parses findings:

  • Lines matching /\S+:\d+/ (e.g. src/foo.js:42: missing null check)
  • Lines starting with - (bullet items)

Each finding is appended to .adlc/findings.jsonl:

{
  "ts": "2026-01-01T00:00:00.000Z",
  "tool": "model-ratchet",
  "file": "src/auth.mjs",
  "line": 42,
  "category": "ratchet",
  "severity": "unknown",
  "desc": "src/auth.mjs:42: missing null check"
}

Exit code 2 from review-cmd is treated as "findings present" (not an error). Exit codes other than 0 or 2 cause an operational error (tool exits 1).

Exit Codes

| Code | Meaning | |------|---------| | 0 | Success — plan printed or review run complete | | 1 | Operational error — not a git repo, bad --review-cmd exit code, bad args | | 2 | Not used by model-ratchet itself (reserved for gate-fail; review-cmd findings go to ledger) |

Examples

# Print prosecution plan for top 10 hot files
model-ratchet

# Top 5 files, last 500 commits
model-ratchet --top 5 --churn-limit 500

# Dry-run plan even if review-cmd is provided
model-ratchet --top 10 --review-cmd "adversarial-review {file}" --dry-run

# Run adversarial review and append findings
model-ratchet --review-cmd "adversarial-review --file {file}"

# Machine-readable output for orchestrators
model-ratchet --top 5 --json

# Run a custom linter as the reviewer
model-ratchet --review-cmd "eslint {file} --format compact"

Cron and CI Examples

GitHub Actions — on every model release

# .github/workflows/model-ratchet.yml
name: model-ratchet

on:
  # Manually trigger when a new model is released
  workflow_dispatch:
  # Or run monthly
  schedule:
    - cron: '0 9 1 * *'

jobs:
  ratchet:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0  # needed for full churn history
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - name: Run model-ratchet
        run: |
          npx @adlc/model-ratchet \
            --top 10 \
            --review-cmd "npx @adlc/adversarial-review --file {file}" \
            --json > ratchet-results.json
      - uses: actions/upload-artifact@v4
        with:
          name: ratchet-findings
          path: .adlc/findings.jsonl

Cron (shell)

# Run on every model release — add to crontab or a release script
# crontab entry: run on the 1st of every month at 09:00
# 0 9 1 * * cd /path/to/repo && model-ratchet --top 10 --review-cmd "adversarial-review {file}" --json >> .adlc/ratchet-runs.log 2>&1

# Or run manually after a model upgrade:
model-ratchet --top 20 --review-cmd "adversarial-review --file {file}" --json

CI gate (plan-only, no API key required)

- name: Print hot paths prosecution plan
  run: npx @adlc/model-ratchet --top 10 --json

Core Gaps

None. Uses churn(), isGitRepo(), appendEntry(), parseArgs(), opError(), pass(), printJson() from @adlc/core. All hot-score logic, import-graph walking, and finding parsing live in lib/.

Relationship to Sibling Tools

  • adversarial-review — natural choice for --review-cmd; model-ratchet aims it at the highest-value files.
  • review-calibration (C8) — calibrate first, then ratchet.
  • lesson-foundry (C9) — consume the .adlc/findings ledger entries that model-ratchet appends.
  • gate-manifest (C11) — findings from ratchet runs appear in the shared findings ledger that manifests track.