@vorionsys/proof-plane 0.1.1 → 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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,57 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@vorionsys/proof-plane` will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.2] - 2026-02-17
9
+
10
+ ### Changed
11
+ - Standardized package metadata for npm publish
12
+
13
+ ## [0.1.1] - 2026-02-16
14
+
15
+ ### Added
16
+ - Dual-hash verification: SHA3-256 integrity anchor (`eventHash3`) alongside SHA-256 chain hash
17
+ - Ed25519 digital signatures for event authenticity and non-repudiation
18
+ - `generateSigningKeyPair()`, `signEvent()`, `verifyEventSignature()`
19
+ - `EventSigningService` class with trusted key management
20
+ - Batch signature verification via `verifyEventSignatures()`
21
+ - Shadow mode support for T0_SANDBOX testnet agents
22
+ - `getUnverifiedShadowEvents()` query
23
+ - `verifyShadowEvent()` for HITL verification workflow
24
+ - Hook manager integration (`EVENT_EMITTED` hook for A3I)
25
+ - REST API routes (Fastify + Express adapters)
26
+ - `POST /proof` -- submit events
27
+ - `GET /proof/:id` -- retrieve events
28
+ - `GET /proof/verify/:id` -- verify single event (hash + signature)
29
+ - `GET /proof/chain/:correlationId` -- trace queries
30
+ - `POST /proof/chain/verify` -- full chain verification
31
+ - `GET /proof/stats` -- aggregate statistics
32
+ - `GET /proof/latest` -- most recent event
33
+ - OpenAPI 3.1 specification (`openapi.yaml`)
34
+ - `ProofPlaneLogger` bridge for A3I authorization engine integration
35
+ - Combined chain + signature verification via `verifyChainAndSignatures()`
36
+ - Environment tagging (`production`, `testnet`, `development`)
37
+
38
+ ### Changed
39
+ - License updated from MIT to Apache-2.0
40
+
41
+ ## [0.1.0] - 2026-02-04
42
+
43
+ ### Added
44
+ - Initial release
45
+ - `ProofPlane` class with event logging (`logIntentReceived`, `logDecisionMade`, `logTrustDelta`, `logExecutionStarted`, `logExecutionCompleted`, `logExecutionFailed`)
46
+ - SHA-256 hash-chained event model with genesis event support
47
+ - `ProofEventStore` abstract interface for pluggable storage
48
+ - `InMemoryEventStore` reference implementation
49
+ - `ProofEventEmitter` with serialized emission and batch support
50
+ - Chain verification (`verifyChain`, `verifyChainWithDetails`)
51
+ - Correlation-based trace queries (`getTrace`)
52
+ - Agent history queries (`getAgentHistory`)
53
+ - Real-time event subscriptions (`subscribe`, `subscribeToType`)
54
+ - Event statistics (`getStats`)
55
+
56
+ [0.1.1]: https://github.com/vorionsys/vorion/compare/proof-plane-v0.1.0...proof-plane-v0.1.1
57
+ [0.1.0]: https://github.com/vorionsys/vorion/releases/tag/proof-plane-v0.1.0
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2025 Vorion Systems
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md CHANGED
@@ -1,6 +1,23 @@
1
1
  # @vorionsys/proof-plane
2
2
 
3
- Immutable audit trail for AI agent operations. Provides hash-chained, cryptographically signed event logging for compliance, debugging, and trust verification.
3
+ Immutable dual-hash audit trail for AI agent governance decisions.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@vorionsys/proof-plane)](https://www.npmjs.com/package/@vorionsys/proof-plane)
6
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ The **Proof Plane** is a core component of the [Vorion](https://github.com/vorionsys/vorion) AI governance stack, built on the **BASIS** (Baseline Authority for Safe & Interoperable Systems) framework. It provides a cryptographically verifiable, immutable audit trail for every decision made by AI agents -- from intent submission through authorization, execution, and trust score changes.
13
+
14
+ Every event in the proof plane is:
15
+
16
+ - **Hash-chained** using dual hashing (SHA-256 + SHA3-256) so that tampering with any record breaks the chain
17
+ - **Digitally signed** (optional Ed25519 signatures) for authenticity and non-repudiation
18
+ - **Correlation-linked** so that complete request traces can be reconstructed from intent to outcome
19
+
20
+ This makes the Proof Plane the **single source of truth** for compliance auditing, incident forensics, and trust calibration in multi-agent AI systems.
4
21
 
5
22
  ## Installation
6
23
 
@@ -8,154 +25,401 @@ Immutable audit trail for AI agent operations. Provides hash-chained, cryptograp
8
25
  npm install @vorionsys/proof-plane
9
26
  ```
10
27
 
28
+ > Requires Node.js >= 18.0.0
29
+
30
+ ## What is PROOF?
31
+
32
+ PROOF stands for the immutable audit trail at the heart of Vorion's AI governance model. Every time an AI agent submits an intent, receives an authorization decision, begins or completes execution, or has its trust score adjusted, a **proof event** is emitted and appended to the chain.
33
+
34
+ The proof chain answers critical governance questions:
35
+
36
+ - **What did this agent request?** (INTENT_RECEIVED)
37
+ - **Was it authorized, and why?** (DECISION_MADE -- includes trust band, score, and reasoning)
38
+ - **What trust score change occurred?** (TRUST_DELTA)
39
+ - **Did execution succeed or fail?** (EXECUTION_STARTED / EXECUTION_COMPLETED / EXECUTION_FAILED)
40
+ - **Has anyone tampered with this record?** (Chain and signature verification)
41
+
42
+ ## How Dual-Hash Works
43
+
44
+ Each proof event carries two independent hashes for defense-in-depth tamper detection:
45
+
46
+ ```
47
+ Event N
48
+ +--------------------------------------------+
49
+ | eventId, eventType, correlationId, |
50
+ | agentId, payload, occurredAt, signedBy |
51
+ | previousHash -----> Event N-1 eventHash |
52
+ +--------------------------------------------+
53
+ | eventHash = SHA-256(canonical content) | <-- primary chain hash
54
+ | eventHash3 = SHA3-256(canonical content) | <-- integrity anchor
55
+ +--------------------------------------------+
56
+ ```
57
+
58
+ 1. **SHA-256 content hash (`eventHash`)** -- The primary chain hash. Each event's `previousHash` field points to the preceding event's `eventHash`, forming a linked chain identical in principle to a blockchain.
59
+
60
+ 2. **SHA3-256 integrity anchor (`eventHash3`)** -- A secondary hash computed with a different algorithm family (Keccak-based SHA-3). Even if a collision or weakness is discovered in SHA-256, the SHA3-256 anchor provides an independent integrity check.
61
+
62
+ Content is **canonically serialized** (sorted keys, deterministic JSON) before hashing, guaranteeing that the same logical event always produces the same hash regardless of property insertion order.
63
+
64
+ **Verification** walks the chain from genesis to tip, recomputing both hashes for every event and confirming that each `previousHash` matches the prior event's `eventHash`. A single mismatch pinpoints the exact tampered record.
65
+
11
66
  ## Quick Start
12
67
 
13
68
  ```typescript
14
- import { createProofPlane, createInMemoryEventStore } from '@vorionsys/proof-plane';
69
+ import {
70
+ createProofPlane,
71
+ createInMemoryEventStore,
72
+ } from '@vorionsys/proof-plane';
15
73
 
74
+ // 1. Create an event store (in-memory for dev; use Postgres/Supabase in production)
16
75
  const store = createInMemoryEventStore();
76
+
77
+ // 2. Create the proof plane
17
78
  const proofPlane = createProofPlane({
18
79
  signedBy: 'my-service',
19
80
  store,
20
81
  });
21
82
 
22
- // Log events
23
- await proofPlane.logIntentReceived(intent);
24
- await proofPlane.logDecisionMade(decision);
83
+ // 3. Log governance events
84
+ const intentResult = await proofPlane.logIntentReceived(intent);
85
+ const decisionResult = await proofPlane.logDecisionMade(decision);
25
86
 
26
- // Query events by correlation ID
87
+ // 4. Retrieve a full request trace by correlation ID
27
88
  const trace = await proofPlane.getTrace(correlationId);
89
+ // Returns: [INTENT_RECEIVED, DECISION_MADE, ...] in chronological order
28
90
 
29
- // Verify hash chain integrity
91
+ // 5. Verify chain integrity
30
92
  const verification = await proofPlane.verifyChain();
31
- console.log(verification.valid); // true
93
+ console.log(verification.valid); // true
94
+ console.log(verification.verifiedCount); // number of events checked
32
95
  ```
33
96
 
34
- ## Features
97
+ ## Usage Examples
35
98
 
36
- - **Hash-Chained Events**: Every event links to the previous via SHA-256, forming a tamper-evident chain
37
- - **Cryptographic Signatures**: Ed25519 event signing with key pair generation and batch verification
38
- - **Pluggable Storage**: Abstract `ProofEventStore` interface - bring your own database
39
- - **Event Emitter**: Typed event system with batch emit support
40
- - **Trace Queries**: Retrieve full event traces by correlation ID
41
- - **Chain Verification**: Verify integrity of the entire hash chain with detailed reports
42
- - **API Routes**: Pre-built Express/Fastify route handlers for proof endpoints
43
-
44
- ## Subpath Imports
99
+ ### Creating and Chaining Proof Events
45
100
 
46
101
  ```typescript
47
- // Core proof plane
48
- import { createProofPlane, ProofPlane } from '@vorionsys/proof-plane';
102
+ import { createProofPlane } from '@vorionsys/proof-plane';
49
103
 
50
- // Event stores
51
- import { InMemoryEventStore } from '@vorionsys/proof-plane/events';
104
+ const proofPlane = createProofPlane({ signedBy: 'auth-service' });
52
105
 
53
- // Proof plane internals
54
- import { ProofPlane } from '@vorionsys/proof-plane/proof-plane';
106
+ // Log an intent (first event becomes the genesis -- previousHash is null)
107
+ const r1 = await proofPlane.logIntentReceived(intent);
108
+ console.log(r1.isGenesis); // true
109
+ console.log(r1.previousHash); // null
55
110
 
56
- // API route handlers
57
- import { createProofRoutes } from '@vorionsys/proof-plane/api';
58
- ```
111
+ // Log a decision (chains to previous event)
112
+ const r2 = await proofPlane.logDecisionMade(decision);
113
+ console.log(r2.isGenesis); // false
114
+ console.log(r2.previousHash); // r1.event.eventHash
59
115
 
60
- ## API Reference
61
-
62
- ### ProofPlane
116
+ // Log execution lifecycle
117
+ await proofPlane.logExecutionStarted(executionId, actionId, decisionId, adapterId, agentId, correlationId);
118
+ await proofPlane.logExecutionCompleted(executionId, actionId, durationMs, outputHash, agentId, correlationId);
63
119
 
64
- ```typescript
65
- const plane = createProofPlane({
66
- signedBy: 'service-name', // Identifier for the signing service
67
- store: eventStore, // ProofEventStore implementation
68
- });
69
-
70
- // Log lifecycle events
71
- await plane.logIntentReceived(intent);
72
- await plane.logDecisionMade(decision);
120
+ // Log trust score changes
121
+ await proofPlane.logTrustDelta(agentId, previousProfile, newProfile, 'Positive behavioral evidence');
122
+ ```
73
123
 
74
- // Query
75
- const trace = await plane.getTrace(correlationId);
76
- const events = await plane.queryEvents({ limit: 100, offset: 0 });
124
+ ### Verifying Chain Integrity
77
125
 
78
- // Verify chain
79
- const result = await plane.verifyChain();
80
- // { valid: boolean, checkedCount: number, errors: string[] }
126
+ ```typescript
127
+ // Verify the entire chain
128
+ const result = await proofPlane.verifyChain();
129
+ // {
130
+ // valid: true,
131
+ // verifiedCount: 42,
132
+ // totalEvents: 42,
133
+ // firstEventId: '...',
134
+ // lastEventId: '...'
135
+ // }
136
+
137
+ // Verify a specific correlation chain
138
+ const traceResult = await proofPlane.verifyCorrelationChain(correlationId);
139
+
140
+ // Low-level: verify individual events
141
+ import { verifyEventHash, verifyChainWithDetails } from '@vorionsys/proof-plane';
142
+
143
+ const hashOk = await verifyEventHash(event); // recompute + compare SHA-256
144
+ const details = await verifyChainWithDetails(events); // full chain walk
81
145
  ```
82
146
 
83
- ### Hash Chain
147
+ ### Querying Audit Records
84
148
 
85
149
  ```typescript
86
- import {
87
- sha256,
88
- computeEventHash,
89
- verifyEventHash,
90
- verifyChain,
91
- verifyChainWithDetails,
92
- } from '@vorionsys/proof-plane';
150
+ // Get trace for a specific request
151
+ const trace = await proofPlane.getTrace(correlationId);
93
152
 
94
- const hash = sha256(data);
95
- const eventHash = computeEventHash(event);
96
- const isValid = verifyEventHash(event);
97
- const chainResult = verifyChainWithDetails(events);
153
+ // Get all events for an agent
154
+ const history = await proofPlane.getAgentHistory(agentId);
155
+
156
+ // Query with filters and pagination
157
+ const result = await proofPlane.queryEvents(
158
+ { agentId, eventTypes: [ProofEventType.DECISION_MADE] },
159
+ { limit: 50, offset: 0, order: 'desc' }
160
+ );
161
+ console.log(result.events);
162
+ console.log(result.totalCount);
163
+ console.log(result.hasMore);
164
+
165
+ // Get statistics
166
+ const stats = await proofPlane.getStats();
167
+ // { totalEvents, byType: { INTENT_RECEIVED: 10, ... }, byAgent: { ... } }
98
168
  ```
99
169
 
100
- ### Event Signatures
170
+ ### Ed25519 Digital Signatures
101
171
 
102
172
  ```typescript
103
173
  import {
174
+ createProofPlane,
104
175
  generateSigningKeyPair,
105
- signEvent,
106
- verifyEventSignature,
107
- EventSigningService,
176
+ createSigningService,
108
177
  } from '@vorionsys/proof-plane';
109
178
 
110
- // Generate keys
111
- const keyPair = await generateSigningKeyPair();
179
+ // Generate a key pair
180
+ const keyPair = await generateSigningKeyPair('auth-service');
181
+
182
+ // Create a signing service
183
+ const signingService = createSigningService({
184
+ serviceId: 'auth-service',
185
+ privateKey: keyPair.privateKey,
186
+ keyId: keyPair.keyId,
187
+ trustedKeys: [{ publicKey: keyPair.publicKey, keyId: keyPair.keyId, owner: 'auth-service' }],
188
+ });
189
+
190
+ // Create proof plane with signing enabled
191
+ const proofPlane = createProofPlane({
192
+ signedBy: 'auth-service',
193
+ enableSignatures: true,
194
+ signingService,
195
+ });
112
196
 
113
- // Sign an event
114
- const signature = await signEvent(event, keyPair.privateKey);
197
+ // Events are now automatically signed
198
+ const result = await proofPlane.logIntentReceived(intent);
199
+ console.log(result.event.signature); // base64-encoded Ed25519 signature
115
200
 
116
- // Verify
117
- const isValid = await verifyEventSignature(event, signature, keyPair.publicKey);
201
+ // Verify signatures
202
+ const sigResult = await proofPlane.verifyEventSignature(result.event);
203
+ console.log(sigResult.valid); // true
118
204
 
119
- // Or use the service
120
- const signer = createSigningService({ keyPair });
121
- const signed = await signer.sign(event);
205
+ // Verify both chain AND signatures in one call
206
+ const fullVerification = await proofPlane.verifyChainAndSignatures();
207
+ console.log(fullVerification.fullyVerified); // true
122
208
  ```
123
209
 
124
- ### Event Store
210
+ ### Real-Time Event Subscriptions
125
211
 
126
- Implement the `ProofEventStore` interface for custom storage:
212
+ ```typescript
213
+ // Subscribe to all events
214
+ const unsubscribe = proofPlane.subscribe((event) => {
215
+ console.log(`[${event.eventType}] ${event.correlationId}`);
216
+ });
217
+
218
+ // Subscribe to specific event types
219
+ proofPlane.subscribeToType(ProofEventType.DECISION_MADE, (event) => {
220
+ console.log('Decision:', event.payload);
221
+ });
222
+
223
+ // Unsubscribe when done
224
+ unsubscribe();
225
+ ```
226
+
227
+ ### Custom Event Stores
127
228
 
128
229
  ```typescript
129
230
  import type { ProofEventStore, EventQueryOptions } from '@vorionsys/proof-plane';
130
231
 
131
- class MyEventStore implements ProofEventStore {
132
- async append(event) { /* ... */ }
133
- async getByCorrelationId(id) { /* ... */ }
134
- async query(options: EventQueryOptions) { /* ... */ }
232
+ class PostgresEventStore implements ProofEventStore {
233
+ async append(event) { /* INSERT INTO proof_events ... */ }
234
+ async get(eventId) { /* SELECT ... WHERE event_id = $1 */ }
235
+ async getLatest() { /* SELECT ... ORDER BY occurred_at DESC LIMIT 1 */ }
236
+ async getLatestHash() { /* ... */ }
237
+ async query(filter?, options?) { /* ... */ }
238
+ async getByCorrelationId(id, options?) { /* ... */ }
239
+ async getByAgentId(id, options?) { /* ... */ }
240
+ async getByTimeRange(from, to, options?) { /* ... */ }
241
+ async getByType(type, options?) { /* ... */ }
242
+ async getSummaries(filter?, options?) { /* ... */ }
243
+ async getChain(fromEventId?, limit?) { /* ... */ }
244
+ async count(filter?) { /* ... */ }
135
245
  async getStats() { /* ... */ }
136
- async getChain(options) { /* ... */ }
246
+ async exists(eventId) { /* ... */ }
247
+ async clear() { /* ... */ }
137
248
  }
249
+
250
+ const proofPlane = createProofPlane({
251
+ store: new PostgresEventStore(pool),
252
+ signedBy: 'my-service',
253
+ });
138
254
  ```
139
255
 
140
- ### API Routes
256
+ ### REST API Routes
141
257
 
142
258
  ```typescript
143
- import { createProofRoutes, registerProofRoutes } from '@vorionsys/proof-plane';
144
-
145
259
  // Fastify
146
- registerProofRoutes(fastifyApp, { store });
260
+ import Fastify from 'fastify';
261
+ import { createProofPlane } from '@vorionsys/proof-plane';
262
+ import { registerProofRoutes } from '@vorionsys/proof-plane/api';
263
+
264
+ const app = Fastify();
265
+ const proofPlane = createProofPlane({ signedBy: 'api-service' });
266
+
267
+ await app.register(async (instance) => {
268
+ registerProofRoutes(instance, proofPlane);
269
+ }, { prefix: '/v1' });
147
270
 
148
271
  // Express
149
- import { createProofExpressRouter } from '@vorionsys/proof-plane';
150
- app.use('/proof', createProofExpressRouter({ store }));
272
+ import express from 'express';
273
+ import { createProofExpressRouter } from '@vorionsys/proof-plane/api';
274
+
275
+ const app = express();
276
+ const { handler } = createProofExpressRouter(proofPlane);
277
+ app.use('/v1', handler);
151
278
  ```
152
279
 
153
- ## TypeScript
280
+ **Available endpoints:**
281
+
282
+ | Method | Path | Description |
283
+ |--------|------|-------------|
284
+ | `POST` | `/proof` | Submit a new proof event |
285
+ | `GET` | `/proof/:id` | Retrieve a proof event by ID |
286
+ | `GET` | `/proof/verify/:id` | Verify a single event (hash + signature) |
287
+ | `GET` | `/proof/chain/:correlationId` | Get event trace by correlation ID |
288
+ | `POST` | `/proof/chain/verify` | Verify chain integrity |
289
+ | `GET` | `/proof/stats` | Get event statistics |
290
+ | `GET` | `/proof/latest` | Get the most recent event |
291
+
292
+ See [`openapi.yaml`](./openapi.yaml) for the full OpenAPI 3.1 specification.
293
+
294
+ ## Subpath Imports
295
+
296
+ The package exposes granular entry points for tree-shaking:
297
+
298
+ ```typescript
299
+ // Main entry -- everything
300
+ import { createProofPlane, sha256, InMemoryEventStore } from '@vorionsys/proof-plane';
301
+
302
+ // Events module -- stores, emitter, hash chain, signatures
303
+ import { InMemoryEventStore, createEventEmitter } from '@vorionsys/proof-plane/events';
304
+
305
+ // Proof Plane module -- ProofPlane class and logger
306
+ import { ProofPlane, createProofPlaneLogger } from '@vorionsys/proof-plane/proof-plane';
307
+
308
+ // API module -- REST route handlers
309
+ import { createProofRoutes, registerProofRoutes } from '@vorionsys/proof-plane/api';
310
+ ```
311
+
312
+ ## API Reference
313
+
314
+ ### Core
315
+
316
+ | Export | Type | Description |
317
+ |--------|------|-------------|
318
+ | `ProofPlane` | class | Main proof plane class |
319
+ | `createProofPlane(config?)` | function | Factory for ProofPlane instances |
320
+ | `ProofPlaneConfig` | type | Configuration options (store, signedBy, signatures, shadow mode, hooks) |
321
+
322
+ ### Event Logging (ProofPlane methods)
323
+
324
+ | Method | Description |
325
+ |--------|-------------|
326
+ | `logIntentReceived(intent, correlationId?)` | Log an intent submission |
327
+ | `logDecisionMade(decision, correlationId?)` | Log an authorization decision |
328
+ | `logTrustDelta(agentId, prevProfile, newProfile, reason, correlationId?)` | Log a trust score change |
329
+ | `logExecutionStarted(executionId, actionId, decisionId, adapterId, agentId, correlationId)` | Log execution start |
330
+ | `logExecutionCompleted(executionId, actionId, durationMs, outputHash, agentId, correlationId, status?)` | Log execution completion |
331
+ | `logExecutionFailed(executionId, actionId, error, durationMs, retryable, agentId, correlationId)` | Log execution failure |
332
+ | `logEvent(eventType, correlationId, payload, agentId?)` | Log a generic event |
333
+
334
+ ### Querying (ProofPlane methods)
335
+
336
+ | Method | Description |
337
+ |--------|-------------|
338
+ | `getEvent(eventId)` | Get event by ID |
339
+ | `getLatestEvent()` | Get most recent event |
340
+ | `getTrace(correlationId)` | Get all events for a correlation ID |
341
+ | `getAgentHistory(agentId, options?)` | Get all events for an agent |
342
+ | `getEventsByType(eventType, options?)` | Get events by type |
343
+ | `queryEvents(filter?, options?)` | Query with filters and pagination |
344
+ | `getEventCount(filter?)` | Count matching events |
345
+ | `getStats()` | Get aggregate statistics |
346
+
347
+ ### Verification (ProofPlane methods)
348
+
349
+ | Method | Description |
350
+ |--------|-------------|
351
+ | `verifyChain(fromEventId?, limit?)` | Verify hash chain integrity |
352
+ | `verifyCorrelationChain(correlationId)` | Verify chain for a correlation ID |
353
+ | `verifyEventSignature(event)` | Verify Ed25519 signature on an event |
354
+ | `verifySignatures(events)` | Batch signature verification |
355
+ | `verifyChainAndSignatures(fromEventId?, limit?)` | Verify both chain and signatures |
356
+
357
+ ### Hash Chain Utilities
358
+
359
+ | Export | Description |
360
+ |--------|-------------|
361
+ | `sha256(data)` | Compute SHA-256 hash |
362
+ | `sha3_256(data)` | Compute SHA3-256 hash |
363
+ | `computeEventHash(event)` | Compute SHA-256 event hash |
364
+ | `computeEventHash3(event)` | Compute SHA3-256 event hash |
365
+ | `verifyEventHash(event)` | Verify event SHA-256 hash |
366
+ | `verifyEventHash3(event)` | Verify event SHA3-256 hash |
367
+ | `verifyChainLink(event, previousEvent)` | Verify a single chain link |
368
+ | `verifyChain(events)` | Verify a chain of events |
369
+ | `verifyChainWithDetails(events)` | Verify chain with detailed results |
370
+ | `getGenesisHash()` | Get the genesis hash (null) |
371
+
372
+ ### Event Signatures
373
+
374
+ | Export | Description |
375
+ |--------|-------------|
376
+ | `generateSigningKeyPair(owner)` | Generate Ed25519 key pair |
377
+ | `signEvent(event, privateKey, signedBy)` | Sign an event |
378
+ | `verifyEventSignature(event, publicKey)` | Verify an event signature |
379
+ | `verifyEventSignatures(events, signingService)` | Batch verification |
380
+ | `EventSigningService` | class | Key management and signing service |
381
+ | `createSigningService(config)` | Factory for EventSigningService |
382
+
383
+ ### Event Store
384
+
385
+ | Export | Description |
386
+ |--------|-------------|
387
+ | `ProofEventStore` | interface | Abstract storage interface |
388
+ | `InMemoryEventStore` | class | Reference in-memory implementation |
389
+ | `createInMemoryEventStore()` | Factory for InMemoryEventStore |
390
+ | `EventStoreError` | class | Storage error type |
391
+ | `EventStoreErrorCode` | enum | Error codes (DUPLICATE_EVENT, NOT_FOUND, etc.) |
392
+
393
+ ### Event Emitter
394
+
395
+ | Export | Description |
396
+ |--------|-------------|
397
+ | `ProofEventEmitter` | class | Event creation with hash chaining |
398
+ | `createEventEmitter(config)` | Factory for ProofEventEmitter |
399
+
400
+ ### Logger (A3I Bridge)
401
+
402
+ | Export | Description |
403
+ |--------|-------------|
404
+ | `ProofPlaneLoggerImpl` | class | Bridges A3I authorization engine to proof plane |
405
+ | `createProofPlaneLogger(config)` | Factory for the logger |
406
+ | `noopProofPlaneLogger` | No-op logger when proof plane is not connected |
407
+
408
+ ### API Routes
409
+
410
+ | Export | Description |
411
+ |--------|-------------|
412
+ | `createProofRoutes(proofPlane)` | Create route definitions |
413
+ | `registerProofRoutes(fastify, proofPlane)` | Register routes on a Fastify instance |
414
+ | `createProofExpressRouter(proofPlane)` | Create an Express middleware handler |
415
+
416
+ ### Key Types
154
417
 
155
418
  ```typescript
156
419
  import type {
157
420
  ProofPlaneConfig,
158
421
  ProofPlaneLogger,
422
+ ProofPlaneLoggerConfig,
159
423
  ProofEventStore,
160
424
  EventQueryOptions,
161
425
  EventQueryResult,
@@ -163,12 +427,66 @@ import type {
163
427
  EventEmitterConfig,
164
428
  EventListener,
165
429
  EmitResult,
430
+ BatchEmitOptions,
431
+ BatchEmitResult,
166
432
  ChainVerificationResult,
167
433
  SigningKeyPair,
434
+ PublicKey,
168
435
  SignatureVerificationResult,
436
+ SigningServiceConfig,
437
+ BatchVerificationResult,
438
+ ProofRoute,
169
439
  } from '@vorionsys/proof-plane';
170
440
  ```
171
441
 
442
+ ## Shadow Mode (T0 Sandbox)
443
+
444
+ The proof plane supports **shadow mode** for sandbox and testnet environments. Events emitted in shadow mode are tagged and can be filtered separately, enabling safe experimentation with T0_SANDBOX agents whose events require human-in-the-loop (HITL) verification before counting toward production trust scores.
445
+
446
+ ```typescript
447
+ const sandboxPlane = createProofPlane({
448
+ signedBy: 'sandbox-service',
449
+ shadowMode: 'shadow',
450
+ environment: 'testnet',
451
+ });
452
+
453
+ // Query unverified shadow events
454
+ const pending = await sandboxPlane.getUnverifiedShadowEvents(agentId);
455
+
456
+ // Mark a shadow event as HITL-verified
457
+ await sandboxPlane.verifyShadowEvent(eventId, verificationId, 'human-reviewer', true);
458
+ ```
459
+
460
+ ## Architecture
461
+
462
+ The proof plane sits at the foundation of the Vorion governance stack:
463
+
464
+ ```
465
+ +----------------------------+
466
+ | Application Layer |
467
+ +----------------------------+
468
+ | A3I Authorization | <-- emits intents & decisions
469
+ +----------------------------+
470
+ | PROOF PLANE | <-- this package
471
+ | (dual-hash chain + |
472
+ | Ed25519 signatures) |
473
+ +----------------------------+
474
+ | Event Store | <-- pluggable (memory, Postgres, etc.)
475
+ +----------------------------+
476
+ ```
477
+
172
478
  ## License
173
479
 
174
- MIT
480
+ [Apache-2.0](./LICENSE)
481
+
482
+ ## Repository
483
+
484
+ This package is part of the [Vorion](https://github.com/vorionsys/vorion) monorepo.
485
+
486
+ ```
487
+ vorion/
488
+ packages/
489
+ proof-plane/ <-- you are here
490
+ contracts/
491
+ ...
492
+ ```
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/api/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KA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AAC;QACrB,KAAK,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;QACpB,IAAI,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;KACpB,CAAC;CACH;AA4BD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,EAAE,CA0PtE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE;IACP,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAClF,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACpF,EACD,UAAU,EAAE,UAAU,GACrB,IAAI,CA0CN;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,UAAU,GAAG;IAChE,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D,CA+CA"}
@@ -129,10 +129,11 @@ export function createProofRoutes(proofPlane) {
129
129
  ctx.reply.status(404).send(error('EVENT_NOT_FOUND', `Proof event ${params.id} not found`));
130
130
  return;
131
131
  }
132
- // Verify hash integrity
133
- const { computeEventHash } = await import('../events/hash-chain.js');
132
+ // Verify hash integrity (dual-hash: SHA-256 + SHA3-256)
133
+ const { computeEventHash, verifyEventHash3 } = await import('../events/hash-chain.js');
134
134
  const computedHash = await computeEventHash(event);
135
135
  const hashValid = computedHash === event.eventHash;
136
+ const hash3Valid = verifyEventHash3(event);
136
137
  // Verify signature if present
137
138
  let signatureResult = null;
138
139
  if (event.signature && proofPlane.isSignatureVerificationEnabled()) {
@@ -142,8 +143,10 @@ export function createProofRoutes(proofPlane) {
142
143
  eventId: event.eventId,
143
144
  verification: {
144
145
  hashValid,
146
+ hash3Valid,
145
147
  computedHash,
146
148
  storedHash: event.eventHash,
149
+ storedHash3: event.eventHash3 ?? null,
147
150
  signatureValid: signatureResult?.valid ?? null,
148
151
  signatureError: signatureResult?.error,
149
152
  signer: signatureResult?.signer,
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/api/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC;IACvC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CACtB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CACjC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,WAAW,EAA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b,QAAQ,EAAE,oBAAoB,EAAE,EAChC,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,eAAe,CAAC;IA4B3B;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAI1C;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAO7C;;OAEG;IACH,QAAQ,IAAI,eAAe;YAMb,cAAc;YAcd,mBAAmB;IA0EjC,OAAO,CAAC,aAAa;YA2BP,eAAe;CAU9B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,iBAAiB,CAEhF"}
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { v4 as uuidv4 } from 'uuid';
8
8
  import { EventStoreError, EventStoreErrorCode } from './event-store.js';
9
- import { computeEventHash, getGenesisHash } from './hash-chain.js';
9
+ import { computeEventHash, computeEventHash3, getGenesisHash } from './hash-chain.js';
10
10
  import { signEvent } from './event-signatures.js';
11
11
  /**
12
12
  * ProofEventEmitter - Creates properly hashed and chained events
@@ -180,12 +180,14 @@ export class ProofEventEmitter {
180
180
  ...eventWithoutHashAndSig,
181
181
  signature,
182
182
  };
183
- // Compute hash (includes signature if present)
183
+ // Compute dual hashes (includes signature if present)
184
184
  const eventHash = await computeEventHash(eventWithSig);
185
+ const eventHash3 = computeEventHash3(eventWithSig);
185
186
  // Create complete event
186
187
  const event = {
187
188
  ...eventWithSig,
188
189
  eventHash,
190
+ eventHash3,
189
191
  recordedAt: now,
190
192
  };
191
193
  // Validate the event
@@ -1 +1 @@
1
- {"version":3,"file":"event-emitter.js","sourceRoot":"","sources":["../../src/events/event-emitter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAQpC,OAAO,EAAwB,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,gBA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of event contains a hash of its contents and a reference
5
5
  * to the previous event's hash, forming an immutable chain.
6
+ *
7
+ * Dual-hash: SHA-256 (primary chain) + SHA3-256 (integrity anchor).
6
8
  */
7
9
  import type { ProofEvent } from '@vorionsys/contracts';
8
10
  /**
9
11
  * Create a SHA-256 hash of the given data
10
12
  */
11
13
  export declare function sha256(data: string): Promise<string>;
14
+ /**
15
+ * Create a SHA3-256 hash of the given data (integrity anchor)
16
+ */
17
+ export declare function sha3_256(data: string): string;
12
18
  /**
13
19
  * Compute the hash of an event's content
14
20
  */
15
21
  export declare function computeEventHash(event: Omit<ProofEvent, 'eventHash' | 'recordedAt'>): Promise<string>;
16
22
  /**
17
- * Verify that an event's hash is correct
23
+ * Compute the SHA3-256 integrity anchor hash for an event
24
+ */
25
+ export declare function computeEventHash3(event: Omit<ProofEvent, 'eventHash' | 'eventHash3' | 'recordedAt'>): string;
26
+ /**
27
+ * Verify that an event's SHA-256 hash is correct
18
28
  */
19
29
  export declare function verifyEventHash(event: ProofEvent): Promise<boolean>;
30
+ /**
31
+ * Verify that an event's SHA3-256 integrity hash is correct (if present)
32
+ * Returns true if hash3 is absent (pre-upgrade record).
33
+ */
34
+ export declare function verifyEventHash3(event: ProofEvent): boolean;
20
35
  /**
21
36
  * Verify that an event correctly chains to the previous event
22
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"hash-chain.d.ts","sourceRoot":"","sources":["../../src/events/hash-chain.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,sBAAsB,CAAC;AAE1E;;GAEG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAM1D;AAsDD;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,YAAY,CAAC,GAClD,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED;;GAEG;AACH,wBAAs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6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8BAA8B;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAanG"}
@@ -3,7 +3,10 @@
3
3
  *
4
4
  * Each proof event contains a hash of its contents and a reference
5
5
  * to the previous event's hash, forming an immutable chain.
6
+ *
7
+ * Dual-hash: SHA-256 (primary chain) + SHA3-256 (integrity anchor).
6
8
  */
9
+ import * as nodeCrypto from 'node:crypto';
7
10
  /**
8
11
  * Create a SHA-256 hash of the given data
9
12
  */
@@ -14,6 +17,12 @@ export async function sha256(data) {
14
17
  const hashArray = Array.from(new Uint8Array(hashBuffer));
15
18
  return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
16
19
  }
20
+ /**
21
+ * Create a SHA3-256 hash of the given data (integrity anchor)
22
+ */
23
+ export function sha3_256(data) {
24
+ return nodeCrypto.createHash('sha3-256').update(data).digest('hex');
25
+ }
17
26
  /**
18
27
  * Create the hashable representation of an event
19
28
  */
@@ -58,12 +67,31 @@ export async function computeEventHash(event) {
58
67
  return sha256(serialized);
59
68
  }
60
69
  /**
61
- * Verify that an event's hash is correct
70
+ * Compute the SHA3-256 integrity anchor hash for an event
71
+ */
72
+ export function computeEventHash3(event) {
73
+ const hashable = getHashableData(event);
74
+ const sortedHashable = sortObjectKeys(hashable);
75
+ const serialized = JSON.stringify(sortedHashable);
76
+ return sha3_256(serialized);
77
+ }
78
+ /**
79
+ * Verify that an event's SHA-256 hash is correct
62
80
  */
63
81
  export async function verifyEventHash(event) {
64
82
  const computedHash = await computeEventHash(event);
65
83
  return computedHash === event.eventHash;
66
84
  }
85
+ /**
86
+ * Verify that an event's SHA3-256 integrity hash is correct (if present)
87
+ * Returns true if hash3 is absent (pre-upgrade record).
88
+ */
89
+ export function verifyEventHash3(event) {
90
+ if (!event.eventHash3)
91
+ return true; // Pre-upgrade records don't have hash3
92
+ const computedHash3 = computeEventHash3(event);
93
+ return computedHash3 === event.eventHash3;
94
+ }
67
95
  /**
68
96
  * Verify that an event correctly chains to the previous event
69
97
  */
@@ -85,7 +113,7 @@ export async function verifyChain(events) {
85
113
  for (let i = 0; i < events.length; i++) {
86
114
  const event = events[i];
87
115
  const previousEvent = i === 0 ? null : events[i - 1];
88
- // Verify hash integrity
116
+ // Verify SHA-256 hash integrity
89
117
  const hashValid = await verifyEventHash(event);
90
118
  if (!hashValid) {
91
119
  return {
@@ -93,7 +121,18 @@ export async function verifyChain(events) {
93
121
  verifiedCount: i,
94
122
  brokenAtIndex: i,
95
123
  brokenAtEventId: event.eventId,
96
- error: `Event ${event.eventId} has invalid hash`,
124
+ error: `Event ${event.eventId} has invalid SHA-256 hash`,
125
+ };
126
+ }
127
+ // Verify SHA3-256 integrity anchor (if present)
128
+ const hash3Valid = verifyEventHash3(event);
129
+ if (!hash3Valid) {
130
+ return {
131
+ valid: false,
132
+ verifiedCount: i,
133
+ brokenAtIndex: i,
134
+ brokenAtEventId: event.eventId,
135
+ error: `Event ${event.eventId} has invalid SHA3-256 hash`,
97
136
  };
98
137
  }
99
138
  // Verify chain link
@@ -1 +1 @@
1
- {"version":3,"file":"hash-chain.js","sourceRoot":"","sources":["../../src/events/hash-chain.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAY;IACvC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CA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AC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,CAAC;AACd,CAAC;AAwBD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,MAAoB;IAC/D,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IAEzC,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,WAAW,EAAE,MAAM,CAAC,MAAM;QAC1B,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO;QAChC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,OAAO;QAC/C,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ export { ProofPlaneLoggerImpl, createProofPlaneLogger, noopProofPlaneLogger, typ
31
31
  export { type ProofEventStore, type EventQueryOptions, type EventQueryResult, type EventStats, EventStoreError, EventStoreErrorCode, } from './events/event-store.js';
32
32
  export { InMemoryEventStore, createInMemoryEventStore, } from './events/memory-store.js';
33
33
  export { ProofEventEmitter, createEventEmitter, type EventEmitterConfig, type EventListener, type EmitResult, type BatchEmitOptions, type BatchEmitResult, } from './events/event-emitter.js';
34
- export { sha256, computeEventHash, verifyEventHash, verifyChainLink, verifyChain, verifyChainWithDetails, getGenesisHash, type ChainVerificationResult, } from './events/hash-chain.js';
34
+ export { sha256, sha3_256, computeEventHash, computeEventHash3, verifyEventHash, verifyEventHash3, verifyChainLink, verifyChain, verifyChainWithDetails, getGenesisHash, type ChainVerificationResult, } from './events/hash-chain.js';
35
35
  export { generateSigningKeyPair, signEvent, verifyEventSignature, verifyEventSignatures, EventSigningService, createSigningService, type SigningKeyPair, type PublicKey, type SignatureVerificationResult, type SigningServiceConfig, type BatchVerificationResult, } from './events/event-signatures.js';
36
36
  export { createProofRoutes, registerProofRoutes, createProofExpressRouter, type ProofRoute, } from './api/index.js';
37
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,KAAK,uBAAuB,GAC7B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,sBAAsB,EACtB,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,KAAK,uBAAuB,GAC7B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,sBAAsB,EACtB,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ export { InMemoryEventStore, createInMemoryEventStore, } from './events/memory-s
35
35
  // Event emitter exports
36
36
  export { ProofEventEmitter, createEventEmitter, } from './events/event-emitter.js';
37
37
  // Hash chain exports
38
- export { sha256, computeEventHash, verifyEventHash, verifyChainLink, verifyChain, verifyChainWithDetails, getGenesisHash, } from './events/hash-chain.js';
38
+ export { sha256, sha3_256, computeEventHash, computeEventHash3, verifyEventHash, verifyEventHash3, verifyChainLink, verifyChain, verifyChainWithDetails, getGenesisHash, } from './events/hash-chain.js';
39
39
  // Event signature exports
40
40
  export { generateSigningKeyPair, signEvent, verifyEventSignature, verifyEventSignatures, EventSigningService, createSigningService, } from './events/event-signatures.js';
41
41
  // API route exports
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,eAAe;AACf,OAAO,EACL,UAAU,EACV,gBAAgB,GAEjB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GAGrB,MAAM,yBAAyB,CAAC;AAEjC,sBAAsB;AACtB,OAAO,EAKL,eAAe,EACf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAElC,wBAAwB;AACxB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,GAMnB,MAAM,2BAA2B,CAAC;AAEnC,qBAAqB;AACrB,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,cAAc,GAEf,MAAM,wBAAwB,CAAC;AAEhC,0BAA0B;AAC1B,OAAO,EACL,sBAAsB,EACtB,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GAMrB,MAAM,8BAA8B,CAAC;AAEtC,oBAAoB;AACpB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,GAEzB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,eAAe;AACf,OAAO,EACL,UAAU,EACV,gBAAgB,GAEjB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GAGrB,MAAM,yBAAyB,CAAC;AAEjC,sBAAsB;AACtB,OAAO,EAKL,eAAe,EACf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAElC,wBAAwB;AACxB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,GAMnB,MAAM,2BAA2B,CAAC;AAEnC,qBAAqB;AACrB,OAAO,EACL,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,sBAAsB,EACtB,cAAc,GAEf,MAAM,wBAAwB,CAAC;AAEhC,0BAA0B;AAC1B,OAAO,EACL,sBAAsB,EACtB,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GAMrB,MAAM,8BAA8B,CAAC;AAEtC,oBAAoB;AACpB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,GAEzB,MAAM,gBAAgB,CAAC"}
package/openapi.yaml CHANGED
@@ -7,10 +7,10 @@ info:
7
7
  version: 1.0.0
8
8
  contact:
9
9
  name: Vorion Team
10
- url: https://github.com/vorion-dev/vorion
10
+ url: https://github.com/vorionsys/vorion
11
11
  license:
12
- name: MIT
13
- url: https://opensource.org/licenses/MIT
12
+ name: Apache-2.0
13
+ url: https://www.apache.org/licenses/LICENSE-2.0
14
14
 
15
15
  servers:
16
16
  - url: /v1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vorionsys/proof-plane",
3
- "version": "0.1.1",
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
  },
@@ -28,7 +28,10 @@
28
28
  },
29
29
  "files": [
30
30
  "dist",
31
- "openapi.yaml"
31
+ "openapi.yaml",
32
+ "README.md",
33
+ "LICENSE",
34
+ "CHANGELOG.md"
32
35
  ],
33
36
  "scripts": {
34
37
  "build": "tsc",
@@ -38,10 +41,10 @@
38
41
  "test:coverage": "vitest run --coverage",
39
42
  "typecheck": "tsc --noEmit",
40
43
  "lint": "eslint src",
41
- "clean": "rm -rf dist"
44
+ "clean": "rimraf dist"
42
45
  },
43
46
  "dependencies": {
44
- "@vorionsys/contracts": "*",
47
+ "@vorionsys/contracts": "^0.1.1",
45
48
  "uuid": "^11.0.4",
46
49
  "zod": "^3.24.0"
47
50
  },
@@ -53,20 +56,32 @@
53
56
  },
54
57
  "keywords": [
55
58
  "vorion",
59
+ "basis",
56
60
  "proof-plane",
57
61
  "audit-trail",
58
62
  "hash-chain",
63
+ "dual-hash",
64
+ "sha256",
65
+ "sha3",
66
+ "ed25519",
67
+ "immutable",
68
+ "tamper-detection",
69
+ "cryptographic",
59
70
  "ai",
60
71
  "agent",
61
- "governance"
72
+ "governance",
73
+ "compliance"
62
74
  ],
63
75
  "author": "Vorion <team@vorion.org>",
64
- "license": "MIT",
76
+ "license": "Apache-2.0",
65
77
  "repository": {
66
78
  "type": "git",
67
- "url": "https://github.com/voriongit/vorion.git",
79
+ "url": "git+https://github.com/vorionsys/vorion.git",
68
80
  "directory": "packages/proof-plane"
69
81
  },
82
+ "bugs": {
83
+ "url": "https://github.com/vorionsys/vorion/issues"
84
+ },
70
85
  "homepage": "https://vorion.org",
71
86
  "engines": {
72
87
  "node": ">=18.0.0"