@vorionsys/proof-plane 0.1.0 → 0.1.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 (37) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/LICENSE +190 -0
  3. package/README.md +492 -0
  4. package/dist/api/index.d.ts +9 -0
  5. package/dist/api/index.d.ts.map +1 -0
  6. package/dist/api/index.js +9 -0
  7. package/dist/api/index.js.map +1 -0
  8. package/dist/api/routes.d.ts +88 -0
  9. package/dist/api/routes.d.ts.map +1 -0
  10. package/dist/api/routes.js +402 -0
  11. package/dist/api/routes.js.map +1 -0
  12. package/dist/events/event-emitter.d.ts +1 -1
  13. package/dist/events/event-emitter.d.ts.map +1 -1
  14. package/dist/events/event-emitter.js +4 -2
  15. package/dist/events/event-emitter.js.map +1 -1
  16. package/dist/events/event-signatures.d.ts +1 -1
  17. package/dist/events/event-signatures.d.ts.map +1 -1
  18. package/dist/events/event-store.d.ts +1 -1
  19. package/dist/events/event-store.d.ts.map +1 -1
  20. package/dist/events/hash-chain.d.ts +17 -2
  21. package/dist/events/hash-chain.d.ts.map +1 -1
  22. package/dist/events/hash-chain.js +42 -3
  23. package/dist/events/hash-chain.js.map +1 -1
  24. package/dist/events/memory-store.d.ts +1 -1
  25. package/dist/events/memory-store.d.ts.map +1 -1
  26. package/dist/index.d.ts +2 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +3 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/proof-plane/logger.d.ts +1 -1
  31. package/dist/proof-plane/logger.d.ts.map +1 -1
  32. package/dist/proof-plane/proof-plane.d.ts +1 -1
  33. package/dist/proof-plane/proof-plane.d.ts.map +1 -1
  34. package/dist/proof-plane/proof-plane.js +1 -1
  35. package/dist/proof-plane/proof-plane.js.map +1 -1
  36. package/openapi.yaml +571 -0
  37. package/package.json +48 -7
package/openapi.yaml ADDED
@@ -0,0 +1,571 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: Vorion Proof Plane API
4
+ description: |
5
+ REST API for the Vorion audit system providing immutable proof events,
6
+ hash chain verification, and cryptographic signatures for AI agent operations.
7
+ version: 1.0.0
8
+ contact:
9
+ name: Vorion Team
10
+ url: https://github.com/vorionsys/vorion
11
+ license:
12
+ name: Apache-2.0
13
+ url: https://www.apache.org/licenses/LICENSE-2.0
14
+
15
+ servers:
16
+ - url: /v1
17
+ description: API v1
18
+
19
+ tags:
20
+ - name: Proof Events
21
+ description: Submit and retrieve proof events
22
+ - name: Verification
23
+ description: Verify event integrity and chain validity
24
+ - name: Chain
25
+ description: Event chain operations and traces
26
+
27
+ paths:
28
+ /proof:
29
+ post:
30
+ operationId: submitProof
31
+ summary: Submit a proof event
32
+ description: |
33
+ Create a new proof event in the immutable audit trail.
34
+ The event is cryptographically hashed and chained to the previous event.
35
+ tags:
36
+ - Proof Events
37
+ requestBody:
38
+ required: true
39
+ content:
40
+ application/json:
41
+ schema:
42
+ $ref: '#/components/schemas/SubmitProofRequest'
43
+ responses:
44
+ '201':
45
+ description: Proof event created successfully
46
+ content:
47
+ application/json:
48
+ schema:
49
+ $ref: '#/components/schemas/ProofEventResponse'
50
+ '400':
51
+ $ref: '#/components/responses/ValidationError'
52
+ '500':
53
+ $ref: '#/components/responses/InternalError'
54
+
55
+ /proof/{id}:
56
+ get:
57
+ operationId: getProof
58
+ summary: Get proof event by ID
59
+ description: Retrieve a single proof event by its unique identifier.
60
+ tags:
61
+ - Proof Events
62
+ parameters:
63
+ - $ref: '#/components/parameters/EventId'
64
+ responses:
65
+ '200':
66
+ description: Proof event found
67
+ content:
68
+ application/json:
69
+ schema:
70
+ $ref: '#/components/schemas/ProofEventDetailResponse'
71
+ '404':
72
+ $ref: '#/components/responses/NotFound'
73
+
74
+ /proof/verify/{id}:
75
+ get:
76
+ operationId: verifyProof
77
+ summary: Verify a proof event
78
+ description: |
79
+ Verify the cryptographic integrity of a single proof event.
80
+ Checks hash validity and optionally signature validity.
81
+ tags:
82
+ - Verification
83
+ parameters:
84
+ - $ref: '#/components/parameters/EventId'
85
+ responses:
86
+ '200':
87
+ description: Verification result
88
+ content:
89
+ application/json:
90
+ schema:
91
+ $ref: '#/components/schemas/VerifyEventResponse'
92
+ '404':
93
+ $ref: '#/components/responses/NotFound'
94
+
95
+ /proof/chain/{correlationId}:
96
+ get:
97
+ operationId: getChain
98
+ summary: Get event trace by correlation ID
99
+ description: |
100
+ Retrieve all proof events associated with a correlation ID,
101
+ representing a complete audit trail for a single operation.
102
+ tags:
103
+ - Chain
104
+ parameters:
105
+ - $ref: '#/components/parameters/CorrelationId'
106
+ - $ref: '#/components/parameters/Limit'
107
+ - $ref: '#/components/parameters/Offset'
108
+ responses:
109
+ '200':
110
+ description: Event trace found
111
+ content:
112
+ application/json:
113
+ schema:
114
+ $ref: '#/components/schemas/ChainTraceResponse'
115
+ '404':
116
+ $ref: '#/components/responses/NotFound'
117
+
118
+ /proof/chain/verify:
119
+ post:
120
+ operationId: verifyChain
121
+ summary: Verify chain integrity
122
+ description: |
123
+ Verify the cryptographic integrity of the entire event chain.
124
+ Checks hash validity, chain links, and optionally signatures.
125
+ tags:
126
+ - Verification
127
+ requestBody:
128
+ required: true
129
+ content:
130
+ application/json:
131
+ schema:
132
+ $ref: '#/components/schemas/VerifyChainRequest'
133
+ responses:
134
+ '200':
135
+ description: Chain verification result
136
+ content:
137
+ application/json:
138
+ schema:
139
+ $ref: '#/components/schemas/VerifyChainResponse'
140
+
141
+ /proof/stats:
142
+ get:
143
+ operationId: getStats
144
+ summary: Get event statistics
145
+ description: Retrieve aggregate statistics about proof events.
146
+ tags:
147
+ - Proof Events
148
+ responses:
149
+ '200':
150
+ description: Statistics retrieved
151
+ content:
152
+ application/json:
153
+ schema:
154
+ $ref: '#/components/schemas/StatsResponse'
155
+
156
+ /proof/latest:
157
+ get:
158
+ operationId: getLatest
159
+ summary: Get most recent event
160
+ description: Retrieve the most recently recorded proof event.
161
+ tags:
162
+ - Proof Events
163
+ responses:
164
+ '200':
165
+ description: Latest event found
166
+ content:
167
+ application/json:
168
+ schema:
169
+ $ref: '#/components/schemas/ProofEventDetailResponse'
170
+ '404':
171
+ $ref: '#/components/responses/NotFound'
172
+
173
+ components:
174
+ parameters:
175
+ EventId:
176
+ name: id
177
+ in: path
178
+ required: true
179
+ description: Proof event UUID
180
+ schema:
181
+ type: string
182
+ format: uuid
183
+
184
+ CorrelationId:
185
+ name: correlationId
186
+ in: path
187
+ required: true
188
+ description: Correlation ID for event trace
189
+ schema:
190
+ type: string
191
+ format: uuid
192
+
193
+ Limit:
194
+ name: limit
195
+ in: query
196
+ description: Maximum number of results (1-1000)
197
+ schema:
198
+ type: integer
199
+ minimum: 1
200
+ maximum: 1000
201
+ default: 100
202
+
203
+ Offset:
204
+ name: offset
205
+ in: query
206
+ description: Number of results to skip
207
+ schema:
208
+ type: integer
209
+ minimum: 0
210
+ default: 0
211
+
212
+ schemas:
213
+ SubmitProofRequest:
214
+ type: object
215
+ required:
216
+ - eventType
217
+ - correlationId
218
+ - payload
219
+ properties:
220
+ eventType:
221
+ type: string
222
+ enum:
223
+ - INTENT_RECEIVED
224
+ - DECISION_MADE
225
+ - EXECUTION_STARTED
226
+ - EXECUTION_COMPLETED
227
+ - EXECUTION_FAILED
228
+ - TRUST_DELTA
229
+ - COMPONENT_UPDATED
230
+ - POLICY_APPLIED
231
+ description: Type of proof event
232
+ correlationId:
233
+ type: string
234
+ format: uuid
235
+ description: Correlation ID linking related events
236
+ agentId:
237
+ type: string
238
+ format: uuid
239
+ description: Optional agent identifier
240
+ payload:
241
+ type: object
242
+ additionalProperties: true
243
+ description: Event-specific payload data
244
+
245
+ ProofEvent:
246
+ type: object
247
+ properties:
248
+ eventId:
249
+ type: string
250
+ format: uuid
251
+ description: Unique event identifier
252
+ eventType:
253
+ type: string
254
+ description: Type of proof event
255
+ correlationId:
256
+ type: string
257
+ format: uuid
258
+ description: Correlation ID
259
+ agentId:
260
+ type: string
261
+ format: uuid
262
+ nullable: true
263
+ description: Agent identifier
264
+ payload:
265
+ type: object
266
+ additionalProperties: true
267
+ description: Event payload
268
+ eventHash:
269
+ type: string
270
+ description: SHA-256 hash of event content
271
+ previousHash:
272
+ type: string
273
+ nullable: true
274
+ description: Hash of previous event in chain
275
+ occurredAt:
276
+ type: string
277
+ format: date-time
278
+ description: When the event occurred
279
+ recordedAt:
280
+ type: string
281
+ format: date-time
282
+ description: When the event was recorded
283
+ signedBy:
284
+ type: string
285
+ nullable: true
286
+ description: Service that signed the event
287
+ signature:
288
+ type: string
289
+ nullable: true
290
+ description: Ed25519 digital signature
291
+ shadowMode:
292
+ type: string
293
+ enum: [production, shadow, testnet, verified]
294
+ nullable: true
295
+ description: Shadow mode status
296
+
297
+ ProofEventResponse:
298
+ type: object
299
+ properties:
300
+ data:
301
+ type: object
302
+ properties:
303
+ eventId:
304
+ type: string
305
+ format: uuid
306
+ eventType:
307
+ type: string
308
+ correlationId:
309
+ type: string
310
+ format: uuid
311
+ eventHash:
312
+ type: string
313
+ previousHash:
314
+ type: string
315
+ nullable: true
316
+ occurredAt:
317
+ type: string
318
+ format: date-time
319
+ recordedAt:
320
+ type: string
321
+ format: date-time
322
+ meta:
323
+ $ref: '#/components/schemas/ResponseMeta'
324
+
325
+ ProofEventDetailResponse:
326
+ type: object
327
+ properties:
328
+ data:
329
+ $ref: '#/components/schemas/ProofEvent'
330
+ meta:
331
+ $ref: '#/components/schemas/ResponseMeta'
332
+
333
+ VerifyEventResponse:
334
+ type: object
335
+ properties:
336
+ data:
337
+ type: object
338
+ properties:
339
+ eventId:
340
+ type: string
341
+ format: uuid
342
+ verification:
343
+ type: object
344
+ properties:
345
+ hashValid:
346
+ type: boolean
347
+ description: Whether the event hash is valid
348
+ computedHash:
349
+ type: string
350
+ description: Computed hash of event content
351
+ storedHash:
352
+ type: string
353
+ description: Stored hash in event
354
+ signatureValid:
355
+ type: boolean
356
+ nullable: true
357
+ description: Whether the signature is valid (null if unsigned)
358
+ signatureError:
359
+ type: string
360
+ nullable: true
361
+ description: Signature verification error
362
+ signer:
363
+ type: string
364
+ nullable: true
365
+ description: Signer identity
366
+ verifiedAt:
367
+ type: string
368
+ format: date-time
369
+ meta:
370
+ $ref: '#/components/schemas/ResponseMeta'
371
+
372
+ ChainTraceResponse:
373
+ type: object
374
+ properties:
375
+ data:
376
+ type: object
377
+ properties:
378
+ correlationId:
379
+ type: string
380
+ format: uuid
381
+ events:
382
+ type: array
383
+ items:
384
+ $ref: '#/components/schemas/ProofEvent'
385
+ total:
386
+ type: integer
387
+ description: Total number of events in trace
388
+ pagination:
389
+ $ref: '#/components/schemas/Pagination'
390
+ meta:
391
+ $ref: '#/components/schemas/ResponseMeta'
392
+
393
+ VerifyChainRequest:
394
+ type: object
395
+ properties:
396
+ fromEventId:
397
+ type: string
398
+ format: uuid
399
+ description: Start verification from this event
400
+ limit:
401
+ type: integer
402
+ minimum: 1
403
+ maximum: 10000
404
+ description: Maximum events to verify
405
+
406
+ VerifyChainResponse:
407
+ type: object
408
+ properties:
409
+ data:
410
+ type: object
411
+ properties:
412
+ chain:
413
+ type: object
414
+ properties:
415
+ valid:
416
+ type: boolean
417
+ description: Whether chain integrity is valid
418
+ verifiedCount:
419
+ type: integer
420
+ description: Number of events verified
421
+ totalEvents:
422
+ type: integer
423
+ description: Total events in chain
424
+ firstEventId:
425
+ type: string
426
+ format: uuid
427
+ nullable: true
428
+ lastEventId:
429
+ type: string
430
+ format: uuid
431
+ nullable: true
432
+ brokenAtEventId:
433
+ type: string
434
+ format: uuid
435
+ nullable: true
436
+ description: Event ID where chain broke
437
+ brokenAtIndex:
438
+ type: integer
439
+ nullable: true
440
+ description: Index where chain broke
441
+ error:
442
+ type: string
443
+ nullable: true
444
+ description: Error description
445
+ signatures:
446
+ type: object
447
+ nullable: true
448
+ properties:
449
+ totalEvents:
450
+ type: integer
451
+ validCount:
452
+ type: integer
453
+ invalidCount:
454
+ type: integer
455
+ unsignedCount:
456
+ type: integer
457
+ success:
458
+ type: boolean
459
+ fullyVerified:
460
+ type: boolean
461
+ description: Chain and signatures both valid
462
+ verifiedAt:
463
+ type: string
464
+ format: date-time
465
+ meta:
466
+ $ref: '#/components/schemas/ResponseMeta'
467
+
468
+ StatsResponse:
469
+ type: object
470
+ properties:
471
+ data:
472
+ type: object
473
+ properties:
474
+ totalEvents:
475
+ type: integer
476
+ description: Total number of events
477
+ eventsByType:
478
+ type: object
479
+ additionalProperties:
480
+ type: integer
481
+ description: Count by event type
482
+ oldestEvent:
483
+ type: string
484
+ format: date-time
485
+ nullable: true
486
+ newestEvent:
487
+ type: string
488
+ format: date-time
489
+ nullable: true
490
+ shadowModeStats:
491
+ type: object
492
+ additionalProperties:
493
+ type: integer
494
+ nullable: true
495
+ meta:
496
+ $ref: '#/components/schemas/ResponseMeta'
497
+
498
+ ResponseMeta:
499
+ type: object
500
+ properties:
501
+ requestId:
502
+ type: string
503
+ description: Request identifier for correlation
504
+ timestamp:
505
+ type: string
506
+ format: date-time
507
+ description: Response timestamp
508
+
509
+ Pagination:
510
+ type: object
511
+ properties:
512
+ offset:
513
+ type: integer
514
+ limit:
515
+ type: integer
516
+ hasMore:
517
+ type: boolean
518
+
519
+ ErrorResponse:
520
+ type: object
521
+ properties:
522
+ error:
523
+ type: object
524
+ properties:
525
+ code:
526
+ type: string
527
+ description: Error code
528
+ message:
529
+ type: string
530
+ description: Human-readable error message
531
+ details:
532
+ type: object
533
+ additionalProperties: true
534
+ description: Additional error details
535
+
536
+ responses:
537
+ NotFound:
538
+ description: Resource not found
539
+ content:
540
+ application/json:
541
+ schema:
542
+ $ref: '#/components/schemas/ErrorResponse'
543
+ example:
544
+ error:
545
+ code: EVENT_NOT_FOUND
546
+ message: Proof event not found
547
+
548
+ ValidationError:
549
+ description: Request validation failed
550
+ content:
551
+ application/json:
552
+ schema:
553
+ $ref: '#/components/schemas/ErrorResponse'
554
+ example:
555
+ error:
556
+ code: VALIDATION_ERROR
557
+ message: Request validation failed
558
+ details:
559
+ - path: ["eventType"]
560
+ message: Required
561
+
562
+ InternalError:
563
+ description: Internal server error
564
+ content:
565
+ application/json:
566
+ schema:
567
+ $ref: '#/components/schemas/ErrorResponse'
568
+ example:
569
+ error:
570
+ code: INTERNAL_ERROR
571
+ message: An unexpected error occurred
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vorionsys/proof-plane",
3
- "version": "0.1.0",
4
- "description": "Vorion Proof Plane - Immutable audit trail for AI agent operations",
3
+ "version": "0.1.2",
4
+ "description": "Immutable dual-hash audit trail for AI agent governance decisions (SHA-256 + SHA3-256 chain, Ed25519 signatures)",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -20,10 +20,18 @@
20
20
  "./proof-plane": {
21
21
  "types": "./dist/proof-plane/index.d.ts",
22
22
  "import": "./dist/proof-plane/index.js"
23
+ },
24
+ "./api": {
25
+ "types": "./dist/api/index.d.ts",
26
+ "import": "./dist/api/index.js"
23
27
  }
24
28
  },
25
29
  "files": [
26
- "dist"
30
+ "dist",
31
+ "openapi.yaml",
32
+ "README.md",
33
+ "LICENSE",
34
+ "CHANGELOG.md"
27
35
  ],
28
36
  "scripts": {
29
37
  "build": "tsc",
@@ -33,16 +41,49 @@
33
41
  "test:coverage": "vitest run --coverage",
34
42
  "typecheck": "tsc --noEmit",
35
43
  "lint": "eslint src",
36
- "clean": "rm -rf dist"
44
+ "clean": "rimraf dist"
37
45
  },
38
46
  "dependencies": {
39
- "@vorionsys/contracts": "*",
40
- "uuid": "^11.0.4"
47
+ "@vorionsys/contracts": "^0.1.1",
48
+ "uuid": "^11.0.4",
49
+ "zod": "^3.24.0"
41
50
  },
42
51
  "devDependencies": {
43
52
  "@types/node": "^22.10.5",
44
53
  "@types/uuid": "^10.0.0",
45
54
  "typescript": "^5.7.2",
46
- "vitest": "^2.1.8"
55
+ "vitest": "^4.0.18"
56
+ },
57
+ "keywords": [
58
+ "vorion",
59
+ "basis",
60
+ "proof-plane",
61
+ "audit-trail",
62
+ "hash-chain",
63
+ "dual-hash",
64
+ "sha256",
65
+ "sha3",
66
+ "ed25519",
67
+ "immutable",
68
+ "tamper-detection",
69
+ "cryptographic",
70
+ "ai",
71
+ "agent",
72
+ "governance",
73
+ "compliance"
74
+ ],
75
+ "author": "Vorion <team@vorion.org>",
76
+ "license": "Apache-2.0",
77
+ "repository": {
78
+ "type": "git",
79
+ "url": "git+https://github.com/vorionsys/vorion.git",
80
+ "directory": "packages/proof-plane"
81
+ },
82
+ "bugs": {
83
+ "url": "https://github.com/vorionsys/vorion/issues"
84
+ },
85
+ "homepage": "https://vorion.org",
86
+ "engines": {
87
+ "node": ">=18.0.0"
47
88
  }
48
89
  }