@parmanasystems/core 1.56.0 → 1.59.0

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 +366 -94
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -1,24 +1,87 @@
1
1
  # @parmanasystems/core
2
2
 
3
- Portable runtime SDK for the parmanasystems deterministic governance ecosystem.
3
+ Deterministic governance SDK and evaluation foundation for the Parmana Systems ecosystem.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@parmanasystems/core)](https://www.npmjs.com/package/@parmanasystems/core)
6
6
 
7
- ## Overview
7
+ ---
8
8
 
9
- `@parmanasystems/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.
9
+ # Overview
10
10
 
11
- Install this instead of separately installing `@parmanasystems/execution`, `@parmanasystems/governance`, and `@parmanasystems/verifier`.
11
+ `@parmanasystems/core` is the primary integration package for the Parmana deterministic governance ecosystem.
12
12
 
13
- ## Installation
13
+ It provides a unified governance SDK combining:
14
14
 
15
- ```bash
16
- npm install @parmanasystems/core
17
- ```
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.
23
+
24
+ ---
25
+
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.
56
+
57
+ When to use this package
58
+
59
+ Use this package when:
18
60
 
19
- ## Quick start
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
20
68
 
21
- ```typescript
69
+ Do NOT use this package when:
70
+
71
+ requiring only low-level runtime primitives
72
+ implementing only cryptographic infrastructure
73
+ building custom governance internals
74
+
75
+ In those cases use lower-level packages directly:
76
+
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
22
85
  import {
23
86
  executeFromSignals,
24
87
  verifyAttestation,
@@ -27,94 +90,268 @@ import {
27
90
  getRuntimeManifest,
28
91
  RedisReplayStore,
29
92
  } from "@parmanasystems/core";
93
+
30
94
  import { createClient } from "redis";
31
95
 
32
- const redis = createClient();
96
+ const redis =
97
+ createClient();
98
+
33
99
  await redis.connect();
34
100
 
35
- const signer = new LocalSigner(process.env.Parmana_PRIVATE_KEY!);
36
- const verifier = new LocalVerifier(process.env.Parmana_PUBLIC_KEY!);
37
- const store = new RedisReplayStore(redis);
38
- const manifest = getRuntimeManifest();
39
-
40
- // Execute a governance decision
41
- const result = await executeFromSignals(
42
- {
43
- policyId: "claims-approval",
44
- policyVersion: "v1",
45
- signals: { insurance_active: true, risk_score: 42 },
46
- },
47
- signer,
48
- verifier,
49
- store
50
- );
51
-
52
- if (result.status === "success" && result.signature) {
53
- // Independently verify
54
- const verification = verifyAttestation(
55
- { execution_id: result.execution_id, ...result },
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
+ },
132
+ },
133
+ signer,
56
134
  verifier,
57
- manifest
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
58
158
  );
59
- console.log(verification.valid); // true
60
159
  }
61
- ```
62
-
63
- ## Exports
64
-
65
- ### Governance lifecycle (from `@parmanasystems/governance`)
66
-
67
- | Export | Description |
68
- |---|---|
69
- | `createPolicy` | Scaffold a new policy directory |
70
- | `upgradePolicy` | Create an upgraded policy version |
71
- | `validatePolicy` | Validate a policy structure |
72
- | `generateBundle` | Generate a content-addressed policy bundle |
73
- | `definePolicy` | Build a PolicyDefinition in memory |
74
-
75
- ### Deterministic execution (from `@parmanasystems/execution`)
76
-
77
- | Export | Description |
78
- |---|---|
79
- | `executeFromSignals` | Full pipeline: load policy → evaluate → sign |
80
- | `executeDecision` | Lower-level: token → verify → replay → sign |
81
- | `executeSimple` | Token-based execution without policy file |
82
- | `resolveOverride` | Complete a pending_override execution |
83
- | `evaluatePolicy` | Pure policy rule evaluation |
84
- | `issueToken` | Issue a single-use execution token |
85
- | `signExecutionToken` | Sign a token |
86
- | `verifyExecutionToken` | Verify a token signature |
87
- | `getRuntimeManifest` | Return the active runtime manifest |
88
- | `signRuntimeManifest` | Sign a runtime manifest |
89
- | `verifyRuntimeManifest` | Verify a runtime manifest signature |
90
- | `LocalSigner` | Ed25519 signer (Node.js crypto) |
91
- | `LocalVerifier` | Ed25519 verifier (Node.js crypto) |
92
- | `MemoryReplayStore` | In-process replay protection |
93
- | `RedisReplayStore` | Distributed Redis replay protection |
94
- | `INVARIANT_REGISTRY` | All 60+ registered invariants |
95
- | `InvariantViolation` | Invariant violation error class |
96
- | `violate` | Throw a structured invariant violation |
97
-
98
- ### Portable verification (from `@parmanasystems/verifier`)
99
-
100
- | Export | Description |
101
- |---|---|
102
- | `verifyAttestation` | Four-check attestation verification |
103
- | `verifyBundle` | Bundle signature and hash verification |
104
- | `verifyRuntime` | Runtime manifest comparison |
105
- | `verifyRuntimeCompatibility` | Runtime requirements check |
106
- | `verifyExecutionRequirements` | Execution requirements check |
107
-
108
- ### Canonical utilities (from `@parmanasystems/bundle`)
109
-
110
- ```typescript
111
- import { canonicalize } from "@parmanasystems/core";
112
- // Deterministic JSON serialization (sorted keys, stable bytes)
113
- ```
114
-
115
- ### Types
116
-
117
- ```typescript
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.
246
+
247
+ signals_hash
248
+
249
+ Canonicalized governed input proof.
250
+
251
+ Used for:
252
+
253
+ deterministic reconstruction
254
+ execution verification
255
+ audit integrity
256
+ replay-safe governance
257
+ Example Policy
258
+ {
259
+ "policyId": "loan-approval",
260
+
261
+ "version": "v1",
262
+
263
+ "signalsSchema": {
264
+
265
+ "risk_score": {
266
+ "type": "number"
267
+ }
268
+ },
269
+
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
347
+
348
+ import {
349
+ canonicalize
350
+ } from "@parmanasystems/core";
351
+
352
+ Provides deterministic canonical serialization.
353
+
354
+ Types
118
355
  import type {
119
356
  ExecutionContext,
120
357
  ExecutionAttestation,
@@ -128,8 +365,43 @@ import type {
128
365
  AsyncReplayStore,
129
366
  ViolationReport,
130
367
  } from "@parmanasystems/core";
131
- ```
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:
132
395
 
133
- ## License
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
134
406
 
135
- Apache-2.0
407
+ Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parmanasystems/core",
3
- "version": "1.56.0",
3
+ "version": "1.59.0",
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.56.0",
22
- "@parmanasystems/bundle": "^1.56.0",
23
- "@parmanasystems/crypto": "^1.56.0",
24
- "@parmanasystems/execution": "^1.56.0",
25
- "@parmanasystems/governance": "^1.56.0",
26
- "@parmanasystems/verifier": "^1.56.0"
21
+ "@parmanasystems/audit-db": "^1.59.0",
22
+ "@parmanasystems/bundle": "^1.59.0",
23
+ "@parmanasystems/crypto": "^1.59.0",
24
+ "@parmanasystems/execution": "^1.59.0",
25
+ "@parmanasystems/governance": "^1.59.0",
26
+ "@parmanasystems/verifier": "^1.59.0"
27
27
  },
28
28
  "description": "Public orchestration and SDK surface for parmanasystems deterministic governance infrastructure.",
29
29
  "license": "Apache-2.0",