@kya-os/mcp-i-core 1.3.8-canary.clientinfo.20251126050113 → 1.3.9-canary.clientinfo.20251126121212

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.
@@ -1,10 +1,168 @@
1
1
 
2
- > @kya-os/mcp-i-core@1.3.0 test /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core
2
+ > @kya-os/mcp-i-core@1.3.7 test /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core
3
3
  > vitest run
4
4
 
5
5
 
6
6
  RUN v4.0.5 /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core
7
7
 
8
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyEd25519 > should return false on verification error
9
+ [CryptoService] Ed25519 verification error: Error: Verification failed
10
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:62:9
11
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
12
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
13
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
14
+ at new Promise (<anonymous>)
15
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
16
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
17
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
18
+ at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
19
+ at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
20
+
21
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject invalid JWK format
22
+ [CryptoService] Invalid Ed25519 JWK format
23
+
24
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong kty
25
+ [CryptoService] Invalid Ed25519 JWK format
26
+
27
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong crv
28
+ [CryptoService] Invalid Ed25519 JWK format
29
+
30
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with missing x field
31
+ [CryptoService] Invalid Ed25519 JWK format
32
+
33
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with empty x field
34
+ [CryptoService] Invalid Ed25519 JWK format
35
+
36
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject malformed JWS
37
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'ž', "ž‹" is not valid JSON
38
+ at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
39
+ at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
40
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:230:42
41
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
42
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
43
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
44
+ at new Promise (<anonymous>)
45
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
46
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
47
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
48
+
49
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject non-EdDSA algorithms
50
+ [CryptoService] Unsupported algorithm: RS256, expected EdDSA
51
+
52
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject HS256 algorithm
53
+ [CryptoService] Unsupported algorithm: HS256, expected EdDSA
54
+
55
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle empty JWS components
56
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected end of JSON input
57
+ at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
58
+ at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
59
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:271:42
60
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
61
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
62
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
63
+ at new Promise (<anonymous>)
64
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
65
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
66
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
67
+
68
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - single part
69
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
70
+ at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
71
+ at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
72
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:279:42
73
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
74
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
75
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
76
+ at new Promise (<anonymous>)
77
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
78
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
79
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
80
+
81
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - two parts
82
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
83
+ at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
84
+ at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
85
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:287:42
86
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
87
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
88
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
89
+ at new Promise (<anonymous>)
90
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
91
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
92
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
93
+
94
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - four parts
95
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
96
+ at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
97
+ at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
98
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:302:42
99
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
100
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
101
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
102
+ at new Promise (<anonymous>)
103
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
104
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
105
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
106
+
107
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid JSON header
108
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'o', "notjson" is not valid JSON
109
+ at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
110
+ at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
111
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:316:42
112
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
113
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
114
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
115
+ at new Promise (<anonymous>)
116
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
117
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
118
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
119
+
120
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid base64
121
+ [CryptoService] Invalid JWS format: Error: Invalid payload base64: Invalid base64url string: Invalid character
122
+ at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:107:15)
123
+ at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
124
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:334:42
125
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
126
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
127
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
128
+ at new Promise (<anonymous>)
129
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
130
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
131
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
132
+
133
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate expectedKid option
134
+ [CryptoService] Key ID mismatch
135
+
136
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate alg option
137
+ [CryptoService] Unsupported algorithm: EdDSA, expected RS256
138
+
139
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate Ed25519 key length
140
+ [CryptoService] Failed to extract public key: Error: Invalid Ed25519 public key length: 5
141
+ at CryptoService.jwkToBase64PublicKey (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:295:13)
142
+ at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:249:32)
143
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:398:42
144
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
145
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
146
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
147
+ at new Promise (<anonymous>)
148
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
149
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
150
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
151
+
152
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle signature verification error
153
+ [CryptoService] Ed25519 verification error: Error: Crypto error
154
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:449:61
155
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
156
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
157
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
158
+ at new Promise (<anonymous>)
159
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
160
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
161
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
162
+ at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
163
+ at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
164
+
165
+ ✓ src/services/__tests__/crypto.service.test.ts (34 tests) 19ms
8
166
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use X-API-Key header for new endpoint
9
167
  [ToolProtectionService] Config loaded from API {
10
168
  source: 'api',
@@ -13,7 +171,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
13
171
  agentDid: 'did:key:z6MkhaXgBZDv...',
14
172
  projectId: 'test-project-123',
15
173
  cacheTtlMs: 300000,
16
- cacheExpiresAt: '2025-11-25T17:44:45.668Z'
174
+ cacheExpiresAt: '2025-11-26T15:41:45.310Z'
17
175
  }
18
176
 
19
177
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use Authorization Bearer header for old endpoint
@@ -24,7 +182,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
24
182
  agentDid: 'did:key:z6MkhaXgBZDv...',
25
183
  projectId: 'none',
26
184
  cacheTtlMs: 300000,
27
- cacheExpiresAt: '2025-11-25T17:44:45.671Z'
185
+ cacheExpiresAt: '2025-11-26T15:41:45.314Z'
28
186
  }
29
187
 
30
188
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use project-scoped endpoint when projectId is available
@@ -35,7 +193,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
35
193
  agentDid: 'did:key:z6MkhaXgBZDv...',
36
194
  projectId: 'test-project-123',
37
195
  cacheTtlMs: 300000,
38
- cacheExpiresAt: '2025-11-25T17:44:45.673Z'
196
+ cacheExpiresAt: '2025-11-26T15:41:45.315Z'
39
197
  }
40
198
 
41
199
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use agent-scoped endpoint when projectId is not available
@@ -46,18 +204,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
46
204
  agentDid: 'did:key:z6MkhaXgBZDv...',
47
205
  projectId: 'none',
48
206
  cacheTtlMs: 300000,
49
- cacheExpiresAt: '2025-11-25T17:44:45.674Z'
50
- }
51
-
52
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should fetch from project-scoped endpoint when projectId is available
53
- [ToolProtectionService] Config loaded from API {
54
- source: 'api',
55
- toolCount: 2,
56
- protectedTools: [ 'checkout' ],
57
- agentDid: 'did:key:z6MkhaXgBZDv...',
58
- projectId: 'test-project-123',
59
- cacheTtlMs: 300000,
60
- cacheExpiresAt: '2025-11-25T17:44:45.673Z'
207
+ cacheExpiresAt: '2025-11-26T15:41:45.315Z'
61
208
  }
62
209
 
63
210
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode projectId in URL
@@ -68,7 +215,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
68
215
  agentDid: 'did:key:z6MkhaXgBZDv...',
69
216
  projectId: 'project/with/special-chars',
70
217
  cacheTtlMs: 300000,
71
- cacheExpiresAt: '2025-11-25T17:44:45.674Z'
218
+ cacheExpiresAt: '2025-11-26T15:41:45.316Z'
72
219
  }
73
220
 
74
221
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode agent DID in URL
@@ -79,7 +226,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
79
226
  agentDid: 'did:key:z6MkhaXgBZDv...',
80
227
  projectId: 'none',
81
228
  cacheTtlMs: 300000,
82
- cacheExpiresAt: '2025-11-25T17:44:45.674Z'
229
+ cacheExpiresAt: '2025-11-26T15:41:45.316Z'
83
230
  }
84
231
 
85
232
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle new endpoint format (toolProtections object)
@@ -90,59 +237,73 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
90
237
  agentDid: 'did:key:z6MkhaXgBZDv...',
91
238
  projectId: 'test-project-123',
92
239
  cacheTtlMs: 300000,
93
- cacheExpiresAt: '2025-11-25T17:44:45.675Z'
240
+ cacheExpiresAt: '2025-11-26T15:41:45.316Z'
241
+ }
242
+
243
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should fetch from project-scoped endpoint when projectId is available
244
+ [ToolProtectionService] Config loaded from API {
245
+ source: 'api',
246
+ toolCount: 2,
247
+ protectedTools: [ 'checkout' ],
248
+ agentDid: 'did:key:z6MkhaXgBZDv...',
249
+ projectId: 'test-project-123',
250
+ cacheTtlMs: 300000,
251
+ cacheExpiresAt: '2025-11-26T15:41:45.312Z'
252
+ }
253
+
254
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should handle new endpoint format with toolProtections object
255
+ [ToolProtectionService] Config loaded from API {
256
+ source: 'api',
257
+ toolCount: 2,
258
+ protectedTools: [ 'protected_tool' ],
259
+ agentDid: 'did:key:z6MkhaXgBZDv...',
260
+ projectId: 'test-project-123',
261
+ cacheTtlMs: 300000,
262
+ cacheExpiresAt: '2025-11-26T15:41:45.316Z'
263
+ }
264
+
265
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should parse oauthProvider from new endpoint format (Phase 2)
266
+ [ToolProtectionService] Config loaded from API {
267
+ source: 'api',
268
+ toolCount: 2,
269
+ protectedTools: [ 'read_repos', 'send_email' ],
270
+ agentDid: 'did:key:z6MkhaXgBZDv...',
271
+ projectId: 'test-project-123',
272
+ cacheTtlMs: 300000,
273
+ cacheExpiresAt: '2025-11-26T15:41:45.317Z'
94
274
  }
95
275
 
96
276
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools array)
97
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyEd25519 > should return false on verification error
98
- [CryptoService] Ed25519 verification error: Error: Verification failed
99
277
  [ToolProtectionService] Config loaded from API {
100
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:62:9
101
278
  source: 'api',
102
279
  toolCount: 2,
103
280
  protectedTools: [ 'checkout' ],
104
281
  agentDid: 'did:key:z6MkhaXgBZDv...',
105
282
  projectId: 'none',
106
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
107
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
108
283
  cacheTtlMs: 300000,
109
- cacheExpiresAt: '2025-11-25T17:44:45.675Z'
110
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
284
+ cacheExpiresAt: '2025-11-26T15:41:45.317Z'
111
285
  }
112
286
 
113
287
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools object)
114
- at new Promise (<anonymous>)
115
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
116
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
117
288
  [ToolProtectionService] Config loaded from API {
118
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
119
289
  source: 'api',
120
290
  toolCount: 2,
121
291
  protectedTools: [ 'checkout' ],
122
292
  agentDid: 'did:key:z6MkhaXgBZDv...',
123
- at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
124
- at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
125
293
  projectId: 'none',
126
-
127
294
  cacheTtlMs: 300000,
128
- stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Error Handling > should handle network timeout
129
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
130
- cacheExpiresAt: '2025-11-25T17:44:45.676Z'
295
+ cacheExpiresAt: '2025-11-26T15:41:45.317Z'
131
296
  }
132
297
 
133
298
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle snake_case field names
134
299
  [ToolProtectionService] Config loaded from API {
135
300
  source: 'api',
136
-
137
301
  toolCount: 1,
138
302
  protectedTools: [ 'tool1' ],
139
303
  agentDid: 'did:key:z6MkhaXgBZDv...',
140
304
  projectId: 'test-project-123',
141
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject invalid JWK format
142
- [CryptoService] Invalid Ed25519 JWK format
143
305
  cacheTtlMs: 300000,
144
-
145
- cacheExpiresAt: '2025-11-25T17:44:45.676Z'
306
+ cacheExpiresAt: '2025-11-26T15:41:45.318Z'
146
307
  }
147
308
 
148
309
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle camelCase field names
@@ -153,7 +314,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
153
314
  agentDid: 'did:key:z6MkhaXgBZDv...',
154
315
  projectId: 'test-project-123',
155
316
  cacheTtlMs: 300000,
156
- cacheExpiresAt: '2025-11-25T17:44:45.676Z'
317
+ cacheExpiresAt: '2025-11-26T15:41:45.318Z'
157
318
  }
158
319
 
159
320
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should prefer camelCase over snake_case when both present
@@ -164,215 +325,105 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
164
325
  agentDid: 'did:key:z6MkhaXgBZDv...',
165
326
  projectId: 'test-project-123',
166
327
  cacheTtlMs: 300000,
167
- cacheExpiresAt: '2025-11-25T17:44:45.677Z'
328
+ cacheExpiresAt: '2025-11-26T15:41:45.318Z'
168
329
  }
169
330
 
170
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should handle new endpoint format with toolProtections object
331
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should preserve oauthProvider through cache operations
171
332
  [ToolProtectionService] Config loaded from API {
172
333
  source: 'api',
173
- toolCount: 2,
174
- protectedTools: [ 'protected_tool' ],
334
+ toolCount: 1,
335
+ protectedTools: [ 'read_repos' ],
175
336
  agentDid: 'did:key:z6MkhaXgBZDv...',
176
337
  projectId: 'test-project-123',
177
338
  cacheTtlMs: 300000,
178
- cacheExpiresAt: '2025-11-25T17:44:45.678Z'
339
+ cacheExpiresAt: '2025-11-26T15:41:45.317Z'
179
340
  }
180
341
 
181
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should parse oauthProvider from new endpoint format (Phase 2)
342
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should fetch from agent-scoped endpoint when projectId is not available
182
343
  [ToolProtectionService] Config loaded from API {
183
344
  source: 'api',
345
+ stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Error Handling > should handle network timeout
184
346
  toolCount: 2,
185
- protectedTools: [ 'read_repos', 'send_email' ],
347
+ protectedTools: [ 'checkout' ],
348
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
186
349
  agentDid: 'did:key:z6MkhaXgBZDv...',
187
- projectId: 'test-project-123',
350
+ projectId: 'none',
188
351
  cacheTtlMs: 300000,
189
- cacheExpiresAt: '2025-11-25T17:44:45.678Z'
190
- }
191
352
 
192
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong kty
193
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should preserve oauthProvider through cache operations
194
- [ToolProtectionService] Config loaded from API {
195
- source: 'api',
196
- toolCount: 1,
197
- protectedTools: [ 'read_repos' ],
198
- [CryptoService] Invalid Ed25519 JWK format
353
+ cacheExpiresAt: '2025-11-26T15:41:45.318Z'
354
+ stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Fallback Behavior > should cache fallback config
355
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
199
356
 
200
- agentDid: 'did:key:z6MkhaXgBZDv...',
201
- projectId: 'test-project-123',
202
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong crv
203
- cacheTtlMs: 300000,
204
- [CryptoService] Invalid Ed25519 JWK format
205
- cacheExpiresAt: '2025-11-25T17:44:45.678Z'
206
357
  }
207
358
 
208
-
209
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should cache successful API responses
359
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools array
210
360
  [ToolProtectionService] Config loaded from API {
211
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with missing x field
212
361
  source: 'api',
213
- toolCount: 1,
362
+ toolCount: 2,
214
363
  protectedTools: [ 'tool1' ],
215
364
  agentDid: 'did:key:z6MkhaXgBZDv...',
216
- projectId: 'test-project-123',
365
+ projectId: 'none',
217
366
  cacheTtlMs: 300000,
218
- [CryptoService] Invalid Ed25519 JWK format
219
-
220
- cacheExpiresAt: '2025-11-25T17:44:45.678Z'
367
+ cacheExpiresAt: '2025-11-26T15:41:45.319Z'
221
368
  }
222
369
 
223
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
224
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with empty x field
225
- [CryptoService] Invalid Ed25519 JWK format
226
-
227
- stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Fallback Behavior > should cache fallback config
228
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
229
- [ToolProtectionService] Config loaded from API {
230
-
231
- source: 'api',
232
- toolCount: 0,
233
- protectedTools: [],
234
- agentDid: 'did:key:z6MkhaXgBZDv...',
235
- projectId: 'test-project-123',
236
- cacheTtlMs: 1000,
237
- cacheExpiresAt: '2025-11-25T17:39:46.679Z'
238
- }
239
-
240
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should fetch from agent-scoped endpoint when projectId is not available
241
- [ToolProtectionService] Config loaded from API {
242
- source: 'api',
243
- toolCount: 2,
244
- protectedTools: [ 'checkout' ],
245
- agentDid: 'did:key:z6MkhaXgBZDv...',
246
- projectId: 'none',
247
- cacheTtlMs: 300000,
248
- cacheExpiresAt: '2025-11-25T17:44:45.679Z'
249
- }
250
-
251
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools array
252
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject malformed JWS
253
- [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'ž', "ž‹" is not valid JSON
254
- at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
255
- [ToolProtectionService] Config loaded from API {
256
- source: 'api',
257
- at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
258
- toolCount: 2,
259
- protectedTools: [ 'tool1' ],
260
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:230:42
261
- agentDid: 'did:key:z6MkhaXgBZDv...',
262
- projectId: 'none',
263
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
264
- cacheTtlMs: 300000,
265
- cacheExpiresAt: '2025-11-25T17:44:45.679Z'
266
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
267
- }
268
-
269
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
270
- at new Promise (<anonymous>)
271
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
272
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
273
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
274
-
275
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject non-EdDSA algorithms
276
- [CryptoService] Unsupported algorithm: RS256, expected EdDSA
277
-
278
370
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should parse oauthProvider from old endpoint format (tools array)
279
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject HS256 algorithm
280
- [CryptoService] Unsupported algorithm: HS256, expected EdDSA
281
371
  [ToolProtectionService] Config loaded from API {
282
-
283
372
  source: 'api',
284
373
  toolCount: 2,
285
374
  protectedTools: [ 'read_repos', 'send_email' ],
286
375
  agentDid: 'did:key:z6MkhaXgBZDv...',
287
376
  projectId: 'none',
288
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle empty JWS components
289
- [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected end of JSON input
290
- at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
291
377
  cacheTtlMs: 300000,
292
- cacheExpiresAt: '2025-11-25T17:44:45.679Z'
378
+ cacheExpiresAt: '2025-11-26T15:41:45.319Z'
293
379
  }
294
380
 
295
381
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools object
296
382
  [ToolProtectionService] Config loaded from API {
297
383
  source: 'api',
298
384
  toolCount: 2,
299
- at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
300
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:271:42
301
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
302
385
  protectedTools: [ 'tool1' ],
303
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
304
386
  agentDid: 'did:key:z6MkhaXgBZDv...',
305
387
  projectId: 'none',
306
388
  cacheTtlMs: 300000,
307
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
308
- cacheExpiresAt: '2025-11-25T17:44:45.679Z'
389
+ cacheExpiresAt: '2025-11-26T15:41:45.320Z'
309
390
  }
310
391
 
311
- at new Promise (<anonymous>)
312
392
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should parse oauthProvider from old endpoint format (tools object)
313
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
314
393
  [ToolProtectionService] Config loaded from API {
315
394
  source: 'api',
316
395
  toolCount: 2,
317
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
318
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
319
396
  protectedTools: [ 'read_repos', 'send_email' ],
320
-
321
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - single part
322
- [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
323
397
  agentDid: 'did:key:z6MkhaXgBZDv...',
324
398
  projectId: 'none',
325
399
  cacheTtlMs: 300000,
326
- cacheExpiresAt: '2025-11-25T17:44:45.680Z'
400
+ cacheExpiresAt: '2025-11-26T15:41:45.320Z'
327
401
  }
328
- at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
329
- at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
330
402
 
331
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:279:42
332
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
333
403
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
334
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
335
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
336
404
  [ToolProtectionService] Cache miss, fetching from API {
337
- at new Promise (<anonymous>)
338
405
  source: 'api-fetch-start',
339
406
  cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
340
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
341
407
  agentDid: 'did:key:z6MkhaXgBZDv...',
342
408
  projectId: 'none',
343
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
344
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
345
-
346
409
  apiUrl: 'https://kya.vouched.id',
347
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - two parts
348
410
  endpoint: '/api/v1/bouncer/config?agent_did=did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
349
411
  }
350
412
  [ToolProtectionService] Fetching from API: https://kya.vouched.id/api/v1/bouncer/config?agent_did=did%3Akey%3Az6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK {
351
413
  method: 'config?agent_did (old)',
352
- [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
353
414
  projectId: 'none',
354
415
  apiKeyPresent: true,
355
- at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
356
416
  apiKeyLength: 18,
357
417
  apiKeyMasked: 'test-api...'
358
418
  }
359
419
 
360
- at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
361
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:287:42
362
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
363
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
364
420
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
365
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
366
421
  [ToolProtectionService] API response received {
367
- at new Promise (<anonymous>)
368
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
369
422
  source: 'api-fetch-complete',
370
423
  agentDid: 'did:key:z6MkhaXgBZDv...',
371
424
  projectId: 'none',
372
425
  responseKeys: [ 'success', 'data', 'metadata' ],
373
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
374
426
  dataKeys: [ 'tools' ],
375
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
376
427
  rawToolProtections: null,
377
428
  rawTools: [
378
429
  { name: 'valid_tool', requiresDelegation: true },
@@ -381,118 +432,70 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
381
432
  responseMetadata: {}
382
433
  }
383
434
 
384
-
385
435
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
386
436
  [ToolProtectionService] Config loaded from API {
387
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - four parts
388
437
  source: 'api',
389
438
  toolCount: 1,
390
- [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
391
439
  protectedTools: [ 'valid_tool' ],
392
- at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
393
440
  agentDid: 'did:key:z6MkhaXgBZDv...',
394
441
  projectId: 'none',
395
- at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
396
442
  cacheTtlMs: 300000,
397
- cacheExpiresAt: '2025-11-25T17:44:45.681Z'
398
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:302:42
399
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
443
+ cacheExpiresAt: '2025-11-26T15:41:45.321Z'
400
444
  }
401
445
  [ToolProtectionService] API fetch successful, config cached {
402
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
403
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
404
446
  source: 'cache-write',
405
447
  agentDid: 'did:key:z6MkhaXgBZDv...',
406
- at new Promise (<anonymous>)
407
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
408
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
409
448
  cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
410
449
  toolCount: 1,
411
450
  tools: [ { name: 'valid_tool', requiresDelegation: true, scopeCount: 0 } ],
412
451
  ttlMs: 300000,
413
452
  ttlMinutes: 5,
414
- expiresAt: '2025-11-25T17:44:45.681Z',
453
+ expiresAt: '2025-11-26T15:41:45.321Z',
415
454
  expiresIn: '300s'
416
455
  }
417
456
 
418
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
419
-
420
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid JSON header
421
- [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'o', "notjson" is not valid JSON
422
- at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
423
- at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
424
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:316:42
425
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
426
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
427
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
428
- at new Promise (<anonymous>)
429
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
430
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
431
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
432
-
433
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid base64
434
- [CryptoService] Invalid JWS format: Error: Invalid payload base64: Invalid base64url string: Invalid character
435
- at CryptoService.parseJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:107:15)
436
- at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
437
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:334:42
438
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
439
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
440
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
441
- at new Promise (<anonymous>)
442
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
443
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
444
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
445
-
446
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate expectedKid option
447
- [CryptoService] Key ID mismatch
448
-
449
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate alg option
450
- [CryptoService] Unsupported algorithm: EdDSA, expected RS256
451
-
452
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate Ed25519 key length
453
- [CryptoService] Failed to extract public key: Error: Invalid Ed25519 public key length: 5
454
- at CryptoService.jwkToBase64PublicKey (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:295:13)
455
- at CryptoService.verifyJWS (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/crypto.service.ts:249:32)
456
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:398:42
457
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
458
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
459
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
460
- at new Promise (<anonymous>)
461
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
462
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
463
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
464
-
465
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle signature verification error
466
- [CryptoService] Ed25519 verification error: Error: Crypto error
467
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:449:61
468
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
469
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
470
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
471
- at new Promise (<anonymous>)
472
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
473
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
474
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
475
- at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
476
- at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
457
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should cache successful API responses
458
+ [ToolProtectionService] Config loaded from API {
459
+ source: 'api',
460
+ toolCount: 1,
461
+ protectedTools: [ 'tool1' ],
462
+ agentDid: 'did:key:z6MkhaXgBZDv...',
463
+ projectId: 'test-project-123',
464
+ cacheTtlMs: 300000,
465
+ cacheExpiresAt: '2025-11-26T15:41:45.319Z'
466
+ }
477
467
 
478
- stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch error handling > should handle network errors gracefully
479
- [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
468
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
469
+ [ToolProtectionService] Config loaded from API {
470
+ source: 'api',
471
+ toolCount: 0,
472
+ protectedTools: [],
480
473
  agentDid: 'did:key:z6MkhaXgBZDv...',
481
- error: 'ECONNREFUSED',
482
- cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
474
+ projectId: 'test-project-123',
475
+ cacheTtlMs: 1000,
476
+ cacheExpiresAt: '2025-11-26T15:36:46.320Z'
483
477
  }
484
478
 
479
+ stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch error handling > should handle network errors gracefully
480
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
485
481
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should cache successful API responses
486
482
  [ToolProtectionService] Config loaded from API {
487
483
  source: 'api',
484
+ agentDid: 'did:key:z6MkhaXgBZDv...',
485
+ error: 'ECONNREFUSED',
486
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
488
487
  toolCount: 1,
489
488
  protectedTools: [ 'tool1' ],
490
489
  agentDid: 'did:key:z6MkhaXgBZDv...',
491
490
  projectId: 'none',
492
491
  cacheTtlMs: 300000,
493
- cacheExpiresAt: '2025-11-25T17:44:45.684Z'
494
492
  }
493
+ cacheExpiresAt: '2025-11-26T15:41:45.324Z'
495
494
 
495
+ }
496
+ stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
497
+
498
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
496
499
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use default cache TTL when not specified
497
500
  [ToolProtectionService] Config loaded from API {
498
501
  source: 'api',
@@ -501,7 +504,12 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
501
504
  agentDid: 'did:key:z6MkhaXgBZDv...',
502
505
  projectId: 'none',
503
506
  cacheTtlMs: 300000,
504
- cacheExpiresAt: '2025-11-25T17:44:45.684Z'
507
+ cacheExpiresAt: '2025-11-26T15:41:45.324Z'
508
+ agentDid: 'did:key:z6MkhaXgBZDv...',
509
+ error: 'Network error',
510
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
511
+ }
512
+
505
513
  }
506
514
 
507
515
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use custom cache TTL when specified
@@ -512,7 +520,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
512
520
  agentDid: 'did:key:z6MkhaXgBZDv...',
513
521
  projectId: 'none',
514
522
  cacheTtlMs: 600000,
515
- cacheExpiresAt: '2025-11-25T17:49:45.684Z'
523
+ cacheExpiresAt: '2025-11-26T15:46:45.324Z'
516
524
  }
517
525
 
518
526
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle empty toolProtections object
@@ -523,7 +531,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
523
531
  agentDid: 'did:key:z6MkhaXgBZDv...',
524
532
  projectId: 'none',
525
533
  cacheTtlMs: 300000,
526
- cacheExpiresAt: '2025-11-25T17:44:45.684Z'
534
+ cacheExpiresAt: '2025-11-26T15:41:45.324Z'
527
535
  }
528
536
 
529
537
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle null requiredScopes
@@ -534,7 +542,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
534
542
  agentDid: 'did:key:z6MkhaXgBZDv...',
535
543
  projectId: 'none',
536
544
  cacheTtlMs: 300000,
537
- cacheExpiresAt: '2025-11-25T17:44:45.684Z'
545
+ cacheExpiresAt: '2025-11-26T15:41:45.324Z'
538
546
  }
539
547
 
540
548
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle mixed camelCase and snake_case in response
@@ -545,7 +553,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
545
553
  agentDid: 'did:key:z6MkhaXgBZDv...',
546
554
  projectId: 'none',
547
555
  cacheTtlMs: 300000,
548
- cacheExpiresAt: '2025-11-25T17:44:45.684Z'
556
+ cacheExpiresAt: '2025-11-26T15:41:45.324Z'
549
557
  }
550
558
 
551
559
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool has no protection
@@ -556,7 +564,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
556
564
  agentDid: 'did:key:z6MkhaXgBZDv...',
557
565
  projectId: 'none',
558
566
  cacheTtlMs: 300000,
559
- cacheExpiresAt: '2025-11-25T17:44:45.684Z'
567
+ cacheExpiresAt: '2025-11-26T15:41:45.325Z'
560
568
  }
561
569
 
562
570
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
@@ -567,7 +575,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
567
575
  agentDid: 'did:key:z6MkhaXgBZDv...',
568
576
  projectId: 'none',
569
577
  cacheTtlMs: 300000,
570
- cacheExpiresAt: '2025-11-25T17:44:45.684Z'
578
+ cacheExpiresAt: '2025-11-26T15:41:45.325Z'
571
579
  }
572
580
 
573
581
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
@@ -588,7 +596,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
588
596
  agentDid: 'did:key:z6MkhaXgBZDv...',
589
597
  projectId: 'none',
590
598
  cacheTtlMs: 300000,
591
- cacheExpiresAt: '2025-11-25T17:44:45.685Z'
599
+ cacheExpiresAt: '2025-11-26T15:41:45.325Z'
592
600
  }
593
601
 
594
602
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
@@ -609,14 +617,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
609
617
  agentDid: 'did:key:z6MkhaXgBZDv...',
610
618
  projectId: 'none',
611
619
  cacheTtlMs: 300000,
612
- cacheExpiresAt: '2025-11-25T17:44:45.685Z'
613
- }
614
-
615
- stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
616
- [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
617
- agentDid: 'did:key:z6MkhaXgBZDv...',
618
- error: 'Network error',
619
- cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
620
+ cacheExpiresAt: '2025-11-26T15:41:45.325Z'
620
621
  }
621
622
 
622
623
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
@@ -637,7 +638,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
637
638
  agentDid: 'did:key:z6MkhaXgBZDv...',
638
639
  projectId: 'none',
639
640
  cacheTtlMs: 300000,
640
- cacheExpiresAt: '2025-11-25T17:44:45.685Z'
641
+ cacheExpiresAt: '2025-11-26T15:41:45.325Z'
641
642
  }
642
643
 
643
644
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
@@ -658,7 +659,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
658
659
  agentDid: 'did:key:z6MkhaXgBZDv...',
659
660
  projectId: 'none',
660
661
  cacheTtlMs: 300000,
661
- cacheExpiresAt: '2025-11-25T17:44:45.685Z'
662
+ cacheExpiresAt: '2025-11-26T15:41:45.326Z'
662
663
  }
663
664
 
664
665
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
@@ -669,28 +670,13 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
669
670
  agentDid: 'did:key:z6MkhaXgBZDv...',
670
671
  projectId: 'none',
671
672
  cacheTtlMs: 300000,
672
- cacheExpiresAt: '2025-11-25T17:44:45.685Z'
673
+ cacheExpiresAt: '2025-11-26T15:41:45.326Z'
673
674
  }
674
675
 
675
- ✓ src/services/__tests__/crypto.service.test.ts (34 tests) 12ms
676
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
677
- [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
678
-
679
- ✓ src/__tests__/services/tool-protection.service.test.ts (49 tests) 19ms
680
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
681
- [StorageService] Failed to initialize KV, falling back to memory: Failed to import Cloudflare storage providers: Cannot find package '@kya-os/mcp-i-cloudflare/providers/storage' imported from '/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/storage.service.ts'
682
-
683
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should fall back to memory when Redis connection fails
684
- [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
685
-
686
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should use KV namespace when provided
687
- [StorageService] Failed to initialize KV, falling back to memory: Failed to import Cloudflare storage providers: Cannot find package '@kya-os/mcp-i-cloudflare/providers/storage' imported from '/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/storage.service.ts'
688
-
689
- ✓ src/delegation/__tests__/vc-verifier.test.ts (35 tests) 40ms
690
- ✓ src/services/__tests__/storage.service.test.ts (17 tests) 19ms
676
+ ✓ src/__tests__/services/tool-protection.service.test.ts (49 tests) 22ms
691
677
  stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should submit proofs successfully
692
678
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
693
- correlationId: 'ff7a0e23-b990-4a90-b6ac-d367d14acf1b',
679
+ correlationId: '2ade6797-2590-481e-aa6f-2215d75b3996',
694
680
  status: 200,
695
681
  statusText: '',
696
682
  headers: { 'content-type': 'application/json' },
@@ -699,7 +685,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
699
685
  fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
700
686
  }
701
687
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
702
- correlationId: 'ff7a0e23-b990-4a90-b6ac-d367d14acf1b',
688
+ correlationId: '2ade6797-2590-481e-aa6f-2215d75b3996',
703
689
  status: 200,
704
690
  responseDataType: 'object',
705
691
  responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
@@ -729,7 +715,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
729
715
 
730
716
  stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle all_proofs_rejected error gracefully
731
717
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
732
- correlationId: '24a01a0d-cf7b-483c-9259-81055f6c8bdd',
718
+ correlationId: '60a313a1-6692-43bd-aa37-29fa860cf510',
733
719
  status: 400,
734
720
  statusText: '',
735
721
  headers: { 'content-type': 'application/json' },
@@ -738,7 +724,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
738
724
  fullResponseText: '{"success":false,"error":{"code":"all_proofs_rejected","message":"All proofs rejected","details":{"rejected":1,"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid signature"}}]}}}'
739
725
  }
740
726
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
741
- correlationId: '24a01a0d-cf7b-483c-9259-81055f6c8bdd',
727
+ correlationId: '60a313a1-6692-43bd-aa37-29fa860cf510',
742
728
  status: 400,
743
729
  responseDataType: 'object',
744
730
  responseDataKeys: [ 'success', 'error' ],
@@ -765,16 +751,16 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
765
751
 
766
752
  stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response format
767
753
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
768
- correlationId: '0b4fe4b5-d799-4be6-b064-1076d8e44ce8',
754
+ correlationId: '8062b77e-6f28-4dac-a624-c3e10c7865d9',
769
755
  status: 200,
770
756
  statusText: '',
771
757
  headers: { 'content-type': 'application/json' },
772
758
  responseTextLength: 206,
773
- responseTextPreview: '{"success":true,"data":{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T17:39:45.716Z"}}',
774
- fullResponseText: '{"success":true,"data":{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T17:39:45.716Z"}}'
759
+ responseTextPreview: '{"success":true,"data":{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.371Z"}}',
760
+ fullResponseText: '{"success":true,"data":{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.371Z"}}'
775
761
  }
776
762
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
777
- correlationId: '0b4fe4b5-d799-4be6-b064-1076d8e44ce8',
763
+ correlationId: '8062b77e-6f28-4dac-a624-c3e10c7865d9',
778
764
  status: 200,
779
765
  responseDataType: 'object',
780
766
  responseDataKeys: [ 'success', 'data', 'metadata' ],
@@ -793,7 +779,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
793
779
  ' },\n' +
794
780
  ' "metadata": {\n' +
795
781
  ' "requestId": "test-request-id",\n' +
796
- ' "timestamp": "2025-11-25T17:39:45.716Z"\n' +
782
+ ' "timestamp": "2025-11-26T15:36:45.371Z"\n' +
797
783
  ' }\n' +
798
784
  '}'
799
785
  }
@@ -812,11 +798,11 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
812
798
  },
813
799
  "metadata": {
814
800
  "requestId": "test-request-id",
815
- "timestamp": "2025-11-25T17:39:45.716Z"
801
+ "timestamp": "2025-11-26T15:36:45.371Z"
816
802
  }
817
803
  }
818
804
  [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
819
- correlationId: '0b4fe4b5-d799-4be6-b064-1076d8e44ce8',
805
+ correlationId: '8062b77e-6f28-4dac-a624-c3e10c7865d9',
820
806
  dataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
821
807
  hasAccepted: true,
822
808
  hasRejected: true,
@@ -843,7 +829,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
843
829
  '}'
844
830
  }
845
831
  [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
846
- correlationId: '0b4fe4b5-d799-4be6-b064-1076d8e44ce8',
832
+ correlationId: '8062b77e-6f28-4dac-a624-c3e10c7865d9',
847
833
  dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
848
834
  hasSuccess: true,
849
835
  successValue: true,
@@ -868,7 +854,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
868
854
 
869
855
  stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
870
856
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
871
- correlationId: 'd78e6955-da22-4db8-bb04-ddde3cbaae0b',
857
+ correlationId: 'd77a977b-42ca-4926-a1a3-8e633c5c215c',
872
858
  status: 200,
873
859
  statusText: '',
874
860
  headers: { 'content-type': 'application/json' },
@@ -877,7 +863,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
877
863
  fullResponseText: '{"success":true,"accepted":1,"rejected":0}'
878
864
  }
879
865
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
880
- correlationId: 'd78e6955-da22-4db8-bb04-ddde3cbaae0b',
866
+ correlationId: 'd77a977b-42ca-4926-a1a3-8e633c5c215c',
881
867
  status: 200,
882
868
  responseDataType: 'object',
883
869
  responseDataKeys: [ 'success', 'accepted', 'rejected' ],
@@ -891,7 +877,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
891
877
 
892
878
  stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
893
879
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
894
- correlationId: 'a376fa6b-cca8-46bb-82f4-8abef62495de',
880
+ correlationId: 'b57c702a-173c-463c-8a0e-1edc3fc11cb6',
895
881
  status: 200,
896
882
  statusText: '',
897
883
  headers: { 'content-type': 'application/json' },
@@ -900,7 +886,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
900
886
  fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
901
887
  }
902
888
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
903
- correlationId: 'a376fa6b-cca8-46bb-82f4-8abef62495de',
889
+ correlationId: 'b57c702a-173c-463c-8a0e-1edc3fc11cb6',
904
890
  status: 200,
905
891
  responseDataType: 'object',
906
892
  responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
@@ -930,7 +916,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
930
916
 
931
917
  stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
932
918
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
933
- correlationId: 'f420aae3-3a41-4e4c-befa-053ceed32465',
919
+ correlationId: '9e9878e9-938f-4bd4-b940-aa4cd8626ac8',
934
920
  status: 200,
935
921
  statusText: '',
936
922
  headers: { 'content-type': 'application/json' },
@@ -939,7 +925,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
939
925
  fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}'
940
926
  }
941
927
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
942
- correlationId: 'f420aae3-3a41-4e4c-befa-053ceed32465',
928
+ correlationId: '9e9878e9-938f-4bd4-b940-aa4cd8626ac8',
943
929
  status: 200,
944
930
  responseDataType: 'object',
945
931
  responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
@@ -952,22 +938,9 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
952
938
  "outcomes": {}
953
939
  }
954
940
 
955
- stderr | src/services/__tests__/proof-verifier.test.ts > ProofVerifier Security > Signature Verification > should handle signature verification errors gracefully
956
- [CryptoService] Ed25519 verification error: Error: Crypto error
957
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.test.ts:328:9
958
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
959
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
960
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
961
- at new Promise (<anonymous>)
962
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
963
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
964
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
965
- at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
966
- at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
967
-
968
941
  stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response with invalid data structure
969
942
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
970
- correlationId: '5a08621f-2fd0-425e-8b6c-9ffd3a72e8d7',
943
+ correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
971
944
  status: 200,
972
945
  statusText: '',
973
946
  headers: { 'content-type': 'application/json' },
@@ -976,7 +949,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
976
949
  fullResponseText: '{"success":true,"data":{"message":"Invalid format"}}'
977
950
  }
978
951
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
979
- correlationId: '5a08621f-2fd0-425e-8b6c-9ffd3a72e8d7',
952
+ correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
980
953
  status: 200,
981
954
  responseDataType: 'object',
982
955
  responseDataKeys: [ 'success', 'data' ],
@@ -989,7 +962,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
989
962
  }
990
963
  }
991
964
  [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
992
- correlationId: '5a08621f-2fd0-425e-8b6c-9ffd3a72e8d7',
965
+ correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
993
966
  dataKeys: [ 'message' ],
994
967
  hasAccepted: false,
995
968
  hasRejected: false,
@@ -1006,7 +979,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
1006
979
  fullData: '{\n "message": "Invalid format"\n}'
1007
980
  }
1008
981
  [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1009
- correlationId: '5a08621f-2fd0-425e-8b6c-9ffd3a72e8d7',
982
+ correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
1010
983
  dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
1011
984
  hasSuccess: true,
1012
985
  successValue: true,
@@ -1019,7 +992,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
1019
992
  fullDataWithSuccess: '{\n "success": true\n}'
1020
993
  }
1021
994
  [AccessControl] ❌ MISSING REQUIRED FIELDS AFTER CONSTRUCTION: {
1022
- correlationId: '5a08621f-2fd0-425e-8b6c-9ffd3a72e8d7',
995
+ correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
1023
996
  hasAccepted: true,
1024
997
  acceptedType: 'undefined',
1025
998
  acceptedValue: undefined,
@@ -1033,159 +1006,75 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
1033
1006
  originalResponseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
1034
1007
  }
1035
1008
 
1036
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when no protection required
1037
- [MCP-I] Checking tool protection: {
1038
- tool: 'unprotectedTool',
1039
- agentDid: 'did:key:zmock123...',
1040
- hasDelegation: false
1041
- }
1042
-
1043
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when no protection required
1044
- [MCP-I] Tool protection check passed (no delegation required) {
1045
- tool: 'unprotectedTool',
1046
- agentDid: 'did:key:zmock123...',
1047
- reason: 'Tool not configured to require delegation'
1048
- }
1009
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
1010
+ [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
1049
1011
 
1050
- src/services/__tests__/proof-verifier.test.ts (21 tests) 14ms
1051
- src/__tests__/runtime/base-extensions.test.ts (38 tests) 12ms
1052
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when protection required and no delegation
1053
- [MCP-I] Checking tool protection: {
1054
- tool: 'protectedTool',
1055
- agentDid: 'did:key:zmock123...',
1056
- hasDelegation: false
1057
- }
1058
-
1059
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when protection required and no delegation
1060
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1061
- tool: 'protectedTool',
1062
- requiredScopes: [ 'files:write' ],
1063
- agentDid: 'did:key:zmock123...',
1064
- resumeToken: 'resume_vyl5sd_miev24e7',
1065
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_vyl5sd_miev24e7'
1066
- }
1067
-
1068
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
1069
- [MCP-I] Checking tool protection: {
1070
- tool: 'protectedTool',
1071
- agentDid: 'did:key:zmock123...',
1072
- hasDelegation: true
1073
- }
1074
-
1075
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
1076
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1077
- tool: 'protectedTool',
1078
- agentDid: 'did:key:zmock123...',
1079
- hasDelegationToken: true,
1080
- hasConsentProof: false,
1081
- requiredScopes: [ 'files:write' ]
1082
- }
1083
-
1084
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
1085
- [MCP-I] ✅ Delegation verification SUCCEEDED {
1086
- tool: 'protectedTool',
1087
- agentDid: 'did:key:zmock123...',
1088
- delegationId: 'test-delegation-id',
1089
- credentialScopes: [ 'files:write' ],
1090
- requiredScopes: [ 'files:write' ]
1091
- }
1092
-
1093
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
1094
- [MCP-I] Checking tool protection: {
1095
- tool: 'protectedTool',
1096
- agentDid: 'did:key:zmock123...',
1097
- hasDelegation: true
1098
- }
1099
-
1100
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
1101
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1102
- tool: 'protectedTool',
1103
- agentDid: 'did:key:zmock123...',
1104
- hasDelegationToken: false,
1105
- hasConsentProof: true,
1106
- requiredScopes: [ 'files:write' ]
1107
- }
1108
-
1109
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
1110
- [MCP-I] ✅ Delegation verification SUCCEEDED {
1111
- tool: 'protectedTool',
1112
- agentDid: 'did:key:zmock123...',
1113
- delegationId: 'test-delegation-id',
1114
- credentialScopes: [ 'files:write' ],
1115
- requiredScopes: [ 'files:write' ]
1116
- }
1117
-
1118
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1119
- [MCP-I] Checking tool protection: {
1120
- tool: 'protectedTool',
1121
- agentDid: 'did:key:zmock123...',
1122
- hasDelegation: true
1123
- }
1124
-
1125
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1126
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1127
- tool: 'protectedTool',
1128
- agentDid: 'did:key:zmock123...',
1129
- hasDelegationToken: true,
1130
- hasConsentProof: false,
1131
- requiredScopes: [ 'files:write' ]
1132
- }
1133
-
1134
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1135
- [MCP-I] ❌ Delegation verification FAILED {
1136
- tool: 'protectedTool',
1137
- agentDid: 'did:key:zmock123...',
1138
- reason: 'Delegation token expired',
1139
- errorCode: undefined,
1140
- errorMessage: undefined,
1141
- requiredScopes: [ 'files:write' ]
1142
- }
1143
-
1144
- ✓ src/services/__tests__/access-control.service.test.ts (23 tests) 39ms
1145
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
1146
- [MCP-I] Checking tool protection: {
1147
- tool: 'protectedTool',
1148
- agentDid: 'did:key:zmock123...',
1149
- hasDelegation: true
1150
- }
1151
-
1152
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
1153
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1154
- tool: 'protectedTool',
1155
- agentDid: 'did:key:zmock123...',
1156
- hasDelegationToken: true,
1157
- hasConsentProof: false,
1158
- requiredScopes: [ 'files:write' ]
1159
- }
1160
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
1161
-
1162
- [MCP-I] ❌ Delegation verification FAILED {
1163
- tool: 'protectedTool',
1164
- agentDid: 'did:key:zmock123...',
1165
- reason: 'Insufficient scopes',
1166
- errorCode: undefined,
1167
- errorMessage: undefined,
1168
- requiredScopes: [ 'files:write' ]
1169
- }
1170
-
1171
- ✓ src/delegation/__tests__/vc-issuer.test.ts (21 tests) 60ms
1172
- stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should submit proof end-to-end
1173
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1174
- correlationId: 'f384070c-fd40-4213-9ce1-03a5a4ad41e3',
1175
- status: 200,
1176
- statusText: '',
1177
- headers: { 'content-type': 'application/json' },
1178
- responseTextLength: 100,
1179
- responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
1180
- fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
1012
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with success field in data
1013
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1014
+ correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
1015
+ status: 200,
1016
+ statusText: undefined,
1017
+ headers: {},
1018
+ responseTextLength: 191,
1019
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.364Z"}}',
1020
+ fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.364Z"}}'
1181
1021
  }
1182
1022
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
1183
- correlationId: 'f384070c-fd40-4213-9ce1-03a5a4ad41e3',
1023
+ correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
1184
1024
  status: 200,
1185
1025
  responseDataType: 'object',
1186
- responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1026
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1187
1027
  responseData: '{\n' +
1188
1028
  ' "success": true,\n' +
1029
+ ' "data": {\n' +
1030
+ ' "accepted": 1,\n' +
1031
+ ' "rejected": 0,\n' +
1032
+ ' "outcomes": {\n' +
1033
+ ' "success": 1,\n' +
1034
+ ' "failed": 0,\n' +
1035
+ ' "blocked": 0,\n' +
1036
+ ' "error": 0\n' +
1037
+ ' }\n' +
1038
+ ' },\n' +
1039
+ ' "metadata": {\n' +
1040
+ ' "requestId": "test-request-id",\n' +
1041
+ ' "timestamp": "2025-11-26T15:36:45.364Z"\n' +
1042
+ ' }\n' +
1043
+ '}'
1044
+ }
1045
+ [AccessControl] Raw response received: {
1046
+ "success": true,
1047
+ "data": {
1048
+ "accepted": 1,
1049
+ "rejected": 0,
1050
+ "outcomes": {
1051
+ "success": 1,
1052
+ "failed": 0,
1053
+ "blocked": 0,
1054
+ "error": 0
1055
+ }
1056
+ },
1057
+ "metadata": {
1058
+ "requestId": "test-request-id",
1059
+ "timestamp": "2025-11-26T15:36:45.364Z"
1060
+ }
1061
+ }
1062
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1063
+ correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
1064
+ dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
1065
+ hasAccepted: true,
1066
+ hasRejected: true,
1067
+ hasOutcomes: true,
1068
+ hasErrors: false,
1069
+ acceptedType: 'number',
1070
+ acceptedValue: 1,
1071
+ rejectedType: 'number',
1072
+ rejectedValue: 0,
1073
+ outcomesType: 'object',
1074
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
1075
+ errorsType: 'undefined',
1076
+ errorsIsArray: false,
1077
+ fullData: '{\n' +
1189
1078
  ' "accepted": 1,\n' +
1190
1079
  ' "rejected": 0,\n' +
1191
1080
  ' "outcomes": {\n' +
@@ -1196,715 +1085,1316 @@ stderr | src/services/__tests__/access-control.integration.test.ts > AccessContr
1196
1085
  ' }\n' +
1197
1086
  '}'
1198
1087
  }
1199
- [AccessControl] Raw response received: {
1200
- "success": true,
1201
- "accepted": 1,
1202
- "rejected": 0,
1203
- "outcomes": {
1204
- "success": 1,
1205
- "failed": 0,
1206
- "blocked": 0,
1207
- "error": 0
1208
- }
1088
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1089
+ correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
1090
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1091
+ hasSuccess: true,
1092
+ successValue: true,
1093
+ hasAccepted: true,
1094
+ acceptedValue: 1,
1095
+ hasRejected: true,
1096
+ rejectedValue: 0,
1097
+ hasOutcomes: true,
1098
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
1099
+ fullDataWithSuccess: '{\n' +
1100
+ ' "success": true,\n' +
1101
+ ' "accepted": 1,\n' +
1102
+ ' "rejected": 0,\n' +
1103
+ ' "outcomes": {\n' +
1104
+ ' "success": 1,\n' +
1105
+ ' "failed": 0,\n' +
1106
+ ' "blocked": 0,\n' +
1107
+ ' "error": 0\n' +
1108
+ ' }\n' +
1109
+ '}'
1209
1110
  }
1210
1111
 
1211
- stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should handle proof submission with errors
1112
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with errors array
1212
1113
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1213
- correlationId: '8cb7cff9-433c-465d-a851-d9e329e3f8f0',
1114
+ correlationId: '379ba9c2-a249-4004-a797-b65af80d45d0',
1214
1115
  status: 200,
1215
- statusText: '',
1216
- headers: { 'content-type': 'application/json' },
1217
- responseTextLength: 200,
1218
- responseTextPreview: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}',
1219
- fullResponseText: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}'
1116
+ statusText: undefined,
1117
+ headers: {},
1118
+ responseTextLength: 333,
1119
+ responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.376Z"}}',
1120
+ fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.376Z"}}'
1220
1121
  }
1221
1122
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
1222
- correlationId: '8cb7cff9-433c-465d-a851-d9e329e3f8f0',
1123
+ correlationId: '379ba9c2-a249-4004-a797-b65af80d45d0',
1223
1124
  status: 200,
1224
1125
  responseDataType: 'object',
1225
- responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1126
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1226
1127
  responseData: '{\n' +
1227
1128
  ' "success": true,\n' +
1228
- ' "accepted": 0,\n' +
1229
- ' "rejected": 1,\n' +
1230
- ' "outcomes": {\n' +
1231
- ' "success": 0,\n' +
1232
- ' "failed": 1,\n' +
1233
- ' "blocked": 0,\n' +
1234
- ' "error": 0\n' +
1235
- ' },\n' +
1236
- ' "errors": [\n' +
1237
- ' {\n' +
1238
- ' "proof_index": 0,\n' +
1239
- ' "error": {\n' +
1240
- ' "code": "invalid_signature",\n' +
1241
- ' "message": "Invalid JWS signature"\n' +
1129
+ ' "data": {\n' +
1130
+ ' "accepted": 0,\n' +
1131
+ ' "rejected": 1,\n' +
1132
+ ' "outcomes": {\n' +
1133
+ ' "success": 0,\n' +
1134
+ ' "failed": 1,\n' +
1135
+ ' "blocked": 0,\n' +
1136
+ ' "error": 0\n' +
1137
+ ' },\n' +
1138
+ ' "errors": [\n' +
1139
+ ' {\n' +
1140
+ ' "proof_index": 0,\n' +
1141
+ ' "error": {\n' +
1142
+ ' "code": "validation_error",\n' +
1143
+ ' "message": "Proof validation failed",\n' +
1144
+ ' "details": {\n' +
1145
+ ' "reason": "invalid_signature"\n' +
1146
+ ' }\n' +
1147
+ ' }\n' +
1242
1148
  ' }\n' +
1243
- ' }\n' +
1244
- ' ]\n' +
1149
+ ' ]\n' +
1150
+ ' },\n' +
1151
+ ' "metadata": {\n' +
1152
+ ' "requestId": "test-request-id",\n' +
1153
+ ' "timestamp": "2025-11-26T15:36:45.376Z"\n' +
1154
+ ' }\n' +
1245
1155
  '}'
1246
1156
  }
1247
1157
  [AccessControl] Raw response received: {
1248
1158
  "success": true,
1249
- "accepted": 0,
1250
- "rejected": 1,
1251
- "outcomes": {
1252
- "success": 0,
1253
- "failed": 1,
1254
- "blocked": 0,
1255
- "error": 0
1256
- },
1257
- "errors": [
1258
- {
1259
- "proof_index": 0,
1260
- "error": {
1261
- "code": "invalid_signature",
1262
- "message": "Invalid JWS signature"
1159
+ "data": {
1160
+ "accepted": 0,
1161
+ "rejected": 1,
1162
+ "outcomes": {
1163
+ "success": 0,
1164
+ "failed": 1,
1165
+ "blocked": 0,
1166
+ "error": 0
1167
+ },
1168
+ "errors": [
1169
+ {
1170
+ "proof_index": 0,
1171
+ "error": {
1172
+ "code": "validation_error",
1173
+ "message": "Proof validation failed",
1174
+ "details": {
1175
+ "reason": "invalid_signature"
1176
+ }
1177
+ }
1263
1178
  }
1264
- }
1265
- ]
1179
+ ]
1180
+ },
1181
+ "metadata": {
1182
+ "requestId": "test-request-id",
1183
+ "timestamp": "2025-11-26T15:36:45.376Z"
1184
+ }
1266
1185
  }
1267
-
1268
- stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Verification Flow > should verify proof using ProofVerifier
1269
- [CryptoService] Key ID mismatch
1270
-
1271
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1272
- [MCP-I] Checking tool protection: {
1273
- tool: 'protectedTool',
1274
- agentDid: 'did:key:zmock123...',
1275
- hasDelegation: true
1186
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1187
+ correlationId: '379ba9c2-a249-4004-a797-b65af80d45d0',
1188
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1189
+ hasAccepted: true,
1190
+ hasRejected: true,
1191
+ hasOutcomes: true,
1192
+ hasErrors: true,
1193
+ acceptedType: 'number',
1194
+ acceptedValue: 0,
1195
+ rejectedType: 'number',
1196
+ rejectedValue: 1,
1197
+ outcomesType: 'object',
1198
+ outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
1199
+ errorsType: 'object',
1200
+ errorsIsArray: true,
1201
+ fullData: '{\n' +
1202
+ ' "accepted": 0,\n' +
1203
+ ' "rejected": 1,\n' +
1204
+ ' "outcomes": {\n' +
1205
+ ' "success": 0,\n' +
1206
+ ' "failed": 1,\n' +
1207
+ ' "blocked": 0,\n' +
1208
+ ' "error": 0\n' +
1209
+ ' },\n' +
1210
+ ' "errors": [\n' +
1211
+ ' {\n' +
1212
+ ' "proof_index": 0,\n' +
1213
+ ' "error": {\n' +
1214
+ ' "code": "validation_error",\n' +
1215
+ ' "message": "Proof validation failed",\n' +
1216
+ ' "details": {\n' +
1217
+ ' "reason": "invalid_signature"\n' +
1218
+ ' }\n' +
1219
+ ' }\n' +
1220
+ ' }\n' +
1221
+ ' ]\n' +
1222
+ '}'
1276
1223
  }
1277
-
1278
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1279
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1280
- tool: 'protectedTool',
1281
- agentDid: 'did:key:zmock123...',
1282
- hasDelegationToken: true,
1283
- hasConsentProof: false,
1284
- requiredScopes: [ 'files:write' ]
1224
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1225
+ correlationId: '379ba9c2-a249-4004-a797-b65af80d45d0',
1226
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1227
+ hasSuccess: true,
1228
+ successValue: true,
1229
+ hasAccepted: true,
1230
+ acceptedValue: 0,
1231
+ hasRejected: true,
1232
+ rejectedValue: 1,
1233
+ hasOutcomes: true,
1234
+ outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
1235
+ fullDataWithSuccess: '{\n' +
1236
+ ' "success": true,\n' +
1237
+ ' "accepted": 0,\n' +
1238
+ ' "rejected": 1,\n' +
1239
+ ' "outcomes": {\n' +
1240
+ ' "success": 0,\n' +
1241
+ ' "failed": 1,\n' +
1242
+ ' "blocked": 0,\n' +
1243
+ ' "error": 0\n' +
1244
+ ' },\n' +
1245
+ ' "errors": [\n' +
1246
+ ' {\n' +
1247
+ ' "proof_index": 0,\n' +
1248
+ ' "error": {\n' +
1249
+ ' "code": "validation_error",\n' +
1250
+ ' "message": "Proof validation failed",\n' +
1251
+ ' "details": {\n' +
1252
+ ' "reason": "invalid_signature"\n' +
1253
+ ' }\n' +
1254
+ ' }\n' +
1255
+ ' }\n' +
1256
+ ' ]\n' +
1257
+ '}'
1285
1258
  }
1286
1259
 
1287
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
1288
- [MCP-I] Checking tool protection: {
1289
- tool: 'protectedTool',
1290
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1291
- agentDid: 'did:key:zmock123...',
1292
- [MCP-I] ❌ Delegation verification error (API failure) {
1293
- tool: 'protectedTool',
1294
- hasDelegation: true
1295
- agentDid: 'did:key:zmock123...',
1260
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response without outcomes (optional field)
1261
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1262
+ correlationId: '4277a869-2b7b-4fd8-a82c-6db33c14ef67',
1263
+ status: 200,
1264
+ statusText: undefined,
1265
+ headers: {},
1266
+ responseTextLength: 133,
1267
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.377Z"}}',
1268
+ fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.377Z"}}'
1296
1269
  }
1297
-
1298
- errorCode: 'network_error',
1299
- errorMessage: 'API unavailable',
1300
- errorDetails: {}
1270
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1271
+ correlationId: '4277a869-2b7b-4fd8-a82c-6db33c14ef67',
1272
+ status: 200,
1273
+ responseDataType: 'object',
1274
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1275
+ responseData: '{\n' +
1276
+ ' "success": true,\n' +
1277
+ ' "data": {\n' +
1278
+ ' "accepted": 1,\n' +
1279
+ ' "rejected": 0\n' +
1280
+ ' },\n' +
1281
+ ' "metadata": {\n' +
1282
+ ' "requestId": "test-request-id",\n' +
1283
+ ' "timestamp": "2025-11-26T15:36:45.377Z"\n' +
1284
+ ' }\n' +
1285
+ '}'
1301
1286
  }
1302
-
1303
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
1304
- [MCP-I] Checking tool protection: {
1305
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
1306
- [MCP-I] ⚠️ Delegation token provided but AccessControlApiService not configured - skipping verification {
1307
- tool: 'protectedTool',
1308
- tool: 'protectedTool',
1309
- agentDid: 'did:key:zmock123...',
1310
- hasDelegation: true
1311
- agentDid: 'did:key:zmock123...',
1312
- hasDelegationToken: true,
1313
- hasConsentProof: false
1287
+ [AccessControl] Raw response received: {
1288
+ "success": true,
1289
+ "data": {
1290
+ "accepted": 1,
1291
+ "rejected": 0
1292
+ },
1293
+ "metadata": {
1294
+ "requestId": "test-request-id",
1295
+ "timestamp": "2025-11-26T15:36:45.377Z"
1296
+ }
1314
1297
  }
1315
-
1298
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1299
+ correlationId: '4277a869-2b7b-4fd8-a82c-6db33c14ef67',
1300
+ dataKeys: [ 'accepted', 'rejected' ],
1301
+ hasAccepted: true,
1302
+ hasRejected: true,
1303
+ hasOutcomes: false,
1304
+ hasErrors: false,
1305
+ acceptedType: 'number',
1306
+ acceptedValue: 1,
1307
+ rejectedType: 'number',
1308
+ rejectedValue: 0,
1309
+ outcomesType: 'undefined',
1310
+ outcomesValue: undefined,
1311
+ errorsType: 'undefined',
1312
+ errorsIsArray: false,
1313
+ fullData: '{\n "accepted": 1,\n "rejected": 0\n}'
1316
1314
  }
1317
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
1318
-
1319
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
1320
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1321
- tool: 'protectedTool',
1322
- [MCP-I] 🔒 SECURITY: User identifier validation FAILED {
1323
- agentDid: 'did:key:zmock123...',
1324
- hasDelegationToken: true,
1325
- hasConsentProof: false,
1326
- requiredScopes: [ 'files:write' ]
1315
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1316
+ correlationId: '4277a869-2b7b-4fd8-a82c-6db33c14ef67',
1317
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
1318
+ hasSuccess: true,
1319
+ successValue: true,
1320
+ hasAccepted: true,
1321
+ acceptedValue: 1,
1322
+ hasRejected: true,
1323
+ rejectedValue: 0,
1324
+ hasOutcomes: false,
1325
+ outcomesValue: undefined,
1326
+ fullDataWithSuccess: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
1327
1327
  }
1328
- tool: 'protectedTool',
1329
1328
 
1330
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should accept delegation when user_identifier matches session userDid
1331
- [MCP-I] Checking tool protection: {
1332
- tool: 'protectedTool',
1333
- agentDid: 'did:key:zmock123...',
1334
- delegationUserIdentifier: 'did:key:zUserB987654...',
1335
- agentDid: 'did:key:zmock123...',
1336
- hasDelegation: true
1337
- }
1329
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
1330
+ [StorageService] Failed to initialize KV, falling back to memory: Failed to import Cloudflare storage providers: Cannot find package '@kya-os/mcp-i-cloudflare/providers/storage' imported from '/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/storage.service.ts'
1338
1331
 
1339
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should accept delegation when user_identifier matches session userDid
1340
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1341
- tool: 'protectedTool',
1342
- agentDid: 'did:key:zmock123...',
1343
- sessionUserDid: 'did:key:zUserA123456...',
1344
- sessionId: 'session123...',
1345
- hasDelegationToken: true,
1346
- reason: 'user_identifier_mismatch',
1347
- severity: 'high'
1348
- hasConsentProof: false,
1349
- requiredScopes: [ 'files:write' ]
1350
- }
1351
- }
1332
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should fall back to memory when Redis connection fails
1333
+ [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
1352
1334
 
1335
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should use KV namespace when provided
1336
+ [StorageService] Failed to initialize KV, falling back to memory: Failed to import Cloudflare storage providers: Cannot find package '@kya-os/mcp-i-cloudflare/providers/storage' imported from '/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/storage.service.ts'
1353
1337
 
1354
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should accept delegation when user_identifier matches session userDid
1355
- [MCP-I] User identifier validation PASSED {
1356
- tool: 'protectedTool',
1357
- agentDid: 'did:key:zmock123...',
1358
- userDid: 'did:key:zUserA123456...',
1359
- sessionId: 'session123...'
1338
+ src/services/__tests__/access-control.service.test.ts (23 tests) 34ms
1339
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should throw validation error if data object missing success field
1340
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1341
+ correlationId: 'd99d9059-cc05-4ce7-84f1-7d951e39daac',
1342
+ status: 200,
1343
+ statusText: undefined,
1344
+ headers: {},
1345
+ responseTextLength: 191,
1346
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.378Z"}}',
1347
+ fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T15:36:45.378Z"}}'
1360
1348
  }
1361
- [MCP-I] Delegation verification SUCCEEDED {
1362
- tool: 'protectedTool',
1363
- agentDid: 'did:key:zmock123...',
1364
- delegationId: 'test-delegation-id',
1365
- credentialScopes: [ 'files:write' ],
1366
- requiredScopes: [ 'files:write' ]
1349
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1350
+ correlationId: 'd99d9059-cc05-4ce7-84f1-7d951e39daac',
1351
+ status: 200,
1352
+ responseDataType: 'object',
1353
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1354
+ responseData: '{\n' +
1355
+ ' "success": true,\n' +
1356
+ ' "data": {\n' +
1357
+ ' "accepted": 1,\n' +
1358
+ ' "rejected": 0,\n' +
1359
+ ' "outcomes": {\n' +
1360
+ ' "success": 1,\n' +
1361
+ ' "failed": 0,\n' +
1362
+ ' "blocked": 0,\n' +
1363
+ ' "error": 0\n' +
1364
+ ' }\n' +
1365
+ ' },\n' +
1366
+ ' "metadata": {\n' +
1367
+ ' "requestId": "test-request-id",\n' +
1368
+ ' "timestamp": "2025-11-26T15:36:45.378Z"\n' +
1369
+ ' }\n' +
1370
+ '}'
1367
1371
  }
1368
-
1369
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing user_identifier gracefully (backward compatibility)
1370
- [MCP-I] Checking tool protection: {
1371
- tool: 'protectedTool',
1372
- agentDid: 'did:key:zmock123...',
1373
- hasDelegation: true
1372
+ [AccessControl] Raw response received: {
1373
+ "success": true,
1374
+ "data": {
1375
+ "accepted": 1,
1376
+ "rejected": 0,
1377
+ "outcomes": {
1378
+ "success": 1,
1379
+ "failed": 0,
1380
+ "blocked": 0,
1381
+ "error": 0
1382
+ }
1383
+ },
1384
+ "metadata": {
1385
+ "requestId": "test-request-id",
1386
+ "timestamp": "2025-11-26T15:36:45.378Z"
1387
+ }
1374
1388
  }
1375
-
1376
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing user_identifier gracefully (backward compatibility)
1377
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1378
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
1379
- tool: 'protectedTool',
1380
- [MCP-I] ⚠️ Delegation has user_identifier but session missing userDid {
1381
- tool: 'protectedTool',
1382
- agentDid: 'did:key:zmock123...',
1383
- hasDelegationToken: true,
1384
- agentDid: 'did:key:zmock123...',
1385
- hasConsentProof: false,
1386
- requiredScopes: [ 'files:write' ]
1389
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1390
+ correlationId: 'd99d9059-cc05-4ce7-84f1-7d951e39daac',
1391
+ dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
1392
+ hasAccepted: true,
1393
+ hasRejected: true,
1394
+ hasOutcomes: true,
1395
+ hasErrors: false,
1396
+ acceptedType: 'number',
1397
+ acceptedValue: 1,
1398
+ rejectedType: 'number',
1399
+ rejectedValue: 0,
1400
+ outcomesType: 'object',
1401
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
1402
+ errorsType: 'undefined',
1403
+ errorsIsArray: false,
1404
+ fullData: '{\n' +
1405
+ ' "accepted": 1,\n' +
1406
+ ' "rejected": 0,\n' +
1407
+ ' "outcomes": {\n' +
1408
+ ' "success": 1,\n' +
1409
+ ' "failed": 0,\n' +
1410
+ ' "blocked": 0,\n' +
1411
+ ' "error": 0\n' +
1412
+ ' }\n' +
1413
+ '}'
1387
1414
  }
1388
-
1389
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing user_identifier gracefully (backward compatibility)
1390
- [MCP-I] Delegation verification SUCCEEDED {
1391
- delegationUserIdentifier: 'did:key:zUserA123456...',
1392
- tool: 'protectedTool',
1393
- agentDid: 'did:key:zmock123...',
1394
- delegationId: 'test-delegation-id',
1395
- credentialScopes: [ 'files:write' ],
1396
- sessionId: 'session123...'
1415
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1416
+ correlationId: 'd99d9059-cc05-4ce7-84f1-7d951e39daac',
1417
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1418
+ hasSuccess: true,
1419
+ successValue: true,
1420
+ hasAccepted: true,
1421
+ acceptedValue: 1,
1422
+ hasRejected: true,
1423
+ rejectedValue: 0,
1424
+ hasOutcomes: true,
1425
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
1426
+ fullDataWithSuccess: '{\n' +
1427
+ ' "success": true,\n' +
1428
+ ' "accepted": 1,\n' +
1429
+ ' "rejected": 0,\n' +
1430
+ ' "outcomes": {\n' +
1431
+ ' "success": 1,\n' +
1432
+ ' "failed": 0,\n' +
1433
+ ' "blocked": 0,\n' +
1434
+ ' "error": 0\n' +
1435
+ ' }\n' +
1436
+ '}'
1397
1437
  }
1398
- requiredScopes: [ 'files:write' ]
1399
1438
 
1400
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
1439
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should correctly extract data from wrapped response after JSON deep clone
1440
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1441
+ correlationId: '1720e7cd-d11b-4e5e-a7f3-947163c96fcc',
1442
+ status: 200,
1443
+ statusText: undefined,
1444
+ headers: {},
1445
+ responseTextLength: 191,
1446
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1},"errors":[]},"metadata":{"requestId":"fc1fa88f-9b22-4161-b4fd-17d8215098ee","timestamp":"2025-11-24T21:36:33.029Z"}}',
1447
+ fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1},"errors":[]},"metadata":{"requestId":"fc1fa88f-9b22-4161-b4fd-17d8215098ee","timestamp":"2025-11-24T21:36:33.029Z"}}'
1401
1448
  }
1402
-
1403
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
1404
- [MCP-I] Checking tool protection: {
1405
- tool: 'protectedTool',
1406
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1407
- agentDid: 'did:key:zmock123...',
1408
- hasDelegation: true
1449
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1450
+ correlationId: '1720e7cd-d11b-4e5e-a7f3-947163c96fcc',
1451
+ status: 200,
1452
+ responseDataType: 'object',
1453
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1454
+ responseData: '{\n' +
1455
+ ' "success": true,\n' +
1456
+ ' "data": {\n' +
1457
+ ' "accepted": 1,\n' +
1458
+ ' "rejected": 0,\n' +
1459
+ ' "outcomes": {\n' +
1460
+ ' "success": 1\n' +
1461
+ ' },\n' +
1462
+ ' "errors": []\n' +
1463
+ ' },\n' +
1464
+ ' "metadata": {\n' +
1465
+ ' "requestId": "fc1fa88f-9b22-4161-b4fd-17d8215098ee",\n' +
1466
+ ' "timestamp": "2025-11-24T21:36:33.029Z"\n' +
1467
+ ' }\n' +
1468
+ '}'
1409
1469
  }
1410
-
1411
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
1412
- tool: 'protectedTool',
1413
- requiredScopes: [ 'files:write' ],
1414
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1415
- agentDid: 'did:key:zmock123...',
1416
- resumeToken: 'resume_vyl74l_miev24el',
1417
- tool: 'protectedTool',
1418
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_vyl74l_miev24el'
1470
+ [AccessControl] Raw response received: {
1471
+ "success": true,
1472
+ "data": {
1473
+ "accepted": 1,
1474
+ "rejected": 0,
1475
+ "outcomes": {
1476
+ "success": 1
1477
+ },
1478
+ "errors": []
1479
+ },
1480
+ "metadata": {
1481
+ "requestId": "fc1fa88f-9b22-4161-b4fd-17d8215098ee",
1482
+ "timestamp": "2025-11-24T21:36:33.029Z"
1483
+ }
1419
1484
  }
1420
- agentDid: 'did:key:zmock123...',
1421
- hasDelegationToken: true,
1422
-
1423
- hasConsentProof: false,
1424
- requiredScopes: [ 'files:write' ]
1485
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1486
+ correlationId: '1720e7cd-d11b-4e5e-a7f3-947163c96fcc',
1487
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1488
+ hasAccepted: true,
1489
+ hasRejected: true,
1490
+ hasOutcomes: true,
1491
+ hasErrors: true,
1492
+ acceptedType: 'number',
1493
+ acceptedValue: 1,
1494
+ rejectedType: 'number',
1495
+ rejectedValue: 0,
1496
+ outcomesType: 'object',
1497
+ outcomesValue: { success: 1 },
1498
+ errorsType: 'object',
1499
+ errorsIsArray: true,
1500
+ fullData: '{\n' +
1501
+ ' "accepted": 1,\n' +
1502
+ ' "rejected": 0,\n' +
1503
+ ' "outcomes": {\n' +
1504
+ ' "success": 1\n' +
1505
+ ' },\n' +
1506
+ ' "errors": []\n' +
1507
+ '}'
1425
1508
  }
1426
-
1427
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
1428
- [MCP-I] Delegation verification SUCCEEDED {
1429
- tool: 'protectedTool',
1430
- agentDid: 'did:key:zmock123...',
1431
- delegationId: 'test-delegation-id',
1432
- credentialScopes: [ 'files:write' ],
1433
- requiredScopes: [ 'files:write' ]
1509
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1510
+ correlationId: '1720e7cd-d11b-4e5e-a7f3-947163c96fcc',
1511
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1512
+ hasSuccess: true,
1513
+ successValue: true,
1514
+ hasAccepted: true,
1515
+ acceptedValue: 1,
1516
+ hasRejected: true,
1517
+ rejectedValue: 0,
1518
+ hasOutcomes: true,
1519
+ outcomesValue: { success: 1 },
1520
+ fullDataWithSuccess: '{\n' +
1521
+ ' "success": true,\n' +
1522
+ ' "accepted": 1,\n' +
1523
+ ' "rejected": 0,\n' +
1524
+ ' "outcomes": {\n' +
1525
+ ' "success": 1\n' +
1526
+ ' },\n' +
1527
+ ' "errors": []\n' +
1528
+ '}'
1434
1529
  }
1435
1530
 
1436
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
1437
- [MCP-I] Checking tool protection: {
1438
- tool: 'unprotectedTool',
1439
- agentDid: 'did:key:zmock123...',
1440
- hasDelegation: false
1531
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should handle response where data fields are numeric values (not undefined)
1532
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1533
+ correlationId: 'a503dfd0-d743-4265-b852-8651f811be47',
1534
+ status: 200,
1535
+ statusText: undefined,
1536
+ headers: {},
1537
+ responseTextLength: 151,
1538
+ responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-11-26T15:36:45.380Z"}}',
1539
+ fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-11-26T15:36:45.380Z"}}'
1441
1540
  }
1442
-
1443
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
1444
- [MCP-I] Tool protection check passed (no delegation required) {
1445
- tool: 'unprotectedTool',
1446
- agentDid: 'did:key:zmock123...',
1447
- reason: 'Tool not configured to require delegation'
1541
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1542
+ correlationId: 'a503dfd0-d743-4265-b852-8651f811be47',
1543
+ status: 200,
1544
+ responseDataType: 'object',
1545
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1546
+ responseData: '{\n' +
1547
+ ' "success": true,\n' +
1548
+ ' "data": {\n' +
1549
+ ' "accepted": 0,\n' +
1550
+ ' "rejected": 0,\n' +
1551
+ ' "outcomes": {},\n' +
1552
+ ' "errors": []\n' +
1553
+ ' },\n' +
1554
+ ' "metadata": {\n' +
1555
+ ' "requestId": "test-id",\n' +
1556
+ ' "timestamp": "2025-11-26T15:36:45.380Z"\n' +
1557
+ ' }\n' +
1558
+ '}'
1448
1559
  }
1449
-
1450
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
1451
- [MCP-I] Checking tool protection: {
1452
- tool: 'protectedTool',
1453
- agentDid: 'did:key:zmock123...',
1454
- hasDelegation: false
1455
- }
1456
-
1457
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
1458
- [MCP-I] Checking tool protection: {
1459
- tool: 'protectedTool',
1460
- agentDid: 'did:key:zmock123...',
1461
- hasDelegation: false
1462
- }
1463
-
1464
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
1465
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1466
- tool: 'protectedTool',
1467
- requiredScopes: [ 'files:write' ],
1468
- agentDid: 'did:key:zmock123...',
1469
- resumeToken: 'resume_vyl75g_miev24el',
1470
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_vyl75g_miev24el'
1471
- }
1472
-
1473
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
1474
- [MCP-I] Checking tool protection: {
1475
- tool: 'protectedTool',
1476
- agentDid: 'did:key:zmock123...',
1477
- hasDelegation: false
1478
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
1479
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1560
+ [AccessControl] Raw response received: {
1561
+ "success": true,
1562
+ "data": {
1563
+ "accepted": 0,
1564
+ "rejected": 0,
1565
+ "outcomes": {},
1566
+ "errors": []
1567
+ },
1568
+ "metadata": {
1569
+ "requestId": "test-id",
1570
+ "timestamp": "2025-11-26T15:36:45.380Z"
1571
+ }
1480
1572
  }
1481
-
1482
- tool: 'protectedTool',
1483
- requiredScopes: [ 'files:write', 'files:read' ],
1484
- agentDid: 'did:key:zmock123...',
1485
- resumeToken: 'resume_vyl76b_miev24em',
1486
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite%2Cfiles%3Aread&session_id=session123&agent_did=&resume_token=resume_vyl76b_miev24em'
1573
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1574
+ correlationId: 'a503dfd0-d743-4265-b852-8651f811be47',
1575
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1576
+ hasAccepted: true,
1577
+ hasRejected: true,
1578
+ hasOutcomes: true,
1579
+ hasErrors: true,
1580
+ acceptedType: 'number',
1581
+ acceptedValue: 0,
1582
+ rejectedType: 'number',
1583
+ rejectedValue: 0,
1584
+ outcomesType: 'object',
1585
+ outcomesValue: {},
1586
+ errorsType: 'object',
1587
+ errorsIsArray: true,
1588
+ fullData: '{\n "accepted": 0,\n "rejected": 0,\n "outcomes": {},\n "errors": []\n}'
1487
1589
  }
1488
-
1489
- ✓ src/__tests__/runtime/route-interception.test.ts (21 tests) 22ms
1490
- src/__tests__/runtime/base.test.ts (55 tests) 20ms
1491
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
1492
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
1493
- [MCP-I] Checking tool protection: {
1494
- tool: 'protectedTool',
1495
- agentDid: 'did:key:zmock123...',
1496
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1497
- hasDelegation: false
1590
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1591
+ correlationId: 'a503dfd0-d743-4265-b852-8651f811be47',
1592
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1593
+ hasSuccess: true,
1594
+ successValue: true,
1595
+ hasAccepted: true,
1596
+ acceptedValue: 0,
1597
+ hasRejected: true,
1598
+ rejectedValue: 0,
1599
+ hasOutcomes: true,
1600
+ outcomesValue: {},
1601
+ fullDataWithSuccess: '{\n' +
1602
+ ' "success": true,\n' +
1603
+ ' "accepted": 0,\n' +
1604
+ ' "rejected": 0,\n' +
1605
+ ' "outcomes": {},\n' +
1606
+ ' "errors": []\n' +
1607
+ '}'
1498
1608
  }
1499
- tool: 'protectedTool',
1500
- requiredScopes: [ 'files:write' ],
1501
1609
 
1502
- agentDid: 'did:key:zmock123...',
1503
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
1504
- [MCP-I] Checking tool protection: {
1505
- resumeToken: 'resume_vyl76b_miev24em',
1506
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_vyl76b_miev24em'
1507
- tool: 'protectedTool',
1508
- agentDid: 'did:key:zmock123...',
1509
- hasDelegation: false
1610
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should handle response with nested outcomes object
1611
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1612
+ correlationId: '92b20f95-5715-4269-a897-5091058dfb43',
1613
+ status: 200,
1614
+ statusText: undefined,
1615
+ headers: {},
1616
+ responseTextLength: 278,
1617
+ responseTextPreview: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-11-26T15:36:45.381Z"}}',
1618
+ fullResponseText: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-11-26T15:36:45.381Z"}}'
1510
1619
  }
1620
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1621
+ correlationId: '92b20f95-5715-4269-a897-5091058dfb43',
1622
+ status: 200,
1623
+ responseDataType: 'object',
1624
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1625
+ responseData: '{\n' +
1626
+ ' "success": true,\n' +
1627
+ ' "data": {\n' +
1628
+ ' "accepted": 3,\n' +
1629
+ ' "rejected": 2,\n' +
1630
+ ' "outcomes": {\n' +
1631
+ ' "success": 1,\n' +
1632
+ ' "failed": 1,\n' +
1633
+ ' "blocked": 1,\n' +
1634
+ ' "error": 2\n' +
1635
+ ' },\n' +
1636
+ ' "errors": [\n' +
1637
+ ' {\n' +
1638
+ ' "proof_index": 0,\n' +
1639
+ ' "error": {\n' +
1640
+ ' "code": "validation_error",\n' +
1641
+ ' "message": "Invalid signature"\n' +
1642
+ ' }\n' +
1643
+ ' }\n' +
1644
+ ' ]\n' +
1645
+ ' },\n' +
1646
+ ' "metadata": {\n' +
1647
+ ' "requestId": "test-id",\n' +
1648
+ ' "timestamp": "2025-11-26T15:36:45.381Z"\n' +
1649
+ ' }\n' +
1650
+ '}'
1511
1651
  }
1512
-
1513
-
1514
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
1515
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
1516
- [MCP-I] Checking tool protection: {
1517
- tool: 'protectedTool',
1518
- agentDid: 'did:key:zmock123...',
1519
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1520
- hasDelegation: false
1521
- tool: 'protectedTool',
1652
+ [AccessControl] Raw response received: {
1653
+ "success": true,
1654
+ "data": {
1655
+ "accepted": 3,
1656
+ "rejected": 2,
1657
+ "outcomes": {
1658
+ "success": 1,
1659
+ "failed": 1,
1660
+ "blocked": 1,
1661
+ "error": 2
1662
+ },
1663
+ "errors": [
1664
+ {
1665
+ "proof_index": 0,
1666
+ "error": {
1667
+ "code": "validation_error",
1668
+ "message": "Invalid signature"
1669
+ }
1670
+ }
1671
+ ]
1672
+ },
1673
+ "metadata": {
1674
+ "requestId": "test-id",
1675
+ "timestamp": "2025-11-26T15:36:45.381Z"
1676
+ }
1522
1677
  }
1523
- requiredScopes: [ 'files:write' ],
1524
- agentDid: 'did:key:zmock123...',
1525
- resumeToken: 'resume_vyl76b_miev24en',
1526
-
1527
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
1528
- [MCP-I] Checking tool protection: {
1529
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_vyl76b_miev24en'
1530
- tool: 'testTool',
1531
- agentDid: 'did:key:zmock123...',
1532
- hasDelegation: false
1678
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1679
+ correlationId: '92b20f95-5715-4269-a897-5091058dfb43',
1680
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1681
+ hasAccepted: true,
1682
+ hasRejected: true,
1683
+ hasOutcomes: true,
1684
+ hasErrors: true,
1685
+ acceptedType: 'number',
1686
+ acceptedValue: 3,
1687
+ rejectedType: 'number',
1688
+ rejectedValue: 2,
1689
+ outcomesType: 'object',
1690
+ outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
1691
+ errorsType: 'object',
1692
+ errorsIsArray: true,
1693
+ fullData: '{\n' +
1694
+ ' "accepted": 3,\n' +
1695
+ ' "rejected": 2,\n' +
1696
+ ' "outcomes": {\n' +
1697
+ ' "success": 1,\n' +
1698
+ ' "failed": 1,\n' +
1699
+ ' "blocked": 1,\n' +
1700
+ ' "error": 2\n' +
1701
+ ' },\n' +
1702
+ ' "errors": [\n' +
1703
+ ' {\n' +
1704
+ ' "proof_index": 0,\n' +
1705
+ ' "error": {\n' +
1706
+ ' "code": "validation_error",\n' +
1707
+ ' "message": "Invalid signature"\n' +
1708
+ ' }\n' +
1709
+ ' }\n' +
1710
+ ' ]\n' +
1711
+ '}'
1533
1712
  }
1713
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1714
+ correlationId: '92b20f95-5715-4269-a897-5091058dfb43',
1715
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1716
+ hasSuccess: true,
1717
+ successValue: true,
1718
+ hasAccepted: true,
1719
+ acceptedValue: 3,
1720
+ hasRejected: true,
1721
+ rejectedValue: 2,
1722
+ hasOutcomes: true,
1723
+ outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
1724
+ fullDataWithSuccess: '{\n' +
1725
+ ' "success": true,\n' +
1726
+ ' "accepted": 3,\n' +
1727
+ ' "rejected": 2,\n' +
1728
+ ' "outcomes": {\n' +
1729
+ ' "success": 1,\n' +
1730
+ ' "failed": 1,\n' +
1731
+ ' "blocked": 1,\n' +
1732
+ ' "error": 2\n' +
1733
+ ' },\n' +
1734
+ ' "errors": [\n' +
1735
+ ' {\n' +
1736
+ ' "proof_index": 0,\n' +
1737
+ ' "error": {\n' +
1738
+ ' "code": "validation_error",\n' +
1739
+ ' "message": "Invalid signature"\n' +
1740
+ ' }\n' +
1741
+ ' }\n' +
1742
+ ' ]\n' +
1743
+ '}'
1534
1744
  }
1535
1745
 
1746
+ ✓ src/services/__tests__/access-control.proof-response-validation.test.ts (12 tests) 18ms
1747
+ ✓ src/services/__tests__/storage.service.test.ts (17 tests) 22ms
1748
+ stderr | src/services/__tests__/proof-verifier.test.ts > ProofVerifier Security > Signature Verification > should handle signature verification errors gracefully
1749
+ [CryptoService] Ed25519 verification error: Error: Crypto error
1750
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.test.ts:328:9
1751
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1752
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1753
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1754
+ at new Promise (<anonymous>)
1755
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1756
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1757
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
1758
+ at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
1759
+ at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
1536
1760
 
1537
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
1538
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1539
- tool: 'protectedTool',
1540
- requiredScopes: [ 'files:write' ],
1541
- agentDid: 'did:key:zmock123...',
1542
- resumeToken: 'resume_mvsnjn_miev24en',
1543
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_mvsnjn_miev24en'
1761
+ stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should submit proof end-to-end
1762
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1763
+ correlationId: '5be6f8ae-ee53-4b5f-a627-da78df1494fb',
1764
+ status: 200,
1765
+ statusText: '',
1766
+ headers: { 'content-type': 'application/json' },
1767
+ responseTextLength: 100,
1768
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
1769
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
1544
1770
  }
1545
-
1546
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
1547
- [MCP-I] Tool protection check passed (no delegation required) {
1548
- tool: 'testTool',
1549
- agentDid: 'did:key:zmock123...',
1550
- reason: 'Tool not configured to require delegation'
1771
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1772
+ correlationId: '5be6f8ae-ee53-4b5f-a627-da78df1494fb',
1773
+ status: 200,
1774
+ responseDataType: 'object',
1775
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1776
+ responseData: '{\n' +
1777
+ ' "success": true,\n' +
1778
+ ' "accepted": 1,\n' +
1779
+ ' "rejected": 0,\n' +
1780
+ ' "outcomes": {\n' +
1781
+ ' "success": 1,\n' +
1782
+ ' "failed": 0,\n' +
1783
+ ' "blocked": 0,\n' +
1784
+ ' "error": 0\n' +
1785
+ ' }\n' +
1786
+ '}'
1787
+ }
1788
+ [AccessControl] Raw response received: {
1789
+ "success": true,
1790
+ "accepted": 1,
1791
+ "rejected": 0,
1792
+ "outcomes": {
1793
+ "success": 1,
1794
+ "failed": 0,
1795
+ "blocked": 0,
1796
+ "error": 0
1797
+ }
1551
1798
  }
1552
1799
 
1553
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log blocked tool call when audit enabled
1554
- [MCP-I] Checking tool protection: {
1555
- tool: 'protectedTool',
1556
- agentDid: 'did:key:zmock123...',
1557
- hasDelegation: false
1800
+ stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should handle proof submission with errors
1801
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1802
+ correlationId: '1ceb40b1-e915-4474-97ee-d103432d8f85',
1803
+ status: 200,
1804
+ statusText: '',
1805
+ headers: { 'content-type': 'application/json' },
1806
+ responseTextLength: 200,
1807
+ responseTextPreview: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}',
1808
+ fullResponseText: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}'
1809
+ }
1810
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1811
+ correlationId: '1ceb40b1-e915-4474-97ee-d103432d8f85',
1812
+ status: 200,
1813
+ responseDataType: 'object',
1814
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1815
+ responseData: '{\n' +
1816
+ ' "success": true,\n' +
1817
+ ' "accepted": 0,\n' +
1818
+ ' "rejected": 1,\n' +
1819
+ ' "outcomes": {\n' +
1820
+ ' "success": 0,\n' +
1821
+ ' "failed": 1,\n' +
1822
+ ' "blocked": 0,\n' +
1823
+ ' "error": 0\n' +
1824
+ ' },\n' +
1825
+ ' "errors": [\n' +
1826
+ ' {\n' +
1827
+ ' "proof_index": 0,\n' +
1828
+ ' "error": {\n' +
1829
+ ' "code": "invalid_signature",\n' +
1830
+ ' "message": "Invalid JWS signature"\n' +
1831
+ ' }\n' +
1832
+ ' }\n' +
1833
+ ' ]\n' +
1834
+ '}'
1835
+ }
1836
+ [AccessControl] Raw response received: {
1837
+ "success": true,
1838
+ "accepted": 0,
1839
+ "rejected": 1,
1840
+ "outcomes": {
1841
+ "success": 0,
1842
+ "failed": 1,
1843
+ "blocked": 0,
1844
+ "error": 0
1845
+ },
1846
+ "errors": [
1847
+ {
1848
+ "proof_index": 0,
1849
+ "error": {
1850
+ "code": "invalid_signature",
1851
+ "message": "Invalid JWS signature"
1852
+ }
1853
+ }
1854
+ ]
1558
1855
  }
1559
1856
 
1560
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should use agent DID from identity for protection check
1857
+ stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Verification Flow > should verify proof using ProofVerifier
1858
+ [CryptoService] Key ID mismatch
1859
+
1860
+ ✓ src/__tests__/cache/tool-protection-cache.test.ts (49 tests) 210ms
1861
+ ✓ src/__tests__/runtime/base.test.ts (55 tests) 35ms
1862
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when no protection required
1863
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when protection required and no delegation
1864
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1865
+ tool: 'protectedTool',
1866
+ requiredScopes: [ 'files:write' ],
1561
1867
  [MCP-I] Checking tool protection: {
1562
- tool: 'testTool',
1868
+ tool: 'unprotectedTool',
1869
+ agentDid: 'did:key:zmock123...',
1870
+ resumeToken: 'resume_gxa3v_mig63sgc',
1563
1871
  agentDid: 'did:key:zmock123...',
1564
1872
  hasDelegation: false
1565
1873
  }
1566
1874
 
1567
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should use agent DID from identity for protection check
1875
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when no protection required
1876
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gxa3v_mig63sgc'
1877
+ }
1878
+
1879
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1568
1880
  [MCP-I] Tool protection check passed (no delegation required) {
1569
- tool: 'testTool',
1881
+ tool: 'unprotectedTool',
1882
+ [MCP-I] ❌ Delegation verification FAILED {
1570
1883
  agentDid: 'did:key:zmock123...',
1571
1884
  reason: 'Tool not configured to require delegation'
1572
1885
  }
1573
1886
 
1574
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should handle tool protection service errors gracefully
1887
+ tool: 'protectedTool',
1888
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when protection required and no delegation
1575
1889
  [MCP-I] Checking tool protection: {
1576
- tool: 'testTool',
1890
+ agentDid: 'did:key:zmock123...',
1891
+ tool: 'protectedTool',
1577
1892
  agentDid: 'did:key:zmock123...',
1578
1893
  hasDelegation: false
1894
+ reason: 'Delegation token expired',
1579
1895
  }
1580
1896
 
1581
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
1582
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
1583
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1584
- tool: 'protectedTool',
1897
+ errorCode: undefined,
1898
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
1899
+ errorMessage: undefined,
1585
1900
  [MCP-I] Checking tool protection: {
1586
- requiredScopes: [],
1587
1901
  tool: 'protectedTool',
1588
1902
  agentDid: 'did:key:zmock123...',
1903
+ hasDelegation: true
1904
+ requiredScopes: [ 'files:write' ]
1905
+ }
1906
+ }
1907
+
1908
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
1909
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1910
+ tool: 'protectedTool',
1589
1911
  agentDid: 'did:key:zmock123...',
1590
- hasDelegation: false
1912
+ hasDelegationToken: true,
1913
+
1914
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
1915
+ hasConsentProof: false,
1916
+ [MCP-I] ❌ Delegation verification FAILED {
1917
+ requiredScopes: [ 'files:write' ]
1591
1918
  }
1592
1919
 
1593
- resumeToken: 'resume_vyl781_miev24ep',
1594
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=&session_id=session123&agent_did=&resume_token=resume_vyl781_miev24ep'
1920
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
1921
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1922
+ tool: 'protectedTool',
1923
+ tool: 'protectedTool',
1924
+ agentDid: 'did:key:zmock123...',
1925
+ agentDid: 'did:key:zmock123...',
1926
+ reason: 'Insufficient scopes',
1927
+ delegationId: 'test-delegation-id',
1928
+ credentialScopes: [ 'files:write' ],
1929
+ errorCode: undefined,
1930
+ requiredScopes: [ 'files:write' ]
1595
1931
  }
1932
+ errorMessage: undefined,
1933
+ requiredScopes: [ 'files:write' ]
1596
1934
 
1597
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
1935
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
1598
1936
  [MCP-I] Checking tool protection: {
1599
1937
  tool: 'protectedTool',
1600
1938
  agentDid: 'did:key:zmock123...',
1601
- hasDelegation: false
1602
1939
  }
1603
1940
 
1604
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
1605
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1941
+ hasDelegation: true
1942
+ }
1943
+
1944
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
1945
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1606
1946
  tool: 'protectedTool',
1607
- requiredScopes: [ 'scope1', 'scope2', 'scope3' ],
1608
1947
  agentDid: 'did:key:zmock123...',
1609
- resumeToken: 'resume_vyl78w_miev24ep',
1610
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=scope1%2Cscope2%2Cscope3&session_id=session123&agent_did=&resume_token=resume_vyl78w_miev24ep'
1948
+ hasDelegationToken: false,
1949
+ hasConsentProof: true,
1950
+ requiredScopes: [ 'files:write' ]
1611
1951
  }
1612
1952
 
1613
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
1953
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
1954
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1955
+ tool: 'protectedTool',
1956
+ agentDid: 'did:key:zmock123...',
1957
+ delegationId: 'test-delegation-id',
1958
+ credentialScopes: [ 'files:write' ],
1959
+ requiredScopes: [ 'files:write' ]
1960
+ }
1961
+
1962
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1614
1963
  [MCP-I] Checking tool protection: {
1615
1964
  tool: 'protectedTool',
1616
1965
  agentDid: 'did:key:zmock123...',
1617
- hasDelegation: false
1966
+ hasDelegation: true
1618
1967
  }
1619
1968
 
1620
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
1621
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1969
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1970
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1622
1971
  tool: 'protectedTool',
1623
- requiredScopes: [ 'files:write' ],
1624
1972
  agentDid: 'did:key:zmock123...',
1625
- resumeToken: 'resume_q0gubi_miev24ep',
1626
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=&agent_did=&resume_token=resume_q0gubi_miev24ep'
1973
+ hasDelegationToken: true,
1974
+ hasConsentProof: false,
1975
+ requiredScopes: [ 'files:write' ]
1627
1976
  }
1628
1977
 
1629
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
1978
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
1630
1979
  [MCP-I] Checking tool protection: {
1631
- tool: 'errorTool',
1980
+ tool: 'protectedTool',
1632
1981
  agentDid: 'did:key:zmock123...',
1633
- hasDelegation: false
1982
+ hasDelegation: true
1634
1983
  }
1635
1984
 
1636
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
1637
- [MCP-I] Tool protection check passed (no delegation required) {
1638
- tool: 'errorTool',
1985
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
1986
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1987
+ tool: 'protectedTool',
1639
1988
  agentDid: 'did:key:zmock123...',
1640
- reason: 'Tool not configured to require delegation'
1989
+ hasDelegationToken: true,
1990
+ hasConsentProof: false,
1991
+ requiredScopes: [ 'files:write' ]
1641
1992
  }
1642
1993
 
1643
- ✓ src/__tests__/runtime/tool-protection-enforcement.test.ts (29 tests) 28ms
1644
- stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
1645
- [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
1646
- at Object.resolveDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
1647
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
1648
- at ProofVerifier.fetchPublicKeyFromDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
1649
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:252:7
1650
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
1651
-
1652
- stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
1653
- [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
1654
- at Object.resolveDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
1655
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
1656
- at ProofVerifier.fetchPublicKeyFromDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
1657
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:257:9
1658
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
1659
-
1660
- ✓ src/services/__tests__/proof-verifier.integration.test.ts (13 tests | 1 skipped) 83ms
1661
- ✓ src/__tests__/cache/tool-protection-cache.test.ts (49 tests) 157ms
1662
- ✓ src/services/__tests__/access-control.integration.test.ts (9 tests) 125ms
1663
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from camelCase field
1664
- [ToolProtectionService] Config loaded from API {
1665
- source: 'api',
1666
- toolCount: 2,
1667
- protectedTools: [ 'read_repos', 'send_email' ],
1668
- agentDid: 'did:key:z6MkhaXgBZDv...',
1669
- projectId: 'test-project-123',
1670
- cacheTtlMs: 300000,
1671
- cacheExpiresAt: '2025-11-25T17:44:45.849Z'
1994
+ ✓ src/services/__tests__/proof-verifier.test.ts (21 tests) 31ms
1995
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1996
+ [MCP-I] Checking tool protection: {
1997
+ tool: 'protectedTool',
1998
+ agentDid: 'did:key:zmock123...',
1999
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
2000
+ hasDelegation: true
1672
2001
  }
1673
2002
 
1674
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from snake_case field
1675
- [ToolProtectionService] Config loaded from API {
1676
- source: 'api',
1677
- toolCount: 1,
1678
- protectedTools: [ 'read_repos' ],
1679
- agentDid: 'did:key:z6MkhaXgBZDv...',
1680
- projectId: 'test-project-123',
1681
- cacheTtlMs: 300000,
1682
- cacheExpiresAt: '2025-11-25T17:44:45.852Z'
2003
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
2004
+ [MCP-I] Delegation verification error (API failure) {
2005
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2006
+ tool: 'protectedTool',
2007
+ tool: 'protectedTool',
2008
+ agentDid: 'did:key:zmock123...',
2009
+ agentDid: 'did:key:zmock123...',
2010
+ hasDelegationToken: true,
2011
+ hasConsentProof: false,
2012
+ errorCode: 'network_error',
2013
+ requiredScopes: [ 'files:write' ]
1683
2014
  }
2015
+ errorMessage: 'API unavailable',
1684
2016
 
1685
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should prefer camelCase over snake_case when both present
1686
- [ToolProtectionService] Config loaded from API {
1687
- source: 'api',
1688
- toolCount: 1,
1689
- protectedTools: [ 'read_repos' ],
1690
- agentDid: 'did:key:z6MkhaXgBZDv...',
1691
- projectId: 'test-project-123',
1692
- cacheTtlMs: 300000,
1693
- cacheExpiresAt: '2025-11-25T17:44:45.852Z'
2017
+ errorDetails: {}
2018
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
2019
+ [MCP-I] Checking tool protection: {
2020
+ tool: 'protectedTool',
2021
+ agentDid: 'did:key:zmock123...',
2022
+ hasDelegation: true
1694
2023
  }
1695
2024
 
1696
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should handle missing oauthProvider field (backward compatible)
1697
- [ToolProtectionService] Config loaded from API {
1698
- source: 'api',
1699
- toolCount: 1,
1700
- protectedTools: [ 'read_repos' ],
1701
- agentDid: 'did:key:z6MkhaXgBZDv...',
1702
- projectId: 'test-project-123',
1703
- cacheTtlMs: 300000,
1704
- cacheExpiresAt: '2025-11-25T17:44:45.853Z'
1705
2025
  }
1706
2026
 
1707
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should parse oauthProvider from array format with camelCase
1708
- [ToolProtectionService] Config loaded from API {
1709
- source: 'api',
1710
- toolCount: 2,
1711
- protectedTools: [ 'read_repos', 'send_email' ],
1712
- agentDid: 'did:key:z6MkhaXgBZDv...',
1713
- projectId: 'none',
1714
- cacheTtlMs: 300000,
1715
- cacheExpiresAt: '2025-11-25T17:44:45.853Z'
2027
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
2028
+ [MCP-I] ⚠️ Delegation token provided but AccessControlApiService not configured - skipping verification {
2029
+ tool: 'protectedTool',
2030
+ agentDid: 'did:key:zmock123...',
2031
+ hasDelegationToken: true,
2032
+ hasConsentProof: false
1716
2033
  }
1717
2034
 
1718
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should parse oauthProvider from array format with snake_case
1719
- [ToolProtectionService] Config loaded from API {
1720
- source: 'api',
1721
- toolCount: 1,
1722
- protectedTools: [ 'read_repos' ],
1723
- agentDid: 'did:key:z6MkhaXgBZDv...',
1724
- projectId: 'none',
1725
- cacheTtlMs: 300000,
1726
- cacheExpiresAt: '2025-11-25T17:44:45.854Z'
2035
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
2036
+ [MCP-I] Checking tool protection: {
2037
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
2038
+ tool: 'protectedTool',
2039
+ agentDid: 'did:key:zmock123...',
2040
+ [MCP-I] 🔒 SECURITY: User identifier validation FAILED {
2041
+ hasDelegation: true
1727
2042
  }
2043
+ tool: 'protectedTool',
1728
2044
 
1729
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should prefer camelCase over snake_case in array format
1730
- [ToolProtectionService] Config loaded from API {
1731
- source: 'api',
1732
- toolCount: 1,
1733
- protectedTools: [ 'read_repos' ],
1734
- agentDid: 'did:key:z6MkhaXgBZDv...',
1735
- projectId: 'none',
1736
- cacheTtlMs: 300000,
1737
- cacheExpiresAt: '2025-11-25T17:44:45.854Z'
2045
+ agentDid: 'did:key:zmock123...',
2046
+ delegationUserIdentifier: 'did:key:zUserB987654...',
2047
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
2048
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2049
+ tool: 'protectedTool',
2050
+ sessionUserDid: 'did:key:zUserA123456...',
2051
+ sessionId: 'session123...',
2052
+ reason: 'user_identifier_mismatch',
2053
+ severity: 'high'
2054
+ agentDid: 'did:key:zmock123...',
1738
2055
  }
2056
+ hasDelegationToken: true,
1739
2057
 
1740
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should parse oauthProvider from object format with camelCase
1741
- [ToolProtectionService] Config loaded from API {
1742
- source: 'api',
1743
- toolCount: 2,
1744
- protectedTools: [ 'read_repos', 'send_email' ],
1745
- agentDid: 'did:key:z6MkhaXgBZDv...',
1746
- projectId: 'none',
1747
- cacheTtlMs: 300000,
1748
- cacheExpiresAt: '2025-11-25T17:44:45.854Z'
2058
+ hasConsentProof: false,
2059
+ requiredScopes: [ 'files:write' ]
1749
2060
  }
1750
2061
 
1751
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should parse oauthProvider from object format with snake_case
1752
- [ToolProtectionService] Config loaded from API {
1753
- source: 'api',
1754
- toolCount: 1,
1755
- protectedTools: [ 'read_repos' ],
1756
- agentDid: 'did:key:z6MkhaXgBZDv...',
1757
- projectId: 'none',
1758
- cacheTtlMs: 300000,
1759
- cacheExpiresAt: '2025-11-25T17:44:45.854Z'
2062
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should accept delegation when user_identifier matches session userDid
2063
+ [MCP-I] Checking tool protection: {
2064
+ tool: 'protectedTool',
2065
+ agentDid: 'did:key:zmock123...',
2066
+ hasDelegation: true
1760
2067
  }
1761
2068
 
1762
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should prefer camelCase over snake_case in object format
1763
- [ToolProtectionService] Config loaded from API {
1764
- source: 'api',
1765
- toolCount: 1,
1766
- protectedTools: [ 'read_repos' ],
1767
- agentDid: 'did:key:z6MkhaXgBZDv...',
1768
- projectId: 'none',
1769
- cacheTtlMs: 300000,
1770
- cacheExpiresAt: '2025-11-25T17:44:45.855Z'
2069
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should accept delegation when user_identifier matches session userDid
2070
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2071
+ tool: 'protectedTool',
2072
+ agentDid: 'did:key:zmock123...',
2073
+ hasDelegationToken: true,
2074
+ hasConsentProof: false,
2075
+ requiredScopes: [ 'files:write' ]
1771
2076
  }
1772
2077
 
1773
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Caching > should cache oauthProvider field correctly
1774
- [ToolProtectionService] Config loaded from API {
1775
- source: 'api',
1776
- toolCount: 1,
1777
- protectedTools: [ 'read_repos' ],
1778
- agentDid: 'did:key:z6MkhaXgBZDv...',
1779
- projectId: 'test-project-123',
1780
- cacheTtlMs: 300000,
1781
- cacheExpiresAt: '2025-11-25T17:44:45.855Z'
2078
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should accept delegation when user_identifier matches session userDid
2079
+ [MCP-I] User identifier validation PASSED {
2080
+ tool: 'protectedTool',
2081
+ agentDid: 'did:key:zmock123...',
2082
+ userDid: 'did:key:zUserA123456...',
2083
+ sessionId: 'session123...'
1782
2084
  }
1783
-
1784
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should include oauthProvider in returned ToolProtection objects when present
1785
- [ToolProtectionService] Config loaded from API {
1786
- source: 'api',
1787
- toolCount: 2,
1788
- protectedTools: [ 'tool_with_provider', 'tool_without_provider' ],
1789
- agentDid: 'did:key:z6MkhaXgBZDv...',
1790
- projectId: 'test-project-123',
1791
- cacheTtlMs: 300000,
1792
- cacheExpiresAt: '2025-11-25T17:44:45.856Z'
2085
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
2086
+ tool: 'protectedTool',
2087
+ agentDid: 'did:key:zmock123...',
2088
+ delegationId: 'test-delegation-id',
2089
+ credentialScopes: [ 'files:write' ],
2090
+ requiredScopes: [ 'files:write' ]
1793
2091
  }
1794
2092
 
1795
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should handle empty string oauthProvider gracefully
1796
- [ToolProtectionService] Config loaded from API {
1797
- source: 'api',
1798
- toolCount: 1,
1799
- protectedTools: [ 'tool_with_empty_provider' ],
1800
- agentDid: 'did:key:z6MkhaXgBZDv...',
1801
- projectId: 'test-project-123',
1802
- cacheTtlMs: 300000,
1803
- cacheExpiresAt: '2025-11-25T17:44:45.856Z'
2093
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing user_identifier gracefully (backward compatibility)
2094
+ [MCP-I] Checking tool protection: {
2095
+ tool: 'protectedTool',
2096
+ agentDid: 'did:key:zmock123...',
2097
+ hasDelegation: true
1804
2098
  }
1805
2099
 
1806
- stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.get errors gracefully
1807
- [UserDidManager] Storage.get failed, generating new DID: Error: Storage error
1808
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:187:67
1809
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1810
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1811
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1812
- at new Promise (<anonymous>)
1813
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1814
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1815
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
1816
- at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
1817
- at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
1818
-
1819
- stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.set errors gracefully
1820
- [UserDidManager] Storage.set failed, continuing with cached DID: Error: Storage error
1821
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:196:67
1822
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1823
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1824
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1825
- at new Promise (<anonymous>)
1826
- at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1827
- at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1828
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
1829
- at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
1830
- at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2100
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing user_identifier gracefully (backward compatibility)
2101
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2102
+ tool: 'protectedTool',
2103
+ agentDid: 'did:key:zmock123...',
2104
+ hasDelegationToken: true,
2105
+ hasConsentProof: false,
2106
+ requiredScopes: [ 'files:write' ]
2107
+ }
1831
2108
 
1832
- stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.delete errors gracefully
1833
- [UserDidManager] Storage.delete failed, continuing: Error: Storage error
1834
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:206:70
1835
- at processTicksAndRejections (node:internal/process/task_queues:105:5)
1836
- at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
2109
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing user_identifier gracefully (backward compatibility)
2110
+ [MCP-I] Delegation verification SUCCEEDED {
2111
+ tool: 'protectedTool',
2112
+ agentDid: 'did:key:zmock123...',
2113
+ delegationId: 'test-delegation-id',
2114
+ credentialScopes: [ 'files:write' ],
2115
+ requiredScopes: [ 'files:write' ]
2116
+ }
1837
2117
 
1838
- src/__tests__/identity/user-did-manager.test.ts (17 tests) 9ms
1839
- src/__tests__/services/tool-protection-oauth-provider.test.ts (14 tests) 8ms
1840
- stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Phase 1 tools (no oauthProvider) > should work with Phase 1 tools that don't specify oauthProvider
1841
- [ToolProtectionService] Config loaded from API {
1842
- source: 'api',
1843
- toolCount: 1,
1844
- protectedTools: [ 'phase1_tool' ],
1845
- agentDid: 'did:key:z6MkhaXgBZDv...',
1846
- projectId: 'none',
1847
- cacheTtlMs: 300000,
1848
- cacheExpiresAt: '2025-11-25T17:44:45.862Z'
2118
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
2119
+ [MCP-I] Checking tool protection: {
2120
+ tool: 'protectedTool',
2121
+ agentDid: 'did:key:zmock123...',
2122
+ hasDelegation: true
1849
2123
  }
1850
2124
 
1851
- stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Old API endpoint format > should still support old endpoint format (tools array)
1852
- [ToolProtectionService] Config loaded from API {
1853
- stderr | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > No Regressions > Phase 1 OAuth flow > should still work with Phase 1 OAuth flow (no oauthProvider)
1854
- source: 'api',
1855
- toolCount: 1,
1856
- protectedTools: [ 'old_tool' ],
1857
- [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
1858
- agentDid: 'did:key:z6MkhaXgBZDv...',
2125
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
2126
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2127
+ tool: 'protectedTool',
2128
+ agentDid: 'did:key:zmock123...',
2129
+ hasDelegationToken: true,
2130
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
2131
+ hasConsentProof: false,
2132
+ requiredScopes: [ 'files:write' ]
2133
+ }
2134
+ [MCP-I] ⚠️ Delegation has user_identifier but session missing userDid {
1859
2135
 
1860
- projectId: 'none',
1861
- cacheTtlMs: 300000,
1862
- cacheExpiresAt: '2025-11-25T17:44:45.867Z'
2136
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
2137
+ tool: 'protectedTool',
2138
+ agentDid: 'did:key:zmock123...',
2139
+ delegationUserIdentifier: 'did:key:zUserA123456...',
2140
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
2141
+ tool: 'protectedTool',
2142
+ agentDid: 'did:key:zmock123...',
2143
+ delegationId: 'test-delegation-id',
2144
+ credentialScopes: [ 'files:write' ],
2145
+ sessionId: 'session123...'
2146
+ requiredScopes: [ 'files:write' ]
1863
2147
  }
1864
2148
 
1865
- stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Old API endpoint format > should still support old endpoint format (tools object)
1866
- [ToolProtectionService] Config loaded from API {
1867
- source: 'api',
1868
- toolCount: 1,
1869
- protectedTools: [ 'old_tool' ],
1870
- agentDid: 'did:key:z6MkhaXgBZDv...',
1871
- projectId: 'none',
1872
- cacheTtlMs: 300000,
1873
- cacheExpiresAt: '2025-11-25T17:44:45.867Z'
2149
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
2150
+ [MCP-I] Checking tool protection: {
1874
2151
  }
1875
2152
 
1876
- stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > snake_case field names > should still support snake_case field names
1877
- [ToolProtectionService] Config loaded from API {
1878
- source: 'api',
1879
- toolCount: 1,
1880
- protectedTools: [ 'tool_with_snake_case' ],
1881
- agentDid: 'did:key:z6MkhaXgBZDv...',
1882
- projectId: 'test-project-123',
1883
- cacheTtlMs: 300000,
1884
- cacheExpiresAt: '2025-11-25T17:44:45.867Z'
2153
+ tool: 'unprotectedTool',
2154
+ agentDid: 'did:key:zmock123...',
2155
+ hasDelegation: false
1885
2156
  }
1886
2157
 
1887
- stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Mixed Phase 1 and Phase 2 tools > should handle mix of Phase 1 and Phase 2 tools in same project
1888
- [ToolProtectionService] Config loaded from API {
1889
- source: 'api',
1890
- toolCount: 2,
1891
- protectedTools: [ 'phase1_tool', 'phase2_tool' ],
1892
- agentDid: 'did:key:z6MkhaXgBZDv...',
1893
- projectId: 'test-project-123',
1894
- cacheTtlMs: 300000,
1895
- cacheExpiresAt: '2025-11-25T17:44:45.869Z'
2158
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
2159
+ [MCP-I] Tool protection check passed (no delegation required) {
2160
+ tool: 'unprotectedTool',
2161
+ agentDid: 'did:key:zmock123...',
2162
+ reason: 'Tool not configured to require delegation'
2163
+ }
2164
+
2165
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
2166
+ [MCP-I] Checking tool protection: {
2167
+ tool: 'protectedTool',
2168
+ agentDid: 'did:key:zmock123...',
2169
+ hasDelegation: false
2170
+ }
2171
+
2172
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
2173
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
2174
+ [MCP-I] Checking tool protection: {
2175
+ tool: 'protectedTool',
2176
+ agentDid: 'did:key:zmock123...',
2177
+ hasDelegation: false
2178
+ }
2179
+
2180
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2181
+ tool: 'protectedTool',
2182
+ requiredScopes: [ 'files:write' ],
2183
+ agentDid: 'did:key:zmock123...',
2184
+ resumeToken: 'resume_gx8nc_mig63sgv',
2185
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gx8nc_mig63sgv'
2186
+ }
2187
+
2188
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
2189
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2190
+ tool: 'protectedTool',
2191
+ requiredScopes: [ 'files:write' ],
2192
+ agentDid: 'did:key:zmock123...',
2193
+ resumeToken: 'resume_gx8nc_mig63sgv',
2194
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gx8nc_mig63sgv'
2195
+ }
2196
+
2197
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
2198
+ [MCP-I] Checking tool protection: {
2199
+ tool: 'protectedTool',
2200
+ agentDid: 'did:key:zmock123...',
2201
+ hasDelegation: false
2202
+ }
2203
+
2204
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
2205
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2206
+ tool: 'protectedTool',
2207
+ requiredScopes: [ 'files:write', 'files:read' ],
2208
+ agentDid: 'did:key:zmock123...',
2209
+ resumeToken: 'resume_gx8nc_mig63sgw',
2210
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite%2Cfiles%3Aread&session_id=session123&agent_did=&resume_token=resume_gx8nc_mig63sgw'
2211
+ }
2212
+
2213
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
2214
+ [MCP-I] Checking tool protection: {
2215
+ tool: 'protectedTool',
2216
+ agentDid: 'did:key:zmock123...',
2217
+ hasDelegation: false
2218
+ }
2219
+
2220
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
2221
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2222
+ tool: 'protectedTool',
2223
+ requiredScopes: [ 'files:write' ],
2224
+ agentDid: 'did:key:zmock123...',
2225
+ resumeToken: 'resume_gx8mh_mig63sgw',
2226
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gx8mh_mig63sgw'
2227
+ }
2228
+
2229
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
2230
+ [MCP-I] Checking tool protection: {
2231
+ tool: 'protectedTool',
2232
+ agentDid: 'did:key:zmock123...',
2233
+ hasDelegation: false
2234
+ }
2235
+
2236
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
2237
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2238
+ tool: 'protectedTool',
2239
+ requiredScopes: [ 'files:write' ],
2240
+ agentDid: 'did:key:zmock123...',
2241
+ resumeToken: 'resume_gx8mh_mig63sgw',
2242
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gx8mh_mig63sgw'
2243
+ }
2244
+
2245
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
2246
+ [MCP-I] Checking tool protection: {
2247
+ tool: 'protectedTool',
2248
+ agentDid: 'did:key:zmock123...',
2249
+ hasDelegation: false
2250
+ }
2251
+
2252
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
2253
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2254
+ tool: 'protectedTool',
2255
+ requiredScopes: [ 'files:write' ],
2256
+ agentDid: 'did:key:zmock123...',
2257
+ resumeToken: 'resume_fpsylu_mig63sgw',
2258
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_fpsylu_mig63sgw'
2259
+ }
2260
+
2261
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
2262
+ [MCP-I] Checking tool protection: {
2263
+ tool: 'testTool',
2264
+ agentDid: 'did:key:zmock123...',
2265
+ hasDelegation: false
2266
+ }
2267
+
2268
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
2269
+ [MCP-I] Tool protection check passed (no delegation required) {
2270
+ tool: 'testTool',
2271
+ agentDid: 'did:key:zmock123...',
2272
+ reason: 'Tool not configured to require delegation'
2273
+ }
2274
+
2275
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log blocked tool call when audit enabled
2276
+ [MCP-I] Checking tool protection: {
2277
+ tool: 'protectedTool',
2278
+ agentDid: 'did:key:zmock123...',
2279
+ hasDelegation: false
2280
+ }
2281
+
2282
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should use agent DID from identity for protection check
2283
+ [MCP-I] Checking tool protection: {
2284
+ tool: 'testTool',
2285
+ agentDid: 'did:key:zmock123...',
2286
+ hasDelegation: false
2287
+ }
2288
+
2289
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should use agent DID from identity for protection check
2290
+ [MCP-I] Tool protection check passed (no delegation required) {
2291
+ tool: 'testTool',
2292
+ agentDid: 'did:key:zmock123...',
2293
+ reason: 'Tool not configured to require delegation'
2294
+ }
2295
+
2296
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should handle tool protection service errors gracefully
2297
+ [MCP-I] Checking tool protection: {
2298
+ tool: 'testTool',
2299
+ agentDid: 'did:key:zmock123...',
2300
+ hasDelegation: false
2301
+ }
2302
+
2303
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
2304
+ [MCP-I] Checking tool protection: {
2305
+ tool: 'protectedTool',
2306
+ agentDid: 'did:key:zmock123...',
2307
+ hasDelegation: false
2308
+ }
2309
+
2310
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
2311
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2312
+ tool: 'protectedTool',
2313
+ requiredScopes: [],
2314
+ agentDid: 'did:key:zmock123...',
2315
+ resumeToken: 'resume_gx7z8_mig63sh2',
2316
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=&session_id=session123&agent_did=&resume_token=resume_gx7z8_mig63sh2'
2317
+ }
2318
+
2319
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
2320
+ [MCP-I] Checking tool protection: {
2321
+ tool: 'protectedTool',
2322
+ agentDid: 'did:key:zmock123...',
2323
+ hasDelegation: false
2324
+ }
2325
+
2326
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
2327
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2328
+ tool: 'protectedTool',
2329
+ requiredScopes: [ 'scope1', 'scope2', 'scope3' ],
2330
+ agentDid: 'did:key:zmock123...',
2331
+ resumeToken: 'resume_gx7yd_mig63sh3',
2332
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=scope1%2Cscope2%2Cscope3&session_id=session123&agent_did=&resume_token=resume_gx7yd_mig63sh3'
2333
+ }
2334
+
2335
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
2336
+ [MCP-I] Checking tool protection: {
2337
+ tool: 'protectedTool',
2338
+ agentDid: 'did:key:zmock123...',
2339
+ hasDelegation: false
2340
+ }
2341
+
2342
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
2343
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2344
+ tool: 'protectedTool',
2345
+ requiredScopes: [ 'files:write' ],
2346
+ agentDid: 'did:key:zmock123...',
2347
+ resumeToken: 'resume_cl4sgd_mig63sh3',
2348
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=&agent_did=&resume_token=resume_cl4sgd_mig63sh3'
2349
+ }
2350
+
2351
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
2352
+ [MCP-I] Checking tool protection: {
2353
+ tool: 'errorTool',
2354
+ agentDid: 'did:key:zmock123...',
2355
+ hasDelegation: false
2356
+ }
2357
+
2358
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
2359
+ [MCP-I] Tool protection check passed (no delegation required) {
2360
+ tool: 'errorTool',
2361
+ agentDid: 'did:key:zmock123...',
2362
+ reason: 'Tool not configured to require delegation'
1896
2363
  }
1897
2364
 
1898
- ✓ src/__tests__/regression/phase2-regression.test.ts (12 tests) 8ms
2365
+ ✓ src/__tests__/runtime/tool-protection-enforcement.test.ts (29 tests) 63ms
2366
+ stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
2367
+ [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
2368
+ at Object.resolveDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
2369
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
2370
+ at ProofVerifier.fetchPublicKeyFromDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
2371
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:252:7
2372
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
2373
+
2374
+ stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
2375
+ [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
2376
+ at Object.resolveDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
2377
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
2378
+ at ProofVerifier.fetchPublicKeyFromDID (/Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
2379
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:257:9
2380
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
2381
+
2382
+ ✓ src/__tests__/runtime/route-interception.test.ts (21 tests) 46ms
2383
+ ✓ src/services/__tests__/proof-verifier.integration.test.ts (13 tests | 1 skipped) 154ms
2384
+ ✓ src/services/__tests__/access-control.integration.test.ts (9 tests) 134ms
2385
+ ✓ src/delegation/__tests__/vc-verifier.test.ts (35 tests) 317ms
2386
+ ✓ src/delegation/__tests__/vc-issuer.test.ts (21 tests) 324ms
1899
2387
  stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should allow unprotected tool calls
1900
2388
  [ToolProtectionService] Config loaded from API {
1901
2389
  source: 'api',
1902
2390
  toolCount: 1,
1903
2391
  protectedTools: [],
1904
2392
  agentDid: 'did:key:z6MkhaXgBZDv...',
2393
+ stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should use fallback config when API fails
1905
2394
  projectId: 'test-project',
1906
2395
  cacheTtlMs: 300000,
1907
- cacheExpiresAt: '2025-11-25T17:44:45.884Z'
2396
+ cacheExpiresAt: '2025-11-26T15:41:45.684Z'
2397
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
1908
2398
  }
1909
2399
 
1910
2400
  stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
@@ -1912,15 +2402,21 @@ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > T
1912
2402
  source: 'api',
1913
2403
  toolCount: 1,
1914
2404
  protectedTools: [ 'checkout' ],
2405
+
1915
2406
  agentDid: 'did:key:z6MkhaXgBZDv...',
2407
+ stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle tool protection service errors gracefully
1916
2408
  projectId: 'test-project',
1917
2409
  cacheTtlMs: 300000,
1918
- cacheExpiresAt: '2025-11-25T17:44:45.884Z'
2410
+ cacheExpiresAt: '2025-11-26T15:41:45.685Z'
1919
2411
  }
2412
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
1920
2413
 
1921
2414
  stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
2415
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2416
+ error: 'Network error',
1922
2417
  [ToolProtectionService] Protection check {
1923
2418
  tool: 'checkout',
2419
+ cacheKey: 'config:tool-protections:test-project'
1924
2420
  agentDid: 'did:key:z6MkhaXgBZDv...',
1925
2421
  found: true,
1926
2422
  isWildcard: false,
@@ -1928,49 +2424,21 @@ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > T
1928
2424
  availableTools: [ 'checkout' ]
1929
2425
  }
1930
2426
 
1931
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle empty scopes array
1932
- [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
1933
-
1934
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle ambiguous scopes (multiple providers inferred)
1935
- [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
1936
-
1937
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle unknown scope prefixes
1938
- [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
1939
-
1940
- stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify gmail → google mapping works
1941
- [ProviderResolver] Inferred provider "google" from scopes
1942
-
1943
- stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify calendar → google mapping works
1944
- [ProviderResolver] Inferred provider "google" from scopes
1945
-
1946
- stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify outlook → microsoft mapping works
1947
- [ProviderResolver] Inferred provider "microsoft" from scopes
1948
-
1949
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle scopes without colons
1950
- [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
1951
-
1952
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle inferred provider not in registry
1953
- [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "google" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
1954
-
1955
2427
  stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should fetch tool protection config from AgentShield
2428
+ }
1956
2429
  [ToolProtectionService] Config loaded from API {
1957
2430
  source: 'api',
2431
+
2432
+ stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle network timeouts
2433
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
1958
2434
  toolCount: 1,
1959
2435
  protectedTools: [ 'protected_tool' ],
1960
2436
  agentDid: 'did:key:z6MkhaXgBZDv...',
1961
2437
  projectId: 'test-project',
1962
2438
  cacheTtlMs: 300000,
1963
- cacheExpiresAt: '2025-11-25T17:44:45.885Z'
1964
- }
1965
-
1966
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Fallback behavior (Priority 3) > should use first configured provider when oauthProvider not specified
1967
- [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
1968
2439
 
1969
- stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Provider name case sensitivity > should handle provider names case-insensitively in inference
1970
- [ProviderResolver] Inferred provider "github" from scopes
1971
-
1972
- stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Multiple scopes with same provider > should handle multiple scopes from same provider
1973
- [ProviderResolver] Inferred provider "github" from scopes
2440
+ cacheExpiresAt: '2025-11-26T15:41:45.686Z'
2441
+ }
1974
2442
 
1975
2443
  stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should cache tool protection config
1976
2444
  [ToolProtectionService] Config loaded from API {
@@ -1980,22 +2448,9 @@ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > A
1980
2448
  agentDid: 'did:key:z6MkhaXgBZDv...',
1981
2449
  projectId: 'test-project',
1982
2450
  cacheTtlMs: 300000,
1983
- cacheExpiresAt: '2025-11-25T17:44:45.886Z'
2451
+ cacheExpiresAt: '2025-11-26T15:41:45.687Z'
1984
2452
  }
1985
2453
 
1986
- stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should use fallback config when API fails
1987
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
1988
-
1989
- stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle tool protection service errors gracefully
1990
- [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
1991
- agentDid: 'did:key:z6MkhaXgBZDv...',
1992
- error: 'Network error',
1993
- cacheKey: 'config:tool-protections:test-project'
1994
- }
1995
-
1996
- stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle network timeouts
1997
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
1998
-
1999
2454
  stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should share cache across multiple service instances
2000
2455
  [ToolProtectionService] Config loaded from API {
2001
2456
  source: 'api',
@@ -2004,7 +2459,7 @@ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > C
2004
2459
  agentDid: 'did:key:z6MkhaXgBZDv...',
2005
2460
  projectId: 'test-project',
2006
2461
  cacheTtlMs: 300000,
2007
- cacheExpiresAt: '2025-11-25T17:44:45.888Z'
2462
+ cacheExpiresAt: '2025-11-26T15:41:45.689Z'
2008
2463
  }
2009
2464
 
2010
2465
  stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
@@ -2015,7 +2470,7 @@ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > C
2015
2470
  agentDid: 'did:key:z6MkhaXgBZDv...',
2016
2471
  projectId: 'test-project',
2017
2472
  cacheTtlMs: 300000,
2018
- cacheExpiresAt: '2025-11-25T17:44:45.889Z'
2473
+ cacheExpiresAt: '2025-11-26T15:41:45.689Z'
2019
2474
  }
2020
2475
 
2021
2476
  stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
@@ -2026,7 +2481,7 @@ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > C
2026
2481
  agentDid: 'did:key:z6MkhaXgBZDv...',
2027
2482
  projectId: 'test-project',
2028
2483
  cacheTtlMs: 300000,
2029
- cacheExpiresAt: '2025-11-25T17:44:45.889Z'
2484
+ cacheExpiresAt: '2025-11-26T15:41:45.689Z'
2030
2485
  }
2031
2486
 
2032
2487
  stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Real-world e-commerce scenario > should handle complete e-commerce flow with tool protection
@@ -2037,7 +2492,7 @@ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > R
2037
2492
  agentDid: 'did:key:z6MkhaXgBZDv...',
2038
2493
  projectId: 'test-project',
2039
2494
  cacheTtlMs: 300000,
2040
- cacheExpiresAt: '2025-11-25T17:44:45.889Z'
2495
+ cacheExpiresAt: '2025-11-26T15:41:45.689Z'
2041
2496
  }
2042
2497
 
2043
2498
  stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Real-world e-commerce scenario > should handle complete e-commerce flow with tool protection
@@ -2058,7 +2513,7 @@ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > C
2058
2513
  agentDid: 'did:key:z6MkhaXgBZDv...',
2059
2514
  projectId: 'test-project',
2060
2515
  cacheTtlMs: 300000,
2061
- cacheExpiresAt: '2025-11-25T17:44:45.890Z'
2516
+ cacheExpiresAt: '2025-11-26T15:41:45.690Z'
2062
2517
  }
2063
2518
  [ToolProtectionService] Config loaded from API {
2064
2519
  source: 'api',
@@ -2067,7 +2522,7 @@ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > C
2067
2522
  agentDid: 'did:key:z6MkhaXgBZDv...',
2068
2523
  projectId: 'test-project',
2069
2524
  cacheTtlMs: 300000,
2070
- cacheExpiresAt: '2025-11-25T17:44:45.890Z'
2525
+ cacheExpiresAt: '2025-11-26T15:41:45.690Z'
2071
2526
  }
2072
2527
  [ToolProtectionService] Config loaded from API {
2073
2528
  source: 'api',
@@ -2076,57 +2531,13 @@ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > C
2076
2531
  agentDid: 'did:key:z6MkhaXgBZDv...',
2077
2532
  projectId: 'test-project',
2078
2533
  cacheTtlMs: 300000,
2079
- cacheExpiresAt: '2025-11-25T17:44:45.890Z'
2534
+ cacheExpiresAt: '2025-11-26T15:41:45.690Z'
2080
2535
  }
2081
2536
 
2082
- ✓ src/__tests__/services/provider-resolver-edge-cases.test.ts (19 tests | 1 skipped) 7ms
2083
- src/__tests__/integration/full-flow.test.ts (21 tests) 11ms
2084
- ✓ src/delegation/__tests__/bitstring.test.ts (30 tests) 4ms
2085
- src/services/__tests__/batch-delegation.service.test.ts (11 tests) 7ms
2086
- ✓ src/__tests__/providers/memory.test.ts (34 tests) 12ms
2087
- ✓ src/delegation/__tests__/cascading-revocation.test.ts (23 tests) 10ms
2088
- ✓ src/delegation/__tests__/delegation-graph.test.ts (28 tests) 8ms
2089
- stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
2090
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zWBPHuUmENfsOTpU4_th94X32do-iRToC","environment":"development","userDidGeneration":"disabled"},"timestamp":1764092385955,"timestampFormatted":"2025-11-25T17:39:45.955Z"}
2091
-
2092
- stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
2093
- [AUDIT] {"event":"tool_executed","data":{"tool":"greetingTool","sessionId":"2a4e71b15dbcf9a5306effd2f6a4e298","timestamp":1764092385955},"timestamp":1764092385955,"timestampFormatted":"2025-11-25T17:39:45.955Z"}
2094
-
2095
- stdout | src/__tests__/integration.test.ts > Integration Tests > Session expiry handling > should handle expired sessions correctly
2096
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zz_XlklyRJjXBI98DrFR13m2w4Qcat8w5","environment":"development","userDidGeneration":"disabled"},"timestamp":1764092385967,"timestampFormatted":"2025-11-25T17:39:45.967Z"}
2097
-
2098
- stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
2099
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zJyPqsQPpGspJUIbe4G3AAerCRLvX0Ie-","environment":"development","userDidGeneration":"disabled"},"timestamp":1764092385967,"timestampFormatted":"2025-11-25T17:39:45.967Z"}
2100
-
2101
- stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
2102
- [AUDIT] {"event":"keys_rotated","data":{"oldDid":"did:key:zJyPqsQPpGspJUIbe4G3AAerCRLvX0Ie-","newDid":"did:key:zEbZh2-g0Lt8omynTZBTjMlq6I9FBqQkp","timestamp":1764092385967},"timestamp":1764092385967,"timestampFormatted":"2025-11-25T17:39:45.967Z"}
2103
-
2104
- stdout | src/__tests__/integration.test.ts > Integration Tests > Well-known endpoints > should provide identity discovery endpoints
2105
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zAdMHvCNSpoCB2IB6etOHot8WdGxWo1J-","environment":"development","userDidGeneration":"disabled"},"timestamp":1764092385967,"timestampFormatted":"2025-11-25T17:39:45.967Z"}
2106
-
2107
- stdout | src/__tests__/integration.test.ts > Integration Tests > Nonce replay protection > should prevent nonce reuse
2108
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zUtdiJWFv9uMJexUunPfayFyzWIJsLAGo","environment":"development","userDidGeneration":"disabled"},"timestamp":1764092385968,"timestampFormatted":"2025-11-25T17:39:45.968Z"}
2109
-
2110
- stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle network errors gracefully
2111
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z9F9CmF04tN0yLKatkFCAZt_r5C28k6Gn","environment":"development","userDidGeneration":"disabled"},"timestamp":1764092385968,"timestampFormatted":"2025-11-25T17:39:45.968Z"}
2112
-
2113
- stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle malformed DID documents
2114
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zPqVpSAG3MR3USTe8fNGux1DeJWTTlIBc","environment":"development","userDidGeneration":"disabled"},"timestamp":1764092385968,"timestampFormatted":"2025-11-25T17:39:45.968Z"}
2115
-
2116
- stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should provide debug information in development
2117
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zEeLbWdl34pLDU32yi74n7iDcqhy_o_ES","environment":"development","userDidGeneration":"disabled"},"timestamp":1764092385969,"timestampFormatted":"2025-11-25T17:39:45.969Z"}
2118
-
2119
- stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should be disabled in production
2120
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z6d9sazxXZN6KFvekxSb2_0MjhlgEXQ0Y","environment":"development","userDidGeneration":"disabled"},"timestamp":1764092385969,"timestampFormatted":"2025-11-25T17:39:45.969Z"}
2121
-
2122
- ✓ src/__tests__/runtime/proof-client-did.test.ts (17 tests) 23ms
2123
- ✓ src/__tests__/integration.test.ts (9 tests) 15ms
2124
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API request fails
2125
- [RemoteConfig] API returned 404: Not Found
2126
-
2127
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API throws error
2128
- [RemoteConfig] Failed to fetch config: Error: Network error
2129
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:170:35
2537
+ ✓ src/__tests__/integration/full-flow.test.ts (21 tests) 20ms
2538
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.get errors gracefully
2539
+ [UserDidManager] Storage.get failed, generating new DID: Error: Storage error
2540
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:187:67
2130
2541
  at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2131
2542
  at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2132
2543
  at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
@@ -2137,12 +2548,9 @@ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error
2137
2548
  at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2138
2549
  at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2139
2550
 
2140
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if neither projectId nor agentDid provided
2141
- [RemoteConfig] Neither projectId nor agentDid provided
2142
-
2143
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should handle cache read errors gracefully
2144
- [RemoteConfig] Cache read failed: Error: Cache error
2145
- at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:198:50
2551
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.set errors gracefully
2552
+ [UserDidManager] Storage.set failed, continuing with cached DID: Error: Storage error
2553
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:196:67
2146
2554
  at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2147
2555
  at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2148
2556
  at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
@@ -2153,759 +2561,420 @@ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error
2153
2561
  at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2154
2562
  at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2155
2563
 
2156
- src/config/__tests__/remote-config.spec.ts (9 tests) 9ms
2157
- ✓ src/compliance/__tests__/schema-verifier.test.ts (30 tests) 5ms
2158
- stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from github scope prefix
2159
- [ProviderResolver] Inferred provider "github" from scopes
2160
-
2161
- stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from gmail scope prefix (maps to google)
2162
- [ProviderResolver] Inferred provider "google" from scopes
2564
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.delete errors gracefully
2565
+ [UserDidManager] Storage.delete failed, continuing: Error: Storage error
2566
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:206:70
2567
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
2568
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
2163
2569
 
2164
- stderr | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should return null for ambiguous scopes
2165
- [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2570
+ src/__tests__/identity/user-did-manager.test.ts (17 tests) 8ms
2571
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from camelCase field
2572
+ [ToolProtectionService] Config loaded from API {
2573
+ source: 'api',
2574
+ toolCount: 2,
2575
+ protectedTools: [ 'read_repos', 'send_email' ],
2576
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2577
+ projectId: 'test-project-123',
2578
+ cacheTtlMs: 300000,
2579
+ cacheExpiresAt: '2025-11-26T15:41:45.789Z'
2580
+ }
2166
2581
 
2167
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with success field in data
2168
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2169
- correlationId: '0babed74-6504-4941-9a9e-249e91ac221b',
2170
- status: 200,
2171
- src/services/__tests__/provider-resolver.test.ts (8 tests) 9ms
2172
- statusText: undefined,
2173
- headers: {},
2174
- responseTextLength: 191,
2175
- responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T17:39:46.029Z"}}',
2176
- fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T17:39:46.029Z"}}'
2582
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from snake_case field
2583
+ [ToolProtectionService] Config loaded from API {
2584
+ source: 'api',
2585
+ toolCount: 1,
2586
+ protectedTools: [ 'read_repos' ],
2587
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2588
+ projectId: 'test-project-123',
2589
+ cacheTtlMs: 300000,
2590
+ cacheExpiresAt: '2025-11-26T15:41:45.791Z'
2177
2591
  }
2178
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2179
- correlationId: '0babed74-6504-4941-9a9e-249e91ac221b',
2180
- status: 200,
2181
- responseDataType: 'object',
2182
- responseDataKeys: [ 'success', 'data', 'metadata' ],
2183
- responseData: '{\n' +
2184
- ' "success": true,\n' +
2185
- ' "data": {\n' +
2186
- ' "accepted": 1,\n' +
2187
- ' "rejected": 0,\n' +
2188
- ' "outcomes": {\n' +
2189
- ' "success": 1,\n' +
2190
- ' "failed": 0,\n' +
2191
- ' "blocked": 0,\n' +
2192
- ' "error": 0\n' +
2193
- ' }\n' +
2194
- ' },\n' +
2195
- ' "metadata": {\n' +
2196
- ' "requestId": "test-request-id",\n' +
2197
- ' "timestamp": "2025-11-25T17:39:46.029Z"\n' +
2198
- ' }\n' +
2199
- '}'
2592
+
2593
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should prefer camelCase over snake_case when both present
2594
+ [ToolProtectionService] Config loaded from API {
2595
+ source: 'api',
2596
+ toolCount: 1,
2597
+ protectedTools: [ 'read_repos' ],
2598
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2599
+ projectId: 'test-project-123',
2600
+ cacheTtlMs: 300000,
2601
+ cacheExpiresAt: '2025-11-26T15:41:45.791Z'
2200
2602
  }
2201
- [AccessControl] Raw response received: {
2202
- "success": true,
2203
- "data": {
2204
- "accepted": 1,
2205
- "rejected": 0,
2206
- "outcomes": {
2207
- "success": 1,
2208
- "failed": 0,
2209
- "blocked": 0,
2210
- "error": 0
2211
- }
2212
- },
2213
- "metadata": {
2214
- "requestId": "test-request-id",
2215
- "timestamp": "2025-11-25T17:39:46.029Z"
2216
- }
2603
+
2604
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should handle missing oauthProvider field (backward compatible)
2605
+ [ToolProtectionService] Config loaded from API {
2606
+ source: 'api',
2607
+ toolCount: 1,
2608
+ protectedTools: [ 'read_repos' ],
2609
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2610
+ projectId: 'test-project-123',
2611
+ cacheTtlMs: 300000,
2612
+ cacheExpiresAt: '2025-11-26T15:41:45.792Z'
2217
2613
  }
2218
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
2219
- correlationId: '0babed74-6504-4941-9a9e-249e91ac221b',
2220
- dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
2221
- hasAccepted: true,
2222
- hasRejected: true,
2223
- hasOutcomes: true,
2224
- hasErrors: false,
2225
- acceptedType: 'number',
2226
- acceptedValue: 1,
2227
- rejectedType: 'number',
2228
- rejectedValue: 0,
2229
- outcomesType: 'object',
2230
- outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
2231
- errorsType: 'undefined',
2232
- errorsIsArray: false,
2233
- fullData: '{\n' +
2234
- ' "accepted": 1,\n' +
2235
- ' "rejected": 0,\n' +
2236
- ' "outcomes": {\n' +
2237
- ' "success": 1,\n' +
2238
- ' "failed": 0,\n' +
2239
- ' "blocked": 0,\n' +
2240
- ' "error": 0\n' +
2241
- ' }\n' +
2242
- '}'
2614
+
2615
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should parse oauthProvider from array format with camelCase
2616
+ [ToolProtectionService] Config loaded from API {
2617
+ source: 'api',
2618
+ toolCount: 2,
2619
+ protectedTools: [ 'read_repos', 'send_email' ],
2620
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2621
+ projectId: 'none',
2622
+ cacheTtlMs: 300000,
2623
+ cacheExpiresAt: '2025-11-26T15:41:45.793Z'
2243
2624
  }
2244
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
2245
- correlationId: '0babed74-6504-4941-9a9e-249e91ac221b',
2246
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
2247
- hasSuccess: true,
2248
- successValue: true,
2249
- hasAccepted: true,
2250
- acceptedValue: 1,
2251
- hasRejected: true,
2252
- rejectedValue: 0,
2253
- hasOutcomes: true,
2254
- outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
2255
- fullDataWithSuccess: '{\n' +
2256
- ' "success": true,\n' +
2257
- ' "accepted": 1,\n' +
2258
- ' "rejected": 0,\n' +
2259
- ' "outcomes": {\n' +
2260
- ' "success": 1,\n' +
2261
- ' "failed": 0,\n' +
2262
- ' "blocked": 0,\n' +
2263
- ' "error": 0\n' +
2264
- ' }\n' +
2265
- '}'
2625
+
2626
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should parse oauthProvider from array format with snake_case
2627
+ [ToolProtectionService] Config loaded from API {
2628
+ source: 'api',
2629
+ toolCount: 1,
2630
+ protectedTools: [ 'read_repos' ],
2631
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2632
+ projectId: 'none',
2633
+ cacheTtlMs: 300000,
2634
+ cacheExpiresAt: '2025-11-26T15:41:45.793Z'
2266
2635
  }
2267
2636
 
2268
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with errors array
2269
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2270
- correlationId: '628eaa42-5a92-426f-b451-b543bcd6738d',
2271
- status: 200,
2272
- statusText: undefined,
2273
- headers: {},
2274
- responseTextLength: 333,
2275
- responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T17:39:46.042Z"}}',
2276
- fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T17:39:46.042Z"}}'
2637
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should prefer camelCase over snake_case in array format
2638
+ [ToolProtectionService] Config loaded from API {
2639
+ source: 'api',
2640
+ toolCount: 1,
2641
+ protectedTools: [ 'read_repos' ],
2642
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2643
+ projectId: 'none',
2644
+ cacheTtlMs: 300000,
2645
+ cacheExpiresAt: '2025-11-26T15:41:45.793Z'
2277
2646
  }
2278
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2279
- correlationId: '628eaa42-5a92-426f-b451-b543bcd6738d',
2280
- status: 200,
2281
- responseDataType: 'object',
2282
- responseDataKeys: [ 'success', 'data', 'metadata' ],
2283
- responseData: '{\n' +
2284
- ' "success": true,\n' +
2285
- ' "data": {\n' +
2286
- ' "accepted": 0,\n' +
2287
- ' "rejected": 1,\n' +
2288
- ' "outcomes": {\n' +
2289
- ' "success": 0,\n' +
2290
- ' "failed": 1,\n' +
2291
- ' "blocked": 0,\n' +
2292
- ' "error": 0\n' +
2293
- ' },\n' +
2294
- ' "errors": [\n' +
2295
- ' {\n' +
2296
- ' "proof_index": 0,\n' +
2297
- ' "error": {\n' +
2298
- ' "code": "validation_error",\n' +
2299
- ' "message": "Proof validation failed",\n' +
2300
- ' "details": {\n' +
2301
- ' "reason": "invalid_signature"\n' +
2302
- ' }\n' +
2303
- ' }\n' +
2304
- ' }\n' +
2305
- ' ]\n' +
2306
- ' },\n' +
2307
- ' "metadata": {\n' +
2308
- ' "requestId": "test-request-id",\n' +
2309
- ' "timestamp": "2025-11-25T17:39:46.042Z"\n' +
2310
- ' }\n' +
2311
- '}'
2312
- }
2313
- [AccessControl] Raw response received: {
2314
- "success": true,
2315
- "data": {
2316
- "accepted": 0,
2317
- "rejected": 1,
2318
- "outcomes": {
2319
- "success": 0,
2320
- "failed": 1,
2321
- "blocked": 0,
2322
- "error": 0
2323
- },
2324
- "errors": [
2325
- {
2326
- "proof_index": 0,
2327
- "error": {
2328
- "code": "validation_error",
2329
- "message": "Proof validation failed",
2330
- "details": {
2331
- "reason": "invalid_signature"
2332
- }
2333
- }
2334
- }
2335
- ]
2336
- },
2337
- "metadata": {
2338
- "requestId": "test-request-id",
2339
- "timestamp": "2025-11-25T17:39:46.042Z"
2340
- }
2341
- }
2342
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
2343
- correlationId: '628eaa42-5a92-426f-b451-b543bcd6738d',
2344
- dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
2345
- hasAccepted: true,
2346
- hasRejected: true,
2347
- hasOutcomes: true,
2348
- hasErrors: true,
2349
- acceptedType: 'number',
2350
- acceptedValue: 0,
2351
- rejectedType: 'number',
2352
- rejectedValue: 1,
2353
- outcomesType: 'object',
2354
- outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
2355
- errorsType: 'object',
2356
- errorsIsArray: true,
2357
- fullData: '{\n' +
2358
- ' "accepted": 0,\n' +
2359
- ' "rejected": 1,\n' +
2360
- ' "outcomes": {\n' +
2361
- ' "success": 0,\n' +
2362
- ' "failed": 1,\n' +
2363
- ' "blocked": 0,\n' +
2364
- ' "error": 0\n' +
2365
- ' },\n' +
2366
- ' "errors": [\n' +
2367
- ' {\n' +
2368
- ' "proof_index": 0,\n' +
2369
- ' "error": {\n' +
2370
- ' "code": "validation_error",\n' +
2371
- ' "message": "Proof validation failed",\n' +
2372
- ' "details": {\n' +
2373
- ' "reason": "invalid_signature"\n' +
2374
- ' }\n' +
2375
- ' }\n' +
2376
- ' }\n' +
2377
- ' ]\n' +
2378
- '}'
2379
- }
2380
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
2381
- correlationId: '628eaa42-5a92-426f-b451-b543bcd6738d',
2382
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
2383
- hasSuccess: true,
2384
- successValue: true,
2385
- hasAccepted: true,
2386
- acceptedValue: 0,
2387
- hasRejected: true,
2388
- rejectedValue: 1,
2389
- hasOutcomes: true,
2390
- outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
2391
- fullDataWithSuccess: '{\n' +
2392
- ' "success": true,\n' +
2393
- ' "accepted": 0,\n' +
2394
- ' "rejected": 1,\n' +
2395
- ' "outcomes": {\n' +
2396
- ' "success": 0,\n' +
2397
- ' "failed": 1,\n' +
2398
- ' "blocked": 0,\n' +
2399
- ' "error": 0\n' +
2400
- ' },\n' +
2401
- ' "errors": [\n' +
2402
- ' {\n' +
2403
- ' "proof_index": 0,\n' +
2404
- ' "error": {\n' +
2405
- ' "code": "validation_error",\n' +
2406
- ' "message": "Proof validation failed",\n' +
2407
- ' "details": {\n' +
2408
- ' "reason": "invalid_signature"\n' +
2409
- ' }\n' +
2410
- ' }\n' +
2411
- ' }\n' +
2412
- ' ]\n' +
2413
- '}'
2647
+
2648
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should parse oauthProvider from object format with camelCase
2649
+ [ToolProtectionService] Config loaded from API {
2650
+ source: 'api',
2651
+ toolCount: 2,
2652
+ protectedTools: [ 'read_repos', 'send_email' ],
2653
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2654
+ projectId: 'none',
2655
+ cacheTtlMs: 300000,
2656
+ cacheExpiresAt: '2025-11-26T15:41:45.793Z'
2414
2657
  }
2415
2658
 
2416
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response without outcomes (optional field)
2417
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2418
- correlationId: 'e3cd82c2-c1fa-4b94-bbfe-a3d09082e94b',
2419
- status: 200,
2420
- statusText: undefined,
2421
- headers: {},
2422
- responseTextLength: 133,
2423
- responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T17:39:46.043Z"}}',
2424
- fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T17:39:46.043Z"}}'
2425
- }
2426
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2427
- correlationId: 'e3cd82c2-c1fa-4b94-bbfe-a3d09082e94b',
2428
- status: 200,
2429
- responseDataType: 'object',
2430
- responseDataKeys: [ 'success', 'data', 'metadata' ],
2431
- responseData: '{\n' +
2432
- ' "success": true,\n' +
2433
- ' "data": {\n' +
2434
- ' "accepted": 1,\n' +
2435
- ' "rejected": 0\n' +
2436
- ' },\n' +
2437
- ' "metadata": {\n' +
2438
- ' "requestId": "test-request-id",\n' +
2439
- ' "timestamp": "2025-11-25T17:39:46.043Z"\n' +
2440
- ' }\n' +
2441
- '}'
2442
- }
2443
- [AccessControl] Raw response received: {
2444
- "success": true,
2445
- "data": {
2446
- "accepted": 1,
2447
- "rejected": 0
2448
- },
2449
- "metadata": {
2450
- "requestId": "test-request-id",
2451
- "timestamp": "2025-11-25T17:39:46.043Z"
2452
- }
2453
- }
2454
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
2455
- correlationId: 'e3cd82c2-c1fa-4b94-bbfe-a3d09082e94b',
2456
- dataKeys: [ 'accepted', 'rejected' ],
2457
- hasAccepted: true,
2458
- hasRejected: true,
2459
- hasOutcomes: false,
2460
- hasErrors: false,
2461
- acceptedType: 'number',
2462
- acceptedValue: 1,
2463
- rejectedType: 'number',
2464
- rejectedValue: 0,
2465
- outcomesType: 'undefined',
2466
- outcomesValue: undefined,
2467
- errorsType: 'undefined',
2468
- errorsIsArray: false,
2469
- fullData: '{\n "accepted": 1,\n "rejected": 0\n}'
2470
- }
2471
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
2472
- correlationId: 'e3cd82c2-c1fa-4b94-bbfe-a3d09082e94b',
2473
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
2474
- hasSuccess: true,
2475
- successValue: true,
2476
- hasAccepted: true,
2477
- acceptedValue: 1,
2478
- hasRejected: true,
2479
- rejectedValue: 0,
2480
- hasOutcomes: false,
2481
- outcomesValue: undefined,
2482
- fullDataWithSuccess: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
2659
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should parse oauthProvider from object format with snake_case
2660
+ [ToolProtectionService] Config loaded from API {
2661
+ source: 'api',
2662
+ toolCount: 1,
2663
+ protectedTools: [ 'read_repos' ],
2664
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2665
+ projectId: 'none',
2666
+ cacheTtlMs: 300000,
2667
+ cacheExpiresAt: '2025-11-26T15:41:45.794Z'
2483
2668
  }
2484
2669
 
2485
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should throw validation error if data object missing success field
2486
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2487
- correlationId: 'f0fbd4cd-9696-489a-864e-ff4c96cf7483',
2488
- status: 200,
2489
- statusText: undefined,
2490
- headers: {},
2491
- responseTextLength: 191,
2492
- responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T17:39:46.043Z"}}',
2493
- fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T17:39:46.043Z"}}'
2494
- }
2495
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2496
- correlationId: 'f0fbd4cd-9696-489a-864e-ff4c96cf7483',
2497
- status: 200,
2498
- responseDataType: 'object',
2499
- responseDataKeys: [ 'success', 'data', 'metadata' ],
2500
- responseData: '{\n' +
2501
- ' "success": true,\n' +
2502
- ' "data": {\n' +
2503
- ' "accepted": 1,\n' +
2504
- ' "rejected": 0,\n' +
2505
- ' "outcomes": {\n' +
2506
- ' "success": 1,\n' +
2507
- ' "failed": 0,\n' +
2508
- ' "blocked": 0,\n' +
2509
- ' "error": 0\n' +
2510
- ' }\n' +
2511
- ' },\n' +
2512
- ' "metadata": {\n' +
2513
- ' "requestId": "test-request-id",\n' +
2514
- ' "timestamp": "2025-11-25T17:39:46.043Z"\n' +
2515
- ' }\n' +
2516
- '}'
2517
- }
2518
- [AccessControl] Raw response received: {
2519
- "success": true,
2520
- "data": {
2521
- "accepted": 1,
2522
- "rejected": 0,
2523
- "outcomes": {
2524
- "success": 1,
2525
- "failed": 0,
2526
- "blocked": 0,
2527
- "error": 0
2528
- }
2529
- },
2530
- "metadata": {
2531
- "requestId": "test-request-id",
2532
- "timestamp": "2025-11-25T17:39:46.043Z"
2533
- }
2534
- }
2535
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
2536
- correlationId: 'f0fbd4cd-9696-489a-864e-ff4c96cf7483',
2537
- dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
2538
- hasAccepted: true,
2539
- hasRejected: true,
2540
- hasOutcomes: true,
2541
- hasErrors: false,
2542
- acceptedType: 'number',
2543
- acceptedValue: 1,
2544
- rejectedType: 'number',
2545
- rejectedValue: 0,
2546
- outcomesType: 'object',
2547
- outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
2548
- errorsType: 'undefined',
2549
- errorsIsArray: false,
2550
- fullData: '{\n' +
2551
- ' "accepted": 1,\n' +
2552
- ' "rejected": 0,\n' +
2553
- ' "outcomes": {\n' +
2554
- ' "success": 1,\n' +
2555
- ' "failed": 0,\n' +
2556
- ' "blocked": 0,\n' +
2557
- ' "error": 0\n' +
2558
- ' }\n' +
2559
- '}'
2560
- }
2561
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
2562
- correlationId: 'f0fbd4cd-9696-489a-864e-ff4c96cf7483',
2563
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
2564
- hasSuccess: true,
2565
- successValue: true,
2566
- hasAccepted: true,
2567
- acceptedValue: 1,
2568
- hasRejected: true,
2569
- rejectedValue: 0,
2570
- hasOutcomes: true,
2571
- outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
2572
- fullDataWithSuccess: '{\n' +
2573
- ' "success": true,\n' +
2574
- ' "accepted": 1,\n' +
2575
- ' "rejected": 0,\n' +
2576
- ' "outcomes": {\n' +
2577
- ' "success": 1,\n' +
2578
- ' "failed": 0,\n' +
2579
- ' "blocked": 0,\n' +
2580
- ' "error": 0\n' +
2581
- ' }\n' +
2582
- '}'
2670
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should prefer camelCase over snake_case in object format
2671
+ [ToolProtectionService] Config loaded from API {
2672
+ source: 'api',
2673
+ toolCount: 1,
2674
+ protectedTools: [ 'read_repos' ],
2675
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2676
+ projectId: 'none',
2677
+ cacheTtlMs: 300000,
2678
+ cacheExpiresAt: '2025-11-26T15:41:45.794Z'
2583
2679
  }
2584
2680
 
2585
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should correctly extract data from wrapped response after JSON deep clone
2586
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2587
- correlationId: 'b6273eca-5c1a-4b87-9aee-e26973fe4d84',
2588
- status: 200,
2589
- statusText: undefined,
2590
- headers: {},
2591
- responseTextLength: 191,
2592
- responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1},"errors":[]},"metadata":{"requestId":"fc1fa88f-9b22-4161-b4fd-17d8215098ee","timestamp":"2025-11-24T21:36:33.029Z"}}',
2593
- fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1},"errors":[]},"metadata":{"requestId":"fc1fa88f-9b22-4161-b4fd-17d8215098ee","timestamp":"2025-11-24T21:36:33.029Z"}}'
2594
- }
2595
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2596
- correlationId: 'b6273eca-5c1a-4b87-9aee-e26973fe4d84',
2597
- status: 200,
2598
- responseDataType: 'object',
2599
- responseDataKeys: [ 'success', 'data', 'metadata' ],
2600
- responseData: '{\n' +
2601
- ' "success": true,\n' +
2602
- ' "data": {\n' +
2603
- ' "accepted": 1,\n' +
2604
- ' "rejected": 0,\n' +
2605
- ' "outcomes": {\n' +
2606
- ' "success": 1\n' +
2607
- ' },\n' +
2608
- ' "errors": []\n' +
2609
- ' },\n' +
2610
- ' "metadata": {\n' +
2611
- ' "requestId": "fc1fa88f-9b22-4161-b4fd-17d8215098ee",\n' +
2612
- ' "timestamp": "2025-11-24T21:36:33.029Z"\n' +
2613
- ' }\n' +
2614
- '}'
2681
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Caching > should cache oauthProvider field correctly
2682
+ [ToolProtectionService] Config loaded from API {
2683
+ source: 'api',
2684
+ toolCount: 1,
2685
+ protectedTools: [ 'read_repos' ],
2686
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2687
+ projectId: 'test-project-123',
2688
+ cacheTtlMs: 300000,
2689
+ cacheExpiresAt: '2025-11-26T15:41:45.795Z'
2615
2690
  }
2616
- [AccessControl] Raw response received: {
2617
- "success": true,
2618
- "data": {
2619
- "accepted": 1,
2620
- "rejected": 0,
2621
- "outcomes": {
2622
- "success": 1
2623
- },
2624
- "errors": []
2625
- },
2626
- "metadata": {
2627
- "requestId": "fc1fa88f-9b22-4161-b4fd-17d8215098ee",
2628
- "timestamp": "2025-11-24T21:36:33.029Z"
2629
- }
2691
+
2692
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should include oauthProvider in returned ToolProtection objects when present
2693
+ [ToolProtectionService] Config loaded from API {
2694
+ source: 'api',
2695
+ toolCount: 2,
2696
+ protectedTools: [ 'tool_with_provider', 'tool_without_provider' ],
2697
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2698
+ projectId: 'test-project-123',
2699
+ cacheTtlMs: 300000,
2700
+ cacheExpiresAt: '2025-11-26T15:41:45.795Z'
2630
2701
  }
2631
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
2632
- correlationId: 'b6273eca-5c1a-4b87-9aee-e26973fe4d84',
2633
- dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
2634
- hasAccepted: true,
2635
- hasRejected: true,
2636
- hasOutcomes: true,
2637
- hasErrors: true,
2638
- acceptedType: 'number',
2639
- acceptedValue: 1,
2640
- rejectedType: 'number',
2641
- rejectedValue: 0,
2642
- outcomesType: 'object',
2643
- outcomesValue: { success: 1 },
2644
- errorsType: 'object',
2645
- errorsIsArray: true,
2646
- fullData: '{\n' +
2647
- ' "accepted": 1,\n' +
2648
- ' "rejected": 0,\n' +
2649
- ' "outcomes": {\n' +
2650
- ' "success": 1\n' +
2651
- ' },\n' +
2652
- ' "errors": []\n' +
2653
- '}'
2702
+
2703
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should handle empty string oauthProvider gracefully
2704
+ [ToolProtectionService] Config loaded from API {
2705
+ source: 'api',
2706
+ toolCount: 1,
2707
+ protectedTools: [ 'tool_with_empty_provider' ],
2708
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2709
+ projectId: 'test-project-123',
2710
+ cacheTtlMs: 300000,
2711
+ cacheExpiresAt: '2025-11-26T15:41:45.795Z'
2654
2712
  }
2655
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
2656
- correlationId: 'b6273eca-5c1a-4b87-9aee-e26973fe4d84',
2657
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
2658
- hasSuccess: true,
2659
- successValue: true,
2660
- hasAccepted: true,
2661
- acceptedValue: 1,
2662
- hasRejected: true,
2663
- rejectedValue: 0,
2664
- hasOutcomes: true,
2665
- outcomesValue: { success: 1 },
2666
- fullDataWithSuccess: '{\n' +
2667
- ' "success": true,\n' +
2668
- ' "accepted": 1,\n' +
2669
- ' "rejected": 0,\n' +
2670
- ' "outcomes": {\n' +
2671
- ' "success": 1\n' +
2672
- ' },\n' +
2673
- ' "errors": []\n' +
2674
- '}'
2713
+
2714
+ ✓ src/__tests__/services/tool-protection-oauth-provider.test.ts (14 tests) 7ms
2715
+ src/__tests__/services/oauth-service-pkce.test.ts (18 tests) 9ms
2716
+ ✓ src/__tests__/providers/memory.test.ts (34 tests) 13ms
2717
+ ✓ src/compliance/__tests__/schema-verifier.test.ts (30 tests) 25ms
2718
+ stderr | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should fall back to configuredProvider for ambiguous scopes
2719
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2720
+ ✓ src/delegation/__tests__/cascading-revocation.test.ts (23 tests) 9ms
2721
+ stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from github scope prefix
2722
+ [ProviderResolver] Inferred provider "github" from scopes
2723
+
2724
+ stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from gmail scope prefix (maps to google)
2725
+ [ProviderResolver] Inferred provider "google" from scopes
2726
+
2727
+
2728
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle empty scopes array
2729
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2730
+
2731
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle ambiguous scopes (multiple providers inferred)
2732
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2733
+
2734
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle unknown scope prefixes
2735
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2736
+
2737
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify gmail → google mapping works
2738
+ [ProviderResolver] Inferred provider "google" from scopes
2739
+
2740
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify calendar → google mapping works
2741
+ [ProviderResolver] Inferred provider "google" from scopes
2742
+
2743
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify outlook → microsoft mapping works
2744
+ [ProviderResolver] Inferred provider "microsoft" from scopes
2745
+
2746
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle scopes without colons
2747
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2748
+
2749
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle inferred provider not in registry
2750
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "google" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2751
+
2752
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Fallback behavior (Priority 3 - configuredProvider) > should use configuredProvider when oauthProvider not specified
2753
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "google" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2754
+
2755
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Provider name case sensitivity > should handle provider names case-insensitively in inference
2756
+ [ProviderResolver] Inferred provider "github" from scopes
2757
+
2758
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > configuredProvider behavior (Priority 3) > should use configuredProvider when tool has no oauthProvider
2759
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Multiple scopes with same provider > should handle multiple scopes from same provider
2760
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2761
+ [ProviderResolver] Inferred provider "github" from scopes
2762
+
2763
+
2764
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > configuredProvider behavior (Priority 3) > should prefer scope-inferred provider over configuredProvider
2765
+ [ProviderResolver] Inferred provider "google" from scopes
2766
+
2767
+ stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Phase 1 tools (no oauthProvider) > should work with Phase 1 tools that don't specify oauthProvider
2768
+ [ToolProtectionService] Config loaded from API {
2769
+ source: 'api',
2770
+ toolCount: 1,
2771
+ protectedTools: [ 'phase1_tool' ],
2772
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2773
+ projectId: 'none',
2774
+ cacheTtlMs: 300000,
2775
+ cacheExpiresAt: '2025-11-26T15:41:45.870Z'
2675
2776
  }
2676
2777
 
2677
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should handle response where data fields are numeric values (not undefined)
2678
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2679
- correlationId: '0c3f59bb-3f55-4148-9595-9da9e3662015',
2680
- status: 200,
2681
- statusText: undefined,
2682
- headers: {},
2683
- responseTextLength: 151,
2684
- responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-11-25T17:39:46.046Z"}}',
2685
- fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-11-25T17:39:46.046Z"}}'
2778
+ stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Old API endpoint format > should still support old endpoint format (tools array)
2779
+ [ToolProtectionService] Config loaded from API {
2780
+ source: 'api',
2781
+ toolCount: 1,
2782
+ protectedTools: [ 'old_tool' ],
2783
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2784
+ projectId: 'none',
2785
+ cacheTtlMs: 300000,
2786
+ cacheExpiresAt: '2025-11-26T15:41:45.881Z'
2686
2787
  }
2687
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2688
- correlationId: '0c3f59bb-3f55-4148-9595-9da9e3662015',
2689
- status: 200,
2690
- responseDataType: 'object',
2691
- responseDataKeys: [ 'success', 'data', 'metadata' ],
2692
- responseData: '{\n' +
2693
- ' "success": true,\n' +
2694
- ' "data": {\n' +
2695
- ' "accepted": 0,\n' +
2696
- ' "rejected": 0,\n' +
2697
- ' "outcomes": {},\n' +
2698
- ' "errors": []\n' +
2699
- ' },\n' +
2700
- ' "metadata": {\n' +
2701
- ' "requestId": "test-id",\n' +
2702
- ' "timestamp": "2025-11-25T17:39:46.046Z"\n' +
2703
- ' }\n' +
2704
- '}'
2788
+
2789
+ stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Old API endpoint format > should still support old endpoint format (tools object)
2790
+ [ToolProtectionService] Config loaded from API {
2791
+ source: 'api',
2792
+ toolCount: 1,
2793
+ protectedTools: [ 'old_tool' ],
2794
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2795
+ projectId: 'none',
2796
+ cacheTtlMs: 300000,
2797
+ cacheExpiresAt: '2025-11-26T15:41:45.882Z'
2705
2798
  }
2706
- [AccessControl] Raw response received: {
2707
- "success": true,
2708
- "data": {
2709
- "accepted": 0,
2710
- "rejected": 0,
2711
- "outcomes": {},
2712
- "errors": []
2713
- },
2714
- "metadata": {
2715
- "requestId": "test-id",
2716
- "timestamp": "2025-11-25T17:39:46.046Z"
2717
- }
2799
+
2800
+ stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > snake_case field names > should still support snake_case field names
2801
+ [ToolProtectionService] Config loaded from API {
2802
+ source: 'api',
2803
+ toolCount: 1,
2804
+ protectedTools: [ 'tool_with_snake_case' ],
2805
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2806
+ projectId: 'test-project-123',
2807
+ cacheTtlMs: 300000,
2808
+ cacheExpiresAt: '2025-11-26T15:41:45.882Z'
2718
2809
  }
2719
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
2720
- correlationId: '0c3f59bb-3f55-4148-9595-9da9e3662015',
2721
- dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
2722
- hasAccepted: true,
2723
- hasRejected: true,
2724
- hasOutcomes: true,
2725
- hasErrors: true,
2726
- acceptedType: 'number',
2727
- acceptedValue: 0,
2728
- rejectedType: 'number',
2729
- rejectedValue: 0,
2730
- outcomesType: 'object',
2731
- outcomesValue: {},
2732
- errorsType: 'object',
2733
- errorsIsArray: true,
2734
- fullData: '{\n "accepted": 0,\n "rejected": 0,\n "outcomes": {},\n "errors": []\n}'
2810
+
2811
+ stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Mixed Phase 1 and Phase 2 tools > should handle mix of Phase 1 and Phase 2 tools in same project
2812
+ [ToolProtectionService] Config loaded from API {
2813
+ source: 'api',
2814
+ toolCount: 2,
2815
+ protectedTools: [ 'phase1_tool', 'phase2_tool' ],
2816
+ stderr | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > No Regressions > Phase 1 OAuth flow > should still work with Phase 1 OAuth flow (no oauthProvider)
2817
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2818
+ projectId: 'test-project-123',
2819
+ cacheTtlMs: 300000,
2820
+ cacheExpiresAt: '2025-11-26T15:41:45.885Z'
2735
2821
  }
2736
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
2737
- correlationId: '0c3f59bb-3f55-4148-9595-9da9e3662015',
2738
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
2739
- hasSuccess: true,
2740
- successValue: true,
2741
- hasAccepted: true,
2742
- acceptedValue: 0,
2743
- hasRejected: true,
2744
- rejectedValue: 0,
2745
- hasOutcomes: true,
2746
- outcomesValue: {},
2747
- fullDataWithSuccess: '{\n' +
2748
- ' "success": true,\n' +
2749
- ' "accepted": 0,\n' +
2750
- ' "rejected": 0,\n' +
2751
- ' "outcomes": {},\n' +
2752
- ' "errors": []\n' +
2753
- '}'
2822
+
2823
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2824
+
2825
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
2826
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z-fcn5k3v2ZvYK9dlIxU8n4lMqIWAYMTh","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405871,"timestampFormatted":"2025-11-26T15:36:45.871Z"}
2827
+
2828
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
2829
+ [AUDIT] {"event":"tool_executed","data":{"tool":"greetingTool","sessionId":"70fae80e7f85d8d7c07f785a68990d26","timestamp":1764171405871},"timestamp":1764171405871,"timestampFormatted":"2025-11-26T15:36:45.871Z"}
2830
+
2831
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Session expiry handling > should handle expired sessions correctly
2832
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zT_7RaA0bLnzRdBKcRy8wSQhZQWOqdu6M","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405883,"timestampFormatted":"2025-11-26T15:36:45.883Z"}
2833
+
2834
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
2835
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zTh6D4u2wJj_Y3a4AyHIqU89X7UCKWfoF","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405883,"timestampFormatted":"2025-11-26T15:36:45.883Z"}
2836
+
2837
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
2838
+ [AUDIT] {"event":"keys_rotated","data":{"oldDid":"did:key:zTh6D4u2wJj_Y3a4AyHIqU89X7UCKWfoF","newDid":"did:key:zmjuGQxXVJTkNFmfA7biSllCtFAK3U22B","timestamp":1764171405883},"timestamp":1764171405883,"timestampFormatted":"2025-11-26T15:36:45.883Z"}
2839
+
2840
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Well-known endpoints > should provide identity discovery endpoints
2841
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zt1EwInIPdYDy3nYd-H-vnDVXRVC8Ngnz","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405887,"timestampFormatted":"2025-11-26T15:36:45.887Z"}
2842
+
2843
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Nonce replay protection > should prevent nonce reuse
2844
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zd-MgrCaVXirdlYFY4OUm5ClzQZAdOchd","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405888,"timestampFormatted":"2025-11-26T15:36:45.888Z"}
2845
+
2846
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle network errors gracefully
2847
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zmtiafOUYJHiKNWjqtCy4IRCk3iieeEpb","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405888,"timestampFormatted":"2025-11-26T15:36:45.888Z"}
2848
+
2849
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle malformed DID documents
2850
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zmglnfmMGPMSRQ2b7Vr0t-PoMXPG0Ltbg","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405888,"timestampFormatted":"2025-11-26T15:36:45.888Z"}
2851
+
2852
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should provide debug information in development
2853
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zs1TeqYecLeqs89TtiOTV2kVTDeu1wdzZ","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405889,"timestampFormatted":"2025-11-26T15:36:45.889Z"}
2854
+
2855
+ ✓ src/__tests__/services/provider-resolver-edge-cases.test.ts (25 tests | 1 skipped) 12ms
2856
+ ✓ src/delegation/__tests__/delegation-graph.test.ts (28 tests) 6ms
2857
+ ✓ src/__tests__/runtime/base-extensions.test.ts (38 tests) 14ms
2858
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should be disabled in production
2859
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z-4za6CQd91VdYGlXbvvTWpL8r9av_GhE","environment":"development","userDidGeneration":"disabled"},"timestamp":1764171405889,"timestampFormatted":"2025-11-26T15:36:45.889Z"}
2860
+
2861
+ ✓ src/__tests__/regression/phase2-regression.test.ts (12 tests) 17ms
2862
+ ✓ src/services/__tests__/provider-resolver.test.ts (8 tests) 6ms
2863
+ ✓ src/__tests__/integration.test.ts (9 tests) 19ms
2864
+ ✓ src/__tests__/providers/base.test.ts (14 tests) 6ms
2865
+ ✓ src/__tests__/runtime/proof-client-did.test.ts (17 tests) 7ms
2866
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API request fails
2867
+ [RemoteConfig] API returned 404: Not Found
2868
+
2869
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API throws error
2870
+ [RemoteConfig] Failed to fetch config: Error: Network error
2871
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:170:35
2872
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2873
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2874
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2875
+ at new Promise (<anonymous>)
2876
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2877
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2878
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
2879
+ at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2880
+ at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2881
+
2882
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if neither projectId nor agentDid provided
2883
+ [RemoteConfig] Neither projectId nor agentDid provided
2884
+
2885
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should handle cache read errors gracefully
2886
+ [RemoteConfig] Cache read failed: Error: Cache error
2887
+ at /Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:198:50
2888
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2889
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2890
+ at file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2891
+ at new Promise (<anonymous>)
2892
+ at runWithTimeout (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2893
+ at runTest (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2894
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
2895
+ at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2896
+ at runSuite (file:///Users/brian/Documents/Vouched/@sandbox/xmcp-i-S/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2897
+
2898
+ ✓ src/config/__tests__/remote-config.spec.ts (9 tests) 7ms
2899
+ ✓ src/delegation/storage/__tests__/memory-graph-storage.test.ts (27 tests) 4ms
2900
+ ✓ src/__tests__/runtime/delegation-flow.test.ts (4 tests) 11ms
2901
+ ✓ src/delegation/__tests__/bitstring.test.ts (30 tests) 5ms
2902
+ ✓ src/delegation/__tests__/utils.test.ts (28 tests) 7ms
2903
+ ✓ src/services/__tests__/oauth-provider-registry.test.ts (9 tests) 3ms
2904
+ ✓ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts (14 tests) 3ms
2905
+ ✓ src/__tests__/config/provider-runtime-config.test.ts (9 tests) 4ms
2906
+ ✓ src/__tests__/runtime/audit-logger.test.ts (9 tests) 4ms
2907
+ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > clearAndRefresh should call fetchFromApi with bypassCDNCache: true
2908
+ [ToolProtectionService] clearAndRefresh starting {
2909
+ cacheKey: 'config:tool-protections:test-project-123',
2910
+ projectId: 'test-project-123',
2911
+ agentDid: 'did:key:test-agent...'
2754
2912
  }
2755
2913
 
2756
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should handle response with nested outcomes object
2757
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2758
- correlationId: 'e62eaa44-bfba-42af-8ce8-4937624a7ae8',
2759
- status: 200,
2760
- statusText: undefined,
2761
- headers: {},
2762
- responseTextLength: 278,
2763
- responseTextPreview: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-11-25T17:39:46.046Z"}}',
2764
- fullResponseText: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-11-25T17:39:46.046Z"}}'
2914
+ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > clearAndRefresh should call fetchFromApi with bypassCDNCache: true
2915
+ [ToolProtectionService] Cache entry deleted { cacheKey: 'config:tool-protections:test-project-123' }
2916
+
2917
+ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > clearAndRefresh should call fetchFromApi with bypassCDNCache: true
2918
+ [ToolProtectionService] Fresh config fetched and cached {
2919
+ cacheKey: 'config:tool-protections:test-project-123',
2920
+ toolCount: 1,
2921
+ protectedTools: [ 'greet' ],
2922
+ source: 'api'
2765
2923
  }
2766
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2767
- correlationId: 'e62eaa44-bfba-42af-8ce8-4937624a7ae8',
2768
- status: 200,
2769
- responseDataType: 'object',
2770
- responseDataKeys: [ 'success', 'data', 'metadata' ],
2771
- responseData: '{\n' +
2772
- ' "success": true,\n' +
2773
- ' "data": {\n' +
2774
- ' "accepted": 3,\n' +
2775
- ' "rejected": 2,\n' +
2776
- ' "outcomes": {\n' +
2777
- ' "success": 1,\n' +
2778
- ' "failed": 1,\n' +
2779
- ' "blocked": 1,\n' +
2780
- ' "error": 2\n' +
2781
- ' },\n' +
2782
- ' "errors": [\n' +
2783
- ' {\n' +
2784
- ' "proof_index": 0,\n' +
2785
- ' "error": {\n' +
2786
- ' "code": "validation_error",\n' +
2787
- ' "message": "Invalid signature"\n' +
2788
- ' }\n' +
2789
- ' }\n' +
2790
- ' ]\n' +
2791
- ' },\n' +
2792
- ' "metadata": {\n' +
2793
- ' "requestId": "test-id",\n' +
2794
- ' "timestamp": "2025-11-25T17:39:46.046Z"\n' +
2795
- ' }\n' +
2796
- '}'
2924
+
2925
+ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should add cache-busting query param when bypassCDNCache is true
2926
+ [ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/tool-protections?_t=1764171406153 {
2927
+ method: 'projects/{projectId}/tool-protections (new)',
2928
+ projectId: 'test-project-123',
2929
+ apiKeyPresent: true,
2930
+ apiKeyLength: 12,
2931
+ apiKeyMasked: 'test-api...'
2797
2932
  }
2798
- [AccessControl] Raw response received: {
2799
- "success": true,
2800
- "data": {
2801
- "accepted": 3,
2802
- "rejected": 2,
2803
- "outcomes": {
2804
- "success": 1,
2805
- "failed": 1,
2806
- "blocked": 1,
2807
- "error": 2
2808
- },
2809
- "errors": [
2810
- {
2811
- "proof_index": 0,
2812
- "error": {
2813
- "code": "validation_error",
2814
- "message": "Invalid signature"
2815
- }
2816
- }
2817
- ]
2818
- },
2819
- "metadata": {
2820
- "requestId": "test-id",
2821
- "timestamp": "2025-11-25T17:39:46.046Z"
2822
- }
2933
+
2934
+ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should add Cache-Control headers when bypassCDNCache is true
2935
+ [ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/tool-protections?_t=1764171406153 {
2936
+ method: 'projects/{projectId}/tool-protections (new)',
2937
+ projectId: 'test-project-123',
2938
+ apiKeyPresent: true,
2939
+ apiKeyLength: 12,
2940
+ apiKeyMasked: 'test-api...'
2823
2941
  }
2824
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
2825
- correlationId: 'e62eaa44-bfba-42af-8ce8-4937624a7ae8',
2826
- dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
2827
- hasAccepted: true,
2828
- hasRejected: true,
2829
- hasOutcomes: true,
2830
- hasErrors: true,
2831
- acceptedType: 'number',
2832
- acceptedValue: 3,
2833
- rejectedType: 'number',
2834
- rejectedValue: 2,
2835
- outcomesType: 'object',
2836
- outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
2837
- errorsType: 'object',
2838
- errorsIsArray: true,
2839
- fullData: '{\n' +
2840
- ' "accepted": 3,\n' +
2841
- ' "rejected": 2,\n' +
2842
- ' "outcomes": {\n' +
2843
- ' "success": 1,\n' +
2844
- ' "failed": 1,\n' +
2845
- ' "blocked": 1,\n' +
2846
- ' "error": 2\n' +
2847
- ' },\n' +
2848
- ' "errors": [\n' +
2849
- ' {\n' +
2850
- ' "proof_index": 0,\n' +
2851
- ' "error": {\n' +
2852
- ' "code": "validation_error",\n' +
2853
- ' "message": "Invalid signature"\n' +
2854
- ' }\n' +
2855
- ' }\n' +
2856
- ' ]\n' +
2857
- '}'
2942
+
2943
+ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should NOT add cache-busting when bypassCDNCache is false/undefined
2944
+ [ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/tool-protections {
2945
+ method: 'projects/{projectId}/tool-protections (new)',
2946
+ projectId: 'test-project-123',
2947
+ apiKeyPresent: true,
2948
+ apiKeyLength: 12,
2949
+ apiKeyMasked: 'test-api...'
2858
2950
  }
2859
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
2860
- correlationId: 'e62eaa44-bfba-42af-8ce8-4937624a7ae8',
2861
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
2862
- hasSuccess: true,
2863
- successValue: true,
2864
- hasAccepted: true,
2865
- acceptedValue: 3,
2866
- hasRejected: true,
2867
- rejectedValue: 2,
2868
- hasOutcomes: true,
2869
- outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
2870
- fullDataWithSuccess: '{\n' +
2871
- ' "success": true,\n' +
2872
- ' "accepted": 3,\n' +
2873
- ' "rejected": 2,\n' +
2874
- ' "outcomes": {\n' +
2875
- ' "success": 1,\n' +
2876
- ' "failed": 1,\n' +
2877
- ' "blocked": 1,\n' +
2878
- ' "error": 2\n' +
2879
- ' },\n' +
2880
- ' "errors": [\n' +
2881
- ' {\n' +
2882
- ' "proof_index": 0,\n' +
2883
- ' "error": {\n' +
2884
- ' "code": "validation_error",\n' +
2885
- ' "message": "Invalid signature"\n' +
2886
- ' }\n' +
2887
- ' }\n' +
2888
- ' ]\n' +
2889
- '}'
2951
+
2952
+ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > cache should be empty after clearAndRefresh deletes it
2953
+ [ToolProtectionService] clearAndRefresh starting {
2954
+ cacheKey: 'config:tool-protections:test-project-123',
2955
+ projectId: 'test-project-123',
2956
+ agentDid: 'did:key:test-agent...'
2957
+ }
2958
+
2959
+ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > cache should be empty after clearAndRefresh deletes it
2960
+ [ToolProtectionService] Cache entry deleted { cacheKey: 'config:tool-protections:test-project-123' }
2961
+
2962
+ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > cache should be empty after clearAndRefresh deletes it
2963
+ [ToolProtectionService] Fresh config fetched and cached {
2964
+ cacheKey: 'config:tool-protections:test-project-123',
2965
+ toolCount: 0,
2966
+ protectedTools: [],
2967
+ source: 'api'
2890
2968
  }
2891
2969
 
2892
- ✓ src/services/__tests__/access-control.proof-response-validation.test.ts (12 tests) 18ms
2893
- ✓ src/delegation/storage/__tests__/memory-graph-storage.test.ts (27 tests) 4ms
2894
- ✓ src/delegation/__tests__/utils.test.ts (28 tests) 3ms
2895
- ✓ src/__tests__/providers/base.test.ts (14 tests) 4ms
2896
2970
  stderr | src/services/__tests__/provider-resolution.integration.test.ts > Provider Resolution Integration > Backward compatibility > should work with Phase 1 tools (no oauthProvider field)
2897
- [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2971
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2898
2972
 
2973
+ ✓ src/__tests__/services/cache-busting.test.ts (5 tests) 5ms
2899
2974
  ✓ src/services/__tests__/provider-resolution.integration.test.ts (6 tests) 4ms
2900
- ✓ src/__tests__/runtime/audit-logger.test.ts (9 tests) 3ms
2901
- ✓ src/services/__tests__/oauth-provider-registry.test.ts (9 tests) 4ms
2902
2975
  ✓ src/utils/__tests__/did-helpers.test.ts (11 tests) 3ms
2903
- ✓ src/__tests__/config/provider-runtime-config.test.ts (9 tests) 3ms
2904
- ✓ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts (14 tests) 16ms
2905
- ✓ src/__tests__/runtime/delegation-flow.test.ts (4 tests) 9ms
2906
- ✓ src/delegation/__tests__/audience-validator.test.ts (5 tests) 2ms
2907
- ↓ src/__tests__/delegation-e2e.test.ts (14 tests | 14 skipped)
2908
- ✓ src/__tests__/index.test.ts (4 tests) 2ms
2976
+ ✓ src/delegation/__tests__/audience-validator.test.ts (5 tests) 1ms
2977
+ ✓ src/services/__tests__/batch-delegation.service.test.ts (11 tests) 4ms
2909
2978
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
2910
2979
  [ToolProtectionService] Config loaded from API {
2911
2980
  source: 'api',
@@ -2914,7 +2983,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
2914
2983
  agentDid: 'did:key:z6MkhaXgBZDv...',
2915
2984
  projectId: 'test-project-123',
2916
2985
  cacheTtlMs: 1000,
2917
- cacheExpiresAt: '2025-11-25T17:39:47.780Z'
2986
+ cacheExpiresAt: '2025-11-26T15:36:47.421Z'
2918
2987
  }
2919
2988
 
2920
2989
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle typical e-commerce tool protection config
@@ -2925,7 +2994,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
2925
2994
  agentDid: 'did:key:z6MkhaXgBZDv...',
2926
2995
  projectId: 'test-project-123',
2927
2996
  cacheTtlMs: 300000,
2928
- cacheExpiresAt: '2025-11-25T17:44:46.781Z'
2997
+ cacheExpiresAt: '2025-11-26T15:41:46.421Z'
2929
2998
  }
2930
2999
 
2931
3000
  stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle API rate limiting gracefully
@@ -2942,7 +3011,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
2942
3011
  agentDid: 'did:key:z6MkhaXgBZDv...',
2943
3012
  projectId: 'test-project-123',
2944
3013
  cacheTtlMs: 300000,
2945
- cacheExpiresAt: '2025-11-25T17:44:46.781Z'
3014
+ cacheExpiresAt: '2025-11-26T15:41:46.422Z'
2946
3015
  }
2947
3016
  [ToolProtectionService] Config loaded from API {
2948
3017
  source: 'api',
@@ -2951,7 +3020,7 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
2951
3020
  agentDid: 'did:key:z6MkhaXgBZDv...',
2952
3021
  projectId: 'test-project-123',
2953
3022
  cacheTtlMs: 300000,
2954
- cacheExpiresAt: '2025-11-25T17:44:46.781Z'
3023
+ cacheExpiresAt: '2025-11-26T15:41:46.422Z'
2955
3024
  }
2956
3025
  [ToolProtectionService] Config loaded from API {
2957
3026
  source: 'api',
@@ -2960,14 +3029,16 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
2960
3029
  agentDid: 'did:key:z6MkhaXgBZDv...',
2961
3030
  projectId: 'test-project-123',
2962
3031
  cacheTtlMs: 300000,
2963
- cacheExpiresAt: '2025-11-25T17:44:46.781Z'
3032
+ cacheExpiresAt: '2025-11-26T15:41:46.422Z'
2964
3033
  }
2965
3034
 
2966
- ✓ src/__tests__/services/agentshield-integration.test.ts (30 tests) 1115ms
3035
+ ✓ src/__tests__/services/agentshield-integration.test.ts (30 tests) 1113ms
2967
3036
  ✓ should respect cache TTL 1102ms
3037
+ ↓ src/__tests__/delegation-e2e.test.ts (14 tests | 14 skipped)
3038
+ ✓ src/__tests__/index.test.ts (4 tests) 2ms
2968
3039
 
2969
- Test Files 43 passed | 1 skipped (44)
2970
- Tests 876 passed | 16 skipped (892)
2971
- Start at 12:39:45
2972
- Duration 1.52s (transform 2.23s, setup 0ms, collect 3.81s, tests 1.98s, environment 4ms, prepare 715ms)
3040
+ Test Files 45 passed | 1 skipped (46)
3041
+ Tests 905 passed | 16 skipped (921)
3042
+ Start at 10:36:44
3043
+ Duration 1.70s (transform 5.57s, setup 0ms, collect 8.85s, tests 2.79s, environment 4ms, prepare 1.19s)
2973
3044