@fuzdev/fuz_app 0.180.0 → 0.182.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 (389) hide show
  1. package/dist/actions/CLAUDE.md +38 -20
  2. package/dist/actions/action_rpc.d.ts +25 -6
  3. package/dist/actions/action_rpc.d.ts.map +1 -1
  4. package/dist/actions/action_rpc.js +56 -48
  5. package/dist/actions/action_types.d.ts +31 -13
  6. package/dist/actions/action_types.d.ts.map +1 -1
  7. package/dist/actions/action_types.js +1 -1
  8. package/dist/actions/notification_sender.d.ts +83 -0
  9. package/dist/actions/notification_sender.d.ts.map +1 -0
  10. package/dist/actions/notification_sender.js +85 -0
  11. package/dist/actions/perform_action.d.ts +13 -4
  12. package/dist/actions/perform_action.d.ts.map +1 -1
  13. package/dist/actions/perform_action.js +27 -18
  14. package/dist/actions/register_action_ws.d.ts +20 -2
  15. package/dist/actions/register_action_ws.d.ts.map +1 -1
  16. package/dist/actions/register_action_ws.js +17 -5
  17. package/dist/actions/ws_socket_session.d.ts +3 -0
  18. package/dist/actions/ws_socket_session.d.ts.map +1 -1
  19. package/dist/actions/ws_socket_session.js +3 -2
  20. package/dist/auth/CLAUDE.md +84 -59
  21. package/dist/auth/account_actions.d.ts.map +1 -1
  22. package/dist/auth/account_actions.js +30 -3
  23. package/dist/auth/account_queries.d.ts +213 -2
  24. package/dist/auth/account_queries.d.ts.map +1 -1
  25. package/dist/auth/account_queries.js +255 -2
  26. package/dist/auth/account_route_schema.d.ts +26 -16
  27. package/dist/auth/account_route_schema.d.ts.map +1 -1
  28. package/dist/auth/account_route_schema.js +10 -24
  29. package/dist/auth/account_routes.d.ts +5 -7
  30. package/dist/auth/account_routes.d.ts.map +1 -1
  31. package/dist/auth/account_routes.js +110 -89
  32. package/dist/auth/admin_actions.d.ts.map +1 -1
  33. package/dist/auth/admin_actions.js +117 -25
  34. package/dist/auth/api_token_queries.d.ts +29 -12
  35. package/dist/auth/api_token_queries.d.ts.map +1 -1
  36. package/dist/auth/api_token_queries.js +42 -27
  37. package/dist/auth/audit_log_route_schema.d.ts +1 -1
  38. package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
  39. package/dist/auth/audit_log_routes.d.ts +1 -1
  40. package/dist/auth/audit_log_routes.d.ts.map +1 -1
  41. package/dist/auth/audit_log_routes.js +10 -12
  42. package/dist/auth/audit_log_schema.js +4 -4
  43. package/dist/auth/bearer_auth.d.ts +4 -3
  44. package/dist/auth/bearer_auth.d.ts.map +1 -1
  45. package/dist/auth/bearer_auth.js +37 -32
  46. package/dist/auth/bootstrap_account.d.ts +65 -37
  47. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  48. package/dist/auth/bootstrap_account.js +115 -66
  49. package/dist/auth/bootstrap_route_schema.d.ts +6 -2
  50. package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
  51. package/dist/auth/bootstrap_route_schema.js +7 -2
  52. package/dist/auth/bootstrap_routes.d.ts +50 -33
  53. package/dist/auth/bootstrap_routes.d.ts.map +1 -1
  54. package/dist/auth/bootstrap_routes.js +109 -87
  55. package/dist/auth/bootstrap_token_store.d.ts +60 -0
  56. package/dist/auth/bootstrap_token_store.d.ts.map +1 -0
  57. package/dist/auth/bootstrap_token_store.js +39 -0
  58. package/dist/auth/credential_headers.d.ts +71 -0
  59. package/dist/auth/credential_headers.d.ts.map +1 -0
  60. package/dist/auth/credential_headers.js +100 -0
  61. package/dist/auth/daemon_token.d.ts +13 -1
  62. package/dist/auth/daemon_token.d.ts.map +1 -1
  63. package/dist/auth/daemon_token.js +14 -2
  64. package/dist/auth/daemon_token_middleware.d.ts +10 -11
  65. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  66. package/dist/auth/daemon_token_middleware.js +39 -30
  67. package/dist/auth/deps.d.ts +10 -11
  68. package/dist/auth/deps.d.ts.map +1 -1
  69. package/dist/auth/invite_queries.d.ts +18 -0
  70. package/dist/auth/invite_queries.d.ts.map +1 -1
  71. package/dist/auth/invite_queries.js +24 -0
  72. package/dist/auth/request_context.d.ts +97 -76
  73. package/dist/auth/request_context.d.ts.map +1 -1
  74. package/dist/auth/request_context.js +93 -104
  75. package/dist/auth/resolved_auth.d.ts +10 -5
  76. package/dist/auth/resolved_auth.d.ts.map +1 -1
  77. package/dist/auth/resolved_auth.js +2 -2
  78. package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
  79. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  80. package/dist/auth/role_grant_offer_action_specs.js +5 -3
  81. package/dist/auth/role_grant_offer_actions.d.ts +7 -11
  82. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  83. package/dist/auth/role_grant_offer_actions.js +97 -106
  84. package/dist/auth/role_grant_offer_ddl.d.ts +7 -1
  85. package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
  86. package/dist/auth/role_grant_offer_ddl.js +9 -2
  87. package/dist/auth/role_grant_offer_notifications.d.ts +87 -38
  88. package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
  89. package/dist/auth/role_grant_offer_notifications.js +75 -22
  90. package/dist/auth/role_grant_offer_queries.d.ts +143 -9
  91. package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
  92. package/dist/auth/role_grant_offer_queries.js +266 -66
  93. package/dist/auth/role_grant_offer_schema.js +1 -1
  94. package/dist/auth/role_grant_queries.d.ts +57 -10
  95. package/dist/auth/role_grant_queries.d.ts.map +1 -1
  96. package/dist/auth/role_grant_queries.js +81 -22
  97. package/dist/auth/role_grant_sql.d.ts +21 -0
  98. package/dist/auth/role_grant_sql.d.ts.map +1 -1
  99. package/dist/auth/role_grant_sql.js +21 -0
  100. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  101. package/dist/auth/self_service_role_actions.js +9 -2
  102. package/dist/auth/session_cookie.d.ts +105 -25
  103. package/dist/auth/session_cookie.d.ts.map +1 -1
  104. package/dist/auth/session_cookie.js +124 -15
  105. package/dist/auth/session_middleware.d.ts +83 -54
  106. package/dist/auth/session_middleware.d.ts.map +1 -1
  107. package/dist/auth/session_middleware.js +92 -66
  108. package/dist/auth/session_queries.d.ts +95 -14
  109. package/dist/auth/session_queries.d.ts.map +1 -1
  110. package/dist/auth/session_queries.js +98 -19
  111. package/dist/auth/signup_route_schema.d.ts +5 -5
  112. package/dist/auth/signup_route_schema.d.ts.map +1 -1
  113. package/dist/auth/signup_route_schema.js +4 -4
  114. package/dist/auth/signup_routes.d.ts.map +1 -1
  115. package/dist/auth/signup_routes.js +17 -14
  116. package/dist/auth/standard_rpc_actions.d.ts +6 -19
  117. package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
  118. package/dist/auth/standard_rpc_actions.js +5 -6
  119. package/dist/auth/token_scope.d.ts +6 -8
  120. package/dist/auth/token_scope.d.ts.map +1 -1
  121. package/dist/auth/token_scope.js +6 -9
  122. package/dist/dev/setup.d.ts +6 -1
  123. package/dist/dev/setup.d.ts.map +1 -1
  124. package/dist/dev/setup.js +42 -34
  125. package/dist/hono_context.d.ts +21 -0
  126. package/dist/hono_context.d.ts.map +1 -1
  127. package/dist/hono_context.js +17 -0
  128. package/dist/http/CLAUDE.md +156 -48
  129. package/dist/http/auth_shape.d.ts +4 -4
  130. package/dist/http/common_routes.js +1 -1
  131. package/dist/http/db_routes.d.ts +4 -3
  132. package/dist/http/db_routes.d.ts.map +1 -1
  133. package/dist/http/db_routes.js +14 -14
  134. package/dist/http/dev_route_error_check.d.ts +6 -3
  135. package/dist/http/dev_route_error_check.d.ts.map +1 -1
  136. package/dist/http/dev_route_error_check.js +6 -3
  137. package/dist/http/dev_set_cookie_check.d.ts +53 -0
  138. package/dist/http/dev_set_cookie_check.d.ts.map +1 -0
  139. package/dist/http/dev_set_cookie_check.js +80 -0
  140. package/dist/http/error_schemas.d.ts +45 -22
  141. package/dist/http/error_schemas.d.ts.map +1 -1
  142. package/dist/http/error_schemas.js +53 -26
  143. package/dist/http/header_lines.d.ts +42 -0
  144. package/dist/http/header_lines.d.ts.map +1 -0
  145. package/dist/http/header_lines.js +80 -0
  146. package/dist/http/host.d.ts +12 -9
  147. package/dist/http/host.d.ts.map +1 -1
  148. package/dist/http/host.js +25 -20
  149. package/dist/http/origin.d.ts +7 -22
  150. package/dist/http/origin.d.ts.map +1 -1
  151. package/dist/http/origin.js +11 -25
  152. package/dist/http/proxy.d.ts +1 -0
  153. package/dist/http/proxy.d.ts.map +1 -1
  154. package/dist/http/proxy.js +3 -0
  155. package/dist/http/request_headers.d.ts +95 -0
  156. package/dist/http/request_headers.d.ts.map +1 -0
  157. package/dist/http/request_headers.js +110 -0
  158. package/dist/http/request_target.d.ts +134 -0
  159. package/dist/http/request_target.d.ts.map +1 -0
  160. package/dist/http/request_target.js +193 -0
  161. package/dist/http/route_error_check.d.ts +4 -11
  162. package/dist/http/route_error_check.d.ts.map +1 -1
  163. package/dist/http/route_error_check.js +4 -21
  164. package/dist/http/route_result.d.ts +127 -23
  165. package/dist/http/route_result.d.ts.map +1 -1
  166. package/dist/http/route_result.js +97 -19
  167. package/dist/http/route_spec.d.ts +299 -83
  168. package/dist/http/route_spec.d.ts.map +1 -1
  169. package/dist/http/route_spec.js +548 -71
  170. package/dist/http/simple_request.d.ts +19 -14
  171. package/dist/http/simple_request.d.ts.map +1 -1
  172. package/dist/http/simple_request.js +17 -29
  173. package/dist/http/surface.d.ts +2 -0
  174. package/dist/http/surface.d.ts.map +1 -1
  175. package/dist/http/surface.js +4 -1
  176. package/dist/realtime/outbound_budget.d.ts +1 -2
  177. package/dist/realtime/outbound_budget.d.ts.map +1 -1
  178. package/dist/realtime/outbound_budget.js +1 -2
  179. package/dist/realtime/sse.d.ts +47 -17
  180. package/dist/realtime/sse.d.ts.map +1 -1
  181. package/dist/realtime/sse.js +115 -93
  182. package/dist/realtime/sse_constants.d.ts +7 -1
  183. package/dist/realtime/sse_constants.d.ts.map +1 -1
  184. package/dist/realtime/sse_constants.js +12 -1
  185. package/dist/realtime/sse_registry.d.ts +3 -3
  186. package/dist/realtime/sse_registry.js +3 -3
  187. package/dist/runtime/deps.d.ts +20 -4
  188. package/dist/runtime/deps.d.ts.map +1 -1
  189. package/dist/runtime/mock.d.ts +7 -1
  190. package/dist/runtime/mock.d.ts.map +1 -1
  191. package/dist/runtime/mock.js +33 -3
  192. package/dist/runtime/node.d.ts.map +1 -1
  193. package/dist/runtime/node.js +2 -1
  194. package/dist/runtime/secure_file.d.ts +71 -10
  195. package/dist/runtime/secure_file.d.ts.map +1 -1
  196. package/dist/runtime/secure_file.js +91 -11
  197. package/dist/server/app_backend.d.ts +0 -8
  198. package/dist/server/app_backend.d.ts.map +1 -1
  199. package/dist/server/app_backend.js +4 -4
  200. package/dist/server/app_server.d.ts +54 -33
  201. package/dist/server/app_server.d.ts.map +1 -1
  202. package/dist/server/app_server.js +69 -41
  203. package/dist/server/serve_fact_route.d.ts +3 -3
  204. package/dist/server/serve_fact_route.d.ts.map +1 -1
  205. package/dist/server/serve_fact_route.js +59 -55
  206. package/dist/server/static.d.ts +20 -0
  207. package/dist/server/static.d.ts.map +1 -1
  208. package/dist/server/static.js +56 -8
  209. package/dist/server/unmatched_route.d.ts +42 -0
  210. package/dist/server/unmatched_route.d.ts.map +1 -0
  211. package/dist/server/unmatched_route.js +64 -0
  212. package/dist/testing/CLAUDE.md +406 -1202
  213. package/dist/testing/app_server.d.ts +3 -1
  214. package/dist/testing/app_server.d.ts.map +1 -1
  215. package/dist/testing/app_server.js +5 -9
  216. package/dist/testing/auth_apps.d.ts.map +1 -1
  217. package/dist/testing/auth_apps.js +3 -2
  218. package/dist/testing/cross_backend/account_lifecycle.d.ts +11 -4
  219. package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
  220. package/dist/testing/cross_backend/account_lifecycle.js +320 -6
  221. package/dist/testing/cross_backend/build_test_backend_paths.d.ts +4 -1
  222. package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
  223. package/dist/testing/cross_backend/build_test_backend_paths.js +1 -1
  224. package/dist/testing/cross_backend/capabilities.d.ts +68 -5
  225. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  226. package/dist/testing/cross_backend/capabilities.js +20 -4
  227. package/dist/testing/cross_backend/cell_gated_create.js +1 -1
  228. package/dist/testing/cross_backend/conformance_case.d.ts +63 -21
  229. package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
  230. package/dist/testing/cross_backend/conformance_table.d.ts +54 -12
  231. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  232. package/dist/testing/cross_backend/conformance_table.js +179 -23
  233. package/dist/testing/cross_backend/cookie_attributes.js +1 -1
  234. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +7 -1
  235. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
  236. package/dist/testing/cross_backend/create_dual_spawn_global_setup.js +3 -3
  237. package/dist/testing/cross_backend/credential_conformance.d.ts +196 -0
  238. package/dist/testing/cross_backend/credential_conformance.d.ts.map +1 -0
  239. package/dist/testing/cross_backend/credential_conformance.js +296 -0
  240. package/dist/testing/cross_backend/credential_conformance.json +1284 -0
  241. package/dist/testing/cross_backend/credential_conformance_wire.d.ts +40 -0
  242. package/dist/testing/cross_backend/credential_conformance_wire.d.ts.map +1 -0
  243. package/dist/testing/cross_backend/credential_conformance_wire.js +293 -0
  244. package/dist/testing/cross_backend/credential_header_robustness.d.ts +1 -3
  245. package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
  246. package/dist/testing/cross_backend/credential_header_robustness.js +24 -55
  247. package/dist/testing/cross_backend/credential_wire.d.ts +112 -0
  248. package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -0
  249. package/dist/testing/cross_backend/credential_wire.js +188 -0
  250. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  251. package/dist/testing/cross_backend/default_backend_configs.js +22 -2
  252. package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -26
  253. package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
  254. package/dist/testing/cross_backend/default_spine_surface.js +3 -7
  255. package/dist/testing/cross_backend/differential.d.ts +1 -1
  256. package/dist/testing/cross_backend/differential.d.ts.map +1 -1
  257. package/dist/testing/cross_backend/differential.js +3 -2
  258. package/dist/testing/cross_backend/differential_normalize.d.ts +23 -6
  259. package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
  260. package/dist/testing/cross_backend/differential_normalize.js +11 -5
  261. package/dist/testing/cross_backend/full_spine_mount.d.ts +4 -10
  262. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  263. package/dist/testing/cross_backend/full_spine_mount.js +11 -4
  264. package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
  265. package/dist/testing/cross_backend/identity_parity.js +4 -0
  266. package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
  267. package/dist/testing/cross_backend/in_process_setup.js +78 -4
  268. package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
  269. package/dist/testing/cross_backend/login_security.js +13 -10
  270. package/dist/testing/cross_backend/peer_ping_ws.d.ts +1 -1
  271. package/dist/testing/cross_backend/peer_ping_ws.js +2 -2
  272. package/dist/testing/cross_backend/request_header_conformance.d.ts +174 -0
  273. package/dist/testing/cross_backend/request_header_conformance.d.ts.map +1 -0
  274. package/dist/testing/cross_backend/request_header_conformance.js +196 -0
  275. package/dist/testing/cross_backend/request_header_conformance.json +1158 -0
  276. package/dist/testing/cross_backend/request_header_conformance_wire.d.ts +39 -0
  277. package/dist/testing/cross_backend/request_header_conformance_wire.d.ts.map +1 -0
  278. package/dist/testing/cross_backend/request_header_conformance_wire.js +284 -0
  279. package/dist/testing/cross_backend/request_target_conformance.d.ts +298 -0
  280. package/dist/testing/cross_backend/request_target_conformance.d.ts.map +1 -0
  281. package/dist/testing/cross_backend/request_target_conformance.js +186 -0
  282. package/dist/testing/cross_backend/request_target_conformance.json +3765 -0
  283. package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +32 -0
  284. package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -0
  285. package/dist/testing/cross_backend/request_target_conformance_wire.js +278 -0
  286. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
  287. package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +173 -1
  288. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +5 -4
  289. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
  290. package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +185 -31
  291. package/dist/testing/cross_backend/rpc_adversarial.d.ts +6 -4
  292. package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -1
  293. package/dist/testing/cross_backend/rpc_adversarial.js +5 -2
  294. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +6 -7
  295. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
  296. package/dist/testing/cross_backend/rust_spine_consumer_surface.js +4 -5
  297. package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
  298. package/dist/testing/cross_backend/session_cap.js +82 -34
  299. package/dist/testing/cross_backend/session_cookie_effect.d.ts +43 -0
  300. package/dist/testing/cross_backend/session_cookie_effect.d.ts.map +1 -0
  301. package/dist/testing/cross_backend/session_cookie_effect.js +103 -0
  302. package/dist/testing/cross_backend/session_login.d.ts +24 -0
  303. package/dist/testing/cross_backend/session_login.d.ts.map +1 -0
  304. package/dist/testing/cross_backend/session_login.js +31 -0
  305. package/dist/testing/cross_backend/setup.d.ts +117 -0
  306. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  307. package/dist/testing/cross_backend/setup.js +193 -9
  308. package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
  309. package/dist/testing/cross_backend/simple_request.js +5 -0
  310. package/dist/testing/cross_backend/spine_suites.d.ts +9 -1
  311. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  312. package/dist/testing/cross_backend/spine_suites.js +88 -5
  313. package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
  314. package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
  315. package/dist/testing/cross_backend/spine_surface_constants.js +1 -0
  316. package/dist/testing/cross_backend/sse_round_trip.d.ts +8 -5
  317. package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
  318. package/dist/testing/cross_backend/sse_round_trip.js +205 -64
  319. package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
  320. package/dist/testing/cross_backend/testing_backdoor.js +5 -2
  321. package/dist/testing/cross_backend/testing_credential_read.d.ts +165 -0
  322. package/dist/testing/cross_backend/testing_credential_read.d.ts.map +1 -0
  323. package/dist/testing/cross_backend/testing_credential_read.js +175 -0
  324. package/dist/testing/cross_backend/testing_reset_actions.d.ts +19 -0
  325. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  326. package/dist/testing/cross_backend/testing_reset_actions.js +22 -6
  327. package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
  328. package/dist/testing/cross_backend/token_lifetime.js +58 -2
  329. package/dist/testing/cross_backend/transport_composition.d.ts +2 -4
  330. package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
  331. package/dist/testing/cross_backend/transport_composition.js +13 -10
  332. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
  333. package/dist/testing/cross_backend/ts_spine_backend_config.js +5 -3
  334. package/dist/testing/cross_backend/ws_endpoint.d.ts +11 -1
  335. package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
  336. package/dist/testing/cross_backend/ws_endpoint.js +19 -2
  337. package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
  338. package/dist/testing/cross_backend/ws_role_gated.js +2 -3
  339. package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
  340. package/dist/testing/cross_backend/ws_round_trip.js +28 -12
  341. package/dist/testing/cross_backend/xfail.d.ts +44 -11
  342. package/dist/testing/cross_backend/xfail.d.ts.map +1 -1
  343. package/dist/testing/cross_backend/xfail.js +68 -23
  344. package/dist/testing/data_exposure.d.ts.map +1 -1
  345. package/dist/testing/data_exposure.js +4 -3
  346. package/dist/testing/integration.d.ts +1 -2
  347. package/dist/testing/integration.d.ts.map +1 -1
  348. package/dist/testing/integration.js +14 -8
  349. package/dist/testing/integration_helpers.d.ts +50 -3
  350. package/dist/testing/integration_helpers.d.ts.map +1 -1
  351. package/dist/testing/integration_helpers.js +87 -9
  352. package/dist/testing/middleware.d.ts +3 -1
  353. package/dist/testing/middleware.d.ts.map +1 -1
  354. package/dist/testing/middleware.js +14 -7
  355. package/dist/testing/resolved_auth.d.ts +3 -1
  356. package/dist/testing/resolved_auth.d.ts.map +1 -1
  357. package/dist/testing/resolved_auth.js +4 -4
  358. package/dist/testing/round_trip.d.ts +6 -2
  359. package/dist/testing/round_trip.d.ts.map +1 -1
  360. package/dist/testing/round_trip.js +17 -6
  361. package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
  362. package/dist/testing/rpc_envelope_cases.js +7 -0
  363. package/dist/testing/rpc_helpers.d.ts +4 -2
  364. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  365. package/dist/testing/rpc_helpers.js +6 -1
  366. package/dist/testing/rpc_round_trip.d.ts +13 -2
  367. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  368. package/dist/testing/rpc_round_trip.js +25 -6
  369. package/dist/testing/schema_generators.d.ts +2 -2
  370. package/dist/testing/schema_generators.d.ts.map +1 -1
  371. package/dist/testing/schema_generators.js +4 -4
  372. package/dist/testing/stubs.d.ts +2 -2
  373. package/dist/testing/stubs.d.ts.map +1 -1
  374. package/dist/testing/stubs.js +13 -10
  375. package/dist/testing/transports/fetch_transport.d.ts +6 -3
  376. package/dist/testing/transports/fetch_transport.d.ts.map +1 -1
  377. package/dist/testing/transports/fetch_transport.js +31 -19
  378. package/dist/testing/transports/raw_http.d.ts +61 -1
  379. package/dist/testing/transports/raw_http.d.ts.map +1 -1
  380. package/dist/testing/transports/raw_http.js +61 -1
  381. package/dist/testing/transports/ws_raw_client.d.ts +20 -0
  382. package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
  383. package/dist/testing/transports/ws_raw_client.js +10 -4
  384. package/dist/testing/transports/ws_transport.d.ts +21 -1
  385. package/dist/testing/transports/ws_transport.d.ts.map +1 -1
  386. package/dist/testing/transports/ws_transport.js +58 -20
  387. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  388. package/dist/testing/ws_round_trip.js +8 -4
  389. package/package.json +1 -1
@@ -12,14 +12,19 @@ import '../assert_dev_env.js';
12
12
  * - `role_grant_revoked` (flat, omits `revoked_by`) → revokee (active grant
13
13
  * revoked by the `role_grant_revoke` action), for a global grant and a
14
14
  * scoped one unless `scope_kind` is `null`
15
- * - `role_grant_offer_supersede` → each superseded sibling's grantor, fired on
16
- * BOTH the accept-cascade (`reason: 'sibling_accepted'`) and the
17
- * revoke-cascade (`reason: 'role_grant_revoked'`)
15
+ * - `role_grant_offer_supersede` → each live party of an offer a cascade ended:
16
+ * an accept's siblings' grantors (`reason: 'sibling_accepted'`, the
17
+ * recipient being the caller), both parties of every offer a revoke ends
18
+ * (`reason: 'role_grant_revoked'` — the revokee's incoming siblings and its
19
+ * own outgoing offers), and the other party of every offer an account
20
+ * removal ends (`reason: 'account_deleted'`, delete and purge — gated on
21
+ * `capabilities.account_lifecycle` too; the removed account's socket closes
22
+ * and hears none of it)
18
23
  *
19
24
  * These exercise only spine primitives (accounts, role-grants, offers, WS
20
25
  * notifications) — zero consumer domain — so the suite lives here and runs
21
- * against any backend that wires the standard RPC actions' `notification_sender`
22
- * and mounts a registered WS socket: fuz_app's own spine self-tests
26
+ * against any backend that mounts the standard RPC actions and a WS endpoint
27
+ * their notifications reach: fuz_app's own spine self-tests
23
28
  * (`testing_spine_server` + the Rust `testing_spine_stub`) and downstream
24
29
  * twin-impl consumers (the fuz_forge Deno/Hono + Rust `fuz_forge_server`
25
30
  * backends) alike.
@@ -35,7 +40,10 @@ import '../assert_dev_env.js';
35
40
  * but the answers to its own requests, behind a `heartbeat` barrier on its
36
41
  * socket (`assert_bystander_heard_nothing` says why the barrier makes the
37
42
  * silence meaningful). A fan-out that reached past its target account fails
38
- * there.
43
+ * there. The target is held the same way, behind a barrier of its own: its
44
+ * socket heard exactly the notifications the case addressed to it, each once,
45
+ * in order — so a backend delivering one twice (a registry reached through
46
+ * two paths) fails, which the frame's own `wait_for` can't see.
39
47
  *
40
48
  * Sends are queued on the post-commit drain (handler-emit, not audit-derived),
41
49
  * so a frame may land a beat after the RPC resolves — `WsClient.wait_for` polls
@@ -47,11 +55,12 @@ import '../assert_dev_env.js';
47
55
  * guard), and accept stays idempotent on the role_grant while still superseding
48
56
  * pending siblings. Gated on `capabilities.ws`.
49
57
  *
50
- * The revoke case revokes the revokee's only `ROLE_ADMIN` grant. On an endpoint
58
+ * The revoke cases revoke the revokee's only `ROLE_ADMIN` grant. On an endpoint
51
59
  * gated on that role (`ws_required_roles`) the revokee's socket loses its
52
60
  * access by the same revoke: it is closed with `WS_CLOSE_PERMISSION_REVOKED`,
53
- * and the notification may or may not reach it first (nothing orders the two),
54
- * so the case asserts the close there and the frame on an ungated endpoint.
61
+ * and its notifications may or may not reach it first (nothing orders the
62
+ * two), so the cases assert the close there — and at most the start of what it
63
+ * would have heard, in order — and the frames on an ungated endpoint.
55
64
  *
56
65
  * Cross-process only: `create_admitted_ws_transport` needs a real bound socket, so wire
57
66
  * it from a `*.cross.test.ts` file, never an in-process setup. Authed cookies
@@ -64,23 +73,38 @@ import { assert, describe } from 'vitest';
64
73
  import { parse_or_throw } from '@fuzdev/fuz_schema/schema.ts';
65
74
  import { rpc_call } from '../rpc_helpers.js';
66
75
  import { WS_ADMISSION_PROBE_ID } from '../transports/ws_transport.js';
67
- import { is_notification_with, is_response_for } from '../transports/ws_client.js';
76
+ import { is_notification, is_notification_with, is_response_for } from '../transports/ws_client.js';
68
77
  import { ROLE_ADMIN, is_builtin_role } from '../../auth/role_schema.js';
69
- import { WS_CLOSE_PERMISSION_REVOKED } from '../../actions/transports.js';
78
+ import { WS_CLOSE_PERMISSION_REVOKED, WS_CLOSE_PERMISSION_REVOKED_REASON } from '../../actions/transports.js';
70
79
  import { ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, ROLE_GRANT_REVOKED_NOTIFICATION_METHOD, RoleGrantOfferReceivedParams, RoleGrantOfferAcceptedParams, RoleGrantOfferDeclinedParams, RoleGrantOfferRetractedParams, RoleGrantOfferSupersedeParams, RoleGrantRevokedParams } from '../../auth/role_grant_offer_notifications.js';
71
80
  import { test_if } from './capabilities.js';
72
81
  import { create_active_role_grant, create_pending_role_grant_offer } from './role_grant_cross_helpers.js';
82
+ import { cross_account_purge } from './revocation_drivers.js';
73
83
  import { SPINE_PARTICIPANT_ROLE, SPINE_RPC_PATH } from './spine_surface_constants.js';
74
84
  import { open_session_ws } from './ws_endpoint.js';
75
85
  /** The request id the bystander's barrier `heartbeat` goes out under. */
76
86
  const BYSTANDER_BARRIER_ID = 'bystander_barrier';
87
+ /** The request id the target's barrier `heartbeat` goes out under. */
88
+ const TARGET_BARRIER_ID = 'target_barrier';
89
+ /**
90
+ * Name each frame a socket received but the answers to its admission probe and
91
+ * its barrier: a notification by its method, anything else as its JSON, so an
92
+ * unexpected response shows in the assertion's diff.
93
+ */
94
+ const to_heard_frames = (ws) => ws.messages
95
+ .filter((msg) => !is_response_for(WS_ADMISSION_PROBE_ID)(msg) && !is_response_for(TARGET_BARRIER_ID)(msg))
96
+ .map((msg) => {
97
+ const method = msg?.method;
98
+ return typeof method === 'string' ? method : JSON.stringify(msg);
99
+ });
77
100
  /**
78
101
  * Register the role-grant-offer WS notification suite — cases over a real
79
102
  * upgrade, one per server-initiated notification (received / accepted /
80
- * declined / retracted / revoke, global and scoped, + supersede on both the
81
- * accept and revoke cascades). Each opens the affected counterparty's socket, drives the
82
- * lifecycle RPC, and strict-parses the delivered frame against its canonical
83
- * params schema. Gated on `capabilities.ws`.
103
+ * declined / retracted / revoke, global and scoped, + supersede on the accept,
104
+ * revoke, delete and purge cascades). Each opens every party's socket, drives
105
+ * the lifecycle RPC, and strict-parses the delivered frames against their
106
+ * canonical params schema. Gated on `capabilities.ws`, the removals on
107
+ * `capabilities.account_lifecycle` too.
84
108
  */
85
109
  export const describe_role_grant_offer_notification_ws_tests = (options) => {
86
110
  const { setup_test, capabilities, ws_required_roles = [] } = options;
@@ -131,7 +155,8 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
131
155
  * frame can be written while the pass is still pushing — a window the
132
156
  * barrier's round trip outlasts in practice. Either way the check covers
133
157
  * every pass of the drain, not just the one that reached the target: TS
134
- * runs them in one closure, and `PostCommitEffects::drain_all` joins
158
+ * calls every queued send in one synchronous loop
159
+ * (`flush_post_commit_effects`), and `PostCommitEffects::drain_all` joins
135
160
  * effects whose notify futures push synchronously, so every pass
136
161
  * completes in the drain's first poll.
137
162
  */
@@ -140,6 +165,34 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
140
165
  const strays = bystander_ws.messages.filter((msg) => !is_response_for(WS_ADMISSION_PROBE_ID)(msg) && !is_response_for(BYSTANDER_BARRIER_ID)(msg));
141
166
  assert.deepStrictEqual(strays, [], 'a bystander socket received frames addressed to others');
142
167
  };
168
+ /**
169
+ * Assert the targeted socket heard exactly `expected` — the notifications
170
+ * the case addressed to it, in order, each once — and nothing else but the
171
+ * answers to its own requests. Called once the targeted frame has landed,
172
+ * behind a `heartbeat` barrier on the target's own socket, which makes the
173
+ * absence of a second copy a finding for the reason
174
+ * `assert_bystander_heard_nothing` gives: a fan-out queues every copy it
175
+ * sends in the pass that sent the first, ahead of the barrier's response.
176
+ */
177
+ const assert_target_heard_exactly = async (target_ws, expected) => {
178
+ await target_ws.request(TARGET_BARRIER_ID, 'heartbeat', {}, 5000);
179
+ assert.deepStrictEqual(to_heard_frames(target_ws), expected, 'the target socket did not hear exactly the notifications addressed to it, each once');
180
+ };
181
+ /**
182
+ * Wait for the `role_grant_offer_supersede` frame of `offer_id` on `ws` and
183
+ * strict-parse its params against the canonical wire schema.
184
+ */
185
+ const wait_for_supersede = async (ws, offer_id) => {
186
+ const frame = await ws.wait_for(is_notification_with(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, (p) => p.offer.id === offer_id), 5000);
187
+ const params = parse_or_throw(RoleGrantOfferSupersedeParams, frame.params);
188
+ assert.strictEqual(params.offer.id, offer_id);
189
+ assert.isNotNull(params.offer.superseded_at);
190
+ return params;
191
+ };
192
+ /** The offer ids of the supersede frames `ws` heard, in order. */
193
+ const supersede_offer_ids = (ws) => ws.messages
194
+ .filter(is_notification(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD))
195
+ .map((msg) => msg.params.offer.id);
143
196
  /** Drive a JSON-RPC call over the fixture's HTTP transport. */
144
197
  const rpc = (fixture, method, params, headers) => rpc_call({ app: fixture.transport, path: SPINE_RPC_PATH, method, params, headers });
145
198
  /** A fresh pending `ROLE_ADMIN` offer, from the keeper unless a grantor is given. */
@@ -171,6 +224,9 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
171
224
  const params = parse_or_throw(RoleGrantOfferReceivedParams, frame.params);
172
225
  assert.strictEqual(params.offer.to_account_id, recipient.account.id);
173
226
  assert.strictEqual(params.offer.role, ROLE_ADMIN);
227
+ await assert_target_heard_exactly(recipient_ws, [
228
+ ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD
229
+ ]);
174
230
  await assert_bystander_heard_nothing(bystander_ws);
175
231
  }
176
232
  finally {
@@ -196,6 +252,9 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
196
252
  const params = parse_or_throw(RoleGrantOfferAcceptedParams, frame.params);
197
253
  assert.strictEqual(params.offer.id, offer.id);
198
254
  assert.isNotNull(params.offer.accepted_at);
255
+ await assert_target_heard_exactly(grantor, [
256
+ ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD
257
+ ]);
199
258
  await assert_bystander_heard_nothing(bystander_ws);
200
259
  }
201
260
  finally {
@@ -221,6 +280,9 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
221
280
  assert.strictEqual(params.offer.id, offer.id);
222
281
  // Decline reason rides inside the offer row, not a sibling field.
223
282
  assert.strictEqual(params.offer.decline_reason, 'no thanks');
283
+ await assert_target_heard_exactly(grantor, [
284
+ ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD
285
+ ]);
224
286
  await assert_bystander_heard_nothing(bystander_ws);
225
287
  }
226
288
  finally {
@@ -247,6 +309,11 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
247
309
  assert.strictEqual(params.offer.id, offer.id);
248
310
  assert.strictEqual(params.offer.to_account_id, recipient.account.id);
249
311
  assert.isNotNull(params.offer.retracted_at);
312
+ // the offer's create, made with the socket open, notified it first
313
+ await assert_target_heard_exactly(recipient_ws, [
314
+ ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD,
315
+ ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD
316
+ ]);
250
317
  await assert_bystander_heard_nothing(bystander_ws);
251
318
  }
252
319
  finally {
@@ -290,13 +357,18 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
290
357
  const closed = await revokee_ws.wait_for_close(5000);
291
358
  assert.ok(closed, 'the gated socket did not close after the revoke');
292
359
  assert.strictEqual(revokee_ws.close_code, WS_CLOSE_PERMISSION_REVOKED);
360
+ assert.strictEqual(revokee_ws.close_reason, WS_CLOSE_PERMISSION_REVOKED_REASON);
293
361
  const early = revokee_ws.messages.find(is_revoke_frame);
294
362
  if (early)
295
363
  assert_flat_revoke(early);
364
+ // a closed socket takes no barrier: what reached it ahead of the
365
+ // close is the notification once, or nothing
366
+ assert.deepStrictEqual(to_heard_frames(revokee_ws), early ? [ROLE_GRANT_REVOKED_NOTIFICATION_METHOD] : [], 'the gated socket heard more than the one notification before its close');
296
367
  await assert_bystander_heard_nothing(bystander_ws);
297
368
  return;
298
369
  }
299
370
  assert_flat_revoke(await revokee_ws.wait_for(is_revoke_frame, 5000));
371
+ await assert_target_heard_exactly(revokee_ws, [ROLE_GRANT_REVOKED_NOTIFICATION_METHOD]);
300
372
  await assert_bystander_heard_nothing(bystander_ws);
301
373
  }
302
374
  finally {
@@ -328,6 +400,7 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
328
400
  assert.strictEqual(params.scope_kind, scope_kind);
329
401
  assert.strictEqual(params.scope_id, scope_id);
330
402
  assert.strictEqual(params.reason, null);
403
+ await assert_target_heard_exactly(revokee_ws, [ROLE_GRANT_REVOKED_NOTIFICATION_METHOD]);
331
404
  await assert_bystander_heard_nothing(bystander_ws);
332
405
  }
333
406
  finally {
@@ -363,6 +436,9 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
363
436
  // cause_id points at the accepted sibling (grantor 2's offer).
364
437
  assert.strictEqual(params.cause_id, grantor2_offer.id);
365
438
  assert.isNotNull(params.offer.superseded_at);
439
+ await assert_target_heard_exactly(grantor1_ws, [
440
+ ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD
441
+ ]);
366
442
  await assert_bystander_heard_nothing(bystander_ws);
367
443
  }
368
444
  finally {
@@ -373,39 +449,117 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
373
449
  await bystander_ws.close();
374
450
  }
375
451
  });
376
- test_if(capabilities.ws, 'revoke supersedes a pending sibling offer and notifies its grantor WS', async () => {
452
+ test_if(capabilities.ws, "revoke supersedes the revokee's pending offers both ways and notifies both parties of each", async () => {
377
453
  const fixture = await setup_test();
378
454
  const grantor = await fixture.create_account({ roles: [ROLE_ADMIN] });
379
455
  const revokee = await fixture.create_account({ roles: [ROLE_ADMIN] });
456
+ const recipient = await fixture.create_account({ roles: [ROLE_ADMIN] });
380
457
  const role_grant_id = await create_active_role_grant(fixture, revokee, {
381
458
  rpc_path: SPINE_RPC_PATH
382
459
  });
383
- // A *pending* sibling offer for the same (account, role) — this is what
384
- // the revoke cascade supersedes.
460
+ // A pending sibling for the revoked grant's (account, role), and an
461
+ // offer the revokee made — the revoke's two cascades, in that order.
385
462
  const sibling_offer = await create_pending_offer(fixture, revokee.account.id, grantor.create_session_headers());
386
- // Watch the sibling grantor's socket for the supersede push.
463
+ const outgoing_offer = await create_pending_offer(fixture, recipient.account.id, revokee.create_session_headers());
387
464
  const bystander_ws = await open_bystander(fixture);
465
+ const grantor_ws = await open_ws(grantor);
466
+ const revokee_ws = await open_ws(revokee);
467
+ const recipient_ws = await open_ws(recipient);
388
468
  try {
389
- const grantor_ws = await open_ws(grantor);
390
- try {
391
- const revoked = await rpc(fixture, 'role_grant_revoke', { actor_id: revokee.actor.id, role_grant_id }, fixture.create_session_headers());
392
- assert.isTrue(revoked.ok, `revoke failed: ${JSON.stringify(revoked)}`);
393
- const frame = await grantor_ws.wait_for(is_notification_with(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, (p) => p.offer.id === sibling_offer.id), 5000);
394
- const params = parse_or_throw(RoleGrantOfferSupersedeParams, frame.params);
395
- assert.strictEqual(params.offer.id, sibling_offer.id);
469
+ const revoked = await rpc(fixture, 'role_grant_revoke', { actor_id: revokee.actor.id, role_grant_id }, fixture.create_session_headers());
470
+ assert.isTrue(revoked.ok, `revoke failed: ${JSON.stringify(revoked)}`);
471
+ const assert_supersede = async (ws, offer_id) => {
472
+ const params = await wait_for_supersede(ws, offer_id);
396
473
  assert.strictEqual(params.reason, 'role_grant_revoked');
397
474
  // cause_id points at the revoked role_grant.
398
475
  assert.strictEqual(params.cause_id, role_grant_id);
399
- assert.isNotNull(params.offer.superseded_at);
400
- await assert_bystander_heard_nothing(bystander_ws);
476
+ };
477
+ // the sibling's grantor and the outgoing offer's recipient
478
+ await assert_supersede(grantor_ws, sibling_offer.id);
479
+ await assert_target_heard_exactly(grantor_ws, [
480
+ ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD
481
+ ]);
482
+ await assert_supersede(recipient_ws, outgoing_offer.id);
483
+ await assert_target_heard_exactly(recipient_ws, [
484
+ ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD
485
+ ]);
486
+ // the revokee is the sibling's recipient and the outgoing offer's
487
+ // grantor: the revoke, then the two offers in the cascade's order
488
+ const revokee_heard = [
489
+ ROLE_GRANT_REVOKED_NOTIFICATION_METHOD,
490
+ ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD,
491
+ ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD
492
+ ];
493
+ if (revoke_closes_the_socket) {
494
+ // the gated socket closes with the revoke, hearing at most the
495
+ // start of what it would have heard, in order
496
+ const closed = await revokee_ws.wait_for_close(5000);
497
+ assert.ok(closed, 'the gated socket did not close after the revoke');
498
+ assert.strictEqual(revokee_ws.close_code, WS_CLOSE_PERMISSION_REVOKED);
499
+ const heard = to_heard_frames(revokee_ws);
500
+ assert.deepStrictEqual(heard, revokee_heard.slice(0, heard.length));
401
501
  }
402
- finally {
403
- await grantor_ws.close();
502
+ else {
503
+ await assert_supersede(revokee_ws, outgoing_offer.id);
504
+ await assert_target_heard_exactly(revokee_ws, revokee_heard);
505
+ assert.deepStrictEqual(supersede_offer_ids(revokee_ws), [sibling_offer.id, outgoing_offer.id], "the revokee hears the sibling's supersede, then its own offer's");
404
506
  }
507
+ await assert_bystander_heard_nothing(bystander_ws);
405
508
  }
406
509
  finally {
510
+ await Promise.all([recipient_ws.close(), revokee_ws.close(), grantor_ws.close()]);
407
511
  await bystander_ws.close();
408
512
  }
409
513
  });
514
+ /**
515
+ * The account removals: `remove` ends `removed`'s account, whose pending
516
+ * offers both ways are superseded with `reason: 'account_deleted'`, the
517
+ * account as the grantor's cause and its actor as the recipient's. Each
518
+ * offer's other party hears it once; the removed account's socket closes
519
+ * and hears none of it.
520
+ */
521
+ const removal_case = async (remove) => {
522
+ const fixture = await setup_test();
523
+ const removed = await fixture.create_account({ roles: [ROLE_ADMIN] });
524
+ const recipient = await fixture.create_account({ roles: [ROLE_ADMIN] });
525
+ const grantor = await fixture.create_account({ roles: [ROLE_ADMIN] });
526
+ const outgoing_offer = await create_pending_offer(fixture, recipient.account.id, removed.create_session_headers());
527
+ const incoming_offer = await create_pending_offer(fixture, removed.account.id, grantor.create_session_headers());
528
+ const bystander_ws = await open_bystander(fixture);
529
+ const removed_ws = await open_ws(removed);
530
+ const recipient_ws = await open_ws(recipient);
531
+ const grantor_ws = await open_ws(grantor);
532
+ try {
533
+ await remove(fixture, removed);
534
+ // the recipient is sent the grantor's actor, an id it already holds —
535
+ // never the removed account's id; the grantor is sent the removed
536
+ // account, its offer's `to_account_id`
537
+ for (const [ws, offer_id, cause_id] of [
538
+ [recipient_ws, outgoing_offer.id, removed.actor.id],
539
+ [grantor_ws, incoming_offer.id, removed.account.id]
540
+ ]) {
541
+ const params = await wait_for_supersede(ws, offer_id);
542
+ assert.strictEqual(params.reason, 'account_deleted');
543
+ assert.strictEqual(params.cause_id, cause_id);
544
+ await assert_target_heard_exactly(ws, [ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD]);
545
+ }
546
+ const closed = await removed_ws.wait_for_close(5000);
547
+ assert.ok(closed, "the removed account's socket did not close");
548
+ // binds only on a spine that delivers a frame queued ahead of the close;
549
+ // one whose close drops it passes either way, so the spine's own fan-out
550
+ // tests are what hold a send to the removed account out
551
+ assert.deepStrictEqual(to_heard_frames(removed_ws), [], "the removed account's socket heard a notification before its close");
552
+ await assert_bystander_heard_nothing(bystander_ws);
553
+ }
554
+ finally {
555
+ await Promise.all([grantor_ws.close(), recipient_ws.close(), removed_ws.close()]);
556
+ await bystander_ws.close();
557
+ }
558
+ };
559
+ test_if(capabilities.ws && capabilities.account_lifecycle, "delete supersedes the account's pending offers both ways and notifies each other party", () => removal_case(async (fixture, removed) => {
560
+ const deleted = await rpc(fixture, 'account_delete', { account_id: removed.account.id }, fixture.create_session_headers());
561
+ assert.isTrue(deleted.ok, `delete failed: ${JSON.stringify(deleted)}`);
562
+ }));
563
+ test_if(capabilities.ws && capabilities.account_lifecycle, "purge supersedes the account's pending offers both ways and notifies each other party", () => removal_case((fixture, removed) => cross_account_purge(fixture, SPINE_RPC_PATH, removed.account.id)));
410
564
  });
411
565
  };
@@ -1,6 +1,7 @@
1
1
  import '../assert_dev_env.js';
2
2
  import { type AppSurfaceSpec, type RpcEndpointSpec } from '../../http/surface.js';
3
3
  import type { RpcPathCrossSuiteOptions } from './setup.js';
4
+ import { type XfailMarker } from './xfail.js';
4
5
  /** Options for `describe_rpc_adversarial_cross_tests`. */
5
6
  export interface RpcAdversarialCrossTestOptions extends RpcPathCrossSuiteOptions {
6
7
  /** The declared surface; the endpoint at `rpc_path` supplies the methods and their input schemas. */
@@ -31,12 +32,13 @@ export interface RpcAdversarialCrossTestOptions extends RpcPathCrossSuiteOptions
31
32
  readonly xfail_params?: ReadonlyArray<RpcParamsXfail>;
32
33
  }
33
34
  /** Generated params cases of one method marked `xfail_until`, by case label. */
34
- export interface RpcParamsXfail {
35
+ export interface RpcParamsXfail extends XfailMarker {
35
36
  readonly method: string;
36
- /** `InputTestCase.label`s of `generate_rpc_params_test_cases(method's input)`. */
37
+ /**
38
+ * `InputTestCase.label`s of `generate_rpc_params_test_cases(method's input)`.
39
+ * A label naming no generated case fails the suite.
40
+ */
37
41
  readonly labels: ReadonlyArray<string>;
38
- readonly tracking_id: string;
39
- readonly reason: string;
40
42
  }
41
43
  /**
42
44
  * Run the cross-process malformed-envelope and invalid-params suite.
@@ -1 +1 @@
1
- {"version":3,"file":"rpc_adversarial.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/rpc_adversarial.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA6E9B,O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OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAG3D,0DAA0D;AAC1D,MAAM,WAAW,8BAA+B,SAAQ,wBAAwB;IAC/E,qGAAqG;IACrG,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC7D,wEAAwE;IACxE,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9C;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxE;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACtD;AAED,gFAAgF;AAChF,MAAM,WAAW,cAAe,SAAQ,WAAW;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACvC;AAmGD;;;;GAIG;AACH,eAAO,MAAM,oCAAoC,GAChD,SAAS,8BAA8B,KACrC,IAkKF,CAAC"}
@@ -270,9 +270,12 @@ export const describe_rpc_adversarial_cross_tests = (options) => {
270
270
  continue;
271
271
  }
272
272
  matched_xfails.add(key);
273
- xfail_until(xfail.tracking_id, xfail.reason, `${method}: [${tc.label}] → 400 invalid_params`, async () => {
273
+ xfail_until(xfail, `${method}: [${tc.label}] → 400 invalid_params`, async () => {
274
274
  const failure = await check_case(await setup_test(), action, tc);
275
- assert.strictEqual(failure, null);
275
+ // the failure text itself, so `fails_with` can read the answer;
276
+ // an assertion would print it truncated
277
+ if (failure !== null)
278
+ assert.fail(failure);
276
279
  });
277
280
  }
278
281
  if (param_cases.length === 0)
@@ -13,8 +13,8 @@ import '../assert_dev_env.js';
13
13
  * single-keeper daemon) is not this shape.
14
14
  *
15
15
  * The route shapes come from `create_account_route_shapes` and friends, never
16
- * the live route factories, which statically pull `hono/cookie` and
17
- * `hono/streaming`. Handlers are never invoked — the suites read `method`,
16
+ * the live route factories, which statically pull the query layer and, for
17
+ * the audit stream, `hono/streaming`. Handlers are never invoked — the suites read `method`,
18
18
  * `path`, `auth` and the schemas, and live dispatch happens in the spawned
19
19
  * binary — so routes and actions carry no-op handlers.
20
20
  *
@@ -28,11 +28,10 @@ import type { AppSurfaceSpec, RpcEndpointSpec } from '../../http/surface.js';
28
28
  import type { AppServerContext } from '../../server/app_server_context.js';
29
29
  /**
30
30
  * The routes `fuz_auth::account_router` mounts, relative to `/api/account`. An
31
- * allowlist rather than every account route shape: `/verify` is a TS-only
32
- * route the Rust router doesn't serve, so declaring it would have the suites
33
- * probe a 404. A shape fuz_app renames or drops fails the surface build; one
34
- * it adds stays off the surface until the Rust router mounts it and this list
35
- * names it.
31
+ * allowlist rather than every account route shape, so a route the TS spine
32
+ * gains ahead of the Rust router never has the suites probe a 404: a shape
33
+ * fuz_app renames or drops fails the surface build; one it adds stays off the
34
+ * surface until the Rust router mounts it and this list names it.
36
35
  */
37
36
  export declare const ACCOUNT_ROUTER_PATHS: readonly ["/status", "/login", "/logout", "/password"];
38
37
  /** Options for `create_rust_spine_consumer_rpc_endpoints`. */
@@ -1 +1 @@
1
- {"version":3,"file":"rust_spine_consumer_surface.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/rust_spine_consumer_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAA6B,MAAM,8BAA8B,CAAC;AAM/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAA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CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,eAAe,CAAC,CA+BpD,CAAC;AAiCF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uCAAuC,GACnD,SAAS,mCAAmC,KAC1C,cAUA,CAAC"}
@@ -9,11 +9,10 @@ import { create_test_app_surface_spec, stub_route_spec } from '../stubs.js';
9
9
  import { SPINE_ACCOUNT_PATH_PREFIX, SPINE_RPC_PATH } from './spine_surface_constants.js';
10
10
  /**
11
11
  * The routes `fuz_auth::account_router` mounts, relative to `/api/account`. An
12
- * allowlist rather than every account route shape: `/verify` is a TS-only
13
- * route the Rust router doesn't serve, so declaring it would have the suites
14
- * probe a 404. A shape fuz_app renames or drops fails the surface build; one
15
- * it adds stays off the surface until the Rust router mounts it and this list
16
- * names it.
12
+ * allowlist rather than every account route shape, so a route the TS spine
13
+ * gains ahead of the Rust router never has the suites probe a 404: a shape
14
+ * fuz_app renames or drops fails the surface build; one it adds stays off the
15
+ * surface until the Rust router mounts it and this list names it.
17
16
  */
18
17
  export const ACCOUNT_ROUTER_PATHS = ['/status', '/login', '/logout', '/password'];
19
18
  /** Surface generation never invokes handlers — see the module doc. */
@@ -1 +1 @@
1
- {"version":3,"file":"session_cap.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/session_cap.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAmE9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAM5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,gDAAgD;AAChD,MAAM,WAAW,0BAA0B;IAC1C,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,qEAAqE;IACrE,QAA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