@parmanasystems/core 1.69.0 → 1.71.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +122 -374
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -1,407 +1,155 @@
1
1
  # @parmanasystems/core
2
2
 
3
- Deterministic governance SDK and evaluation foundation for the Parmana Systems ecosystem.
3
+ Unified public SDK for Parmana Systems deterministic governance.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@parmanasystems/core)](https://www.npmjs.com/package/@parmanasystems/core)
6
6
 
7
7
  ---
8
8
 
9
- # Overview
9
+ ## Overview
10
10
 
11
- `@parmanasystems/core` is the primary integration package for the Parmana deterministic governance ecosystem.
12
-
13
- It provides a unified governance SDK combining:
14
-
15
- - deterministic policy evaluation
16
- - governed execution
17
- - independent verification
18
- - replay-safe execution infrastructure
19
- - runtime provenance validation
20
- - canonical governance utilities
21
-
22
- For most applications, this is the recommended entry point into the Parmana ecosystem.
11
+ `@parmanasystems/core` is the single entry point for most Parmana Systems integrations. It re-exports the complete public API from the underlying packages — execution, runtime orchestration, portable verification, governance lifecycle, and cryptographic primitives — under one install.
23
12
 
24
13
  ---
25
14
 
26
- # Mental Model
27
-
28
- ```txt id="o5f0r2"
29
- Signals
30
-
31
- Deterministic Evaluation
32
-
33
- Governed Decision
34
-
35
- Governed Execution
36
-
37
- Execution Attestation
38
-
39
- Independent Verification
40
-
41
- The core package unifies the full deterministic governance lifecycle.
42
-
43
- What this package does
44
-
45
- @parmanasystems/core combines:
46
-
47
- Capability Description
48
- deterministic evaluation governed decision evaluation
49
- governed execution replay-safe enforcement
50
- verification independent proof validation
51
- governance utilities canonical governance infrastructure
52
- runtime lineage provenance validation
53
- replay protection deterministic execution safety
54
-
55
- This package acts as the unified developer-facing governance SDK.
15
+ ## Install
56
16
 
57
- When to use this package
58
-
59
- Use this package when:
60
-
61
- integrating deterministic governance into applications
62
- building governed AI systems
63
- implementing governed execution workflows
64
- deploying deterministic execution pipelines
65
- verifying execution attestations
66
- building replay-safe governance infrastructure
67
- adopting Parmana without managing multiple packages individually
68
-
69
- Do NOT use this package when:
17
+ ```bash
18
+ npm install @parmanasystems/core
19
+ ```
70
20
 
71
- requiring only low-level runtime primitives
72
- implementing only cryptographic infrastructure
73
- building custom governance internals
21
+ ---
74
22
 
75
- In those cases use lower-level packages directly:
23
+ ## Usage
76
24
 
77
- Package Responsibility
78
- @parmanasystems/execution governed execution runtime
79
- @parmanasystems/verifier independent verification
80
- @parmanasystems/governance governance lifecycle
81
- @parmanasystems/crypto signing infrastructure
82
- Installation
83
- npm install @parmanasystems/core
84
- Quick Start
25
+ ```typescript
26
+ import crypto from "crypto";
85
27
  import {
86
28
  executeFromSignals,
87
- verifyAttestation,
88
29
  LocalSigner,
89
30
  LocalVerifier,
31
+ MemoryReplayStore,
32
+ verifyAttestation,
90
33
  getRuntimeManifest,
91
- RedisReplayStore,
92
34
  } from "@parmanasystems/core";
93
35
 
94
- import { createClient } from "redis";
95
-
96
- const redis =
97
- createClient();
98
-
99
- await redis.connect();
100
-
101
- const signer =
102
- new LocalSigner(
103
- process.env.Parmana_PRIVATE_KEY!
104
- );
105
-
106
- const verifier =
107
- new LocalVerifier(
108
- process.env.Parmana_PUBLIC_KEY!
109
- );
110
-
111
- const store =
112
- new RedisReplayStore(
113
- redis
114
- );
115
-
116
- const manifest =
117
- getRuntimeManifest();
118
-
119
- const result =
120
- await executeFromSignals(
121
- {
122
- policyId:
123
- "claims-approval",
124
-
125
- policyVersion:
126
- "v1",
127
-
128
- signals: {
129
- insurance_active: true,
130
- risk_score: 42,
131
- },
36
+ const { privateKey, publicKey } = crypto.generateKeyPairSync("ed25519", {
37
+ privateKeyEncoding: { type: "pkcs8", format: "pem" },
38
+ publicKeyEncoding: { type: "spki", format: "pem" },
39
+ });
40
+
41
+ const signer = new LocalSigner(privateKey);
42
+ const verifier = new LocalVerifier(publicKey);
43
+ const replayStore = new MemoryReplayStore();
44
+
45
+ const attestation = await executeFromSignals(
46
+ {
47
+ policyId: "trade-risk-approval",
48
+ policyVersion: "1.0.0",
49
+ signals: {
50
+ amount_usd: 450_000,
51
+ risk_score: 18,
52
+ counterparty: "acme-corp",
132
53
  },
133
- signer,
134
- verifier,
135
- store
136
- );
137
-
138
- if (
139
- result.status === "success"
140
- &&
141
- result.signature
142
- ) {
143
-
144
- const verification =
145
- verifyAttestation(
146
- {
147
- execution_id:
148
- result.execution_id,
149
-
150
- ...result
151
- },
152
- verifier,
153
- manifest
154
- );
155
-
156
- console.log(
157
- verification.valid
158
- );
159
- }
160
- Core Concepts
161
- Deterministic Evaluation
162
-
163
- Governance evaluation is deterministic.
164
-
165
- The runtime guarantees:
166
-
167
- same signals + same policy → same governed outcome
168
-
169
- Evaluation does not depend on:
170
-
171
- randomness
172
- mutable runtime state
173
- probabilistic execution
174
- timestamps
175
- Signals vs Rules vs Execution
176
-
177
- Parmana separates:
178
-
179
- Component Responsibility
180
- signals governed facts and inputs
181
- rules deterministic governance logic
182
- execution governed enforcement
183
-
184
- This separation improves:
185
-
186
- auditability
187
- reproducibility
188
- governance clarity
189
- execution trust boundaries
190
- signalsSchema
191
-
192
- Policies define governed signal structure explicitly.
193
-
194
- Example:
195
-
196
- {
197
- "signalsSchema": {
198
- "risk_score": {
199
- "type": "number"
200
- }
201
- }
202
- }
203
-
204
- Signals are:
205
-
206
- typed
207
- deterministic
208
- explicitly governed
209
- schema-validated
210
- Governed Decisions
211
-
212
- The evaluator produces governed outcomes:
213
-
214
- {
215
- "action": "approve",
216
- "requires_override": false
217
- }
218
-
219
- Possible outcomes include:
220
-
221
- Outcome Meaning
222
- approve execution allowed
223
- reject execution denied
224
- requires_override human escalation required
225
-
226
- The evaluator determines governance outcomes.
227
-
228
- Execution authority is enforced separately.
229
-
230
- execution_id
231
-
232
- Operational execution lineage identifier.
233
-
234
- Used for:
235
-
236
- audit tracking
237
- governance event identity
238
- operational lineage
239
- execution_fingerprint
240
-
241
- Deterministic replay identity.
242
-
243
- Replay protection operates on execution fingerprints.
244
-
245
- Identical governed inputs produce identical execution fingerprints.
54
+ },
55
+ signer,
56
+ verifier,
57
+ replayStore
58
+ );
246
59
 
247
- signals_hash
60
+ console.log(attestation.execution_state); // "completed"
61
+ console.log(attestation.decision.action); // "approve"
62
+ console.log(attestation.signature); // Ed25519 over canonical attestation JSON
248
63
 
249
- Canonicalized governed input proof.
64
+ // Independently verify — no runtime state required beyond the manifest
65
+ const manifest = getRuntimeManifest();
66
+ const result = verifyAttestation(attestation, verifier, manifest);
67
+ console.log(result.valid); // true
68
+ ```
250
69
 
251
- Used for:
70
+ ---
252
71
 
253
- deterministic reconstruction
254
- execution verification
255
- audit integrity
256
- replay-safe governance
257
- Example Policy
258
- {
259
- "policyId": "loan-approval",
72
+ ## Exports
73
+
74
+ ### Runtime orchestration
75
+
76
+ | Export | Description |
77
+ |---|---|
78
+ | `executeFromSignals` | Primary execution entry point — evaluates a policy, signs the result, returns `ExecutionAttestation` |
79
+ | `MemoryReplayStore` | In-process replay store for development and testing |
80
+ | `RedisReplayStore` | Distributed replay store for production use |
81
+
82
+ ### Core execution primitives
83
+
84
+ | Export | Description |
85
+ |---|---|
86
+ | `executeDecision` | Deterministic execution pipeline (verify → execute → sign) |
87
+ | `issueToken` | Issue a signed `ExecutionToken` |
88
+ | `verifyExecutionToken` | Verify an `ExecutionToken` signature |
89
+ | `getRuntimeManifest` | Return the current `RuntimeManifest` |
90
+ | `signRuntimeManifest` | Sign a `RuntimeManifest` |
91
+ | `verifyRuntimeManifest` | Verify a signed `RuntimeManifest` |
92
+ | `LocalSigner` | Ed25519 signer backed by a local PEM private key |
93
+ | `LocalVerifier` | Ed25519 verifier backed by a local PEM public key |
94
+
95
+ ### Portable verification
96
+
97
+ | Export | Description |
98
+ |---|---|
99
+ | `verifyAttestation` | Verify an `ExecutionAttestation` signature and runtime binding |
100
+ | `verifyBundle` | Verify a governance bundle's content-addressed integrity |
101
+ | `verifyRuntime` | Verify runtime state against a manifest |
102
+ | `verifyRuntimeCompatibility` | Check runtime version compatibility with a policy's requirements |
103
+ | `verifyExecutionRequirements` | Verify execution requirements before running |
104
+
105
+ ### Governance lifecycle
106
+
107
+ | Export | Description |
108
+ |---|---|
109
+ | `createPolicy` | Scaffold a new policy directory |
110
+ | `upgradePolicy` | Create a new version of an existing policy |
111
+ | `validatePolicy` | Validate a policy definition against the governance schema |
112
+ | `generateBundle` | Package a policy directory into a signed bundle |
113
+ | `signBundle` | Sign a bundle directory with a `Signer` |
114
+
115
+ ### Override authority
116
+
117
+ | Export | Description |
118
+ |---|---|
119
+ | `approveOverride` | Approve a pending override decision |
120
+
121
+ ### Invariant registry
122
+
123
+ | Export | Description |
124
+ |---|---|
125
+ | `INVARIANT_REGISTRY` | Registry of all declared deterministic invariants |
126
+ | `InvariantViolation` | Error subclass for invariant violations |
127
+ | `violate` | Throw an `InvariantViolation` |
128
+ | `hashInput` | SHA-256 hash of canonical input |
129
+
130
+ ### Key types
131
+
132
+ | Export | Description |
133
+ |---|---|
134
+ | `ExecutionAttestation` | Signed record of a completed governed execution |
135
+ | `ExecutionContext` | Full input context for `executeDecision` |
136
+ | `ExecutionToken` | Signed artifact binding a decision to its execution identity |
137
+ | `RuntimeManifest` | Runtime binary state snapshot |
138
+ | `Signer` | Signing interface |
139
+ | `Verifier` | Verification interface |
140
+ | `ReplayStore` | Replay protection interface |
141
+ | `DecisionResult` | Resolved policy decision |
142
+ | `DecisionOutcome` | Action, override flag, and optional reason |
260
143
 
261
- "version": "v1",
144
+ ---
262
145
 
263
- "signalsSchema": {
146
+ ## Documentation
264
147
 
265
- "risk_score": {
266
- "type": "number"
267
- }
268
- },
148
+ Full docs: [parmanasystems.mintlify.app](https://parmanasystems.mintlify.app)
149
+ Package page: [parmanasystems.mintlify.app/packages/core](https://parmanasystems.mintlify.app/packages/core)
269
150
 
270
- "rules": [
271
-
272
- {
273
- "id": "approve-low-risk",
274
-
275
- "condition": {
276
- "all": [
277
- {
278
- "signal": "risk_score",
279
- "less_than": 0.25
280
- }
281
- ]
282
- },
283
-
284
- "outcome": {
285
- "action": "approve",
286
- "requires_override": false
287
- }
288
- }
289
- ]
290
- }
291
- Governance Lifecycle
292
- Signals
293
-
294
- Validation
295
-
296
- Deterministic Evaluation
297
-
298
- Governed Decision
299
-
300
- Execution Token
301
-
302
- Governed Execution
303
-
304
- Execution Attestation
305
-
306
- Independent Verification
307
- Major Exports
308
- Governance Lifecycle
309
-
310
- From @parmanasystems/governance
311
-
312
- Export Description
313
- createPolicy scaffold governance policy
314
- upgradePolicy create new immutable policy version
315
- validatePolicy validate governance policy
316
- generateBundle generate governance bundle
317
- definePolicy define policy in memory
318
- Deterministic Execution
319
-
320
- From @parmanasystems/execution
321
-
322
- Export Description
323
- executeFromSignals full governed execution pipeline
324
- executeDecision low-level execution pipeline
325
- executeSimple simplified token execution
326
- resolveOverride resolve override workflow
327
- evaluatePolicy deterministic policy evaluation
328
- issueToken issue execution token
329
- getRuntimeManifest active runtime lineage
330
- LocalSigner local Ed25519 signer
331
- LocalVerifier local Ed25519 verifier
332
- MemoryReplayStore in-memory replay protection
333
- RedisReplayStore distributed replay protection
334
- Independent Verification
335
-
336
- From @parmanasystems/verifier
337
-
338
- Export Description
339
- verifyAttestation deterministic attestation verification
340
- verifyBundle governance bundle verification
341
- verifyRuntime runtime lineage verification
342
- verifyRuntimeCompatibility runtime compatibility validation
343
- verifyExecutionRequirements execution requirement validation
344
- Canonical Utilities
345
-
346
- From @parmanasystems/bundle
151
+ ---
347
152
 
348
- import {
349
- canonicalize
350
- } from "@parmanasystems/core";
153
+ ## License
351
154
 
352
- Provides deterministic canonical serialization.
353
-
354
- Types
355
- import type {
356
- ExecutionContext,
357
- ExecutionAttestation,
358
- ExecutionToken,
359
- DecisionResult,
360
- RuntimeManifest,
361
- Signer,
362
- AsyncSigner,
363
- Verifier,
364
- ReplayStore,
365
- AsyncReplayStore,
366
- ViolationReport,
367
- } from "@parmanasystems/core";
368
- Recommended Architecture
369
- Application
370
-
371
- @parmanasystems/core
372
-
373
- Deterministic Governance
374
-
375
- Execution Attestation
376
-
377
- Independent Verification
378
-
379
- For most applications, @parmanasystems/core is the recommended integration surface.
380
-
381
- Security Model
382
-
383
- The core governance SDK enforces:
384
-
385
- deterministic evaluation
386
- fail-closed governance
387
- replay-safe execution
388
- immutable attestations
389
- runtime provenance validation
390
- independent verification
391
- governed execution boundaries
392
- canonical deterministic serialization
393
-
394
- The system is designed so that:
395
-
396
- AI may recommend actions.
397
- Deterministic governance controls execution authority.
398
- Relationship to Other Parmana Packages
399
- Package Responsibility
400
- @parmanasystems/core unified governance SDK
401
- @parmanasystems/execution governed execution runtime
402
- @parmanasystems/verifier independent verification
403
- @parmanasystems/server deployable runtime
404
- @parmanasystems/sdk-client HTTP integration
405
- License
406
-
407
- Apache-2.0
155
+ Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parmanasystems/core",
3
- "version": "1.69.0",
3
+ "version": "1.71.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -18,12 +18,12 @@
18
18
  ],
19
19
  "sideEffects": false,
20
20
  "dependencies": {
21
- "@parmanasystems/audit-db": "^1.69.0",
22
- "@parmanasystems/bundle": "^1.69.0",
23
- "@parmanasystems/crypto": "^1.69.0",
24
- "@parmanasystems/execution": "^1.69.0",
25
- "@parmanasystems/governance": "^1.69.0",
26
- "@parmanasystems/verifier": "^1.69.0"
21
+ "@parmanasystems/audit-db": "^1.71.2",
22
+ "@parmanasystems/bundle": "^1.71.2",
23
+ "@parmanasystems/crypto": "^1.71.2",
24
+ "@parmanasystems/execution": "^1.71.2",
25
+ "@parmanasystems/governance": "^1.71.2",
26
+ "@parmanasystems/verifier": "^1.71.2"
27
27
  },
28
28
  "description": "Public orchestration and SDK surface for parmanasystems deterministic governance infrastructure.",
29
29
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "type": "git",
32
32
  "url": "https://github.com/pavancharak/parmanasystems-core.git"
33
33
  },
34
- "homepage": "https://github.com/pavancharak/parmanasystems-core",
34
+ "homepage": "https://parmanasystems.mintlify.app",
35
35
  "bugs": {
36
36
  "url": "https://github.com/pavancharak/parmanasystems-core/issues"
37
37
  },