@kya-os/mcp-i-core 1.2.3-canary.7 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/.turbo/turbo-build.log +4 -0
  3. package/.turbo/turbo-test$colon$coverage.log +4514 -0
  4. package/.turbo/turbo-test.log +2973 -0
  5. package/COMPLIANCE_IMPROVEMENT_REPORT.md +483 -0
  6. package/Composer 3.md +615 -0
  7. package/GPT-5.md +1169 -0
  8. package/OPUS-plan.md +352 -0
  9. package/PHASE_3_AND_4.1_SUMMARY.md +585 -0
  10. package/PHASE_3_SUMMARY.md +317 -0
  11. package/PHASE_4.1.3_SUMMARY.md +428 -0
  12. package/PHASE_4.1_COMPLETE.md +525 -0
  13. package/PHASE_4_USER_DID_IDENTITY_LINKING_PLAN.md +1240 -0
  14. package/SCHEMA_COMPLIANCE_REPORT.md +275 -0
  15. package/TEST_PLAN.md +571 -0
  16. package/coverage/coverage-final.json +57 -0
  17. package/dist/__tests__/utils/mock-providers.d.ts +1 -2
  18. package/dist/__tests__/utils/mock-providers.d.ts.map +1 -1
  19. package/dist/__tests__/utils/mock-providers.js.map +1 -1
  20. package/dist/cache/oauth-config-cache.d.ts +69 -0
  21. package/dist/cache/oauth-config-cache.d.ts.map +1 -0
  22. package/dist/cache/oauth-config-cache.js +76 -0
  23. package/dist/cache/oauth-config-cache.js.map +1 -0
  24. package/dist/identity/idp-token-resolver.d.ts +53 -0
  25. package/dist/identity/idp-token-resolver.d.ts.map +1 -0
  26. package/dist/identity/idp-token-resolver.js +108 -0
  27. package/dist/identity/idp-token-resolver.js.map +1 -0
  28. package/dist/identity/idp-token-storage.interface.d.ts +42 -0
  29. package/dist/identity/idp-token-storage.interface.d.ts.map +1 -0
  30. package/dist/identity/idp-token-storage.interface.js +12 -0
  31. package/dist/identity/idp-token-storage.interface.js.map +1 -0
  32. package/dist/identity/user-did-manager.d.ts +39 -1
  33. package/dist/identity/user-did-manager.d.ts.map +1 -1
  34. package/dist/identity/user-did-manager.js +69 -3
  35. package/dist/identity/user-did-manager.js.map +1 -1
  36. package/dist/index.d.ts +22 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +39 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/runtime/audit-logger.d.ts +37 -0
  41. package/dist/runtime/audit-logger.d.ts.map +1 -0
  42. package/dist/runtime/audit-logger.js +9 -0
  43. package/dist/runtime/audit-logger.js.map +1 -0
  44. package/dist/runtime/base.d.ts +58 -2
  45. package/dist/runtime/base.d.ts.map +1 -1
  46. package/dist/runtime/base.js +266 -11
  47. package/dist/runtime/base.js.map +1 -1
  48. package/dist/services/access-control.service.d.ts.map +1 -1
  49. package/dist/services/access-control.service.js +200 -35
  50. package/dist/services/access-control.service.js.map +1 -1
  51. package/dist/services/authorization/authorization-registry.d.ts +29 -0
  52. package/dist/services/authorization/authorization-registry.d.ts.map +1 -0
  53. package/dist/services/authorization/authorization-registry.js +57 -0
  54. package/dist/services/authorization/authorization-registry.js.map +1 -0
  55. package/dist/services/authorization/types.d.ts +53 -0
  56. package/dist/services/authorization/types.d.ts.map +1 -0
  57. package/dist/services/authorization/types.js +10 -0
  58. package/dist/services/authorization/types.js.map +1 -0
  59. package/dist/services/batch-delegation.service.d.ts +53 -0
  60. package/dist/services/batch-delegation.service.d.ts.map +1 -0
  61. package/dist/services/batch-delegation.service.js +95 -0
  62. package/dist/services/batch-delegation.service.js.map +1 -0
  63. package/dist/services/oauth-config.service.d.ts +53 -0
  64. package/dist/services/oauth-config.service.d.ts.map +1 -0
  65. package/dist/services/oauth-config.service.js +117 -0
  66. package/dist/services/oauth-config.service.js.map +1 -0
  67. package/dist/services/oauth-provider-registry.d.ts +77 -0
  68. package/dist/services/oauth-provider-registry.d.ts.map +1 -0
  69. package/dist/services/oauth-provider-registry.js +112 -0
  70. package/dist/services/oauth-provider-registry.js.map +1 -0
  71. package/dist/services/oauth-service.d.ts +77 -0
  72. package/dist/services/oauth-service.d.ts.map +1 -0
  73. package/dist/services/oauth-service.js +348 -0
  74. package/dist/services/oauth-service.js.map +1 -0
  75. package/dist/services/oauth-token-retrieval.service.d.ts +49 -0
  76. package/dist/services/oauth-token-retrieval.service.d.ts.map +1 -0
  77. package/dist/services/oauth-token-retrieval.service.js +150 -0
  78. package/dist/services/oauth-token-retrieval.service.js.map +1 -0
  79. package/dist/services/provider-resolver.d.ts +48 -0
  80. package/dist/services/provider-resolver.d.ts.map +1 -0
  81. package/dist/services/provider-resolver.js +120 -0
  82. package/dist/services/provider-resolver.js.map +1 -0
  83. package/dist/services/provider-validator.d.ts +55 -0
  84. package/dist/services/provider-validator.d.ts.map +1 -0
  85. package/dist/services/provider-validator.js +135 -0
  86. package/dist/services/provider-validator.js.map +1 -0
  87. package/dist/services/tool-context-builder.d.ts +57 -0
  88. package/dist/services/tool-context-builder.d.ts.map +1 -0
  89. package/dist/services/tool-context-builder.js +125 -0
  90. package/dist/services/tool-context-builder.js.map +1 -0
  91. package/dist/services/tool-protection.service.d.ts +87 -10
  92. package/dist/services/tool-protection.service.d.ts.map +1 -1
  93. package/dist/services/tool-protection.service.js +282 -112
  94. package/dist/services/tool-protection.service.js.map +1 -1
  95. package/dist/types/oauth-required-error.d.ts +40 -0
  96. package/dist/types/oauth-required-error.d.ts.map +1 -0
  97. package/dist/types/oauth-required-error.js +40 -0
  98. package/dist/types/oauth-required-error.js.map +1 -0
  99. package/dist/utils/did-helpers.d.ts +33 -0
  100. package/dist/utils/did-helpers.d.ts.map +1 -1
  101. package/dist/utils/did-helpers.js +40 -0
  102. package/dist/utils/did-helpers.js.map +1 -1
  103. package/dist/utils/index.d.ts +1 -0
  104. package/dist/utils/index.d.ts.map +1 -1
  105. package/dist/utils/index.js +1 -0
  106. package/dist/utils/index.js.map +1 -1
  107. package/docs/API_REFERENCE.md +1362 -0
  108. package/docs/COMPLIANCE_MATRIX.md +691 -0
  109. package/docs/STATUSLIST2021_GUIDE.md +696 -0
  110. package/docs/W3C_VC_DELEGATION_GUIDE.md +710 -0
  111. package/package.json +24 -50
  112. package/scripts/audit-compliance.ts +724 -0
  113. package/src/__tests__/cache/tool-protection-cache.test.ts +640 -0
  114. package/src/__tests__/config/provider-runtime-config.test.ts +309 -0
  115. package/src/__tests__/delegation-e2e.test.ts +690 -0
  116. package/src/__tests__/identity/user-did-manager.test.ts +213 -0
  117. package/src/__tests__/index.test.ts +56 -0
  118. package/src/__tests__/integration/full-flow.test.ts +776 -0
  119. package/src/__tests__/integration.test.ts +281 -0
  120. package/src/__tests__/providers/base.test.ts +173 -0
  121. package/src/__tests__/providers/memory.test.ts +319 -0
  122. package/src/__tests__/regression/phase2-regression.test.ts +427 -0
  123. package/src/__tests__/runtime/audit-logger.test.ts +154 -0
  124. package/src/__tests__/runtime/base-extensions.test.ts +593 -0
  125. package/src/__tests__/runtime/base.test.ts +869 -0
  126. package/src/__tests__/runtime/delegation-flow.test.ts +164 -0
  127. package/src/__tests__/runtime/proof-client-did.test.ts +375 -0
  128. package/src/__tests__/runtime/route-interception.test.ts +686 -0
  129. package/src/__tests__/runtime/tool-protection-enforcement.test.ts +908 -0
  130. package/src/__tests__/services/agentshield-integration.test.ts +784 -0
  131. package/src/__tests__/services/provider-resolver-edge-cases.test.ts +487 -0
  132. package/src/__tests__/services/tool-protection-oauth-provider.test.ts +480 -0
  133. package/src/__tests__/services/tool-protection.service.test.ts +1366 -0
  134. package/src/__tests__/utils/mock-providers.ts +340 -0
  135. package/src/cache/oauth-config-cache.d.ts +69 -0
  136. package/src/cache/oauth-config-cache.d.ts.map +1 -0
  137. package/src/cache/oauth-config-cache.js +71 -0
  138. package/src/cache/oauth-config-cache.js.map +1 -0
  139. package/src/cache/oauth-config-cache.ts +123 -0
  140. package/src/cache/tool-protection-cache.ts +171 -0
  141. package/src/compliance/EXAMPLE.md +412 -0
  142. package/src/compliance/__tests__/schema-verifier.test.ts +797 -0
  143. package/src/compliance/index.ts +8 -0
  144. package/src/compliance/schema-registry.ts +460 -0
  145. package/src/compliance/schema-verifier.ts +708 -0
  146. package/src/config/__tests__/remote-config.spec.ts +268 -0
  147. package/src/config/remote-config.ts +174 -0
  148. package/src/config.ts +309 -0
  149. package/src/delegation/__tests__/audience-validator.test.ts +112 -0
  150. package/src/delegation/__tests__/bitstring.test.ts +346 -0
  151. package/src/delegation/__tests__/cascading-revocation.test.ts +628 -0
  152. package/src/delegation/__tests__/delegation-graph.test.ts +584 -0
  153. package/src/delegation/__tests__/utils.test.ts +152 -0
  154. package/src/delegation/__tests__/vc-issuer.test.ts +442 -0
  155. package/src/delegation/__tests__/vc-verifier.test.ts +922 -0
  156. package/src/delegation/audience-validator.ts +52 -0
  157. package/src/delegation/bitstring.ts +278 -0
  158. package/src/delegation/cascading-revocation.ts +370 -0
  159. package/src/delegation/delegation-graph.ts +299 -0
  160. package/src/delegation/index.ts +14 -0
  161. package/src/delegation/statuslist-manager.ts +353 -0
  162. package/src/delegation/storage/__tests__/memory-graph-storage.test.ts +366 -0
  163. package/src/delegation/storage/__tests__/memory-statuslist-storage.test.ts +228 -0
  164. package/src/delegation/storage/index.ts +9 -0
  165. package/src/delegation/storage/memory-graph-storage.ts +178 -0
  166. package/src/delegation/storage/memory-statuslist-storage.ts +77 -0
  167. package/src/delegation/utils.ts +42 -0
  168. package/src/delegation/vc-issuer.ts +232 -0
  169. package/src/delegation/vc-verifier.ts +568 -0
  170. package/src/identity/idp-token-resolver.ts +147 -0
  171. package/src/identity/idp-token-storage.interface.ts +59 -0
  172. package/src/identity/user-did-manager.ts +370 -0
  173. package/src/index.ts +260 -0
  174. package/src/providers/base.d.ts +91 -0
  175. package/src/providers/base.d.ts.map +1 -0
  176. package/src/providers/base.js +38 -0
  177. package/src/providers/base.js.map +1 -0
  178. package/src/providers/base.ts +96 -0
  179. package/src/providers/memory.ts +142 -0
  180. package/src/runtime/audit-logger.ts +39 -0
  181. package/src/runtime/base.ts +1329 -0
  182. package/src/services/__tests__/access-control.integration.test.ts +443 -0
  183. package/src/services/__tests__/access-control.proof-response-validation.test.ts +578 -0
  184. package/src/services/__tests__/access-control.service.test.ts +970 -0
  185. package/src/services/__tests__/batch-delegation.service.test.ts +351 -0
  186. package/src/services/__tests__/crypto.service.test.ts +531 -0
  187. package/src/services/__tests__/oauth-provider-registry.test.ts +142 -0
  188. package/src/services/__tests__/proof-verifier.integration.test.ts +485 -0
  189. package/src/services/__tests__/proof-verifier.test.ts +489 -0
  190. package/src/services/__tests__/provider-resolution.integration.test.ts +198 -0
  191. package/src/services/__tests__/provider-resolver.test.ts +217 -0
  192. package/src/services/__tests__/storage.service.test.ts +358 -0
  193. package/src/services/access-control.service.ts +990 -0
  194. package/src/services/authorization/authorization-registry.ts +66 -0
  195. package/src/services/authorization/types.ts +71 -0
  196. package/src/services/batch-delegation.service.ts +137 -0
  197. package/src/services/crypto.service.ts +302 -0
  198. package/src/services/errors.ts +76 -0
  199. package/src/services/index.ts +9 -0
  200. package/src/services/oauth-config.service.d.ts +53 -0
  201. package/src/services/oauth-config.service.d.ts.map +1 -0
  202. package/src/services/oauth-config.service.js +113 -0
  203. package/src/services/oauth-config.service.js.map +1 -0
  204. package/src/services/oauth-config.service.ts +166 -0
  205. package/src/services/oauth-provider-registry.d.ts +57 -0
  206. package/src/services/oauth-provider-registry.d.ts.map +1 -0
  207. package/src/services/oauth-provider-registry.js +73 -0
  208. package/src/services/oauth-provider-registry.js.map +1 -0
  209. package/src/services/oauth-provider-registry.ts +123 -0
  210. package/src/services/oauth-service.ts +510 -0
  211. package/src/services/oauth-token-retrieval.service.ts +245 -0
  212. package/src/services/proof-verifier.ts +478 -0
  213. package/src/services/provider-resolver.d.ts +48 -0
  214. package/src/services/provider-resolver.d.ts.map +1 -0
  215. package/src/services/provider-resolver.js +106 -0
  216. package/src/services/provider-resolver.js.map +1 -0
  217. package/src/services/provider-resolver.ts +144 -0
  218. package/src/services/provider-validator.ts +170 -0
  219. package/src/services/storage.service.ts +566 -0
  220. package/src/services/tool-context-builder.ts +172 -0
  221. package/src/services/tool-protection.service.ts +958 -0
  222. package/src/types/oauth-required-error.ts +63 -0
  223. package/src/types/tool-protection.ts +155 -0
  224. package/src/utils/__tests__/did-helpers.test.ts +101 -0
  225. package/src/utils/base64.ts +148 -0
  226. package/src/utils/cors.ts +83 -0
  227. package/src/utils/did-helpers.ts +150 -0
  228. package/src/utils/index.ts +8 -0
  229. package/src/utils/storage-keys.ts +278 -0
  230. package/tsconfig.json +21 -0
  231. package/vitest.config.ts +56 -0
@@ -0,0 +1,4514 @@
1
+
2
+ 
3
+ > @kya-os/mcp-i-core@1.2.2-canary.38 test:coverage /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
4
+ > vitest run --coverage
5
+
6
+ [?25l
7
+  RUN  v4.0.5 /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
8
+ Coverage enabled with v8
9
+
10
+ [?2026h
11
+  ❯ src/__tests__/services/agentshield-integration.test.ts [queued]
12
+
13
+  Test Files 0 passed (44)
14
+  Tests 0 passed (0)
15
+  Start at 17:52:48
16
+  Duration 102ms
17
+ [?2026l[?2026h
18
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts [queued]
19
+  ❯ src/__tests__/integration.test.ts [queued]
20
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
21
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
22
+  ❯ src/__tests__/services/agentshield-integration.test.ts [queued]
23
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 0/19
24
+  ❯ src/__tests__/services/tool-protection.service.test.ts [queued]
25
+  ❯ src/delegation/__tests__/vc-issuer.test.ts [queued]
26
+  ❯ src/delegation/__tests__/vc-verifier.test.ts [queued]
27
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts [queued]
28
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
29
+  ❯ src/services/__tests__/access-control.service.test.ts [queued]
30
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
31
+
32
+  Test Files 0 passed (44)
33
+  Tests 0 passed (19)
34
+  Start at 17:52:48
35
+  Duration 202ms
36
+ [?2026l[?2026hstderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle empty scopes array
37
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
38
+
39
+ 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)
40
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
41
+
42
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle unknown scope prefixes
43
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
44
+
45
+
46
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
47
+  ❯ src/__tests__/integration.test.ts [queued]
48
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
49
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
50
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
51
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
52
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
53
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
54
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
55
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
56
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
57
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
58
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
59
+
60
+  Test Files 3 passed (44)
61
+  Tests 95 passed | 1 skipped (253)
62
+  Start at 17:52:48
63
+  Duration 302ms
64
+ [?2026l[?2026hstdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify gmail → google mapping works
65
+ [ProviderResolver] Inferred provider "google" from scopes
66
+
67
+ 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
68
+ [ProviderResolver] Inferred provider "google" from scopes
69
+
70
+ 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
71
+ [ProviderResolver] Inferred provider "microsoft" from scopes
72
+
73
+
74
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
75
+  ❯ src/__tests__/integration.test.ts [queued]
76
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
77
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
78
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
79
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
80
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
81
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
82
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
83
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
84
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
85
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
86
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
87
+
88
+  Test Files 3 passed (44)
89
+  Tests 95 passed | 1 skipped (253)
90
+  Start at 17:52:48
91
+  Duration 302ms
92
+ [?2026l[?2026hstderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle scopes without colons
93
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
94
+
95
+ 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
96
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "google" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
97
+
98
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Fallback behavior (Priority 3) > should use first configured provider when oauthProvider not specified
99
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
100
+
101
+
102
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
103
+  ❯ src/__tests__/integration.test.ts [queued]
104
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
105
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
106
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
107
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
108
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
109
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
110
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
111
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
112
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
113
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
114
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
115
+
116
+  Test Files 3 passed (44)
117
+  Tests 95 passed | 1 skipped (253)
118
+  Start at 17:52:48
119
+  Duration 302ms
120
+ [?2026l[?2026hstdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Provider name case sensitivity > should handle provider names case-insensitively in inference
121
+ [ProviderResolver] Inferred provider "github" from scopes
122
+
123
+ 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
124
+ [ProviderResolver] Inferred provider "github" from scopes
125
+
126
+ ✓ src/__tests__/services/provider-resolver-edge-cases.test.ts (19 tests | 1 skipped) 7ms
127
+ ✓ src/delegation/storage/__tests__/memory-graph-storage.test.ts (27 tests) 5ms
128
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use X-API-Key header for new endpoint
129
+ [ToolProtectionService] Config loaded from API {
130
+ source: 'api',
131
+ toolCount: 0,
132
+ protectedTools: [],
133
+ agentDid: 'did:key:z6MkhaXgBZDv...',
134
+ projectId: 'test-project-123',
135
+ cacheTtlMs: 300000,
136
+ cacheExpiresAt: '2025-11-24T23:57:48.638Z'
137
+ }
138
+
139
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use Authorization Bearer header for old endpoint
140
+ [ToolProtectionService] Config loaded from API {
141
+ source: 'api',
142
+ toolCount: 0,
143
+ protectedTools: [],
144
+ agentDid: 'did:key:z6MkhaXgBZDv...',
145
+ projectId: 'none',
146
+ cacheTtlMs: 300000,
147
+ cacheExpiresAt: '2025-11-24T23:57:48.642Z'
148
+ }
149
+
150
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use project-scoped endpoint when projectId is available
151
+ [ToolProtectionService] Config loaded from API {
152
+ source: 'api',
153
+ toolCount: 0,
154
+ protectedTools: [],
155
+ agentDid: 'did:key:z6MkhaXgBZDv...',
156
+ projectId: 'test-project-123',
157
+ cacheTtlMs: 300000,
158
+ cacheExpiresAt: '2025-11-24T23:57:48.643Z'
159
+ }
160
+
161
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use agent-scoped endpoint when projectId is not available
162
+ [ToolProtectionService] Config loaded from API {
163
+ source: 'api',
164
+ toolCount: 0,
165
+ protectedTools: [],
166
+ agentDid: 'did:key:z6MkhaXgBZDv...',
167
+ projectId: 'none',
168
+ cacheTtlMs: 300000,
169
+ cacheExpiresAt: '2025-11-24T23:57:48.643Z'
170
+ }
171
+
172
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode projectId in URL
173
+ [ToolProtectionService] Config loaded from API {
174
+ source: 'api',
175
+ toolCount: 0,
176
+ protectedTools: [],
177
+ agentDid: 'did:key:z6MkhaXgBZDv...',
178
+ projectId: 'project/with/special-chars',
179
+ cacheTtlMs: 300000,
180
+ cacheExpiresAt: '2025-11-24T23:57:48.644Z'
181
+ }
182
+
183
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode agent DID in URL
184
+ [ToolProtectionService] Config loaded from API {
185
+ source: 'api',
186
+ toolCount: 0,
187
+ protectedTools: [],
188
+ agentDid: 'did:key:z6MkhaXgBZDv...',
189
+ projectId: 'none',
190
+ cacheTtlMs: 300000,
191
+ cacheExpiresAt: '2025-11-24T23:57:48.644Z'
192
+ }
193
+
194
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle new endpoint format (toolProtections object)
195
+ [ToolProtectionService] Config loaded from API {
196
+ source: 'api',
197
+ toolCount: 2,
198
+ protectedTools: [ 'checkout' ],
199
+ agentDid: 'did:key:z6MkhaXgBZDv...',
200
+ projectId: 'test-project-123',
201
+ cacheTtlMs: 300000,
202
+ cacheExpiresAt: '2025-11-24T23:57:48.644Z'
203
+ }
204
+
205
+ 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
206
+ [ToolProtectionService] Config loaded from API {
207
+ source: 'api',
208
+ toolCount: 2,
209
+ protectedTools: [ 'checkout' ],
210
+ agentDid: 'did:key:z6MkhaXgBZDv...',
211
+ projectId: 'test-project-123',
212
+ cacheTtlMs: 300000,
213
+ cacheExpiresAt: '2025-11-24T23:57:48.643Z'
214
+ }
215
+
216
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools array)
217
+ [ToolProtectionService] Config loaded from API {
218
+ source: 'api',
219
+ toolCount: 2,
220
+ protectedTools: [ 'checkout' ],
221
+ agentDid: 'did:key:z6MkhaXgBZDv...',
222
+ projectId: 'none',
223
+ cacheTtlMs: 300000,
224
+ cacheExpiresAt: '2025-11-24T23:57:48.644Z'
225
+ }
226
+
227
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools object)
228
+ [ToolProtectionService] Config loaded from API {
229
+ source: 'api',
230
+ toolCount: 2,
231
+ protectedTools: [ 'checkout' ],
232
+ agentDid: 'did:key:z6MkhaXgBZDv...',
233
+ projectId: 'none',
234
+ cacheTtlMs: 300000,
235
+ cacheExpiresAt: '2025-11-24T23:57:48.644Z'
236
+ }
237
+
238
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle snake_case field names
239
+ [ToolProtectionService] Config loaded from API {
240
+ source: 'api',
241
+ toolCount: 1,
242
+ protectedTools: [ 'tool1' ],
243
+ agentDid: 'did:key:z6MkhaXgBZDv...',
244
+ projectId: 'test-project-123',
245
+ cacheTtlMs: 300000,
246
+ cacheExpiresAt: '2025-11-24T23:57:48.645Z'
247
+ }
248
+
249
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle camelCase field names
250
+ [ToolProtectionService] Config loaded from API {
251
+ source: 'api',
252
+ toolCount: 1,
253
+ protectedTools: [ 'tool1' ],
254
+ agentDid: 'did:key:z6MkhaXgBZDv...',
255
+ projectId: 'test-project-123',
256
+ cacheTtlMs: 300000,
257
+ cacheExpiresAt: '2025-11-24T23:57:48.645Z'
258
+ }
259
+
260
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should prefer camelCase over snake_case when both present
261
+ [ToolProtectionService] Config loaded from API {
262
+ source: 'api',
263
+ toolCount: 1,
264
+ protectedTools: [ 'tool1' ],
265
+ agentDid: 'did:key:z6MkhaXgBZDv...',
266
+ projectId: 'test-project-123',
267
+ cacheTtlMs: 300000,
268
+ cacheExpiresAt: '2025-11-24T23:57:48.645Z'
269
+ }
270
+
271
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should handle new endpoint format with toolProtections object
272
+ [ToolProtectionService] Config loaded from API {
273
+ source: 'api',
274
+ toolCount: 2,
275
+ protectedTools: [ 'protected_tool' ],
276
+ agentDid: 'did:key:z6MkhaXgBZDv...',
277
+ projectId: 'test-project-123',
278
+ cacheTtlMs: 300000,
279
+ cacheExpiresAt: '2025-11-24T23:57:48.645Z'
280
+ }
281
+
282
+ 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)
283
+ [ToolProtectionService] Config loaded from API {
284
+ source: 'api',
285
+ toolCount: 2,
286
+ protectedTools: [ 'read_repos', 'send_email' ],
287
+ agentDid: 'did:key:z6MkhaXgBZDv...',
288
+ projectId: 'test-project-123',
289
+ cacheTtlMs: 300000,
290
+ cacheExpiresAt: '2025-11-24T23:57:48.645Z'
291
+ }
292
+
293
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should preserve oauthProvider through cache operations
294
+ [ToolProtectionService] Config loaded from API {
295
+ source: 'api',
296
+ toolCount: 1,
297
+ protectedTools: [ 'read_repos' ],
298
+ agentDid: 'did:key:z6MkhaXgBZDv...',
299
+ projectId: 'test-project-123',
300
+ cacheTtlMs: 300000,
301
+ cacheExpiresAt: '2025-11-24T23:57:48.645Z'
302
+ }
303
+
304
+ 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
305
+ [ToolProtectionService] Config loaded from API {
306
+ source: 'api',
307
+ toolCount: 2,
308
+ protectedTools: [ 'checkout' ],
309
+ agentDid: 'did:key:z6MkhaXgBZDv...',
310
+ projectId: 'none',
311
+ cacheTtlMs: 300000,
312
+ cacheExpiresAt: '2025-11-24T23:57:48.645Z'
313
+ }
314
+
315
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools array
316
+ [ToolProtectionService] Config loaded from API {
317
+ source: 'api',
318
+ toolCount: 2,
319
+ protectedTools: [ 'tool1' ],
320
+ agentDid: 'did:key:z6MkhaXgBZDv...',
321
+ projectId: 'none',
322
+ cacheTtlMs: 300000,
323
+ cacheExpiresAt: '2025-11-24T23:57:48.646Z'
324
+ }
325
+
326
+ 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)
327
+ [ToolProtectionService] Config loaded from API {
328
+ source: 'api',
329
+ toolCount: 2,
330
+ protectedTools: [ 'read_repos', 'send_email' ],
331
+ agentDid: 'did:key:z6MkhaXgBZDv...',
332
+ projectId: 'none',
333
+ cacheTtlMs: 300000,
334
+ cacheExpiresAt: '2025-11-24T23:57:48.646Z'
335
+ }
336
+
337
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools object
338
+ [ToolProtectionService] Config loaded from API {
339
+ source: 'api',
340
+ toolCount: 2,
341
+ protectedTools: [ 'tool1' ],
342
+ agentDid: 'did:key:z6MkhaXgBZDv...',
343
+ projectId: 'none',
344
+ cacheTtlMs: 300000,
345
+ cacheExpiresAt: '2025-11-24T23:57:48.646Z'
346
+ }
347
+
348
+ 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)
349
+ [ToolProtectionService] Config loaded from API {
350
+ source: 'api',
351
+ toolCount: 2,
352
+ protectedTools: [ 'read_repos', 'send_email' ],
353
+ agentDid: 'did:key:z6MkhaXgBZDv...',
354
+ projectId: 'none',
355
+ cacheTtlMs: 300000,
356
+ cacheExpiresAt: '2025-11-24T23:57:48.646Z'
357
+ }
358
+
359
+
360
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
361
+  ❯ src/__tests__/integration.test.ts [queued]
362
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
363
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
364
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
365
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
366
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
367
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
368
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
369
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
370
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
371
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
372
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
373
+
374
+  Test Files 3 passed (44)
375
+  Tests 95 passed | 1 skipped (253)
376
+  Start at 17:52:48
377
+  Duration 302ms
378
+ [?2026l[?2026hstderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Error Handling > should handle network timeout
379
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
380
+
381
+ stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Fallback Behavior > should cache fallback config
382
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
383
+
384
+
385
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
386
+  ❯ src/__tests__/integration.test.ts [queued]
387
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
388
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
389
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
390
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
391
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
392
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
393
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
394
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
395
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
396
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
397
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
398
+
399
+  Test Files 3 passed (44)
400
+  Tests 95 passed | 1 skipped (253)
401
+  Start at 17:52:48
402
+  Duration 302ms
403
+ [?2026l[?2026hstdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should cache successful API responses
404
+ [ToolProtectionService] Config loaded from API {
405
+ source: 'api',
406
+ toolCount: 1,
407
+ protectedTools: [ 'tool1' ],
408
+ agentDid: 'did:key:z6MkhaXgBZDv...',
409
+ projectId: 'test-project-123',
410
+ cacheTtlMs: 300000,
411
+ cacheExpiresAt: '2025-11-24T23:57:48.647Z'
412
+ }
413
+
414
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
415
+ [ToolProtectionService] Cache miss, fetching from API {
416
+ source: 'api-fetch-start',
417
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
418
+ agentDid: 'did:key:z6MkhaXgBZDv...',
419
+ projectId: 'none',
420
+ apiUrl: 'https://kya.vouched.id',
421
+ endpoint: '/api/v1/bouncer/config?agent_did=did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
422
+ }
423
+ [ToolProtectionService] Fetching from API: https://kya.vouched.id/api/v1/bouncer/config?agent_did=did%3Akey%3Az6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK {
424
+ method: 'config?agent_did (old)',
425
+ projectId: 'none',
426
+ apiKeyPresent: true,
427
+ apiKeyLength: 18,
428
+ apiKeyMasked: 'test-api...'
429
+ }
430
+
431
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
432
+ [ToolProtectionService] API response received {
433
+ source: 'api-fetch-complete',
434
+ agentDid: 'did:key:z6MkhaXgBZDv...',
435
+ projectId: 'none',
436
+ responseKeys: [ 'success', 'data', 'metadata' ],
437
+ dataKeys: [ 'tools' ],
438
+ rawToolProtections: null,
439
+ rawTools: [
440
+ { name: 'valid_tool', requiresDelegation: true },
441
+ { requiresDelegation: false }
442
+ ],
443
+ responseMetadata: {}
444
+ }
445
+
446
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
447
+ [ToolProtectionService] Config loaded from API {
448
+ source: 'api',
449
+ toolCount: 1,
450
+ protectedTools: [ 'valid_tool' ],
451
+ agentDid: 'did:key:z6MkhaXgBZDv...',
452
+ projectId: 'none',
453
+ cacheTtlMs: 300000,
454
+ cacheExpiresAt: '2025-11-24T23:57:48.647Z'
455
+ }
456
+ [ToolProtectionService] API fetch successful, config cached {
457
+ source: 'cache-write',
458
+ agentDid: 'did:key:z6MkhaXgBZDv...',
459
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
460
+ toolCount: 1,
461
+ tools: [ { name: 'valid_tool', requiresDelegation: true, scopeCount: 0 } ],
462
+ ttlMs: 300000,
463
+ ttlMinutes: 5,
464
+ expiresAt: '2025-11-24T23:57:48.647Z',
465
+ expiresIn: '300s'
466
+ }
467
+
468
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
469
+ [ToolProtectionService] Config loaded from API {
470
+ source: 'api',
471
+ toolCount: 0,
472
+ protectedTools: [],
473
+ agentDid: 'did:key:z6MkhaXgBZDv...',
474
+ projectId: 'test-project-123',
475
+ cacheTtlMs: 1000,
476
+ cacheExpiresAt: '2025-11-24T23:52:49.647Z'
477
+ }
478
+
479
+
480
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
481
+  ❯ src/__tests__/integration.test.ts [queued]
482
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
483
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
484
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
485
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
486
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
487
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
488
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
489
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
490
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
491
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
492
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
493
+
494
+  Test Files 3 passed (44)
495
+  Tests 95 passed | 1 skipped (253)
496
+  Start at 17:52:48
497
+  Duration 302ms
498
+ [?2026l[?2026hstderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch error handling > should handle network errors gracefully
499
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
500
+ agentDid: 'did:key:z6MkhaXgBZDv...',
501
+ error: 'ECONNREFUSED',
502
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
503
+ }
504
+
505
+
506
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
507
+  ❯ src/__tests__/integration.test.ts [queued]
508
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
509
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
510
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
511
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
512
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
513
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
514
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
515
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
516
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
517
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
518
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
519
+
520
+  Test Files 3 passed (44)
521
+  Tests 95 passed | 1 skipped (253)
522
+  Start at 17:52:48
523
+  Duration 302ms
524
+ [?2026l[?2026hstdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should cache successful API responses
525
+ [ToolProtectionService] Config loaded from API {
526
+ source: 'api',
527
+ toolCount: 1,
528
+ protectedTools: [ 'tool1' ],
529
+ agentDid: 'did:key:z6MkhaXgBZDv...',
530
+ projectId: 'none',
531
+ cacheTtlMs: 300000,
532
+ cacheExpiresAt: '2025-11-24T23:57:48.650Z'
533
+ }
534
+
535
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use default cache TTL when not specified
536
+ [ToolProtectionService] Config loaded from API {
537
+ source: 'api',
538
+ toolCount: 0,
539
+ protectedTools: [],
540
+ agentDid: 'did:key:z6MkhaXgBZDv...',
541
+ projectId: 'none',
542
+ cacheTtlMs: 300000,
543
+ cacheExpiresAt: '2025-11-24T23:57:48.650Z'
544
+ }
545
+
546
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use custom cache TTL when specified
547
+ [ToolProtectionService] Config loaded from API {
548
+ source: 'api',
549
+ toolCount: 0,
550
+ protectedTools: [],
551
+ agentDid: 'did:key:z6MkhaXgBZDv...',
552
+ projectId: 'none',
553
+ cacheTtlMs: 600000,
554
+ cacheExpiresAt: '2025-11-25T00:02:48.651Z'
555
+ }
556
+
557
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle empty toolProtections object
558
+ [ToolProtectionService] Config loaded from API {
559
+ source: 'api',
560
+ toolCount: 0,
561
+ protectedTools: [],
562
+ agentDid: 'did:key:z6MkhaXgBZDv...',
563
+ projectId: 'none',
564
+ cacheTtlMs: 300000,
565
+ cacheExpiresAt: '2025-11-24T23:57:48.651Z'
566
+ }
567
+
568
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle null requiredScopes
569
+ [ToolProtectionService] Config loaded from API {
570
+ source: 'api',
571
+ toolCount: 1,
572
+ protectedTools: [ 'tool1' ],
573
+ agentDid: 'did:key:z6MkhaXgBZDv...',
574
+ projectId: 'none',
575
+ cacheTtlMs: 300000,
576
+ cacheExpiresAt: '2025-11-24T23:57:48.651Z'
577
+ }
578
+
579
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle mixed camelCase and snake_case in response
580
+ [ToolProtectionService] Config loaded from API {
581
+ source: 'api',
582
+ toolCount: 2,
583
+ protectedTools: [ 'tool1' ],
584
+ agentDid: 'did:key:z6MkhaXgBZDv...',
585
+ projectId: 'none',
586
+ cacheTtlMs: 300000,
587
+ cacheExpiresAt: '2025-11-24T23:57:48.651Z'
588
+ }
589
+
590
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool has no protection
591
+ [ToolProtectionService] Config loaded from API {
592
+ source: 'api',
593
+ toolCount: 1,
594
+ protectedTools: [],
595
+ agentDid: 'did:key:z6MkhaXgBZDv...',
596
+ projectId: 'none',
597
+ cacheTtlMs: 300000,
598
+ cacheExpiresAt: '2025-11-24T23:57:48.651Z'
599
+ }
600
+
601
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
602
+ [ToolProtectionService] Config loaded from API {
603
+ source: 'api',
604
+ toolCount: 1,
605
+ protectedTools: [ 'other_tool' ],
606
+ agentDid: 'did:key:z6MkhaXgBZDv...',
607
+ projectId: 'none',
608
+ cacheTtlMs: 300000,
609
+ cacheExpiresAt: '2025-11-24T23:57:48.654Z'
610
+ }
611
+
612
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
613
+ [ToolProtectionService] Protection check {
614
+ tool: 'unknown_tool',
615
+ agentDid: 'did:key:z6MkhaXgBZDv...',
616
+ found: false,
617
+ isWildcard: true,
618
+ requiresDelegation: false,
619
+ availableTools: [ 'other_tool' ]
620
+ }
621
+
622
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
623
+ [ToolProtectionService] Config loaded from API {
624
+ source: 'api',
625
+ toolCount: 2,
626
+ protectedTools: [ '*' ],
627
+ agentDid: 'did:key:z6MkhaXgBZDv...',
628
+ projectId: 'none',
629
+ cacheTtlMs: 300000,
630
+ cacheExpiresAt: '2025-11-24T23:57:48.654Z'
631
+ }
632
+
633
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
634
+ [ToolProtectionService] Protection check {
635
+ tool: 'unknown_tool',
636
+ agentDid: 'did:key:z6MkhaXgBZDv...',
637
+ found: true,
638
+ isWildcard: true,
639
+ requiresDelegation: true,
640
+ availableTools: [ '*', 'specific_tool' ]
641
+ }
642
+
643
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should prioritize specific tool protection over wildcard
644
+ [ToolProtectionService] Config loaded from API {
645
+ source: 'api',
646
+ toolCount: 2,
647
+ protectedTools: [ '*' ],
648
+ agentDid: 'did:key:z6MkhaXgBZDv...',
649
+ projectId: 'none',
650
+ cacheTtlMs: 300000,
651
+ cacheExpiresAt: '2025-11-24T23:57:48.654Z'
652
+ }
653
+
654
+
655
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
656
+  ❯ src/__tests__/integration.test.ts [queued]
657
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
658
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
659
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
660
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
661
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
662
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
663
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
664
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
665
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
666
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
667
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
668
+
669
+  Test Files 3 passed (44)
670
+  Tests 95 passed | 1 skipped (253)
671
+  Start at 17:52:48
672
+  Duration 302ms
673
+ [?2026l[?2026hstderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
674
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
675
+ agentDid: 'did:key:z6MkhaXgBZDv...',
676
+ error: 'Network error',
677
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
678
+ }
679
+
680
+
681
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
682
+  ❯ src/__tests__/integration.test.ts [queued]
683
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
684
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
685
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
686
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
687
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
688
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
689
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
690
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
691
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
692
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
693
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
694
+
695
+  Test Files 3 passed (44)
696
+  Tests 95 passed | 1 skipped (253)
697
+  Start at 17:52:48
698
+  Duration 302ms
699
+ [?2026l[?2026hstdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
700
+ [ToolProtectionService] Protection check {
701
+ tool: 'any_tool',
702
+ agentDid: 'did:key:z6MkhaXgBZDv...',
703
+ found: true,
704
+ isWildcard: true,
705
+ requiresDelegation: true,
706
+ availableTools: [ '*' ]
707
+ }
708
+
709
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
710
+ [ToolProtectionService] Config loaded from API {
711
+ source: 'api',
712
+ toolCount: 1,
713
+ protectedTools: [ 'protected_tool' ],
714
+ agentDid: 'did:key:z6MkhaXgBZDv...',
715
+ projectId: 'none',
716
+ cacheTtlMs: 300000,
717
+ cacheExpiresAt: '2025-11-24T23:57:48.655Z'
718
+ }
719
+
720
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
721
+ [ToolProtectionService] Protection check {
722
+ tool: 'protected_tool',
723
+ agentDid: 'did:key:z6MkhaXgBZDv...',
724
+ found: true,
725
+ isWildcard: false,
726
+ requiresDelegation: true,
727
+ availableTools: [ 'protected_tool' ]
728
+ }
729
+
730
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
731
+ [ToolProtectionService] Config loaded from API {
732
+ source: 'api',
733
+ toolCount: 1,
734
+ protectedTools: [ 'tool1' ],
735
+ agentDid: 'did:key:z6MkhaXgBZDv...',
736
+ projectId: 'none',
737
+ cacheTtlMs: 300000,
738
+ cacheExpiresAt: '2025-11-24T23:57:48.655Z'
739
+ }
740
+
741
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
742
+ [ToolProtectionService] Config loaded from API {
743
+ source: 'api',
744
+ toolCount: 1,
745
+ protectedTools: [ 'tool1' ],
746
+ agentDid: 'did:key:z6MkhaXgBZDv...',
747
+ projectId: 'none',
748
+ cacheTtlMs: 300000,
749
+ cacheExpiresAt: '2025-11-24T23:57:48.655Z'
750
+ }
751
+
752
+ ✓ src/__tests__/services/tool-protection.service.test.ts (49 tests) 17ms
753
+
754
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
755
+  ❯ src/__tests__/integration.test.ts [queued]
756
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
757
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
758
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
759
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
760
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
761
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
762
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
763
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
764
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
765
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
766
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
767
+
768
+  Test Files 3 passed (44)
769
+  Tests 95 passed | 1 skipped (253)
770
+  Start at 17:52:48
771
+  Duration 302ms
772
+ [?2026l[?2026hstderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should submit proofs successfully
773
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
774
+ correlationId: '65b85076-4377-4e1f-bf37-836838433b88',
775
+ status: 200,
776
+ statusText: '',
777
+ headers: { 'content-type': 'application/json' },
778
+ responseTextLength: 100,
779
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
780
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
781
+ }
782
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
783
+ correlationId: '65b85076-4377-4e1f-bf37-836838433b88',
784
+ status: 200,
785
+ responseDataType: 'object',
786
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
787
+ responseData: '{\n' +
788
+ ' "success": true,\n' +
789
+ ' "accepted": 1,\n' +
790
+ ' "rejected": 0,\n' +
791
+ ' "outcomes": {\n' +
792
+ ' "success": 1,\n' +
793
+ ' "failed": 0,\n' +
794
+ ' "blocked": 0,\n' +
795
+ ' "error": 0\n' +
796
+ ' }\n' +
797
+ '}'
798
+ }
799
+ [AccessControl] Raw response received: {
800
+ "success": true,
801
+ "accepted": 1,
802
+ "rejected": 0,
803
+ "outcomes": {
804
+ "success": 1,
805
+ "failed": 0,
806
+ "blocked": 0,
807
+ "error": 0
808
+ }
809
+ }
810
+
811
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle all_proofs_rejected error gracefully
812
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
813
+ correlationId: '11b587b4-ac6e-43ef-bafa-12bda57e5630',
814
+ status: 400,
815
+ statusText: '',
816
+ headers: { 'content-type': 'application/json' },
817
+ responseTextLength: 209,
818
+ 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"}}]}}}',
819
+ 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"}}]}}}'
820
+ }
821
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
822
+ correlationId: '11b587b4-ac6e-43ef-bafa-12bda57e5630',
823
+ status: 400,
824
+ responseDataType: 'object',
825
+ responseDataKeys: [ 'success', 'error' ],
826
+ responseData: '{\n' +
827
+ ' "success": false,\n' +
828
+ ' "error": {\n' +
829
+ ' "code": "all_proofs_rejected",\n' +
830
+ ' "message": "All proofs rejected",\n' +
831
+ ' "details": {\n' +
832
+ ' "rejected": 1,\n' +
833
+ ' "errors": [\n' +
834
+ ' {\n' +
835
+ ' "proof_index": 0,\n' +
836
+ ' "error": {\n' +
837
+ ' "code": "invalid_signature",\n' +
838
+ ' "message": "Invalid signature"\n' +
839
+ ' }\n' +
840
+ ' }\n' +
841
+ ' ]\n' +
842
+ ' }\n' +
843
+ ' }\n' +
844
+ '}'
845
+ }
846
+
847
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response format
848
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
849
+ correlationId: '5ac1bfa3-006b-4bb7-9082-67a24030fafe',
850
+ status: 200,
851
+ statusText: '',
852
+ headers: { 'content-type': 'application/json' },
853
+ responseTextLength: 206,
854
+ 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-24T23:52:48.685Z"}}',
855
+ 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-24T23:52:48.685Z"}}'
856
+ }
857
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
858
+ correlationId: '5ac1bfa3-006b-4bb7-9082-67a24030fafe',
859
+ status: 200,
860
+ responseDataType: 'object',
861
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
862
+ responseData: '{\n' +
863
+ ' "success": true,\n' +
864
+ ' "data": {\n' +
865
+ ' "success": true,\n' +
866
+ ' "accepted": 1,\n' +
867
+ ' "rejected": 0,\n' +
868
+ ' "outcomes": {\n' +
869
+ ' "success": 1,\n' +
870
+ ' "failed": 0,\n' +
871
+ ' "blocked": 0,\n' +
872
+ ' "error": 0\n' +
873
+ ' }\n' +
874
+ ' },\n' +
875
+ ' "metadata": {\n' +
876
+ ' "requestId": "test-request-id",\n' +
877
+ ' "timestamp": "2025-11-24T23:52:48.685Z"\n' +
878
+ ' }\n' +
879
+ '}'
880
+ }
881
+ [AccessControl] Raw response received: {
882
+ "success": true,
883
+ "data": {
884
+ "success": true,
885
+ "accepted": 1,
886
+ "rejected": 0,
887
+ "outcomes": {
888
+ "success": 1,
889
+ "failed": 0,
890
+ "blocked": 0,
891
+ "error": 0
892
+ }
893
+ },
894
+ "metadata": {
895
+ "requestId": "test-request-id",
896
+ "timestamp": "2025-11-24T23:52:48.685Z"
897
+ }
898
+ }
899
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
900
+ correlationId: '5ac1bfa3-006b-4bb7-9082-67a24030fafe',
901
+ dataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
902
+ hasAccepted: true,
903
+ hasRejected: true,
904
+ hasOutcomes: true,
905
+ hasErrors: false,
906
+ acceptedType: 'number',
907
+ acceptedValue: 1,
908
+ rejectedType: 'number',
909
+ rejectedValue: 0,
910
+ outcomesType: 'object',
911
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
912
+ errorsType: 'undefined',
913
+ errorsIsArray: false,
914
+ fullData: '{\n' +
915
+ ' "success": true,\n' +
916
+ ' "accepted": 1,\n' +
917
+ ' "rejected": 0,\n' +
918
+ ' "outcomes": {\n' +
919
+ ' "success": 1,\n' +
920
+ ' "failed": 0,\n' +
921
+ ' "blocked": 0,\n' +
922
+ ' "error": 0\n' +
923
+ ' }\n' +
924
+ '}'
925
+ }
926
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
927
+ correlationId: '5ac1bfa3-006b-4bb7-9082-67a24030fafe',
928
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
929
+ hasSuccess: true,
930
+ successValue: true,
931
+ hasAccepted: true,
932
+ acceptedValue: 1,
933
+ hasRejected: true,
934
+ rejectedValue: 0,
935
+ hasOutcomes: true,
936
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
937
+ fullDataWithSuccess: '{\n' +
938
+ ' "success": true,\n' +
939
+ ' "accepted": 1,\n' +
940
+ ' "rejected": 0,\n' +
941
+ ' "outcomes": {\n' +
942
+ ' "success": 1,\n' +
943
+ ' "failed": 0,\n' +
944
+ ' "blocked": 0,\n' +
945
+ ' "error": 0\n' +
946
+ ' }\n' +
947
+ '}'
948
+ }
949
+
950
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
951
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
952
+ correlationId: '027b427a-ce0e-42c1-9193-038ce989ead0',
953
+ status: 200,
954
+ statusText: '',
955
+ headers: { 'content-type': 'application/json' },
956
+ responseTextLength: 42,
957
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0}',
958
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0}'
959
+ }
960
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
961
+ correlationId: '027b427a-ce0e-42c1-9193-038ce989ead0',
962
+ status: 200,
963
+ responseDataType: 'object',
964
+ responseDataKeys: [ 'success', 'accepted', 'rejected' ],
965
+ responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
966
+ }
967
+ [AccessControl] Raw response received: {
968
+ "success": true,
969
+ "accepted": 1,
970
+ "rejected": 0
971
+ }
972
+
973
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
974
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
975
+ correlationId: 'f783783f-2004-4322-ab55-454b76b141ac',
976
+ status: 200,
977
+ statusText: '',
978
+ headers: { 'content-type': 'application/json' },
979
+ responseTextLength: 100,
980
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
981
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
982
+ }
983
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
984
+ correlationId: 'f783783f-2004-4322-ab55-454b76b141ac',
985
+ status: 200,
986
+ responseDataType: 'object',
987
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
988
+ responseData: '{\n' +
989
+ ' "success": true,\n' +
990
+ ' "accepted": 1,\n' +
991
+ ' "rejected": 0,\n' +
992
+ ' "outcomes": {\n' +
993
+ ' "success": 1,\n' +
994
+ ' "failed": 0,\n' +
995
+ ' "blocked": 0,\n' +
996
+ ' "error": 0\n' +
997
+ ' }\n' +
998
+ '}'
999
+ }
1000
+ [AccessControl] Raw response received: {
1001
+ "success": true,
1002
+ "accepted": 1,
1003
+ "rejected": 0,
1004
+ "outcomes": {
1005
+ "success": 1,
1006
+ "failed": 0,
1007
+ "blocked": 0,
1008
+ "error": 0
1009
+ }
1010
+ }
1011
+
1012
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
1013
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1014
+ correlationId: '349ca8ce-6a47-4afa-8c0a-37e36c407b8c',
1015
+ status: 200,
1016
+ statusText: '',
1017
+ headers: { 'content-type': 'application/json' },
1018
+ responseTextLength: 56,
1019
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}',
1020
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}'
1021
+ }
1022
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1023
+ correlationId: '349ca8ce-6a47-4afa-8c0a-37e36c407b8c',
1024
+ status: 200,
1025
+ responseDataType: 'object',
1026
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1027
+ responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0,\n "outcomes": {}\n}'
1028
+ }
1029
+ [AccessControl] Raw response received: {
1030
+ "success": true,
1031
+ "accepted": 1,
1032
+ "rejected": 0,
1033
+ "outcomes": {}
1034
+ }
1035
+
1036
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response with invalid data structure
1037
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1038
+ correlationId: '98fb8b6f-6133-4c82-b1c8-1da92ef65003',
1039
+ status: 200,
1040
+ statusText: '',
1041
+ headers: { 'content-type': 'application/json' },
1042
+ responseTextLength: 52,
1043
+ responseTextPreview: '{"success":true,"data":{"message":"Invalid format"}}',
1044
+ fullResponseText: '{"success":true,"data":{"message":"Invalid format"}}'
1045
+ }
1046
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1047
+ correlationId: '98fb8b6f-6133-4c82-b1c8-1da92ef65003',
1048
+ status: 200,
1049
+ responseDataType: 'object',
1050
+ responseDataKeys: [ 'success', 'data' ],
1051
+ responseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
1052
+ }
1053
+ [AccessControl] Raw response received: {
1054
+ "success": true,
1055
+ "data": {
1056
+ "message": "Invalid format"
1057
+ }
1058
+ }
1059
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1060
+ correlationId: '98fb8b6f-6133-4c82-b1c8-1da92ef65003',
1061
+ dataKeys: [ 'message' ],
1062
+ hasAccepted: false,
1063
+ hasRejected: false,
1064
+ hasOutcomes: false,
1065
+ hasErrors: false,
1066
+ acceptedType: 'undefined',
1067
+ acceptedValue: undefined,
1068
+ rejectedType: 'undefined',
1069
+ rejectedValue: undefined,
1070
+ outcomesType: 'undefined',
1071
+ outcomesValue: undefined,
1072
+ errorsType: 'undefined',
1073
+ errorsIsArray: false,
1074
+ fullData: '{\n "message": "Invalid format"\n}'
1075
+ }
1076
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1077
+ correlationId: '98fb8b6f-6133-4c82-b1c8-1da92ef65003',
1078
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
1079
+ hasSuccess: true,
1080
+ successValue: true,
1081
+ hasAccepted: true,
1082
+ acceptedValue: undefined,
1083
+ hasRejected: true,
1084
+ rejectedValue: undefined,
1085
+ hasOutcomes: false,
1086
+ outcomesValue: undefined,
1087
+ fullDataWithSuccess: '{\n "success": true\n}'
1088
+ }
1089
+ [AccessControl] ❌ MISSING REQUIRED FIELDS AFTER CONSTRUCTION: {
1090
+ correlationId: '98fb8b6f-6133-4c82-b1c8-1da92ef65003',
1091
+ hasAccepted: true,
1092
+ acceptedType: 'undefined',
1093
+ acceptedValue: undefined,
1094
+ hasRejected: true,
1095
+ rejectedType: 'undefined',
1096
+ rejectedValue: undefined,
1097
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
1098
+ fullDataWithSuccess: '{\n "success": true\n}',
1099
+ dataToValidateKeys: [ 'message' ],
1100
+ fullDataToValidate: '{\n "message": "Invalid format"\n}',
1101
+ originalResponseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
1102
+ }
1103
+
1104
+
1105
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
1106
+  ❯ src/__tests__/integration.test.ts [queued]
1107
+  ❯ src/__tests__/runtime/proof-client-did.test.ts [queued]
1108
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
1109
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
1110
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 19/19
1111
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
1112
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
1113
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
1114
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts 27/27
1115
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
1116
+  ❯ src/services/__tests__/access-control.service.test.ts 1/23
1117
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
1118
+
1119
+  Test Files 3 passed (44)
1120
+  Tests 95 passed | 1 skipped (253)
1121
+  Start at 17:52:48
1122
+  Duration 302ms
1123
+ [?2026l[?2026h ✓ src/services/__tests__/access-control.service.test.ts (23 tests) 38ms
1124
+ ✓ src/delegation/__tests__/vc-verifier.test.ts (35 tests) 74ms
1125
+ ✓ src/delegation/__tests__/vc-issuer.test.ts (21 tests) 104ms
1126
+
1127
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1128
+  ❯ src/__tests__/integration.test.ts 0/9
1129
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1130
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1131
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
1132
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1133
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1134
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1135
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
1136
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1137
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1138
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
1139
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1140
+
1141
+  Test Files 8 passed (44)
1142
+  Tests 269 passed | 1 skipped (356)
1143
+  Start at 17:52:48
1144
+  Duration 403ms
1145
+ [?2026l[?2026hstderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyEd25519 > should return false on verification error
1146
+ [CryptoService] Ed25519 verification error: Error: Verification failed
1147
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:62:9
1148
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1149
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1150
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1151
+ at new Promise (<anonymous>)
1152
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1153
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1154
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1155
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
1156
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
1157
+
1158
+ stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
1159
+ [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
1160
+ at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
1161
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1162
+ at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
1163
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:252:7
1164
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
1165
+
1166
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject invalid JWK format
1167
+ [CryptoService] Invalid Ed25519 JWK format
1168
+
1169
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong kty
1170
+ [CryptoService] Invalid Ed25519 JWK format
1171
+
1172
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong crv
1173
+ [CryptoService] Invalid Ed25519 JWK format
1174
+
1175
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with missing x field
1176
+ [CryptoService] Invalid Ed25519 JWK format
1177
+
1178
+
1179
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1180
+  ❯ src/__tests__/integration.test.ts 0/9
1181
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1182
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1183
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
1184
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1185
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1186
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1187
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
1188
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1189
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1190
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
1191
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1192
+
1193
+  Test Files 8 passed (44)
1194
+  Tests 269 passed | 1 skipped (356)
1195
+  Start at 17:52:48
1196
+  Duration 403ms
1197
+ [?2026l[?2026h ✓ src/__tests__/runtime/route-interception.test.ts (21 tests) 35ms
1198
+
1199
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1200
+  ❯ src/__tests__/integration.test.ts 0/9
1201
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1202
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1203
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
1204
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1205
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1206
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1207
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
1208
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1209
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1210
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
1211
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1212
+
1213
+  Test Files 8 passed (44)
1214
+  Tests 269 passed | 1 skipped (356)
1215
+  Start at 17:52:48
1216
+  Duration 403ms
1217
+ [?2026l[?2026hstderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with empty x field
1218
+ [CryptoService] Invalid Ed25519 JWK format
1219
+
1220
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject malformed JWS
1221
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'ž', "ž‹" is not valid JSON
1222
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
1223
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1224
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:230:42
1225
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1226
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1227
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1228
+ at new Promise (<anonymous>)
1229
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1230
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1231
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1232
+
1233
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject non-EdDSA algorithms
1234
+ [CryptoService] Unsupported algorithm: RS256, expected EdDSA
1235
+
1236
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject HS256 algorithm
1237
+ [CryptoService] Unsupported algorithm: HS256, expected EdDSA
1238
+
1239
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle empty JWS components
1240
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected end of JSON input
1241
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
1242
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1243
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:271:42
1244
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1245
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1246
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1247
+ at new Promise (<anonymous>)
1248
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1249
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1250
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1251
+
1252
+ stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
1253
+ [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
1254
+ at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
1255
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1256
+ at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
1257
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:257:9
1258
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
1259
+
1260
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - single part
1261
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
1262
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
1263
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1264
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:279:42
1265
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1266
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1267
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1268
+ at new Promise (<anonymous>)
1269
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1270
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1271
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1272
+
1273
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - two parts
1274
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
1275
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
1276
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1277
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:287:42
1278
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1279
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1280
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1281
+ at new Promise (<anonymous>)
1282
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1283
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1284
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1285
+
1286
+
1287
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1288
+  ❯ src/__tests__/integration.test.ts 0/9
1289
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1290
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1291
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
1292
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1293
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1294
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1295
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
1296
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1297
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1298
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
1299
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1300
+
1301
+  Test Files 8 passed (44)
1302
+  Tests 269 passed | 1 skipped (356)
1303
+  Start at 17:52:48
1304
+  Duration 403ms
1305
+ [?2026l[?2026hstdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
1306
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zR2T1bdxSVhqFu_d_eKkKvLNvKe1i7QGg","environment":"development","userDidGeneration":"disabled"},"timestamp":1764028368809,"timestampFormatted":"2025-11-24T23:52:48.809Z"}
1307
+
1308
+ ✓ src/__tests__/cache/tool-protection-cache.test.ts (49 tests) 164ms
1309
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
1310
+ [AUDIT] {"event":"tool_executed","data":{"tool":"greetingTool","sessionId":"b4baa468a1525b411e466ab234d851d3","timestamp":1764028368809},"timestamp":1764028368809,"timestampFormatted":"2025-11-24T23:52:48.809Z"}
1311
+
1312
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Session expiry handling > should handle expired sessions correctly
1313
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zFakH7XD0MHPMuE27RdmBSeo1Rm2mFFrJ","environment":"development","userDidGeneration":"disabled"},"timestamp":1764028368814,"timestampFormatted":"2025-11-24T23:52:48.814Z"}
1314
+
1315
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
1316
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zL7rWRHMPmV0fq7nCCPQLbADZoOeaZcb0","environment":"development","userDidGeneration":"disabled"},"timestamp":1764028368814,"timestampFormatted":"2025-11-24T23:52:48.814Z"}
1317
+
1318
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
1319
+ [AUDIT] {"event":"keys_rotated","data":{"oldDid":"did:key:zL7rWRHMPmV0fq7nCCPQLbADZoOeaZcb0","newDid":"did:key:zFeeIiR7_PPnoxptUEt29-LM6RPtdJUo9","timestamp":1764028368814},"timestamp":1764028368814,"timestampFormatted":"2025-11-24T23:52:48.814Z"}
1320
+
1321
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Well-known endpoints > should provide identity discovery endpoints
1322
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:ztEJI5ksSFuBKCt8pvLPNWoYmN5pHOqCY","environment":"development","userDidGeneration":"disabled"},"timestamp":1764028368815,"timestampFormatted":"2025-11-24T23:52:48.815Z"}
1323
+
1324
+
1325
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1326
+  ❯ src/__tests__/integration.test.ts 0/9
1327
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1328
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1329
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
1330
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1331
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1332
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1333
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
1334
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1335
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1336
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
1337
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1338
+
1339
+  Test Files 8 passed (44)
1340
+  Tests 269 passed | 1 skipped (356)
1341
+  Start at 17:52:48
1342
+  Duration 403ms
1343
+ [?2026l[?2026hstderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - four parts
1344
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
1345
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
1346
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1347
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:302:42
1348
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1349
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1350
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1351
+ at new Promise (<anonymous>)
1352
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1353
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1354
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1355
+
1356
+
1357
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1358
+  ❯ src/__tests__/integration.test.ts 0/9
1359
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1360
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1361
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
1362
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1363
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1364
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1365
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
1366
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1367
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1368
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
1369
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1370
+
1371
+  Test Files 8 passed (44)
1372
+  Tests 269 passed | 1 skipped (356)
1373
+  Start at 17:52:48
1374
+  Duration 403ms
1375
+ [?2026l[?2026hstdout | src/__tests__/integration.test.ts > Integration Tests > Nonce replay protection > should prevent nonce reuse
1376
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zM3Uz_vzOMcWsnGV3S5W9rF5gWpJ2P6JG","environment":"development","userDidGeneration":"disabled"},"timestamp":1764028368815,"timestampFormatted":"2025-11-24T23:52:48.815Z"}
1377
+
1378
+
1379
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1380
+  ❯ src/__tests__/integration.test.ts 0/9
1381
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1382
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1383
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
1384
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1385
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1386
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1387
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
1388
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1389
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1390
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
1391
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1392
+
1393
+  Test Files 8 passed (44)
1394
+  Tests 269 passed | 1 skipped (356)
1395
+  Start at 17:52:48
1396
+  Duration 403ms
1397
+ [?2026l[?2026hstderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid JSON header
1398
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'o', "notjson" is not valid JSON
1399
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
1400
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1401
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:316:42
1402
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1403
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1404
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1405
+ at new Promise (<anonymous>)
1406
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1407
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1408
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1409
+
1410
+
1411
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1412
+  ❯ src/__tests__/integration.test.ts 0/9
1413
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1414
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1415
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
1416
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1417
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1418
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1419
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
1420
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1421
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1422
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
1423
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1424
+
1425
+  Test Files 8 passed (44)
1426
+  Tests 269 passed | 1 skipped (356)
1427
+  Start at 17:52:48
1428
+  Duration 403ms
1429
+ [?2026l[?2026hstdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle network errors gracefully
1430
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zMO7-Htu3LlfayBEg_lbqysxpBEqtYIYS","environment":"development","userDidGeneration":"disabled"},"timestamp":1764028368816,"timestampFormatted":"2025-11-24T23:52:48.816Z"}
1431
+
1432
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle malformed DID documents
1433
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zwE8MZq80KXN1yqj30YVx5E7av8Ddhu76","environment":"development","userDidGeneration":"disabled"},"timestamp":1764028368816,"timestampFormatted":"2025-11-24T23:52:48.816Z"}
1434
+
1435
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should provide debug information in development
1436
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z9ZSnbRnMCharaJfa0KU--Ac24AUgOFoZ","environment":"development","userDidGeneration":"disabled"},"timestamp":1764028368816,"timestampFormatted":"2025-11-24T23:52:48.816Z"}
1437
+
1438
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should be disabled in production
1439
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zpaZlGd4Gl1drs00uTZm7ialjf6LiPs4O","environment":"development","userDidGeneration":"disabled"},"timestamp":1764028368816,"timestampFormatted":"2025-11-24T23:52:48.816Z"}
1440
+
1441
+
1442
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1443
+  ❯ src/__tests__/integration.test.ts 0/9
1444
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1445
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1446
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
1447
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1448
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1449
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1450
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
1451
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1452
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1453
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
1454
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1455
+
1456
+  Test Files 8 passed (44)
1457
+  Tests 269 passed | 1 skipped (356)
1458
+  Start at 17:52:48
1459
+  Duration 403ms
1460
+ [?2026l[?2026hstderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid base64
1461
+ [CryptoService] Invalid JWS format: Error: Invalid payload base64: Invalid base64url string: Invalid character
1462
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:107:15)
1463
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1464
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:334:42
1465
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1466
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1467
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1468
+ at new Promise (<anonymous>)
1469
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1470
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1471
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1472
+
1473
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate expectedKid option
1474
+ [CryptoService] Key ID mismatch
1475
+
1476
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate alg option
1477
+ [CryptoService] Unsupported algorithm: EdDSA, expected RS256
1478
+
1479
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate Ed25519 key length
1480
+ [CryptoService] Failed to extract public key: Error: Invalid Ed25519 public key length: 5
1481
+ at CryptoService.jwkToBase64PublicKey (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:295:13)
1482
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:249:32)
1483
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:398:42
1484
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1485
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1486
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1487
+ at new Promise (<anonymous>)
1488
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1489
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1490
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1491
+
1492
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle signature verification error
1493
+ [CryptoService] Ed25519 verification error: Error: Crypto error
1494
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:449:61
1495
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
1496
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
1497
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
1498
+ at new Promise (<anonymous>)
1499
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
1500
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
1501
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
1502
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
1503
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
1504
+
1505
+
1506
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1507
+  ❯ src/__tests__/integration.test.ts 9/9
1508
+  ❯ src/__tests__/runtime/base-extensions.test.ts 0/38
1509
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1510
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 17/17
1511
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1512
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
1513
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1514
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1515
+  ❯ src/services/__tests__/access-control.integration.test.ts 7/9
1516
+  ❯ src/services/__tests__/crypto.service.test.ts 34/34
1517
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 13/13
1518
+  ❯ src/services/__tests__/storage.service.test.ts [queued]
1519
+
1520
+  Test Files 12 passed (44)
1521
+  Tests 348 passed | 2 skipped (394)
1522
+  Start at 17:52:48
1523
+  Duration 524ms
1524
+ [?2026l[?2026h ✓ src/__tests__/runtime/proof-client-did.test.ts (17 tests) 27ms
1525
+ ✓ src/services/__tests__/crypto.service.test.ts (34 tests) 27ms
1526
+ ✓ src/services/__tests__/proof-verifier.integration.test.ts (13 tests | 1 skipped) 89ms
1527
+
1528
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1529
+  ❯ src/__tests__/integration.test.ts 9/9
1530
+  ❯ src/__tests__/runtime/base-extensions.test.ts 0/38
1531
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1532
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 17/17
1533
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1534
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
1535
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1536
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1537
+  ❯ src/services/__tests__/access-control.integration.test.ts 7/9
1538
+  ❯ src/services/__tests__/crypto.service.test.ts 34/34
1539
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 13/13
1540
+  ❯ src/services/__tests__/storage.service.test.ts [queued]
1541
+
1542
+  Test Files 12 passed (44)
1543
+  Tests 348 passed | 2 skipped (394)
1544
+  Start at 17:52:48
1545
+  Duration 524ms
1546
+ [?2026l[?2026hstderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should submit proof end-to-end
1547
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1548
+ correlationId: '65272a36-f969-4200-a207-97a1a693668b',
1549
+ status: 200,
1550
+ statusText: '',
1551
+ headers: { 'content-type': 'application/json' },
1552
+ responseTextLength: 100,
1553
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
1554
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
1555
+ }
1556
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1557
+ correlationId: '65272a36-f969-4200-a207-97a1a693668b',
1558
+ status: 200,
1559
+ responseDataType: 'object',
1560
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1561
+ responseData: '{\n' +
1562
+ ' "success": true,\n' +
1563
+ ' "accepted": 1,\n' +
1564
+ ' "rejected": 0,\n' +
1565
+ ' "outcomes": {\n' +
1566
+ ' "success": 1,\n' +
1567
+ ' "failed": 0,\n' +
1568
+ ' "blocked": 0,\n' +
1569
+ ' "error": 0\n' +
1570
+ ' }\n' +
1571
+ '}'
1572
+ }
1573
+ [AccessControl] Raw response received: {
1574
+ "success": true,
1575
+ "accepted": 1,
1576
+ "rejected": 0,
1577
+ "outcomes": {
1578
+ "success": 1,
1579
+ "failed": 0,
1580
+ "blocked": 0,
1581
+ "error": 0
1582
+ }
1583
+ }
1584
+
1585
+ stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should handle proof submission with errors
1586
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1587
+ correlationId: '826c3ebd-3cff-47ed-be37-041b9451bfb5',
1588
+ status: 200,
1589
+ statusText: '',
1590
+ headers: { 'content-type': 'application/json' },
1591
+ responseTextLength: 200,
1592
+ responseTextPreview: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}',
1593
+ 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"}}]}'
1594
+ }
1595
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1596
+ correlationId: '826c3ebd-3cff-47ed-be37-041b9451bfb5',
1597
+ status: 200,
1598
+ responseDataType: 'object',
1599
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1600
+ responseData: '{\n' +
1601
+ ' "success": true,\n' +
1602
+ ' "accepted": 0,\n' +
1603
+ ' "rejected": 1,\n' +
1604
+ ' "outcomes": {\n' +
1605
+ ' "success": 0,\n' +
1606
+ ' "failed": 1,\n' +
1607
+ ' "blocked": 0,\n' +
1608
+ ' "error": 0\n' +
1609
+ ' },\n' +
1610
+ ' "errors": [\n' +
1611
+ ' {\n' +
1612
+ ' "proof_index": 0,\n' +
1613
+ ' "error": {\n' +
1614
+ ' "code": "invalid_signature",\n' +
1615
+ ' "message": "Invalid JWS signature"\n' +
1616
+ ' }\n' +
1617
+ ' }\n' +
1618
+ ' ]\n' +
1619
+ '}'
1620
+ }
1621
+ [AccessControl] Raw response received: {
1622
+ "success": true,
1623
+ "accepted": 0,
1624
+ "rejected": 1,
1625
+ "outcomes": {
1626
+ "success": 0,
1627
+ "failed": 1,
1628
+ "blocked": 0,
1629
+ "error": 0
1630
+ },
1631
+ "errors": [
1632
+ {
1633
+ "proof_index": 0,
1634
+ "error": {
1635
+ "code": "invalid_signature",
1636
+ "message": "Invalid JWS signature"
1637
+ }
1638
+ }
1639
+ ]
1640
+ }
1641
+
1642
+ stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Verification Flow > should verify proof using ProofVerifier
1643
+ [CryptoService] Key ID mismatch
1644
+
1645
+
1646
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1647
+  ❯ src/__tests__/integration.test.ts 9/9
1648
+  ❯ src/__tests__/runtime/base-extensions.test.ts 0/38
1649
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1650
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 17/17
1651
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1652
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
1653
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1654
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1655
+  ❯ src/services/__tests__/access-control.integration.test.ts 7/9
1656
+  ❯ src/services/__tests__/crypto.service.test.ts 34/34
1657
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 13/13
1658
+  ❯ src/services/__tests__/storage.service.test.ts [queued]
1659
+
1660
+  Test Files 12 passed (44)
1661
+  Tests 348 passed | 2 skipped (394)
1662
+  Start at 17:52:48
1663
+  Duration 524ms
1664
+ [?2026l[?2026h ✓ src/__tests__/integration.test.ts (9 tests) 8ms
1665
+
1666
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1667
+  ❯ src/__tests__/integration.test.ts 9/9
1668
+  ❯ src/__tests__/runtime/base-extensions.test.ts 0/38
1669
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1670
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 17/17
1671
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
1672
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
1673
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1674
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
1675
+  ❯ src/services/__tests__/access-control.integration.test.ts 7/9
1676
+  ❯ src/services/__tests__/crypto.service.test.ts 34/34
1677
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 13/13
1678
+  ❯ src/services/__tests__/storage.service.test.ts [queued]
1679
+
1680
+  Test Files 12 passed (44)
1681
+  Tests 348 passed | 2 skipped (394)
1682
+  Start at 17:52:48
1683
+  Duration 524ms
1684
+ [?2026l[?2026h ✓ src/__tests__/runtime/base-extensions.test.ts (38 tests) 9ms
1685
+ ✓ src/services/__tests__/access-control.integration.test.ts (9 tests) 161ms
1686
+ 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
1687
+ [MCP-I] Checking tool protection: {
1688
+ tool: 'unprotectedTool',
1689
+ agentDid: 'did:key:zmock123...',
1690
+ hasDelegation: false
1691
+ }
1692
+
1693
+ 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
1694
+ [MCP-I] Tool protection check passed (no delegation required) {
1695
+ tool: 'unprotectedTool',
1696
+ agentDid: 'did:key:zmock123...',
1697
+ reason: 'Tool not configured to require delegation'
1698
+ }
1699
+
1700
+ 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
1701
+ [MCP-I] Checking tool protection: {
1702
+ tool: 'protectedTool',
1703
+ agentDid: 'did:key:zmock123...',
1704
+ hasDelegation: false
1705
+ }
1706
+
1707
+
1708
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
1709
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
1710
+  ❯ src/__tests__/providers/memory.test.ts 0/34
1711
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
1712
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
1713
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1714
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
1715
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1716
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
1717
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
1718
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
1719
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
1720
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1721
+
1722
+  Test Files 16 passed (44)
1723
+  Tests 472 passed | 2 skipped (574)
1724
+  Start at 17:52:48
1725
+  Duration 727ms
1726
+ [?2026l[?2026hstderr | 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
1727
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1728
+ tool: 'protectedTool',
1729
+ requiredScopes: [ 'files:write' ],
1730
+ agentDid: 'did:key:zmock123...',
1731
+ resumeToken: 'resume_cxkqz9_midsy0ry',
1732
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_cxkqz9_midsy0ry'
1733
+ }
1734
+
1735
+
1736
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
1737
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
1738
+  ❯ src/__tests__/providers/memory.test.ts 0/34
1739
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
1740
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
1741
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1742
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
1743
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1744
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
1745
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
1746
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
1747
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
1748
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1749
+
1750
+  Test Files 16 passed (44)
1751
+  Tests 472 passed | 2 skipped (574)
1752
+  Start at 17:52:48
1753
+  Duration 727ms
1754
+ [?2026l[?2026hstdout | 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
1755
+ [MCP-I] Checking tool protection: {
1756
+ tool: 'protectedTool',
1757
+ agentDid: 'did:key:zmock123...',
1758
+ hasDelegation: true
1759
+ }
1760
+
1761
+ 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
1762
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1763
+ tool: 'protectedTool',
1764
+ agentDid: 'did:key:zmock123...',
1765
+ hasDelegationToken: true,
1766
+ hasConsentProof: false,
1767
+ requiredScopes: [ 'files:write' ]
1768
+ }
1769
+
1770
+ 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
1771
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1772
+ tool: 'protectedTool',
1773
+ agentDid: 'did:key:zmock123...',
1774
+ delegationId: 'test-delegation-id',
1775
+ credentialScopes: [ 'files:write' ],
1776
+ requiredScopes: [ 'files:write' ]
1777
+ }
1778
+
1779
+ 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
1780
+ [MCP-I] Checking tool protection: {
1781
+ tool: 'protectedTool',
1782
+ agentDid: 'did:key:zmock123...',
1783
+ hasDelegation: true
1784
+ }
1785
+
1786
+ 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
1787
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1788
+ tool: 'protectedTool',
1789
+ agentDid: 'did:key:zmock123...',
1790
+ hasDelegationToken: false,
1791
+ hasConsentProof: true,
1792
+ requiredScopes: [ 'files:write' ]
1793
+ }
1794
+
1795
+ 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
1796
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1797
+ tool: 'protectedTool',
1798
+ agentDid: 'did:key:zmock123...',
1799
+ delegationId: 'test-delegation-id',
1800
+ credentialScopes: [ 'files:write' ],
1801
+ requiredScopes: [ 'files:write' ]
1802
+ }
1803
+
1804
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1805
+ [MCP-I] Checking tool protection: {
1806
+ tool: 'protectedTool',
1807
+ agentDid: 'did:key:zmock123...',
1808
+ hasDelegation: true
1809
+ }
1810
+
1811
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1812
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1813
+ tool: 'protectedTool',
1814
+ agentDid: 'did:key:zmock123...',
1815
+ hasDelegationToken: true,
1816
+ hasConsentProof: false,
1817
+ requiredScopes: [ 'files:write' ]
1818
+ }
1819
+
1820
+
1821
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
1822
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
1823
+  ❯ src/__tests__/providers/memory.test.ts 0/34
1824
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
1825
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
1826
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1827
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
1828
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1829
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
1830
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
1831
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
1832
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
1833
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1834
+
1835
+  Test Files 16 passed (44)
1836
+  Tests 472 passed | 2 skipped (574)
1837
+  Start at 17:52:48
1838
+  Duration 727ms
1839
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1840
+ [MCP-I] ❌ Delegation verification FAILED {
1841
+ tool: 'protectedTool',
1842
+ agentDid: 'did:key:zmock123...',
1843
+ reason: 'Delegation token expired',
1844
+ errorCode: undefined,
1845
+ errorMessage: undefined,
1846
+ requiredScopes: [ 'files:write' ]
1847
+ }
1848
+
1849
+
1850
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
1851
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
1852
+  ❯ src/__tests__/providers/memory.test.ts 0/34
1853
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
1854
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
1855
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1856
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
1857
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1858
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
1859
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
1860
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
1861
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
1862
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1863
+
1864
+  Test Files 16 passed (44)
1865
+  Tests 472 passed | 2 skipped (574)
1866
+  Start at 17:52:48
1867
+  Duration 727ms
1868
+ [?2026l[?2026hstdout | 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
1869
+ [MCP-I] Checking tool protection: {
1870
+ tool: 'protectedTool',
1871
+ agentDid: 'did:key:zmock123...',
1872
+ hasDelegation: true
1873
+ }
1874
+
1875
+ 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
1876
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1877
+ tool: 'protectedTool',
1878
+ agentDid: 'did:key:zmock123...',
1879
+ hasDelegationToken: true,
1880
+ hasConsentProof: false,
1881
+ requiredScopes: [ 'files:write' ]
1882
+ }
1883
+
1884
+
1885
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
1886
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
1887
+  ❯ src/__tests__/providers/memory.test.ts 0/34
1888
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
1889
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
1890
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1891
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
1892
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1893
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
1894
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
1895
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
1896
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
1897
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1898
+
1899
+  Test Files 16 passed (44)
1900
+  Tests 472 passed | 2 skipped (574)
1901
+  Start at 17:52:48
1902
+  Duration 727ms
1903
+ [?2026l[?2026hstderr | 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
1904
+ [MCP-I] ❌ Delegation verification FAILED {
1905
+ tool: 'protectedTool',
1906
+ agentDid: 'did:key:zmock123...',
1907
+ reason: 'Insufficient scopes',
1908
+ errorCode: undefined,
1909
+ errorMessage: undefined,
1910
+ requiredScopes: [ 'files:write' ]
1911
+ }
1912
+
1913
+
1914
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
1915
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
1916
+  ❯ src/__tests__/providers/memory.test.ts 0/34
1917
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
1918
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
1919
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1920
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
1921
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1922
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
1923
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
1924
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
1925
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
1926
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1927
+
1928
+  Test Files 16 passed (44)
1929
+  Tests 472 passed | 2 skipped (574)
1930
+  Start at 17:52:48
1931
+  Duration 727ms
1932
+ [?2026l[?2026h ✓ src/__tests__/runtime/base.test.ts (55 tests) 15ms
1933
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1934
+ [MCP-I] Checking tool protection: {
1935
+ tool: 'protectedTool',
1936
+ agentDid: 'did:key:zmock123...',
1937
+ hasDelegation: true
1938
+ }
1939
+
1940
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1941
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1942
+ tool: 'protectedTool',
1943
+ agentDid: 'did:key:zmock123...',
1944
+ hasDelegationToken: true,
1945
+ hasConsentProof: false,
1946
+ requiredScopes: [ 'files:write' ]
1947
+ }
1948
+
1949
+
1950
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
1951
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
1952
+  ❯ src/__tests__/providers/memory.test.ts 0/34
1953
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
1954
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
1955
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1956
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
1957
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1958
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
1959
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
1960
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
1961
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
1962
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1963
+
1964
+  Test Files 16 passed (44)
1965
+  Tests 472 passed | 2 skipped (574)
1966
+  Start at 17:52:48
1967
+  Duration 727ms
1968
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1969
+ [MCP-I] ❌ Delegation verification error (API failure) {
1970
+ tool: 'protectedTool',
1971
+ agentDid: 'did:key:zmock123...',
1972
+ errorCode: 'network_error',
1973
+ errorMessage: 'API unavailable',
1974
+ errorDetails: {}
1975
+ }
1976
+
1977
+
1978
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
1979
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
1980
+  ❯ src/__tests__/providers/memory.test.ts 0/34
1981
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
1982
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
1983
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1984
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
1985
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1986
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
1987
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
1988
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
1989
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
1990
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1991
+
1992
+  Test Files 16 passed (44)
1993
+  Tests 472 passed | 2 skipped (574)
1994
+  Start at 17:52:48
1995
+  Duration 727ms
1996
+ [?2026l[?2026hstdout | 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)
1997
+ [MCP-I] Checking tool protection: {
1998
+ tool: 'protectedTool',
1999
+ agentDid: 'did:key:zmock123...',
2000
+ hasDelegation: true
2001
+ }
2002
+
2003
+
2004
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2005
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2006
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2007
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2008
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2009
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2010
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2011
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2012
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2013
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2014
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2015
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2016
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2017
+
2018
+  Test Files 16 passed (44)
2019
+  Tests 472 passed | 2 skipped (574)
2020
+  Start at 17:52:48
2021
+  Duration 727ms
2022
+ [?2026l[?2026hstderr | 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)
2023
+ [MCP-I] ⚠️ Delegation token provided but AccessControlApiService not configured - skipping verification {
2024
+ tool: 'protectedTool',
2025
+ agentDid: 'did:key:zmock123...',
2026
+ hasDelegationToken: true,
2027
+ hasConsentProof: false
2028
+ }
2029
+
2030
+
2031
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2032
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2033
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2034
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2035
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2036
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2037
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2038
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2039
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2040
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2041
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2042
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2043
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2044
+
2045
+  Test Files 16 passed (44)
2046
+  Tests 472 passed | 2 skipped (574)
2047
+  Start at 17:52:48
2048
+  Duration 727ms
2049
+ [?2026l[?2026hstdout | 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
2050
+ [MCP-I] Checking tool protection: {
2051
+ tool: 'protectedTool',
2052
+ agentDid: 'did:key:zmock123...',
2053
+ hasDelegation: true
2054
+ }
2055
+
2056
+ 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
2057
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2058
+ tool: 'protectedTool',
2059
+ agentDid: 'did:key:zmock123...',
2060
+ hasDelegationToken: true,
2061
+ hasConsentProof: false,
2062
+ requiredScopes: [ 'files:write' ]
2063
+ }
2064
+
2065
+
2066
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2067
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2068
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2069
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2070
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2071
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2072
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2073
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2074
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2075
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2076
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2077
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2078
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2079
+
2080
+  Test Files 16 passed (44)
2081
+  Tests 472 passed | 2 skipped (574)
2082
+  Start at 17:52:48
2083
+  Duration 727ms
2084
+ [?2026l[?2026hstderr | 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
2085
+ [MCP-I] 🔒 SECURITY: User identifier validation FAILED {
2086
+ tool: 'protectedTool',
2087
+ agentDid: 'did:key:zmock123...',
2088
+ delegationUserIdentifier: 'did:key:zUserB987654...',
2089
+ sessionUserDid: 'did:key:zUserA123456...',
2090
+ sessionId: 'session123...',
2091
+ reason: 'user_identifier_mismatch',
2092
+ severity: 'high'
2093
+ }
2094
+
2095
+
2096
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2097
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2098
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2099
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2100
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2101
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2102
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2103
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2104
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2105
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2106
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2107
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2108
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2109
+
2110
+  Test Files 16 passed (44)
2111
+  Tests 472 passed | 2 skipped (574)
2112
+  Start at 17:52:48
2113
+  Duration 727ms
2114
+ [?2026l[?2026hstdout | 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
2115
+ [MCP-I] Checking tool protection: {
2116
+ tool: 'protectedTool',
2117
+ agentDid: 'did:key:zmock123...',
2118
+ hasDelegation: true
2119
+ }
2120
+
2121
+ 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
2122
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2123
+ tool: 'protectedTool',
2124
+ agentDid: 'did:key:zmock123...',
2125
+ hasDelegationToken: true,
2126
+ hasConsentProof: false,
2127
+ requiredScopes: [ 'files:write' ]
2128
+ }
2129
+
2130
+ 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
2131
+ [MCP-I] ✅ User identifier validation PASSED {
2132
+ tool: 'protectedTool',
2133
+ agentDid: 'did:key:zmock123...',
2134
+ userDid: 'did:key:zUserA123456...',
2135
+ sessionId: 'session123...'
2136
+ }
2137
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
2138
+ tool: 'protectedTool',
2139
+ agentDid: 'did:key:zmock123...',
2140
+ delegationId: 'test-delegation-id',
2141
+ credentialScopes: [ 'files:write' ],
2142
+ requiredScopes: [ 'files:write' ]
2143
+ }
2144
+
2145
+ 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)
2146
+ [MCP-I] Checking tool protection: {
2147
+ tool: 'protectedTool',
2148
+ agentDid: 'did:key:zmock123...',
2149
+ hasDelegation: true
2150
+ }
2151
+
2152
+ 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)
2153
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2154
+ tool: 'protectedTool',
2155
+ agentDid: 'did:key:zmock123...',
2156
+ hasDelegationToken: true,
2157
+ hasConsentProof: false,
2158
+ requiredScopes: [ 'files:write' ]
2159
+ }
2160
+
2161
+ 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)
2162
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
2163
+ tool: 'protectedTool',
2164
+ agentDid: 'did:key:zmock123...',
2165
+ delegationId: 'test-delegation-id',
2166
+ credentialScopes: [ 'files:write' ],
2167
+ requiredScopes: [ 'files:write' ]
2168
+ }
2169
+
2170
+ 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
2171
+ [MCP-I] Checking tool protection: {
2172
+ tool: 'protectedTool',
2173
+ agentDid: 'did:key:zmock123...',
2174
+ hasDelegation: true
2175
+ }
2176
+
2177
+ 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
2178
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2179
+ tool: 'protectedTool',
2180
+ agentDid: 'did:key:zmock123...',
2181
+ hasDelegationToken: true,
2182
+ hasConsentProof: false,
2183
+ requiredScopes: [ 'files:write' ]
2184
+ }
2185
+
2186
+
2187
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2188
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2189
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2190
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2191
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2192
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2193
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2194
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2195
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2196
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2197
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2198
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2199
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2200
+
2201
+  Test Files 16 passed (44)
2202
+  Tests 472 passed | 2 skipped (574)
2203
+  Start at 17:52:48
2204
+  Duration 727ms
2205
+ [?2026l[?2026hstderr | 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
2206
+ [MCP-I] ⚠️ Delegation has user_identifier but session missing userDid {
2207
+ tool: 'protectedTool',
2208
+ agentDid: 'did:key:zmock123...',
2209
+ delegationUserIdentifier: 'did:key:zUserA123456...',
2210
+ sessionId: 'session123...'
2211
+ }
2212
+
2213
+
2214
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2215
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2216
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2217
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2218
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2219
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2220
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2221
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2222
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2223
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2224
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2225
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2226
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2227
+
2228
+  Test Files 16 passed (44)
2229
+  Tests 472 passed | 2 skipped (574)
2230
+  Start at 17:52:48
2231
+  Duration 727ms
2232
+ [?2026l[?2026hstdout | 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
2233
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
2234
+ tool: 'protectedTool',
2235
+ agentDid: 'did:key:zmock123...',
2236
+ delegationId: 'test-delegation-id',
2237
+ credentialScopes: [ 'files:write' ],
2238
+ requiredScopes: [ 'files:write' ]
2239
+ }
2240
+
2241
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
2242
+ [MCP-I] Checking tool protection: {
2243
+ tool: 'unprotectedTool',
2244
+ agentDid: 'did:key:zmock123...',
2245
+ hasDelegation: false
2246
+ }
2247
+
2248
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
2249
+ [MCP-I] Tool protection check passed (no delegation required) {
2250
+ tool: 'unprotectedTool',
2251
+ agentDid: 'did:key:zmock123...',
2252
+ reason: 'Tool not configured to require delegation'
2253
+ }
2254
+
2255
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
2256
+ [MCP-I] Checking tool protection: {
2257
+ tool: 'protectedTool',
2258
+ agentDid: 'did:key:zmock123...',
2259
+ hasDelegation: false
2260
+ }
2261
+
2262
+
2263
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2264
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2265
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2266
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2267
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2268
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2269
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2270
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2271
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2272
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2273
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2274
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2275
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2276
+
2277
+  Test Files 16 passed (44)
2278
+  Tests 472 passed | 2 skipped (574)
2279
+  Start at 17:52:48
2280
+  Duration 727ms
2281
+ [?2026l[?2026hstderr | 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
2282
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2283
+ tool: 'protectedTool',
2284
+ requiredScopes: [ 'files:write' ],
2285
+ agentDid: 'did:key:zmock123...',
2286
+ resumeToken: 'resume_cxkqaa_midsy0s6',
2287
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_cxkqaa_midsy0s6'
2288
+ }
2289
+
2290
+
2291
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2292
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2293
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2294
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2295
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2296
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2297
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2298
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2299
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2300
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2301
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2302
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2303
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2304
+
2305
+  Test Files 16 passed (44)
2306
+  Tests 472 passed | 2 skipped (574)
2307
+  Start at 17:52:48
2308
+  Duration 727ms
2309
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
2310
+ [MCP-I] Checking tool protection: {
2311
+ tool: 'protectedTool',
2312
+ agentDid: 'did:key:zmock123...',
2313
+ hasDelegation: false
2314
+ }
2315
+
2316
+
2317
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2318
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2319
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2320
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2321
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2322
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2323
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2324
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2325
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2326
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2327
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2328
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2329
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2330
+
2331
+  Test Files 16 passed (44)
2332
+  Tests 472 passed | 2 skipped (574)
2333
+  Start at 17:52:48
2334
+  Duration 727ms
2335
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
2336
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2337
+ tool: 'protectedTool',
2338
+ requiredScopes: [ 'files:write' ],
2339
+ agentDid: 'did:key:zmock123...',
2340
+ resumeToken: 'resume_cxkqaa_midsy0s6',
2341
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_cxkqaa_midsy0s6'
2342
+ }
2343
+
2344
+
2345
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2346
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2347
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2348
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2349
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2350
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2351
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2352
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2353
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2354
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2355
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2356
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2357
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2358
+
2359
+  Test Files 16 passed (44)
2360
+  Tests 472 passed | 2 skipped (574)
2361
+  Start at 17:52:48
2362
+  Duration 727ms
2363
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
2364
+ [MCP-I] Checking tool protection: {
2365
+ tool: 'protectedTool',
2366
+ agentDid: 'did:key:zmock123...',
2367
+ hasDelegation: false
2368
+ }
2369
+
2370
+
2371
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2372
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2373
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2374
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2375
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2376
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2377
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2378
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2379
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2380
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2381
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2382
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2383
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2384
+
2385
+  Test Files 16 passed (44)
2386
+  Tests 472 passed | 2 skipped (574)
2387
+  Start at 17:52:48
2388
+  Duration 727ms
2389
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
2390
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2391
+ tool: 'protectedTool',
2392
+ requiredScopes: [ 'files:write', 'files:read' ],
2393
+ agentDid: 'did:key:zmock123...',
2394
+ resumeToken: 'resume_cxkq9f_midsy0s7',
2395
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite%2Cfiles%3Aread&session_id=session123&agent_did=&resume_token=resume_cxkq9f_midsy0s7'
2396
+ }
2397
+
2398
+
2399
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2400
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2401
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2402
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2403
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2404
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2405
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2406
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2407
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2408
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2409
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2410
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2411
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2412
+
2413
+  Test Files 16 passed (44)
2414
+  Tests 472 passed | 2 skipped (574)
2415
+  Start at 17:52:48
2416
+  Duration 727ms
2417
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
2418
+ [MCP-I] Checking tool protection: {
2419
+ tool: 'protectedTool',
2420
+ agentDid: 'did:key:zmock123...',
2421
+ hasDelegation: false
2422
+ }
2423
+
2424
+
2425
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2426
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2427
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2428
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2429
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2430
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2431
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2432
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2433
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2434
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2435
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2436
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2437
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2438
+
2439
+  Test Files 16 passed (44)
2440
+  Tests 472 passed | 2 skipped (574)
2441
+  Start at 17:52:48
2442
+  Duration 727ms
2443
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
2444
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2445
+ tool: 'protectedTool',
2446
+ requiredScopes: [ 'files:write' ],
2447
+ agentDid: 'did:key:zmock123...',
2448
+ resumeToken: 'resume_cxkq9f_midsy0s7',
2449
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_cxkq9f_midsy0s7'
2450
+ }
2451
+
2452
+
2453
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2454
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2455
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2456
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2457
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2458
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2459
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2460
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2461
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2462
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2463
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2464
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2465
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2466
+
2467
+  Test Files 16 passed (44)
2468
+  Tests 472 passed | 2 skipped (574)
2469
+  Start at 17:52:48
2470
+  Duration 727ms
2471
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
2472
+ [MCP-I] Checking tool protection: {
2473
+ tool: 'protectedTool',
2474
+ agentDid: 'did:key:zmock123...',
2475
+ hasDelegation: false
2476
+ }
2477
+
2478
+
2479
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2480
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2481
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2482
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2483
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2484
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2485
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2486
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2487
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2488
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2489
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2490
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2491
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2492
+
2493
+  Test Files 16 passed (44)
2494
+  Tests 472 passed | 2 skipped (574)
2495
+  Start at 17:52:48
2496
+  Duration 727ms
2497
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
2498
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2499
+ tool: 'protectedTool',
2500
+ requiredScopes: [ 'files:write' ],
2501
+ agentDid: 'did:key:zmock123...',
2502
+ resumeToken: 'resume_cxkq9f_midsy0s7',
2503
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_cxkq9f_midsy0s7'
2504
+ }
2505
+
2506
+
2507
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2508
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2509
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2510
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2511
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2512
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2513
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2514
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2515
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2516
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2517
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2518
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2519
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2520
+
2521
+  Test Files 16 passed (44)
2522
+  Tests 472 passed | 2 skipped (574)
2523
+  Start at 17:52:48
2524
+  Duration 727ms
2525
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
2526
+ [MCP-I] Checking tool protection: {
2527
+ tool: 'protectedTool',
2528
+ agentDid: 'did:key:zmock123...',
2529
+ hasDelegation: false
2530
+ }
2531
+
2532
+
2533
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2534
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2535
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2536
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2537
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2538
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2539
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2540
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2541
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2542
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2543
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2544
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2545
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2546
+
2547
+  Test Files 16 passed (44)
2548
+  Tests 472 passed | 2 skipped (574)
2549
+  Start at 17:52:48
2550
+  Duration 727ms
2551
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
2552
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2553
+ tool: 'protectedTool',
2554
+ requiredScopes: [ 'files:write' ],
2555
+ agentDid: 'did:key:zmock123...',
2556
+ resumeToken: 'resume_395gyw_midsy0s7',
2557
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_395gyw_midsy0s7'
2558
+ }
2559
+
2560
+
2561
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2562
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2563
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2564
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2565
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2566
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2567
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2568
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2569
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2570
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2571
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2572
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2573
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2574
+
2575
+  Test Files 16 passed (44)
2576
+  Tests 472 passed | 2 skipped (574)
2577
+  Start at 17:52:48
2578
+  Duration 727ms
2579
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
2580
+ [MCP-I] Checking tool protection: {
2581
+ tool: 'testTool',
2582
+ agentDid: 'did:key:zmock123...',
2583
+ hasDelegation: false
2584
+ }
2585
+
2586
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
2587
+ [MCP-I] Tool protection check passed (no delegation required) {
2588
+ tool: 'testTool',
2589
+ agentDid: 'did:key:zmock123...',
2590
+ reason: 'Tool not configured to require delegation'
2591
+ }
2592
+
2593
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log blocked tool call when audit enabled
2594
+ [MCP-I] Checking tool protection: {
2595
+ tool: 'protectedTool',
2596
+ agentDid: 'did:key:zmock123...',
2597
+ hasDelegation: false
2598
+ }
2599
+
2600
+ 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
2601
+ [MCP-I] Checking tool protection: {
2602
+ tool: 'testTool',
2603
+ agentDid: 'did:key:zmock123...',
2604
+ hasDelegation: false
2605
+ }
2606
+
2607
+ 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
2608
+ [MCP-I] Tool protection check passed (no delegation required) {
2609
+ tool: 'testTool',
2610
+ agentDid: 'did:key:zmock123...',
2611
+ reason: 'Tool not configured to require delegation'
2612
+ }
2613
+
2614
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should handle tool protection service errors gracefully
2615
+ [MCP-I] Checking tool protection: {
2616
+ tool: 'testTool',
2617
+ agentDid: 'did:key:zmock123...',
2618
+ hasDelegation: false
2619
+ }
2620
+
2621
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
2622
+ [MCP-I] Checking tool protection: {
2623
+ tool: 'protectedTool',
2624
+ agentDid: 'did:key:zmock123...',
2625
+ hasDelegation: false
2626
+ }
2627
+
2628
+
2629
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2630
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2631
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2632
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2633
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2634
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2635
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2636
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2637
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2638
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2639
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2640
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2641
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2642
+
2643
+  Test Files 16 passed (44)
2644
+  Tests 472 passed | 2 skipped (574)
2645
+  Start at 17:52:48
2646
+  Duration 727ms
2647
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
2648
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2649
+ tool: 'protectedTool',
2650
+ requiredScopes: [],
2651
+ agentDid: 'did:key:zmock123...',
2652
+ resumeToken: 'resume_cxkq7p_midsy0s9',
2653
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=&session_id=session123&agent_did=&resume_token=resume_cxkq7p_midsy0s9'
2654
+ }
2655
+
2656
+
2657
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2658
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2659
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2660
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2661
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2662
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2663
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2664
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2665
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2666
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2667
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2668
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2669
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2670
+
2671
+  Test Files 16 passed (44)
2672
+  Tests 472 passed | 2 skipped (574)
2673
+  Start at 17:52:48
2674
+  Duration 727ms
2675
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
2676
+ [MCP-I] Checking tool protection: {
2677
+ tool: 'protectedTool',
2678
+ agentDid: 'did:key:zmock123...',
2679
+ hasDelegation: false
2680
+ }
2681
+
2682
+
2683
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2684
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2685
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2686
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2687
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2688
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2689
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2690
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2691
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2692
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2693
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2694
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2695
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2696
+
2697
+  Test Files 16 passed (44)
2698
+  Tests 472 passed | 2 skipped (574)
2699
+  Start at 17:52:48
2700
+  Duration 727ms
2701
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
2702
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2703
+ tool: 'protectedTool',
2704
+ requiredScopes: [ 'scope1', 'scope2', 'scope3' ],
2705
+ agentDid: 'did:key:zmock123...',
2706
+ resumeToken: 'resume_cxkq7p_midsy0s9',
2707
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=scope1%2Cscope2%2Cscope3&session_id=session123&agent_did=&resume_token=resume_cxkq7p_midsy0s9'
2708
+ }
2709
+
2710
+
2711
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2712
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2713
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2714
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2715
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2716
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2717
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2718
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2719
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2720
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2721
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2722
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2723
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2724
+
2725
+  Test Files 16 passed (44)
2726
+  Tests 472 passed | 2 skipped (574)
2727
+  Start at 17:52:48
2728
+  Duration 727ms
2729
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
2730
+ [MCP-I] Checking tool protection: {
2731
+ tool: 'protectedTool',
2732
+ agentDid: 'did:key:zmock123...',
2733
+ hasDelegation: false
2734
+ }
2735
+
2736
+
2737
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2738
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2739
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2740
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2741
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2742
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2743
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2744
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2745
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2746
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2747
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2748
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2749
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2750
+
2751
+  Test Files 16 passed (44)
2752
+  Tests 472 passed | 2 skipped (574)
2753
+  Start at 17:52:48
2754
+  Duration 727ms
2755
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
2756
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2757
+ tool: 'protectedTool',
2758
+ requiredScopes: [ 'files:write' ],
2759
+ agentDid: 'did:key:zmock123...',
2760
+ resumeToken: 'resume_4ha71_midsy0s9',
2761
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=&agent_did=&resume_token=resume_4ha71_midsy0s9'
2762
+ }
2763
+
2764
+
2765
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2766
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2767
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2768
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2769
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2770
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2771
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2772
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2773
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2774
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2775
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2776
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2777
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2778
+
2779
+  Test Files 16 passed (44)
2780
+  Tests 472 passed | 2 skipped (574)
2781
+  Start at 17:52:48
2782
+  Duration 727ms
2783
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
2784
+ [MCP-I] Checking tool protection: {
2785
+ tool: 'errorTool',
2786
+ agentDid: 'did:key:zmock123...',
2787
+ hasDelegation: false
2788
+ }
2789
+
2790
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
2791
+ [MCP-I] Tool protection check passed (no delegation required) {
2792
+ tool: 'errorTool',
2793
+ agentDid: 'did:key:zmock123...',
2794
+ reason: 'Tool not configured to require delegation'
2795
+ }
2796
+
2797
+
2798
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2799
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2800
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2801
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2802
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2803
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2804
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2805
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2806
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2807
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2808
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2809
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2810
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2811
+
2812
+  Test Files 16 passed (44)
2813
+  Tests 472 passed | 2 skipped (574)
2814
+  Start at 17:52:48
2815
+  Duration 727ms
2816
+ [?2026l[?2026hstderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
2817
+ [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
2818
+
2819
+
2820
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2821
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2822
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2823
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2824
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2825
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2826
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2827
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2828
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2829
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2830
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2831
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2832
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2833
+
2834
+  Test Files 16 passed (44)
2835
+  Tests 472 passed | 2 skipped (574)
2836
+  Start at 17:52:48
2837
+  Duration 727ms
2838
+ [?2026l[?2026h ✓ src/__tests__/runtime/tool-protection-enforcement.test.ts (29 tests) 18ms
2839
+
2840
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2841
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2842
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2843
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2844
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2845
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2846
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2847
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2848
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2849
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2850
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2851
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2852
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2853
+
2854
+  Test Files 16 passed (44)
2855
+  Tests 472 passed | 2 skipped (574)
2856
+  Start at 17:52:48
2857
+  Duration 727ms
2858
+ [?2026l[?2026hstderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
2859
+ [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'
2860
+
2861
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should fall back to memory when Redis connection fails
2862
+ [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
2863
+
2864
+ stderr | src/services/__tests__/proof-verifier.test.ts > ProofVerifier Security > Signature Verification > should handle signature verification errors gracefully
2865
+ [CryptoService] Ed25519 verification error: Error: Crypto error
2866
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.test.ts:328:9
2867
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2868
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2869
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2870
+ at new Promise (<anonymous>)
2871
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2872
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2873
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
2874
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2875
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2876
+
2877
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should use KV namespace when provided
2878
+ [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'
2879
+
2880
+
2881
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
2882
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
2883
+  ❯ src/__tests__/providers/memory.test.ts 0/34
2884
+  ❯ src/__tests__/regression/phase2-regression.test.ts 0/12
2885
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
2886
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2887
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
2888
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2889
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
2890
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
2891
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 0/12
2892
+  ❯ src/services/__tests__/proof-verifier.test.ts 0/21
2893
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
2894
+
2895
+  Test Files 16 passed (44)
2896
+  Tests 472 passed | 2 skipped (574)
2897
+  Start at 17:52:48
2898
+  Duration 727ms
2899
+ [?2026l[?2026h ✓ src/__tests__/providers/memory.test.ts (34 tests) 8ms
2900
+
2901
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
2902
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
2903
+  ❯ src/__tests__/providers/memory.test.ts 34/34
2904
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
2905
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
2906
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2907
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
2908
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
2909
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
2910
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
2911
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2912
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
2913
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2914
+
2915
+  Test Files 24 passed (44)
2916
+  Tests 629 passed | 2 skipped (663)
2917
+  Start at 17:52:48
2918
+  Duration 827ms
2919
+ [?2026l[?2026hstderr | 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
2920
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2921
+ correlationId: 'ad96c32e-52a5-4887-a858-92d70ca77f0d',
2922
+ status: 200,
2923
+ statusText: undefined,
2924
+ headers: {},
2925
+ responseTextLength: 191,
2926
+ 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-24T23:52:49.047Z"}}',
2927
+ 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-24T23:52:49.047Z"}}'
2928
+ }
2929
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
2930
+ correlationId: 'ad96c32e-52a5-4887-a858-92d70ca77f0d',
2931
+ status: 200,
2932
+ responseDataType: 'object',
2933
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
2934
+ responseData: '{\n' +
2935
+ ' "success": true,\n' +
2936
+ ' "data": {\n' +
2937
+ ' "accepted": 1,\n' +
2938
+ ' "rejected": 0,\n' +
2939
+ ' "outcomes": {\n' +
2940
+ ' "success": 1,\n' +
2941
+ ' "failed": 0,\n' +
2942
+ ' "blocked": 0,\n' +
2943
+ ' "error": 0\n' +
2944
+ ' }\n' +
2945
+ ' },\n' +
2946
+ ' "metadata": {\n' +
2947
+ ' "requestId": "test-request-id",\n' +
2948
+ ' "timestamp": "2025-11-24T23:52:49.047Z"\n' +
2949
+ ' }\n' +
2950
+ '}'
2951
+ }
2952
+ [AccessControl] Raw response received: {
2953
+ "success": true,
2954
+ "data": {
2955
+ "accepted": 1,
2956
+ "rejected": 0,
2957
+ "outcomes": {
2958
+ "success": 1,
2959
+ "failed": 0,
2960
+ "blocked": 0,
2961
+ "error": 0
2962
+ }
2963
+ },
2964
+ "metadata": {
2965
+ "requestId": "test-request-id",
2966
+ "timestamp": "2025-11-24T23:52:49.047Z"
2967
+ }
2968
+ }
2969
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
2970
+ correlationId: 'ad96c32e-52a5-4887-a858-92d70ca77f0d',
2971
+ dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
2972
+ hasAccepted: true,
2973
+ hasRejected: true,
2974
+ hasOutcomes: true,
2975
+ hasErrors: false,
2976
+ acceptedType: 'number',
2977
+ acceptedValue: 1,
2978
+ rejectedType: 'number',
2979
+ rejectedValue: 0,
2980
+ outcomesType: 'object',
2981
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
2982
+ errorsType: 'undefined',
2983
+ errorsIsArray: false,
2984
+ fullData: '{\n' +
2985
+ ' "accepted": 1,\n' +
2986
+ ' "rejected": 0,\n' +
2987
+ ' "outcomes": {\n' +
2988
+ ' "success": 1,\n' +
2989
+ ' "failed": 0,\n' +
2990
+ ' "blocked": 0,\n' +
2991
+ ' "error": 0\n' +
2992
+ ' }\n' +
2993
+ '}'
2994
+ }
2995
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
2996
+ correlationId: 'ad96c32e-52a5-4887-a858-92d70ca77f0d',
2997
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
2998
+ hasSuccess: true,
2999
+ successValue: true,
3000
+ hasAccepted: true,
3001
+ acceptedValue: 1,
3002
+ hasRejected: true,
3003
+ rejectedValue: 0,
3004
+ hasOutcomes: true,
3005
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
3006
+ fullDataWithSuccess: '{\n' +
3007
+ ' "success": true,\n' +
3008
+ ' "accepted": 1,\n' +
3009
+ ' "rejected": 0,\n' +
3010
+ ' "outcomes": {\n' +
3011
+ ' "success": 1,\n' +
3012
+ ' "failed": 0,\n' +
3013
+ ' "blocked": 0,\n' +
3014
+ ' "error": 0\n' +
3015
+ ' }\n' +
3016
+ '}'
3017
+ }
3018
+
3019
+ 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
3020
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
3021
+ correlationId: 'ad29b63a-0efd-473d-b421-1877f8ab7a4f',
3022
+ status: 200,
3023
+ statusText: undefined,
3024
+ headers: {},
3025
+ responseTextLength: 333,
3026
+ 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-24T23:52:49.110Z"}}',
3027
+ 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-24T23:52:49.110Z"}}'
3028
+ }
3029
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
3030
+ correlationId: 'ad29b63a-0efd-473d-b421-1877f8ab7a4f',
3031
+ status: 200,
3032
+ responseDataType: 'object',
3033
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
3034
+ responseData: '{\n' +
3035
+ ' "success": true,\n' +
3036
+ ' "data": {\n' +
3037
+ ' "accepted": 0,\n' +
3038
+ ' "rejected": 1,\n' +
3039
+ ' "outcomes": {\n' +
3040
+ ' "success": 0,\n' +
3041
+ ' "failed": 1,\n' +
3042
+ ' "blocked": 0,\n' +
3043
+ ' "error": 0\n' +
3044
+ ' },\n' +
3045
+ ' "errors": [\n' +
3046
+ ' {\n' +
3047
+ ' "proof_index": 0,\n' +
3048
+ ' "error": {\n' +
3049
+ ' "code": "validation_error",\n' +
3050
+ ' "message": "Proof validation failed",\n' +
3051
+ ' "details": {\n' +
3052
+ ' "reason": "invalid_signature"\n' +
3053
+ ' }\n' +
3054
+ ' }\n' +
3055
+ ' }\n' +
3056
+ ' ]\n' +
3057
+ ' },\n' +
3058
+ ' "metadata": {\n' +
3059
+ ' "requestId": "test-request-id",\n' +
3060
+ ' "timestamp": "2025-11-24T23:52:49.110Z"\n' +
3061
+ ' }\n' +
3062
+ '}'
3063
+ }
3064
+ [AccessControl] Raw response received: {
3065
+ "success": true,
3066
+ "data": {
3067
+ "accepted": 0,
3068
+ "rejected": 1,
3069
+ "outcomes": {
3070
+ "success": 0,
3071
+ "failed": 1,
3072
+ "blocked": 0,
3073
+ "error": 0
3074
+ },
3075
+ "errors": [
3076
+ {
3077
+ "proof_index": 0,
3078
+ "error": {
3079
+ "code": "validation_error",
3080
+ "message": "Proof validation failed",
3081
+ "details": {
3082
+ "reason": "invalid_signature"
3083
+ }
3084
+ }
3085
+ }
3086
+ ]
3087
+ },
3088
+ "metadata": {
3089
+ "requestId": "test-request-id",
3090
+ "timestamp": "2025-11-24T23:52:49.110Z"
3091
+ }
3092
+ }
3093
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
3094
+ correlationId: 'ad29b63a-0efd-473d-b421-1877f8ab7a4f',
3095
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
3096
+ hasAccepted: true,
3097
+ hasRejected: true,
3098
+ hasOutcomes: true,
3099
+ hasErrors: true,
3100
+ acceptedType: 'number',
3101
+ acceptedValue: 0,
3102
+ rejectedType: 'number',
3103
+ rejectedValue: 1,
3104
+ outcomesType: 'object',
3105
+ outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
3106
+ errorsType: 'object',
3107
+ errorsIsArray: true,
3108
+ fullData: '{\n' +
3109
+ ' "accepted": 0,\n' +
3110
+ ' "rejected": 1,\n' +
3111
+ ' "outcomes": {\n' +
3112
+ ' "success": 0,\n' +
3113
+ ' "failed": 1,\n' +
3114
+ ' "blocked": 0,\n' +
3115
+ ' "error": 0\n' +
3116
+ ' },\n' +
3117
+ ' "errors": [\n' +
3118
+ ' {\n' +
3119
+ ' "proof_index": 0,\n' +
3120
+ ' "error": {\n' +
3121
+ ' "code": "validation_error",\n' +
3122
+ ' "message": "Proof validation failed",\n' +
3123
+ ' "details": {\n' +
3124
+ ' "reason": "invalid_signature"\n' +
3125
+ ' }\n' +
3126
+ ' }\n' +
3127
+ ' }\n' +
3128
+ ' ]\n' +
3129
+ '}'
3130
+ }
3131
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
3132
+ correlationId: 'ad29b63a-0efd-473d-b421-1877f8ab7a4f',
3133
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
3134
+ hasSuccess: true,
3135
+ successValue: true,
3136
+ hasAccepted: true,
3137
+ acceptedValue: 0,
3138
+ hasRejected: true,
3139
+ rejectedValue: 1,
3140
+ hasOutcomes: true,
3141
+ outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
3142
+ fullDataWithSuccess: '{\n' +
3143
+ ' "success": true,\n' +
3144
+ ' "accepted": 0,\n' +
3145
+ ' "rejected": 1,\n' +
3146
+ ' "outcomes": {\n' +
3147
+ ' "success": 0,\n' +
3148
+ ' "failed": 1,\n' +
3149
+ ' "blocked": 0,\n' +
3150
+ ' "error": 0\n' +
3151
+ ' },\n' +
3152
+ ' "errors": [\n' +
3153
+ ' {\n' +
3154
+ ' "proof_index": 0,\n' +
3155
+ ' "error": {\n' +
3156
+ ' "code": "validation_error",\n' +
3157
+ ' "message": "Proof validation failed",\n' +
3158
+ ' "details": {\n' +
3159
+ ' "reason": "invalid_signature"\n' +
3160
+ ' }\n' +
3161
+ ' }\n' +
3162
+ ' }\n' +
3163
+ ' ]\n' +
3164
+ '}'
3165
+ }
3166
+
3167
+
3168
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3169
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3170
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3171
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3172
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
3173
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3174
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3175
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3176
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3177
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3178
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
3179
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3180
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
3181
+
3182
+  Test Files 24 passed (44)
3183
+  Tests 629 passed | 2 skipped (663)
3184
+  Start at 17:52:48
3185
+  Duration 827ms
3186
+ [?2026l[?2026h ✓ src/services/__tests__/proof-verifier.test.ts (21 tests) 23ms
3187
+
3188
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3189
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3190
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3191
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3192
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
3193
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3194
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3195
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3196
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3197
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3198
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
3199
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3200
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
3201
+
3202
+  Test Files 24 passed (44)
3203
+  Tests 629 passed | 2 skipped (663)
3204
+  Start at 17:52:48
3205
+  Duration 827ms
3206
+ [?2026l[?2026hstderr | 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)
3207
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
3208
+ correlationId: '27682a7f-582d-4e08-a703-a9bc88fbdfe4',
3209
+ status: 200,
3210
+ statusText: undefined,
3211
+ headers: {},
3212
+ responseTextLength: 133,
3213
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T23:52:49.110Z"}}',
3214
+ fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T23:52:49.110Z"}}'
3215
+ }
3216
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
3217
+ correlationId: '27682a7f-582d-4e08-a703-a9bc88fbdfe4',
3218
+ status: 200,
3219
+ responseDataType: 'object',
3220
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
3221
+ responseData: '{\n' +
3222
+ ' "success": true,\n' +
3223
+ ' "data": {\n' +
3224
+ ' "accepted": 1,\n' +
3225
+ ' "rejected": 0\n' +
3226
+ ' },\n' +
3227
+ ' "metadata": {\n' +
3228
+ ' "requestId": "test-request-id",\n' +
3229
+ ' "timestamp": "2025-11-24T23:52:49.110Z"\n' +
3230
+ ' }\n' +
3231
+ '}'
3232
+ }
3233
+ [AccessControl] Raw response received: {
3234
+ "success": true,
3235
+ "data": {
3236
+ "accepted": 1,
3237
+ "rejected": 0
3238
+ },
3239
+ "metadata": {
3240
+ "requestId": "test-request-id",
3241
+ "timestamp": "2025-11-24T23:52:49.110Z"
3242
+ }
3243
+ }
3244
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
3245
+ correlationId: '27682a7f-582d-4e08-a703-a9bc88fbdfe4',
3246
+ dataKeys: [ 'accepted', 'rejected' ],
3247
+ hasAccepted: true,
3248
+ hasRejected: true,
3249
+ hasOutcomes: false,
3250
+ hasErrors: false,
3251
+ acceptedType: 'number',
3252
+ acceptedValue: 1,
3253
+ rejectedType: 'number',
3254
+ rejectedValue: 0,
3255
+ outcomesType: 'undefined',
3256
+ outcomesValue: undefined,
3257
+ errorsType: 'undefined',
3258
+ errorsIsArray: false,
3259
+ fullData: '{\n "accepted": 1,\n "rejected": 0\n}'
3260
+ }
3261
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
3262
+ correlationId: '27682a7f-582d-4e08-a703-a9bc88fbdfe4',
3263
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
3264
+ hasSuccess: true,
3265
+ successValue: true,
3266
+ hasAccepted: true,
3267
+ acceptedValue: 1,
3268
+ hasRejected: true,
3269
+ rejectedValue: 0,
3270
+ hasOutcomes: false,
3271
+ outcomesValue: undefined,
3272
+ fullDataWithSuccess: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
3273
+ }
3274
+
3275
+ 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
3276
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
3277
+ correlationId: '2a24ca10-b029-43b6-90f2-faf4cf3d29cb',
3278
+ status: 200,
3279
+ statusText: undefined,
3280
+ headers: {},
3281
+ responseTextLength: 191,
3282
+ 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-24T23:52:49.111Z"}}',
3283
+ 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-24T23:52:49.111Z"}}'
3284
+ }
3285
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
3286
+ correlationId: '2a24ca10-b029-43b6-90f2-faf4cf3d29cb',
3287
+ status: 200,
3288
+ responseDataType: 'object',
3289
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
3290
+ responseData: '{\n' +
3291
+ ' "success": true,\n' +
3292
+ ' "data": {\n' +
3293
+ ' "accepted": 1,\n' +
3294
+ ' "rejected": 0,\n' +
3295
+ ' "outcomes": {\n' +
3296
+ ' "success": 1,\n' +
3297
+ ' "failed": 0,\n' +
3298
+ ' "blocked": 0,\n' +
3299
+ ' "error": 0\n' +
3300
+ ' }\n' +
3301
+ ' },\n' +
3302
+ ' "metadata": {\n' +
3303
+ ' "requestId": "test-request-id",\n' +
3304
+ ' "timestamp": "2025-11-24T23:52:49.111Z"\n' +
3305
+ ' }\n' +
3306
+ '}'
3307
+ }
3308
+ [AccessControl] Raw response received: {
3309
+ "success": true,
3310
+ "data": {
3311
+ "accepted": 1,
3312
+ "rejected": 0,
3313
+ "outcomes": {
3314
+ "success": 1,
3315
+ "failed": 0,
3316
+ "blocked": 0,
3317
+ "error": 0
3318
+ }
3319
+ },
3320
+ "metadata": {
3321
+ "requestId": "test-request-id",
3322
+ "timestamp": "2025-11-24T23:52:49.111Z"
3323
+ }
3324
+ }
3325
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
3326
+ correlationId: '2a24ca10-b029-43b6-90f2-faf4cf3d29cb',
3327
+ dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
3328
+ hasAccepted: true,
3329
+ hasRejected: true,
3330
+ hasOutcomes: true,
3331
+ hasErrors: false,
3332
+ acceptedType: 'number',
3333
+ acceptedValue: 1,
3334
+ rejectedType: 'number',
3335
+ rejectedValue: 0,
3336
+ outcomesType: 'object',
3337
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
3338
+ errorsType: 'undefined',
3339
+ errorsIsArray: false,
3340
+ fullData: '{\n' +
3341
+ ' "accepted": 1,\n' +
3342
+ ' "rejected": 0,\n' +
3343
+ ' "outcomes": {\n' +
3344
+ ' "success": 1,\n' +
3345
+ ' "failed": 0,\n' +
3346
+ ' "blocked": 0,\n' +
3347
+ ' "error": 0\n' +
3348
+ ' }\n' +
3349
+ '}'
3350
+ }
3351
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
3352
+ correlationId: '2a24ca10-b029-43b6-90f2-faf4cf3d29cb',
3353
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
3354
+ hasSuccess: true,
3355
+ successValue: true,
3356
+ hasAccepted: true,
3357
+ acceptedValue: 1,
3358
+ hasRejected: true,
3359
+ rejectedValue: 0,
3360
+ hasOutcomes: true,
3361
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
3362
+ fullDataWithSuccess: '{\n' +
3363
+ ' "success": true,\n' +
3364
+ ' "accepted": 1,\n' +
3365
+ ' "rejected": 0,\n' +
3366
+ ' "outcomes": {\n' +
3367
+ ' "success": 1,\n' +
3368
+ ' "failed": 0,\n' +
3369
+ ' "blocked": 0,\n' +
3370
+ ' "error": 0\n' +
3371
+ ' }\n' +
3372
+ '}'
3373
+ }
3374
+
3375
+ 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
3376
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
3377
+ correlationId: '5723bd29-b42c-457f-a1c1-e9508d75669a',
3378
+ status: 200,
3379
+ statusText: undefined,
3380
+ headers: {},
3381
+ responseTextLength: 191,
3382
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1},"errors":[]},"metadata":{"requestId":"fc1fa88f-9b22-4161-b4fd-17d8215098ee","timestamp":"2025-11-24T21:36:33.029Z"}}',
3383
+ 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"}}'
3384
+ }
3385
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
3386
+ correlationId: '5723bd29-b42c-457f-a1c1-e9508d75669a',
3387
+ status: 200,
3388
+ responseDataType: 'object',
3389
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
3390
+ responseData: '{\n' +
3391
+ ' "success": true,\n' +
3392
+ ' "data": {\n' +
3393
+ ' "accepted": 1,\n' +
3394
+ ' "rejected": 0,\n' +
3395
+ ' "outcomes": {\n' +
3396
+ ' "success": 1\n' +
3397
+ ' },\n' +
3398
+ ' "errors": []\n' +
3399
+ ' },\n' +
3400
+ ' "metadata": {\n' +
3401
+ ' "requestId": "fc1fa88f-9b22-4161-b4fd-17d8215098ee",\n' +
3402
+ ' "timestamp": "2025-11-24T21:36:33.029Z"\n' +
3403
+ ' }\n' +
3404
+ '}'
3405
+ }
3406
+ [AccessControl] Raw response received: {
3407
+ "success": true,
3408
+ "data": {
3409
+ "accepted": 1,
3410
+ "rejected": 0,
3411
+ "outcomes": {
3412
+ "success": 1
3413
+ },
3414
+ "errors": []
3415
+ },
3416
+ "metadata": {
3417
+ "requestId": "fc1fa88f-9b22-4161-b4fd-17d8215098ee",
3418
+ "timestamp": "2025-11-24T21:36:33.029Z"
3419
+ }
3420
+ }
3421
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
3422
+ correlationId: '5723bd29-b42c-457f-a1c1-e9508d75669a',
3423
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
3424
+ hasAccepted: true,
3425
+ hasRejected: true,
3426
+ hasOutcomes: true,
3427
+ hasErrors: true,
3428
+ acceptedType: 'number',
3429
+ acceptedValue: 1,
3430
+ rejectedType: 'number',
3431
+ rejectedValue: 0,
3432
+ outcomesType: 'object',
3433
+ outcomesValue: { success: 1 },
3434
+ errorsType: 'object',
3435
+ errorsIsArray: true,
3436
+ fullData: '{\n' +
3437
+ ' "accepted": 1,\n' +
3438
+ ' "rejected": 0,\n' +
3439
+ ' "outcomes": {\n' +
3440
+ ' "success": 1\n' +
3441
+ ' },\n' +
3442
+ ' "errors": []\n' +
3443
+ '}'
3444
+ }
3445
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
3446
+ correlationId: '5723bd29-b42c-457f-a1c1-e9508d75669a',
3447
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
3448
+ hasSuccess: true,
3449
+ successValue: true,
3450
+ hasAccepted: true,
3451
+ acceptedValue: 1,
3452
+ hasRejected: true,
3453
+ rejectedValue: 0,
3454
+ hasOutcomes: true,
3455
+ outcomesValue: { success: 1 },
3456
+ fullDataWithSuccess: '{\n' +
3457
+ ' "success": true,\n' +
3458
+ ' "accepted": 1,\n' +
3459
+ ' "rejected": 0,\n' +
3460
+ ' "outcomes": {\n' +
3461
+ ' "success": 1\n' +
3462
+ ' },\n' +
3463
+ ' "errors": []\n' +
3464
+ '}'
3465
+ }
3466
+
3467
+ 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)
3468
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
3469
+ correlationId: 'a382c923-903e-4c59-bc1c-4e14a99a598f',
3470
+ status: 200,
3471
+ statusText: undefined,
3472
+ headers: {},
3473
+ responseTextLength: 151,
3474
+ responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-11-24T23:52:49.114Z"}}',
3475
+ fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-11-24T23:52:49.114Z"}}'
3476
+ }
3477
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
3478
+ correlationId: 'a382c923-903e-4c59-bc1c-4e14a99a598f',
3479
+ status: 200,
3480
+ responseDataType: 'object',
3481
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
3482
+ responseData: '{\n' +
3483
+ ' "success": true,\n' +
3484
+ ' "data": {\n' +
3485
+ ' "accepted": 0,\n' +
3486
+ ' "rejected": 0,\n' +
3487
+ ' "outcomes": {},\n' +
3488
+ ' "errors": []\n' +
3489
+ ' },\n' +
3490
+ ' "metadata": {\n' +
3491
+ ' "requestId": "test-id",\n' +
3492
+ ' "timestamp": "2025-11-24T23:52:49.114Z"\n' +
3493
+ ' }\n' +
3494
+ '}'
3495
+ }
3496
+ [AccessControl] Raw response received: {
3497
+ "success": true,
3498
+ "data": {
3499
+ "accepted": 0,
3500
+ "rejected": 0,
3501
+ "outcomes": {},
3502
+ "errors": []
3503
+ },
3504
+ "metadata": {
3505
+ "requestId": "test-id",
3506
+ "timestamp": "2025-11-24T23:52:49.114Z"
3507
+ }
3508
+ }
3509
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
3510
+ correlationId: 'a382c923-903e-4c59-bc1c-4e14a99a598f',
3511
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
3512
+ hasAccepted: true,
3513
+ hasRejected: true,
3514
+ hasOutcomes: true,
3515
+ hasErrors: true,
3516
+ acceptedType: 'number',
3517
+ acceptedValue: 0,
3518
+ rejectedType: 'number',
3519
+ rejectedValue: 0,
3520
+ outcomesType: 'object',
3521
+ outcomesValue: {},
3522
+ errorsType: 'object',
3523
+ errorsIsArray: true,
3524
+ fullData: '{\n "accepted": 0,\n "rejected": 0,\n "outcomes": {},\n "errors": []\n}'
3525
+ }
3526
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
3527
+ correlationId: 'a382c923-903e-4c59-bc1c-4e14a99a598f',
3528
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
3529
+ hasSuccess: true,
3530
+ successValue: true,
3531
+ hasAccepted: true,
3532
+ acceptedValue: 0,
3533
+ hasRejected: true,
3534
+ rejectedValue: 0,
3535
+ hasOutcomes: true,
3536
+ outcomesValue: {},
3537
+ fullDataWithSuccess: '{\n' +
3538
+ ' "success": true,\n' +
3539
+ ' "accepted": 0,\n' +
3540
+ ' "rejected": 0,\n' +
3541
+ ' "outcomes": {},\n' +
3542
+ ' "errors": []\n' +
3543
+ '}'
3544
+ }
3545
+
3546
+ 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
3547
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
3548
+ correlationId: 'eb3e998b-0929-4bd6-b912-44bf3d74cecf',
3549
+ status: 200,
3550
+ statusText: undefined,
3551
+ headers: {},
3552
+ responseTextLength: 278,
3553
+ 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-24T23:52:49.115Z"}}',
3554
+ 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-24T23:52:49.115Z"}}'
3555
+ }
3556
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
3557
+ correlationId: 'eb3e998b-0929-4bd6-b912-44bf3d74cecf',
3558
+ status: 200,
3559
+ responseDataType: 'object',
3560
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
3561
+ responseData: '{\n' +
3562
+ ' "success": true,\n' +
3563
+ ' "data": {\n' +
3564
+ ' "accepted": 3,\n' +
3565
+ ' "rejected": 2,\n' +
3566
+ ' "outcomes": {\n' +
3567
+ ' "success": 1,\n' +
3568
+ ' "failed": 1,\n' +
3569
+ ' "blocked": 1,\n' +
3570
+ ' "error": 2\n' +
3571
+ ' },\n' +
3572
+ ' "errors": [\n' +
3573
+ ' {\n' +
3574
+ ' "proof_index": 0,\n' +
3575
+ ' "error": {\n' +
3576
+ ' "code": "validation_error",\n' +
3577
+ ' "message": "Invalid signature"\n' +
3578
+ ' }\n' +
3579
+ ' }\n' +
3580
+ ' ]\n' +
3581
+ ' },\n' +
3582
+ ' "metadata": {\n' +
3583
+ ' "requestId": "test-id",\n' +
3584
+ ' "timestamp": "2025-11-24T23:52:49.115Z"\n' +
3585
+ ' }\n' +
3586
+ '}'
3587
+ }
3588
+ [AccessControl] Raw response received: {
3589
+ "success": true,
3590
+ "data": {
3591
+ "accepted": 3,
3592
+ "rejected": 2,
3593
+ "outcomes": {
3594
+ "success": 1,
3595
+ "failed": 1,
3596
+ "blocked": 1,
3597
+ "error": 2
3598
+ },
3599
+ "errors": [
3600
+ {
3601
+ "proof_index": 0,
3602
+ "error": {
3603
+ "code": "validation_error",
3604
+ "message": "Invalid signature"
3605
+ }
3606
+ }
3607
+ ]
3608
+ },
3609
+ "metadata": {
3610
+ "requestId": "test-id",
3611
+ "timestamp": "2025-11-24T23:52:49.115Z"
3612
+ }
3613
+ }
3614
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
3615
+ correlationId: 'eb3e998b-0929-4bd6-b912-44bf3d74cecf',
3616
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
3617
+ hasAccepted: true,
3618
+ hasRejected: true,
3619
+ hasOutcomes: true,
3620
+ hasErrors: true,
3621
+ acceptedType: 'number',
3622
+ acceptedValue: 3,
3623
+ rejectedType: 'number',
3624
+ rejectedValue: 2,
3625
+ outcomesType: 'object',
3626
+ outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
3627
+ errorsType: 'object',
3628
+ errorsIsArray: true,
3629
+ fullData: '{\n' +
3630
+ ' "accepted": 3,\n' +
3631
+ ' "rejected": 2,\n' +
3632
+ ' "outcomes": {\n' +
3633
+ ' "success": 1,\n' +
3634
+ ' "failed": 1,\n' +
3635
+ ' "blocked": 1,\n' +
3636
+ ' "error": 2\n' +
3637
+ ' },\n' +
3638
+ ' "errors": [\n' +
3639
+ ' {\n' +
3640
+ ' "proof_index": 0,\n' +
3641
+ ' "error": {\n' +
3642
+ ' "code": "validation_error",\n' +
3643
+ ' "message": "Invalid signature"\n' +
3644
+ ' }\n' +
3645
+ ' }\n' +
3646
+ ' ]\n' +
3647
+ '}'
3648
+ }
3649
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
3650
+ correlationId: 'eb3e998b-0929-4bd6-b912-44bf3d74cecf',
3651
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
3652
+ hasSuccess: true,
3653
+ successValue: true,
3654
+ hasAccepted: true,
3655
+ acceptedValue: 3,
3656
+ hasRejected: true,
3657
+ rejectedValue: 2,
3658
+ hasOutcomes: true,
3659
+ outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
3660
+ fullDataWithSuccess: '{\n' +
3661
+ ' "success": true,\n' +
3662
+ ' "accepted": 3,\n' +
3663
+ ' "rejected": 2,\n' +
3664
+ ' "outcomes": {\n' +
3665
+ ' "success": 1,\n' +
3666
+ ' "failed": 1,\n' +
3667
+ ' "blocked": 1,\n' +
3668
+ ' "error": 2\n' +
3669
+ ' },\n' +
3670
+ ' "errors": [\n' +
3671
+ ' {\n' +
3672
+ ' "proof_index": 0,\n' +
3673
+ ' "error": {\n' +
3674
+ ' "code": "validation_error",\n' +
3675
+ ' "message": "Invalid signature"\n' +
3676
+ ' }\n' +
3677
+ ' }\n' +
3678
+ ' ]\n' +
3679
+ '}'
3680
+ }
3681
+
3682
+
3683
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3684
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3685
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3686
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3687
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
3688
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3689
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3690
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3691
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3692
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3693
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
3694
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3695
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
3696
+
3697
+  Test Files 24 passed (44)
3698
+  Tests 629 passed | 2 skipped (663)
3699
+  Start at 17:52:48
3700
+  Duration 827ms
3701
+ [?2026l[?2026h ✓ src/services/__tests__/storage.service.test.ts (17 tests) 70ms
3702
+ 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
3703
+ [ToolProtectionService] Config loaded from API {
3704
+ source: 'api',
3705
+ toolCount: 1,
3706
+ protectedTools: [ 'phase1_tool' ],
3707
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3708
+ projectId: 'none',
3709
+ cacheTtlMs: 300000,
3710
+ cacheExpiresAt: '2025-11-24T23:57:49.118Z'
3711
+ }
3712
+
3713
+ 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)
3714
+ [ToolProtectionService] Config loaded from API {
3715
+ source: 'api',
3716
+ toolCount: 1,
3717
+ protectedTools: [ 'old_tool' ],
3718
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3719
+ projectId: 'none',
3720
+ cacheTtlMs: 300000,
3721
+ cacheExpiresAt: '2025-11-24T23:57:49.127Z'
3722
+ }
3723
+
3724
+ 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)
3725
+ [ToolProtectionService] Config loaded from API {
3726
+ source: 'api',
3727
+ toolCount: 1,
3728
+ protectedTools: [ 'old_tool' ],
3729
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3730
+ projectId: 'none',
3731
+ cacheTtlMs: 300000,
3732
+ cacheExpiresAt: '2025-11-24T23:57:49.127Z'
3733
+ }
3734
+
3735
+ 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
3736
+ [ToolProtectionService] Config loaded from API {
3737
+ source: 'api',
3738
+ toolCount: 1,
3739
+ protectedTools: [ 'tool_with_snake_case' ],
3740
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3741
+ projectId: 'test-project-123',
3742
+ cacheTtlMs: 300000,
3743
+ cacheExpiresAt: '2025-11-24T23:57:49.127Z'
3744
+ }
3745
+
3746
+
3747
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3748
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3749
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3750
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3751
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
3752
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3753
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3754
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3755
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3756
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3757
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
3758
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3759
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
3760
+
3761
+  Test Files 24 passed (44)
3762
+  Tests 629 passed | 2 skipped (663)
3763
+  Start at 17:52:48
3764
+  Duration 827ms
3765
+ [?2026l[?2026hstderr | 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)
3766
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
3767
+
3768
+
3769
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3770
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3771
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3772
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3773
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
3774
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3775
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3776
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3777
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3778
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3779
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
3780
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3781
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
3782
+
3783
+  Test Files 24 passed (44)
3784
+  Tests 629 passed | 2 skipped (663)
3785
+  Start at 17:52:48
3786
+  Duration 827ms
3787
+ [?2026l[?2026hstdout | 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
3788
+ [ToolProtectionService] Config loaded from API {
3789
+ source: 'api',
3790
+ toolCount: 2,
3791
+ protectedTools: [ 'phase1_tool', 'phase2_tool' ],
3792
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3793
+ projectId: 'test-project-123',
3794
+ cacheTtlMs: 300000,
3795
+ cacheExpiresAt: '2025-11-24T23:57:49.128Z'
3796
+ }
3797
+
3798
+
3799
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3800
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3801
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3802
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3803
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
3804
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3805
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3806
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3807
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3808
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3809
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
3810
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3811
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
3812
+
3813
+  Test Files 24 passed (44)
3814
+  Tests 629 passed | 2 skipped (663)
3815
+  Start at 17:52:48
3816
+  Duration 827ms
3817
+ [?2026l[?2026hstderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.get errors gracefully
3818
+ [UserDidManager] Storage.get failed, generating new DID: Error: Storage error
3819
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:187:67
3820
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
3821
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
3822
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
3823
+ at new Promise (<anonymous>)
3824
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
3825
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
3826
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3827
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
3828
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
3829
+
3830
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.set errors gracefully
3831
+ [UserDidManager] Storage.set failed, continuing with cached DID: Error: Storage error
3832
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:196:67
3833
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
3834
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
3835
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
3836
+ at new Promise (<anonymous>)
3837
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
3838
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
3839
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3840
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
3841
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
3842
+
3843
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.delete errors gracefully
3844
+ [UserDidManager] Storage.delete failed, continuing: Error: Storage error
3845
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:206:70
3846
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3847
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
3848
+
3849
+
3850
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3851
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3852
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3853
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3854
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
3855
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3856
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3857
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3858
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3859
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3860
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
3861
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3862
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
3863
+
3864
+  Test Files 24 passed (44)
3865
+  Tests 629 passed | 2 skipped (663)
3866
+  Start at 17:52:48
3867
+  Duration 827ms
3868
+ [?2026l[?2026h ✓ src/services/__tests__/access-control.proof-response-validation.test.ts (12 tests) 78ms
3869
+ ✓ src/__tests__/identity/user-did-manager.test.ts (17 tests) 7ms
3870
+ ✓ src/__tests__/regression/phase2-regression.test.ts (12 tests) 12ms
3871
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should allow unprotected tool calls
3872
+ [ToolProtectionService] Config loaded from API {
3873
+ source: 'api',
3874
+ toolCount: 1,
3875
+ protectedTools: [],
3876
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3877
+ projectId: 'test-project',
3878
+ cacheTtlMs: 300000,
3879
+ cacheExpiresAt: '2025-11-24T23:57:49.142Z'
3880
+ }
3881
+
3882
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
3883
+ [ToolProtectionService] Config loaded from API {
3884
+ source: 'api',
3885
+ toolCount: 1,
3886
+ protectedTools: [ 'checkout' ],
3887
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3888
+ projectId: 'test-project',
3889
+ cacheTtlMs: 300000,
3890
+ cacheExpiresAt: '2025-11-24T23:57:49.143Z'
3891
+ }
3892
+
3893
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
3894
+ [ToolProtectionService] Protection check {
3895
+ tool: 'checkout',
3896
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3897
+ found: true,
3898
+ isWildcard: false,
3899
+ requiresDelegation: true,
3900
+ availableTools: [ 'checkout' ]
3901
+ }
3902
+
3903
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should fetch tool protection config from AgentShield
3904
+ [ToolProtectionService] Config loaded from API {
3905
+ source: 'api',
3906
+ toolCount: 1,
3907
+ protectedTools: [ 'protected_tool' ],
3908
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3909
+ projectId: 'test-project',
3910
+ cacheTtlMs: 300000,
3911
+ cacheExpiresAt: '2025-11-24T23:57:49.143Z'
3912
+ }
3913
+
3914
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should cache tool protection config
3915
+ [ToolProtectionService] Config loaded from API {
3916
+ source: 'api',
3917
+ toolCount: 1,
3918
+ protectedTools: [ 'tool1' ],
3919
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3920
+ projectId: 'test-project',
3921
+ cacheTtlMs: 300000,
3922
+ cacheExpiresAt: '2025-11-24T23:57:49.144Z'
3923
+ }
3924
+
3925
+
3926
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3927
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3928
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3929
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3930
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
3931
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3932
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3933
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3934
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3935
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3936
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
3937
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3938
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
3939
+
3940
+  Test Files 24 passed (44)
3941
+  Tests 629 passed | 2 skipped (663)
3942
+  Start at 17:52:48
3943
+  Duration 827ms
3944
+ [?2026l[?2026hstderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should use fallback config when API fails
3945
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
3946
+
3947
+ stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle tool protection service errors gracefully
3948
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
3949
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3950
+ error: 'Network error',
3951
+ cacheKey: 'config:tool-protections:test-project'
3952
+ }
3953
+
3954
+ stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle network timeouts
3955
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
3956
+
3957
+
3958
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3959
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3960
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3961
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3962
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
3963
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3964
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3965
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3966
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3967
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3968
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
3969
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3970
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
3971
+
3972
+  Test Files 24 passed (44)
3973
+  Tests 629 passed | 2 skipped (663)
3974
+  Start at 17:52:48
3975
+  Duration 827ms
3976
+ [?2026l[?2026hstdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should share cache across multiple service instances
3977
+ [ToolProtectionService] Config loaded from API {
3978
+ source: 'api',
3979
+ toolCount: 1,
3980
+ protectedTools: [ 'tool1' ],
3981
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3982
+ projectId: 'test-project',
3983
+ cacheTtlMs: 300000,
3984
+ cacheExpiresAt: '2025-11-24T23:57:49.146Z'
3985
+ }
3986
+
3987
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
3988
+ [ToolProtectionService] Config loaded from API {
3989
+ source: 'api',
3990
+ toolCount: 1,
3991
+ protectedTools: [ 'tool1' ],
3992
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3993
+ projectId: 'test-project',
3994
+ cacheTtlMs: 300000,
3995
+ cacheExpiresAt: '2025-11-24T23:57:49.146Z'
3996
+ }
3997
+
3998
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
3999
+ [ToolProtectionService] Config loaded from API {
4000
+ source: 'api',
4001
+ toolCount: 1,
4002
+ protectedTools: [ 'tool1' ],
4003
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4004
+ projectId: 'test-project',
4005
+ cacheTtlMs: 300000,
4006
+ cacheExpiresAt: '2025-11-24T23:57:49.146Z'
4007
+ }
4008
+
4009
+ 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
4010
+ [ToolProtectionService] Config loaded from API {
4011
+ source: 'api',
4012
+ toolCount: 3,
4013
+ protectedTools: [ 'add_to_cart', 'checkout' ],
4014
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4015
+ projectId: 'test-project',
4016
+ cacheTtlMs: 300000,
4017
+ cacheExpiresAt: '2025-11-24T23:57:49.146Z'
4018
+ }
4019
+
4020
+ 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
4021
+ [ToolProtectionService] Protection check {
4022
+ tool: 'add_to_cart',
4023
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4024
+ found: true,
4025
+ isWildcard: false,
4026
+ requiresDelegation: true,
4027
+ availableTools: [ 'search_products', 'add_to_cart', 'checkout' ]
4028
+ }
4029
+
4030
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Concurrent operations > should handle concurrent cache operations
4031
+ [ToolProtectionService] Config loaded from API {
4032
+ source: 'api',
4033
+ toolCount: 1,
4034
+ protectedTools: [ 'tool1' ],
4035
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4036
+ projectId: 'test-project',
4037
+ cacheTtlMs: 300000,
4038
+ cacheExpiresAt: '2025-11-24T23:57:49.147Z'
4039
+ }
4040
+ [ToolProtectionService] Config loaded from API {
4041
+ source: 'api',
4042
+ toolCount: 1,
4043
+ protectedTools: [ 'tool1' ],
4044
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4045
+ projectId: 'test-project',
4046
+ cacheTtlMs: 300000,
4047
+ cacheExpiresAt: '2025-11-24T23:57:49.147Z'
4048
+ }
4049
+ [ToolProtectionService] Config loaded from API {
4050
+ source: 'api',
4051
+ toolCount: 1,
4052
+ protectedTools: [ 'tool1' ],
4053
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4054
+ projectId: 'test-project',
4055
+ cacheTtlMs: 300000,
4056
+ cacheExpiresAt: '2025-11-24T23:57:49.147Z'
4057
+ }
4058
+
4059
+ ✓ src/__tests__/integration/full-flow.test.ts (21 tests) 12ms
4060
+ ✓ src/delegation/__tests__/cascading-revocation.test.ts (23 tests) 8ms
4061
+
4062
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
4063
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
4064
+  ❯ src/__tests__/providers/memory.test.ts 34/34
4065
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
4066
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
4067
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4068
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
4069
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
4070
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
4071
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
4072
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
4073
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
4074
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
4075
+
4076
+  Test Files 24 passed (44)
4077
+  Tests 629 passed | 2 skipped (663)
4078
+  Start at 17:52:48
4079
+  Duration 827ms
4080
+ [?2026l[?2026hstdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from camelCase field
4081
+ [ToolProtectionService] Config loaded from API {
4082
+ source: 'api',
4083
+ toolCount: 2,
4084
+ protectedTools: [ 'read_repos', 'send_email' ],
4085
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4086
+ projectId: 'test-project-123',
4087
+ cacheTtlMs: 300000,
4088
+ cacheExpiresAt: '2025-11-24T23:57:49.319Z'
4089
+ }
4090
+
4091
+ 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
4092
+ [ToolProtectionService] Config loaded from API {
4093
+ source: 'api',
4094
+ toolCount: 1,
4095
+ protectedTools: [ 'read_repos' ],
4096
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4097
+ projectId: 'test-project-123',
4098
+ cacheTtlMs: 300000,
4099
+ cacheExpiresAt: '2025-11-24T23:57:49.323Z'
4100
+ }
4101
+
4102
+ 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
4103
+ [ToolProtectionService] Config loaded from API {
4104
+ source: 'api',
4105
+ toolCount: 1,
4106
+ protectedTools: [ 'read_repos' ],
4107
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4108
+ projectId: 'test-project-123',
4109
+ cacheTtlMs: 300000,
4110
+ cacheExpiresAt: '2025-11-24T23:57:49.323Z'
4111
+ }
4112
+
4113
+ 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)
4114
+ [ToolProtectionService] Config loaded from API {
4115
+ source: 'api',
4116
+ toolCount: 1,
4117
+ protectedTools: [ 'read_repos' ],
4118
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4119
+ projectId: 'test-project-123',
4120
+ cacheTtlMs: 300000,
4121
+ cacheExpiresAt: '2025-11-24T23:57:49.324Z'
4122
+ }
4123
+
4124
+ 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
4125
+ [ToolProtectionService] Config loaded from API {
4126
+ source: 'api',
4127
+ toolCount: 2,
4128
+ protectedTools: [ 'read_repos', 'send_email' ],
4129
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4130
+ projectId: 'none',
4131
+ cacheTtlMs: 300000,
4132
+ cacheExpiresAt: '2025-11-24T23:57:49.325Z'
4133
+ }
4134
+
4135
+ 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
4136
+ [ToolProtectionService] Config loaded from API {
4137
+ source: 'api',
4138
+ toolCount: 1,
4139
+ protectedTools: [ 'read_repos' ],
4140
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4141
+ projectId: 'none',
4142
+ cacheTtlMs: 300000,
4143
+ cacheExpiresAt: '2025-11-24T23:57:49.325Z'
4144
+ }
4145
+
4146
+ 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
4147
+ [ToolProtectionService] Config loaded from API {
4148
+ source: 'api',
4149
+ toolCount: 1,
4150
+ protectedTools: [ 'read_repos' ],
4151
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4152
+ projectId: 'none',
4153
+ cacheTtlMs: 300000,
4154
+ cacheExpiresAt: '2025-11-24T23:57:49.325Z'
4155
+ }
4156
+
4157
+ 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
4158
+ [ToolProtectionService] Config loaded from API {
4159
+ source: 'api',
4160
+ toolCount: 2,
4161
+ protectedTools: [ 'read_repos', 'send_email' ],
4162
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4163
+ projectId: 'none',
4164
+ cacheTtlMs: 300000,
4165
+ cacheExpiresAt: '2025-11-24T23:57:49.325Z'
4166
+ }
4167
+
4168
+ 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
4169
+ [ToolProtectionService] Config loaded from API {
4170
+ source: 'api',
4171
+ toolCount: 1,
4172
+ protectedTools: [ 'read_repos' ],
4173
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4174
+ projectId: 'none',
4175
+ cacheTtlMs: 300000,
4176
+ cacheExpiresAt: '2025-11-24T23:57:49.325Z'
4177
+ }
4178
+
4179
+ 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
4180
+ [ToolProtectionService] Config loaded from API {
4181
+ source: 'api',
4182
+ toolCount: 1,
4183
+ protectedTools: [ 'read_repos' ],
4184
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4185
+ projectId: 'none',
4186
+ cacheTtlMs: 300000,
4187
+ cacheExpiresAt: '2025-11-24T23:57:49.326Z'
4188
+ }
4189
+
4190
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Caching > should cache oauthProvider field correctly
4191
+ [ToolProtectionService] Config loaded from API {
4192
+ source: 'api',
4193
+ toolCount: 1,
4194
+ protectedTools: [ 'read_repos' ],
4195
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4196
+ projectId: 'test-project-123',
4197
+ cacheTtlMs: 300000,
4198
+ cacheExpiresAt: '2025-11-24T23:57:49.326Z'
4199
+ }
4200
+
4201
+ 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
4202
+ [ToolProtectionService] Config loaded from API {
4203
+ source: 'api',
4204
+ toolCount: 2,
4205
+ protectedTools: [ 'tool_with_provider', 'tool_without_provider' ],
4206
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4207
+ projectId: 'test-project-123',
4208
+ cacheTtlMs: 300000,
4209
+ cacheExpiresAt: '2025-11-24T23:57:49.326Z'
4210
+ }
4211
+
4212
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should handle empty string oauthProvider gracefully
4213
+ [ToolProtectionService] Config loaded from API {
4214
+ source: 'api',
4215
+ toolCount: 1,
4216
+ protectedTools: [ 'tool_with_empty_provider' ],
4217
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4218
+ projectId: 'test-project-123',
4219
+ cacheTtlMs: 300000,
4220
+ cacheExpiresAt: '2025-11-24T23:57:49.326Z'
4221
+ }
4222
+
4223
+ ✓ src/delegation/__tests__/delegation-graph.test.ts (28 tests) 17ms
4224
+
4225
+  ❯ src/__tests__/providers/base.test.ts 14/14
4226
+  ❯ src/__tests__/runtime/delegation-flow.test.ts 4/4
4227
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4228
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts 14/14
4229
+  ❯ src/compliance/__tests__/schema-verifier.test.ts 1/30
4230
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
4231
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
4232
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 28/28
4233
+  ❯ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts [queued]
4234
+  ❯ src/services/__tests__/batch-delegation.service.test.ts 0/11
4235
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
4236
+  ❯ src/services/__tests__/provider-resolution.integration.test.ts 0/6
4237
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4238
+
4239
+  Test Files 30 passed (44)
4240
+  Tests 707 passed | 2 skipped (789)
4241
+  Start at 17:52:48
4242
+  Duration 1.06s
4243
+ [?2026l[?2026hstderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API request fails
4244
+ [RemoteConfig] API returned 404: Not Found
4245
+
4246
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API throws error
4247
+ [RemoteConfig] Failed to fetch config: Error: Network error
4248
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:170:35
4249
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
4250
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
4251
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
4252
+ at new Promise (<anonymous>)
4253
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
4254
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
4255
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
4256
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
4257
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
4258
+
4259
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if neither projectId nor agentDid provided
4260
+ [RemoteConfig] Neither projectId nor agentDid provided
4261
+
4262
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should handle cache read errors gracefully
4263
+ [RemoteConfig] Cache read failed: Error: Cache error
4264
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:198:50
4265
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
4266
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
4267
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
4268
+ at new Promise (<anonymous>)
4269
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
4270
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
4271
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
4272
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
4273
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
4274
+
4275
+
4276
+  ❯ src/__tests__/providers/base.test.ts 14/14
4277
+  ❯ src/__tests__/runtime/delegation-flow.test.ts 4/4
4278
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4279
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts 14/14
4280
+  ❯ src/compliance/__tests__/schema-verifier.test.ts 1/30
4281
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
4282
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
4283
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 28/28
4284
+  ❯ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts [queued]
4285
+  ❯ src/services/__tests__/batch-delegation.service.test.ts 0/11
4286
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
4287
+  ❯ src/services/__tests__/provider-resolution.integration.test.ts 0/6
4288
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4289
+
4290
+  Test Files 30 passed (44)
4291
+  Tests 707 passed | 2 skipped (789)
4292
+  Start at 17:52:48
4293
+  Duration 1.06s
4294
+ [?2026l[?2026h ✓ src/__tests__/services/tool-protection-oauth-provider.test.ts (14 tests) 9ms
4295
+ ✓ src/config/__tests__/remote-config.spec.ts (9 tests) 7ms
4296
+ ✓ src/__tests__/providers/base.test.ts (14 tests) 7ms
4297
+ ✓ src/__tests__/runtime/delegation-flow.test.ts (4 tests) 4ms
4298
+ stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from github scope prefix
4299
+ [ProviderResolver] Inferred provider "github" from scopes
4300
+
4301
+ stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from gmail scope prefix (maps to google)
4302
+ [ProviderResolver] Inferred provider "google" from scopes
4303
+
4304
+
4305
+  ❯ src/__tests__/providers/base.test.ts 14/14
4306
+  ❯ src/__tests__/runtime/delegation-flow.test.ts 4/4
4307
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4308
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts 14/14
4309
+  ❯ src/compliance/__tests__/schema-verifier.test.ts 1/30
4310
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
4311
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
4312
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 28/28
4313
+  ❯ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts [queued]
4314
+  ❯ src/services/__tests__/batch-delegation.service.test.ts 0/11
4315
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
4316
+  ❯ src/services/__tests__/provider-resolution.integration.test.ts 0/6
4317
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4318
+
4319
+  Test Files 30 passed (44)
4320
+  Tests 707 passed | 2 skipped (789)
4321
+  Start at 17:52:48
4322
+  Duration 1.06s
4323
+ [?2026l[?2026hstderr | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should return null for ambiguous scopes
4324
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
4325
+
4326
+
4327
+  ❯ src/__tests__/providers/base.test.ts 14/14
4328
+  ❯ src/__tests__/runtime/delegation-flow.test.ts 4/4
4329
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4330
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts 14/14
4331
+  ❯ src/compliance/__tests__/schema-verifier.test.ts 1/30
4332
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
4333
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
4334
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 28/28
4335
+  ❯ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts [queued]
4336
+  ❯ src/services/__tests__/batch-delegation.service.test.ts 0/11
4337
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
4338
+  ❯ src/services/__tests__/provider-resolution.integration.test.ts 0/6
4339
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4340
+
4341
+  Test Files 30 passed (44)
4342
+  Tests 707 passed | 2 skipped (789)
4343
+  Start at 17:52:48
4344
+  Duration 1.06s
4345
+ [?2026l[?2026h ✓ src/services/__tests__/provider-resolver.test.ts (8 tests) 5ms
4346
+
4347
+  ❯ src/__tests__/providers/base.test.ts 14/14
4348
+  ❯ src/__tests__/runtime/delegation-flow.test.ts 4/4
4349
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4350
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts 14/14
4351
+  ❯ src/compliance/__tests__/schema-verifier.test.ts 1/30
4352
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
4353
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
4354
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 28/28
4355
+  ❯ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts [queued]
4356
+  ❯ src/services/__tests__/batch-delegation.service.test.ts 0/11
4357
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
4358
+  ❯ src/services/__tests__/provider-resolution.integration.test.ts 0/6
4359
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4360
+
4361
+  Test Files 30 passed (44)
4362
+  Tests 707 passed | 2 skipped (789)
4363
+  Start at 17:52:48
4364
+  Duration 1.06s
4365
+ [?2026l[?2026h ✓ src/compliance/__tests__/schema-verifier.test.ts (30 tests) 5ms
4366
+
4367
+
4368
+
4369
+
4370
+
4371
+
4372
+
4373
+  ❯ src/__tests__/config/provider-runtime-config.test.ts 1/9
4374
+  ❯ src/__tests__/index.test.ts [queued]
4375
+  ❯ src/__tests__/runtime/audit-logger.test.ts [queued]
4376
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4377
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4378
+  ❯ src/utils/__tests__/did-helpers.test.ts [queued]
4379
+
4380
+  Test Files 37 passed (44)
4381
+  Tests 835 passed | 2 skipped (849)
4382
+  Start at 17:52:48
4383
+  Duration 1.16s
4384
+ [?2026l[?2026hstderr | src/services/__tests__/provider-resolution.integration.test.ts > Provider Resolution Integration > Backward compatibility > should work with Phase 1 tools (no oauthProvider field)
4385
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
4386
+
4387
+
4388
+
4389
+
4390
+
4391
+
4392
+  ❯ src/__tests__/config/provider-runtime-config.test.ts 1/9
4393
+  ❯ src/__tests__/index.test.ts [queued]
4394
+  ❯ src/__tests__/runtime/audit-logger.test.ts [queued]
4395
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4396
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4397
+  ❯ src/utils/__tests__/did-helpers.test.ts [queued]
4398
+
4399
+  Test Files 37 passed (44)
4400
+  Tests 835 passed | 2 skipped (849)
4401
+  Start at 17:52:48
4402
+  Duration 1.16s
4403
+ [?2026l[?2026h ✓ src/delegation/__tests__/bitstring.test.ts (30 tests) 13ms
4404
+ ✓ src/services/__tests__/batch-delegation.service.test.ts (11 tests) 4ms
4405
+ ✓ src/services/__tests__/provider-resolution.integration.test.ts (6 tests) 11ms
4406
+ ✓ src/services/__tests__/oauth-provider-registry.test.ts (9 tests) 4ms
4407
+ ✓ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts (14 tests) 3ms
4408
+ ✓ src/delegation/__tests__/utils.test.ts (28 tests) 3ms
4409
+
4410
+
4411
+
4412
+  ❯ src/__tests__/config/provider-runtime-config.test.ts 1/9
4413
+  ❯ src/__tests__/index.test.ts [queued]
4414
+  ❯ src/__tests__/runtime/audit-logger.test.ts [queued]
4415
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4416
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4417
+  ❯ src/utils/__tests__/did-helpers.test.ts [queued]
4418
+
4419
+  Test Files 37 passed (44)
4420
+  Tests 835 passed | 2 skipped (849)
4421
+  Start at 17:52:48
4422
+  Duration 1.16s
4423
+ [?2026l[?2026h ✓ src/__tests__/config/provider-runtime-config.test.ts (9 tests) 2ms
4424
+ ✓ src/__tests__/runtime/audit-logger.test.ts (9 tests) 4ms
4425
+ ✓ src/utils/__tests__/did-helpers.test.ts (11 tests) 4ms
4426
+ ✓ src/delegation/__tests__/audience-validator.test.ts (5 tests) 2ms
4427
+
4428
+
4429
+
4430
+
4431
+  ❯ src/__tests__/delegation-e2e.test.ts [queued]
4432
+  ❯ src/__tests__/index.test.ts 0/4
4433
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4434
+
4435
+  Test Files 41 passed (44)
4436
+  Tests 868 passed | 2 skipped (878)
4437
+  Start at 17:52:48
4438
+  Duration 1.36s
4439
+ [?2026l ↓ src/__tests__/delegation-e2e.test.ts (14 tests | 14 skipped)
4440
+ ✓ src/__tests__/index.test.ts (4 tests) 3ms
4441
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
4442
+ [ToolProtectionService] Config loaded from API {
4443
+ source: 'api',
4444
+ toolCount: 0,
4445
+ protectedTools: [],
4446
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4447
+ projectId: 'test-project-123',
4448
+ cacheTtlMs: 1000,
4449
+ cacheExpiresAt: '2025-11-24T23:52:50.747Z'
4450
+ }
4451
+
4452
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle typical e-commerce tool protection config
4453
+ [ToolProtectionService] Config loaded from API {
4454
+ source: 'api',
4455
+ toolCount: 4,
4456
+ protectedTools: [ 'add_to_cart', 'checkout' ],
4457
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4458
+ projectId: 'test-project-123',
4459
+ cacheTtlMs: 300000,
4460
+ cacheExpiresAt: '2025-11-24T23:57:49.748Z'
4461
+ }
4462
+
4463
+ stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle API rate limiting gracefully
4464
+ [ToolProtectionService] API fetch failed, using fallback config {
4465
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4466
+ error: 'Failed to fetch bouncer config: 429 Too Many Requests - Rate limit exceeded'
4467
+ }
4468
+
4469
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle concurrent requests
4470
+ [ToolProtectionService] Config loaded from API {
4471
+ source: 'api',
4472
+ toolCount: 1,
4473
+ protectedTools: [ 'tool1' ],
4474
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4475
+ projectId: 'test-project-123',
4476
+ cacheTtlMs: 300000,
4477
+ cacheExpiresAt: '2025-11-24T23:57:49.748Z'
4478
+ }
4479
+ [ToolProtectionService] Config loaded from API {
4480
+ source: 'api',
4481
+ toolCount: 1,
4482
+ protectedTools: [ 'tool1' ],
4483
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4484
+ projectId: 'test-project-123',
4485
+ cacheTtlMs: 300000,
4486
+ cacheExpiresAt: '2025-11-24T23:57:49.748Z'
4487
+ }
4488
+ [ToolProtectionService] Config loaded from API {
4489
+ source: 'api',
4490
+ toolCount: 1,
4491
+ protectedTools: [ 'tool1' ],
4492
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4493
+ projectId: 'test-project-123',
4494
+ cacheTtlMs: 300000,
4495
+ cacheExpiresAt: '2025-11-24T23:57:49.748Z'
4496
+ }
4497
+
4498
+ ✓ src/__tests__/services/agentshield-integration.test.ts (30 tests) 1111ms
4499
+ ✓ should respect cache TTL  1101ms
4500
+
4501
+  Test Files  43 passed | 1 skipped (44)
4502
+  Tests  876 passed | 16 skipped (892)
4503
+  Start at  17:52:48
4504
+  Duration  1.54s (transform 2.94s, setup 0ms, collect 4.95s, tests 2.24s, environment 4ms, prepare 1.12s)
4505
+
4506
+  % Coverage report from v8
4507
+
4508
+ =============================== Coverage summary ===============================
4509
+ Statements : 64.89% ( 1551/2390 )
4510
+ Branches : 59.85% ( 969/1619 )
4511
+ Functions : 63.77% ( 250/392 )
4512
+ Lines : 64.87% ( 1513/2332 )
4513
+ ================================================================================
4514
+ [?25h