@fuzdev/fuz_app 0.146.1 → 0.148.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 (313) hide show
  1. package/dist/actions/CLAUDE.md +6 -4
  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/perform_action.js +1 -1
  6. package/dist/auth/CLAUDE.md +1 -1
  7. package/dist/auth/bootstrap_account.d.ts +2 -1
  8. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  9. package/dist/auth/bootstrap_account.js +17 -6
  10. package/dist/auth/cell_action_specs.d.ts +3 -1
  11. package/dist/auth/cell_action_specs.d.ts.map +1 -1
  12. package/dist/auth/cell_action_specs.js +5 -5
  13. package/dist/auth/cell_actions.d.ts.map +1 -1
  14. package/dist/auth/cell_actions.js +2 -3
  15. package/dist/auth/cell_data_schema.d.ts +1 -1
  16. package/dist/auth/cell_data_schema.js +1 -1
  17. package/dist/auth/cell_field_action_specs.d.ts +4 -3
  18. package/dist/auth/cell_field_action_specs.d.ts.map +1 -1
  19. package/dist/auth/cell_field_action_specs.js +5 -6
  20. package/dist/auth/cell_field_actions.d.ts.map +1 -1
  21. package/dist/auth/cell_field_actions.js +8 -1
  22. package/dist/auth/cell_item_action_specs.d.ts +4 -2
  23. package/dist/auth/cell_item_action_specs.d.ts.map +1 -1
  24. package/dist/auth/cell_item_action_specs.js +5 -5
  25. package/dist/auth/cell_item_actions.d.ts.map +1 -1
  26. package/dist/auth/cell_item_actions.js +8 -1
  27. package/dist/auth/keyring.d.ts +35 -38
  28. package/dist/auth/keyring.d.ts.map +1 -1
  29. package/dist/auth/keyring.js +43 -50
  30. package/dist/auth/password_argon2.d.ts.map +1 -1
  31. package/dist/auth/password_argon2.js +11 -8
  32. package/dist/auth/role_grant_offer_action_specs.d.ts +2 -0
  33. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  34. package/dist/auth/role_grant_offer_action_specs.js +3 -1
  35. package/dist/auth/session_cookie.d.ts.map +1 -1
  36. package/dist/auth/session_cookie.js +5 -2
  37. package/dist/db/CLAUDE.md +18 -16
  38. package/dist/db/cell_queries.d.ts +3 -2
  39. package/dist/db/cell_queries.d.ts.map +1 -1
  40. package/dist/db/cell_queries.js +3 -2
  41. package/dist/db/fact_disk_storage.d.ts +15 -15
  42. package/dist/db/fact_disk_storage.d.ts.map +1 -1
  43. package/dist/db/fact_disk_storage.js +22 -28
  44. package/dist/db/fact_queries.d.ts +2 -3
  45. package/dist/db/fact_queries.d.ts.map +1 -1
  46. package/dist/db/fact_queries.js +2 -3
  47. package/dist/db/fact_store.d.ts +20 -18
  48. package/dist/db/fact_store.d.ts.map +1 -1
  49. package/dist/db/fact_store.js +30 -44
  50. package/dist/db/file_fact_url.d.ts +19 -4
  51. package/dist/db/file_fact_url.d.ts.map +1 -1
  52. package/dist/db/file_fact_url.js +19 -4
  53. package/dist/primitive_schemas.d.ts +1 -1
  54. package/dist/primitive_schemas.d.ts.map +1 -1
  55. package/dist/primitive_schemas.js +2 -1
  56. package/dist/schema_meta.d.ts +20 -0
  57. package/dist/schema_meta.d.ts.map +1 -1
  58. package/dist/schema_meta.js +7 -1
  59. package/dist/server/env.d.ts.map +1 -1
  60. package/dist/server/env.js +2 -2
  61. package/dist/server/serve_fact_route.d.ts +9 -5
  62. package/dist/server/serve_fact_route.d.ts.map +1 -1
  63. package/dist/server/serve_fact_route.js +15 -7
  64. package/dist/testing/CLAUDE.md +737 -114
  65. package/dist/testing/admin_integration.d.ts.map +1 -1
  66. package/dist/testing/admin_integration.js +73 -5
  67. package/dist/testing/adversarial_input.d.ts +0 -47
  68. package/dist/testing/adversarial_input.d.ts.map +1 -1
  69. package/dist/testing/adversarial_input.js +4 -340
  70. package/dist/testing/adversarial_input_cases.d.ts +64 -0
  71. package/dist/testing/adversarial_input_cases.d.ts.map +1 -0
  72. package/dist/testing/adversarial_input_cases.js +348 -0
  73. package/dist/testing/app_server.d.ts.map +1 -1
  74. package/dist/testing/app_server.js +2 -2
  75. package/dist/testing/audit_completeness.d.ts.map +1 -1
  76. package/dist/testing/audit_completeness.js +24 -20
  77. package/dist/testing/audit_drift_guard.d.ts +27 -1
  78. package/dist/testing/audit_drift_guard.d.ts.map +1 -1
  79. package/dist/testing/audit_drift_guard.js +50 -0
  80. package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
  81. package/dist/testing/cross_backend/account_lifecycle.js +29 -12
  82. package/dist/testing/cross_backend/actor_lookup.d.ts.map +1 -1
  83. package/dist/testing/cross_backend/actor_lookup.js +7 -25
  84. package/dist/testing/cross_backend/app_settings.d.ts.map +1 -1
  85. package/dist/testing/cross_backend/app_settings.js +4 -6
  86. package/dist/testing/cross_backend/audit_cross_helpers.d.ts +51 -0
  87. package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -0
  88. package/dist/testing/cross_backend/audit_cross_helpers.js +78 -0
  89. package/dist/testing/cross_backend/backend_config.d.ts +2 -1
  90. package/dist/testing/cross_backend/backend_config.d.ts.map +1 -1
  91. package/dist/testing/cross_backend/body_size.d.ts +6 -0
  92. package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
  93. package/dist/testing/cross_backend/body_size.js +26 -44
  94. package/dist/testing/cross_backend/body_size_smuggling.d.ts +5 -0
  95. package/dist/testing/cross_backend/body_size_smuggling.d.ts.map +1 -1
  96. package/dist/testing/cross_backend/body_size_smuggling.js +7 -14
  97. package/dist/testing/cross_backend/bootstrap_backend.d.ts +11 -1
  98. package/dist/testing/cross_backend/bootstrap_backend.d.ts.map +1 -1
  99. package/dist/testing/cross_backend/bootstrap_backend.js +2 -1
  100. package/dist/testing/cross_backend/build_test_backend_paths.d.ts +3 -1
  101. package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
  102. package/dist/testing/cross_backend/capabilities.d.ts +55 -59
  103. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  104. package/dist/testing/cross_backend/capabilities.js +20 -23
  105. package/dist/testing/cross_backend/cargo_binary.d.ts +70 -0
  106. package/dist/testing/cross_backend/cargo_binary.d.ts.map +1 -0
  107. package/dist/testing/cross_backend/cargo_binary.js +148 -0
  108. package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
  109. package/dist/testing/cross_backend/cell_crud.js +57 -1
  110. package/dist/testing/cross_backend/cell_gated_create.d.ts +0 -60
  111. package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -1
  112. package/dist/testing/cross_backend/cell_gated_create.js +9 -487
  113. package/dist/testing/cross_backend/cell_grant_role.d.ts +14 -2
  114. package/dist/testing/cross_backend/cell_grant_role.d.ts.map +1 -1
  115. package/dist/testing/cross_backend/cell_grant_role.js +22 -12
  116. package/dist/testing/cross_backend/cell_moderate.d.ts +66 -0
  117. package/dist/testing/cross_backend/cell_moderate.d.ts.map +1 -0
  118. package/dist/testing/cross_backend/cell_moderate.js +511 -0
  119. package/dist/testing/cross_backend/cell_ref_admission.d.ts.map +1 -1
  120. package/dist/testing/cross_backend/cell_ref_admission.js +1 -1
  121. package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
  122. package/dist/testing/cross_backend/cell_relations.js +40 -19
  123. package/dist/testing/cross_backend/conformance_case.d.ts +43 -4
  124. package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
  125. package/dist/testing/cross_backend/conformance_case.js +29 -1
  126. package/dist/testing/cross_backend/conformance_rpc_auth.d.ts +93 -0
  127. package/dist/testing/cross_backend/conformance_rpc_auth.d.ts.map +1 -0
  128. package/dist/testing/cross_backend/conformance_rpc_auth.js +125 -0
  129. package/dist/testing/cross_backend/conformance_table.d.ts +144 -4
  130. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  131. package/dist/testing/cross_backend/conformance_table.js +297 -65
  132. package/dist/testing/cross_backend/cookie_attributes.d.ts.map +1 -1
  133. package/dist/testing/cross_backend/cookie_attributes.js +3 -2
  134. package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts +38 -5
  135. package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts.map +1 -1
  136. package/dist/testing/cross_backend/create_cross_backend_global_setup.js +24 -3
  137. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +5 -5
  138. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
  139. package/dist/testing/cross_backend/credential_deadline.d.ts +10 -6
  140. package/dist/testing/cross_backend/credential_deadline.d.ts.map +1 -1
  141. package/dist/testing/cross_backend/credential_deadline.js +32 -31
  142. package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
  143. package/dist/testing/cross_backend/credential_header_robustness.js +4 -6
  144. package/dist/testing/cross_backend/{cell_cross_helpers.d.ts → cross_rpc.d.ts} +12 -2
  145. package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -0
  146. package/dist/testing/cross_backend/{cell_cross_helpers.js → cross_rpc.js} +31 -7
  147. package/dist/testing/cross_backend/default_backend_configs.d.ts +56 -61
  148. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  149. package/dist/testing/cross_backend/default_backend_configs.js +97 -91
  150. package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
  151. package/dist/testing/cross_backend/default_spine_surface.js +2 -2
  152. package/dist/testing/cross_backend/differential.d.ts +126 -0
  153. package/dist/testing/cross_backend/differential.d.ts.map +1 -0
  154. package/dist/testing/cross_backend/differential.js +201 -0
  155. package/dist/testing/cross_backend/differential_normalize.d.ts +150 -0
  156. package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -0
  157. package/dist/testing/cross_backend/differential_normalize.js +153 -0
  158. package/dist/testing/cross_backend/fact_serving.d.ts +5 -0
  159. package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
  160. package/dist/testing/cross_backend/fact_serving.js +41 -7
  161. package/dist/testing/cross_backend/full_spine_mount.d.ts +15 -0
  162. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  163. package/dist/testing/cross_backend/full_spine_mount.js +55 -1
  164. package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
  165. package/dist/testing/cross_backend/identity_parity.js +6 -5
  166. package/dist/testing/cross_backend/in_process_setup.d.ts +12 -2
  167. package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
  168. package/dist/testing/cross_backend/in_process_setup.js +10 -7
  169. package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
  170. package/dist/testing/cross_backend/login_security.js +13 -18
  171. package/dist/testing/cross_backend/origin.js +1 -1
  172. package/dist/testing/cross_backend/origin_conformance.js +1 -1
  173. package/dist/testing/cross_backend/origin_scope.d.ts +6 -0
  174. package/dist/testing/cross_backend/origin_scope.d.ts.map +1 -1
  175. package/dist/testing/cross_backend/origin_scope.js +13 -12
  176. package/dist/testing/cross_backend/peer_ping_ws.d.ts +2 -5
  177. package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
  178. package/dist/testing/cross_backend/peer_ping_ws.js +14 -24
  179. package/dist/testing/cross_backend/postgres_database.d.ts +85 -0
  180. package/dist/testing/cross_backend/postgres_database.d.ts.map +1 -0
  181. package/dist/testing/cross_backend/postgres_database.js +140 -0
  182. package/dist/testing/cross_backend/provided_context.d.ts +28 -0
  183. package/dist/testing/cross_backend/provided_context.d.ts.map +1 -0
  184. package/dist/testing/cross_backend/provided_context.js +35 -0
  185. package/dist/testing/cross_backend/query_shape.d.ts.map +1 -1
  186. package/dist/testing/cross_backend/query_shape.js +10 -12
  187. package/dist/testing/cross_backend/ready.js +2 -2
  188. package/dist/testing/cross_backend/revocation_drivers.d.ts +4 -3
  189. package/dist/testing/cross_backend/revocation_drivers.d.ts.map +1 -1
  190. package/dist/testing/cross_backend/revocation_drivers.js +1 -1
  191. package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts +3 -2
  192. package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts.map +1 -1
  193. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts +13 -0
  194. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -0
  195. package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +203 -0
  196. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +2 -5
  197. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
  198. package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +203 -111
  199. package/dist/testing/cross_backend/role_grant_participation.d.ts +13 -0
  200. package/dist/testing/cross_backend/role_grant_participation.d.ts.map +1 -1
  201. package/dist/testing/cross_backend/role_grant_participation.js +32 -21
  202. package/dist/testing/cross_backend/role_grant_role_grammar.d.ts.map +1 -1
  203. package/dist/testing/cross_backend/role_grant_role_grammar.js +6 -9
  204. package/dist/testing/cross_backend/rpc_adversarial.d.ts +38 -0
  205. package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -0
  206. package/dist/testing/cross_backend/rpc_adversarial.js +292 -0
  207. package/dist/testing/cross_backend/rpc_success_fixtures.d.ts +24 -0
  208. package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -0
  209. package/dist/testing/cross_backend/rpc_success_fixtures.js +124 -0
  210. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +101 -0
  211. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -0
  212. package/dist/testing/cross_backend/rust_spine_consumer_surface.js +113 -0
  213. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts +10 -0
  214. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
  215. package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +27 -18
  216. package/dist/testing/cross_backend/session_cap.d.ts +9 -8
  217. package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
  218. package/dist/testing/cross_backend/session_cap.js +9 -4
  219. package/dist/testing/cross_backend/session_cookie_codec.d.ts +19 -0
  220. package/dist/testing/cross_backend/session_cookie_codec.d.ts.map +1 -0
  221. package/dist/testing/cross_backend/session_cookie_codec.js +128 -0
  222. package/dist/testing/cross_backend/setup.d.ts +56 -54
  223. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  224. package/dist/testing/cross_backend/setup.js +29 -29
  225. package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
  226. package/dist/testing/cross_backend/simple_request.js +4 -4
  227. package/dist/testing/cross_backend/spawn_backend.d.ts +59 -10
  228. package/dist/testing/cross_backend/spawn_backend.d.ts.map +1 -1
  229. package/dist/testing/cross_backend/spawn_backend.js +219 -60
  230. package/dist/testing/cross_backend/spine_suites.d.ts +231 -0
  231. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -0
  232. package/dist/testing/cross_backend/spine_suites.js +626 -0
  233. package/dist/testing/cross_backend/spine_surface_constants.d.ts +29 -0
  234. package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
  235. package/dist/testing/cross_backend/spine_surface_constants.js +29 -0
  236. package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
  237. package/dist/testing/cross_backend/sse_round_trip.js +3 -4
  238. package/dist/testing/cross_backend/standard.d.ts +18 -1
  239. package/dist/testing/cross_backend/standard.d.ts.map +1 -1
  240. package/dist/testing/cross_backend/standard.js +2 -0
  241. package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts +24 -0
  242. package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts.map +1 -1
  243. package/dist/testing/cross_backend/test_cell_gated_create_authorize.js +15 -0
  244. package/dist/testing/cross_backend/testing_backdoor.d.ts +2 -8
  245. package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
  246. package/dist/testing/cross_backend/testing_backdoor.js +7 -10
  247. package/dist/testing/cross_backend/testing_reset_actions.d.ts +10 -5
  248. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  249. package/dist/testing/cross_backend/testing_reset_actions.js +21 -12
  250. package/dist/testing/cross_backend/testing_server_bun.js +1 -1
  251. package/dist/testing/cross_backend/token_lifetime.js +1 -1
  252. package/dist/testing/cross_backend/token_scope_surface.d.ts.map +1 -1
  253. package/dist/testing/cross_backend/token_scope_surface.js +9 -13
  254. package/dist/testing/cross_backend/transport_composition.d.ts +26 -2
  255. package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
  256. package/dist/testing/cross_backend/transport_composition.js +81 -51
  257. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +8 -0
  258. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
  259. package/dist/testing/cross_backend/ts_spine_backend_config.js +17 -10
  260. package/dist/testing/cross_backend/ws_action_rate_limit.d.ts +2 -5
  261. package/dist/testing/cross_backend/ws_action_rate_limit.d.ts.map +1 -1
  262. package/dist/testing/cross_backend/ws_action_rate_limit.js +8 -14
  263. package/dist/testing/cross_backend/ws_connection_cap.d.ts +4 -9
  264. package/dist/testing/cross_backend/ws_connection_cap.d.ts.map +1 -1
  265. package/dist/testing/cross_backend/ws_connection_cap.js +11 -12
  266. package/dist/testing/cross_backend/ws_endpoint.d.ts +52 -0
  267. package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -0
  268. package/dist/testing/cross_backend/ws_endpoint.js +54 -0
  269. package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts +2 -5
  270. package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts.map +1 -1
  271. package/dist/testing/cross_backend/ws_inbound_dispatch.js +9 -15
  272. package/dist/testing/cross_backend/ws_outbound_overflow.d.ts +2 -7
  273. package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
  274. package/dist/testing/cross_backend/ws_outbound_overflow.js +5 -9
  275. package/dist/testing/cross_backend/ws_role_gated.d.ts +4 -5
  276. package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
  277. package/dist/testing/cross_backend/ws_role_gated.js +12 -21
  278. package/dist/testing/cross_backend/ws_round_trip.d.ts +12 -9
  279. package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
  280. package/dist/testing/cross_backend/ws_round_trip.js +29 -34
  281. package/dist/testing/db_entities.d.ts +16 -3
  282. package/dist/testing/db_entities.d.ts.map +1 -1
  283. package/dist/testing/db_entities.js +28 -5
  284. package/dist/testing/integration_helpers.d.ts +61 -2
  285. package/dist/testing/integration_helpers.d.ts.map +1 -1
  286. package/dist/testing/integration_helpers.js +75 -18
  287. package/dist/testing/round_trip.d.ts +17 -0
  288. package/dist/testing/round_trip.d.ts.map +1 -1
  289. package/dist/testing/round_trip.js +67 -24
  290. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  291. package/dist/testing/rpc_attack_surface.js +13 -138
  292. package/dist/testing/rpc_envelope_cases.d.ts +111 -0
  293. package/dist/testing/rpc_envelope_cases.d.ts.map +1 -0
  294. package/dist/testing/rpc_envelope_cases.js +240 -0
  295. package/dist/testing/rpc_helpers.d.ts +31 -0
  296. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  297. package/dist/testing/rpc_helpers.js +35 -14
  298. package/dist/testing/rpc_round_trip.d.ts +62 -6
  299. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  300. package/dist/testing/rpc_round_trip.js +151 -39
  301. package/dist/testing/schema_generators.d.ts.map +1 -1
  302. package/dist/testing/schema_generators.js +22 -2
  303. package/dist/testing/standard.d.ts +26 -0
  304. package/dist/testing/standard.d.ts.map +1 -1
  305. package/dist/testing/standard.js +4 -1
  306. package/dist/testing/transports/raw_http.d.ts +21 -0
  307. package/dist/testing/transports/raw_http.d.ts.map +1 -1
  308. package/dist/testing/transports/raw_http.js +30 -0
  309. package/package.json +10 -8
  310. package/dist/testing/cross_backend/actor_search.d.ts +0 -6
  311. package/dist/testing/cross_backend/actor_search.d.ts.map +0 -1
  312. package/dist/testing/cross_backend/actor_search.js +0 -90
  313. package/dist/testing/cross_backend/cell_cross_helpers.d.ts.map +0 -1
@@ -59,15 +59,8 @@ import '../assert_dev_env.js';
59
59
  * @module
60
60
  */
61
61
  import { describe, test, assert } from 'vitest';
62
- import { raw_http_count_responses, raw_http_exchange } from '../transports/raw_http.js';
63
- import { SPINE_RPC_PATH } from './spine_surface_constants.js';
64
- /** The shared 1 MiB cap (see `body_size.ts` for why it's a local constant). */
65
- const BODY_LIMIT_DEFAULT_BYTES = 1024 * 1024;
66
- /**
67
- * How long each raw exchange waits for the server to finish answering. An
68
- * exchange the backend does not end by closing runs the whole window.
69
- */
70
- const RAW_READ_TIMEOUT_MS = 2000;
62
+ import { raw_http_count_responses, raw_http_exchange, RAW_HTTP_READ_TIMEOUT_MS } from '../transports/raw_http.js';
63
+ import { SPINE_BODY_LIMIT_DEFAULT_BYTES, SPINE_RPC_PATH } from './spine_surface_constants.js';
71
64
  export const describe_body_size_smuggling_cross_tests = (options) => {
72
65
  const { base_url } = options;
73
66
  const rpc_path = options.rpc_path ?? SPINE_RPC_PATH;
@@ -81,7 +74,7 @@ export const describe_body_size_smuggling_cross_tests = (options) => {
81
74
  const two_requests = `GET ${rpc_path} HTTP/1.1\r\nHost: ${host}\r\n\r\n` +
82
75
  `GET ${rpc_path} HTTP/1.1\r\nHost: ${host}\r\nConnection: close\r\n\r\n`;
83
76
  const { received: response } = await raw_http_exchange(base_url, two_requests, {
84
- read_timeout_ms: RAW_READ_TIMEOUT_MS
77
+ read_timeout_ms: RAW_HTTP_READ_TIMEOUT_MS
85
78
  });
86
79
  const n = raw_http_count_responses(response);
87
80
  assert.ok(n >= 2, `expected ≥2 responses on one keep-alive connection (got ${n}); without ` +
@@ -89,7 +82,7 @@ export const describe_body_size_smuggling_cross_tests = (options) => {
89
82
  `assertion below is not a real signal. Raw head: ${response.slice(0, 120)}`);
90
83
  });
91
84
  test('oversized POST + pipelined GET → no request smuggled', async () => {
92
- const oversized_len = BODY_LIMIT_DEFAULT_BYTES + 1024;
85
+ const oversized_len = (options.rpc_max_body_bytes ?? SPINE_BODY_LIMIT_DEFAULT_BYTES) + 1024;
93
86
  const pipelined_get = `GET ${rpc_path} HTTP/1.1\r\nHost: ${host}\r\n\r\n`;
94
87
  // One write: an over-cap POST (rejected on Content-Length) immediately
95
88
  // followed by a GET.
@@ -101,7 +94,7 @@ export const describe_body_size_smuggling_cross_tests = (options) => {
101
94
  'x'.repeat(oversized_len) +
102
95
  pipelined_get;
103
96
  const { received: response } = await raw_http_exchange(base_url, payload, {
104
- read_timeout_ms: RAW_READ_TIMEOUT_MS
97
+ read_timeout_ms: RAW_HTTP_READ_TIMEOUT_MS
105
98
  });
106
99
  const n = raw_http_count_responses(response);
107
100
  // The reject closes the connection, so the pipelined GET is never
@@ -140,7 +133,7 @@ export const describe_body_size_smuggling_cross_tests = (options) => {
140
133
  chunked_envelope +
141
134
  `GET ${rpc_path} HTTP/1.1\r\nHost: ${host}\r\n\r\n`;
142
135
  const { received, closed_by_server } = await raw_http_exchange(base_url, payload, {
143
- read_timeout_ms: RAW_READ_TIMEOUT_MS
136
+ read_timeout_ms: RAW_HTTP_READ_TIMEOUT_MS
144
137
  });
145
138
  const n = raw_http_count_responses(received);
146
139
  // Refused with 400 or answered — the status is the implementation's.
@@ -151,7 +144,7 @@ export const describe_body_size_smuggling_cross_tests = (options) => {
151
144
  `Raw head: ${received.slice(0, 120)}`);
152
145
  assert.ok(closed_by_server, `expected the server to close the connection after a request carrying both ` +
153
146
  `Content-Length and Transfer-Encoding; it was still open after ` +
154
- `${RAW_READ_TIMEOUT_MS}ms. Raw head: ${received.slice(0, 120)}`);
147
+ `${RAW_HTTP_READ_TIMEOUT_MS}ms. Raw head: ${received.slice(0, 120)}`);
155
148
  });
156
149
  }
157
150
  });
@@ -25,6 +25,16 @@ import '../assert_dev_env.js';
25
25
  */
26
26
  import type { BackendConfig } from './backend_config.js';
27
27
  import type { BootstrappedBackendHandle } from './setup.js';
28
+ /** Options for `bootstrap_backend`. */
29
+ export interface BootstrapBackendOptions {
30
+ /**
31
+ * Runs after the binary is up and before the keeper bootstrap — the one
32
+ * window in a backend's life where `POST {bootstrap_path}` still answers on
33
+ * the token, so probes of the bootstrap route itself go here. A throw tears
34
+ * the backend down like a failed bootstrap.
35
+ */
36
+ readonly before_bootstrap?: (config: BackendConfig) => Promise<void>;
37
+ }
28
38
  /**
29
39
  * Spawn the test binary described by `config`, bootstrap a keeper, and
30
40
  * return the enriched handle.
@@ -37,5 +47,5 @@ import type { BootstrappedBackendHandle } from './setup.js';
37
47
  * Mirrors the composition `default_cross_process_setup`'s caller would
38
48
  * otherwise hand-roll in every consumer's `globalSetup`.
39
49
  */
40
- export declare const bootstrap_backend: (config: BackendConfig) => Promise<BootstrappedBackendHandle>;
50
+ export declare const bootstrap_backend: (config: BackendConfig, options?: BootstrapBackendOptions) => Promise<BootstrappedBackendHandle>;
41
51
  //# sourceMappingURL=bootstrap_backend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap_backend.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/bootstrap_backend.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,GAC7B,QAAQ,aAAa,KACnB,OAAO,CAAC,yBAAyB,CAwBnC,CAAC"}
1
+ {"version":3,"file":"bootstrap_backend.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/bootstrap_backend.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,uCAAuC;AACvC,MAAM,WAAW,uBAAuB;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,GAC7B,QAAQ,aAAa,EACrB,UAAU,uBAAuB,KAC/B,OAAO,CAAC,yBAAyB,CAyBnC,CAAC"}
@@ -14,9 +14,10 @@ import { create_fetch_transport } from '../transports/fetch_transport.js';
14
14
  * Mirrors the composition `default_cross_process_setup`'s caller would
15
15
  * otherwise hand-roll in every consumer's `globalSetup`.
16
16
  */
17
- export const bootstrap_backend = async (config) => {
17
+ export const bootstrap_backend = async (config, options) => {
18
18
  const handle = await spawn_backend(config);
19
19
  try {
20
+ await options?.before_bootstrap?.(config);
20
21
  const keeper_transport = create_fetch_transport({ base_url: config.base_url });
21
22
  const keeper = await bootstrap({ transport: keeper_transport, config });
22
23
  return {
@@ -8,7 +8,9 @@ import '../assert_dev_env.js';
8
8
  * - `bootstrap_token_path` — `FUZ_BOOTSTRAP_TOKEN_PATH`; harness writes
9
9
  * the bootstrap token here before spawn.
10
10
  * - `daemon_token_path` — where `init_daemon_token` (Rust) and the TS
11
- * server's daemon-token writer land the token (under `{root}/run/`).
11
+ * server's daemon-token writer land the token (under `{root}/run/`);
12
+ * `spawn_backend` deletes it before each spawn, so a token a previous run
13
+ * left is never read.
12
14
  */
13
15
  export interface TestBackendPaths {
14
16
  readonly root: string;
@@ -1 +1 @@
1
- {"version":3,"file":"build_test_backend_paths.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/build_test_backend_paths.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAqB9B;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,MAAM,KAAG,gBASzD,CAAC"}
1
+ {"version":3,"file":"build_test_backend_paths.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/build_test_backend_paths.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAqB9B;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,MAAM,KAAG,gBASzD,CAAC"}
@@ -1,43 +1,9 @@
1
1
  import '../assert_dev_env.js';
2
- /**
3
- * Backend wiring facts recorded for documentation — **not** gating flags.
4
- *
5
- * The companion to `BackendCapabilities`: where each capability flag is read
6
- * by a suite (a `test_if(capabilities.X, ...)` gate, or a fork of one case's
7
- * assertion), nothing reads these. They record middleware / limiter wiring that
8
- * differs between the TS and Rust families (a backend-shape record) but gates
9
- * no cross test today. They live in their own type precisely so
10
- * `BackendCapabilities` stops claiming gating power it doesn't have — fold a
11
- * flag in here the moment it has no `test_if` reader, and promote it back the
12
- * day a suite genuinely gates on it.
13
- */
14
- export interface BackendShapeNotes {
15
- /**
16
- * Bearer-token auth (`Authorization: Bearer <token>`) is wired through the
17
- * backend's middleware stack. `true` on every spine — the bearer-token cases
18
- * in `describe_standard_integration_tests` / `describe_rate_limiting_tests`
19
- * run unconditionally.
20
- */
21
- readonly bearer_auth: boolean;
22
- /**
23
- * Trusted-proxy XFF parsing (`X-Forwarded-For` etc.) is wired. Records the
24
- * proxy-default difference between the TS family (`false` — the test binary
25
- * leaves proxy parsing off) and the Rust family (`true` — the client-IP
26
- * middleware is always wired; the env-gate only chooses XFF vs the TCP peer).
27
- */
28
- readonly trusted_proxy: boolean;
29
- /**
30
- * Per-account login rate limiting is wired. `false` for the TS family (the
31
- * canonical path leaves the limiter null in test mode), `true` for the Rust
32
- * family (env-gated bucket on `/login` + `/password`).
33
- */
34
- readonly login_rate_limit: boolean;
35
- }
36
2
  /**
37
3
  * Optional behaviors a backend may support. Each flag's TSDoc names the
38
4
  * tests that gate on it; add a new flag here before referencing it from
39
- * a suite body, and document the gating tests inline. Wiring facts that gate
40
- * nothing belong in `BackendShapeNotes`, not here.
5
+ * a suite body, and document the gating tests inline. A wiring fact no
6
+ * suite reads doesn't belong here.
41
7
  */
42
8
  export interface BackendCapabilities {
43
9
  /**
@@ -93,15 +59,27 @@ export interface BackendCapabilities {
93
59
  */
94
60
  readonly account_lifecycle: boolean;
95
61
  /**
96
- * The cell-gated fact-serving routes (`GET /api/cells/:cell_id/facts/:hash`
97
- * + the admin-only `GET /api/facts/:hash`) are live-mounted on the backend,
98
- * its DB carries the `fuz_facts` migration namespace, and it registers the
99
- * `_testing_put_fact` seeder. Gates `describe_fact_serving_cross_tests` —
100
- * the per-reference read model (cell-scoped admit via a viewable cell,
101
- * cross-owner-dedup-no-leak, 404-mask, bare-hash admin-only). Like cells,
102
- * the serve routes stay off the standard declared surface.
62
+ * The cell-gated fact-serving route (`GET /api/cells/:cell_id/facts/:hash`)
63
+ * is live-mounted on the backend, its DB carries the `fuz_facts` migration
64
+ * namespace, and it registers the `_testing_put_fact` seeder. Gates
65
+ * `describe_fact_serving_cross_tests`' per-reference read model (cell-scoped
66
+ * admit via a viewable cell, cross-owner-dedup-no-leak, 404-mask),
67
+ * `describe_cell_ref_admission_cross_tests`, and the fact cases of the
68
+ * moderation suite. Like cells, the serve route stays off the standard
69
+ * declared surface. The admin bare-hash route is its own flag,
70
+ * `fact_serving_admin_hash`.
103
71
  */
104
72
  readonly fact_serving: boolean;
73
+ /**
74
+ * The admin-only bare-hash fact route (`GET /api/facts/:hash`) is
75
+ * live-mounted. Gates the bare-hash cases of
76
+ * `describe_fact_serving_cross_tests` (with `fact_serving`, whose seeder
77
+ * they use), `describe_query_shape_cross_tests` and
78
+ * `describe_token_scope_surface_cross_tests`. A backend serving only the
79
+ * cell-gated route states `fact_serving: true, fact_serving_admin_hash:
80
+ * false`.
81
+ */
82
+ readonly fact_serving_admin_hash: boolean;
105
83
  /**
106
84
  * The `/ready` readiness deploy gate (`GET /ready`) is live-mounted on the
107
85
  * backend — the public column-presence schema-drift probe over the committed
@@ -130,13 +108,12 @@ export interface BackendCapabilities {
130
108
  * rejection, per-connection id isolation, never-replying `Timeout`,
131
109
  * wrong-shape reply rejection).
132
110
  *
133
- * `true` for both the Rust spine (server-initiated requests landed
134
- * Rust-first canonical) and the TS spine
135
- * (`BackendWebsocketTransport.request_connection` drives the round-trip,
136
- * correlated by `register_action_ws`). The conservative
137
- * `ts_default_capabilities` keeps it `false` like sse/ready — a TS backend
138
- * opts in once it mounts `peer/ping` on a WS endpoint **and** the HTTP RPC
139
- * endpoint (the no-transport refusal). Like ws/sse/cells, `peer/ping` stays
111
+ * `true` on fuz_app's own spine presets — the Rust `testing_spine_stub` and
112
+ * the TS spine (`BackendWebsocketTransport.request_connection` drives the
113
+ * round-trip, correlated by `register_action_ws`). A `MountFlag`: a backend
114
+ * states `true` once it mounts `peer/ping` on a WS endpoint **and** the HTTP
115
+ * RPC endpoint (the no-transport refusal).
116
+ * Like ws/sse/cells, `peer/ping` stays
140
117
  * off the standard declared surface (it's a protocol action,
141
118
  * manifest-excluded), so this flag is the only opt-in into the peer parity
142
119
  * coverage.
@@ -171,9 +148,9 @@ export interface BackendCapabilities {
171
148
  *
172
149
  * `true` on fuz_app's own spine presets — the TS spine binary mounts its
173
150
  * full action set on `/api/ws`, and the Rust `testing_spine_stub` serves
174
- * one action registry on RPC and WS. `false` in the family defaults:
175
- * a consumer's WS endpoint carries whatever its domain mounts, so it opts in
176
- * once the account actions are there.
151
+ * one action registry on RPC and WS. A `MountFlag`: a consumer's WS endpoint
152
+ * carries whatever its domain mounts, so it states `true` once the account
153
+ * actions are there.
177
154
  */
178
155
  readonly ws_account_actions: boolean;
179
156
  /**
@@ -215,6 +192,31 @@ export interface BackendCapabilities {
215
192
  */
216
193
  readonly ws_refusal_body: boolean;
217
194
  }
195
+ /**
196
+ * The capabilities that describe a backend's own mounts, never a runtime
197
+ * trait: what a consumer chooses to serve. They have no family default —
198
+ * state each flag in your backend config's `capabilities`; a missing one
199
+ * would silently skip its suites, so leaving one out is a type error.
200
+ *
201
+ * `Pick` keeps the list honest: a name that is not a `BackendCapabilities`
202
+ * flag fails to compile.
203
+ */
204
+ export type MountFlag = keyof Pick<BackendCapabilities, 'ws' | 'sse' | 'cell_crud' | 'cell_relations' | 'cell_gated_create' | 'fact_serving' | 'fact_serving_admin_hash' | 'ready' | 'peer_request' | 'ws_account_actions' | 'ws_role_gated'>;
205
+ /**
206
+ * A family's default capabilities: every flag but the `MountFlag`s, which
207
+ * each backend config states itself. Spread one and add every mount flag:
208
+ *
209
+ * ```ts
210
+ * capabilities: {
211
+ * ...rust_default_capabilities,
212
+ * ws: true, sse: true, ready: true, peer_request: true,
213
+ * cell_crud: false, cell_relations: false, cell_gated_create: false,
214
+ * fact_serving: false, fact_serving_admin_hash: false,
215
+ * ws_account_actions: false, ws_role_gated: false,
216
+ * }
217
+ * ```
218
+ */
219
+ export type FamilyDefaultCapabilities = Omit<BackendCapabilities, MountFlag>;
218
220
  /**
219
221
  * Capability declarations for the in-process Hono transport. Nearly every
220
222
  * flag is `true` because in-process testing exercises the full backend
@@ -229,12 +231,6 @@ export interface BackendCapabilities {
229
231
  * per backend.
230
232
  */
231
233
  export declare const in_process_capabilities: BackendCapabilities;
232
- /**
233
- * Shape notes for the in-process Hono transport — every wiring fact present
234
- * (the in-process app exercises the full middleware stack). Documentation
235
- * only, like every `BackendShapeNotes` (nothing reads it).
236
- */
237
- export declare const in_process_shape_notes: BackendShapeNotes;
238
234
  /**
239
235
  * Conditional `test()` wrapper — registers a vitest case only when
240
236
  * `cond` is true; otherwise registers it as `.skip` so the run still
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA2C9B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;CACnC;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC;;;;;;;;;OASG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,EAAE,mBAwBpC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,iBAInC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,OAAO,EAAE,MAAM,MAAM,EAAE,IAAI,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAG,IAMrF,CAAC"}
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAiD9B;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC;;;;;;;;;OASG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,IAAI,CACjC,mBAAmB,EACjB,IAAI,GACJ,KAAK,GACL,WAAW,GACX,gBAAgB,GAChB,mBAAmB,GACnB,cAAc,GACd,yBAAyB,GACzB,OAAO,GACP,cAAc,GACd,oBAAoB,GACpB,eAAe,CACjB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;AAE7E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,EAAE,mBAyBpC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,OAAO,EAAE,MAAM,MAAM,EAAE,IAAI,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAG,IAMrF,CAAC"}
@@ -18,22 +18,28 @@ import '../assert_dev_env.js';
18
18
  * - `in_process_capabilities` — here; every flag `true` except the
19
19
  * cross-process-only ones.
20
20
  * - `ts_default_capabilities` / `rust_default_capabilities` — consumer-facing
21
- * family defaults, in `default_backend_configs.ts` (full literals, so adding
22
- * a capability is a compile error until each family declares it).
21
+ * family defaults, in `default_backend_configs.ts` — every flag but the
22
+ * `MountFlag`s (`FamilyDefaultCapabilities`), as full literals, so adding a
23
+ * non-mount capability is a compile error until each family declares it.
23
24
  * - `ts_spine_capabilities` / `ts_spine_bun_capabilities` — fuz_app's own TS
24
- * spine presets, in `ts_spine_backend_config.ts` (deltas off the family
25
- * default; Bun flips `ws_handshake_pipelining`).
25
+ * spine presets, in `ts_spine_backend_config.ts` (the family
26
+ * default plus every mount flag; Bun flips `ws_handshake_pipelining`).
26
27
  * - `rust_spine_stub_capabilities` — fuz_app's Rust spine-stub preset, in
27
- * `rust_spine_stub_backend_config.ts` (delta off the rust family default).
28
+ * `rust_spine_stub_backend_config.ts` (the rust family default plus every mount flag).
28
29
  *
29
- * **Gating flags vs shape notes.** `BackendCapabilities` holds only flags a
30
- * suite actually gates on (each has a `test_if(capabilities.X, ...)` reader,
31
- * or — `ws_refusal_body` — picks how a case reads a refusal).
32
- * Wiring facts that gate nothing — `bearer_auth` / `trusted_proxy` /
33
- * `login_rate_limit` — live in the parallel `BackendShapeNotes` record
34
- * (`in_process_shape_notes` here, `ts_default_shape_notes` /
35
- * `rust_default_shape_notes` in `default_backend_configs.ts`) so the
36
- * capability type never claims gating power it doesn't have.
30
+ * **Mount flags have no default.** A flag naming something a backend mounts
31
+ * (a `MountFlag`) is never inherited: the family defaults are
32
+ * `FamilyDefaultCapabilities`, which omits them, so every backend config states
33
+ * each one. The family defaults carry only what the family guarantees — the
34
+ * declared spine surface's mounts (`account_lifecycle`, `account_status`) and
35
+ * the runtime behavior of its reference runtime (`ws_handshake_pipelining`,
36
+ * `ws_refusal_body`: Node for TS, hyper for Rust), which a backend on another
37
+ * runtime overrides.
38
+ *
39
+ * **Gating flags only.** `BackendCapabilities` holds only flags a suite
40
+ * actually gates on (each has a `test_if(capabilities.X, ...)` reader, or —
41
+ * `ws_refusal_body` — picks how a case reads a refusal). A wiring fact no suite
42
+ * reads is not a capability.
37
43
  *
38
44
  * @module
39
45
  */
@@ -58,6 +64,7 @@ export const in_process_capabilities = Object.freeze({
58
64
  cell_relations: true,
59
65
  account_lifecycle: true,
60
66
  fact_serving: true,
67
+ fact_serving_admin_hash: true,
61
68
  ready: true,
62
69
  account_status: true,
63
70
  peer_request: false,
@@ -76,16 +83,6 @@ export const in_process_capabilities = Object.freeze({
76
83
  // socket to upgrade); Hono's own refusals carry their bodies.
77
84
  ws_refusal_body: true
78
85
  });
79
- /**
80
- * Shape notes for the in-process Hono transport — every wiring fact present
81
- * (the in-process app exercises the full middleware stack). Documentation
82
- * only, like every `BackendShapeNotes` (nothing reads it).
83
- */
84
- export const in_process_shape_notes = Object.freeze({
85
- bearer_auth: true,
86
- trusted_proxy: true,
87
- login_rate_limit: true
88
- });
89
86
  /**
90
87
  * Conditional `test()` wrapper — registers a vitest case only when
91
88
  * `cond` is true; otherwise registers it as `.skip` so the run still
@@ -0,0 +1,70 @@
1
+ import '../assert_dev_env.js';
2
+ /**
3
+ * Env var skipping the build, for iteration on a known-current binary: `1` or
4
+ * `true` skips it, any other value (`0`, `false`, empty) builds.
5
+ */
6
+ export declare const NO_REBUILD_ENV = "FUZ_TESTING_NO_REBUILD";
7
+ /**
8
+ * Whether an `NO_REBUILD_ENV` value asks to skip the build — only an explicit
9
+ * `1` / `true`, so `FUZ_TESTING_NO_REBUILD=0` still builds.
10
+ *
11
+ * @param value - the variable's value, `undefined` when unset
12
+ */
13
+ export declare const is_no_rebuild_requested: (value: string | undefined) => boolean;
14
+ /** Options naming one Cargo-built binary. */
15
+ export interface CargoBinaryOptions {
16
+ /** The Cargo workspace (or package) directory the build runs in. */
17
+ readonly workspace_dir: string;
18
+ /** The Cargo package holding the binary (`cargo build -p`). */
19
+ readonly package: string;
20
+ /** The binary target (`cargo build --bin`). Default the package name. */
21
+ readonly bin?: string;
22
+ /** The Cargo profile. Default `'dev'`, whose output is `debug/`. */
23
+ readonly profile?: string;
24
+ }
25
+ /**
26
+ * The directory under the target directory a profile's output lands in —
27
+ * `debug` for `dev`, the profile's own name otherwise (`release`, a custom
28
+ * `cross-test`).
29
+ *
30
+ * @param profile - the Cargo profile
31
+ */
32
+ export declare const to_cargo_profile_dir: (profile: string) => string;
33
+ /**
34
+ * The binary path `cargo build --profile <profile> --bin <bin>` writes, from
35
+ * `cargo metadata --no-deps --format-version 1` output.
36
+ *
37
+ * @param metadata_json - the `cargo metadata` output
38
+ * @param bin - the binary's name
39
+ * @param profile - the Cargo profile
40
+ * @returns the binary's absolute path
41
+ * @throws Error when the output carries no `target_directory`
42
+ */
43
+ export declare const to_cargo_binary_path: (metadata_json: string, bin: string, profile: string) => string;
44
+ /**
45
+ * The path of a Cargo-built binary, without building it — what a config's
46
+ * `start_command` names. Runs `cargo metadata` once per process per workspace,
47
+ * so it needs cargo on PATH.
48
+ *
49
+ * @param options - the workspace, package, binary and profile
50
+ * @returns the binary's absolute path
51
+ * @throws Error when the workspace is missing or `cargo metadata` fails
52
+ */
53
+ export declare const resolve_cargo_binary_path: (options: CargoBinaryOptions) => string;
54
+ /**
55
+ * Build a Cargo binary before its backend spawns, unless `NO_REBUILD_ENV`
56
+ * asks to skip it, and return its path. The build's output is inherited, so a
57
+ * cold build shows its progress, and a failed build throws — the project fails
58
+ * loudly rather than spawning a stale binary. `cargo build` is incremental, so
59
+ * a build with nothing changed is quick.
60
+ *
61
+ * Synchronous: vitest awaits each project's `globalSetup` in turn, so one
62
+ * invocation selecting several projects builds once, then finds the build
63
+ * current.
64
+ *
65
+ * @param options - the workspace, package, binary and profile
66
+ * @returns the binary's absolute path (`resolve_cargo_binary_path`)
67
+ * @throws Error when the workspace is missing, the build fails, or `cargo metadata` fails
68
+ */
69
+ export declare const prepare_cargo_binary: (options: CargoBinaryOptions) => string;
70
+ //# sourceMappingURL=cargo_binary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cargo_binary.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/cargo_binary.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAyB9B;;;GAGG;AACH,eAAO,MAAM,cAAc,2BAA2B,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,OACnB,CAAC;AAElD,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IAClC,oEAAoE;IACpE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,MACjB,CAAC;AAEvC;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,GAChC,eAAe,MAAM,EACrB,KAAK,MAAM,EACX,SAAS,MAAM,KACb,MAMF,CAAC;AA2DF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,kBAAkB,KAAG,MAGvE,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,kBAAkB,KAAG,MAUlE,CAAC"}
@@ -0,0 +1,148 @@
1
+ import '../assert_dev_env.js';
2
+ /**
3
+ * Cargo-built test binaries for cross-backend projects — build before the
4
+ * spawn, then spawn the binary itself.
5
+ *
6
+ * A config that spawns `cargo run` builds inside `spawn_backend`'s health
7
+ * window, so a cold build can outlast the startup timeout, and the build's
8
+ * output is held in the spawn's stderr tail rather than shown.
9
+ * `prepare_cargo_binary` runs the build first, with its output inherited, as a
10
+ * pre-spawn hook (`create_cross_backend_global_setup`'s `before_spawn`), and
11
+ * the config's `start_command` names the built binary
12
+ * (`resolve_cargo_binary_path`), so the spawn starts at once.
13
+ *
14
+ * The binary's path comes from `cargo metadata`: under the workspace's
15
+ * resolved `target_directory`, so `CARGO_TARGET_DIR` and `build.target-dir`
16
+ * are honoured, in the profile's output directory.
17
+ *
18
+ * @module
19
+ */
20
+ import { execFileSync } from 'node:child_process';
21
+ import { existsSync } from 'node:fs';
22
+ import { join } from 'node:path';
23
+ /**
24
+ * Env var skipping the build, for iteration on a known-current binary: `1` or
25
+ * `true` skips it, any other value (`0`, `false`, empty) builds.
26
+ */
27
+ export const NO_REBUILD_ENV = 'FUZ_TESTING_NO_REBUILD';
28
+ /**
29
+ * Whether an `NO_REBUILD_ENV` value asks to skip the build — only an explicit
30
+ * `1` / `true`, so `FUZ_TESTING_NO_REBUILD=0` still builds.
31
+ *
32
+ * @param value - the variable's value, `undefined` when unset
33
+ */
34
+ export const is_no_rebuild_requested = (value) => value === '1' || value?.toLowerCase() === 'true';
35
+ /**
36
+ * The directory under the target directory a profile's output lands in —
37
+ * `debug` for `dev`, the profile's own name otherwise (`release`, a custom
38
+ * `cross-test`).
39
+ *
40
+ * @param profile - the Cargo profile
41
+ */
42
+ export const to_cargo_profile_dir = (profile) => profile === 'dev' ? 'debug' : profile;
43
+ /**
44
+ * The binary path `cargo build --profile <profile> --bin <bin>` writes, from
45
+ * `cargo metadata --no-deps --format-version 1` output.
46
+ *
47
+ * @param metadata_json - the `cargo metadata` output
48
+ * @param bin - the binary's name
49
+ * @param profile - the Cargo profile
50
+ * @returns the binary's absolute path
51
+ * @throws Error when the output carries no `target_directory`
52
+ */
53
+ export const to_cargo_binary_path = (metadata_json, bin, profile) => {
54
+ const metadata = JSON.parse(metadata_json);
55
+ if (typeof metadata.target_directory !== 'string' || !metadata.target_directory) {
56
+ throw new Error('`cargo metadata` output has no `target_directory`');
57
+ }
58
+ return join(metadata.target_directory, to_cargo_profile_dir(profile), bin);
59
+ };
60
+ /**
61
+ * Per-process memo of each workspace's target directory metadata. On
62
+ * `globalThis` rather than in module scope, so every project's `globalSetup` in
63
+ * one vitest process shares it whether or not they share this module's
64
+ * instance.
65
+ */
66
+ const CARGO_METADATA_MEMO_KEY = '__fuz_app_cargo_metadata_memo';
67
+ const get_metadata_memo = () => {
68
+ const holder = globalThis;
69
+ return (holder[CARGO_METADATA_MEMO_KEY] ??= new Map());
70
+ };
71
+ /**
72
+ * How long `cargo metadata` may take (ms). Usually well under a second, but
73
+ * the first run in a checkout can have rustup install the pinned toolchain.
74
+ */
75
+ const CARGO_METADATA_TIMEOUT_MS = 120_000;
76
+ /**
77
+ * Throw naming the workspace when its directory is missing — a spawn with a
78
+ * missing `cwd` otherwise fails as `spawnSync cargo ENOENT`, which reads as
79
+ * cargo not being installed.
80
+ */
81
+ const assert_workspace_dir = (workspace_dir) => {
82
+ if (!existsSync(workspace_dir)) {
83
+ throw new Error(`the Cargo workspace ${workspace_dir} does not exist`);
84
+ }
85
+ };
86
+ const read_cargo_metadata = (workspace_dir) => {
87
+ const memo = get_metadata_memo();
88
+ let metadata_json = memo.get(workspace_dir);
89
+ if (metadata_json === undefined) {
90
+ assert_workspace_dir(workspace_dir);
91
+ try {
92
+ metadata_json = execFileSync('cargo', ['metadata', '--no-deps', '--format-version', '1'], {
93
+ cwd: workspace_dir,
94
+ encoding: 'utf-8',
95
+ stdio: ['ignore', 'pipe', 'inherit'],
96
+ maxBuffer: 64 * 1024 * 1024,
97
+ timeout: CARGO_METADATA_TIMEOUT_MS
98
+ });
99
+ }
100
+ catch (error) {
101
+ const code = error.code;
102
+ throw new Error(code === 'ETIMEDOUT'
103
+ ? `\`cargo metadata\` in ${workspace_dir} took over ${CARGO_METADATA_TIMEOUT_MS}ms`
104
+ : `\`cargo metadata\` in ${workspace_dir} failed: ${error.message}`, { cause: error });
105
+ }
106
+ memo.set(workspace_dir, metadata_json);
107
+ }
108
+ return metadata_json;
109
+ };
110
+ /**
111
+ * The path of a Cargo-built binary, without building it — what a config's
112
+ * `start_command` names. Runs `cargo metadata` once per process per workspace,
113
+ * so it needs cargo on PATH.
114
+ *
115
+ * @param options - the workspace, package, binary and profile
116
+ * @returns the binary's absolute path
117
+ * @throws Error when the workspace is missing or `cargo metadata` fails
118
+ */
119
+ export const resolve_cargo_binary_path = (options) => {
120
+ const { workspace_dir, package: pkg, bin = pkg, profile = 'dev' } = options;
121
+ return to_cargo_binary_path(read_cargo_metadata(workspace_dir), bin, profile);
122
+ };
123
+ /**
124
+ * Build a Cargo binary before its backend spawns, unless `NO_REBUILD_ENV`
125
+ * asks to skip it, and return its path. The build's output is inherited, so a
126
+ * cold build shows its progress, and a failed build throws — the project fails
127
+ * loudly rather than spawning a stale binary. `cargo build` is incremental, so
128
+ * a build with nothing changed is quick.
129
+ *
130
+ * Synchronous: vitest awaits each project's `globalSetup` in turn, so one
131
+ * invocation selecting several projects builds once, then finds the build
132
+ * current.
133
+ *
134
+ * @param options - the workspace, package, binary and profile
135
+ * @returns the binary's absolute path (`resolve_cargo_binary_path`)
136
+ * @throws Error when the workspace is missing, the build fails, or `cargo metadata` fails
137
+ */
138
+ export const prepare_cargo_binary = (options) => {
139
+ const { workspace_dir, package: pkg, bin = pkg, profile = 'dev' } = options;
140
+ if (!is_no_rebuild_requested(process.env[NO_REBUILD_ENV])) {
141
+ assert_workspace_dir(workspace_dir);
142
+ execFileSync('cargo', ['build', '-p', pkg, '--bin', bin, '--profile', profile], {
143
+ cwd: workspace_dir,
144
+ stdio: 'inherit'
145
+ });
146
+ }
147
+ return resolve_cargo_binary_path(options);
148
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"cell_crud.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/cell_crud.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA6D9B,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,YAAY,CAAC;AAG1E,eAAO,MAAM,8BAA8B,GAC1C,SAAS,uCAAuC,KAC9C,IAggBF,CAAC"}
1
+ {"version":3,"file":"cell_crud.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/cell_crud.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAiE9B,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,YAAY,CAAC;AAG1E,eAAO,MAAM,8BAA8B,GAC1C,SAAS,uCAAuC,KAC9C,IA6lBF,CAAC"}