@pramanasystems/core
v1.0.19
Published
Public orchestration and SDK surface for PramanaSystems deterministic governance infrastructure.
Downloads
1,751
Maintainers
Readme
@pramanasystems/core
Portable runtime SDK for the PramanaSystems deterministic governance ecosystem.
Overview
@pramanasystems/core is the recommended single-package install for most applications. It re-exports the full governance lifecycle, execution runtime, and verification layer, and adds the deterministic validator and canonical JSON utilities.
Install this instead of separately installing @pramanasystems/execution, @pramanasystems/governance, and @pramanasystems/verifier.
Installation
npm install @pramanasystems/coreQuick start
import {
executeFromSignals,
verifyAttestation,
LocalSigner,
LocalVerifier,
getRuntimeManifest,
RedisReplayStore,
} from "@pramanasystems/core";
import { createClient } from "redis";
const redis = createClient();
await redis.connect();
const signer = new LocalSigner(process.env.PRAMANA_PRIVATE_KEY!);
const verifier = new LocalVerifier(process.env.PRAMANA_PUBLIC_KEY!);
const store = new RedisReplayStore(redis);
const manifest = getRuntimeManifest();
// Execute a governance decision
const result = await executeFromSignals(
{
policyId: "claims-approval",
policyVersion: "v1",
signals: { insurance_active: true, risk_score: 42 },
},
signer,
verifier,
store
);
if (result.status === "success" && result.signature) {
// Independently verify
const verification = verifyAttestation(
{ execution_id: result.execution_id, ...result },
verifier,
manifest
);
console.log(verification.valid); // true
}Exports
Governance lifecycle (from @pramanasystems/governance)
| Export | Description |
|---|---|
| createPolicy | Scaffold a new policy directory |
| upgradePolicy | Create an upgraded policy version |
| validatePolicy | Validate a policy structure |
| generateBundle | Generate a content-addressed policy bundle |
| definePolicy | Build a PolicyDefinition in memory |
Deterministic execution (from @pramanasystems/execution)
| Export | Description |
|---|---|
| executeFromSignals | Full pipeline: load policy → evaluate → sign |
| executeDecision | Lower-level: token → verify → replay → sign |
| executeSimple | Token-based execution without policy file |
| resolveOverride | Complete a pending_override execution |
| evaluatePolicy | Pure policy rule evaluation |
| issueToken | Issue a single-use execution token |
| signExecutionToken | Sign a token |
| verifyExecutionToken | Verify a token signature |
| getRuntimeManifest | Return the active runtime manifest |
| signRuntimeManifest | Sign a runtime manifest |
| verifyRuntimeManifest | Verify a runtime manifest signature |
| LocalSigner | Ed25519 signer (Node.js crypto) |
| LocalVerifier | Ed25519 verifier (Node.js crypto) |
| MemoryReplayStore | In-process replay protection |
| RedisReplayStore | Distributed Redis replay protection |
| INVARIANT_REGISTRY | All 60+ registered invariants |
| InvariantViolation | Invariant violation error class |
| violate | Throw a structured invariant violation |
Portable verification (from @pramanasystems/verifier)
| Export | Description |
|---|---|
| verifyAttestation | Four-check attestation verification |
| verifyBundle | Bundle signature and hash verification |
| verifyRuntime | Runtime manifest comparison |
| verifyRuntimeCompatibility | Runtime requirements check |
| verifyExecutionRequirements | Execution requirements check |
Canonical utilities (from @pramanasystems/bundle)
import { canonicalize } from "@pramanasystems/core";
// Deterministic JSON serialization (sorted keys, stable bytes)Types
import type {
ExecutionContext,
ExecutionAttestation,
ExecutionToken,
DecisionResult,
RuntimeManifest,
Signer,
AsyncSigner,
Verifier,
ReplayStore,
AsyncReplayStore,
ViolationReport,
} from "@pramanasystems/core";License
Apache-2.0
