@fuzdev/fuz_app 0.147.0 → 0.149.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 (303) hide show
  1. package/dist/actions/CLAUDE.md +8 -6
  2. package/dist/actions/action_codegen.d.ts +15 -1
  3. package/dist/actions/action_codegen.d.ts.map +1 -1
  4. package/dist/actions/action_codegen.js +23 -2
  5. package/dist/actions/action_event.d.ts.map +1 -1
  6. package/dist/actions/action_event.js +14 -1
  7. package/dist/actions/perform_action.d.ts +17 -1
  8. package/dist/actions/perform_action.d.ts.map +1 -1
  9. package/dist/actions/perform_action.js +23 -3
  10. package/dist/auth/CLAUDE.md +3 -2
  11. package/dist/auth/account_action_specs.d.ts +12 -0
  12. package/dist/auth/account_action_specs.d.ts.map +1 -1
  13. package/dist/auth/account_action_specs.js +16 -2
  14. package/dist/auth/account_actions.d.ts.map +1 -1
  15. package/dist/auth/account_actions.js +7 -4
  16. package/dist/auth/admin_action_specs.d.ts.map +1 -1
  17. package/dist/auth/admin_action_specs.js +29 -8
  18. package/dist/auth/audit_emitter.d.ts +14 -0
  19. package/dist/auth/audit_emitter.d.ts.map +1 -1
  20. package/dist/auth/audit_emitter.js +5 -1
  21. package/dist/auth/cell_action_specs.d.ts +3 -1
  22. package/dist/auth/cell_action_specs.d.ts.map +1 -1
  23. package/dist/auth/cell_action_specs.js +5 -5
  24. package/dist/auth/cell_actions.d.ts.map +1 -1
  25. package/dist/auth/cell_actions.js +2 -3
  26. package/dist/auth/cell_data_schema.d.ts +1 -1
  27. package/dist/auth/cell_data_schema.js +1 -1
  28. package/dist/auth/cell_field_action_specs.d.ts +4 -3
  29. package/dist/auth/cell_field_action_specs.d.ts.map +1 -1
  30. package/dist/auth/cell_field_action_specs.js +5 -6
  31. package/dist/auth/cell_field_actions.d.ts.map +1 -1
  32. package/dist/auth/cell_field_actions.js +8 -1
  33. package/dist/auth/cell_item_action_specs.d.ts +4 -2
  34. package/dist/auth/cell_item_action_specs.d.ts.map +1 -1
  35. package/dist/auth/cell_item_action_specs.js +5 -5
  36. package/dist/auth/cell_item_actions.d.ts.map +1 -1
  37. package/dist/auth/cell_item_actions.js +8 -1
  38. package/dist/auth/role_grant_offer_action_specs.d.ts +2 -0
  39. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  40. package/dist/auth/role_grant_offer_action_specs.js +8 -4
  41. package/dist/http/CLAUDE.md +14 -2
  42. package/dist/http/error_schemas.d.ts +8 -0
  43. package/dist/http/error_schemas.d.ts.map +1 -1
  44. package/dist/http/error_schemas.js +12 -0
  45. package/dist/http/jsonrpc_errors.d.ts +40 -15
  46. package/dist/http/jsonrpc_errors.d.ts.map +1 -1
  47. package/dist/http/jsonrpc_errors.js +90 -35
  48. package/dist/primitive_schemas.d.ts +1 -1
  49. package/dist/primitive_schemas.d.ts.map +1 -1
  50. package/dist/primitive_schemas.js +2 -1
  51. package/dist/schema_meta.d.ts +80 -0
  52. package/dist/schema_meta.d.ts.map +1 -1
  53. package/dist/schema_meta.js +71 -1
  54. package/dist/testing/CLAUDE.md +853 -146
  55. package/dist/testing/admin_integration.d.ts.map +1 -1
  56. package/dist/testing/admin_integration.js +73 -5
  57. package/dist/testing/adversarial_input.d.ts +0 -47
  58. package/dist/testing/adversarial_input.d.ts.map +1 -1
  59. package/dist/testing/adversarial_input.js +4 -340
  60. package/dist/testing/adversarial_input_cases.d.ts +124 -0
  61. package/dist/testing/adversarial_input_cases.d.ts.map +1 -0
  62. package/dist/testing/adversarial_input_cases.js +393 -0
  63. package/dist/testing/audit_completeness.d.ts.map +1 -1
  64. package/dist/testing/audit_completeness.js +24 -20
  65. package/dist/testing/audit_drift_guard.d.ts +30 -3
  66. package/dist/testing/audit_drift_guard.d.ts.map +1 -1
  67. package/dist/testing/audit_drift_guard.js +55 -3
  68. package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
  69. package/dist/testing/cross_backend/account_lifecycle.js +29 -12
  70. package/dist/testing/cross_backend/actor_lookup.d.ts.map +1 -1
  71. package/dist/testing/cross_backend/actor_lookup.js +7 -25
  72. package/dist/testing/cross_backend/app_settings.d.ts.map +1 -1
  73. package/dist/testing/cross_backend/app_settings.js +4 -6
  74. package/dist/testing/cross_backend/audit_cross_helpers.d.ts +57 -0
  75. package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -0
  76. package/dist/testing/cross_backend/audit_cross_helpers.js +89 -0
  77. package/dist/testing/cross_backend/backend_config.d.ts +2 -1
  78. package/dist/testing/cross_backend/backend_config.d.ts.map +1 -1
  79. package/dist/testing/cross_backend/body_size.d.ts +6 -0
  80. package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
  81. package/dist/testing/cross_backend/body_size.js +26 -44
  82. package/dist/testing/cross_backend/body_size_smuggling.d.ts +5 -0
  83. package/dist/testing/cross_backend/body_size_smuggling.d.ts.map +1 -1
  84. package/dist/testing/cross_backend/body_size_smuggling.js +7 -14
  85. package/dist/testing/cross_backend/build_test_backend_paths.d.ts +3 -1
  86. package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
  87. package/dist/testing/cross_backend/capabilities.d.ts +78 -59
  88. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  89. package/dist/testing/cross_backend/capabilities.js +25 -24
  90. package/dist/testing/cross_backend/cargo_binary.d.ts +70 -0
  91. package/dist/testing/cross_backend/cargo_binary.d.ts.map +1 -0
  92. package/dist/testing/cross_backend/cargo_binary.js +148 -0
  93. package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
  94. package/dist/testing/cross_backend/cell_crud.js +174 -3
  95. package/dist/testing/cross_backend/cell_gated_create.d.ts +0 -60
  96. package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -1
  97. package/dist/testing/cross_backend/cell_gated_create.js +9 -487
  98. package/dist/testing/cross_backend/cell_grant_role.d.ts +14 -2
  99. package/dist/testing/cross_backend/cell_grant_role.d.ts.map +1 -1
  100. package/dist/testing/cross_backend/cell_grant_role.js +22 -12
  101. package/dist/testing/cross_backend/cell_moderate.d.ts +66 -0
  102. package/dist/testing/cross_backend/cell_moderate.d.ts.map +1 -0
  103. package/dist/testing/cross_backend/cell_moderate.js +511 -0
  104. package/dist/testing/cross_backend/cell_ref_admission.d.ts.map +1 -1
  105. package/dist/testing/cross_backend/cell_ref_admission.js +1 -1
  106. package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
  107. package/dist/testing/cross_backend/cell_relations.js +40 -19
  108. package/dist/testing/cross_backend/conformance_case.d.ts +43 -4
  109. package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
  110. package/dist/testing/cross_backend/conformance_case.js +29 -1
  111. package/dist/testing/cross_backend/conformance_rpc_auth.d.ts +93 -0
  112. package/dist/testing/cross_backend/conformance_rpc_auth.d.ts.map +1 -0
  113. package/dist/testing/cross_backend/conformance_rpc_auth.js +125 -0
  114. package/dist/testing/cross_backend/conformance_table.d.ts +144 -4
  115. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  116. package/dist/testing/cross_backend/conformance_table.js +297 -65
  117. package/dist/testing/cross_backend/cookie_attributes.d.ts.map +1 -1
  118. package/dist/testing/cross_backend/cookie_attributes.js +3 -2
  119. package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts +38 -5
  120. package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts.map +1 -1
  121. package/dist/testing/cross_backend/create_cross_backend_global_setup.js +24 -3
  122. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +5 -5
  123. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
  124. package/dist/testing/cross_backend/credential_deadline.d.ts +10 -6
  125. package/dist/testing/cross_backend/credential_deadline.d.ts.map +1 -1
  126. package/dist/testing/cross_backend/credential_deadline.js +32 -31
  127. package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
  128. package/dist/testing/cross_backend/credential_header_robustness.js +4 -6
  129. package/dist/testing/cross_backend/{cell_cross_helpers.d.ts → cross_rpc.d.ts} +14 -2
  130. package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -0
  131. package/dist/testing/cross_backend/{cell_cross_helpers.js → cross_rpc.js} +31 -7
  132. package/dist/testing/cross_backend/default_backend_configs.d.ts +58 -61
  133. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  134. package/dist/testing/cross_backend/default_backend_configs.js +97 -91
  135. package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
  136. package/dist/testing/cross_backend/default_spine_surface.js +2 -2
  137. package/dist/testing/cross_backend/differential.d.ts +126 -0
  138. package/dist/testing/cross_backend/differential.d.ts.map +1 -0
  139. package/dist/testing/cross_backend/differential.js +201 -0
  140. package/dist/testing/cross_backend/differential_normalize.d.ts +150 -0
  141. package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -0
  142. package/dist/testing/cross_backend/differential_normalize.js +153 -0
  143. package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
  144. package/dist/testing/cross_backend/fact_serving.js +27 -17
  145. package/dist/testing/cross_backend/full_spine_mount.d.ts +15 -0
  146. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  147. package/dist/testing/cross_backend/full_spine_mount.js +55 -1
  148. package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
  149. package/dist/testing/cross_backend/identity_parity.js +6 -5
  150. package/dist/testing/cross_backend/in_process_setup.d.ts +12 -2
  151. package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
  152. package/dist/testing/cross_backend/in_process_setup.js +10 -7
  153. package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
  154. package/dist/testing/cross_backend/login_security.js +13 -18
  155. package/dist/testing/cross_backend/origin.js +1 -1
  156. package/dist/testing/cross_backend/origin_conformance.js +1 -1
  157. package/dist/testing/cross_backend/origin_scope.d.ts +6 -0
  158. package/dist/testing/cross_backend/origin_scope.d.ts.map +1 -1
  159. package/dist/testing/cross_backend/origin_scope.js +13 -12
  160. package/dist/testing/cross_backend/peer_ping_ws.d.ts +2 -5
  161. package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
  162. package/dist/testing/cross_backend/peer_ping_ws.js +14 -24
  163. package/dist/testing/cross_backend/postgres_database.d.ts +85 -0
  164. package/dist/testing/cross_backend/postgres_database.d.ts.map +1 -0
  165. package/dist/testing/cross_backend/postgres_database.js +140 -0
  166. package/dist/testing/cross_backend/provided_context.d.ts +28 -0
  167. package/dist/testing/cross_backend/provided_context.d.ts.map +1 -0
  168. package/dist/testing/cross_backend/provided_context.js +35 -0
  169. package/dist/testing/cross_backend/query_shape.d.ts.map +1 -1
  170. package/dist/testing/cross_backend/query_shape.js +10 -12
  171. package/dist/testing/cross_backend/ready.js +2 -2
  172. package/dist/testing/cross_backend/revocation_drivers.d.ts +4 -3
  173. package/dist/testing/cross_backend/revocation_drivers.d.ts.map +1 -1
  174. package/dist/testing/cross_backend/revocation_drivers.js +1 -1
  175. package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts +3 -2
  176. package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts.map +1 -1
  177. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts +13 -0
  178. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -0
  179. package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +203 -0
  180. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +2 -5
  181. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
  182. package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +203 -111
  183. package/dist/testing/cross_backend/role_grant_participation.d.ts +13 -0
  184. package/dist/testing/cross_backend/role_grant_participation.d.ts.map +1 -1
  185. package/dist/testing/cross_backend/role_grant_participation.js +32 -21
  186. package/dist/testing/cross_backend/role_grant_role_grammar.d.ts.map +1 -1
  187. package/dist/testing/cross_backend/role_grant_role_grammar.js +6 -9
  188. package/dist/testing/cross_backend/rpc_adversarial.d.ts +47 -0
  189. package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -0
  190. package/dist/testing/cross_backend/rpc_adversarial.js +302 -0
  191. package/dist/testing/cross_backend/rpc_success_fixtures.d.ts +24 -0
  192. package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -0
  193. package/dist/testing/cross_backend/rpc_success_fixtures.js +124 -0
  194. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +101 -0
  195. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -0
  196. package/dist/testing/cross_backend/rust_spine_consumer_surface.js +113 -0
  197. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts +10 -0
  198. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
  199. package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +33 -21
  200. package/dist/testing/cross_backend/session_cap.d.ts +9 -8
  201. package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
  202. package/dist/testing/cross_backend/session_cap.js +9 -4
  203. package/dist/testing/cross_backend/session_cookie_codec.js +1 -1
  204. package/dist/testing/cross_backend/setup.d.ts +58 -56
  205. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  206. package/dist/testing/cross_backend/setup.js +29 -29
  207. package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
  208. package/dist/testing/cross_backend/simple_request.js +4 -4
  209. package/dist/testing/cross_backend/spawn_backend.d.ts +59 -10
  210. package/dist/testing/cross_backend/spawn_backend.d.ts.map +1 -1
  211. package/dist/testing/cross_backend/spawn_backend.js +219 -60
  212. package/dist/testing/cross_backend/spine_suites.d.ts +311 -0
  213. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -0
  214. package/dist/testing/cross_backend/spine_suites.js +897 -0
  215. package/dist/testing/cross_backend/spine_surface_constants.d.ts +44 -0
  216. package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
  217. package/dist/testing/cross_backend/spine_surface_constants.js +53 -0
  218. package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
  219. package/dist/testing/cross_backend/sse_round_trip.js +3 -4
  220. package/dist/testing/cross_backend/standard.d.ts +18 -1
  221. package/dist/testing/cross_backend/standard.d.ts.map +1 -1
  222. package/dist/testing/cross_backend/standard.js +2 -0
  223. package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts +24 -0
  224. package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts.map +1 -1
  225. package/dist/testing/cross_backend/test_cell_gated_create_authorize.js +15 -0
  226. package/dist/testing/cross_backend/testing_backdoor.d.ts +29 -12
  227. package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
  228. package/dist/testing/cross_backend/testing_backdoor.js +143 -51
  229. package/dist/testing/cross_backend/testing_reset_actions.d.ts +30 -14
  230. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  231. package/dist/testing/cross_backend/testing_reset_actions.js +58 -37
  232. package/dist/testing/cross_backend/testing_server_bun.js +1 -1
  233. package/dist/testing/cross_backend/token_lifetime.js +1 -1
  234. package/dist/testing/cross_backend/token_scope_surface.d.ts.map +1 -1
  235. package/dist/testing/cross_backend/token_scope_surface.js +9 -13
  236. package/dist/testing/cross_backend/transport_composition.d.ts +26 -2
  237. package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
  238. package/dist/testing/cross_backend/transport_composition.js +81 -51
  239. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +8 -0
  240. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
  241. package/dist/testing/cross_backend/ts_spine_backend_config.js +23 -13
  242. package/dist/testing/cross_backend/ws_action_rate_limit.d.ts +2 -5
  243. package/dist/testing/cross_backend/ws_action_rate_limit.d.ts.map +1 -1
  244. package/dist/testing/cross_backend/ws_action_rate_limit.js +8 -14
  245. package/dist/testing/cross_backend/ws_connection_cap.d.ts +4 -9
  246. package/dist/testing/cross_backend/ws_connection_cap.d.ts.map +1 -1
  247. package/dist/testing/cross_backend/ws_connection_cap.js +11 -12
  248. package/dist/testing/cross_backend/ws_endpoint.d.ts +52 -0
  249. package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -0
  250. package/dist/testing/cross_backend/ws_endpoint.js +54 -0
  251. package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts +2 -5
  252. package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts.map +1 -1
  253. package/dist/testing/cross_backend/ws_inbound_dispatch.js +9 -15
  254. package/dist/testing/cross_backend/ws_outbound_overflow.d.ts +2 -7
  255. package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
  256. package/dist/testing/cross_backend/ws_outbound_overflow.js +5 -9
  257. package/dist/testing/cross_backend/ws_role_gated.d.ts +4 -5
  258. package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
  259. package/dist/testing/cross_backend/ws_role_gated.js +12 -21
  260. package/dist/testing/cross_backend/ws_round_trip.d.ts +12 -9
  261. package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
  262. package/dist/testing/cross_backend/ws_round_trip.js +29 -34
  263. package/dist/testing/db_entities.d.ts +16 -3
  264. package/dist/testing/db_entities.d.ts.map +1 -1
  265. package/dist/testing/db_entities.js +28 -5
  266. package/dist/testing/integration_helpers.d.ts +61 -2
  267. package/dist/testing/integration_helpers.d.ts.map +1 -1
  268. package/dist/testing/integration_helpers.js +75 -18
  269. package/dist/testing/round_trip.d.ts +17 -0
  270. package/dist/testing/round_trip.d.ts.map +1 -1
  271. package/dist/testing/round_trip.js +67 -24
  272. package/dist/testing/rpc_attack_surface.d.ts +10 -0
  273. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  274. package/dist/testing/rpc_attack_surface.js +27 -140
  275. package/dist/testing/rpc_envelope_cases.d.ts +114 -0
  276. package/dist/testing/rpc_envelope_cases.d.ts.map +1 -0
  277. package/dist/testing/rpc_envelope_cases.js +243 -0
  278. package/dist/testing/rpc_helpers.d.ts +31 -0
  279. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  280. package/dist/testing/rpc_helpers.js +35 -14
  281. package/dist/testing/rpc_round_trip.d.ts +62 -6
  282. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  283. package/dist/testing/rpc_round_trip.js +151 -39
  284. package/dist/testing/schema_generators.d.ts +99 -2
  285. package/dist/testing/schema_generators.d.ts.map +1 -1
  286. package/dist/testing/schema_generators.js +261 -73
  287. package/dist/testing/standard.d.ts +26 -0
  288. package/dist/testing/standard.d.ts.map +1 -1
  289. package/dist/testing/standard.js +4 -1
  290. package/dist/testing/stubs.d.ts +4 -3
  291. package/dist/testing/stubs.d.ts.map +1 -1
  292. package/dist/testing/stubs.js +6 -4
  293. package/dist/testing/transports/raw_http.d.ts +21 -0
  294. package/dist/testing/transports/raw_http.d.ts.map +1 -1
  295. package/dist/testing/transports/raw_http.js +30 -0
  296. package/dist/zod.d.ts +9 -0
  297. package/dist/zod.d.ts.map +1 -1
  298. package/dist/zod.js +20 -0
  299. package/package.json +6 -4
  300. package/dist/testing/cross_backend/actor_search.d.ts +0 -6
  301. package/dist/testing/cross_backend/actor_search.d.ts.map +0 -1
  302. package/dist/testing/cross_backend/actor_search.js +0 -90
  303. package/dist/testing/cross_backend/cell_cross_helpers.d.ts.map +0 -1
@@ -29,13 +29,16 @@ import '../assert_dev_env.js';
29
29
  *
30
30
  * `_testing_reset` — full DB wipe + keeper re-seed + optional
31
31
  * secondary-account seeding. The
32
- * handler wipes every auth-namespace row (no keeper-preserve filter),
32
+ * handler first fires the consumer-supplied domain-state callback (domain
33
+ * rows depend on auth rows, so a domain table with a restricting FK to
34
+ * `actor` empties before the rows it references go), then wipes every
35
+ * auth-namespace row (no keeper-preserve filter),
33
36
  * flips `bootstrap_lock` back to its post-bootstrap shape, seeds a
34
37
  * fresh keeper account inline (reusing `create_test_account_with_credentials`
35
- * so cross-process matches in-process write semantics), seeds any
36
- * caller-requested `extra_accounts` (also direct-inserted at this
37
- * setup step), refreshes the daemon-token cache to point at the new
38
- * keeper, and fires the consumer-supplied domain-state callback. The
38
+ * so cross-process matches in-process write semantics), queues the
39
+ * daemon-token cache refresh to point at the new keeper once the reset
40
+ * commits, and seeds any caller-requested `extra_accounts` (also
41
+ * direct-inserted at this setup step). The
39
42
  * new keeper + secondary credentials return as the action output so
40
43
  * the per-test fixture closes over them.
41
44
  *
@@ -177,6 +180,11 @@ export declare const testing_reset_action_spec: {
177
180
  * not — nor are eager writes outside `emit` (session touch, token usage),
178
181
  * which only the dispatching transport's own flush awaits.
179
182
  *
183
+ * The output's `tracked` is `AuditEmitter.is_tracking_inflight` — whether the
184
+ * drain could wait on anything. `cross_drain_effects` refuses `tracked: false`,
185
+ * so a binary whose emitter was built without tracking fails its first audit
186
+ * read instead of racing it. The Rust twin answers the same shape.
187
+ *
180
188
  * `auth` gates on the daemon-token credential, matching `_testing_reset`.
181
189
  */
182
190
  export declare const testing_drain_effects_action_spec: {
@@ -192,6 +200,7 @@ export declare const testing_drain_effects_action_spec: {
192
200
  readonly input: z.ZodVoid;
193
201
  readonly output: z.ZodObject<{
194
202
  ok: z.ZodBoolean;
203
+ tracked: z.ZodBoolean;
195
204
  }, z.core.$strict>;
196
205
  readonly async: true;
197
206
  readonly description: "Test-binary only — await in-flight fire-and-forget audit writes so a following audit_log_list read is authoritative.";
@@ -251,7 +260,8 @@ export declare const testing_mint_session_action_spec: {
251
260
  * emitter the backend's handlers emit through (`deps.audit`), built with
252
261
  * `track_inflight: true` (see the spec doc). Mount it on any test endpoint
253
262
  * whose suite asserts on audit rows (the spine binary bundles it via
254
- * `create_testing_actions`; in-process suites mount it directly).
263
+ * `create_testing_actions`; in-process suites mount it directly). Answers
264
+ * `{ok: true, tracked}`, `tracked` read from `audit.is_tracking_inflight()`.
255
265
  *
256
266
  * @param audit - the backend's emitter, whose in-flight writes the action awaits
257
267
  */
@@ -626,16 +636,22 @@ export interface CreateTestingActionsOptions {
626
636
  */
627
637
  readonly daemon_token_state: DaemonTokenState;
628
638
  /**
629
- * Consumer-supplied callback invoked after the auth-table reset, passed
630
- * the same transactional `Db` the auth wipes ran on. DB-domain consumers
639
+ * Consumer-supplied callback invoked first, before the auth-table wipe and
640
+ * keeper re-seed, passed the same transactional `Db` the auth wipes then
641
+ * run on. It runs while the previous test's accounts and actors still
642
+ * exist, so a domain table with a restricting FK to `actor` / `account`
643
+ * empties before the auth wipe deletes what it references; it must not
644
+ * depend on the fresh keeper, which doesn't exist yet. DB-domain consumers
631
645
  * (e.g. fuz_forge truncating its cell / fact / file tables) MUST use this
632
646
  * `db` rather than a separately-pooled connection — under the in-memory
633
- * drivers' single connection (pglet, PGlite) a second connection deadlocks against this still-open
634
- * transaction. `testing_zzz_server` clears in-memory workspace registry +
635
- * terminals + scoped-FS scratch (ignores `db`); `testing_spine_stub` has
636
- * no domain layer and omits the option. Runs inside the same RPC dispatch
637
- * as the auth-table writes, so a throw surfaces to the caller as a
638
- * JSON-RPC error and the per-test fixture short-circuits.
647
+ * drivers' single connection (pglet, PGlite) a second connection deadlocks
648
+ * against this still-open transaction. `testing_zzz_server` clears
649
+ * in-memory workspace registry + terminals + scoped-FS scratch (ignores
650
+ * `db`); the spine binaries (`testing/cross_backend/full_spine_mount.ts` and
651
+ * the Rust `testing_spine_stub`) empty the cell and fact tables. Runs inside
652
+ * the same RPC dispatch as the auth-table writes, so a throw rolls the whole
653
+ * reset back and surfaces to the caller as a JSON-RPC error and the per-test
654
+ * fixture short-circuits.
639
655
  */
640
656
  readonly reset_state?: (db: Db) => Promise<void> | void;
641
657
  }
@@ -1 +1 @@
1
- {"version":3,"file":"testing_reset_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_reset_actions.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AAEH,OAAO,EAAE,CAAC,EA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CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,GAClC,MAAM,OAAO,EACb,SAAS,2BAA2B,KAClC,KAAK,CAAC,SAAS,CAkJjB,CAAC"}
1
+ {"version":3,"file":"testing_reset_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_reset_actions.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAOzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAsBzC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCQ,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;CAkBA,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;CAwBC,CAAC;AAE/C;;;;;;;;;GASG;AACH,eAAO,MAAM,mCAAmC,GAAI,OAAO,YAAY,KAAG,SAIvE,CAAC;AAEJ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;;;;;;;;;;;;;;;;;CAaF,CAAC;AAkB/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qCAAqC,GACjD,SAAS,aAAa,CAAC,SAAS,CAAC,KAC/B,SAMF,CAAC;AAEF,4CAA4C;AAC5C,MAAM,WAAW,2BAA2B;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACjD;;;;;;OAMG;IACH,QAAQ,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;IAC9C;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,GAClC,MAAM,OAAO,EACb,SAAS,2BAA2B,KAClC,KAAK,CAAC,SAAS,CAwJjB,CAAC"}
@@ -29,13 +29,16 @@ import '../assert_dev_env.js';
29
29
  *
30
30
  * `_testing_reset` — full DB wipe + keeper re-seed + optional
31
31
  * secondary-account seeding. The
32
- * handler wipes every auth-namespace row (no keeper-preserve filter),
32
+ * handler first fires the consumer-supplied domain-state callback (domain
33
+ * rows depend on auth rows, so a domain table with a restricting FK to
34
+ * `actor` empties before the rows it references go), then wipes every
35
+ * auth-namespace row (no keeper-preserve filter),
33
36
  * flips `bootstrap_lock` back to its post-bootstrap shape, seeds a
34
37
  * fresh keeper account inline (reusing `create_test_account_with_credentials`
35
- * so cross-process matches in-process write semantics), seeds any
36
- * caller-requested `extra_accounts` (also direct-inserted at this
37
- * setup step), refreshes the daemon-token cache to point at the new
38
- * keeper, and fires the consumer-supplied domain-state callback. The
38
+ * so cross-process matches in-process write semantics), queues the
39
+ * daemon-token cache refresh to point at the new keeper once the reset
40
+ * commits, and seeds any caller-requested `extra_accounts` (also
41
+ * direct-inserted at this setup step). The
39
42
  * new keeper + secondary credentials return as the action output so
40
43
  * the per-test fixture closes over them.
41
44
  *
@@ -87,7 +90,7 @@ import { query_put_fact_holder } from '../../db/fact_holder_queries.js';
87
90
  import { ROLE_ADMIN, ROLE_KEEPER } from '../../auth/role_schema.js';
88
91
  import { query_schema_snapshot, SchemaSnapshot, query_migration_tracker, MigrationTracker } from '../schema_introspect.js';
89
92
  import { ActionManifest, build_action_manifest } from './action_manifest.js';
90
- import { query_create_actor } from '../../auth/account_queries.js';
93
+ import { create_test_extra_actor } from '../db_entities.js';
91
94
  import { create_test_account_with_credentials, mint_test_session } from '../app_server.js';
92
95
  import { DEFAULT_TEST_PASSWORD } from '../test_credentials.js';
93
96
  import { TESTING_ACTION_AUTH } from './spine_surface_constants.js';
@@ -179,6 +182,11 @@ export const testing_reset_action_spec = {
179
182
  * not — nor are eager writes outside `emit` (session touch, token usage),
180
183
  * which only the dispatching transport's own flush awaits.
181
184
  *
185
+ * The output's `tracked` is `AuditEmitter.is_tracking_inflight` — whether the
186
+ * drain could wait on anything. `cross_drain_effects` refuses `tracked: false`,
187
+ * so a binary whose emitter was built without tracking fails its first audit
188
+ * read instead of racing it. The Rust twin answers the same shape.
189
+ *
182
190
  * `auth` gates on the daemon-token credential, matching `_testing_reset`.
183
191
  */
184
192
  export const testing_drain_effects_action_spec = {
@@ -188,7 +196,13 @@ export const testing_drain_effects_action_spec = {
188
196
  auth: TESTING_ACTION_AUTH,
189
197
  side_effects: false,
190
198
  input: z.void(),
191
- output: z.strictObject({ ok: z.boolean() }),
199
+ output: z.strictObject({
200
+ ok: z.boolean(),
201
+ tracked: z.boolean().meta({
202
+ description: "Whether the backend's audit emitter tracks in-flight writes — false means the drain " +
203
+ 'waited on nothing and is no barrier.'
204
+ })
205
+ }),
192
206
  async: true,
193
207
  description: 'Test-binary only — await in-flight fire-and-forget audit writes so a following audit_log_list read is authoritative.'
194
208
  };
@@ -250,13 +264,14 @@ export const testing_mint_session_action_spec = {
250
264
  * emitter the backend's handlers emit through (`deps.audit`), built with
251
265
  * `track_inflight: true` (see the spec doc). Mount it on any test endpoint
252
266
  * whose suite asserts on audit rows (the spine binary bundles it via
253
- * `create_testing_actions`; in-process suites mount it directly).
267
+ * `create_testing_actions`; in-process suites mount it directly). Answers
268
+ * `{ok: true, tracked}`, `tracked` read from `audit.is_tracking_inflight()`.
254
269
  *
255
270
  * @param audit - the backend's emitter, whose in-flight writes the action awaits
256
271
  */
257
272
  export const create_testing_drain_effects_action = (audit) => rpc_action(testing_drain_effects_action_spec, async () => {
258
273
  await audit.drain_inflight();
259
- return { ok: true };
274
+ return { ok: true, tracked: audit.is_tracking_inflight() };
260
275
  });
261
276
  /**
262
277
  * `_testing_put_fact` — seed an **embedded** fact (`fact.bytes`) for the
@@ -613,8 +628,18 @@ export const create_testing_actions = (deps, options) => {
613
628
  const log = deps.log;
614
629
  return [
615
630
  rpc_action(testing_reset_action_spec, async (input, ctx) => {
616
- log.info('[_testing_reset] resetting auth state + re-seeding keeper');
617
- // 1. Wipe every auth-namespace row. No keeper-preserve filter —
631
+ log.info('[_testing_reset] resetting domain + auth state + re-seeding keeper');
632
+ // 1. Fire domain-state reset (zzz workspaces/terminals/scratch,
633
+ // fuz_forge cell/fact/file truncation, the spine binaries' cell +
634
+ // fact wipe) first: domain rows depend on auth rows, so a domain
635
+ // table with a restricting FK to `actor` would make the auth wipe
636
+ // below fail once it holds a row.
637
+ // Pass the transactional `ctx.db` so DB-domain truncation runs
638
+ // on the same connection — a separate pool connection deadlocks
639
+ // against this open transaction under the in-memory drivers.
640
+ if (reset_state)
641
+ await reset_state(ctx.db);
642
+ // 2. Wipe every auth-namespace row. No keeper-preserve filter —
618
643
  // the fresh-keeper-per-test contract means mutation-cascade
619
644
  // tests (password change, revoke-all) and hardcoded-username
620
645
  // signup-uniqueness tests can't leak between cases.
@@ -631,13 +656,13 @@ export const create_testing_actions = (deps, options) => {
631
656
  await ctx.db.query('DELETE FROM role_grant');
632
657
  await ctx.db.query('DELETE FROM actor');
633
658
  await ctx.db.query('DELETE FROM account');
634
- // 2. Reset singleton `app_settings` to production defaults
659
+ // 3. Reset singleton `app_settings` to production defaults
635
660
  // (matches in-process `_build_test_backend` behavior in
636
661
  // `app_server.ts`). Tests that flipped `open_signup` mid-run
637
662
  // revert.
638
663
  await ctx.db.query('UPDATE app_settings SET open_signup = false, updated_at = NULL, updated_by = NULL ' +
639
664
  'WHERE open_signup = true OR updated_at IS NOT NULL');
640
- // 3. Flip `bootstrap_lock` to its post-bootstrap shape. Production
665
+ // 4. Flip `bootstrap_lock` to its post-bootstrap shape. Production
641
666
  // `bootstrap_account` flips this to `true` on success; the
642
667
  // in-process `bootstrap_test_keeper` mirrors the flip. We're
643
668
  // about to seed the keeper here, so the final state needs to
@@ -645,7 +670,7 @@ export const create_testing_actions = (deps, options) => {
645
670
  // to `false` — nothing reads it between our DELETEs and the
646
671
  // UPDATE.
647
672
  await ctx.db.query('UPDATE bootstrap_lock SET bootstrapped = true WHERE id = 1');
648
- // 4. Seed the fresh keeper inline. Reuses the same primitive
673
+ // 5. Seed the fresh keeper inline. Reuses the same primitive
649
674
  // in-process tests use (`create_test_account_with_credentials`)
650
675
  // so cross-process and in-process write semantics stay in
651
676
  // parity — same hash, same account+actor+role_grants+
@@ -662,7 +687,19 @@ export const create_testing_actions = (deps, options) => {
662
687
  password_value: DEFAULT_TEST_PASSWORD,
663
688
  roles: [ROLE_KEEPER, ROLE_ADMIN, ...(input.extra_keeper_roles ?? [])]
664
689
  });
665
- // 5. Seed any caller-requested extras. These are bootstrap-time
690
+ // 6. Refresh the daemon-token cache so subsequent daemon-token
691
+ // requests resolve to the freshly seeded keeper. The
692
+ // middleware's lazy-refresh path only fires when the cached
693
+ // id is null, so the reset sets it — after the commit, queued as
694
+ // soon as the keeper exists, so a reset that rolls back after it
695
+ // (a failing extra seed, a failed COMMIT) leaves the cache on the
696
+ // keeper still in the database rather than one that never
697
+ // landed, and the next reset can still authenticate.
698
+ const keeper_account_id = keeper.account.id;
699
+ emit_after_commit(ctx, () => {
700
+ daemon_token_state.keeper_account_id = keeper_account_id;
701
+ });
702
+ // 7. Seed any caller-requested extras. These are bootstrap-time
666
703
  // secondaries — the bypass exists in the same cradle the
667
704
  // keeper does, not as a free-form runtime action.
668
705
  const extras = [];
@@ -678,35 +715,19 @@ export const create_testing_actions = (deps, options) => {
678
715
  });
679
716
  extras.push(seeded);
680
717
  }
681
- // 5b. Seed any additional keeper actors. Same bootstrap-cradle
718
+ // 8. Seed any additional keeper actors. Same bootstrap-cradle
682
719
  // bypass as extra_accounts — no production wire path mints a
683
720
  // second actor, so the multi-actor `acting` branches need this
684
721
  // direct insert. Order-preserving so the fixture can address
685
- // them positionally.
722
+ // them positionally, and seeded at the wall clock so they sort
723
+ // after the keeper's bootstrap actor in insert order
724
+ // (`create_test_extra_actor`), as on the Rust spine
725
+ // (`query_create_actor_with_clock_timestamp`).
686
726
  const extra_actors = [];
687
727
  for (const name of input.extra_actors ?? []) {
688
- const seeded_actor = await query_create_actor({ db: ctx.db }, keeper.account.id, name);
728
+ const seeded_actor = await create_test_extra_actor(ctx.db, keeper.account.id, name);
689
729
  extra_actors.push({ id: seeded_actor.id, name: seeded_actor.name });
690
730
  }
691
- // 6. Refresh the daemon-token cache so subsequent daemon-token
692
- // requests resolve to the freshly seeded keeper. The
693
- // middleware's lazy-refresh path only fires when the cached
694
- // id is null, so the reset sets it — after the commit, so a
695
- // reset that rolls back (a throwing `reset_state`, a failed
696
- // COMMIT) leaves the cache on the keeper still in the database
697
- // rather than one that never landed, and the next reset can
698
- // still authenticate.
699
- const keeper_account_id = keeper.account.id;
700
- emit_after_commit(ctx, () => {
701
- daemon_token_state.keeper_account_id = keeper_account_id;
702
- });
703
- // 7. Fire domain-state reset (zzz workspaces/terminals/scratch,
704
- // fuz_forge cell/fact/file truncation, or no-op for spine_stub).
705
- // Pass the transactional `ctx.db` so DB-domain truncation runs
706
- // on the same connection — a separate pool connection deadlocks
707
- // against this open transaction under the in-memory drivers.
708
- if (reset_state)
709
- await reset_state(ctx.db);
710
731
  return { ...keeper, extra_accounts: extras, extra_actors };
711
732
  }),
712
733
  rpc_action(testing_mint_session_action_spec, async (input, ctx) => {
@@ -72,7 +72,7 @@ export const create_bun_testing_adapter = () => {
72
72
  // hang), and the client runtime — a single server-closed WS is
73
73
  // necessary and sufficient. Client-initiated close or leaving the
74
74
  // socket open both stop cleanly in ~0ms. In this suite the trigger is
75
- // any server-initiated WS close — a revocation's (the `ws.cross.test.ts`
75
+ // any server-initiated WS close — a revocation's (the WS round-trip suite's
76
76
  // close-on-revoke cases), a cap eviction's, an oversized message's —
77
77
  // which is why teardown hangs after those and not under HTTP-only or
78
78
  // client-closed WS traffic.
@@ -37,7 +37,7 @@ import '../assert_dev_env.js';
37
37
  */
38
38
  import { describe, test, assert } from 'vitest';
39
39
  import { account_token_create_action_spec, account_token_list_action_spec, API_TOKEN_NAME_LENGTH_MAX, TokenCreateOutput, TokenListOutput } from '../../auth/account_action_specs.js';
40
- import { cross_rpc_call, error_reason, expect_output } from './cell_cross_helpers.js';
40
+ import { cross_rpc_call, error_reason, expect_output } from './cross_rpc.js';
41
41
  import { assert_iso8601_seconds } from './wire_shapes.js';
42
42
  import { SPINE_RPC_PATH } from './spine_surface_constants.js';
43
43
  /** TTL used by the bounded-mint case. */
@@ -1 +1 @@
1
- {"version":3,"file":"token_scope_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/token_scope_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgF9B,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,YAAY,CAAC;AAqB1E,wDAAwD;AACxD,MAAM,WAAW,iCAAkC,SAAQ,uCAAuC;IACjG,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AA6DD,eAAO,MAAM,wCAAwC,GACpD,SAAS,iCAAiC,KACxC,IA+JF,CAAC"}
1
+ {"version":3,"file":"token_scope_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/token_scope_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgF9B,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,YAAY,CAAC;AAmB1E,wDAAwD;AACxD,MAAM,WAAW,iCAAkC,SAAQ,uCAAuC;IACjG,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AA6DD,eAAO,MAAM,wCAAwC,GACpD,SAAS,iCAAiC,KACxC,IAqKF,CAAC"}
@@ -70,13 +70,9 @@ import '../assert_dev_env.js';
70
70
  import { describe, assert } from 'vitest';
71
71
  import { ERROR_CREDENTIAL_TYPE_REQUIRED, ERROR_TOKEN_SCOPE_REQUIRED } from '../../http/error_schemas.js';
72
72
  import { test_if } from './capabilities.js';
73
- import { cross_rpc_call } from './cell_cross_helpers.js';
73
+ import { cross_rpc_call } from './cross_rpc.js';
74
74
  import { mint_narrowed_api_token } from './narrowed_api_token.js';
75
- import { SPINE_RPC_PATH } from './spine_surface_constants.js';
76
- /** Default audit-log SSE path — the `audit_stream` surface. */
77
- const DEFAULT_SSE_PATH = '/api/admin/audit/stream';
78
- /** The account status read, which answers a narrowed token as anonymous. */
79
- const STATUS_PATH = '/api/account/status';
75
+ import { SPINE_ACCOUNT_STATUS_PATH, SPINE_RPC_PATH, SPINE_SSE_PATH } from './spine_surface_constants.js';
80
76
  /**
81
77
  * A well-formed hash that no fact has. The scope gate is a pre-authorization
82
78
  * guard, so it fires before the handler ever looks the hash up — but *params*
@@ -127,7 +123,7 @@ const assert_channel_denied = async (fresh_transport, path, token, credential_ty
127
123
  export const describe_token_scope_surface_cross_tests = (options) => {
128
124
  const { setup_test, capabilities } = options;
129
125
  const rpc_path = options.rpc_path ?? SPINE_RPC_PATH;
130
- const sse_path = options.sse_path ?? DEFAULT_SSE_PATH;
126
+ const sse_path = options.sse_path ?? SPINE_SSE_PATH;
131
127
  describe('token scope non-RPC surface parity', () => {
132
128
  /**
133
129
  * The non-vacuity control for every denial below: a narrowed token is
@@ -155,7 +151,7 @@ export const describe_token_scope_surface_cross_tests = (options) => {
155
151
  });
156
152
  await assert_channel_denied(fixture.fresh_transport, sse_path, token, ['session']);
157
153
  });
158
- test_if(capabilities.fact_serving, 'a narrowed token is refused the bare-hash fact read (surface:fact_bare)', async () => {
154
+ test_if(capabilities.fact_serving_admin_hash, 'a narrowed token is refused the bare-hash fact read (surface:fact_bare)', async () => {
159
155
  const fixture = await setup_test();
160
156
  const token = await mint_narrowed_api_token({
161
157
  app: fixture.transport,
@@ -173,7 +169,7 @@ export const describe_token_scope_surface_cross_tests = (options) => {
173
169
  * scope denial satisfies the property, so the assertion is on what the
174
170
  * response must *not* be.
175
171
  */
176
- test_if(capabilities.fact_serving, 'a full token is not refused by the scope gate on the same route', async () => {
172
+ test_if(capabilities.fact_serving_admin_hash, 'a full token is not refused by the scope gate on the same route', async () => {
177
173
  const fixture = await setup_test();
178
174
  const res = await fixture.fresh_transport({ origin: null })(`/api/facts/${ABSENT_FACT_HASH}`, { headers: fixture.create_bearer_headers() });
179
175
  const body = (await res.json().catch(() => undefined));
@@ -193,14 +189,14 @@ export const describe_token_scope_surface_cross_tests = (options) => {
193
189
  session_headers: fixture.create_session_headers(),
194
190
  methods: [ADMITTED_METHOD]
195
191
  });
196
- const anonymous = await fixture.fresh_transport({ origin: null })(STATUS_PATH, {});
197
- const narrowed = await fixture.fresh_transport({ origin: null })(STATUS_PATH, {
192
+ const anonymous = await fixture.fresh_transport({ origin: null })(SPINE_ACCOUNT_STATUS_PATH, {});
193
+ const narrowed = await fixture.fresh_transport({ origin: null })(SPINE_ACCOUNT_STATUS_PATH, {
198
194
  headers: { authorization: `Bearer ${token}` }
199
195
  });
200
196
  assert.strictEqual(anonymous.status, 401, 'anonymous status must be 401');
201
197
  assert.strictEqual(narrowed.status, 401, 'a narrowed token must read status as anonymous');
202
198
  assert.strictEqual(await narrowed.text(), await anonymous.text(), 'the narrowed answer must be the anonymous one, byte for byte');
203
- const full = await fixture.fresh_transport({ origin: null })(STATUS_PATH, {
199
+ const full = await fixture.fresh_transport({ origin: null })(SPINE_ACCOUNT_STATUS_PATH, {
204
200
  headers: fixture.create_bearer_headers()
205
201
  });
206
202
  assert.strictEqual(full.status, 200, 'a full-scope bearer must read the account');
@@ -218,7 +214,7 @@ export const describe_token_scope_surface_cross_tests = (options) => {
218
214
  * *holds* the role — so both orderings look identical there, which is
219
215
  * exactly why this divergence survived as long as it did.
220
216
  */
221
- test_if(capabilities.fact_serving, 'scope outranks role — a narrowed token lacking the role hears about its scope', async () => {
217
+ test_if(capabilities.fact_serving_admin_hash, 'scope outranks role — a narrowed token lacking the role hears about its scope', async () => {
222
218
  const fixture = await setup_test();
223
219
  const non_admin = await fixture.create_account({ username: 'scope_before_role' });
224
220
  const token = await mint_narrowed_api_token({
@@ -1,10 +1,10 @@
1
1
  import '../assert_dev_env.js';
2
2
  import { type BackendCapabilities } from './capabilities.js';
3
- import type { RpcPathCapabilityGatedCrossSuiteOptions } from './setup.js';
3
+ import type { RpcPathCapabilityGatedCrossSuiteOptions, SetupTest } from './setup.js';
4
4
  /** A transport's front door, as the table's rows name it. */
5
5
  export type TransportCompositionSurface = 'rest_post' | 'rest_password' | 'rpc_post' | 'rpc_get' | 'ws_upgrade' | 'sse';
6
6
  /** What a probe sends, as the table's columns name it. */
7
- export type TransportCompositionProbe = 'foreign_origin' | 'unreadable_origin' | 'duplicated_origin' | 'over_cap_foreign_origin' | 'no_credential' | 'narrowed_token';
7
+ export type TransportCompositionProbe = 'foreign_origin' | 'unreadable_origin' | 'duplicated_origin' | 'over_cap_foreign_origin' | 'no_credential' | 'narrowed_token' | 'multi_actor_no_acting';
8
8
  /** The refusal a case expects. */
9
9
  export interface TransportCompositionExpect {
10
10
  readonly status: number;
@@ -25,6 +25,21 @@ export interface TransportCompositionCase {
25
25
  }
26
26
  /** The front-door table — one case per cell of the module doc's matrix. */
27
27
  export declare const transport_composition_cases: ReadonlyArray<TransportCompositionCase>;
28
+ /**
29
+ * The rows that need a multi-actor keeper — run only given
30
+ * `TransportCompositionCrossTestOptions.multi_actor`, on its fixture.
31
+ */
32
+ export declare const transport_composition_multi_actor_cases: ReadonlyArray<TransportCompositionCase>;
33
+ /** The multi-actor rows' fixture, and how a backend known to diverge runs them. */
34
+ export interface TransportCompositionMultiActorOptions {
35
+ /** Per-test fixture whose keeper is seeded with at least one `extra_actors` entry. */
36
+ readonly setup_test: SetupTest;
37
+ /** Run the multi-actor rows as `xfail_until` — for a backend known to admit them. */
38
+ readonly xfail?: {
39
+ readonly tracking_id: string;
40
+ readonly reason: string;
41
+ };
42
+ }
28
43
  /** Options for `describe_transport_composition_cross_tests`. */
29
44
  export interface TransportCompositionCrossTestOptions extends RpcPathCapabilityGatedCrossSuiteOptions {
30
45
  /**
@@ -47,6 +62,15 @@ export interface TransportCompositionCrossTestOptions extends RpcPathCapabilityG
47
62
  readonly ws_path?: string;
48
63
  /** Audit-log SSE path. Default `/api/admin/audit/stream`. */
49
64
  readonly sse_path?: string;
65
+ /** Run the multi-actor rows (`transport_composition_multi_actor_cases`). */
66
+ readonly multi_actor?: TransportCompositionMultiActorOptions;
67
+ /**
68
+ * The backend's request-body cap on `rpc_path`, in bytes; the RPC row's
69
+ * over-cap probe declares a length one past it. Default
70
+ * `SPINE_BODY_LIMIT_DEFAULT_BYTES`. The REST rows probe past that default,
71
+ * the cap a backend keeps off its RPC path.
72
+ */
73
+ readonly rpc_max_body_bytes?: number;
50
74
  }
51
75
  /**
52
76
  * Register the front-door table's cases — one test per cell, each on a fresh
@@ -1 +1 @@
1
- {"version":3,"file":"transport_composition.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/transport_composition.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA+E9B,OAAO,EAAW,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,KAAK,EAAE,uCAAuC,EAAe,M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AAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,kDAAkD;IAClD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAwFD;;;;;;;GAOG;AACH,eAAO,MAAM,0CAA0C,GACtD,SAAS,oCAAoC,KAC3C,IA2KF,CAAC"}
1
+ {"version":3,"file":"transport_composition.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/transport_composition.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgG9B,OAAO,EAAW,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,KAAK,EAAE,uCAAuC,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAWlG,6DAA6D;AAC7D,MAAM,MAAM,2BAA2B,GACtC,WAAW,GAAG,eAAe,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,KAAK,CAAC;AAE/E,0DAA0D;AAC1D,MAAM,MAAM,yBAAyB,GAClC,gBAAgB,GAChB,mBAAmB,GACnB,mBAAmB,GACnB,yBAAyB,GACzB,eAAe,GACf,gBAAgB,GAChB,uBAAuB,CAAC;AAE3B,kCAAkC;AAClC,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,8FAA8F;IAC9F,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wCAAwC;AACxC,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,CAAC,KAAK,E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