agent-passport-system 1.4.0 → 1.5.1
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/README.md +129 -8
- package/dist/src/core/coordination.d.ts +101 -0
- package/dist/src/core/coordination.d.ts.map +1 -0
- package/dist/src/core/coordination.js +432 -0
- package/dist/src/core/coordination.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/types/coordination.d.ts +147 -0
- package/dist/src/types/coordination.d.ts.map +1 -0
- package/dist/src/types/coordination.js +9 -0
- package/dist/src/types/coordination.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/agent-passport-system)
|
|
4
4
|
[](https://github.com/aeoess/agent-passport-system/blob/main/LICENSE)
|
|
5
|
-
[](https://github.com/aeoess/agent-passport-system)
|
|
6
6
|
[](https://doi.org/10.5281/zenodo.18749779)
|
|
7
7
|
|
|
8
|
-
Cryptographic identity, ethical governance, economic attribution, protocol-native communication,
|
|
8
|
+
Cryptographic identity, ethical governance, economic attribution, protocol-native communication, intent architecture, cascade revocation, and coordination primitives for autonomous AI agents.
|
|
9
9
|
|
|
10
|
-
**
|
|
10
|
+
**7 layers. 165 tests. Zero heavy dependencies. Running code. MCP server included.**
|
|
11
11
|
|
|
12
12
|
> *As AI agents from different creators, running different models, serving different humans begin to collaborate — who is responsible, under what authority, according to what values, and who benefits?*
|
|
13
13
|
|
|
@@ -166,10 +166,83 @@ const eval = evaluateConsensus(delib)
|
|
|
166
166
|
// → { converged: true, standardDeviation: 4.2, recommendation: 'converged' }
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
+
### Layer 7 — Coordination Primitives
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
import {
|
|
173
|
+
createTaskBrief, assignTask, acceptTask,
|
|
174
|
+
submitEvidence, reviewEvidence, handoffEvidence,
|
|
175
|
+
submitDeliverable, completeTask
|
|
176
|
+
} from 'agent-passport-system'
|
|
177
|
+
|
|
178
|
+
// Operator creates a task brief
|
|
179
|
+
const brief = createTaskBrief({
|
|
180
|
+
title: 'Competitive Protocol Analysis',
|
|
181
|
+
roles: { researcher: { count: 1 }, analyst: { count: 1 } },
|
|
182
|
+
deliverables: [
|
|
183
|
+
{ id: 'd1', description: 'Evidence packet', assignedRole: 'researcher' },
|
|
184
|
+
{ id: 'd2', description: 'Synthesis report', assignedRole: 'analyst' }
|
|
185
|
+
],
|
|
186
|
+
acceptanceCriteria: [
|
|
187
|
+
{ id: 'c1', description: 'Min 3 sources', threshold: 70 }
|
|
188
|
+
]
|
|
189
|
+
}, operatorKeys)
|
|
190
|
+
|
|
191
|
+
// Assign agents to roles
|
|
192
|
+
const assigned = assignTask(brief, 'researcher', agentId, agentPubKey, ['web_search'], operatorKeys)
|
|
193
|
+
|
|
194
|
+
// Worker accepts
|
|
195
|
+
const accepted = acceptTask(assigned.brief, agentKeys)
|
|
196
|
+
|
|
197
|
+
// Researcher submits evidence (every claim needs a 10+ word quote)
|
|
198
|
+
const evidence = submitEvidence({
|
|
199
|
+
taskId: brief.id, role: 'researcher',
|
|
200
|
+
claims: [
|
|
201
|
+
{ claim: 'Protocol X has 50 stars', source: 'github.com/x', quote: 'Repository shows 50 stars as of Feb 2026', confidence: 'verified' }
|
|
202
|
+
],
|
|
203
|
+
methodology: 'GitHub search + npm registry analysis',
|
|
204
|
+
gaps: [{ area: 'Performance data', reason: 'No benchmarks published' }]
|
|
205
|
+
}, researcherKeys)
|
|
206
|
+
|
|
207
|
+
// Operator reviews (cannot approve below threshold)
|
|
208
|
+
const review = reviewEvidence(evidence.id, {
|
|
209
|
+
verdict: 'approve', score: 85, threshold: 70,
|
|
210
|
+
notes: 'Solid sourcing, gap acknowledged'
|
|
211
|
+
}, operatorKeys)
|
|
212
|
+
|
|
213
|
+
// Handoff to analyst (requires approved review)
|
|
214
|
+
const handoff = handoffEvidence(evidence.id, review.id, 'analyst', analystPubKey, operatorKeys)
|
|
215
|
+
|
|
216
|
+
// Analyst submits deliverable citing evidence
|
|
217
|
+
const deliverable = submitDeliverable({
|
|
218
|
+
taskId: brief.id, role: 'analyst',
|
|
219
|
+
content: 'Protocol X shows moderate adoption...',
|
|
220
|
+
evidencePacketIds: [evidence.id],
|
|
221
|
+
citationCount: 3, gapsFlagged: 1
|
|
222
|
+
}, analystKeys)
|
|
223
|
+
|
|
224
|
+
// Operator closes with metrics
|
|
225
|
+
const completion = completeTask(brief.id, {
|
|
226
|
+
status: 'completed',
|
|
227
|
+
retrospective: {
|
|
228
|
+
overheadRatio: 0.9, gapRate: 0.08,
|
|
229
|
+
reworkCount: 0, errorsCaught: 1
|
|
230
|
+
}
|
|
231
|
+
}, operatorKeys)
|
|
232
|
+
```
|
|
233
|
+
|
|
169
234
|
## Architecture
|
|
170
235
|
|
|
171
236
|
```
|
|
172
237
|
┌─────────────────────────────────────────────────┐
|
|
238
|
+
│ Layer 7: Coordination Primitives │
|
|
239
|
+
│ Task briefs · Role assignment · Evidence · │
|
|
240
|
+
│ Review gates · Handoffs · Deliverables · Metrics│
|
|
241
|
+
├─────────────────────────────────────────────────┤
|
|
242
|
+
│ Layer 6: Cascade Revocation & Policy Engine │
|
|
243
|
+
│ 3-signature chain · Chain tracking · Batch │
|
|
244
|
+
│ revoke · Validation events · Policy receipts │
|
|
245
|
+
├─────────────────────────────────────────────────┤
|
|
173
246
|
│ Layer 5: Intent Architecture │
|
|
174
247
|
│ Roles · Tradeoff rules · Deliberative │
|
|
175
248
|
│ consensus · Precedent memory · Signed outcomes │
|
|
@@ -202,6 +275,10 @@ const eval = evaluateConsensus(delib)
|
|
|
202
275
|
|
|
203
276
|
**Layer 5 — Intent Architecture.** Context tells agents what they know. Intent tells them what to care about. Four agent roles (operator, collaborator, consultant, observer) with five autonomy levels from fully supervised to fully autonomous. Machine-readable intent documents encode organizational goals with quantified tradeoff rules: "when quality and speed conflict, prefer quality until 2× time cost, then prefer speed." Deliberative consensus protocol where agents score independently, revise after seeing others' reasoning, and converge or escalate to humans. Every resolved deliberation becomes a citable precedent. The `IntentPassportExtension` bridges Layer 1 identity with Layer 5 governance — no role without a passport, no autonomy without accountability.
|
|
204
277
|
|
|
278
|
+
**Layer 6 — Cascade Revocation & Policy Engine.** Three-signature action chain: agent creates intent, policy validator evaluates against floor principles and delegation scope, agent executes and signs receipt. Parent→child chain registry tracks all delegation relationships. Revoking a parent automatically cascade-revokes all descendants. Batch revocation by agent ID. Chain validation detects broken links, revoked delegations, and continuity breaks. Revocation events emitted for real-time monitoring.
|
|
279
|
+
|
|
280
|
+
**Layer 7 — Coordination Primitives.** Protocol-native multi-agent task orchestration. Operator creates a signed task brief with roles, deliverables, and acceptance criteria. Agents are assigned to roles and sign acceptance. Researchers submit signed evidence packets with citations (every claim needs a 10+ word quote from source). Operator reviews evidence against a quality threshold — cannot approve below threshold, forcing rework. Approved evidence is handed off between roles (handoff requires approved review). Analysts submit deliverables citing evidence packets. Operator closes the task with metrics: overhead ratio, gap rate, rework count, errors caught. Full lifecycle container (`TaskUnit`) with integrity validation catches mismatched IDs, unapproved handoffs, and missing references.
|
|
281
|
+
|
|
205
282
|
## Human Values Floor — v0.1
|
|
206
283
|
|
|
207
284
|
| ID | Principle | Enforcement |
|
|
@@ -216,17 +293,49 @@ const eval = evaluateConsensus(delib)
|
|
|
216
293
|
|
|
217
294
|
Full manifest: [`values/floor.yaml`](values/floor.yaml)
|
|
218
295
|
|
|
296
|
+
## MCP Server
|
|
297
|
+
|
|
298
|
+
The protocol ships with a coordination-native MCP server — any MCP client (Claude Desktop, Cursor, etc.) can connect agents directly.
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
npm install agent-passport-system-mcp
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**14 tools, role-scoped access control.** Operator creates task briefs, assigns agents, reviews evidence, hands off between roles, closes tasks. Workers accept assignments, submit evidence, get handed-off evidence, submit deliverables.
|
|
305
|
+
|
|
306
|
+
```json
|
|
307
|
+
{
|
|
308
|
+
"mcpServers": {
|
|
309
|
+
"agent-passport": {
|
|
310
|
+
"command": "npx",
|
|
311
|
+
"args": ["agent-passport-system-mcp"],
|
|
312
|
+
"env": {
|
|
313
|
+
"AGENT_KEY": "<public_key>",
|
|
314
|
+
"AGENT_PRIVATE_KEY": "<private_key>",
|
|
315
|
+
"AGENT_ID": "my-agent"
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Every operation is Ed25519 signed. Role is auto-detected from task assignments. Role-specific prompts served via MCP prompts API. File-backed task persistence at `~/.agent-passport-tasks.json`.
|
|
323
|
+
|
|
324
|
+
npm: [agent-passport-system-mcp](https://www.npmjs.com/package/agent-passport-system-mcp) · GitHub: [aeoess/agent-passport-mcp](https://github.com/aeoess/agent-passport-mcp)
|
|
325
|
+
|
|
219
326
|
## Tests
|
|
220
327
|
|
|
221
328
|
```bash
|
|
222
329
|
npm test
|
|
223
|
-
#
|
|
330
|
+
# 165 tests across 12 files, 40 suites, 0 failures
|
|
224
331
|
```
|
|
225
332
|
|
|
226
333
|
Includes 23 adversarial tests: Merkle tree tampering, attribution gaming resistance, compliance violations, floor negotiation attacks, wrong-key attestations.
|
|
227
334
|
|
|
228
335
|
15 Agora-specific tests: message signing, tamper detection, registry membership, feed operations, threading, full feed verification.
|
|
229
336
|
|
|
337
|
+
17 coordination tests: task brief creation/verification, role assignment, evidence submission, review gates (score vs threshold), handoff enforcement (requires approved review), deliverable submission, full lifecycle, task unit validation.
|
|
338
|
+
|
|
230
339
|
## Paper
|
|
231
340
|
|
|
232
341
|
**"The Agent Social Contract: Cryptographic Identity, Ethical Governance, and Beneficiary Economics for Autonomous AI Agents"**
|
|
@@ -246,21 +355,24 @@ By Tymofii Pidlisnyi — Published on Zenodo
|
|
|
246
355
|
| Values layer | Attested + auditable | — | Rules | — | — |
|
|
247
356
|
| Attribution | Merkle proofs | — | — | — | — |
|
|
248
357
|
| Communication | Signed Agora | — | — | — | — |
|
|
249
|
-
|
|
|
358
|
+
| Coordination | Task units + MCP server | — | — | — | — |
|
|
359
|
+
| Tests | 165 (23 adversarial) | None | Limited | None | None |
|
|
250
360
|
| Dependencies | Node.js crypto + uuid | — | Multi-LLM | — | Consensus network |
|
|
251
361
|
|
|
252
362
|
## Structure
|
|
253
363
|
|
|
254
364
|
```
|
|
255
|
-
src/
|
|
365
|
+
src/ 21 source files
|
|
256
366
|
contract.ts — High-level API (6 functions)
|
|
257
367
|
core/
|
|
258
368
|
passport.ts — Ed25519 identity
|
|
259
|
-
delegation.ts — Scoped delegation, receipts, revocation
|
|
369
|
+
delegation.ts — Scoped delegation, receipts, cascade revocation
|
|
260
370
|
values.ts — Floor attestation, compliance, negotiation
|
|
261
371
|
attribution.ts — Merkle trees, beneficiary tracing
|
|
262
372
|
agora.ts — Protocol-native signed communication
|
|
263
373
|
intent.ts — Intent architecture, deliberation, roles
|
|
374
|
+
policy.ts — 3-signature chain, policy validation
|
|
375
|
+
coordination.ts — Task briefs, evidence, review, handoff, deliverables
|
|
264
376
|
cli/
|
|
265
377
|
index.ts — CLI (14 commands)
|
|
266
378
|
crypto/
|
|
@@ -269,13 +381,21 @@ src/ 19 source files
|
|
|
269
381
|
passport.ts — Layers 1–3 types
|
|
270
382
|
agora.ts — Layer 4 types
|
|
271
383
|
intent.ts — Layer 5 types
|
|
272
|
-
|
|
384
|
+
policy.ts — Layer 6 types
|
|
385
|
+
coordination.ts — Layer 7 types
|
|
386
|
+
tests/ 12 test files, 165 tests (40 suites)
|
|
273
387
|
adversarial.ts — 23 adversarial cases
|
|
274
388
|
agora.test.ts — 15 Agora tests
|
|
275
389
|
contract.test.ts — High-level API tests
|
|
276
390
|
passport.test.ts — v1.0 primitives
|
|
277
391
|
v1.1-integration.ts — Delegation chains, receipts, revocation
|
|
278
392
|
v2.0-integration.ts — Full-stack integration (7 acts)
|
|
393
|
+
values.test.ts — Floor loading, attestation, compliance
|
|
394
|
+
delegation.test.ts — Delegation, sub-delegation, depth limits
|
|
395
|
+
attribution.test.ts — Merkle trees, attribution, collaboration
|
|
396
|
+
policy.test.ts — Intent, policy decision, 3-sig chain
|
|
397
|
+
cascade.test.ts — Chain registry, cascade revocation, batch
|
|
398
|
+
coordination.test.ts — Task briefs, evidence, review, handoff, lifecycle
|
|
279
399
|
values/
|
|
280
400
|
floor.yaml — Human Values Floor manifest
|
|
281
401
|
papers/
|
|
@@ -289,6 +409,7 @@ Designed and built by **Tymofii Pidlisnyi** with AI assistance from **Claude** (
|
|
|
289
409
|
Protocol page: [aeoess.com/protocol.html](https://aeoess.com/protocol.html)
|
|
290
410
|
Agora: [aeoess.com/agora.html](https://aeoess.com/agora.html)
|
|
291
411
|
npm: [npmjs.com/package/agent-passport-system](https://www.npmjs.com/package/agent-passport-system)
|
|
412
|
+
MCP server: [npmjs.com/package/agent-passport-system-mcp](https://www.npmjs.com/package/agent-passport-system-mcp)
|
|
292
413
|
|
|
293
414
|
## LLM Documentation
|
|
294
415
|
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { TaskBrief, TaskRoleSpec, DeliverableSpec, TaskAssignment, EvidencePacket, EvidenceClaim, ReviewDecision, ReviewVerdict, ReviewIssue, EvidenceHandoff, Deliverable, TaskCompletion, TaskUnit, CoordinationRole, TaskStatus } from '../types/coordination.js';
|
|
2
|
+
export declare function createTaskBrief(opts: {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
operatorPublicKey: string;
|
|
6
|
+
operatorPrivateKey: string;
|
|
7
|
+
roles: Omit<TaskRoleSpec, 'assignedTo' | 'delegationId'>[];
|
|
8
|
+
deliverables: Omit<DeliverableSpec, 'deliverableId'>[];
|
|
9
|
+
acceptanceCriteria: string[];
|
|
10
|
+
deadline?: string;
|
|
11
|
+
}): TaskBrief;
|
|
12
|
+
export declare function verifyTaskBrief(brief: TaskBrief): {
|
|
13
|
+
valid: boolean;
|
|
14
|
+
errors: string[];
|
|
15
|
+
};
|
|
16
|
+
export declare function assignTask(opts: {
|
|
17
|
+
brief: TaskBrief;
|
|
18
|
+
role: CoordinationRole;
|
|
19
|
+
agentId: string;
|
|
20
|
+
agentPublicKey: string;
|
|
21
|
+
delegationId: string;
|
|
22
|
+
operatorPrivateKey: string;
|
|
23
|
+
}): {
|
|
24
|
+
assignment: TaskAssignment;
|
|
25
|
+
updatedBrief: TaskBrief;
|
|
26
|
+
};
|
|
27
|
+
export declare function acceptTask(assignment: TaskAssignment, agentPrivateKey: string): TaskAssignment;
|
|
28
|
+
export declare function submitEvidence(opts: {
|
|
29
|
+
taskId: string;
|
|
30
|
+
submitterPublicKey: string;
|
|
31
|
+
submitterPrivateKey: string;
|
|
32
|
+
role: CoordinationRole;
|
|
33
|
+
claims: Omit<EvidenceClaim, 'claimId'>[];
|
|
34
|
+
methodology: string;
|
|
35
|
+
}): EvidencePacket;
|
|
36
|
+
export declare function verifyEvidence(packet: EvidencePacket): {
|
|
37
|
+
valid: boolean;
|
|
38
|
+
errors: string[];
|
|
39
|
+
};
|
|
40
|
+
export declare function reviewEvidence(opts: {
|
|
41
|
+
taskId: string;
|
|
42
|
+
packet: EvidencePacket;
|
|
43
|
+
reviewerPublicKey: string;
|
|
44
|
+
reviewerPrivateKey: string;
|
|
45
|
+
verdict: ReviewVerdict;
|
|
46
|
+
score: number;
|
|
47
|
+
threshold: number;
|
|
48
|
+
rationale: string;
|
|
49
|
+
issues?: ReviewIssue[];
|
|
50
|
+
}): ReviewDecision;
|
|
51
|
+
export declare function verifyReview(review: ReviewDecision): {
|
|
52
|
+
valid: boolean;
|
|
53
|
+
errors: string[];
|
|
54
|
+
};
|
|
55
|
+
export declare function handoffEvidence(opts: {
|
|
56
|
+
taskId: string;
|
|
57
|
+
packet: EvidencePacket;
|
|
58
|
+
review: ReviewDecision;
|
|
59
|
+
fromRole: CoordinationRole;
|
|
60
|
+
toRole: CoordinationRole;
|
|
61
|
+
toAgentPublicKey: string;
|
|
62
|
+
operatorPrivateKey: string;
|
|
63
|
+
}): EvidenceHandoff;
|
|
64
|
+
export declare function verifyHandoff(handoff: EvidenceHandoff, operatorPublicKey: string): {
|
|
65
|
+
valid: boolean;
|
|
66
|
+
errors: string[];
|
|
67
|
+
};
|
|
68
|
+
export declare function submitDeliverable(opts: {
|
|
69
|
+
taskId: string;
|
|
70
|
+
specId: string;
|
|
71
|
+
submitterPublicKey: string;
|
|
72
|
+
submitterPrivateKey: string;
|
|
73
|
+
role: CoordinationRole;
|
|
74
|
+
content: string;
|
|
75
|
+
evidencePacketIds: string[];
|
|
76
|
+
citationCount: number;
|
|
77
|
+
gapsFlagged: number;
|
|
78
|
+
}): Deliverable;
|
|
79
|
+
export declare function verifyDeliverable(deliverable: Deliverable): {
|
|
80
|
+
valid: boolean;
|
|
81
|
+
errors: string[];
|
|
82
|
+
};
|
|
83
|
+
export declare function completeTask(opts: {
|
|
84
|
+
brief: TaskBrief;
|
|
85
|
+
unit: TaskUnit;
|
|
86
|
+
operatorPublicKey: string;
|
|
87
|
+
operatorPrivateKey: string;
|
|
88
|
+
status: 'completed' | 'failed' | 'partial';
|
|
89
|
+
retrospective?: string;
|
|
90
|
+
}): TaskCompletion;
|
|
91
|
+
export declare function verifyCompletion(completion: TaskCompletion, operatorPublicKey: string): {
|
|
92
|
+
valid: boolean;
|
|
93
|
+
errors: string[];
|
|
94
|
+
};
|
|
95
|
+
export declare function createTaskUnit(brief: TaskBrief): TaskUnit;
|
|
96
|
+
export declare function getTaskStatus(unit: TaskUnit): TaskStatus;
|
|
97
|
+
export declare function validateTaskUnit(unit: TaskUnit): {
|
|
98
|
+
valid: boolean;
|
|
99
|
+
errors: string[];
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=coordination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"co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,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAqErF"}
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
// ══════════════════════════════════════
|
|
2
|
+
// LAYER 6 — Coordination Primitives
|
|
3
|
+
// ══════════════════════════════════════
|
|
4
|
+
// Protocol-native task coordination for multi-agent units.
|
|
5
|
+
// Every operation is Ed25519 signed. Every handoff is verifiable.
|
|
6
|
+
import { randomBytes } from 'node:crypto';
|
|
7
|
+
import { sign, verify } from '../crypto/keys.js';
|
|
8
|
+
import { canonicalize } from './canonical.js';
|
|
9
|
+
// ═══════════════════════════════════════
|
|
10
|
+
// Task Brief — Operator decomposes work
|
|
11
|
+
// ═══════════════════════════════════════
|
|
12
|
+
export function createTaskBrief(opts) {
|
|
13
|
+
const taskId = `task-${Date.now().toString(36)}-${randomBytes(4).toString('hex')}`;
|
|
14
|
+
const roles = opts.roles.map(r => ({
|
|
15
|
+
...r,
|
|
16
|
+
assignedTo: undefined,
|
|
17
|
+
delegationId: undefined,
|
|
18
|
+
}));
|
|
19
|
+
const deliverables = opts.deliverables.map((d, i) => ({
|
|
20
|
+
...d,
|
|
21
|
+
deliverableId: `${taskId}-del-${i}`,
|
|
22
|
+
}));
|
|
23
|
+
const brief = {
|
|
24
|
+
taskId,
|
|
25
|
+
version: '1.0',
|
|
26
|
+
title: opts.title,
|
|
27
|
+
description: opts.description,
|
|
28
|
+
createdBy: opts.operatorPublicKey,
|
|
29
|
+
createdAt: new Date().toISOString(),
|
|
30
|
+
deadline: opts.deadline,
|
|
31
|
+
roles,
|
|
32
|
+
deliverables,
|
|
33
|
+
acceptanceCriteria: opts.acceptanceCriteria,
|
|
34
|
+
status: 'draft',
|
|
35
|
+
};
|
|
36
|
+
const signature = sign(canonicalize(brief), opts.operatorPrivateKey);
|
|
37
|
+
return { ...brief, signature };
|
|
38
|
+
}
|
|
39
|
+
export function verifyTaskBrief(brief) {
|
|
40
|
+
const errors = [];
|
|
41
|
+
const { signature, ...content } = brief;
|
|
42
|
+
try {
|
|
43
|
+
if (!verify(canonicalize(content), signature, brief.createdBy)) {
|
|
44
|
+
errors.push('Invalid operator signature on task brief');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
errors.push(`Signature verification failed: ${e.message}`);
|
|
49
|
+
}
|
|
50
|
+
// Validate structure
|
|
51
|
+
if (!brief.roles.length)
|
|
52
|
+
errors.push('Task brief must have at least one role');
|
|
53
|
+
if (!brief.deliverables.length)
|
|
54
|
+
errors.push('Task brief must have at least one deliverable');
|
|
55
|
+
if (!brief.acceptanceCriteria.length)
|
|
56
|
+
errors.push('Task brief must have acceptance criteria');
|
|
57
|
+
// Validate role constraints
|
|
58
|
+
const roleNames = brief.roles.map(r => r.role);
|
|
59
|
+
for (const del of brief.deliverables) {
|
|
60
|
+
if (!roleNames.includes(del.producedBy)) {
|
|
61
|
+
errors.push(`Deliverable "${del.name}" assigned to role "${del.producedBy}" which is not in the task`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return { valid: errors.length === 0, errors };
|
|
65
|
+
}
|
|
66
|
+
// ═══════════════════════════════════════
|
|
67
|
+
// Task Assignment — Link delegation to role
|
|
68
|
+
// ═══════════════════════════════════════
|
|
69
|
+
export function assignTask(opts) {
|
|
70
|
+
const roleSpec = opts.brief.roles.find(r => r.role === opts.role);
|
|
71
|
+
if (!roleSpec) {
|
|
72
|
+
throw new Error(`Role "${opts.role}" not found in task brief`);
|
|
73
|
+
}
|
|
74
|
+
if (roleSpec.assignedTo) {
|
|
75
|
+
throw new Error(`Role "${opts.role}" already assigned to ${roleSpec.assignedTo}`);
|
|
76
|
+
}
|
|
77
|
+
const assignmentId = `assign-${Date.now().toString(36)}-${randomBytes(4).toString('hex')}`;
|
|
78
|
+
const assignmentContent = {
|
|
79
|
+
assignmentId,
|
|
80
|
+
taskId: opts.brief.taskId,
|
|
81
|
+
role: opts.role,
|
|
82
|
+
agentId: opts.agentId,
|
|
83
|
+
agentPublicKey: opts.agentPublicKey,
|
|
84
|
+
delegationId: opts.delegationId,
|
|
85
|
+
assignedBy: opts.brief.createdBy,
|
|
86
|
+
assignedAt: new Date().toISOString(),
|
|
87
|
+
};
|
|
88
|
+
const operatorSignature = sign(canonicalize(assignmentContent), opts.operatorPrivateKey);
|
|
89
|
+
const assignment = {
|
|
90
|
+
...assignmentContent,
|
|
91
|
+
operatorSignature,
|
|
92
|
+
};
|
|
93
|
+
// Update brief with assignment
|
|
94
|
+
const updatedRoles = opts.brief.roles.map(r => r.role === opts.role
|
|
95
|
+
? { ...r, assignedTo: opts.agentPublicKey, delegationId: opts.delegationId }
|
|
96
|
+
: r);
|
|
97
|
+
const allAssigned = updatedRoles.every(r => r.assignedTo);
|
|
98
|
+
const { signature: _oldSig, ...briefContent } = opts.brief;
|
|
99
|
+
const updatedBriefContent = {
|
|
100
|
+
...briefContent,
|
|
101
|
+
roles: updatedRoles,
|
|
102
|
+
status: (allAssigned ? 'assigned' : 'draft'),
|
|
103
|
+
};
|
|
104
|
+
const newSig = sign(canonicalize(updatedBriefContent), opts.operatorPrivateKey);
|
|
105
|
+
const updatedBrief = { ...updatedBriefContent, signature: newSig };
|
|
106
|
+
return { assignment, updatedBrief };
|
|
107
|
+
}
|
|
108
|
+
export function acceptTask(assignment, agentPrivateKey) {
|
|
109
|
+
const acceptedAt = new Date().toISOString();
|
|
110
|
+
const toSign = { assignmentId: assignment.assignmentId, taskId: assignment.taskId, acceptedAt };
|
|
111
|
+
const agentSignature = sign(canonicalize(toSign), agentPrivateKey);
|
|
112
|
+
return { ...assignment, acceptedAt, agentSignature };
|
|
113
|
+
}
|
|
114
|
+
// ═══════════════════════════════════════
|
|
115
|
+
// Evidence Submission — Researcher output
|
|
116
|
+
// ═══════════════════════════════════════
|
|
117
|
+
export function submitEvidence(opts) {
|
|
118
|
+
const packetId = `evid-${Date.now().toString(36)}-${randomBytes(4).toString('hex')}`;
|
|
119
|
+
const claims = opts.claims.map((c, i) => ({
|
|
120
|
+
...c,
|
|
121
|
+
claimId: `${packetId}-c${i}`,
|
|
122
|
+
}));
|
|
123
|
+
const gapCount = claims.filter(c => c.confidence === 'not_found').length;
|
|
124
|
+
const citedClaims = claims.filter(c => c.sourceUrl && c.confidence !== 'not_found').length;
|
|
125
|
+
const packetContent = {
|
|
126
|
+
packetId,
|
|
127
|
+
taskId: opts.taskId,
|
|
128
|
+
submittedBy: opts.submitterPublicKey,
|
|
129
|
+
role: opts.role,
|
|
130
|
+
submittedAt: new Date().toISOString(),
|
|
131
|
+
claims,
|
|
132
|
+
metadata: {
|
|
133
|
+
sourcesSearched: new Set(claims.map(c => c.sourceUrl).filter(Boolean)).size,
|
|
134
|
+
totalClaims: claims.length,
|
|
135
|
+
citedClaims,
|
|
136
|
+
gapCount,
|
|
137
|
+
methodology: opts.methodology,
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
const signature = sign(canonicalize(packetContent), opts.submitterPrivateKey);
|
|
141
|
+
return { ...packetContent, signature };
|
|
142
|
+
}
|
|
143
|
+
export function verifyEvidence(packet) {
|
|
144
|
+
const errors = [];
|
|
145
|
+
const { signature, ...content } = packet;
|
|
146
|
+
try {
|
|
147
|
+
if (!verify(canonicalize(content), signature, packet.submittedBy)) {
|
|
148
|
+
errors.push('Invalid signature on evidence packet');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (e) {
|
|
152
|
+
errors.push(`Signature verification failed: ${e.message}`);
|
|
153
|
+
}
|
|
154
|
+
// Quality checks
|
|
155
|
+
for (const claim of packet.claims) {
|
|
156
|
+
if (claim.confidence !== 'not_found' && claim.quote.split(' ').length < 3) {
|
|
157
|
+
errors.push(`Claim ${claim.claimId}: quote too short (< 3 words)`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return { valid: errors.length === 0, errors };
|
|
161
|
+
}
|
|
162
|
+
// ═══════════════════════════════════════
|
|
163
|
+
// Review Decision — Operator quality gate
|
|
164
|
+
// ═══════════════════════════════════════
|
|
165
|
+
export function reviewEvidence(opts) {
|
|
166
|
+
const reviewId = `review-${Date.now().toString(36)}-${randomBytes(4).toString('hex')}`;
|
|
167
|
+
// Auto-derive verdict from score vs threshold if not explicitly set
|
|
168
|
+
let verdict = opts.verdict;
|
|
169
|
+
if (opts.score >= opts.threshold && verdict === 'rework') {
|
|
170
|
+
// Operator can still force rework above threshold
|
|
171
|
+
}
|
|
172
|
+
else if (opts.score < opts.threshold && verdict === 'approve') {
|
|
173
|
+
throw new Error(`Cannot approve: score ${opts.score} below threshold ${opts.threshold}`);
|
|
174
|
+
}
|
|
175
|
+
const decisionContent = {
|
|
176
|
+
reviewId,
|
|
177
|
+
taskId: opts.taskId,
|
|
178
|
+
packetId: opts.packet.packetId,
|
|
179
|
+
reviewedBy: opts.reviewerPublicKey,
|
|
180
|
+
reviewedAt: new Date().toISOString(),
|
|
181
|
+
verdict,
|
|
182
|
+
score: opts.score,
|
|
183
|
+
threshold: opts.threshold,
|
|
184
|
+
rationale: opts.rationale,
|
|
185
|
+
issues: opts.issues,
|
|
186
|
+
};
|
|
187
|
+
const signature = sign(canonicalize(decisionContent), opts.reviewerPrivateKey);
|
|
188
|
+
return { ...decisionContent, signature };
|
|
189
|
+
}
|
|
190
|
+
export function verifyReview(review) {
|
|
191
|
+
const errors = [];
|
|
192
|
+
const { signature, ...content } = review;
|
|
193
|
+
try {
|
|
194
|
+
if (!verify(canonicalize(content), signature, review.reviewedBy)) {
|
|
195
|
+
errors.push('Invalid signature on review decision');
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
catch (e) {
|
|
199
|
+
errors.push(`Signature verification failed: ${e.message}`);
|
|
200
|
+
}
|
|
201
|
+
if (review.score < 0 || review.score > 100)
|
|
202
|
+
errors.push('Score must be 0-100');
|
|
203
|
+
return { valid: errors.length === 0, errors };
|
|
204
|
+
}
|
|
205
|
+
// ═══════════════════════════════════════
|
|
206
|
+
// Evidence Handoff — Transfer between roles
|
|
207
|
+
// ═══════════════════════════════════════
|
|
208
|
+
export function handoffEvidence(opts) {
|
|
209
|
+
if (opts.review.verdict !== 'approve') {
|
|
210
|
+
throw new Error(`Cannot handoff: evidence not approved (verdict: ${opts.review.verdict})`);
|
|
211
|
+
}
|
|
212
|
+
if (opts.review.packetId !== opts.packet.packetId) {
|
|
213
|
+
throw new Error('Review does not match evidence packet');
|
|
214
|
+
}
|
|
215
|
+
const handoffId = `handoff-${Date.now().toString(36)}-${randomBytes(4).toString('hex')}`;
|
|
216
|
+
const handoffContent = {
|
|
217
|
+
handoffId,
|
|
218
|
+
taskId: opts.taskId,
|
|
219
|
+
packetId: opts.packet.packetId,
|
|
220
|
+
reviewId: opts.review.reviewId,
|
|
221
|
+
fromRole: opts.fromRole,
|
|
222
|
+
toRole: opts.toRole,
|
|
223
|
+
fromAgent: opts.packet.submittedBy,
|
|
224
|
+
toAgent: opts.toAgentPublicKey,
|
|
225
|
+
handoffAt: new Date().toISOString(),
|
|
226
|
+
};
|
|
227
|
+
const operatorSignature = sign(canonicalize(handoffContent), opts.operatorPrivateKey);
|
|
228
|
+
return { ...handoffContent, operatorSignature };
|
|
229
|
+
}
|
|
230
|
+
export function verifyHandoff(handoff, operatorPublicKey) {
|
|
231
|
+
const errors = [];
|
|
232
|
+
const { operatorSignature, ...content } = handoff;
|
|
233
|
+
try {
|
|
234
|
+
if (!verify(canonicalize(content), operatorSignature, operatorPublicKey)) {
|
|
235
|
+
errors.push('Invalid operator signature on handoff');
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
catch (e) {
|
|
239
|
+
errors.push(`Signature verification failed: ${e.message}`);
|
|
240
|
+
}
|
|
241
|
+
return { valid: errors.length === 0, errors };
|
|
242
|
+
}
|
|
243
|
+
// ═══════════════════════════════════════
|
|
244
|
+
// Deliverable — Final output from a role
|
|
245
|
+
// ═══════════════════════════════════════
|
|
246
|
+
export function submitDeliverable(opts) {
|
|
247
|
+
const deliverableId = `deliv-${Date.now().toString(36)}-${randomBytes(4).toString('hex')}`;
|
|
248
|
+
const delivContent = {
|
|
249
|
+
deliverableId,
|
|
250
|
+
taskId: opts.taskId,
|
|
251
|
+
specId: opts.specId,
|
|
252
|
+
submittedBy: opts.submitterPublicKey,
|
|
253
|
+
role: opts.role,
|
|
254
|
+
submittedAt: new Date().toISOString(),
|
|
255
|
+
content: opts.content,
|
|
256
|
+
evidencePacketIds: opts.evidencePacketIds,
|
|
257
|
+
citationCount: opts.citationCount,
|
|
258
|
+
gapsFlagged: opts.gapsFlagged,
|
|
259
|
+
};
|
|
260
|
+
const signature = sign(canonicalize(delivContent), opts.submitterPrivateKey);
|
|
261
|
+
return { ...delivContent, signature };
|
|
262
|
+
}
|
|
263
|
+
export function verifyDeliverable(deliverable) {
|
|
264
|
+
const errors = [];
|
|
265
|
+
const { signature, ...content } = deliverable;
|
|
266
|
+
try {
|
|
267
|
+
if (!verify(canonicalize(content), signature, deliverable.submittedBy)) {
|
|
268
|
+
errors.push('Invalid signature on deliverable');
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
catch (e) {
|
|
272
|
+
errors.push(`Signature verification failed: ${e.message}`);
|
|
273
|
+
}
|
|
274
|
+
return { valid: errors.length === 0, errors };
|
|
275
|
+
}
|
|
276
|
+
// ═══════════════════════════════════════
|
|
277
|
+
// Task Completion — Close the unit
|
|
278
|
+
// ═══════════════════════════════════════
|
|
279
|
+
export function completeTask(opts) {
|
|
280
|
+
const deliverableIds = opts.unit.deliverables.map(d => d.deliverableId);
|
|
281
|
+
// Calculate metrics
|
|
282
|
+
const briefTime = new Date(opts.brief.createdAt).getTime();
|
|
283
|
+
const now = Date.now();
|
|
284
|
+
const totalDuration = Math.floor((now - briefTime) / 1000);
|
|
285
|
+
// Sum handoff/review times as coordination overhead
|
|
286
|
+
const reviewTimes = opts.unit.reviews.map(r => new Date(r.reviewedAt).getTime());
|
|
287
|
+
const handoffTimes = opts.unit.handoffs.map(h => new Date(h.handoffAt).getTime());
|
|
288
|
+
const overheadEvents = [...reviewTimes, ...handoffTimes].sort();
|
|
289
|
+
// Rough estimate: each review/handoff = ~30s overhead
|
|
290
|
+
const coordinationOverhead = overheadEvents.length * 30;
|
|
291
|
+
const taskWorkTime = totalDuration - coordinationOverhead;
|
|
292
|
+
const overheadRatio = taskWorkTime > 0 ? coordinationOverhead / taskWorkTime : 0;
|
|
293
|
+
const totalClaims = opts.unit.evidencePackets.reduce((s, p) => s + p.metadata.totalClaims, 0);
|
|
294
|
+
const totalGaps = opts.unit.evidencePackets.reduce((s, p) => s + p.metadata.gapCount, 0);
|
|
295
|
+
const evidenceGapRate = totalClaims > 0 ? totalGaps / totalClaims : 0;
|
|
296
|
+
const reworkCount = opts.unit.reviews.filter(r => r.verdict === 'rework').length;
|
|
297
|
+
const errorsCaught = opts.unit.reviews.reduce((s, r) => s + (r.issues?.length || 0), 0);
|
|
298
|
+
const agentKeys = new Set([
|
|
299
|
+
...opts.unit.assignments.map(a => a.agentPublicKey),
|
|
300
|
+
]);
|
|
301
|
+
const metrics = {
|
|
302
|
+
totalDuration,
|
|
303
|
+
coordinationOverhead,
|
|
304
|
+
taskWorkTime,
|
|
305
|
+
overheadRatio: Math.round(overheadRatio * 100) / 100,
|
|
306
|
+
evidenceGapRate: Math.round(evidenceGapRate * 100) / 100,
|
|
307
|
+
reworkCount,
|
|
308
|
+
errorsCaught,
|
|
309
|
+
agentCount: agentKeys.size,
|
|
310
|
+
};
|
|
311
|
+
const completionContent = {
|
|
312
|
+
taskId: opts.brief.taskId,
|
|
313
|
+
completedBy: opts.operatorPublicKey,
|
|
314
|
+
completedAt: new Date().toISOString(),
|
|
315
|
+
status: opts.status,
|
|
316
|
+
deliverableIds,
|
|
317
|
+
metrics,
|
|
318
|
+
retrospective: opts.retrospective,
|
|
319
|
+
};
|
|
320
|
+
const signature = sign(canonicalize(completionContent), opts.operatorPrivateKey);
|
|
321
|
+
return { ...completionContent, signature };
|
|
322
|
+
}
|
|
323
|
+
export function verifyCompletion(completion, operatorPublicKey) {
|
|
324
|
+
const errors = [];
|
|
325
|
+
const { signature, ...content } = completion;
|
|
326
|
+
try {
|
|
327
|
+
if (!verify(canonicalize(content), signature, operatorPublicKey)) {
|
|
328
|
+
errors.push('Invalid operator signature on task completion');
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
catch (e) {
|
|
332
|
+
errors.push(`Signature verification failed: ${e.message}`);
|
|
333
|
+
}
|
|
334
|
+
return { valid: errors.length === 0, errors };
|
|
335
|
+
}
|
|
336
|
+
// ═══════════════════════════════════════
|
|
337
|
+
// Task Unit — Full lifecycle container
|
|
338
|
+
// ═══════════════════════════════════════
|
|
339
|
+
export function createTaskUnit(brief) {
|
|
340
|
+
return {
|
|
341
|
+
brief,
|
|
342
|
+
assignments: [],
|
|
343
|
+
evidencePackets: [],
|
|
344
|
+
reviews: [],
|
|
345
|
+
handoffs: [],
|
|
346
|
+
deliverables: [],
|
|
347
|
+
completion: undefined,
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
export function getTaskStatus(unit) {
|
|
351
|
+
if (unit.completion)
|
|
352
|
+
return unit.completion.status === 'completed' ? 'completed' : 'failed';
|
|
353
|
+
if (unit.deliverables.length > 0)
|
|
354
|
+
return 'delivered';
|
|
355
|
+
if (unit.reviews.some(r => r.verdict === 'approve'))
|
|
356
|
+
return 'approved';
|
|
357
|
+
if (unit.reviews.some(r => r.verdict === 'rework'))
|
|
358
|
+
return 'rework_requested';
|
|
359
|
+
if (unit.reviews.length > 0)
|
|
360
|
+
return 'under_review';
|
|
361
|
+
if (unit.evidencePackets.length > 0)
|
|
362
|
+
return 'evidence_submitted';
|
|
363
|
+
if (unit.assignments.length > 0) {
|
|
364
|
+
return unit.assignments.every(a => a.acceptedAt) ? 'in_progress' : 'assigned';
|
|
365
|
+
}
|
|
366
|
+
return 'draft';
|
|
367
|
+
}
|
|
368
|
+
// Validate the entire unit's integrity — every signature, every link
|
|
369
|
+
export function validateTaskUnit(unit) {
|
|
370
|
+
const errors = [];
|
|
371
|
+
// 1. Brief
|
|
372
|
+
const briefResult = verifyTaskBrief(unit.brief);
|
|
373
|
+
errors.push(...briefResult.errors);
|
|
374
|
+
// 2. Assignments reference valid roles
|
|
375
|
+
for (const a of unit.assignments) {
|
|
376
|
+
if (a.taskId !== unit.brief.taskId) {
|
|
377
|
+
errors.push(`Assignment ${a.assignmentId}: taskId mismatch`);
|
|
378
|
+
}
|
|
379
|
+
const roleExists = unit.brief.roles.some(r => r.role === a.role);
|
|
380
|
+
if (!roleExists) {
|
|
381
|
+
errors.push(`Assignment ${a.assignmentId}: role "${a.role}" not in brief`);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
// 3. Evidence packets reference this task
|
|
385
|
+
for (const p of unit.evidencePackets) {
|
|
386
|
+
if (p.taskId !== unit.brief.taskId) {
|
|
387
|
+
errors.push(`Evidence ${p.packetId}: taskId mismatch`);
|
|
388
|
+
}
|
|
389
|
+
const evidResult = verifyEvidence(p);
|
|
390
|
+
errors.push(...evidResult.errors);
|
|
391
|
+
}
|
|
392
|
+
// 4. Reviews reference valid packets
|
|
393
|
+
for (const r of unit.reviews) {
|
|
394
|
+
if (r.taskId !== unit.brief.taskId) {
|
|
395
|
+
errors.push(`Review ${r.reviewId}: taskId mismatch`);
|
|
396
|
+
}
|
|
397
|
+
const packetExists = unit.evidencePackets.some(p => p.packetId === r.packetId);
|
|
398
|
+
if (!packetExists) {
|
|
399
|
+
errors.push(`Review ${r.reviewId}: references unknown packet ${r.packetId}`);
|
|
400
|
+
}
|
|
401
|
+
const revResult = verifyReview(r);
|
|
402
|
+
errors.push(...revResult.errors);
|
|
403
|
+
}
|
|
404
|
+
// 5. Handoffs require approved reviews
|
|
405
|
+
for (const h of unit.handoffs) {
|
|
406
|
+
const review = unit.reviews.find(r => r.reviewId === h.reviewId);
|
|
407
|
+
if (!review) {
|
|
408
|
+
errors.push(`Handoff ${h.handoffId}: references unknown review ${h.reviewId}`);
|
|
409
|
+
}
|
|
410
|
+
else if (review.verdict !== 'approve') {
|
|
411
|
+
errors.push(`Handoff ${h.handoffId}: review not approved (verdict: ${review.verdict})`);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
// 6. Deliverables reference valid evidence
|
|
415
|
+
for (const d of unit.deliverables) {
|
|
416
|
+
const delivResult = verifyDeliverable(d);
|
|
417
|
+
errors.push(...delivResult.errors);
|
|
418
|
+
for (const pId of d.evidencePacketIds) {
|
|
419
|
+
const exists = unit.evidencePackets.some(p => p.packetId === pId);
|
|
420
|
+
if (!exists) {
|
|
421
|
+
errors.push(`Deliverable ${d.deliverableId}: references unknown packet ${pId}`);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
// 7. Completion
|
|
426
|
+
if (unit.completion) {
|
|
427
|
+
const compResult = verifyCompletion(unit.completion, unit.brief.createdBy);
|
|
428
|
+
errors.push(...compResult.errors);
|
|
429
|
+
}
|
|
430
|
+
return { valid: errors.length === 0, errors };
|
|
431
|
+
}
|
|
432
|
+
//# sourceMappingURL=coordination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordination.js","sourceRoot":"","sources":["../../../src/core/coordination.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AACpC,yCAAyC;AACzC,2DAA2D;AAC3D,kEAAkE;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAU7C,0CAA0C;AAC1C,wCAAwC;AACxC,0CAA0C;AAE1C,MAAM,UAAU,eAAe,CAAC,IAS/B;IACC,MAAM,MAAM,GAAG,QAAQ,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAA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M,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;AAC/C,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export type { CollaborationAttribution } from './core/attribution.js';
|
|
|
15
15
|
export { assignRole, createTradeoffRule, evaluateTradeoff, createIntentDocument, createDeliberation, submitConsensusRound, evaluateConsensus, resolveDeliberation, getPrecedentsByTopic, citePrecedent, createIntentPassportExtension, } from './core/intent.js';
|
|
16
16
|
export type { TradeoffEvaluation, ConsensusEvaluation } from './core/intent.js';
|
|
17
17
|
export type { AgentRole, AutonomyLevel, RoleAssignment, IntentDocument, IntentGoal, TradeoffRule, ConsensusRound, Deliberation, DeliberationOutcome, DomainAssessment, Precedent, MemoryTier, ContextGovernance, IntentPassportExtension, } from './types/intent.js';
|
|
18
|
+
export { createTaskBrief, verifyTaskBrief, assignTask, acceptTask, submitEvidence, verifyEvidence, reviewEvidence, verifyReview, handoffEvidence, verifyHandoff, submitDeliverable, verifyDeliverable, completeTask, verifyCompletion, createTaskUnit, getTaskStatus, validateTaskUnit, } from './core/coordination.js';
|
|
19
|
+
export type { CoordinationRole, TaskStatus, ReviewVerdict, TaskBrief, TaskRoleSpec, DeliverableSpec, TaskAssignment, EvidencePacket, EvidenceClaim, ReviewDecision, ReviewIssue, EvidenceHandoff, Deliverable, TaskCompletion, TaskMetrics, TaskUnit, } from './types/coordination.js';
|
|
18
20
|
export { createActionIntent, verifyActionIntent, evaluateIntent, verifyPolicyDecision, createPolicyReceipt, verifyPolicyReceipt, FloorValidatorV1, requestAction, } from './core/policy.js';
|
|
19
21
|
export type { ActionIntent, PolicyDecision, PolicyReceipt, PolicyVerdict, PrincipleEvaluation, PolicyValidator, ValidationContext, PolicyEvaluationResult, } from './types/policy.js';
|
|
20
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],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C9B,MAAM,kBAAkB,CAAA;AAEzB,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAE/E,YAAY,EAEV,SAAS,EAAE,aAAa,EAAE,cAAc,EACxC,cAAc,EAAE,UAAU,EAAE,YAAY,EACxC,cAAc,EAAE,YAAY,EAAE,mBAAmB,EACjD,gBAAgB,EAAE,SAAS,EAC3B,UAAU,EAAE,iBAAiB,EAC7B,uBAAuB,GACxB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,YAAY,EAC5B,eAAe,EAAE,aAAa,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,gBAAgB,EAC9B,cAAc,EAAE,aAAa,EAAE,gBAAgB,GAChD,MAAM,wBAAwB,CAAA;AAE/B,YAAY,EACV,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAC3C,SAAS,EAAE,YAAY,EAAE,eAAe,EACxC,cAAc,EAAE,cAAc,EAAE,aAAa,EAC7C,cAAc,EAAE,WAAW,EAC3B,eAAe,EAAE,WAAW,EAC5B,cAAc,EAAE,WAAW,EAAE,QAAQ,GACtC,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EACL,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,oBAAoB,EACpC,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAChB,aAAa,GACd,MAAM,kBAAkB,CAAA;AAEzB,YAAY,EACV,YAAY,EAAE,cAAc,EAAE,aAAa,EAC3C,aAAa,EAAE,mBAAmB,EAClC,eAAe,EAAE,iBAAiB,EAAE,sBAAsB,GAC3D,MAAM,mBAAmB,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -29,6 +29,8 @@ export { hashReceipt, traceBeneficiary, computeAttribution, verifyAttributionRep
|
|
|
29
29
|
export { createAgoraMessage, verifyAgoraMessage, createFeed, appendToFeed, getThread, getByTopic, getByAuthor, getTopics, createRegistry, registerAgent, verifyFeed } from './core/agora.js';
|
|
30
30
|
// ── Layer 5: Intent Architecture ──
|
|
31
31
|
export { assignRole, createTradeoffRule, evaluateTradeoff, createIntentDocument, createDeliberation, submitConsensusRound, evaluateConsensus, resolveDeliberation, getPrecedentsByTopic, citePrecedent, createIntentPassportExtension, } from './core/intent.js';
|
|
32
|
+
// ── Layer 6: Coordination Primitives ──
|
|
33
|
+
export { createTaskBrief, verifyTaskBrief, assignTask, acceptTask, submitEvidence, verifyEvidence, reviewEvidence, verifyReview, handoffEvidence, verifyHandoff, submitDeliverable, verifyDeliverable, completeTask, verifyCompletion, createTaskUnit, getTaskStatus, validateTaskUnit, } from './core/coordination.js';
|
|
32
34
|
// ── Values Floor Policy Engine ──
|
|
33
35
|
export { createActionIntent, verifyActionIntent, evaluateIntent, verifyPolicyDecision, createPolicyReceipt, verifyPolicyReceipt, FloorValidatorV1, requestAction, } from './core/policy.js';
|
|
34
36
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,6DAA6D;AAC7D,EAAE;AACF,+BAA+B;AAC/B,8DAA8D;AAC9D,mDAAmD;AACnD,8CAA8C;AAC9C,2DAA2D;AAC3D,sEAAsE;AACtE,4DAA4D;AAC5D,EAAE;AACF,8DAA8D;AAE9D,yCAAyC;AACzC,OAAO,EACL,kBAAkB,EAAE,oBAAoB,EACxC,QAAQ,EAAE,UAAU,EACpB,kBAAkB,EAAE,eAAe,EACpC,MAAM,eAAe,CAAA;AAOtB,2CAA2C;AAC3C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA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ltinRole | (string & {});
|
|
3
|
+
export type TaskStatus = 'draft' | 'assigned' | 'in_progress' | 'evidence_submitted' | 'under_review' | 'rework_requested' | 'approved' | 'delivered' | 'completed' | 'failed';
|
|
4
|
+
export type ReviewVerdict = 'approve' | 'rework' | 'reject';
|
|
5
|
+
export interface TaskBrief {
|
|
6
|
+
taskId: string;
|
|
7
|
+
version: '1.0';
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
createdBy: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
deadline?: string;
|
|
13
|
+
roles: TaskRoleSpec[];
|
|
14
|
+
deliverables: DeliverableSpec[];
|
|
15
|
+
acceptanceCriteria: string[];
|
|
16
|
+
status: TaskStatus;
|
|
17
|
+
signature: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TaskRoleSpec {
|
|
20
|
+
role: CoordinationRole;
|
|
21
|
+
description: string;
|
|
22
|
+
allowedScopes: string[];
|
|
23
|
+
forbiddenScopes: string[];
|
|
24
|
+
requiredCapabilities?: string[];
|
|
25
|
+
assignedTo?: string;
|
|
26
|
+
delegationId?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DeliverableSpec {
|
|
29
|
+
deliverableId: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
format: string;
|
|
33
|
+
producedBy: CoordinationRole;
|
|
34
|
+
requiredFields?: string[];
|
|
35
|
+
minCitations?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface TaskAssignment {
|
|
38
|
+
assignmentId: string;
|
|
39
|
+
taskId: string;
|
|
40
|
+
role: CoordinationRole;
|
|
41
|
+
agentId: string;
|
|
42
|
+
agentPublicKey: string;
|
|
43
|
+
delegationId: string;
|
|
44
|
+
assignedBy: string;
|
|
45
|
+
assignedAt: string;
|
|
46
|
+
acceptedAt?: string;
|
|
47
|
+
agentSignature?: string;
|
|
48
|
+
operatorSignature: string;
|
|
49
|
+
}
|
|
50
|
+
export interface EvidencePacket {
|
|
51
|
+
packetId: string;
|
|
52
|
+
taskId: string;
|
|
53
|
+
submittedBy: string;
|
|
54
|
+
role: CoordinationRole;
|
|
55
|
+
submittedAt: string;
|
|
56
|
+
claims: EvidenceClaim[];
|
|
57
|
+
metadata: {
|
|
58
|
+
sourcesSearched: number;
|
|
59
|
+
totalClaims: number;
|
|
60
|
+
citedClaims: number;
|
|
61
|
+
gapCount: number;
|
|
62
|
+
methodology: string;
|
|
63
|
+
};
|
|
64
|
+
signature: string;
|
|
65
|
+
}
|
|
66
|
+
export interface EvidenceClaim {
|
|
67
|
+
claimId: string;
|
|
68
|
+
dimension: string;
|
|
69
|
+
subject: string;
|
|
70
|
+
claim: string;
|
|
71
|
+
quote: string;
|
|
72
|
+
sourceUrl: string;
|
|
73
|
+
confidence: 'high' | 'medium' | 'low' | 'not_found';
|
|
74
|
+
}
|
|
75
|
+
export interface ReviewDecision {
|
|
76
|
+
reviewId: string;
|
|
77
|
+
taskId: string;
|
|
78
|
+
packetId: string;
|
|
79
|
+
reviewedBy: string;
|
|
80
|
+
reviewedAt: string;
|
|
81
|
+
verdict: ReviewVerdict;
|
|
82
|
+
score: number;
|
|
83
|
+
threshold: number;
|
|
84
|
+
rationale: string;
|
|
85
|
+
issues?: ReviewIssue[];
|
|
86
|
+
signature: string;
|
|
87
|
+
}
|
|
88
|
+
export interface ReviewIssue {
|
|
89
|
+
claimId: string;
|
|
90
|
+
issue: string;
|
|
91
|
+
severity: 'critical' | 'major' | 'minor';
|
|
92
|
+
}
|
|
93
|
+
export interface EvidenceHandoff {
|
|
94
|
+
handoffId: string;
|
|
95
|
+
taskId: string;
|
|
96
|
+
packetId: string;
|
|
97
|
+
reviewId: string;
|
|
98
|
+
fromRole: CoordinationRole;
|
|
99
|
+
toRole: CoordinationRole;
|
|
100
|
+
fromAgent: string;
|
|
101
|
+
toAgent: string;
|
|
102
|
+
handoffAt: string;
|
|
103
|
+
operatorSignature: string;
|
|
104
|
+
}
|
|
105
|
+
export interface Deliverable {
|
|
106
|
+
deliverableId: string;
|
|
107
|
+
taskId: string;
|
|
108
|
+
specId: string;
|
|
109
|
+
submittedBy: string;
|
|
110
|
+
role: CoordinationRole;
|
|
111
|
+
submittedAt: string;
|
|
112
|
+
content: string;
|
|
113
|
+
evidencePacketIds: string[];
|
|
114
|
+
citationCount: number;
|
|
115
|
+
gapsFlagged: number;
|
|
116
|
+
signature: string;
|
|
117
|
+
}
|
|
118
|
+
export interface TaskCompletion {
|
|
119
|
+
taskId: string;
|
|
120
|
+
completedBy: string;
|
|
121
|
+
completedAt: string;
|
|
122
|
+
status: 'completed' | 'failed' | 'partial';
|
|
123
|
+
deliverableIds: string[];
|
|
124
|
+
metrics: TaskMetrics;
|
|
125
|
+
retrospective?: string;
|
|
126
|
+
signature: string;
|
|
127
|
+
}
|
|
128
|
+
export interface TaskMetrics {
|
|
129
|
+
totalDuration: number;
|
|
130
|
+
coordinationOverhead: number;
|
|
131
|
+
taskWorkTime: number;
|
|
132
|
+
overheadRatio: number;
|
|
133
|
+
evidenceGapRate: number;
|
|
134
|
+
reworkCount: number;
|
|
135
|
+
errorsCaught: number;
|
|
136
|
+
agentCount: number;
|
|
137
|
+
}
|
|
138
|
+
export interface TaskUnit {
|
|
139
|
+
brief: TaskBrief;
|
|
140
|
+
assignments: TaskAssignment[];
|
|
141
|
+
evidencePackets: EvidencePacket[];
|
|
142
|
+
reviews: ReviewDecision[];
|
|
143
|
+
handoffs: EvidenceHandoff[];
|
|
144
|
+
deliverables: Deliverable[];
|
|
145
|
+
completion?: TaskCompletion;
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=coordination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordination.d.ts","sourceRoot":"","sources":["../../../src/types/coordination.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AACzF,MAAM,MAAM,gBAAgB,GAAG,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AAQ,GAAG,SAAS,CAAA;IAC1C,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,OAAO,EAAE,WAAW,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAA;IACrB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACnB;AAKD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,SAAS,CAAA;IAChB,WAAW,EAAE,cAAc,EAAE,CAAA;IAC7B,eAAe,EAAE,cAAc,EAAE,CAAA;IACjC,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,QAAQ,EAAE,eAAe,EAAE,CAAA;IAC3B,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,UAAU,CAAC,EAAE,cAAc,CAAA;CAC5B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// ══════════════════════════════════════
|
|
2
|
+
// LAYER 6 — Coordination Primitives
|
|
3
|
+
// ══════════════════════════════════════
|
|
4
|
+
// Protocol-native task coordination for multi-agent units.
|
|
5
|
+
// Turns manual orchestration into signed, verifiable operations.
|
|
6
|
+
//
|
|
7
|
+
// Lifecycle: Brief → Assign → Evidence → Review → Handoff → Deliver → Complete
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=coordination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordination.js","sourceRoot":"","sources":["../../../src/types/coordination.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AACpC,yCAAyC;AACzC,2DAA2D;AAC3D,iEAAiE;AACjE,EAAE;AACF,+EAA+E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-passport-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "The Agent Social Contract — cryptographic identity, ethical governance, beneficiary attribution, and protocol-native communication for autonomous AI agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "tsc && chmod +x dist/src/cli/index.js",
|
|
19
|
-
"test": "tsx --test tests/passport.test.ts tests/v1.1-integration.ts tests/adversarial.ts tests/v2.0-integration.ts tests/contract.test.ts tests/agora.test.ts tests/values.test.ts tests/delegation.test.ts tests/attribution.test.ts tests/policy.test.ts tests/cascade.test.ts",
|
|
19
|
+
"test": "tsx --test tests/passport.test.ts tests/v1.1-integration.ts tests/adversarial.ts tests/v2.0-integration.ts tests/contract.test.ts tests/agora.test.ts tests/values.test.ts tests/delegation.test.ts tests/attribution.test.ts tests/policy.test.ts tests/cascade.test.ts tests/coordination.test.ts",
|
|
20
20
|
"test:quick": "tsx --test tests/passport.test.ts",
|
|
21
21
|
"lint": "tsc --noEmit",
|
|
22
22
|
"clean": "rm -rf dist",
|