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

@phoenixaihub/behaviorprint

v1.0.1

Published

Behavioral Fingerprinting Engine — detect behavioral regressions in code changes before they reach production

Readme

behaviorprint

Behavioral Fingerprinting Engine for Code Changes

Catch the regressions your tests don't cover — before they hit production 30-90 days later.

The Problem

AI-assisted code changes are fast and pass existing tests. But tests only cover known behaviors. When an AI refactors processPayment(), it might subtly change how null currency codes are handled. Your tests pass. Three months later, 0.3% of payments start failing.

behaviorprint captures the complete behavioral signature of your functions — every edge case, every boundary value, every type coercion quirk — and detects when any of it changes.

How It Works

Before Change                    After Change
     │                                │
     ▼                                ▼
┌──────────────┐              ┌──────────────┐
│ Extract AST  │              │ Extract AST  │
│ functions    │              │ functions    │
└──────┬───────┘              └──────┬───────┘
       ▼                             ▼
┌──────────────┐              ┌──────────────┐
│ Generate     │              │ Generate     │
│ input classes│              │ input classes│
│ (boundaries) │              │ (boundaries) │
└──────┬───────┘              └──────┬───────┘
       ▼                             ▼
┌──────────────┐              ┌──────────────┐
│ Probe each   │              │ Probe each   │
│ function     │              │ function     │
│ (sandboxed)  │              │ (sandboxed)  │
└──────┬───────┘              └──────┬───────┘
       │                             │
       └──────────┬──────────────────┘
                  ▼
          ┌──────────────┐
          │   Compare    │
          │ fingerprints │
          └──────┬───────┘
                 ▼
          ┌──────────────┐
          │  Divergence  │
          │   Report     │
          └──────────────┘

Core Algorithms

  1. Function Extraction — AST-based (tree-sitter) identification of exported/public functions with arity detection
  2. Input Class Generation — Automatic boundary values: 0, -1, MAX_SAFE_INTEGER, null, undefined, NaN, Infinity, empty string, empty array, {}, and combinations
  3. Behavioral Probing — Sandboxed execution capturing return values, thrown exceptions, and side effects (console output)
  4. Fingerprint Comparison — Hash-based comparison of (input_class → output_signature) maps
  5. Severity Classificationreturn→throw = critical, null/undefined boundary = high, type changes = medium
  6. Coverage Gap Detection — Information-theoretic entropy metric identifying undertested behavioral surfaces

Installation

npm install @phoenixaihub/behaviorprint

CLI Usage

Capture fingerprints

# Capture behavioral fingerprints of all exported functions
behaviorprint capture ./src --output before.json

# Make your changes...

# Capture again
behaviorprint capture ./src --output after.json

Compare fingerprints

behaviorprint compare before.json after.json --output report.json

Example Output

{
  "functions_analyzed": 12,
  "identical": 9,
  "divergent": 3,
  "divergences": [
    {
      "function": "processPayment",
      "file": "src/payments.js",
      "input": [0, null],
      "before": { "returns": { "success": false, "error": "invalid" } },
      "after": { "throws": "TypeError: Cannot read property 'code' of null" },
      "severity": "critical",
      "production_frequency": "estimated 0.3% of calls"
    }
  ]
}

Programmatic API

import { captureFunction, compareFingerprints } from '@phoenixaihub/behaviorprint';

// Capture a single function
const before = captureFunction(oldImplementation, 'processPayment');
const after = captureFunction(newImplementation, 'processPayment');

// Compare
const report = compareFingerprints([before], [after]);
console.log(`${report.divergent} behavioral divergences found`);

for (const d of report.divergences) {
  console.log(`${d.severity}: ${d.function} — input: ${JSON.stringify(d.input)}`);
}

Full Directory Capture

import { capture, compareFingerprints } from '@phoenixaihub/behaviorprint';

const before = capture('./src-v1');
const after = capture('./src-v2');
const report = compareFingerprints(before.fingerprints, after.fingerprints);

Severity Levels

| Severity | Meaning | Example | |----------|---------|---------| | critical | Function now throws where it previously returned | null input causes crash | | high | Null/undefined boundary behavior changed | Silent null → error | | medium | Return type changed | numberstring | | low | Value changed but type preserved | 4243 |

CI Integration

# .github/workflows/behaviorprint.yml
- name: Capture baseline
  run: behaviorprint capture ./src --output baseline.json

- name: Capture current
  run: behaviorprint capture ./src --output current.json

- name: Compare
  run: |
    behaviorprint compare baseline.json current.json --output report.json
    cat report.json | jq '.divergent' | grep -q '^0$' || exit 1

License

MIT