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

@atlasauth/pca-explain

v0.4.3

Published

Plain-language proof-trace for PCA decisions: given a PCActn and its verify/decide result, explain exactly why it was allowed or denied — which capability granted it, which caveat narrowed or failed, the risk/threshold/budget path, and the first failing c

Readme

@atlasauth/pca-explain

Plain-language proof traces for Proof-Carrying Authority decisions. Given a PCActn and the result of the verifier, it explains why the action was allowed or denied: which checks passed, the first failing check with a concrete fix, which capability granted the action, which caveat narrowed or failed, and the risk, threshold and budget path. It also renders an attenuation trace for a delegation chain.

Everything is pure and read-only: it never re-authorizes anything and never throws, so malformed input degrades to a best-effort explanation.

Install

npm i @atlasauth/pca-explain

Depends on @atlasauth/pca.

Usage

The explainer reads the structural core verdict (verifyPCActnCore's per-check map) to say which check failed and how to fix it. It explains; it does not authorize: the allow / deny decision belongs to the full server verifier (verifyPCActn / requirePCA, with the grant from your own store).

import { explainVerification, explainChain } from '@atlasauth/pca-explain';
import { verifyPCActnCore } from '@atlasauth/pca';

// `pcactn` and `grant` come from your PCA flow.
const result = await verifyPCActnCore(pcactn, { grant, audience: 'ins_acme' });
const ex = explainVerification(pcactn, result);

console.log(ex.toText());
// PCA verification - DENY
// Denied at the "audience binding" check: aud does not match this resource server / instance
//   ...
//   x audience   aud does not match this resource server / instance  <- DECISIVE
//       fix: build the action with aud = this verifier's instance id ...

ex.verdict;           // 'allow' | 'deny'
ex.decisive?.name;    // the first failing check, e.g. 'audience'
ex.decisive?.remedy;  // what to change
ex.passed;            // names of the checks that held

console.log(explainChain([grant]).toText()); // per-hop attenuation trace

For the policy decision (admit, step-up or deny), pass the PCActn and the PolicyDecision to explainDecision(pcactn, decision, { envelope, context }). Supplying the envelope and the action and caveat context lets it name the granting predicate and each caveat's individual outcome; without them it falls back to the decision's own reasons. The result exposes disposition, grant, caveats, risk, admission, decisive and summary.

API

  • explainVerification(pcactn, verifyResult, { now? }) returns a VerificationExplanation with checks, passed, failed, notEnforced, decisive, summary and toText().
  • explainDecision(pcactn, decision, { envelope?, context? }) returns a DecisionExplanation.
  • explainChain(chain) returns a ChainExplanation with per-hop hops and toText().
  • VERIFY_CHECK_ORDER: the normative check order used for the trace.

Status

Experimental. The explanation is derived from the verifier's own result and describes it; it is not an authorization decision, and a check shown as "not enforced" means the verifier you ran did not enforce it.

License

MIT - see LICENSE