@weave_protocol/domere 1.2.6 β†’ 1.2.8

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 +234 -434
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,104 +1,38 @@
1
- # πŸ›‘οΈ Weave Protocol Security Suite
1
+ # βš–οΈ Dōmere - Judge Protocol
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@weave_protocol/domere.svg)](https://www.npmjs.com/package/@weave_protocol/domere)
4
4
  [![license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
5
5
  [![downloads](https://img.shields.io/npm/dm/@weave_protocol/domere.svg)](https://www.npmjs.com/package/@weave_protocol/domere)
6
6
 
7
- **Enterprise-grade security and orchestration infrastructure for AI agents.**
7
+ **Enterprise-grade verification, orchestration, compliance, and audit infrastructure for AI agents.**
8
8
 
9
- Weave Protocol provides defense-in-depth for autonomous AI systems: secret scanning, secure containment, intent verification, execution replay, multi-agent coordination, and compliance trackingβ€”all with blockchain anchoring for immutable audit trails.
9
+ Part of the [Weave Protocol Security Suite](https://github.com/Tyox-all/Weave_Protocol).
10
10
 
11
- ## πŸ“¦ Packages
11
+ ## ✨ Features
12
12
 
13
- | Package | Description | Install |
14
- |---------|-------------|---------|
15
- | **[@weave_protocol/mund](./mund)** | Guardian Protocol - Secret & threat scanning | `npm i @weave_protocol/mund` |
16
- | **[@weave_protocol/hord](./hord)** | Vault Protocol - Secure containment & sandboxing | `npm i @weave_protocol/hord` |
17
- | **[@weave_protocol/domere](./domere)** | Judge Protocol - Verification, orchestration & compliance | `npm i @weave_protocol/domere` |
18
- | **[@weave_protocol/witan](./witan)** | Council Protocol - Consensus, communication & governance | `npm i @weave_protocol/witan` |
19
- | **[@weave_protocol/api](./api)** | Universal REST API for all protocols | `npm i @weave_protocol/api` |
13
+ | Category | Features |
14
+ |----------|----------|
15
+ | **Verification** | Intent tracking, drift detection, execution replay, multi-agent handoff |
16
+ | **Orchestration** | Task scheduler, agent registry, shared state with locks |
17
+ | **Compliance** | SOC2 controls, HIPAA checkpoints, automated reporting |
18
+ | **Blockchain** | Solana & Ethereum anchoring for immutable audit trails |
20
19
 
21
- ## πŸ—οΈ Architecture
20
+ ## πŸ“¦ Installation
22
21
 
23
- ```
24
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
25
- β”‚ WEAVE PROTOCOL SUITE β”‚
26
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
27
- β”‚ β”‚
28
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
29
- β”‚ β”‚ MUND β”‚ β”‚ HORD β”‚ β”‚ DŌMERE β”‚ β”‚ WITAN β”‚ β”‚
30
- β”‚ β”‚ Guardian β”‚ β”‚ Vault β”‚ β”‚ Judge β”‚ β”‚ Council β”‚ β”‚
31
- β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
32
- β”‚ β”‚ β€’ Secrets β”‚ β”‚ β€’ Storage β”‚ β”‚ β€’ Intent β”‚ β”‚ β€’ Consensus β”‚ β”‚
33
- β”‚ β”‚ β€’ PII β”‚ β”‚ β€’ Redaction β”‚ β”‚ β€’ Replay β”‚ β”‚ β€’ Comms Bus β”‚ β”‚
34
- β”‚ β”‚ β€’ Injection β”‚ β”‚ β€’ Sandbox β”‚ β”‚ β€’ Handoff β”‚ β”‚ β€’ Policy β”‚ β”‚
35
- β”‚ β”‚ β€’ Exfil β”‚ β”‚ β€’ Encrypt β”‚ β”‚ β€’ Compliance β”‚ β”‚ β€’ Recovery β”‚ β”‚
36
- β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ Scheduler β”‚ β”‚ β€’ Voting β”‚ β”‚
37
- β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ Registry β”‚ β”‚ β€’ Channels β”‚ β”‚
38
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
39
- β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
40
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
41
- β”‚ β”‚ β”‚
42
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
43
- β”‚ β”‚ WITAN COUNCIL β”‚ β”‚
44
- β”‚ β”‚ (Orchestrator + N Agents) β”‚ β”‚
45
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
46
- β”‚ β”Œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”΄β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β” β”‚
47
- β”‚ β–Ό β–Ό β–Ό β–Ό β–Ό β–Ό β–Ό β–Ό β–Ό β”‚
48
- β”‚ [A1] [A2] [A3] [A4] [A5] [A6] [A7] [A8] [...] β”‚
49
- β”‚ β”‚
50
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
51
- β”‚ BLOCKCHAIN LAYER β”‚
52
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
53
- β”‚ β”‚ Solana β”‚ Ethereum β”‚ β”‚
54
- β”‚ β”‚ Devnet β”‚ Mainnet β”‚ β”‚
55
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
56
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
57
- ```
58
-
59
- ## πŸš€ Quick Start
60
-
61
- ### Option 1: Witan Council (Full Stack)
62
-
63
- ```typescript
64
- import { WitanCouncil } from '@weave_protocol/witan';
65
-
66
- const council = new WitanCouncil({
67
- signing_key: 'your-secret-key',
68
- max_agents: 10
69
- });
70
-
71
- await council.start();
72
-
73
- // Register agents with voting weights
74
- await council.registerAgent({
75
- name: 'researcher',
76
- capabilities: ['search', 'analysis'],
77
- voting_weight: 2
78
- });
79
-
80
- // Submit tasks, propose decisions, send messages
81
- await council.submitTask({ intent: 'Analyze market data', priority: 'high' });
82
-
83
- const proposal = await council.propose({
84
- title: 'Increase compute budget',
85
- type: 'resource',
86
- proposer_id: 'researcher'
87
- });
88
-
89
- await council.vote(proposal.id, 'researcher', 'approve');
22
+ ```bash
23
+ npm install @weave_protocol/domere
90
24
  ```
91
25
 
92
- ### Option 2: Dōmere Orchestration (Core)
26
+ ## πŸš€ Quick Start: Multi-Agent Orchestration
93
27
 
94
28
  ```typescript
95
29
  import { Orchestrator } from '@weave_protocol/domere';
96
30
 
97
- // Create orchestrator for 10 agents
31
+ // Configure agent limit as needed (no hard maximum)
98
32
  const orch = new Orchestrator({ max_agents: 10 });
99
33
  await orch.start();
100
34
 
101
- // Register agents with capabilities
35
+ // Register agents
102
36
  for (let i = 0; i < 10; i++) {
103
37
  await orch.registerAgent({
104
38
  name: `agent-${i}`,
@@ -108,149 +42,155 @@ for (let i = 0; i < 10; i++) {
108
42
  }
109
43
 
110
44
  // Submit tasks with dependencies
111
- const fetchTask = await orch.submitTask({
112
- intent: 'Fetch Q3 financial data',
113
- priority: 'high',
114
- required_capabilities: ['research']
45
+ const task1 = await orch.submitTask({
46
+ intent: 'Fetch Q3 data',
47
+ priority: 'high'
115
48
  });
116
49
 
117
- const analyzeTask = await orch.submitTask({
50
+ const task2 = await orch.submitTask({
118
51
  intent: 'Analyze Q3 trends',
119
- dependencies: [fetchTask.id], // Waits for fetch to complete
120
- required_capabilities: ['analysis']
52
+ dependencies: [task1.id] // Waits for task1
121
53
  });
122
54
 
123
- // Agents receive tasks via heartbeat
124
- const { tasks_to_run } = await orch.heartbeat('agent-0', []);
55
+ // Get stats
56
+ const stats = orch.getStats();
57
+ console.log(`${stats.agents.ready} agents ready, ${stats.tasks.queued} tasks queued`);
125
58
  ```
126
59
 
127
- ### Option 3: REST API (Any AI Agent)
128
-
129
- ```bash
130
- npm install @weave_protocol/api
131
- npx weave-api
132
- # Server running on http://localhost:3000
133
- ```
60
+ ---
134
61
 
135
- ```bash
136
- # Scan for secrets/threats
137
- curl -X POST http://localhost:3000/api/v1/mund/scan \
138
- -H "Content-Type: application/json" \
139
- -d '{"content": "AWS key: AKIAIOSFODNN7EXAMPLE"}'
140
-
141
- # Create verified thread
142
- curl -X POST http://localhost:3000/api/v1/domere/threads \
143
- -d '{"origin_type": "agent", "origin_identity": "gpt-4", "intent": "Process data"}'
144
- ```
62
+ ## πŸ“Š Task Scheduler
145
63
 
146
- ### Option 4: Direct Package Usage
64
+ Priority queue with dependencies, retries, and load balancing.
147
65
 
148
66
  ```typescript
149
- import { MundScanner } from '@weave_protocol/mund';
150
- import { HordVault } from '@weave_protocol/hord';
151
- import { ExecutionReplayManager, ComplianceManager } from '@weave_protocol/domere';
67
+ import { TaskScheduler } from '@weave_protocol/domere';
152
68
 
153
- // Scan for secrets
154
- const scanner = new MundScanner();
155
- const threats = await scanner.scan('API key: sk-1234567890abcdef');
69
+ const scheduler = new TaskScheduler();
156
70
 
157
- // Secure storage
158
- const vault = new HordVault();
159
- await vault.store('api-key', 'sk-1234...', { encryption: true });
71
+ const task = await scheduler.createTask({
72
+ intent: 'Analyze Q3 data',
73
+ priority: 'high',
74
+ dependencies: ['fetch-data-task'],
75
+ constraints: {
76
+ required_capabilities: ['data-analysis'],
77
+ max_duration_ms: 300000,
78
+ exclusive_resources: ['gpu-1']
79
+ },
80
+ retry_policy: {
81
+ max_retries: 3,
82
+ backoff: 'exponential'
83
+ }
84
+ });
160
85
 
161
- // Track execution
162
- const replay = new ExecutionReplayManager('encryption-key');
163
- await replay.recordAction({ thread_id: 'thr_1', agent_id: 'agent-1', ... });
86
+ // Auto-assign to best agent
87
+ const assignment = await scheduler.assignTask(task.id);
88
+
89
+ // Track progress
90
+ scheduler.onTaskProgress(task.id, (p) => console.log(`${p.percent}%`));
91
+
92
+ // Handle completion
93
+ scheduler.onTaskComplete(task.id, (result) => {
94
+ console.log(`Completed in ${result.duration_ms}ms`);
95
+ });
164
96
  ```
165
97
 
166
98
  ---
167
99
 
168
- ## πŸ” Mund - Guardian Protocol
169
-
170
- Real-time threat detection for AI inputs/outputs.
100
+ ## πŸ€– Agent Registry
171
101
 
172
- **Detects:**
173
- - πŸ”‘ **Secrets**: API keys (OpenAI, AWS, GitHub, etc.), passwords, tokens
174
- - πŸ‘€ **PII**: SSN, emails, phone numbers, credit cards
175
- - πŸ’‰ **Injection**: Prompt injection, jailbreak attempts
176
- - πŸ“€ **Exfiltration**: Data theft patterns
102
+ Agent lifecycle, heartbeat monitoring, and failover.
177
103
 
178
104
  ```typescript
179
- import { MundScanner } from '@weave_protocol/mund';
180
-
181
- const scanner = new MundScanner();
182
- const result = await scanner.scan(`
183
- My AWS key is AKIAIOSFODNN7EXAMPLE
184
- and my SSN is 123-45-6789
185
- `);
186
-
187
- console.log(result.issues);
188
- // [
189
- // { type: 'secret', name: 'AWS Access Key', severity: 'critical' },
190
- // { type: 'pii', name: 'SSN', severity: 'high' }
191
- // ]
192
- ```
193
-
194
- ---
195
-
196
- ## πŸ›οΈ Hord - Vault Protocol
105
+ import { AgentRegistry } from '@weave_protocol/domere';
197
106
 
198
- Secure containment and sandboxed execution.
107
+ const registry = new AgentRegistry({
108
+ heartbeat_interval_ms: 5000,
109
+ heartbeat_timeout_ms: 15000
110
+ });
199
111
 
200
- **Features:**
201
- - πŸ”’ Encrypted secret storage
202
- - πŸ“ Automatic redaction
203
- - πŸ–οΈ Sandboxed code execution
204
- - πŸ” Access control policies
112
+ // Register agent
113
+ const agent = await registry.register({
114
+ agent_id: 'agent-7',
115
+ capabilities: ['code-generation', 'testing'],
116
+ max_concurrent_tasks: 3
117
+ });
205
118
 
206
- ```typescript
207
- import { HordVault } from '@weave_protocol/hord';
119
+ await registry.setReady('agent-7');
208
120
 
209
- const vault = new HordVault({ encryption_key: process.env.VAULT_KEY });
121
+ // Process heartbeats
122
+ await registry.heartbeat({
123
+ agent_id: 'agent-7',
124
+ current_tasks: ['task_1', 'task_2']
125
+ });
210
126
 
211
- // Store secrets securely
212
- await vault.store('openai-key', 'sk-...', { ttl: 3600 });
127
+ // Handle failures
128
+ registry.onAgentDown((agent, tasks) => {
129
+ console.log(`${agent.id} down with ${tasks.length} tasks`);
130
+ // Reassign tasks...
131
+ });
213
132
 
214
- // Redact sensitive data
215
- const safe = await vault.redact('My SSN is 123-45-6789');
216
- // β†’ "My SSN is [REDACTED]"
133
+ // Find best agent
134
+ const best = registry.getBestAgent({
135
+ capabilities: ['code-generation'],
136
+ prefer_lowest_load: true
137
+ });
217
138
  ```
218
139
 
219
140
  ---
220
141
 
221
- ## βš–οΈ Dōmere - Judge Protocol
222
-
223
- Intent verification, orchestration, compliance, and blockchain anchoring.
142
+ ## πŸ—ƒοΈ State Manager
224
143
 
225
- ### 🎯 Intent Tracking & Drift Detection
144
+ Shared state with locking, branching, and conflict resolution.
226
145
 
227
146
  ```typescript
228
- import { ThreadManager } from '@weave_protocol/domere';
147
+ import { StateManager } from '@weave_protocol/domere';
229
148
 
230
- const manager = new ThreadManager();
149
+ const state = new StateManager({
150
+ conflict_resolution: 'last-write-wins'
151
+ });
231
152
 
232
- const thread = await manager.createThread({
233
- origin_type: 'human',
234
- origin_identity: 'user@company.com',
235
- intent: 'Generate quarterly report',
236
- constraints: ['read-only', 'no-external-api']
153
+ // Lock before writing
154
+ const lock = await state.acquireLock({
155
+ key: 'customer-db',
156
+ holder: 'agent-3',
157
+ duration_ms: 30000,
158
+ type: 'exclusive'
237
159
  });
238
160
 
239
- // Check for drift
240
- const drift = await manager.checkDrift(thread.id, 'Sending data to external API');
241
- // β†’ { drifted: true, reason: 'Violates no-external-api constraint' }
161
+ if (lock.acquired) {
162
+ await state.set('customer-db', { updated: true });
163
+ await state.releaseLock('customer-db', 'agent-3');
164
+ }
165
+
166
+ // Git-style branching
167
+ await state.createBranch('experiment', { parent: 'main' });
168
+ await state.set('config', newConfig, { branch: 'experiment' });
169
+
170
+ // Merge with conflict detection
171
+ const result = await state.merge('experiment', 'main');
172
+ if (result.conflicts.length > 0) {
173
+ // Resolve conflicts
174
+ }
175
+
176
+ // Snapshots for rollback
177
+ const snap = await state.createSnapshot();
178
+ // ... later ...
179
+ await state.restoreSnapshot(snap.id);
242
180
  ```
243
181
 
244
- ### πŸ”„ Execution Replay & Audit Trail
182
+ ---
183
+
184
+ ## πŸ”„ Execution Replay
245
185
 
246
- Complete forensic trail with cryptographic verification.
186
+ Tamper-proof audit trail with cryptographic verification.
247
187
 
248
188
  ```typescript
249
189
  import { ExecutionReplayManager } from '@weave_protocol/domere';
250
190
 
251
191
  const replay = new ExecutionReplayManager('encryption-key');
252
192
 
253
- // Record every action
193
+ // Record actions
254
194
  await replay.recordAction({
255
195
  thread_id: 'thr_xxx',
256
196
  agent_id: 'gpt-4-agent',
@@ -265,41 +205,57 @@ await replay.recordAction({
265
205
  tokens_out: 1000
266
206
  });
267
207
 
268
- // Get tamper-proof trail
208
+ // Get trail
269
209
  const trail = await replay.getExecutionTrail('thr_xxx');
270
210
  console.log(trail.integrity_valid); // true
271
- console.log(trail.merkle_root); // For blockchain anchoring
211
+ console.log(trail.merkle_root); // For blockchain
212
+
213
+ // Generate report
214
+ const report = await replay.generateAuditReport({
215
+ start_time: new Date('2026-01-01'),
216
+ end_time: new Date('2026-01-31')
217
+ });
272
218
  ```
273
219
 
274
- ### 🀝 Multi-Agent Handoff Verification
220
+ ---
275
221
 
276
- Secure delegation between AI agents with permission inheritance.
222
+ ## 🀝 Multi-Agent Handoff
223
+
224
+ Secure delegation with permission inheritance.
277
225
 
278
226
  ```typescript
279
227
  import { HandoffManager } from '@weave_protocol/domere';
280
228
 
281
229
  const handoff = new HandoffManager('signing-key', {
282
- max_delegation_depth: 5,
283
- max_handoff_duration_ms: 3600000
230
+ max_delegation_depth: 5
284
231
  });
285
232
 
286
- // Delegate from orchestrator to researcher
233
+ // Create handoff token
287
234
  const token = await handoff.createHandoff({
288
235
  thread_id: 'thr_xxx',
289
236
  from_agent: 'orchestrator',
290
237
  to_agent: 'researcher',
291
- delegated_intent: 'Find Q3 revenue data',
292
- constraints: ['read-only', 'internal-data-only'],
238
+ delegated_intent: 'Find Q3 data',
239
+ constraints: ['read-only'],
293
240
  permissions: [{ resource: 'database', actions: ['read'] }],
294
241
  max_actions: 10,
295
242
  expires_in_ms: 300000
296
243
  });
297
244
 
298
- // Researcher verifies before acting
299
- const verification = await handoff.verifyHandoff(token.token, 'researcher');
245
+ // Verify before acting
246
+ const v = await handoff.verifyHandoff(token.token, 'researcher');
247
+ if (v.valid) {
248
+ console.log(`${v.remaining_actions} actions left`);
249
+ }
250
+
251
+ // Track chain
252
+ const chain = await handoff.getDelegationChain('thr_xxx');
253
+ console.log(`Depth: ${chain.depth}, Valid: ${chain.integrity_valid}`);
300
254
  ```
301
255
 
302
- ### πŸ“‹ Compliance Checkpoints (SOC2/HIPAA)
256
+ ---
257
+
258
+ ## πŸ“‹ Compliance (SOC2/HIPAA)
303
259
 
304
260
  Automated compliance tracking and reporting.
305
261
 
@@ -311,282 +267,126 @@ const compliance = new ComplianceManager('signing-key');
311
267
  // HIPAA: Log PHI access
312
268
  await compliance.logPHIAccess({
313
269
  thread_id: 'thr_xxx',
314
- agent_id: 'medical-assistant',
270
+ agent_id: 'medical-ai',
315
271
  patient_id: 'patient_123',
316
- access_reason: 'Treatment recommendation',
317
- data_accessed: ['diagnosis', 'medications'],
272
+ access_reason: 'Treatment',
273
+ data_accessed: ['diagnosis'],
318
274
  legal_basis: 'treatment'
319
275
  });
320
276
 
321
- // Generate compliance report
322
- const report = await compliance.generateReport({
323
- framework: 'HIPAA',
324
- period_start: new Date('2026-01-01'),
325
- period_end: new Date('2026-03-31')
326
- });
327
- console.log('Score:', report.compliance_score);
328
- ```
329
-
330
- ### πŸ“Š Task Scheduler (Multi-Agent)
331
-
332
- Priority queue with dependencies, retries, and load balancing.
333
-
334
- ```typescript
335
- import { TaskScheduler } from '@weave_protocol/domere';
336
-
337
- const scheduler = new TaskScheduler();
338
-
339
- const task = await scheduler.createTask({
340
- intent: 'Analyze Q3 data',
341
- priority: 'high',
342
- dependencies: ['fetch-data-task'],
343
- constraints: {
344
- required_capabilities: ['data-analysis'],
345
- max_duration_ms: 300000
346
- },
347
- retry_policy: { max_retries: 3, backoff: 'exponential' }
277
+ // SOC2: Log access control
278
+ await compliance.logAccessControl({
279
+ thread_id: 'thr_xxx',
280
+ agent_id: 'admin-bot',
281
+ resource: 'reports',
282
+ action: 'grant',
283
+ success: true
348
284
  });
349
285
 
350
- const assignment = await scheduler.assignTask(task.id);
351
- ```
352
-
353
- ### πŸ€– Agent Registry (Health & Capabilities)
354
-
355
- Agent lifecycle, heartbeat monitoring, and failover.
356
-
357
- ```typescript
358
- import { AgentRegistry } from '@weave_protocol/domere';
359
-
360
- const registry = new AgentRegistry();
361
-
362
- const agent = await registry.register({
363
- agent_id: 'agent-7',
364
- capabilities: ['code-generation', 'testing'],
365
- max_concurrent_tasks: 3
286
+ // Generic checkpoint
287
+ await compliance.checkpoint({
288
+ thread_id: 'thr_xxx',
289
+ framework: 'SOC2',
290
+ control: 'CC6.1',
291
+ event_type: 'access',
292
+ event_description: 'Data accessed',
293
+ data_classification: 'confidential',
294
+ agent_id: 'agent-1',
295
+ sign: true
366
296
  });
367
297
 
368
- registry.onAgentDown((agent, activeTasks) => {
369
- console.log(`Agent ${agent.id} down, reassigning tasks`);
298
+ // Generate report
299
+ const report = await compliance.generateReport({
300
+ framework: 'HIPAA',
301
+ period_start: new Date('2026-01-01'),
302
+ period_end: new Date('2026-03-31')
370
303
  });
371
- ```
372
-
373
- ### πŸ—ƒοΈ State Manager (Shared State with Locks)
374
-
375
- Distributed state with locking, branching, and conflict resolution.
376
-
377
- ```typescript
378
- import { StateManager } from '@weave_protocol/domere';
379
-
380
- const state = new StateManager({ conflict_resolution: 'last-write-wins' });
381
-
382
- // Lock before writing
383
- const lock = await state.acquireLock({ key: 'db', holder: 'agent-3' });
384
- if (lock.acquired) {
385
- await state.set('db', { updated: true });
386
- await state.releaseLock('db', 'agent-3');
387
- }
388
-
389
- // Git-style branching
390
- await state.createBranch('experiment');
391
- await state.set('config', newConfig, { branch: 'experiment' });
392
- await state.merge('experiment', 'main');
393
- ```
394
-
395
- ### πŸŽ›οΈ Unified Orchestrator
396
-
397
- Single interface for multi-agent coordination.
398
-
399
- ```typescript
400
- import { Orchestrator } from '@weave_protocol/domere';
401
-
402
- const orch = new Orchestrator({ max_agents: 10 });
403
- await orch.start();
404
-
405
- for (let i = 0; i < 10; i++) {
406
- await orch.registerAgent({ name: `worker-${i}`, capabilities: ['general'] });
407
- }
408
-
409
- await orch.submitTask({ intent: 'Process batch', priority: 'high' });
410
-
411
- const stats = orch.getStats();
412
- console.log(`${stats.agents.ready}/${stats.agents.total} agents ready`);
304
+ console.log(`Score: ${report.compliance_score}`);
413
305
  ```
414
306
 
415
307
  ---
416
308
 
417
- ## πŸ›οΈ Witan - Council Protocol
309
+ ## ⛓️ Blockchain Anchoring
418
310
 
419
- Multi-agent consensus, communication, governance, and recovery.
420
-
421
- ### πŸ—³οΈ Consensus Engine
311
+ Immutable proof on Solana and Ethereum.
422
312
 
423
313
  ```typescript
424
- import { ConsensusEngine } from '@weave_protocol/witan';
425
-
426
- const consensus = new ConsensusEngine('signing-key', {
427
- default_quorum: 0.5,
428
- default_threshold: 0.6
429
- });
430
-
431
- const proposal = await consensus.createProposal({
432
- title: 'Deploy new model',
433
- proposal_type: 'action',
434
- proposer_id: 'orchestrator',
435
- eligible_voters: ['agent-1', 'agent-2', 'agent-3']
436
- });
437
-
438
- await consensus.vote(proposal.id, 'agent-1', 'approve');
439
- await consensus.vote(proposal.id, 'agent-2', 'approve');
440
-
441
- const result = await consensus.finalizeProposal(proposal.id);
442
- console.log(result.decision); // 'approved'
443
- ```
444
-
445
- ### πŸ“¨ Communication Bus
446
-
447
- ```typescript
448
- import { CommunicationBus } from '@weave_protocol/witan';
449
-
450
- const bus = new CommunicationBus('signing-key');
451
-
452
- // Direct message
453
- await bus.send({
454
- from: 'agent-1',
455
- to: 'agent-2',
456
- type: 'data-handoff',
457
- payload: { dataset_id: 'ds_123' }
458
- });
459
-
460
- // Broadcast to all
461
- await bus.broadcast({
462
- from: 'orchestrator',
463
- type: 'priority-change',
464
- payload: { all_tasks: 'high' }
465
- });
466
- ```
467
-
468
- ### πŸ“œ Policy Engine
469
-
470
- ```typescript
471
- import { PolicyEngine } from '@weave_protocol/witan';
472
-
473
- const policy = new PolicyEngine();
314
+ import { EthereumAnchor } from '@weave_protocol/domere';
474
315
 
475
- // Rate limit: 100 requests per minute
476
- await policy.createRateLimit({
477
- name: 'api-limit',
478
- targets: [{ type: 'all' }],
479
- max_requests: 100,
480
- window_ms: 60000
316
+ const anchor = new EthereumAnchor({
317
+ contract_address: '0xAA8b52adD3CEce6269d14C6335a79df451543820'
481
318
  });
482
319
 
483
- // Enforce
484
- const decision = await policy.enforce({
485
- agent_id: 'agent-1',
486
- action: 'api_call',
487
- timestamp: new Date()
488
- });
489
- ```
490
-
491
- ### πŸ”„ Recovery Manager
492
-
493
- ```typescript
494
- import { RecoveryManager } from '@weave_protocol/witan';
495
-
496
- const recovery = new RecoveryManager('signing-key');
497
-
498
- // Checkpoint
499
- const checkpoint = await recovery.checkpoint({
500
- name: 'Pre-deployment',
501
- created_by: 'admin'
502
- });
503
-
504
- // Transaction with auto-rollback
505
- const txn = await recovery.beginTransaction({
506
- initiator: 'agent-1',
507
- auto_checkpoint: true
320
+ await anchor.anchorThread({
321
+ thread_id: 'thr_xxx',
322
+ merkle_root: trail.merkle_root,
323
+ intent_hash: 'abc123...',
324
+ compliant: true
508
325
  });
509
-
510
- // ... operations ...
511
- await recovery.commitTransaction(txn.id);
512
- // or: await recovery.rollbackTransaction(txn.id);
513
326
  ```
514
327
 
515
- ---
516
-
517
- ## ⛓️ Blockchain Deployments
518
-
519
- | Chain | Network | Contract/Program | Explorer |
520
- |-------|---------|------------------|----------|
521
- | **Solana** | Mainnet | `6g7raTAHU2h331VKtfVtkS5pmuvR8vMYwjGsZF1CUj2o` | [View](https://solscan.io/account/6g7raTAHU2h331VKtfVtkS5pmuvR8vMYwjGsZF1CUj2o) |
522
- | **Solana** | Devnet | `BeCYVJYfbUu3k2TPGmh9VoGWeJwzm2hg2NdtnvbdBNCj` | [View](https://solscan.io/account/BeCYVJYfbUu3k2TPGmh9VoGWeJwzm2hg2NdtnvbdBNCj?cluster=devnet) |
523
- | **Ethereum** | Mainnet | `0xAA8b52adD3CEce6269d14C6335a79df451543820` | [View](https://etherscan.io/address/0xAA8b52adD3CEce6269d14C6335a79df451543820) |
328
+ | Chain | Network | Address |
329
+ |-------|---------|---------|
330
+ | Solana | Mainnet | `6g7raTAHU2h331VKtfVtkS5pmuvR8vMYwjGsZF1CUj2o` |
331
+ | Solana | Devnet | `BeCYVJYfbUu3k2TPGmh9VoGWeJwzm2hg2NdtnvbdBNCj` |
332
+ | Ethereum | Mainnet | `0xAA8b52adD3CEce6269d14C6335a79df451543820` |
524
333
 
525
334
  ---
526
335
 
527
- ## πŸ“Š Feature Matrix
528
-
529
- | Feature | Mund | Hord | Dōmere | Witan |
530
- |---------|:----:|:----:|:------:|:-----:|
531
- | Secret Detection | βœ… | | | |
532
- | PII Detection | βœ… | | | |
533
- | Injection Detection | βœ… | | | |
534
- | Encrypted Storage | | βœ… | | |
535
- | Redaction | | βœ… | | |
536
- | Sandboxing | | βœ… | | |
537
- | Intent Tracking | | | βœ… | |
538
- | Drift Detection | | | βœ… | |
539
- | Execution Replay | | | βœ… | |
540
- | Multi-Agent Handoff | | | βœ… | |
541
- | SOC2 Compliance | | | βœ… | |
542
- | HIPAA Compliance | | | βœ… | |
543
- | Task Scheduling | | | βœ… | |
544
- | Agent Registry | | | βœ… | |
545
- | Shared State/Locks | | | βœ… | |
546
- | Blockchain Anchoring | | | βœ… | |
547
- | Consensus/Voting | | | | βœ… |
548
- | Agent Messaging | | | | βœ… |
549
- | Policy Engine | | | | βœ… |
550
- | Checkpoints/Recovery | | | | βœ… |
336
+ ## πŸ“š API Reference
337
+
338
+ ### Orchestrator
339
+ | Method | Description |
340
+ |--------|-------------|
341
+ | `start()` | Start orchestrator |
342
+ | `registerAgent(params)` | Register new agent |
343
+ | `submitTask(params)` | Submit task to queue |
344
+ | `heartbeat(agentId, tasks)` | Process agent heartbeat |
345
+ | `taskCompleted(agentId, taskId, result)` | Report completion |
346
+ | `getStats()` | Get orchestrator stats |
347
+
348
+ ### TaskScheduler
349
+ | Method | Description |
350
+ |--------|-------------|
351
+ | `createTask(params)` | Create task with dependencies |
352
+ | `assignTask(taskId, agentId?)` | Assign to agent |
353
+ | `completeTask(taskId, agentId, result)` | Mark complete |
354
+ | `failTask(taskId, agentId, error)` | Mark failed (auto-retry) |
355
+ | `reassignFromAgent(agentId)` | Reassign failed agent's tasks |
356
+
357
+ ### AgentRegistry
358
+ | Method | Description |
359
+ |--------|-------------|
360
+ | `register(params)` | Register agent |
361
+ | `heartbeat(payload)` | Process heartbeat |
362
+ | `findAgents(query)` | Find matching agents |
363
+ | `drain(agentId)` | Stop accepting tasks |
364
+ | `deregister(agentId)` | Remove agent |
365
+
366
+ ### StateManager
367
+ | Method | Description |
368
+ |--------|-------------|
369
+ | `get(key)` / `set(key, value)` | Basic operations |
370
+ | `acquireLock(request)` | Acquire lock |
371
+ | `releaseLock(key, holder)` | Release lock |
372
+ | `createBranch(name)` | Create branch |
373
+ | `merge(source, target)` | Merge branches |
374
+ | `createSnapshot()` | Create snapshot |
551
375
 
552
376
  ---
553
377
 
554
- ## πŸ—ΊοΈ Roadmap
378
+ ## πŸ”— Related Packages
555
379
 
556
- ### Current (v1.x)
557
- - βœ… Mund - Secret & threat scanning
558
- - βœ… Hord - Secure vault & sandbox
559
- - βœ… Dōmere - Verification & orchestration
560
- - βœ… Witan - Consensus, communication & governance
561
- - βœ… REST API
562
- - βœ… Ethereum mainnet deployment
563
- - βœ… Solana mainnet deployment
564
-
565
- ### Next (v2.x)
566
- - πŸ”² MCP server integration
567
- - πŸ”² Advanced agent coordination patterns
568
- - πŸ”² Real-time monitoring dashboard
569
- - πŸ”² Additional compliance frameworks (PCI-DSS, ISO27001)
570
-
571
- ---
380
+ | Package | Description |
381
+ |---------|-------------|
382
+ | [@weave_protocol/witan](https://www.npmjs.com/package/@weave_protocol/witan) | Consensus, communication & governance |
383
+ | [@weave_protocol/mund](https://www.npmjs.com/package/@weave_protocol/mund) | Secret & threat scanning |
384
+ | [@weave_protocol/hord](https://www.npmjs.com/package/@weave_protocol/hord) | Secure vault & sandbox |
385
+ | [@weave_protocol/api](https://www.npmjs.com/package/@weave_protocol/api) | Universal REST API |
572
386
 
573
387
  ## πŸ“„ License
574
388
 
575
- Apache 2.0 - See [LICENSE](LICENSE) for details.
576
-
577
- ---
578
-
579
- ## 🀝 Contributing
580
-
581
- Contributions welcome! Here's how:
582
-
583
- 1. Fork the repository
584
- 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
585
- 3. Commit your changes (`git commit -m 'Add amazing feature'`)
586
- 4. Push to the branch (`git push origin feature/amazing-feature`)
587
- 5. Open a Pull Request
588
-
589
- Please ensure your code passes existing tests and follows the project's coding style.
389
+ Apache 2.0
590
390
 
591
391
  ---
592
392
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weave_protocol/domere",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "The Judge Protocol - Thread identity, intent verification, and blockchain anchoring",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",