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

@ai-manifests/aap-validate

v1.0.0

Published

Validate AAP acknowledgment events and compute reference reputation weight

Downloads

132

Readme

aap-validate

npm Downloads Node License Spec

Validate AAP acknowledgment events, check the anti-abuse semantic rules, and compute the reference reputation weight for an event.

Install

npm install -g @ai-manifests/aap-validate

Usage

Validate AAP events

aap-validate ./appreciation-with-settlement.json
aap-validate ./a.json ./b.json ./c.json

Validate a batch (with replay / duplicate-id detection)

Pass a directory of events to validate them as a set and detect duplicate id values (replay protection, T4):

aap-validate --batch ./events/

Compute the reference weight

Show the AAP §7.2 reference weight breakdown for an event (assumes issuer_trust = 1 and an unverified settlement, i.e. no economic boost):

aap-validate --weight ./endorsement-witnessed.json

Semantic Checks

| Check | Type | Threat | |-------|------|--------| | value.amount present ⇒ value.settlement_ref present | Error | T2 | | value.amount is a non-negative decimal string | Error | T2 | | WITHDRAWAL carries subject.context_ref | Error | T7 | | Witness DID identical to issuer DID | Error | T9 | | type is neither core nor x- extension | Error | T1 | | Unknown x- type (weight-clamped by consumers) | Warning | T1 | | value present (economic weight needs verified settlement) | Warning | T2 | | Witnesses present (independence verified out-of-band) | Warning | T9 | | expires_at not after issued_at (already expired) | Warning | — | | note longer than the 280-char display recommendation | Warning | T8 | | subject.context_ref advisory until resolved | Warning | T11 | | Duplicate event id within a batch | Error | T4 |

Programmatic Use

import {
  validateEvent,
  validateBatch,
  computeWeight,
  typeWeight,
  DEFAULT_TYPE_WEIGHTS,
} from '@ai-manifests/aap-validate';

const result = validateEvent(event);
const batchResult = validateBatch(events);

// Reference weight (AAP §7.2). value_weight applies only when settlement is verified.
const { weight, components } = computeWeight(event, {
  issuerTrust: 0.8,
  settlementVerified: true,
  usdEquivalent: 0.50,
  now: '2027-01-01T00:00:00Z',  // enables time decay; omit for no decay
});

How It Composes

aap-validate checks events at the source. The durable record layer that stores, chains, federates, and aggregates these events is AAR; validate the ledger with aar-validate. The reference weight computed here is the AAP §7.2 view; the normative aggregation algorithm — issuer-diversity penalty, recursive-trust bound, mandatory settlement verification — lives in AAR §9 and is checked by aar-validate.

aap-validate   validates the acknowledgment event
aar-validate   validates the ledger that stores and aggregates it

Status

v1.0 — Validates against AAP spec v1.0 (stable). Schemas for both v0 (draft baseline) and v1.0 ship in schema/.

License

Apache-2.0 — see LICENSE for the full license text and NOTICE for attribution.