@kya-os/mcp-i-core 1.3.7 → 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.7 test /Users/dylanhobbs/Documents/@kya-os/xmcp-i/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
- RUN v4.0.14 /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
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-26T07:20:55.813Z'
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-26T07:20:55.816Z'
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-26T07:20:55.818Z'
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,7 +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-26T07:20:55.819Z'
207
+ cacheExpiresAt: '2025-11-26T15:41:45.315Z'
50
208
  }
51
209
 
52
210
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode projectId in URL
@@ -57,21 +215,18 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
57
215
  agentDid: 'did:key:z6MkhaXgBZDv...',
58
216
  projectId: 'project/with/special-chars',
59
217
  cacheTtlMs: 300000,
60
- cacheExpiresAt: '2025-11-26T07:20:55.819Z'
218
+ cacheExpiresAt: '2025-11-26T15:41:45.316Z'
61
219
  }
62
220
 
63
221
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode agent DID in URL
64
222
  [ToolProtectionService] Config loaded from API {
65
- stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Error Handling > should handle network timeout
66
223
  source: 'api',
67
224
  toolCount: 0,
68
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
69
225
  protectedTools: [],
70
-
71
226
  agentDid: 'did:key:z6MkhaXgBZDv...',
72
227
  projectId: 'none',
73
228
  cacheTtlMs: 300000,
74
- cacheExpiresAt: '2025-11-26T07:20:55.820Z'
229
+ cacheExpiresAt: '2025-11-26T15:41:45.316Z'
75
230
  }
76
231
 
77
232
  stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle new endpoint format (toolProtections object)
@@ -82,120 +237,95 @@ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield In
82
237
  agentDid: 'did:key:z6MkhaXgBZDv...',
83
238
  projectId: 'test-project-123',
84
239
  cacheTtlMs: 300000,
85
- cacheExpiresAt: '2025-11-26T07:20:55.820Z'
240
+ cacheExpiresAt: '2025-11-26T15:41:45.316Z'
86
241
  }
87
242
 
88
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools array)
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
89
244
  [ToolProtectionService] Config loaded from API {
90
245
  source: 'api',
91
246
  toolCount: 2,
92
247
  protectedTools: [ 'checkout' ],
93
248
  agentDid: 'did:key:z6MkhaXgBZDv...',
94
- projectId: 'none',
249
+ projectId: 'test-project-123',
95
250
  cacheTtlMs: 300000,
96
- cacheExpiresAt: '2025-11-26T07:20:55.820Z'
251
+ cacheExpiresAt: '2025-11-26T15:41:45.312Z'
97
252
  }
98
253
 
99
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools object)
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
100
255
  [ToolProtectionService] Config loaded from API {
101
256
  source: 'api',
102
257
  toolCount: 2,
103
- protectedTools: [ 'checkout' ],
258
+ protectedTools: [ 'protected_tool' ],
104
259
  agentDid: 'did:key:z6MkhaXgBZDv...',
105
- projectId: 'none',
260
+ projectId: 'test-project-123',
106
261
  cacheTtlMs: 300000,
107
- cacheExpiresAt: '2025-11-26T07:20:55.820Z'
262
+ cacheExpiresAt: '2025-11-26T15:41:45.316Z'
108
263
  }
109
264
 
110
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle snake_case field names
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)
111
266
  [ToolProtectionService] Config loaded from API {
112
267
  source: 'api',
113
- toolCount: 1,
114
- protectedTools: [ 'tool1' ],
268
+ toolCount: 2,
269
+ protectedTools: [ 'read_repos', 'send_email' ],
115
270
  agentDid: 'did:key:z6MkhaXgBZDv...',
116
271
  projectId: 'test-project-123',
117
272
  cacheTtlMs: 300000,
118
- cacheExpiresAt: '2025-11-26T07:20:55.821Z'
273
+ cacheExpiresAt: '2025-11-26T15:41:45.317Z'
119
274
  }
120
275
 
121
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle camelCase field names
276
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools array)
122
277
  [ToolProtectionService] Config loaded from API {
123
278
  source: 'api',
124
- toolCount: 1,
125
- protectedTools: [ 'tool1' ],
279
+ toolCount: 2,
280
+ protectedTools: [ 'checkout' ],
126
281
  agentDid: 'did:key:z6MkhaXgBZDv...',
127
- projectId: 'test-project-123',
282
+ projectId: 'none',
128
283
  cacheTtlMs: 300000,
129
- cacheExpiresAt: '2025-11-26T07:20:55.821Z'
284
+ cacheExpiresAt: '2025-11-26T15:41:45.317Z'
130
285
  }
131
286
 
132
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should prefer camelCase over snake_case when both present
287
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools object)
133
288
  [ToolProtectionService] Config loaded from API {
134
289
  source: 'api',
135
- toolCount: 1,
136
- protectedTools: [ 'tool1' ],
290
+ toolCount: 2,
291
+ protectedTools: [ 'checkout' ],
137
292
  agentDid: 'did:key:z6MkhaXgBZDv...',
138
- projectId: 'test-project-123',
293
+ projectId: 'none',
139
294
  cacheTtlMs: 300000,
140
- cacheExpiresAt: '2025-11-26T07:20:55.821Z'
295
+ cacheExpiresAt: '2025-11-26T15:41:45.317Z'
141
296
  }
142
297
 
143
- stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Fallback Behavior > should cache fallback config
144
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should cache successful API responses
298
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle snake_case field names
145
299
  [ToolProtectionService] Config loaded from API {
146
300
  source: 'api',
147
301
  toolCount: 1,
148
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
149
302
  protectedTools: [ 'tool1' ],
150
303
  agentDid: 'did:key:z6MkhaXgBZDv...',
151
304
  projectId: 'test-project-123',
152
305
  cacheTtlMs: 300000,
153
- cacheExpiresAt: '2025-11-26T07:20:55.823Z'
154
- }
155
-
156
-
157
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
158
- [ToolProtectionService] Config loaded from API {
159
- source: 'api',
160
- toolCount: 0,
161
- protectedTools: [],
162
- agentDid: 'did:key:z6MkhaXgBZDv...',
163
- projectId: 'test-project-123',
164
- cacheTtlMs: 1000,
165
- cacheExpiresAt: '2025-11-26T07:15:56.823Z'
166
- }
167
-
168
- 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
169
- [ToolProtectionService] Config loaded from API {
170
- source: 'api',
171
- toolCount: 2,
172
- protectedTools: [ 'checkout' ],
173
- agentDid: 'did:key:z6MkhaXgBZDv...',
174
- projectId: 'test-project-123',
175
- cacheTtlMs: 300000,
176
- cacheExpiresAt: '2025-11-26T07:20:55.820Z'
306
+ cacheExpiresAt: '2025-11-26T15:41:45.318Z'
177
307
  }
178
308
 
179
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should handle new endpoint format with toolProtections object
309
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle camelCase field names
180
310
  [ToolProtectionService] Config loaded from API {
181
311
  source: 'api',
182
- toolCount: 2,
183
- protectedTools: [ 'protected_tool' ],
312
+ toolCount: 1,
313
+ protectedTools: [ 'tool1' ],
184
314
  agentDid: 'did:key:z6MkhaXgBZDv...',
185
315
  projectId: 'test-project-123',
186
316
  cacheTtlMs: 300000,
187
- cacheExpiresAt: '2025-11-26T07:20:55.822Z'
317
+ cacheExpiresAt: '2025-11-26T15:41:45.318Z'
188
318
  }
189
319
 
190
- 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)
320
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should prefer camelCase over snake_case when both present
191
321
  [ToolProtectionService] Config loaded from API {
192
322
  source: 'api',
193
- toolCount: 2,
194
- protectedTools: [ 'read_repos', 'send_email' ],
323
+ toolCount: 1,
324
+ protectedTools: [ 'tool1' ],
195
325
  agentDid: 'did:key:z6MkhaXgBZDv...',
196
326
  projectId: 'test-project-123',
197
327
  cacheTtlMs: 300000,
198
- cacheExpiresAt: '2025-11-26T07:20:55.822Z'
328
+ cacheExpiresAt: '2025-11-26T15:41:45.318Z'
199
329
  }
200
330
 
201
331
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should preserve oauthProvider through cache operations
@@ -206,18 +336,24 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
206
336
  agentDid: 'did:key:z6MkhaXgBZDv...',
207
337
  projectId: 'test-project-123',
208
338
  cacheTtlMs: 300000,
209
- cacheExpiresAt: '2025-11-26T07:20:55.822Z'
339
+ cacheExpiresAt: '2025-11-26T15:41:45.317Z'
210
340
  }
211
341
 
212
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
213
343
  [ToolProtectionService] Config loaded from API {
214
344
  source: 'api',
345
+ stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Error Handling > should handle network timeout
215
346
  toolCount: 2,
216
347
  protectedTools: [ 'checkout' ],
348
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
217
349
  agentDid: 'did:key:z6MkhaXgBZDv...',
218
350
  projectId: 'none',
219
351
  cacheTtlMs: 300000,
220
- cacheExpiresAt: '2025-11-26T07:20:55.822Z'
352
+
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' }
356
+
221
357
  }
222
358
 
223
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
@@ -228,7 +364,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
228
364
  agentDid: 'did:key:z6MkhaXgBZDv...',
229
365
  projectId: 'none',
230
366
  cacheTtlMs: 300000,
231
- cacheExpiresAt: '2025-11-26T07:20:55.823Z'
367
+ cacheExpiresAt: '2025-11-26T15:41:45.319Z'
232
368
  }
233
369
 
234
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)
@@ -239,7 +375,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
239
375
  agentDid: 'did:key:z6MkhaXgBZDv...',
240
376
  projectId: 'none',
241
377
  cacheTtlMs: 300000,
242
- cacheExpiresAt: '2025-11-26T07:20:55.823Z'
378
+ cacheExpiresAt: '2025-11-26T15:41:45.319Z'
243
379
  }
244
380
 
245
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
@@ -250,7 +386,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
250
386
  agentDid: 'did:key:z6MkhaXgBZDv...',
251
387
  projectId: 'none',
252
388
  cacheTtlMs: 300000,
253
- cacheExpiresAt: '2025-11-26T07:20:55.823Z'
389
+ cacheExpiresAt: '2025-11-26T15:41:45.320Z'
254
390
  }
255
391
 
256
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)
@@ -261,7 +397,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
261
397
  agentDid: 'did:key:z6MkhaXgBZDv...',
262
398
  projectId: 'none',
263
399
  cacheTtlMs: 300000,
264
- cacheExpiresAt: '2025-11-26T07:20:55.823Z'
400
+ cacheExpiresAt: '2025-11-26T15:41:45.320Z'
265
401
  }
266
402
 
267
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
@@ -304,7 +440,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
304
440
  agentDid: 'did:key:z6MkhaXgBZDv...',
305
441
  projectId: 'none',
306
442
  cacheTtlMs: 300000,
307
- cacheExpiresAt: '2025-11-26T07:20:55.824Z'
443
+ cacheExpiresAt: '2025-11-26T15:41:45.321Z'
308
444
  }
309
445
  [ToolProtectionService] API fetch successful, config cached {
310
446
  source: 'cache-write',
@@ -314,54 +450,78 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
314
450
  tools: [ { name: 'valid_tool', requiresDelegation: true, scopeCount: 0 } ],
315
451
  ttlMs: 300000,
316
452
  ttlMinutes: 5,
317
- expiresAt: '2025-11-26T07:20:55.824Z',
453
+ expiresAt: '2025-11-26T15:41:45.321Z',
318
454
  expiresIn: '300s'
319
455
  }
320
456
 
321
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should cache successful API responses
457
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should cache successful API responses
322
458
  [ToolProtectionService] Config loaded from API {
323
459
  source: 'api',
324
460
  toolCount: 1,
325
- stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch error handling > should handle network errors gracefully
326
461
  protectedTools: [ 'tool1' ],
327
462
  agentDid: 'did:key:z6MkhaXgBZDv...',
328
- projectId: 'none',
329
- [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
463
+ projectId: 'test-project-123',
330
464
  cacheTtlMs: 300000,
331
- cacheExpiresAt: '2025-11-26T07:20:55.827Z'
332
- agentDid: 'did:key:z6MkhaXgBZDv...',
465
+ cacheExpiresAt: '2025-11-26T15:41:45.319Z'
333
466
  }
334
467
 
335
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use default cache TTL when not specified
468
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
336
469
  [ToolProtectionService] Config loaded from API {
337
- error: 'ECONNREFUSED',
338
470
  source: 'api',
339
471
  toolCount: 0,
340
- cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
341
472
  protectedTools: [],
473
+ agentDid: 'did:key:z6MkhaXgBZDv...',
474
+ projectId: 'test-project-123',
475
+ cacheTtlMs: 1000,
476
+ cacheExpiresAt: '2025-11-26T15:36:46.320Z'
342
477
  }
343
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) {
481
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should cache successful API responses
482
+ [ToolProtectionService] Config loaded from API {
483
+ source: 'api',
484
+ agentDid: 'did:key:z6MkhaXgBZDv...',
485
+ error: 'ECONNREFUSED',
486
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
487
+ toolCount: 1,
488
+ protectedTools: [ 'tool1' ],
344
489
  agentDid: 'did:key:z6MkhaXgBZDv...',
345
490
  projectId: 'none',
346
491
  cacheTtlMs: 300000,
347
- cacheExpiresAt: '2025-11-26T07:20:55.827Z'
348
492
  }
493
+ cacheExpiresAt: '2025-11-26T15:41:45.324Z'
349
494
 
350
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use custom cache TTL when specified
495
+ }
351
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) {
499
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use default cache TTL when not specified
352
500
  [ToolProtectionService] Config loaded from API {
353
501
  source: 'api',
354
- [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
355
502
  toolCount: 0,
503
+ protectedTools: [],
356
504
  agentDid: 'did:key:z6MkhaXgBZDv...',
505
+ projectId: 'none',
506
+ cacheTtlMs: 300000,
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
+
513
+ }
514
+
515
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use custom cache TTL when specified
516
+ [ToolProtectionService] Config loaded from API {
517
+ source: 'api',
518
+ toolCount: 0,
357
519
  protectedTools: [],
358
520
  agentDid: 'did:key:z6MkhaXgBZDv...',
359
521
  projectId: 'none',
360
522
  cacheTtlMs: 600000,
361
- error: 'Network error',
362
- cacheExpiresAt: '2025-11-26T07:25:55.827Z'
523
+ cacheExpiresAt: '2025-11-26T15:46:45.324Z'
363
524
  }
364
- cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
365
525
 
366
526
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle empty toolProtections object
367
527
  [ToolProtectionService] Config loaded from API {
@@ -371,20 +531,18 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
371
531
  agentDid: 'did:key:z6MkhaXgBZDv...',
372
532
  projectId: 'none',
373
533
  cacheTtlMs: 300000,
374
- }
375
- cacheExpiresAt: '2025-11-26T07:20:55.827Z'
534
+ cacheExpiresAt: '2025-11-26T15:41:45.324Z'
376
535
  }
377
536
 
378
537
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle null requiredScopes
379
538
  [ToolProtectionService] Config loaded from API {
380
-
381
539
  source: 'api',
382
540
  toolCount: 1,
383
541
  protectedTools: [ 'tool1' ],
384
542
  agentDid: 'did:key:z6MkhaXgBZDv...',
385
543
  projectId: 'none',
386
544
  cacheTtlMs: 300000,
387
- cacheExpiresAt: '2025-11-26T07:20:55.827Z'
545
+ cacheExpiresAt: '2025-11-26T15:41:45.324Z'
388
546
  }
389
547
 
390
548
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle mixed camelCase and snake_case in response
@@ -395,7 +553,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
395
553
  agentDid: 'did:key:z6MkhaXgBZDv...',
396
554
  projectId: 'none',
397
555
  cacheTtlMs: 300000,
398
- cacheExpiresAt: '2025-11-26T07:20:55.828Z'
556
+ cacheExpiresAt: '2025-11-26T15:41:45.324Z'
399
557
  }
400
558
 
401
559
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool has no protection
@@ -406,7 +564,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
406
564
  agentDid: 'did:key:z6MkhaXgBZDv...',
407
565
  projectId: 'none',
408
566
  cacheTtlMs: 300000,
409
- cacheExpiresAt: '2025-11-26T07:20:55.828Z'
567
+ cacheExpiresAt: '2025-11-26T15:41:45.325Z'
410
568
  }
411
569
 
412
570
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
@@ -417,7 +575,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
417
575
  agentDid: 'did:key:z6MkhaXgBZDv...',
418
576
  projectId: 'none',
419
577
  cacheTtlMs: 300000,
420
- cacheExpiresAt: '2025-11-26T07:20:55.828Z'
578
+ cacheExpiresAt: '2025-11-26T15:41:45.325Z'
421
579
  }
422
580
 
423
581
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
@@ -438,7 +596,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
438
596
  agentDid: 'did:key:z6MkhaXgBZDv...',
439
597
  projectId: 'none',
440
598
  cacheTtlMs: 300000,
441
- cacheExpiresAt: '2025-11-26T07:20:55.828Z'
599
+ cacheExpiresAt: '2025-11-26T15:41:45.325Z'
442
600
  }
443
601
 
444
602
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
@@ -459,7 +617,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
459
617
  agentDid: 'did:key:z6MkhaXgBZDv...',
460
618
  projectId: 'none',
461
619
  cacheTtlMs: 300000,
462
- cacheExpiresAt: '2025-11-26T07:20:55.828Z'
620
+ cacheExpiresAt: '2025-11-26T15:41:45.325Z'
463
621
  }
464
622
 
465
623
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
@@ -480,7 +638,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
480
638
  agentDid: 'did:key:z6MkhaXgBZDv...',
481
639
  projectId: 'none',
482
640
  cacheTtlMs: 300000,
483
- cacheExpiresAt: '2025-11-26T07:20:55.830Z'
641
+ cacheExpiresAt: '2025-11-26T15:41:45.325Z'
484
642
  }
485
643
 
486
644
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
@@ -501,7 +659,7 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
501
659
  agentDid: 'did:key:z6MkhaXgBZDv...',
502
660
  projectId: 'none',
503
661
  cacheTtlMs: 300000,
504
- cacheExpiresAt: '2025-11-26T07:20:55.831Z'
662
+ cacheExpiresAt: '2025-11-26T15:41:45.326Z'
505
663
  }
506
664
 
507
665
  stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
@@ -512,83 +670,104 @@ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtection
512
670
  agentDid: 'did:key:z6MkhaXgBZDv...',
513
671
  projectId: 'none',
514
672
  cacheTtlMs: 300000,
515
- cacheExpiresAt: '2025-11-26T07:20:55.831Z'
673
+ cacheExpiresAt: '2025-11-26T15:41:45.326Z'
516
674
  }
517
675
 
518
- ✓ src/__tests__/services/tool-protection.service.test.ts (49 tests) 18ms
519
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
520
- [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
521
-
522
- 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
523
- [ProviderResolver] Inferred provider "google" from scopes
524
-
525
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle empty scopes array
526
- 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
527
- [ProviderResolver] Inferred provider "google" from scopes
528
-
529
- 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
530
- [ProviderResolver] Inferred provider "microsoft" from scopes
531
-
532
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
533
- 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
534
-
535
- [ProviderResolver] Inferred provider "github" from scopes
536
-
537
- 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)
538
- 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
539
- [ProviderResolver] Inferred provider "github" from scopes
540
-
541
- stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > configuredProvider behavior (Priority 3) > should prefer scope-inferred provider over configuredProvider
542
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
543
- [ProviderResolver] Inferred provider "google" from scopes
544
-
545
-
546
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle unknown scope prefixes
547
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
548
-
549
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle scopes without colons
550
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
551
-
552
- 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
553
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "google" as fallback. Consider explicitly setting oauthProvider in tool protection config.
554
-
555
- 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
556
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "google" as fallback. Consider explicitly setting oauthProvider in tool protection config.
557
-
558
- 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
559
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
560
-
561
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
562
- ✓ src/delegation/__tests__/delegation-graph.test.ts (28 tests) 6ms
563
- [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/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/storage.service.ts'
564
-
565
- ✓ src/__tests__/services/provider-resolver-edge-cases.test.ts (25 tests | 1 skipped) 7ms
566
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should fall back to memory when Redis connection fails
567
- [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
568
-
569
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should use KV namespace when provided
570
- [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/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/storage.service.ts'
571
-
572
- ✓ src/__tests__/cache/tool-protection-cache.test.ts (49 tests) 159ms
573
- ✓ src/services/__tests__/storage.service.test.ts (17 tests) 37ms
574
- 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
676
+ ✓ src/__tests__/services/tool-protection.service.test.ts (49 tests) 22ms
677
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should submit proofs successfully
575
678
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
576
- correlationId: 'f2f52a13-22a6-4862-8d0a-528780107893',
679
+ correlationId: '2ade6797-2590-481e-aa6f-2215d75b3996',
577
680
  status: 200,
578
- statusText: undefined,
579
- headers: {},
580
- responseTextLength: 191,
581
- 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-26T07:15:56.064Z"}}',
582
- 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-26T07:15:56.064Z"}}'
681
+ statusText: '',
682
+ headers: { 'content-type': 'application/json' },
683
+ responseTextLength: 100,
684
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
685
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
583
686
  }
584
687
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
585
- correlationId: 'f2f52a13-22a6-4862-8d0a-528780107893',
688
+ correlationId: '2ade6797-2590-481e-aa6f-2215d75b3996',
586
689
  status: 200,
587
690
  responseDataType: 'object',
588
- responseDataKeys: [ 'success', 'data', 'metadata' ],
691
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
589
692
  responseData: '{\n' +
590
693
  ' "success": true,\n' +
591
- ' "data": {\n' +
694
+ ' "accepted": 1,\n' +
695
+ ' "rejected": 0,\n' +
696
+ ' "outcomes": {\n' +
697
+ ' "success": 1,\n' +
698
+ ' "failed": 0,\n' +
699
+ ' "blocked": 0,\n' +
700
+ ' "error": 0\n' +
701
+ ' }\n' +
702
+ '}'
703
+ }
704
+ [AccessControl] Raw response received: {
705
+ "success": true,
706
+ "accepted": 1,
707
+ "rejected": 0,
708
+ "outcomes": {
709
+ "success": 1,
710
+ "failed": 0,
711
+ "blocked": 0,
712
+ "error": 0
713
+ }
714
+ }
715
+
716
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle all_proofs_rejected error gracefully
717
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
718
+ correlationId: '60a313a1-6692-43bd-aa37-29fa860cf510',
719
+ status: 400,
720
+ statusText: '',
721
+ headers: { 'content-type': 'application/json' },
722
+ responseTextLength: 209,
723
+ responseTextPreview: '{"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"}}]}}}',
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"}}]}}}'
725
+ }
726
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
727
+ correlationId: '60a313a1-6692-43bd-aa37-29fa860cf510',
728
+ status: 400,
729
+ responseDataType: 'object',
730
+ responseDataKeys: [ 'success', 'error' ],
731
+ responseData: '{\n' +
732
+ ' "success": false,\n' +
733
+ ' "error": {\n' +
734
+ ' "code": "all_proofs_rejected",\n' +
735
+ ' "message": "All proofs rejected",\n' +
736
+ ' "details": {\n' +
737
+ ' "rejected": 1,\n' +
738
+ ' "errors": [\n' +
739
+ ' {\n' +
740
+ ' "proof_index": 0,\n' +
741
+ ' "error": {\n' +
742
+ ' "code": "invalid_signature",\n' +
743
+ ' "message": "Invalid signature"\n' +
744
+ ' }\n' +
745
+ ' }\n' +
746
+ ' ]\n' +
747
+ ' }\n' +
748
+ ' }\n' +
749
+ '}'
750
+ }
751
+
752
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response format
753
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
754
+ correlationId: '8062b77e-6f28-4dac-a624-c3e10c7865d9',
755
+ status: 200,
756
+ statusText: '',
757
+ headers: { 'content-type': 'application/json' },
758
+ responseTextLength: 206,
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"}}'
761
+ }
762
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
763
+ correlationId: '8062b77e-6f28-4dac-a624-c3e10c7865d9',
764
+ status: 200,
765
+ responseDataType: 'object',
766
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
767
+ responseData: '{\n' +
768
+ ' "success": true,\n' +
769
+ ' "data": {\n' +
770
+ ' "success": true,\n' +
592
771
  ' "accepted": 1,\n' +
593
772
  ' "rejected": 0,\n' +
594
773
  ' "outcomes": {\n' +
@@ -600,13 +779,14 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
600
779
  ' },\n' +
601
780
  ' "metadata": {\n' +
602
781
  ' "requestId": "test-request-id",\n' +
603
- ' "timestamp": "2025-11-26T07:15:56.064Z"\n' +
782
+ ' "timestamp": "2025-11-26T15:36:45.371Z"\n' +
604
783
  ' }\n' +
605
784
  '}'
606
785
  }
607
786
  [AccessControl] Raw response received: {
608
787
  "success": true,
609
788
  "data": {
789
+ "success": true,
610
790
  "accepted": 1,
611
791
  "rejected": 0,
612
792
  "outcomes": {
@@ -618,12 +798,12 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
618
798
  },
619
799
  "metadata": {
620
800
  "requestId": "test-request-id",
621
- "timestamp": "2025-11-26T07:15:56.064Z"
801
+ "timestamp": "2025-11-26T15:36:45.371Z"
622
802
  }
623
803
  }
624
804
  [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
625
- correlationId: 'f2f52a13-22a6-4862-8d0a-528780107893',
626
- dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
805
+ correlationId: '8062b77e-6f28-4dac-a624-c3e10c7865d9',
806
+ dataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
627
807
  hasAccepted: true,
628
808
  hasRejected: true,
629
809
  hasOutcomes: true,
@@ -637,6 +817,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
637
817
  errorsType: 'undefined',
638
818
  errorsIsArray: false,
639
819
  fullData: '{\n' +
820
+ ' "success": true,\n' +
640
821
  ' "accepted": 1,\n' +
641
822
  ' "rejected": 0,\n' +
642
823
  ' "outcomes": {\n' +
@@ -648,7 +829,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
648
829
  '}'
649
830
  }
650
831
  [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
651
- correlationId: 'f2f52a13-22a6-4862-8d0a-528780107893',
832
+ correlationId: '8062b77e-6f28-4dac-a624-c3e10c7865d9',
652
833
  dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
653
834
  hasSuccess: true,
654
835
  successValue: true,
@@ -671,235 +852,175 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
671
852
  '}'
672
853
  }
673
854
 
674
- 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
855
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
675
856
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
676
- correlationId: 'd6a0c9c6-d451-45b5-89e9-a509969233c6',
857
+ correlationId: 'd77a977b-42ca-4926-a1a3-8e633c5c215c',
677
858
  status: 200,
678
- statusText: undefined,
679
- headers: {},
680
- responseTextLength: 333,
681
- 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-26T07:15:56.078Z"}}',
682
- 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-26T07:15:56.078Z"}}'
859
+ statusText: '',
860
+ headers: { 'content-type': 'application/json' },
861
+ responseTextLength: 42,
862
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0}',
863
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0}'
683
864
  }
684
865
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
685
- correlationId: 'd6a0c9c6-d451-45b5-89e9-a509969233c6',
866
+ correlationId: 'd77a977b-42ca-4926-a1a3-8e633c5c215c',
686
867
  status: 200,
687
868
  responseDataType: 'object',
688
- responseDataKeys: [ 'success', 'data', 'metadata' ],
689
- responseData: '{\n' +
690
- ' "success": true,\n' +
691
- ' "data": {\n' +
692
- ' "accepted": 0,\n' +
693
- ' "rejected": 1,\n' +
694
- ' "outcomes": {\n' +
695
- ' "success": 0,\n' +
696
- ' "failed": 1,\n' +
697
- ' "blocked": 0,\n' +
698
- ' "error": 0\n' +
699
- ' },\n' +
700
- ' "errors": [\n' +
701
- ' {\n' +
702
- ' "proof_index": 0,\n' +
703
- ' "error": {\n' +
704
- ' "code": "validation_error",\n' +
705
- ' "message": "Proof validation failed",\n' +
706
- ' "details": {\n' +
707
- ' "reason": "invalid_signature"\n' +
708
- ' }\n' +
709
- ' }\n' +
710
- ' }\n' +
711
- ' ]\n' +
712
- ' },\n' +
713
- ' "metadata": {\n' +
714
- ' "requestId": "test-request-id",\n' +
715
- ' "timestamp": "2025-11-26T07:15:56.078Z"\n' +
716
- ' }\n' +
717
- '}'
869
+ responseDataKeys: [ 'success', 'accepted', 'rejected' ],
870
+ responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
718
871
  }
719
872
  [AccessControl] Raw response received: {
720
873
  "success": true,
721
- "data": {
722
- "accepted": 0,
723
- "rejected": 1,
724
- "outcomes": {
725
- "success": 0,
726
- "failed": 1,
727
- "blocked": 0,
728
- "error": 0
729
- },
730
- "errors": [
731
- {
732
- "proof_index": 0,
733
- "error": {
734
- "code": "validation_error",
735
- "message": "Proof validation failed",
736
- "details": {
737
- "reason": "invalid_signature"
738
- }
739
- }
740
- }
741
- ]
742
- },
743
- "metadata": {
744
- "requestId": "test-request-id",
745
- "timestamp": "2025-11-26T07:15:56.078Z"
746
- }
874
+ "accepted": 1,
875
+ "rejected": 0
747
876
  }
748
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
749
- correlationId: 'd6a0c9c6-d451-45b5-89e9-a509969233c6',
750
- dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
751
- hasAccepted: true,
752
- hasRejected: true,
753
- hasOutcomes: true,
754
- hasErrors: true,
755
- acceptedType: 'number',
756
- acceptedValue: 0,
757
- rejectedType: 'number',
758
- rejectedValue: 1,
759
- outcomesType: 'object',
760
- outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
761
- errorsType: 'object',
762
- errorsIsArray: true,
763
- fullData: '{\n' +
764
- ' "accepted": 0,\n' +
765
- ' "rejected": 1,\n' +
766
- ' "outcomes": {\n' +
767
- ' "success": 0,\n' +
768
- ' "failed": 1,\n' +
769
- ' "blocked": 0,\n' +
770
- ' "error": 0\n' +
771
- ' },\n' +
772
- ' "errors": [\n' +
773
- ' {\n' +
774
- ' "proof_index": 0,\n' +
775
- ' "error": {\n' +
776
- ' "code": "validation_error",\n' +
777
- ' "message": "Proof validation failed",\n' +
778
- ' "details": {\n' +
779
- ' "reason": "invalid_signature"\n' +
780
- ' }\n' +
781
- ' }\n' +
782
- ' }\n' +
783
- ' ]\n' +
784
- '}'
877
+
878
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
879
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
880
+ correlationId: 'b57c702a-173c-463c-8a0e-1edc3fc11cb6',
881
+ status: 200,
882
+ statusText: '',
883
+ headers: { 'content-type': 'application/json' },
884
+ responseTextLength: 100,
885
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
886
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
785
887
  }
786
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
787
- correlationId: 'd6a0c9c6-d451-45b5-89e9-a509969233c6',
788
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
789
- hasSuccess: true,
790
- successValue: true,
791
- hasAccepted: true,
792
- acceptedValue: 0,
793
- hasRejected: true,
794
- rejectedValue: 1,
795
- hasOutcomes: true,
796
- outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
797
- fullDataWithSuccess: '{\n' +
888
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
889
+ correlationId: 'b57c702a-173c-463c-8a0e-1edc3fc11cb6',
890
+ status: 200,
891
+ responseDataType: 'object',
892
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
893
+ responseData: '{\n' +
798
894
  ' "success": true,\n' +
799
- ' "accepted": 0,\n' +
800
- ' "rejected": 1,\n' +
895
+ ' "accepted": 1,\n' +
896
+ ' "rejected": 0,\n' +
801
897
  ' "outcomes": {\n' +
802
- ' "success": 0,\n' +
803
- ' "failed": 1,\n' +
898
+ ' "success": 1,\n' +
899
+ ' "failed": 0,\n' +
804
900
  ' "blocked": 0,\n' +
805
901
  ' "error": 0\n' +
806
- ' },\n' +
807
- ' "errors": [\n' +
808
- ' {\n' +
809
- ' "proof_index": 0,\n' +
810
- ' "error": {\n' +
811
- ' "code": "validation_error",\n' +
812
- ' "message": "Proof validation failed",\n' +
813
- ' "details": {\n' +
814
- ' "reason": "invalid_signature"\n' +
815
- ' }\n' +
816
- ' }\n' +
817
- ' }\n' +
818
- ' ]\n' +
902
+ ' }\n' +
819
903
  '}'
820
904
  }
905
+ [AccessControl] Raw response received: {
906
+ "success": true,
907
+ "accepted": 1,
908
+ "rejected": 0,
909
+ "outcomes": {
910
+ "success": 1,
911
+ "failed": 0,
912
+ "blocked": 0,
913
+ "error": 0
914
+ }
915
+ }
821
916
 
822
- 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)
917
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
823
918
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
824
- correlationId: '56d5469c-b0c7-4b7c-abaf-9c61e71784ae',
919
+ correlationId: '9e9878e9-938f-4bd4-b940-aa4cd8626ac8',
825
920
  status: 200,
826
- statusText: undefined,
827
- headers: {},
828
- responseTextLength: 133,
829
- responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T07:15:56.079Z"}}',
830
- fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-26T07:15:56.079Z"}}'
921
+ statusText: '',
922
+ headers: { 'content-type': 'application/json' },
923
+ responseTextLength: 56,
924
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}',
925
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}'
831
926
  }
832
927
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
833
- correlationId: '56d5469c-b0c7-4b7c-abaf-9c61e71784ae',
928
+ correlationId: '9e9878e9-938f-4bd4-b940-aa4cd8626ac8',
834
929
  status: 200,
835
930
  responseDataType: 'object',
836
- responseDataKeys: [ 'success', 'data', 'metadata' ],
837
- responseData: '{\n' +
838
- ' "success": true,\n' +
839
- ' "data": {\n' +
840
- ' "accepted": 1,\n' +
841
- ' "rejected": 0\n' +
842
- ' },\n' +
843
- ' "metadata": {\n' +
844
- ' "requestId": "test-request-id",\n' +
845
- ' "timestamp": "2025-11-26T07:15:56.079Z"\n' +
846
- ' }\n' +
847
- '}'
931
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
932
+ responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0,\n "outcomes": {}\n}'
933
+ }
934
+ [AccessControl] Raw response received: {
935
+ "success": true,
936
+ "accepted": 1,
937
+ "rejected": 0,
938
+ "outcomes": {}
939
+ }
940
+
941
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response with invalid data structure
942
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
943
+ correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
944
+ status: 200,
945
+ statusText: '',
946
+ headers: { 'content-type': 'application/json' },
947
+ responseTextLength: 52,
948
+ responseTextPreview: '{"success":true,"data":{"message":"Invalid format"}}',
949
+ fullResponseText: '{"success":true,"data":{"message":"Invalid format"}}'
950
+ }
951
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
952
+ correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
953
+ status: 200,
954
+ responseDataType: 'object',
955
+ responseDataKeys: [ 'success', 'data' ],
956
+ responseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
848
957
  }
849
958
  [AccessControl] Raw response received: {
850
959
  "success": true,
851
960
  "data": {
852
- "accepted": 1,
853
- "rejected": 0
854
- },
855
- "metadata": {
856
- "requestId": "test-request-id",
857
- "timestamp": "2025-11-26T07:15:56.079Z"
961
+ "message": "Invalid format"
858
962
  }
859
963
  }
860
964
  [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
861
- correlationId: '56d5469c-b0c7-4b7c-abaf-9c61e71784ae',
862
- dataKeys: [ 'accepted', 'rejected' ],
863
- hasAccepted: true,
864
- hasRejected: true,
965
+ correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
966
+ dataKeys: [ 'message' ],
967
+ hasAccepted: false,
968
+ hasRejected: false,
865
969
  hasOutcomes: false,
866
970
  hasErrors: false,
867
- acceptedType: 'number',
868
- acceptedValue: 1,
869
- rejectedType: 'number',
870
- rejectedValue: 0,
971
+ acceptedType: 'undefined',
972
+ acceptedValue: undefined,
973
+ rejectedType: 'undefined',
974
+ rejectedValue: undefined,
871
975
  outcomesType: 'undefined',
872
976
  outcomesValue: undefined,
873
977
  errorsType: 'undefined',
874
978
  errorsIsArray: false,
875
- fullData: '{\n "accepted": 1,\n "rejected": 0\n}'
979
+ fullData: '{\n "message": "Invalid format"\n}'
876
980
  }
877
981
  [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
878
- correlationId: '56d5469c-b0c7-4b7c-abaf-9c61e71784ae',
982
+ correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
879
983
  dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
880
984
  hasSuccess: true,
881
985
  successValue: true,
882
986
  hasAccepted: true,
883
- acceptedValue: 1,
987
+ acceptedValue: undefined,
884
988
  hasRejected: true,
885
- rejectedValue: 0,
989
+ rejectedValue: undefined,
886
990
  hasOutcomes: false,
887
991
  outcomesValue: undefined,
888
- fullDataWithSuccess: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
992
+ fullDataWithSuccess: '{\n "success": true\n}'
993
+ }
994
+ [AccessControl] ❌ MISSING REQUIRED FIELDS AFTER CONSTRUCTION: {
995
+ correlationId: 'd9a82dd8-18d9-4721-b45f-ecb435661533',
996
+ hasAccepted: true,
997
+ acceptedType: 'undefined',
998
+ acceptedValue: undefined,
999
+ hasRejected: true,
1000
+ rejectedType: 'undefined',
1001
+ rejectedValue: undefined,
1002
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
1003
+ fullDataWithSuccess: '{\n "success": true\n}',
1004
+ dataToValidateKeys: [ 'message' ],
1005
+ fullDataToValidate: '{\n "message": "Invalid format"\n}',
1006
+ originalResponseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
889
1007
  }
890
1008
 
891
- 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
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
1011
+
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
892
1013
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
893
- correlationId: '540ef223-90ea-47a5-9a40-a724e2afb745',
1014
+ correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
894
1015
  status: 200,
895
1016
  statusText: undefined,
896
1017
  headers: {},
897
1018
  responseTextLength: 191,
898
- 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-26T07:15:56.087Z"}}',
899
- 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-26T07:15:56.087Z"}}'
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"}}'
900
1021
  }
901
1022
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
902
- correlationId: '540ef223-90ea-47a5-9a40-a724e2afb745',
1023
+ correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
903
1024
  status: 200,
904
1025
  responseDataType: 'object',
905
1026
  responseDataKeys: [ 'success', 'data', 'metadata' ],
@@ -917,7 +1038,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
917
1038
  ' },\n' +
918
1039
  ' "metadata": {\n' +
919
1040
  ' "requestId": "test-request-id",\n' +
920
- ' "timestamp": "2025-11-26T07:15:56.087Z"\n' +
1041
+ ' "timestamp": "2025-11-26T15:36:45.364Z"\n' +
921
1042
  ' }\n' +
922
1043
  '}'
923
1044
  }
@@ -935,11 +1056,11 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
935
1056
  },
936
1057
  "metadata": {
937
1058
  "requestId": "test-request-id",
938
- "timestamp": "2025-11-26T07:15:56.087Z"
1059
+ "timestamp": "2025-11-26T15:36:45.364Z"
939
1060
  }
940
1061
  }
941
1062
  [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
942
- correlationId: '540ef223-90ea-47a5-9a40-a724e2afb745',
1063
+ correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
943
1064
  dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
944
1065
  hasAccepted: true,
945
1066
  hasRejected: true,
@@ -965,7 +1086,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
965
1086
  '}'
966
1087
  }
967
1088
  [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
968
- correlationId: '540ef223-90ea-47a5-9a40-a724e2afb745',
1089
+ correlationId: 'a191bb28-c82e-4b0a-b3b2-4b9afd44abf6',
969
1090
  dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
970
1091
  hasSuccess: true,
971
1092
  successValue: true,
@@ -988,100 +1109,251 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
988
1109
  '}'
989
1110
  }
990
1111
 
991
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should submit proofs successfully
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
992
1113
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
993
- correlationId: '8d6912cd-2c9b-41d8-b0ef-655551b70874',
1114
+ correlationId: '379ba9c2-a249-4004-a797-b65af80d45d0',
994
1115
  status: 200,
995
- statusText: '',
996
- headers: { 'content-type': 'application/json' },
997
- responseTextLength: 100,
998
- responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
999
- fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
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"}}'
1121
+ }
1122
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1123
+ correlationId: '379ba9c2-a249-4004-a797-b65af80d45d0',
1124
+ status: 200,
1125
+ responseDataType: 'object',
1126
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1127
+ responseData: '{\n' +
1128
+ ' "success": true,\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' +
1148
+ ' }\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' +
1155
+ '}'
1156
+ }
1157
+ [AccessControl] Raw response received: {
1158
+ "success": true,
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
+ }
1178
+ }
1179
+ ]
1180
+ },
1181
+ "metadata": {
1182
+ "requestId": "test-request-id",
1183
+ "timestamp": "2025-11-26T15:36:45.376Z"
1184
+ }
1185
+ }
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
+ '}'
1223
+ }
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
+ '}'
1258
+ }
1259
+
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"}}'
1000
1269
  }
1001
1270
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
1002
- correlationId: '8d6912cd-2c9b-41d8-b0ef-655551b70874',
1271
+ correlationId: '4277a869-2b7b-4fd8-a82c-6db33c14ef67',
1003
1272
  status: 200,
1004
1273
  responseDataType: 'object',
1005
- responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1274
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1006
1275
  responseData: '{\n' +
1007
1276
  ' "success": true,\n' +
1008
- ' "accepted": 1,\n' +
1009
- ' "rejected": 0,\n' +
1010
- ' "outcomes": {\n' +
1011
- ' "success": 1,\n' +
1012
- ' "failed": 0,\n' +
1013
- ' "blocked": 0,\n' +
1014
- ' "error": 0\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' +
1015
1284
  ' }\n' +
1016
1285
  '}'
1017
1286
  }
1018
1287
  [AccessControl] Raw response received: {
1019
1288
  "success": true,
1020
- "accepted": 1,
1021
- "rejected": 0,
1022
- "outcomes": {
1023
- "success": 1,
1024
- "failed": 0,
1025
- "blocked": 0,
1026
- "error": 0
1289
+ "data": {
1290
+ "accepted": 1,
1291
+ "rejected": 0
1292
+ },
1293
+ "metadata": {
1294
+ "requestId": "test-request-id",
1295
+ "timestamp": "2025-11-26T15:36:45.377Z"
1027
1296
  }
1028
1297
  }
1029
-
1030
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle all_proofs_rejected error gracefully
1031
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1032
- correlationId: 'b6777e8c-ec6d-402e-8b4e-56485608f489',
1033
- status: 400,
1034
- statusText: '',
1035
- headers: { 'content-type': 'application/json' },
1036
- responseTextLength: 209,
1037
- responseTextPreview: '{"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"}}]}}}',
1038
- 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"}}]}}}'
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}'
1039
1314
  }
1040
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
1041
- correlationId: 'b6777e8c-ec6d-402e-8b4e-56485608f489',
1042
- status: 400,
1043
- responseDataType: 'object',
1044
- responseDataKeys: [ 'success', 'error' ],
1045
- responseData: '{\n' +
1046
- ' "success": false,\n' +
1047
- ' "error": {\n' +
1048
- ' "code": "all_proofs_rejected",\n' +
1049
- ' "message": "All proofs rejected",\n' +
1050
- ' "details": {\n' +
1051
- ' "rejected": 1,\n' +
1052
- ' "errors": [\n' +
1053
- ' {\n' +
1054
- ' "proof_index": 0,\n' +
1055
- ' "error": {\n' +
1056
- ' "code": "invalid_signature",\n' +
1057
- ' "message": "Invalid signature"\n' +
1058
- ' }\n' +
1059
- ' }\n' +
1060
- ' ]\n' +
1061
- ' }\n' +
1062
- ' }\n' +
1063
- '}'
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}'
1064
1327
  }
1065
1328
 
1066
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response format
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'
1331
+
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
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'
1337
+
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
1067
1340
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1068
- correlationId: '7d291946-06f1-49c6-9d19-086a5533b75a',
1341
+ correlationId: 'd99d9059-cc05-4ce7-84f1-7d951e39daac',
1069
1342
  status: 200,
1070
- statusText: '',
1071
- headers: { 'content-type': 'application/json' },
1072
- responseTextLength: 206,
1073
- 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-26T07:15:56.086Z"}}',
1074
- 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-26T07:15:56.086Z"}}'
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"}}'
1075
1348
  }
1076
1349
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
1077
- correlationId: '7d291946-06f1-49c6-9d19-086a5533b75a',
1350
+ correlationId: 'd99d9059-cc05-4ce7-84f1-7d951e39daac',
1078
1351
  status: 200,
1079
1352
  responseDataType: 'object',
1080
1353
  responseDataKeys: [ 'success', 'data', 'metadata' ],
1081
1354
  responseData: '{\n' +
1082
1355
  ' "success": true,\n' +
1083
1356
  ' "data": {\n' +
1084
- ' "success": true,\n' +
1085
1357
  ' "accepted": 1,\n' +
1086
1358
  ' "rejected": 0,\n' +
1087
1359
  ' "outcomes": {\n' +
@@ -1093,14 +1365,13 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
1093
1365
  ' },\n' +
1094
1366
  ' "metadata": {\n' +
1095
1367
  ' "requestId": "test-request-id",\n' +
1096
- ' "timestamp": "2025-11-26T07:15:56.086Z"\n' +
1368
+ ' "timestamp": "2025-11-26T15:36:45.378Z"\n' +
1097
1369
  ' }\n' +
1098
1370
  '}'
1099
1371
  }
1100
1372
  [AccessControl] Raw response received: {
1101
1373
  "success": true,
1102
1374
  "data": {
1103
- "success": true,
1104
1375
  "accepted": 1,
1105
1376
  "rejected": 0,
1106
1377
  "outcomes": {
@@ -1112,12 +1383,12 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
1112
1383
  },
1113
1384
  "metadata": {
1114
1385
  "requestId": "test-request-id",
1115
- "timestamp": "2025-11-26T07:15:56.086Z"
1386
+ "timestamp": "2025-11-26T15:36:45.378Z"
1116
1387
  }
1117
1388
  }
1118
1389
  [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1119
- correlationId: '7d291946-06f1-49c6-9d19-086a5533b75a',
1120
- dataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1390
+ correlationId: 'd99d9059-cc05-4ce7-84f1-7d951e39daac',
1391
+ dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
1121
1392
  hasAccepted: true,
1122
1393
  hasRejected: true,
1123
1394
  hasOutcomes: true,
@@ -1131,7 +1402,6 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
1131
1402
  errorsType: 'undefined',
1132
1403
  errorsIsArray: false,
1133
1404
  fullData: '{\n' +
1134
- ' "success": true,\n' +
1135
1405
  ' "accepted": 1,\n' +
1136
1406
  ' "rejected": 0,\n' +
1137
1407
  ' "outcomes": {\n' +
@@ -1143,7 +1413,7 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
1143
1413
  '}'
1144
1414
  }
1145
1415
  [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1146
- correlationId: '7d291946-06f1-49c6-9d19-086a5533b75a',
1416
+ correlationId: 'd99d9059-cc05-4ce7-84f1-7d951e39daac',
1147
1417
  dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1148
1418
  hasSuccess: true,
1149
1419
  successValue: true,
@@ -1166,95 +1436,9 @@ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlAp
1166
1436
  '}'
1167
1437
  }
1168
1438
 
1169
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
1170
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1171
- correlationId: 'ff3a97a8-ee7e-45ee-999e-8f9c158b55e9',
1172
- status: 200,
1173
- statusText: '',
1174
- headers: { 'content-type': 'application/json' },
1175
- responseTextLength: 42,
1176
- responseTextPreview: '{"success":true,"accepted":1,"rejected":0}',
1177
- fullResponseText: '{"success":true,"accepted":1,"rejected":0}'
1178
- }
1179
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
1180
- correlationId: 'ff3a97a8-ee7e-45ee-999e-8f9c158b55e9',
1181
- status: 200,
1182
- responseDataType: 'object',
1183
- responseDataKeys: [ 'success', 'accepted', 'rejected' ],
1184
- responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
1185
- }
1186
- [AccessControl] Raw response received: {
1187
- "success": true,
1188
- "accepted": 1,
1189
- "rejected": 0
1190
- }
1191
-
1192
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
1193
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1194
- correlationId: 'fd168d0c-30ea-4aed-97f2-c3095d2cf439',
1195
- status: 200,
1196
- statusText: '',
1197
- headers: { 'content-type': 'application/json' },
1198
- responseTextLength: 100,
1199
- responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
1200
- fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
1201
- }
1202
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
1203
- correlationId: 'fd168d0c-30ea-4aed-97f2-c3095d2cf439',
1204
- status: 200,
1205
- responseDataType: 'object',
1206
- responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1207
- responseData: '{\n' +
1208
- ' "success": true,\n' +
1209
- ' "accepted": 1,\n' +
1210
- ' "rejected": 0,\n' +
1211
- ' "outcomes": {\n' +
1212
- ' "success": 1,\n' +
1213
- ' "failed": 0,\n' +
1214
- ' "blocked": 0,\n' +
1215
- ' "error": 0\n' +
1216
- ' }\n' +
1217
- '}'
1218
- }
1219
- [AccessControl] Raw response received: {
1220
- "success": true,
1221
- "accepted": 1,
1222
- "rejected": 0,
1223
- "outcomes": {
1224
- "success": 1,
1225
- "failed": 0,
1226
- "blocked": 0,
1227
- "error": 0
1228
- }
1229
- }
1230
-
1231
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
1232
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1233
- correlationId: '16e61652-db73-4492-b384-f954b9c8f21b',
1234
- status: 200,
1235
- statusText: '',
1236
- headers: { 'content-type': 'application/json' },
1237
- responseTextLength: 56,
1238
- responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}',
1239
- fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}'
1240
- }
1241
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
1242
- correlationId: '16e61652-db73-4492-b384-f954b9c8f21b',
1243
- status: 200,
1244
- responseDataType: 'object',
1245
- responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1246
- responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0,\n "outcomes": {}\n}'
1247
- }
1248
- [AccessControl] Raw response received: {
1249
- "success": true,
1250
- "accepted": 1,
1251
- "rejected": 0,
1252
- "outcomes": {}
1253
- }
1254
-
1255
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
1256
1440
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1257
- correlationId: 'd87cf499-6183-41e1-acbc-5a0828621a62',
1441
+ correlationId: '1720e7cd-d11b-4e5e-a7f3-947163c96fcc',
1258
1442
  status: 200,
1259
1443
  statusText: undefined,
1260
1444
  headers: {},
@@ -1263,7 +1447,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1263
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"}}'
1264
1448
  }
1265
1449
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
1266
- correlationId: 'd87cf499-6183-41e1-acbc-5a0828621a62',
1450
+ correlationId: '1720e7cd-d11b-4e5e-a7f3-947163c96fcc',
1267
1451
  status: 200,
1268
1452
  responseDataType: 'object',
1269
1453
  responseDataKeys: [ 'success', 'data', 'metadata' ],
@@ -1299,7 +1483,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1299
1483
  }
1300
1484
  }
1301
1485
  [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1302
- correlationId: 'd87cf499-6183-41e1-acbc-5a0828621a62',
1486
+ correlationId: '1720e7cd-d11b-4e5e-a7f3-947163c96fcc',
1303
1487
  dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1304
1488
  hasAccepted: true,
1305
1489
  hasRejected: true,
@@ -1323,7 +1507,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1323
1507
  '}'
1324
1508
  }
1325
1509
  [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1326
- correlationId: 'd87cf499-6183-41e1-acbc-5a0828621a62',
1510
+ correlationId: '1720e7cd-d11b-4e5e-a7f3-947163c96fcc',
1327
1511
  dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1328
1512
  hasSuccess: true,
1329
1513
  successValue: true,
@@ -1346,16 +1530,16 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1346
1530
 
1347
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)
1348
1532
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1349
- correlationId: 'e25d533e-bdd8-422c-a03d-26a254ad76eb',
1533
+ correlationId: 'a503dfd0-d743-4265-b852-8651f811be47',
1350
1534
  status: 200,
1351
1535
  statusText: undefined,
1352
1536
  headers: {},
1353
1537
  responseTextLength: 151,
1354
- responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-11-26T07:15:56.091Z"}}',
1355
- fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-11-26T07:15:56.091Z"}}'
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"}}'
1356
1540
  }
1357
1541
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
1358
- correlationId: 'e25d533e-bdd8-422c-a03d-26a254ad76eb',
1542
+ correlationId: 'a503dfd0-d743-4265-b852-8651f811be47',
1359
1543
  status: 200,
1360
1544
  responseDataType: 'object',
1361
1545
  responseDataKeys: [ 'success', 'data', 'metadata' ],
@@ -1369,7 +1553,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1369
1553
  ' },\n' +
1370
1554
  ' "metadata": {\n' +
1371
1555
  ' "requestId": "test-id",\n' +
1372
- ' "timestamp": "2025-11-26T07:15:56.091Z"\n' +
1556
+ ' "timestamp": "2025-11-26T15:36:45.380Z"\n' +
1373
1557
  ' }\n' +
1374
1558
  '}'
1375
1559
  }
@@ -1383,11 +1567,11 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1383
1567
  },
1384
1568
  "metadata": {
1385
1569
  "requestId": "test-id",
1386
- "timestamp": "2025-11-26T07:15:56.091Z"
1570
+ "timestamp": "2025-11-26T15:36:45.380Z"
1387
1571
  }
1388
1572
  }
1389
1573
  [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1390
- correlationId: 'e25d533e-bdd8-422c-a03d-26a254ad76eb',
1574
+ correlationId: 'a503dfd0-d743-4265-b852-8651f811be47',
1391
1575
  dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1392
1576
  hasAccepted: true,
1393
1577
  hasRejected: true,
@@ -1404,7 +1588,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1404
1588
  fullData: '{\n "accepted": 0,\n "rejected": 0,\n "outcomes": {},\n "errors": []\n}'
1405
1589
  }
1406
1590
  [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1407
- correlationId: 'e25d533e-bdd8-422c-a03d-26a254ad76eb',
1591
+ correlationId: 'a503dfd0-d743-4265-b852-8651f811be47',
1408
1592
  dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1409
1593
  hasSuccess: true,
1410
1594
  successValue: true,
@@ -1425,16 +1609,16 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1425
1609
 
1426
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
1427
1611
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1428
- correlationId: 'bb898aaa-351c-4d45-a370-193a5853f881',
1612
+ correlationId: '92b20f95-5715-4269-a897-5091058dfb43',
1429
1613
  status: 200,
1430
1614
  statusText: undefined,
1431
1615
  headers: {},
1432
1616
  responseTextLength: 278,
1433
- 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-26T07:15:56.092Z"}}',
1434
- 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-26T07:15:56.092Z"}}'
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"}}'
1435
1619
  }
1436
1620
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
1437
- correlationId: 'bb898aaa-351c-4d45-a370-193a5853f881',
1621
+ correlationId: '92b20f95-5715-4269-a897-5091058dfb43',
1438
1622
  status: 200,
1439
1623
  responseDataType: 'object',
1440
1624
  responseDataKeys: [ 'success', 'data', 'metadata' ],
@@ -1461,7 +1645,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1461
1645
  ' },\n' +
1462
1646
  ' "metadata": {\n' +
1463
1647
  ' "requestId": "test-id",\n' +
1464
- ' "timestamp": "2025-11-26T07:15:56.092Z"\n' +
1648
+ ' "timestamp": "2025-11-26T15:36:45.381Z"\n' +
1465
1649
  ' }\n' +
1466
1650
  '}'
1467
1651
  }
@@ -1488,11 +1672,11 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1488
1672
  },
1489
1673
  "metadata": {
1490
1674
  "requestId": "test-id",
1491
- "timestamp": "2025-11-26T07:15:56.092Z"
1675
+ "timestamp": "2025-11-26T15:36:45.381Z"
1492
1676
  }
1493
1677
  }
1494
1678
  [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1495
- correlationId: 'bb898aaa-351c-4d45-a370-193a5853f881',
1679
+ correlationId: '92b20f95-5715-4269-a897-5091058dfb43',
1496
1680
  dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1497
1681
  hasAccepted: true,
1498
1682
  hasRejected: true,
@@ -1527,7 +1711,7 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1527
1711
  '}'
1528
1712
  }
1529
1713
  [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1530
- correlationId: 'bb898aaa-351c-4d45-a370-193a5853f881',
1714
+ correlationId: '92b20f95-5715-4269-a897-5091058dfb43',
1531
1715
  dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1532
1716
  hasSuccess: true,
1533
1717
  successValue: true,
@@ -1559,236 +1743,24 @@ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts
1559
1743
  '}'
1560
1744
  }
1561
1745
 
1562
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response with invalid data structure
1563
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1564
- correlationId: 'a4376e3b-98a6-4da6-824f-4d643923ab8a',
1565
- status: 200,
1566
- statusText: '',
1567
- headers: { 'content-type': 'application/json' },
1568
- responseTextLength: 52,
1569
- responseTextPreview: '{"success":true,"data":{"message":"Invalid format"}}',
1570
- fullResponseText: '{"success":true,"data":{"message":"Invalid format"}}'
1571
- }
1572
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
1573
- correlationId: 'a4376e3b-98a6-4da6-824f-4d643923ab8a',
1574
- status: 200,
1575
- responseDataType: 'object',
1576
- responseDataKeys: [ 'success', 'data' ],
1577
- responseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
1578
- }
1579
- [AccessControl] Raw response received: {
1580
- "success": true,
1581
- "data": {
1582
- "message": "Invalid format"
1583
- }
1584
- }
1585
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1586
- correlationId: 'a4376e3b-98a6-4da6-824f-4d643923ab8a',
1587
- dataKeys: [ 'message' ],
1588
- hasAccepted: false,
1589
- hasRejected: false,
1590
- hasOutcomes: false,
1591
- hasErrors: false,
1592
- acceptedType: 'undefined',
1593
- acceptedValue: undefined,
1594
- rejectedType: 'undefined',
1595
- rejectedValue: undefined,
1596
- outcomesType: 'undefined',
1597
- outcomesValue: undefined,
1598
- errorsType: 'undefined',
1599
- errorsIsArray: false,
1600
- fullData: '{\n "message": "Invalid format"\n}'
1601
- }
1602
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1603
- correlationId: 'a4376e3b-98a6-4da6-824f-4d643923ab8a',
1604
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
1605
- hasSuccess: true,
1606
- successValue: true,
1607
- hasAccepted: true,
1608
- acceptedValue: undefined,
1609
- hasRejected: true,
1610
- rejectedValue: undefined,
1611
- hasOutcomes: false,
1612
- outcomesValue: undefined,
1613
- fullDataWithSuccess: '{\n "success": true\n}'
1614
- }
1615
- [AccessControl] ❌ MISSING REQUIRED FIELDS AFTER CONSTRUCTION: {
1616
- correlationId: 'a4376e3b-98a6-4da6-824f-4d643923ab8a',
1617
- hasAccepted: true,
1618
- acceptedType: 'undefined',
1619
- acceptedValue: undefined,
1620
- hasRejected: true,
1621
- rejectedType: 'undefined',
1622
- rejectedValue: undefined,
1623
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
1624
- fullDataWithSuccess: '{\n "success": true\n}',
1625
- dataToValidateKeys: [ 'message' ],
1626
- fullDataToValidate: '{\n "message": "Invalid format"\n}',
1627
- originalResponseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
1628
- }
1629
-
1630
- ✓ src/services/__tests__/access-control.proof-response-validation.test.ts (12 tests) 29ms
1631
- ✓ src/services/__tests__/access-control.service.test.ts (23 tests) 61ms
1632
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyEd25519 > should return false on verification error
1633
- [CryptoService] Ed25519 verification error: Error: Verification failed
1634
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:62:9
1635
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1636
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1637
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1638
- at new Promise (<anonymous>)
1639
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1640
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1641
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1642
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
1643
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
1644
-
1645
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject invalid JWK format
1646
- [CryptoService] Invalid Ed25519 JWK format
1647
-
1648
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong kty
1649
- [CryptoService] Invalid Ed25519 JWK format
1650
-
1651
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong crv
1652
- [CryptoService] Invalid Ed25519 JWK format
1653
-
1654
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with missing x field
1655
- [CryptoService] Invalid Ed25519 JWK format
1656
-
1657
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with empty x field
1658
- [CryptoService] Invalid Ed25519 JWK format
1659
-
1660
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject malformed JWS
1661
- [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'ž', "ž‹" is not valid JSON
1662
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
1663
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1664
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:230:42
1665
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1666
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1667
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1668
- at new Promise (<anonymous>)
1669
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1670
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1671
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1672
-
1673
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject non-EdDSA algorithms
1674
- [CryptoService] Unsupported algorithm: RS256, expected EdDSA
1675
-
1676
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject HS256 algorithm
1677
- [CryptoService] Unsupported algorithm: HS256, expected EdDSA
1678
-
1679
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle empty JWS components
1680
- [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected end of JSON input
1681
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
1682
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1683
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:271:42
1684
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1685
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1686
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1687
- at new Promise (<anonymous>)
1688
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1689
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1690
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1691
-
1692
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - single part
1693
- [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
1694
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
1695
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1696
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:279:42
1697
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1698
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1699
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1700
- at new Promise (<anonymous>)
1701
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1702
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1703
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1704
-
1705
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - two parts
1706
- [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
1707
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
1708
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1709
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:287:42
1710
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1711
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1712
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1713
- at new Promise (<anonymous>)
1714
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1715
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1716
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1717
-
1718
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - four parts
1719
- [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
1720
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
1721
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1722
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:302:42
1723
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1724
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1725
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1726
- at new Promise (<anonymous>)
1727
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1728
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1729
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1730
-
1731
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid JSON header
1732
- [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'o', "notjson" is not valid JSON
1733
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
1734
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1735
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:316:42
1736
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1737
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1738
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1739
- at new Promise (<anonymous>)
1740
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1741
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1742
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1743
-
1744
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid base64
1745
- [CryptoService] Invalid JWS format: Error: Invalid payload base64: Invalid base64url string: Invalid character
1746
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:107:15)
1747
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1748
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:334:42
1749
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1750
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1751
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1752
- at new Promise (<anonymous>)
1753
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1754
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1755
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1756
-
1757
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate expectedKid option
1758
- [CryptoService] Key ID mismatch
1759
-
1760
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate alg option
1761
- [CryptoService] Unsupported algorithm: EdDSA, expected RS256
1762
-
1763
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate Ed25519 key length
1764
- [CryptoService] Failed to extract public key: Error: Invalid Ed25519 public key length: 5
1765
- at CryptoService.jwkToBase64PublicKey (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:295:13)
1766
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:249:32)
1767
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:398:42
1768
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1769
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1770
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1771
- at new Promise (<anonymous>)
1772
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1773
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1774
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1775
-
1776
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle signature verification error
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
1777
1749
  [CryptoService] Ed25519 verification error: Error: Crypto error
1778
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:449:61
1779
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1780
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1781
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
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
1782
1754
  at new Promise (<anonymous>)
1783
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1784
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1785
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1786
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
1787
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
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)
1788
1760
 
1789
1761
  stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should submit proof end-to-end
1790
1762
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1791
- correlationId: '5ceb3d4b-1c70-423f-ae9a-ff38449a03fc',
1763
+ correlationId: '5be6f8ae-ee53-4b5f-a627-da78df1494fb',
1792
1764
  status: 200,
1793
1765
  statusText: '',
1794
1766
  headers: { 'content-type': 'application/json' },
@@ -1797,7 +1769,7 @@ stderr | src/services/__tests__/access-control.integration.test.ts > AccessContr
1797
1769
  fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
1798
1770
  }
1799
1771
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
1800
- correlationId: '5ceb3d4b-1c70-423f-ae9a-ff38449a03fc',
1772
+ correlationId: '5be6f8ae-ee53-4b5f-a627-da78df1494fb',
1801
1773
  status: 200,
1802
1774
  responseDataType: 'object',
1803
1775
  responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
@@ -1827,7 +1799,7 @@ stderr | src/services/__tests__/access-control.integration.test.ts > AccessContr
1827
1799
 
1828
1800
  stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should handle proof submission with errors
1829
1801
  [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1830
- correlationId: 'f1d41965-80f2-45ea-b4d0-56cd455af47a',
1802
+ correlationId: '1ceb40b1-e915-4474-97ee-d103432d8f85',
1831
1803
  status: 200,
1832
1804
  statusText: '',
1833
1805
  headers: { 'content-type': 'application/json' },
@@ -1836,7 +1808,7 @@ stderr | src/services/__tests__/access-control.integration.test.ts > AccessContr
1836
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"}}]}'
1837
1809
  }
1838
1810
  [AccessControl] 🔍 PARSED RESPONSE DATA: {
1839
- correlationId: 'f1d41965-80f2-45ea-b4d0-56cd455af47a',
1811
+ correlationId: '1ceb40b1-e915-4474-97ee-d103432d8f85',
1840
1812
  status: 200,
1841
1813
  responseDataType: 'object',
1842
1814
  responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
@@ -1885,75 +1857,87 @@ stderr | src/services/__tests__/access-control.integration.test.ts > AccessContr
1885
1857
  stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Verification Flow > should verify proof using ProofVerifier
1886
1858
  [CryptoService] Key ID mismatch
1887
1859
 
1860
+ ✓ src/__tests__/cache/tool-protection-cache.test.ts (49 tests) 210ms
1861
+ ✓ src/__tests__/runtime/base.test.ts (55 tests) 35ms
1888
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' ],
1889
1867
  [MCP-I] Checking tool protection: {
1890
1868
  tool: 'unprotectedTool',
1891
1869
  agentDid: 'did:key:zmock123...',
1870
+ resumeToken: 'resume_gxa3v_mig63sgc',
1871
+ agentDid: 'did:key:zmock123...',
1892
1872
  hasDelegation: false
1893
1873
  }
1894
1874
 
1895
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
1896
1880
  [MCP-I] Tool protection check passed (no delegation required) {
1897
1881
  tool: 'unprotectedTool',
1882
+ [MCP-I] ❌ Delegation verification FAILED {
1898
1883
  agentDid: 'did:key:zmock123...',
1899
1884
  reason: 'Tool not configured to require delegation'
1900
1885
  }
1901
1886
 
1887
+ tool: 'protectedTool',
1902
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
1903
1889
  [MCP-I] Checking tool protection: {
1890
+ agentDid: 'did:key:zmock123...',
1904
1891
  tool: 'protectedTool',
1905
1892
  agentDid: 'did:key:zmock123...',
1906
1893
  hasDelegation: false
1894
+ reason: 'Delegation token expired',
1907
1895
  }
1908
1896
 
1897
+ errorCode: undefined,
1909
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,
1910
1900
  [MCP-I] Checking tool protection: {
1911
- 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
1912
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1913
- tool: 'protectedTool',
1914
- agentDid: 'did:key:zmock123...',
1915
1901
  tool: 'protectedTool',
1916
- requiredScopes: [ 'files:write' ],
1917
1902
  agentDid: 'did:key:zmock123...',
1918
1903
  hasDelegation: true
1904
+ requiredScopes: [ 'files:write' ]
1905
+ }
1919
1906
  }
1920
- resumeToken: 'resume_5vmfma_mifo7q9i',
1921
1907
 
1922
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_5vmfma_mifo7q9i'
1923
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
1924
1909
  [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1925
1910
  tool: 'protectedTool',
1926
- }
1927
1911
  agentDid: 'did:key:zmock123...',
1928
-
1929
- 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
1930
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
1931
1915
  hasConsentProof: false,
1932
1916
  [MCP-I] ❌ Delegation verification FAILED {
1933
1917
  requiredScopes: [ 'files:write' ]
1934
- tool: 'protectedTool',
1935
1918
  }
1936
1919
 
1937
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
1938
- agentDid: 'did:key:zmock123...',
1939
- reason: 'Delegation token expired',
1940
1921
  [MCP-I] ✅ Delegation verification SUCCEEDED {
1941
1922
  tool: 'protectedTool',
1942
- errorCode: undefined,
1943
- errorMessage: undefined,
1944
- requiredScopes: [ 'files:write' ]
1923
+ tool: 'protectedTool',
1945
1924
  agentDid: 'did:key:zmock123...',
1925
+ agentDid: 'did:key:zmock123...',
1926
+ reason: 'Insufficient scopes',
1946
1927
  delegationId: 'test-delegation-id',
1947
1928
  credentialScopes: [ 'files:write' ],
1929
+ errorCode: undefined,
1948
1930
  requiredScopes: [ 'files:write' ]
1949
1931
  }
1932
+ errorMessage: undefined,
1933
+ requiredScopes: [ 'files:write' ]
1950
1934
 
1951
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
1952
- }
1953
-
1954
1936
  [MCP-I] Checking tool protection: {
1955
1937
  tool: 'protectedTool',
1956
1938
  agentDid: 'did:key:zmock123...',
1939
+ }
1940
+
1957
1941
  hasDelegation: true
1958
1942
  }
1959
1943
 
@@ -1991,37 +1975,28 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
1991
1975
  requiredScopes: [ 'files:write' ]
1992
1976
  }
1993
1977
 
1994
- 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
1995
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
1996
1979
  [MCP-I] Checking tool protection: {
1997
- [MCP-I] ❌ Delegation verification FAILED {
1998
- tool: 'protectedTool',
1999
1980
  tool: 'protectedTool',
2000
1981
  agentDid: 'did:key:zmock123...',
2001
1982
  hasDelegation: true
2002
- agentDid: 'did:key:zmock123...',
2003
- reason: 'Insufficient scopes',
2004
1983
  }
2005
- errorCode: undefined,
2006
1984
 
2007
- errorMessage: undefined,
2008
- requiredScopes: [ 'files:write' ]
2009
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
2010
- }
2011
-
2012
1986
  [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2013
1987
  tool: 'protectedTool',
2014
1988
  agentDid: 'did:key:zmock123...',
2015
1989
  hasDelegationToken: true,
2016
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
2017
1990
  hasConsentProof: false,
2018
1991
  requiredScopes: [ 'files:write' ]
2019
1992
  }
2020
1993
 
1994
+ ✓ src/services/__tests__/proof-verifier.test.ts (21 tests) 31ms
2021
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
2022
1996
  [MCP-I] Checking tool protection: {
2023
1997
  tool: 'protectedTool',
2024
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
2025
2000
  hasDelegation: true
2026
2001
  }
2027
2002
 
@@ -2029,134 +2004,118 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
2029
2004
  [MCP-I] ❌ Delegation verification error (API failure) {
2030
2005
  [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2031
2006
  tool: 'protectedTool',
2032
- agentDid: 'did:key:zmock123...',
2033
2007
  tool: 'protectedTool',
2034
- hasDelegationToken: true,
2035
2008
  agentDid: 'did:key:zmock123...',
2009
+ agentDid: 'did:key:zmock123...',
2010
+ hasDelegationToken: true,
2036
2011
  hasConsentProof: false,
2037
2012
  errorCode: 'network_error',
2038
2013
  requiredScopes: [ 'files:write' ]
2039
- errorMessage: 'API unavailable',
2040
- errorDetails: {}
2041
2014
  }
2015
+ errorMessage: 'API unavailable',
2042
2016
 
2017
+ errorDetails: {}
2043
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)
2044
- }
2045
2019
  [MCP-I] Checking tool protection: {
2046
2020
  tool: 'protectedTool',
2047
2021
  agentDid: 'did:key:zmock123...',
2048
2022
  hasDelegation: true
2049
2023
  }
2050
2024
 
2025
+ }
2026
+
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
2033
+ }
2034
+
2051
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
2052
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
2053
2038
  tool: 'protectedTool',
2054
2039
  agentDid: 'did:key:zmock123...',
2040
+ [MCP-I] 🔒 SECURITY: User identifier validation FAILED {
2055
2041
  hasDelegation: true
2056
2042
  }
2043
+ tool: 'protectedTool',
2057
2044
 
2045
+ agentDid: 'did:key:zmock123...',
2046
+ delegationUserIdentifier: 'did:key:zUserB987654...',
2058
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
2059
2048
  [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2060
-
2061
2049
  tool: 'protectedTool',
2050
+ sessionUserDid: 'did:key:zUserA123456...',
2051
+ sessionId: 'session123...',
2052
+ reason: 'user_identifier_mismatch',
2053
+ severity: 'high'
2062
2054
  agentDid: 'did:key:zmock123...',
2063
- 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)
2064
- [MCP-I] ⚠️ Delegation token provided but AccessControlApiService not configured - skipping verification {
2055
+ }
2065
2056
  hasDelegationToken: true,
2066
- tool: 'protectedTool',
2057
+
2067
2058
  hasConsentProof: false,
2068
2059
  requiredScopes: [ 'files:write' ]
2069
- agentDid: 'did:key:zmock123...',
2070
- hasDelegationToken: true,
2071
- hasConsentProof: false
2072
- }
2073
-
2074
- 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
2075
- [MCP-I] 🔒 SECURITY: User identifier validation FAILED {
2076
2060
  }
2077
2061
 
2078
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
2079
2063
  [MCP-I] Checking tool protection: {
2080
2064
  tool: 'protectedTool',
2081
2065
  agentDid: 'did:key:zmock123...',
2082
- tool: 'protectedTool',
2083
- agentDid: 'did:key:zmock123...',
2084
- delegationUserIdentifier: 'did:key:zUserB987654...',
2085
2066
  hasDelegation: true
2086
2067
  }
2087
2068
 
2088
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
2089
2070
  [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2090
2071
  tool: 'protectedTool',
2091
- sessionUserDid: 'did:key:zUserA123456...',
2092
2072
  agentDid: 'did:key:zmock123...',
2093
2073
  hasDelegationToken: true,
2094
2074
  hasConsentProof: false,
2095
- sessionId: 'session123...',
2096
2075
  requiredScopes: [ 'files:write' ]
2097
- reason: 'user_identifier_mismatch',
2098
2076
  }
2099
- severity: 'high'
2100
2077
 
2101
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
2102
2079
  [MCP-I] ✅ User identifier validation PASSED {
2103
2080
  tool: 'protectedTool',
2104
2081
  agentDid: 'did:key:zmock123...',
2105
2082
  userDid: 'did:key:zUserA123456...',
2106
- }
2107
-
2108
2083
  sessionId: 'session123...'
2109
2084
  }
2110
2085
  [MCP-I] ✅ Delegation verification SUCCEEDED {
2111
- 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
2112
2086
  tool: 'protectedTool',
2113
2087
  agentDid: 'did:key:zmock123...',
2114
2088
  delegationId: 'test-delegation-id',
2115
- [MCP-I] ⚠️ Delegation has user_identifier but session missing userDid {
2116
2089
  credentialScopes: [ 'files:write' ],
2117
2090
  requiredScopes: [ 'files:write' ]
2118
2091
  }
2119
- tool: 'protectedTool',
2120
- agentDid: 'did:key:zmock123...',
2121
- delegationUserIdentifier: 'did:key:zUserA123456...',
2122
- sessionId: 'session123...'
2123
- }
2124
2092
 
2125
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)
2126
2094
  [MCP-I] Checking tool protection: {
2127
2095
  tool: 'protectedTool',
2128
2096
  agentDid: 'did:key:zmock123...',
2129
2097
  hasDelegation: true
2130
-
2131
2098
  }
2132
2099
 
2133
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)
2134
2101
  [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2135
2102
  tool: 'protectedTool',
2136
2103
  agentDid: 'did:key:zmock123...',
2137
- 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
2138
2104
  hasDelegationToken: true,
2139
2105
  hasConsentProof: false,
2140
2106
  requiredScopes: [ 'files:write' ]
2141
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
2142
2107
  }
2143
- tool: 'protectedTool',
2144
- requiredScopes: [ 'files:write' ],
2145
2108
 
2146
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)
2147
2110
  [MCP-I] ✅ Delegation verification SUCCEEDED {
2148
- agentDid: 'did:key:zmock123...',
2149
2111
  tool: 'protectedTool',
2150
2112
  agentDid: 'did:key:zmock123...',
2151
2113
  delegationId: 'test-delegation-id',
2152
- resumeToken: 'resume_5vmfql_mifo7q9n',
2153
2114
  credentialScopes: [ 'files:write' ],
2154
2115
  requiredScopes: [ 'files:write' ]
2155
2116
  }
2156
2117
 
2157
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_5vmfql_mifo7q9n'
2158
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
2159
- }
2160
2119
  [MCP-I] Checking tool protection: {
2161
2120
  tool: 'protectedTool',
2162
2121
  agentDid: 'did:key:zmock123...',
@@ -2165,25 +2124,32 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
2165
2124
 
2166
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
2167
2126
  [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2168
-
2169
2127
  tool: 'protectedTool',
2170
2128
  agentDid: 'did:key:zmock123...',
2171
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
2172
2131
  hasConsentProof: false,
2173
2132
  requiredScopes: [ 'files:write' ]
2174
2133
  }
2134
+ [MCP-I] ⚠️ Delegation has user_identifier but session missing userDid {
2175
2135
 
2176
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...',
2177
2140
  [MCP-I] ✅ Delegation verification SUCCEEDED {
2178
2141
  tool: 'protectedTool',
2179
2142
  agentDid: 'did:key:zmock123...',
2180
2143
  delegationId: 'test-delegation-id',
2181
2144
  credentialScopes: [ 'files:write' ],
2145
+ sessionId: 'session123...'
2182
2146
  requiredScopes: [ 'files:write' ]
2183
2147
  }
2184
2148
 
2185
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
2186
2150
  [MCP-I] Checking tool protection: {
2151
+ }
2152
+
2187
2153
  tool: 'unprotectedTool',
2188
2154
  agentDid: 'did:key:zmock123...',
2189
2155
  hasDelegation: false
@@ -2203,6 +2169,7 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
2203
2169
  hasDelegation: false
2204
2170
  }
2205
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
2206
2173
  stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
2207
2174
  [MCP-I] Checking tool protection: {
2208
2175
  tool: 'protectedTool',
@@ -2210,101 +2177,108 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
2210
2177
  hasDelegation: false
2211
2178
  }
2212
2179
 
2213
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
2214
- [MCP-I] Checking tool protection: {
2180
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2215
2181
  tool: 'protectedTool',
2182
+ requiredScopes: [ 'files:write' ],
2216
2183
  agentDid: 'did:key:zmock123...',
2217
- hasDelegation: false
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'
2218
2186
  }
2219
2187
 
2220
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
2221
- [MCP-I] Checking tool protection: {
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 {
2222
2190
  tool: 'protectedTool',
2191
+ requiredScopes: [ 'files:write' ],
2223
2192
  agentDid: 'did:key:zmock123...',
2224
- hasDelegation: false
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'
2225
2195
  }
2226
2196
 
2227
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
2197
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
2228
2198
  [MCP-I] Checking tool protection: {
2229
2199
  tool: 'protectedTool',
2230
2200
  agentDid: 'did:key:zmock123...',
2231
2201
  hasDelegation: false
2232
2202
  }
2233
2203
 
2234
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
2235
- [MCP-I] Checking tool protection: {
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 {
2236
2206
  tool: 'protectedTool',
2207
+ requiredScopes: [ 'files:write', 'files:read' ],
2237
2208
  agentDid: 'did:key:zmock123...',
2238
- hasDelegation: false
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'
2239
2211
  }
2240
2212
 
2241
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
2213
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
2242
2214
  [MCP-I] Checking tool protection: {
2243
- tool: 'testTool',
2215
+ tool: 'protectedTool',
2244
2216
  agentDid: 'did:key:zmock123...',
2245
2217
  hasDelegation: false
2246
2218
  }
2247
2219
 
2248
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
2249
- [MCP-I] Tool protection check passed (no delegation required) {
2250
- tool: 'testTool',
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' ],
2251
2224
  agentDid: 'did:key:zmock123...',
2252
- reason: 'Tool not configured to require delegation'
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'
2253
2227
  }
2254
2228
 
2255
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log blocked tool call when audit enabled
2229
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
2256
2230
  [MCP-I] Checking tool protection: {
2257
2231
  tool: 'protectedTool',
2258
2232
  agentDid: 'did:key:zmock123...',
2259
2233
  hasDelegation: false
2260
2234
  }
2261
2235
 
2262
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
2236
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
2263
2237
  [MCP-I] BLOCKED: Tool requires delegation but none provided {
2264
2238
  tool: 'protectedTool',
2265
2239
  requiredScopes: [ 'files:write' ],
2266
2240
  agentDid: 'did:key:zmock123...',
2267
- resumeToken: 'resume_5vmg9j_mifo7q9o',
2268
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_5vmg9j_mifo7q9o'
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'
2269
2243
  }
2270
2244
 
2271
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
2272
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
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: {
2273
2247
  tool: 'protectedTool',
2274
- requiredScopes: [ 'files:write', 'files:read' ],
2275
2248
  agentDid: 'did:key:zmock123...',
2276
- resumeToken: 'resume_5vmg9j_mifo7q9o',
2277
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite%2Cfiles%3Aread&session_id=session123&agent_did=&resume_token=resume_5vmg9j_mifo7q9o'
2249
+ hasDelegation: false
2278
2250
  }
2279
2251
 
2280
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
2252
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
2281
2253
  [MCP-I] BLOCKED: Tool requires delegation but none provided {
2282
2254
  tool: 'protectedTool',
2283
2255
  requiredScopes: [ 'files:write' ],
2284
2256
  agentDid: 'did:key:zmock123...',
2285
- resumeToken: 'resume_5vmg9j_mifo7q9o',
2286
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_5vmg9j_mifo7q9o'
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'
2287
2259
  }
2288
2260
 
2289
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
2290
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
2291
- tool: 'protectedTool',
2292
- requiredScopes: [ 'files:write' ],
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',
2293
2264
  agentDid: 'did:key:zmock123...',
2294
- resumeToken: 'resume_5vmg9j_mifo7q9o',
2295
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_5vmg9j_mifo7q9o'
2265
+ hasDelegation: false
2296
2266
  }
2297
2267
 
2298
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
2299
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
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: {
2300
2277
  tool: 'protectedTool',
2301
- requiredScopes: [ 'files:write' ],
2302
2278
  agentDid: 'did:key:zmock123...',
2303
- resumeToken: 'resume_m2cnhu_mifo7q9o',
2304
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_m2cnhu_mifo7q9o'
2279
+ hasDelegation: false
2305
2280
  }
2306
2281
 
2307
- ✓ src/__tests__/runtime/base-extensions.test.ts (38 tests) 10ms
2308
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
2309
2283
  [MCP-I] Checking tool protection: {
2310
2284
  tool: 'testTool',
@@ -2326,7 +2300,6 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
2326
2300
  hasDelegation: false
2327
2301
  }
2328
2302
 
2329
- ✓ src/services/__tests__/crypto.service.test.ts (34 tests) 12ms
2330
2303
  stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
2331
2304
  [MCP-I] Checking tool protection: {
2332
2305
  tool: 'protectedTool',
@@ -2339,8 +2312,8 @@ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
2339
2312
  tool: 'protectedTool',
2340
2313
  requiredScopes: [],
2341
2314
  agentDid: 'did:key:zmock123...',
2342
- resumeToken: 'resume_5vmgb9_mifo7q9q',
2343
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=&session_id=session123&agent_did=&resume_token=resume_5vmgb9_mifo7q9q'
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'
2344
2317
  }
2345
2318
 
2346
2319
  stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
@@ -2355,8 +2328,8 @@ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
2355
2328
  tool: 'protectedTool',
2356
2329
  requiredScopes: [ 'scope1', 'scope2', 'scope3' ],
2357
2330
  agentDid: 'did:key:zmock123...',
2358
- resumeToken: 'resume_5vmgb9_mifo7q9q',
2359
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=scope1%2Cscope2%2Cscope3&session_id=session123&agent_did=&resume_token=resume_5vmgb9_mifo7q9q'
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'
2360
2333
  }
2361
2334
 
2362
2335
  stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
@@ -2371,8 +2344,8 @@ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
2371
2344
  tool: 'protectedTool',
2372
2345
  requiredScopes: [ 'files:write' ],
2373
2346
  agentDid: 'did:key:zmock123...',
2374
- resumeToken: 'resume_ixogpz_mifo7q9q',
2375
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=&agent_did=&resume_token=resume_ixogpz_mifo7q9q'
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'
2376
2349
  }
2377
2350
 
2378
2351
  stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
@@ -2389,146 +2362,212 @@ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntime
2389
2362
  reason: 'Tool not configured to require delegation'
2390
2363
  }
2391
2364
 
2392
- ✓ src/__tests__/runtime/tool-protection-enforcement.test.ts (29 tests) 13ms
2393
- ✓ src/__tests__/runtime/route-interception.test.ts (21 tests) 56ms
2365
+ ✓ src/__tests__/runtime/tool-protection-enforcement.test.ts (29 tests) 63ms
2394
2366
  stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
2395
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
2396
- at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
2397
- at processTicksAndRejections (node:internal/process/task_queues:103:5)
2398
- at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
2399
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:252:7
2400
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:20
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
2401
2373
 
2402
2374
  stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
2403
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
2404
- at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
2405
- at processTicksAndRejections (node:internal/process/task_queues:103:5)
2406
- at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
2407
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:257:9
2408
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:20
2409
-
2410
- ✓ src/services/__tests__/proof-verifier.integration.test.ts (13 tests | 1 skipped) 132ms
2411
- ✓ src/__tests__/services/oauth-service-pkce.test.ts (18 tests) 24ms
2412
- ✓ src/services/__tests__/access-control.integration.test.ts (9 tests) 132ms
2413
- stderr | src/services/__tests__/proof-verifier.test.ts > ProofVerifier Security > Signature Verification > should handle signature verification errors gracefully
2414
- [CryptoService] Ed25519 verification error: Error: Crypto error
2415
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.test.ts:328:9
2416
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
2417
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
2418
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
2419
- at new Promise (<anonymous>)
2420
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
2421
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
2422
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
2423
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
2424
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
2425
-
2426
- ✓ src/services/__tests__/proof-verifier.test.ts (21 tests) 25ms
2427
- stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
2428
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z8121SEztchDV_woQLas8SFKTebz98rah","environment":"development","userDidGeneration":"disabled"},"timestamp":1764141356344,"timestampFormatted":"2025-11-26T07:15:56.344Z"}
2429
-
2430
- stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
2431
- [AUDIT] {"event":"tool_executed","data":{"tool":"greetingTool","sessionId":"0f9a212ed2b16fff311a0e31f1d206b4","timestamp":1764141356344},"timestamp":1764141356344,"timestampFormatted":"2025-11-26T07:15:56.344Z"}
2432
-
2433
- stdout | src/__tests__/integration.test.ts > Integration Tests > Session expiry handling > should handle expired sessions correctly
2434
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z15OoTD0AMXZWW4CfYRHUll3rNTbYO_35","environment":"development","userDidGeneration":"disabled"},"timestamp":1764141356381,"timestampFormatted":"2025-11-26T07:15:56.381Z"}
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
2387
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should allow unprotected tool calls
2388
+ [ToolProtectionService] Config loaded from API {
2389
+ source: 'api',
2390
+ toolCount: 1,
2391
+ protectedTools: [],
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
2394
+ projectId: 'test-project',
2395
+ cacheTtlMs: 300000,
2396
+ cacheExpiresAt: '2025-11-26T15:41:45.684Z'
2397
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
2398
+ }
2435
2399
 
2436
- stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
2437
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zYaU_cFd3ZF4mZJGij9fjLR-MEBv1lcQJ","environment":"development","userDidGeneration":"disabled"},"timestamp":1764141356381,"timestampFormatted":"2025-11-26T07:15:56.381Z"}
2400
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
2401
+ [ToolProtectionService] Config loaded from API {
2402
+ source: 'api',
2403
+ toolCount: 1,
2404
+ protectedTools: [ 'checkout' ],
2438
2405
 
2439
- stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
2440
- [AUDIT] {"event":"keys_rotated","data":{"oldDid":"did:key:zYaU_cFd3ZF4mZJGij9fjLR-MEBv1lcQJ","newDid":"did:key:z3FPDutWeDxlbAquGc1EAV1dk2sNV00eZ","timestamp":1764141356381},"timestamp":1764141356381,"timestampFormatted":"2025-11-26T07:15:56.381Z"}
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
2408
+ projectId: 'test-project',
2409
+ cacheTtlMs: 300000,
2410
+ cacheExpiresAt: '2025-11-26T15:41:45.685Z'
2411
+ }
2412
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
2441
2413
 
2442
- stdout | src/__tests__/integration.test.ts > Integration Tests > Well-known endpoints > should provide identity discovery endpoints
2443
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zHcmV6ojyhvP-mkIWCOW9znBBZa7zutmh","environment":"development","userDidGeneration":"disabled"},"timestamp":1764141356385,"timestampFormatted":"2025-11-26T07:15:56.385Z"}
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',
2417
+ [ToolProtectionService] Protection check {
2418
+ tool: 'checkout',
2419
+ cacheKey: 'config:tool-protections:test-project'
2420
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2421
+ found: true,
2422
+ isWildcard: false,
2423
+ requiresDelegation: true,
2424
+ availableTools: [ 'checkout' ]
2425
+ }
2444
2426
 
2445
- stdout | src/__tests__/integration.test.ts > Integration Tests > Nonce replay protection > should prevent nonce reuse
2446
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zbVf21TqeyIdO1ONiQxlMKOn4IF4VvzX6","environment":"development","userDidGeneration":"disabled"},"timestamp":1764141356386,"timestampFormatted":"2025-11-26T07:15:56.386Z"}
2427
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should fetch tool protection config from AgentShield
2428
+ }
2429
+ [ToolProtectionService] Config loaded from API {
2430
+ source: 'api',
2447
2431
 
2448
- stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle network errors gracefully
2449
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zps_ZWGJTTeDw4XmOWFWJFtRE9pRBzCdU","environment":"development","userDidGeneration":"disabled"},"timestamp":1764141356395,"timestampFormatted":"2025-11-26T07:15:56.395Z"}
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' }
2434
+ toolCount: 1,
2435
+ protectedTools: [ 'protected_tool' ],
2436
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2437
+ projectId: 'test-project',
2438
+ cacheTtlMs: 300000,
2450
2439
 
2451
- stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle malformed DID documents
2452
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zyWmDpk_p9eapoIqgfso40DXrwmREkQRX","environment":"development","userDidGeneration":"disabled"},"timestamp":1764141356395,"timestampFormatted":"2025-11-26T07:15:56.395Z"}
2440
+ cacheExpiresAt: '2025-11-26T15:41:45.686Z'
2441
+ }
2453
2442
 
2454
- stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should provide debug information in development
2455
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zGQdSUHvAMm_zt-y-oh9t-8kZO8BSJaJk","environment":"development","userDidGeneration":"disabled"},"timestamp":1764141356395,"timestampFormatted":"2025-11-26T07:15:56.395Z"}
2443
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should cache tool protection config
2444
+ [ToolProtectionService] Config loaded from API {
2445
+ source: 'api',
2446
+ toolCount: 1,
2447
+ protectedTools: [ 'tool1' ],
2448
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2449
+ projectId: 'test-project',
2450
+ cacheTtlMs: 300000,
2451
+ cacheExpiresAt: '2025-11-26T15:41:45.687Z'
2452
+ }
2456
2453
 
2457
- stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should be disabled in production
2458
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zpcP5klwTGdjXg_hDco2kbiXJci4P7u1h","environment":"development","userDidGeneration":"disabled"},"timestamp":1764141356396,"timestampFormatted":"2025-11-26T07:15:56.396Z"}
2454
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should share cache across multiple service instances
2455
+ [ToolProtectionService] Config loaded from API {
2456
+ source: 'api',
2457
+ toolCount: 1,
2458
+ protectedTools: [ 'tool1' ],
2459
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2460
+ projectId: 'test-project',
2461
+ cacheTtlMs: 300000,
2462
+ cacheExpiresAt: '2025-11-26T15:41:45.689Z'
2463
+ }
2459
2464
 
2460
- src/__tests__/runtime/base.test.ts (55 tests) 13ms
2461
- ✓ src/__tests__/integration.test.ts (9 tests) 63ms
2462
- ✓ src/compliance/__tests__/schema-verifier.test.ts (30 tests) 14ms
2463
- 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
2465
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
2464
2466
  [ToolProtectionService] Config loaded from API {
2465
2467
  source: 'api',
2466
2468
  toolCount: 1,
2467
- protectedTools: [ 'phase1_tool' ],
2469
+ protectedTools: [ 'tool1' ],
2468
2470
  agentDid: 'did:key:z6MkhaXgBZDv...',
2469
- projectId: 'none',
2471
+ projectId: 'test-project',
2470
2472
  cacheTtlMs: 300000,
2471
- cacheExpiresAt: '2025-11-26T07:20:56.500Z'
2473
+ cacheExpiresAt: '2025-11-26T15:41:45.689Z'
2472
2474
  }
2473
2475
 
2474
- 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)
2476
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
2475
2477
  [ToolProtectionService] Config loaded from API {
2476
2478
  source: 'api',
2477
2479
  toolCount: 1,
2478
- protectedTools: [ 'old_tool' ],
2479
- 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)
2480
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2480
+ protectedTools: [ 'tool1' ],
2481
2481
  agentDid: 'did:key:z6MkhaXgBZDv...',
2482
+ projectId: 'test-project',
2483
+ cacheTtlMs: 300000,
2484
+ cacheExpiresAt: '2025-11-26T15:41:45.689Z'
2485
+ }
2482
2486
 
2483
- projectId: 'none',
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
2488
+ [ToolProtectionService] Config loaded from API {
2489
+ source: 'api',
2490
+ toolCount: 3,
2491
+ protectedTools: [ 'add_to_cart', 'checkout' ],
2492
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2493
+ projectId: 'test-project',
2484
2494
  cacheTtlMs: 300000,
2485
- cacheExpiresAt: '2025-11-26T07:20:56.505Z'
2495
+ cacheExpiresAt: '2025-11-26T15:41:45.689Z'
2486
2496
  }
2487
2497
 
2488
- 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)
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
2499
+ [ToolProtectionService] Protection check {
2500
+ tool: 'add_to_cart',
2501
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2502
+ found: true,
2503
+ isWildcard: false,
2504
+ requiresDelegation: true,
2505
+ availableTools: [ 'search_products', 'add_to_cart', 'checkout' ]
2506
+ }
2507
+
2508
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Concurrent operations > should handle concurrent cache operations
2489
2509
  [ToolProtectionService] Config loaded from API {
2490
2510
  source: 'api',
2491
2511
  toolCount: 1,
2492
- protectedTools: [ 'old_tool' ],
2512
+ protectedTools: [ 'tool1' ],
2493
2513
  agentDid: 'did:key:z6MkhaXgBZDv...',
2494
- projectId: 'none',
2514
+ projectId: 'test-project',
2495
2515
  cacheTtlMs: 300000,
2496
- cacheExpiresAt: '2025-11-26T07:20:56.505Z'
2516
+ cacheExpiresAt: '2025-11-26T15:41:45.690Z'
2497
2517
  }
2498
-
2499
- 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
2500
2518
  [ToolProtectionService] Config loaded from API {
2501
2519
  source: 'api',
2502
2520
  toolCount: 1,
2503
- protectedTools: [ 'tool_with_snake_case' ],
2521
+ protectedTools: [ 'tool1' ],
2504
2522
  agentDid: 'did:key:z6MkhaXgBZDv...',
2505
- projectId: 'test-project-123',
2523
+ projectId: 'test-project',
2506
2524
  cacheTtlMs: 300000,
2507
- cacheExpiresAt: '2025-11-26T07:20:56.505Z'
2525
+ cacheExpiresAt: '2025-11-26T15:41:45.690Z'
2508
2526
  }
2509
-
2510
- 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
2511
2527
  [ToolProtectionService] Config loaded from API {
2512
2528
  source: 'api',
2513
- toolCount: 2,
2514
- protectedTools: [ 'phase1_tool', 'phase2_tool' ],
2529
+ toolCount: 1,
2530
+ protectedTools: [ 'tool1' ],
2515
2531
  agentDid: 'did:key:z6MkhaXgBZDv...',
2516
- projectId: 'test-project-123',
2532
+ projectId: 'test-project',
2517
2533
  cacheTtlMs: 300000,
2518
- cacheExpiresAt: '2025-11-26T07:20:56.506Z'
2534
+ cacheExpiresAt: '2025-11-26T15:41:45.690Z'
2519
2535
  }
2520
2536
 
2521
- ✓ src/__tests__/regression/phase2-regression.test.ts (12 tests) 7ms
2522
- stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from github scope prefix
2523
- [ProviderResolver] Inferred provider "github" from scopes
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
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
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
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
2544
+ at new Promise (<anonymous>)
2545
+ 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)
2546
+ 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)
2547
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
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)
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)
2524
2550
 
2525
- stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from gmail scope prefix (maps to google)
2526
- [ProviderResolver] Inferred provider "google" from scopes
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
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
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
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
2557
+ at new Promise (<anonymous>)
2558
+ 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)
2559
+ 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)
2560
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
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)
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)
2527
2563
 
2528
- stderr | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should fall back to configuredProvider for ambiguous scopes
2529
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
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
2530
2569
 
2531
- ✓ src/services/__tests__/provider-resolver.test.ts (8 tests) 16ms
2570
+ ✓ src/__tests__/identity/user-did-manager.test.ts (17 tests) 8ms
2532
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
2533
2572
  [ToolProtectionService] Config loaded from API {
2534
2573
  source: 'api',
@@ -2537,7 +2576,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
2537
2576
  agentDid: 'did:key:z6MkhaXgBZDv...',
2538
2577
  projectId: 'test-project-123',
2539
2578
  cacheTtlMs: 300000,
2540
- cacheExpiresAt: '2025-11-26T07:20:56.624Z'
2579
+ cacheExpiresAt: '2025-11-26T15:41:45.789Z'
2541
2580
  }
2542
2581
 
2543
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
@@ -2548,7 +2587,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
2548
2587
  agentDid: 'did:key:z6MkhaXgBZDv...',
2549
2588
  projectId: 'test-project-123',
2550
2589
  cacheTtlMs: 300000,
2551
- cacheExpiresAt: '2025-11-26T07:20:56.676Z'
2590
+ cacheExpiresAt: '2025-11-26T15:41:45.791Z'
2552
2591
  }
2553
2592
 
2554
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
@@ -2559,7 +2598,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
2559
2598
  agentDid: 'did:key:z6MkhaXgBZDv...',
2560
2599
  projectId: 'test-project-123',
2561
2600
  cacheTtlMs: 300000,
2562
- cacheExpiresAt: '2025-11-26T07:20:56.676Z'
2601
+ cacheExpiresAt: '2025-11-26T15:41:45.791Z'
2563
2602
  }
2564
2603
 
2565
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)
@@ -2570,7 +2609,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
2570
2609
  agentDid: 'did:key:z6MkhaXgBZDv...',
2571
2610
  projectId: 'test-project-123',
2572
2611
  cacheTtlMs: 300000,
2573
- cacheExpiresAt: '2025-11-26T07:20:56.676Z'
2612
+ cacheExpiresAt: '2025-11-26T15:41:45.792Z'
2574
2613
  }
2575
2614
 
2576
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
@@ -2581,7 +2620,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
2581
2620
  agentDid: 'did:key:z6MkhaXgBZDv...',
2582
2621
  projectId: 'none',
2583
2622
  cacheTtlMs: 300000,
2584
- cacheExpiresAt: '2025-11-26T07:20:56.677Z'
2623
+ cacheExpiresAt: '2025-11-26T15:41:45.793Z'
2585
2624
  }
2586
2625
 
2587
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
@@ -2592,7 +2631,7 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
2592
2631
  agentDid: 'did:key:z6MkhaXgBZDv...',
2593
2632
  projectId: 'none',
2594
2633
  cacheTtlMs: 300000,
2595
- cacheExpiresAt: '2025-11-26T07:20:56.677Z'
2634
+ cacheExpiresAt: '2025-11-26T15:41:45.793Z'
2596
2635
  }
2597
2636
 
2598
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
@@ -2603,175 +2642,268 @@ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolPro
2603
2642
  agentDid: 'did:key:z6MkhaXgBZDv...',
2604
2643
  projectId: 'none',
2605
2644
  cacheTtlMs: 300000,
2606
- cacheExpiresAt: '2025-11-26T07:20:56.677Z'
2645
+ cacheExpiresAt: '2025-11-26T15:41:45.793Z'
2646
+ }
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'
2657
+ }
2658
+
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'
2668
+ }
2669
+
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'
2679
+ }
2680
+
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'
2690
+ }
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'
2701
+ }
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'
2607
2712
  }
2608
2713
 
2609
- 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
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
2610
2768
  [ToolProtectionService] Config loaded from API {
2611
2769
  source: 'api',
2612
- toolCount: 2,
2613
- protectedTools: [ 'read_repos', 'send_email' ],
2770
+ toolCount: 1,
2771
+ protectedTools: [ 'phase1_tool' ],
2614
2772
  agentDid: 'did:key:z6MkhaXgBZDv...',
2615
2773
  projectId: 'none',
2616
2774
  cacheTtlMs: 300000,
2617
- cacheExpiresAt: '2025-11-26T07:20:56.677Z'
2775
+ cacheExpiresAt: '2025-11-26T15:41:45.870Z'
2618
2776
  }
2619
2777
 
2620
- 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
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)
2621
2779
  [ToolProtectionService] Config loaded from API {
2622
2780
  source: 'api',
2623
2781
  toolCount: 1,
2624
- protectedTools: [ 'read_repos' ],
2782
+ protectedTools: [ 'old_tool' ],
2625
2783
  agentDid: 'did:key:z6MkhaXgBZDv...',
2626
2784
  projectId: 'none',
2627
2785
  cacheTtlMs: 300000,
2628
- cacheExpiresAt: '2025-11-26T07:20:56.678Z'
2786
+ cacheExpiresAt: '2025-11-26T15:41:45.881Z'
2629
2787
  }
2630
2788
 
2631
- 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
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)
2632
2790
  [ToolProtectionService] Config loaded from API {
2633
2791
  source: 'api',
2634
2792
  toolCount: 1,
2635
- protectedTools: [ 'read_repos' ],
2793
+ protectedTools: [ 'old_tool' ],
2636
2794
  agentDid: 'did:key:z6MkhaXgBZDv...',
2637
2795
  projectId: 'none',
2638
2796
  cacheTtlMs: 300000,
2639
- cacheExpiresAt: '2025-11-26T07:20:56.678Z'
2797
+ cacheExpiresAt: '2025-11-26T15:41:45.882Z'
2640
2798
  }
2641
2799
 
2642
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Caching > should cache oauthProvider field correctly
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
2643
2801
  [ToolProtectionService] Config loaded from API {
2644
2802
  source: 'api',
2645
2803
  toolCount: 1,
2646
- protectedTools: [ 'read_repos' ],
2804
+ protectedTools: [ 'tool_with_snake_case' ],
2647
2805
  agentDid: 'did:key:z6MkhaXgBZDv...',
2648
2806
  projectId: 'test-project-123',
2649
2807
  cacheTtlMs: 300000,
2650
- cacheExpiresAt: '2025-11-26T07:20:56.686Z'
2808
+ cacheExpiresAt: '2025-11-26T15:41:45.882Z'
2651
2809
  }
2652
2810
 
2653
- 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
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
2654
2812
  [ToolProtectionService] Config loaded from API {
2655
2813
  source: 'api',
2656
2814
  toolCount: 2,
2657
- protectedTools: [ 'tool_with_provider', 'tool_without_provider' ],
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)
2658
2817
  agentDid: 'did:key:z6MkhaXgBZDv...',
2659
2818
  projectId: 'test-project-123',
2660
2819
  cacheTtlMs: 300000,
2661
- cacheExpiresAt: '2025-11-26T07:20:56.687Z'
2820
+ cacheExpiresAt: '2025-11-26T15:41:45.885Z'
2662
2821
  }
2663
2822
 
2664
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should handle empty string oauthProvider gracefully
2665
- [ToolProtectionService] Config loaded from API {
2666
- source: 'api',
2667
- toolCount: 1,
2668
- protectedTools: [ 'tool_with_empty_provider' ],
2669
- agentDid: 'did:key:z6MkhaXgBZDv...',
2670
- projectId: 'test-project-123',
2671
- cacheTtlMs: 300000,
2672
- cacheExpiresAt: '2025-11-26T07:20:56.687Z'
2673
- }
2823
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2674
2824
 
2675
- src/__tests__/services/tool-protection-oauth-provider.test.ts (14 tests) 64ms
2676
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
2677
- stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle API rate limiting gracefully
2678
- [ToolProtectionService] API fetch failed, using fallback config {
2679
- [ToolProtectionService] Config loaded from API {
2680
- source: 'api',
2681
- toolCount: 0,
2682
- protectedTools: [],
2683
- agentDid: 'did:key:z6MkhaXgBZDv...',
2684
- error: 'Failed to fetch bouncer config: 429 Too Many Requests - Rate limit exceeded'
2685
- }
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"}
2686
2827
 
2687
- agentDid: 'did:key:z6MkhaXgBZDv...',
2688
- projectId: 'test-project-123',
2689
- cacheTtlMs: 1000,
2690
- cacheExpiresAt: '2025-11-26T07:15:57.924Z'
2691
- }
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"}
2692
2830
 
2693
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle typical e-commerce tool protection config
2694
- [ToolProtectionService] Config loaded from API {
2695
- source: 'api',
2696
- toolCount: 4,
2697
- protectedTools: [ 'add_to_cart', 'checkout' ],
2698
- agentDid: 'did:key:z6MkhaXgBZDv...',
2699
- projectId: 'test-project-123',
2700
- cacheTtlMs: 300000,
2701
- cacheExpiresAt: '2025-11-26T07:20:56.924Z'
2702
- }
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"}
2703
2833
 
2704
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle concurrent requests
2705
- [ToolProtectionService] Config loaded from API {
2706
- source: 'api',
2707
- toolCount: 1,
2708
- protectedTools: [ 'tool1' ],
2709
- agentDid: 'did:key:z6MkhaXgBZDv...',
2710
- projectId: 'test-project-123',
2711
- cacheTtlMs: 300000,
2712
- cacheExpiresAt: '2025-11-26T07:20:56.925Z'
2713
- }
2714
- [ToolProtectionService] Config loaded from API {
2715
- source: 'api',
2716
- toolCount: 1,
2717
- protectedTools: [ 'tool1' ],
2718
- agentDid: 'did:key:z6MkhaXgBZDv...',
2719
- projectId: 'test-project-123',
2720
- cacheTtlMs: 300000,
2721
- cacheExpiresAt: '2025-11-26T07:20:56.925Z'
2722
- }
2723
- [ToolProtectionService] Config loaded from API {
2724
- source: 'api',
2725
- toolCount: 1,
2726
- protectedTools: [ 'tool1' ],
2727
- agentDid: 'did:key:z6MkhaXgBZDv...',
2728
- projectId: 'test-project-123',
2729
- cacheTtlMs: 300000,
2730
- cacheExpiresAt: '2025-11-26T07:20:56.925Z'
2731
- }
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"}
2732
2836
 
2733
- src/__tests__/services/agentshield-integration.test.ts (30 tests) 1113ms
2734
- should respect cache TTL 1101ms
2735
- ✓ src/delegation/__tests__/vc-verifier.test.ts (35 tests) 23ms
2736
- ✓ src/delegation/__tests__/vc-issuer.test.ts (21 tests) 30ms
2737
- stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.get errors gracefully
2738
- [UserDidManager] Storage.get failed, generating new DID: Error: Storage error
2739
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:187:67
2740
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
2741
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
2742
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
2743
- at new Promise (<anonymous>)
2744
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
2745
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
2746
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
2747
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
2748
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
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"}
2749
2839
 
2750
- stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.set errors gracefully
2751
- [UserDidManager] Storage.set failed, continuing with cached DID: Error: Storage error
2752
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:196:67
2753
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
2754
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
2755
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
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
2756
2875
  at new Promise (<anonymous>)
2757
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
2758
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
2759
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
2760
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
2761
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
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)
2762
2881
 
2763
- stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.delete errors gracefully
2764
- [UserDidManager] Storage.delete failed, continuing: Error: Storage error
2765
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:206:70
2766
- at processTicksAndRejections (node:internal/process/task_queues:103:5)
2767
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:20
2768
-
2769
- ✓ src/__tests__/identity/user-did-manager.test.ts (17 tests) 7ms
2770
- ✓ src/__tests__/runtime/delegation-flow.test.ts (4 tests) 55ms
2771
- ✓ src/__tests__/runtime/proof-client-did.test.ts (17 tests) 44ms
2772
- src/delegation/__tests__/cascading-revocation.test.ts (23 tests) 11ms
2773
- src/delegation/__tests__/bitstring.test.ts (30 tests) 8ms
2774
- src/__tests__/providers/memory.test.ts (34 tests) 10ms
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
2775
2907
  stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > clearAndRefresh should call fetchFromApi with bypassCDNCache: true
2776
2908
  [ToolProtectionService] clearAndRefresh starting {
2777
2909
  cacheKey: 'config:tool-protections:test-project-123',
@@ -2791,7 +2923,7 @@ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAn
2791
2923
  }
2792
2924
 
2793
2925
  stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should add cache-busting query param when bypassCDNCache is true
2794
- [ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/tool-protections?_t=1764141357627 {
2926
+ [ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/tool-protections?_t=1764171406153 {
2795
2927
  method: 'projects/{projectId}/tool-protections (new)',
2796
2928
  projectId: 'test-project-123',
2797
2929
  apiKeyPresent: true,
@@ -2800,7 +2932,7 @@ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAn
2800
2932
  }
2801
2933
 
2802
2934
  stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should add Cache-Control headers when bypassCDNCache is true
2803
- [ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/tool-protections?_t=1764141357627 {
2935
+ [ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/tool-protections?_t=1764171406153 {
2804
2936
  method: 'projects/{projectId}/tool-protections (new)',
2805
2937
  projectId: 'test-project-123',
2806
2938
  apiKeyPresent: true,
@@ -2835,210 +2967,78 @@ stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAn
2835
2967
  source: 'api'
2836
2968
  }
2837
2969
 
2838
- src/__tests__/services/cache-busting.test.ts (5 tests) 4ms
2839
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API request fails
2840
- [RemoteConfig] API returned 404: Not Found
2841
-
2842
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API throws error
2843
- [RemoteConfig] Failed to fetch config: Error: Network error
2844
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:170:35
2845
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
2846
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
2847
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
2848
- at new Promise (<anonymous>)
2849
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
2850
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
2851
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
2852
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
2853
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
2854
-
2855
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if neither projectId nor agentDid provided
2856
- [RemoteConfig] Neither projectId nor agentDid provided
2970
+ stderr | src/services/__tests__/provider-resolution.integration.test.ts > Provider Resolution Integration > Backward compatibility > should work with Phase 1 tools (no oauthProvider field)
2971
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2857
2972
 
2858
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should handle cache read errors gracefully
2859
- [RemoteConfig] Cache read failed: Error: Cache error
2860
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:198:50
2861
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
2862
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
2863
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
2864
- at new Promise (<anonymous>)
2865
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
2866
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
2867
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
2868
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
2869
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
2870
-
2871
- ✓ src/config/__tests__/remote-config.spec.ts (9 tests) 12ms
2872
- ✓ src/delegation/storage/__tests__/memory-graph-storage.test.ts (27 tests) 39ms
2873
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should allow unprotected tool calls
2973
+ src/__tests__/services/cache-busting.test.ts (5 tests) 5ms
2974
+ src/services/__tests__/provider-resolution.integration.test.ts (6 tests) 4ms
2975
+ src/utils/__tests__/did-helpers.test.ts (11 tests) 3ms
2976
+ ✓ src/delegation/__tests__/audience-validator.test.ts (5 tests) 1ms
2977
+ ✓ src/services/__tests__/batch-delegation.service.test.ts (11 tests) 4ms
2978
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
2874
2979
  [ToolProtectionService] Config loaded from API {
2875
2980
  source: 'api',
2876
- toolCount: 1,
2981
+ toolCount: 0,
2877
2982
  protectedTools: [],
2878
2983
  agentDid: 'did:key:z6MkhaXgBZDv...',
2879
- projectId: 'test-project',
2880
- cacheTtlMs: 300000,
2881
- cacheExpiresAt: '2025-11-26T07:20:57.798Z'
2882
- }
2883
-
2884
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
2885
- [ToolProtectionService] Config loaded from API {
2886
- source: 'api',
2887
- toolCount: 1,
2888
- protectedTools: [ 'checkout' ],
2889
- agentDid: 'did:key:z6MkhaXgBZDv...',
2890
- projectId: 'test-project',
2891
- cacheTtlMs: 300000,
2892
- cacheExpiresAt: '2025-11-26T07:20:57.798Z'
2893
- }
2894
-
2895
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
2896
- [ToolProtectionService] Protection check {
2897
- tool: 'checkout',
2898
- agentDid: 'did:key:z6MkhaXgBZDv...',
2899
- found: true,
2900
- isWildcard: false,
2901
- requiresDelegation: true,
2902
- availableTools: [ 'checkout' ]
2903
- }
2904
-
2905
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should fetch tool protection config from AgentShield
2906
- [ToolProtectionService] Config loaded from API {
2907
- source: 'api',
2908
- toolCount: 1,
2909
- protectedTools: [ 'protected_tool' ],
2910
- agentDid: 'did:key:z6MkhaXgBZDv...',
2911
- projectId: 'test-project',
2912
- cacheTtlMs: 300000,
2913
- stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should use fallback config when API fails
2914
- cacheExpiresAt: '2025-11-26T07:20:57.800Z'
2915
- }
2916
-
2917
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
2918
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should cache tool protection config
2919
- [ToolProtectionService] Config loaded from API {
2920
-
2921
- source: 'api',
2922
- stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle tool protection service errors gracefully
2923
- [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
2924
- toolCount: 1,
2925
- protectedTools: [ 'tool1' ],
2926
- agentDid: 'did:key:z6MkhaXgBZDv...',
2927
- projectId: 'test-project',
2928
- cacheTtlMs: 300000,
2929
- agentDid: 'did:key:z6MkhaXgBZDv...',
2930
- error: 'Network error',
2931
- cacheExpiresAt: '2025-11-26T07:20:57.802Z'
2932
- }
2933
-
2934
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should share cache across multiple service instances
2935
- cacheKey: 'config:tool-protections:test-project'
2936
- [ToolProtectionService] Config loaded from API {
2937
- source: 'api',
2938
- toolCount: 1,
2939
- protectedTools: [ 'tool1' ],
2940
- }
2941
-
2942
- stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle network timeouts
2943
- agentDid: 'did:key:z6MkhaXgBZDv...',
2944
- projectId: 'test-project',
2945
- cacheTtlMs: 300000,
2946
- cacheExpiresAt: '2025-11-26T07:20:57.804Z'
2947
- }
2948
-
2949
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
2950
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
2951
- [ToolProtectionService] Config loaded from API {
2952
-
2953
- source: 'api',
2954
- toolCount: 1,
2955
- protectedTools: [ 'tool1' ],
2956
- agentDid: 'did:key:z6MkhaXgBZDv...',
2957
- projectId: 'test-project',
2958
- cacheTtlMs: 300000,
2959
- cacheExpiresAt: '2025-11-26T07:20:57.804Z'
2960
- }
2961
-
2962
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
2963
- [ToolProtectionService] Config loaded from API {
2964
- source: 'api',
2965
- toolCount: 1,
2966
- protectedTools: [ 'tool1' ],
2967
- agentDid: 'did:key:z6MkhaXgBZDv...',
2968
- projectId: 'test-project',
2969
- cacheTtlMs: 300000,
2970
- cacheExpiresAt: '2025-11-26T07:20:57.804Z'
2984
+ projectId: 'test-project-123',
2985
+ cacheTtlMs: 1000,
2986
+ cacheExpiresAt: '2025-11-26T15:36:47.421Z'
2971
2987
  }
2972
2988
 
2973
- 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
2989
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle typical e-commerce tool protection config
2974
2990
  [ToolProtectionService] Config loaded from API {
2975
2991
  source: 'api',
2976
- toolCount: 3,
2992
+ toolCount: 4,
2977
2993
  protectedTools: [ 'add_to_cart', 'checkout' ],
2978
2994
  agentDid: 'did:key:z6MkhaXgBZDv...',
2979
- projectId: 'test-project',
2995
+ projectId: 'test-project-123',
2980
2996
  cacheTtlMs: 300000,
2981
- cacheExpiresAt: '2025-11-26T07:20:57.805Z'
2997
+ cacheExpiresAt: '2025-11-26T15:41:46.421Z'
2982
2998
  }
2983
2999
 
2984
- 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
2985
- [ToolProtectionService] Protection check {
2986
- tool: 'add_to_cart',
3000
+ stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle API rate limiting gracefully
3001
+ [ToolProtectionService] API fetch failed, using fallback config {
2987
3002
  agentDid: 'did:key:z6MkhaXgBZDv...',
2988
- found: true,
2989
- isWildcard: false,
2990
- requiresDelegation: true,
2991
- availableTools: [ 'search_products', 'add_to_cart', 'checkout' ]
3003
+ error: 'Failed to fetch bouncer config: 429 Too Many Requests - Rate limit exceeded'
2992
3004
  }
2993
3005
 
2994
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Concurrent operations > should handle concurrent cache operations
3006
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle concurrent requests
2995
3007
  [ToolProtectionService] Config loaded from API {
2996
3008
  source: 'api',
2997
3009
  toolCount: 1,
2998
3010
  protectedTools: [ 'tool1' ],
2999
3011
  agentDid: 'did:key:z6MkhaXgBZDv...',
3000
- projectId: 'test-project',
3012
+ projectId: 'test-project-123',
3001
3013
  cacheTtlMs: 300000,
3002
- cacheExpiresAt: '2025-11-26T07:20:57.805Z'
3014
+ cacheExpiresAt: '2025-11-26T15:41:46.422Z'
3003
3015
  }
3004
3016
  [ToolProtectionService] Config loaded from API {
3005
3017
  source: 'api',
3006
3018
  toolCount: 1,
3007
3019
  protectedTools: [ 'tool1' ],
3008
3020
  agentDid: 'did:key:z6MkhaXgBZDv...',
3009
- projectId: 'test-project',
3021
+ projectId: 'test-project-123',
3010
3022
  cacheTtlMs: 300000,
3011
- cacheExpiresAt: '2025-11-26T07:20:57.805Z'
3023
+ cacheExpiresAt: '2025-11-26T15:41:46.422Z'
3012
3024
  }
3013
3025
  [ToolProtectionService] Config loaded from API {
3014
3026
  source: 'api',
3015
3027
  toolCount: 1,
3016
3028
  protectedTools: [ 'tool1' ],
3017
3029
  agentDid: 'did:key:z6MkhaXgBZDv...',
3018
- projectId: 'test-project',
3030
+ projectId: 'test-project-123',
3019
3031
  cacheTtlMs: 300000,
3020
- cacheExpiresAt: '2025-11-26T07:20:57.805Z'
3032
+ cacheExpiresAt: '2025-11-26T15:41:46.422Z'
3021
3033
  }
3022
3034
 
3023
- ✓ src/__tests__/integration/full-flow.test.ts (21 tests) 27ms
3024
- src/__tests__/providers/base.test.ts (14 tests) 4ms
3025
- ✓ src/delegation/__tests__/utils.test.ts (28 tests) 5ms
3026
- stderr | src/services/__tests__/provider-resolution.integration.test.ts > Provider Resolution Integration > Backward compatibility > should work with Phase 1 tools (no oauthProvider field)
3027
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3028
-
3029
- ✓ src/__tests__/config/provider-runtime-config.test.ts (9 tests) 2ms
3030
- ✓ src/services/__tests__/provider-resolution.integration.test.ts (6 tests) 5ms
3031
- ✓ src/services/__tests__/oauth-provider-registry.test.ts (9 tests) 3ms
3032
- ✓ src/services/__tests__/batch-delegation.service.test.ts (11 tests) 5ms
3033
- ✓ src/delegation/__tests__/audience-validator.test.ts (5 tests) 2ms
3034
- ✓ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts (14 tests) 3ms
3035
- ✓ src/utils/__tests__/did-helpers.test.ts (11 tests) 2ms
3036
- ✓ src/__tests__/runtime/audit-logger.test.ts (9 tests) 3ms
3035
+ ✓ src/__tests__/services/agentshield-integration.test.ts (30 tests) 1113ms
3036
+ should respect cache TTL 1102ms
3037
3037
  ↓ src/__tests__/delegation-e2e.test.ts (14 tests | 14 skipped)
3038
3038
  ✓ src/__tests__/index.test.ts (4 tests) 2ms
3039
3039
 
3040
3040
  Test Files 45 passed | 1 skipped (46)
3041
3041
  Tests 905 passed | 16 skipped (921)
3042
- Start at 01:15:55
3043
- Duration 3.56s (transform 6.53s, setup 0ms, import 12.30s, tests 2.32s, environment 3ms)
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)
3044
3044