Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.manthan.systems/llms.txt

Use this file to discover all available pages before exploring further.

The primary package for executing and verifying governance decisions. Bundles everything you need for production use.

Install

npm install @parmanasystems/core
@parmanasystems/core bundles CJS dependencies. Do NOT set "type": "module" in package.json. Wrap all async code in an async function - do not use top-level await.

Key exports

ExportDescription
executeFromSignalsExecute a governed decision against a policy
verifyAttestationVerify an attestation’s signature and invariants
LocalSignerEd25519 signer backed by Node.js crypto
LocalVerifierEd25519 verifier backed by Node.js crypto
MemoryReplayStoreIn-process replay store for development and testing
RedisReplayStoreRedis-backed replay store for production
approveOverrideRecord a human override for a pending decision
getRuntimeManifestGet the current runtime manifest
LocalValidatorMulti-stage attestation validator

Quick example

import crypto from "crypto";
import {
  executeFromSignals,
  verifyAttestation,
  LocalSigner,
  LocalVerifier,
  MemoryReplayStore,
} from "@parmanasystems/core";

async function main() {
  const { privateKey, publicKey } = crypto.generateKeyPairSync("ed25519", {
    privateKeyEncoding: { type: "pkcs8", format: "pem" },
    publicKeyEncoding:  { type: "spki",  format: "pem" },
  });

  const attestation = await executeFromSignals(
    {
      policyId:      "loan-approval",
      policyVersion: "1.0.0",
      signals:       { credit_score: 720, loan_amount: 15000 },
    },
    new LocalSigner(privateKey),
    new LocalVerifier(publicKey),
    new MemoryReplayStore()
  );

  console.log(attestation.decision);
  // { action: "approve", requires_override: false, reason: "Credit score meets standard threshold." }

  const result = verifyAttestation(attestation, new LocalVerifier(publicKey));
  console.log(result.valid); // true
}

main().catch(console.error);

See also