@fuzdev/fuz_app 0.162.0 → 0.164.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 (280) hide show
  1. package/README.md +2 -1
  2. package/dist/actions/action_event_data.d.ts +1 -1
  3. package/dist/actions/action_rpc.d.ts.map +1 -1
  4. package/dist/actions/action_rpc.js +4 -0
  5. package/dist/actions/action_spec.d.ts +3 -3
  6. package/dist/actions/action_spec.d.ts.map +1 -1
  7. package/dist/auth/CLAUDE.md +39 -36
  8. package/dist/auth/account_action_specs.d.ts +441 -115
  9. package/dist/auth/account_action_specs.d.ts.map +1 -1
  10. package/dist/auth/account_action_specs.js +47 -46
  11. package/dist/auth/account_route_schema.d.ts +98 -62
  12. package/dist/auth/account_route_schema.d.ts.map +1 -1
  13. package/dist/auth/account_route_schema.js +45 -45
  14. package/dist/auth/account_routes.js +1 -1
  15. package/dist/auth/account_schema.d.ts +54 -27
  16. package/dist/auth/account_schema.d.ts.map +1 -1
  17. package/dist/auth/account_schema.js +16 -18
  18. package/dist/auth/admin_action_specs.d.ts +76 -76
  19. package/dist/auth/admin_action_specs.js +2 -4
  20. package/dist/auth/admin_actions.d.ts +4 -4
  21. package/dist/auth/admin_actions.d.ts.map +1 -1
  22. package/dist/auth/admin_actions.js +3 -3
  23. package/dist/auth/all_cell_actions.d.ts +3 -3
  24. package/dist/auth/all_cell_actions.d.ts.map +1 -1
  25. package/dist/auth/all_cell_actions.js +1 -1
  26. package/dist/auth/api_token.d.ts +4 -4
  27. package/dist/auth/api_token.d.ts.map +1 -1
  28. package/dist/auth/api_token.js +3 -3
  29. package/dist/auth/audit_log_route_schema.d.ts +1 -1
  30. package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
  31. package/dist/auth/audit_log_route_schema.js +4 -5
  32. package/dist/auth/audit_log_schema.d.ts +46 -66
  33. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  34. package/dist/auth/audit_log_schema.js +34 -30
  35. package/dist/auth/bootstrap_route_schema.d.ts +146 -52
  36. package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
  37. package/dist/auth/bootstrap_route_schema.js +33 -19
  38. package/dist/auth/cell_grant_action_specs.d.ts +1 -1
  39. package/dist/auth/cell_grant_action_specs.js +1 -1
  40. package/dist/auth/cell_grant_actions.d.ts +4 -4
  41. package/dist/auth/cell_grant_actions.d.ts.map +1 -1
  42. package/dist/auth/cell_grant_actions.js +1 -1
  43. package/dist/auth/credential_type_schema.d.ts +16 -29
  44. package/dist/auth/credential_type_schema.d.ts.map +1 -1
  45. package/dist/auth/credential_type_schema.js +14 -18
  46. package/dist/auth/daemon_token.d.ts +4 -4
  47. package/dist/auth/daemon_token.d.ts.map +1 -1
  48. package/dist/auth/daemon_token.js +3 -3
  49. package/dist/auth/daemon_token_middleware.d.ts +1 -1
  50. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  51. package/dist/auth/daemon_token_middleware.js +5 -5
  52. package/dist/auth/grant_path_schema.d.ts +15 -29
  53. package/dist/auth/grant_path_schema.d.ts.map +1 -1
  54. package/dist/auth/grant_path_schema.js +13 -17
  55. package/dist/auth/middleware.js +4 -4
  56. package/dist/auth/migrations.js +1 -1
  57. package/dist/auth/name_schema.d.ts +7 -6
  58. package/dist/auth/name_schema.d.ts.map +1 -1
  59. package/dist/auth/name_schema.js +8 -9
  60. package/dist/auth/password.d.ts +15 -7
  61. package/dist/auth/password.d.ts.map +1 -1
  62. package/dist/auth/password.js +16 -9
  63. package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
  64. package/dist/auth/role_grant_offer_action_specs.js +2 -2
  65. package/dist/auth/role_grant_offer_actions.d.ts +4 -4
  66. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  67. package/dist/auth/role_grant_offer_actions.js +3 -3
  68. package/dist/auth/role_grant_offer_notifications.js +2 -2
  69. package/dist/auth/role_grant_offer_schema.d.ts +2 -2
  70. package/dist/auth/role_grant_offer_schema.js +2 -2
  71. package/dist/auth/role_schema.d.ts +47 -55
  72. package/dist/auth/role_schema.d.ts.map +1 -1
  73. package/dist/auth/role_schema.js +29 -35
  74. package/dist/auth/scope_kind_schema.d.ts +22 -26
  75. package/dist/auth/scope_kind_schema.d.ts.map +1 -1
  76. package/dist/auth/scope_kind_schema.js +19 -19
  77. package/dist/auth/self_service_role_action_specs.js +1 -1
  78. package/dist/auth/self_service_role_actions.d.ts +6 -6
  79. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  80. package/dist/auth/self_service_role_actions.js +7 -6
  81. package/dist/auth/signup_route_schema.d.ts +71 -21
  82. package/dist/auth/signup_route_schema.d.ts.map +1 -1
  83. package/dist/auth/signup_route_schema.js +17 -19
  84. package/dist/auth/standard_rpc_actions.d.ts +1 -1
  85. package/dist/auth/standard_rpc_actions.js +1 -1
  86. package/dist/auth/token_lifetime.d.ts +33 -9
  87. package/dist/auth/token_lifetime.d.ts.map +1 -1
  88. package/dist/auth/token_lifetime.js +8 -7
  89. package/dist/auth/token_scope.d.ts +99 -25
  90. package/dist/auth/token_scope.d.ts.map +1 -1
  91. package/dist/auth/token_scope.js +57 -35
  92. package/dist/db/CLAUDE.md +2 -1
  93. package/dist/db/file_fact_url.d.ts +11 -6
  94. package/dist/db/file_fact_url.d.ts.map +1 -1
  95. package/dist/db/file_fact_url.js +5 -5
  96. package/dist/db/schema_ready.d.ts +0 -5
  97. package/dist/db/schema_ready.d.ts.map +1 -1
  98. package/dist/db/schema_ready.js +0 -5
  99. package/dist/http/CLAUDE.md +104 -71
  100. package/dist/http/auth_shape.d.ts +48 -29
  101. package/dist/http/auth_shape.d.ts.map +1 -1
  102. package/dist/http/auth_shape.js +12 -85
  103. package/dist/http/body_limit.d.ts +12 -0
  104. package/dist/http/body_limit.d.ts.map +1 -1
  105. package/dist/http/body_limit.js +15 -0
  106. package/dist/http/body_limit_schema.d.ts +20 -0
  107. package/dist/http/body_limit_schema.d.ts.map +1 -0
  108. package/dist/http/body_limit_schema.js +20 -0
  109. package/dist/http/common_routes.d.ts +1 -1
  110. package/dist/http/common_routes.d.ts.map +1 -1
  111. package/dist/http/common_routes.js +11 -14
  112. package/dist/http/db_routes.d.ts.map +1 -1
  113. package/dist/http/db_routes.js +59 -69
  114. package/dist/http/dev_route_error_check.d.ts +70 -0
  115. package/dist/http/dev_route_error_check.d.ts.map +1 -0
  116. package/dist/http/dev_route_error_check.js +119 -0
  117. package/dist/http/error_schemas.d.ts +365 -189
  118. package/dist/http/error_schemas.d.ts.map +1 -1
  119. package/dist/http/error_schemas.js +256 -149
  120. package/dist/http/health_schema.d.ts +10 -6
  121. package/dist/http/health_schema.d.ts.map +1 -1
  122. package/dist/http/health_schema.js +3 -3
  123. package/dist/http/middleware_spec.d.ts +8 -3
  124. package/dist/http/middleware_spec.d.ts.map +1 -1
  125. package/dist/http/origin.d.ts +12 -43
  126. package/dist/http/origin.d.ts.map +1 -1
  127. package/dist/http/origin.js +10 -6
  128. package/dist/http/route_error_check.d.ts +158 -0
  129. package/dist/http/route_error_check.d.ts.map +1 -0
  130. package/dist/http/route_error_check.js +247 -0
  131. package/dist/http/route_errors.d.ts +80 -0
  132. package/dist/http/route_errors.d.ts.map +1 -0
  133. package/dist/http/route_errors.js +83 -0
  134. package/dist/http/route_spec.d.ts +33 -17
  135. package/dist/http/route_spec.d.ts.map +1 -1
  136. package/dist/http/route_spec.js +48 -62
  137. package/dist/http/schema_helpers.d.ts +0 -33
  138. package/dist/http/schema_helpers.d.ts.map +1 -1
  139. package/dist/http/schema_helpers.js +0 -45
  140. package/dist/http/surface.d.ts +19 -12
  141. package/dist/http/surface.d.ts.map +1 -1
  142. package/dist/http/surface.js +25 -38
  143. package/dist/http/surface_query.d.ts +11 -2
  144. package/dist/http/surface_query.d.ts.map +1 -1
  145. package/dist/http/surface_query.js +7 -1
  146. package/dist/primitive_schemas.d.ts +2 -19
  147. package/dist/primitive_schemas.d.ts.map +1 -1
  148. package/dist/primitive_schemas.js +2 -20
  149. package/dist/primitive_schemas_fuz.d.ts +39 -5
  150. package/dist/primitive_schemas_fuz.d.ts.map +1 -1
  151. package/dist/primitive_schemas_fuz.js +36 -7
  152. package/dist/rate_limiter.d.ts +13 -0
  153. package/dist/rate_limiter.d.ts.map +1 -1
  154. package/dist/rate_limiter.js +20 -2
  155. package/dist/schema_issues.d.ts +29 -11
  156. package/dist/schema_issues.d.ts.map +1 -1
  157. package/dist/schema_issues.js +11 -10
  158. package/dist/schema_meta.d.ts +8 -1
  159. package/dist/schema_meta.d.ts.map +1 -1
  160. package/dist/schema_meta.js +2 -1
  161. package/dist/server/app_server.d.ts +3 -1
  162. package/dist/server/app_server.d.ts.map +1 -1
  163. package/dist/server/app_server.js +24 -10
  164. package/dist/server/serve_fact_route.d.ts.map +1 -1
  165. package/dist/server/serve_fact_route.js +8 -31
  166. package/dist/server/surface_route.d.ts.map +1 -1
  167. package/dist/server/surface_route.js +5 -6
  168. package/dist/server/x_accel.d.ts +12 -7
  169. package/dist/server/x_accel.d.ts.map +1 -1
  170. package/dist/server/x_accel.js +7 -9
  171. package/dist/testing/CLAUDE.md +55 -44
  172. package/dist/testing/admin_integration.d.ts +3 -3
  173. package/dist/testing/admin_integration.d.ts.map +1 -1
  174. package/dist/testing/admin_integration.js +2 -2
  175. package/dist/testing/adversarial_404.d.ts +4 -18
  176. package/dist/testing/adversarial_404.d.ts.map +1 -1
  177. package/dist/testing/adversarial_404.js +19 -51
  178. package/dist/testing/adversarial_headers.d.ts +3 -4
  179. package/dist/testing/adversarial_headers.d.ts.map +1 -1
  180. package/dist/testing/adversarial_headers.js +8 -6
  181. package/dist/testing/adversarial_input.d.ts.map +1 -1
  182. package/dist/testing/adversarial_input.js +18 -17
  183. package/dist/testing/assertions.d.ts +33 -11
  184. package/dist/testing/assertions.d.ts.map +1 -1
  185. package/dist/testing/assertions.js +52 -12
  186. package/dist/testing/attack_surface.d.ts +5 -35
  187. package/dist/testing/attack_surface.d.ts.map +1 -1
  188. package/dist/testing/attack_surface.js +29 -91
  189. package/dist/testing/auth_apps.d.ts.map +1 -1
  190. package/dist/testing/auth_apps.js +2 -1
  191. package/dist/testing/cross_backend/action_manifest.d.ts +126 -56
  192. package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
  193. package/dist/testing/cross_backend/action_manifest.js +11 -11
  194. package/dist/testing/cross_backend/action_manifest_parity.d.ts +1 -1
  195. package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
  196. package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
  197. package/dist/testing/cross_backend/cell_crud.js +2 -1
  198. package/dist/testing/cross_backend/conformance_table.js +1 -1
  199. package/dist/testing/cross_backend/default_spine_surface.d.ts +2 -2
  200. package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
  201. package/dist/testing/cross_backend/default_spine_surface.js +2 -2
  202. package/dist/testing/cross_backend/fact_serving.js +3 -3
  203. package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
  204. package/dist/testing/cross_backend/identity_parity.js +39 -6
  205. package/dist/testing/cross_backend/origin_conformance.d.ts +278 -102
  206. package/dist/testing/cross_backend/origin_conformance.d.ts.map +1 -1
  207. package/dist/testing/cross_backend/origin_conformance.js +21 -21
  208. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +3 -3
  209. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
  210. package/dist/testing/cross_backend/rust_spine_consumer_surface.js +7 -1
  211. package/dist/testing/cross_backend/setup.d.ts +14 -1
  212. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  213. package/dist/testing/cross_backend/setup.js +68 -48
  214. package/dist/testing/cross_backend/spine_suites.d.ts +3 -3
  215. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  216. package/dist/testing/cross_backend/standard.d.ts +4 -4
  217. package/dist/testing/cross_backend/standard.d.ts.map +1 -1
  218. package/dist/testing/cross_backend/testing_origin_check.d.ts +147 -71
  219. package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
  220. package/dist/testing/cross_backend/testing_origin_check.js +16 -13
  221. package/dist/testing/cross_backend/testing_reset_actions.d.ts +70 -27
  222. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  223. package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
  224. package/dist/testing/cross_backend/token_lifetime.js +34 -1
  225. package/dist/testing/data_exposure.d.ts.map +1 -1
  226. package/dist/testing/data_exposure.js +5 -4
  227. package/dist/testing/error_coverage.d.ts +24 -34
  228. package/dist/testing/error_coverage.d.ts.map +1 -1
  229. package/dist/testing/error_coverage.js +46 -89
  230. package/dist/testing/integration.d.ts.map +1 -1
  231. package/dist/testing/integration.js +6 -14
  232. package/dist/testing/integration_helpers.d.ts +37 -9
  233. package/dist/testing/integration_helpers.d.ts.map +1 -1
  234. package/dist/testing/integration_helpers.js +86 -40
  235. package/dist/testing/middleware.d.ts +3 -5
  236. package/dist/testing/middleware.d.ts.map +1 -1
  237. package/dist/testing/middleware.js +5 -4
  238. package/dist/testing/rate_limiting.d.ts +1 -1
  239. package/dist/testing/rate_limiting.d.ts.map +1 -1
  240. package/dist/testing/rate_limiting.js +5 -4
  241. package/dist/testing/round_trip.d.ts.map +1 -1
  242. package/dist/testing/round_trip.js +5 -3
  243. package/dist/testing/schema_generators.d.ts +10 -3
  244. package/dist/testing/schema_generators.d.ts.map +1 -1
  245. package/dist/testing/schema_generators.js +23 -11
  246. package/dist/testing/stubs.d.ts +10 -1
  247. package/dist/testing/stubs.d.ts.map +1 -1
  248. package/dist/testing/stubs.js +15 -5
  249. package/dist/testing/surface_invariants.d.ts +36 -115
  250. package/dist/testing/surface_invariants.d.ts.map +1 -1
  251. package/dist/testing/surface_invariants.js +106 -269
  252. package/dist/testing/token_scope_fixtures.d.ts +24 -0
  253. package/dist/testing/token_scope_fixtures.d.ts.map +1 -0
  254. package/dist/testing/token_scope_fixtures.js +49 -0
  255. package/dist/testing/transports/bootstrap.d.ts +1 -1
  256. package/dist/testing/transports/bootstrap.d.ts.map +1 -1
  257. package/dist/testing/transports/bootstrap.js +13 -12
  258. package/dist/ui/BootstrapForm.svelte +4 -2
  259. package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
  260. package/dist/ui/CLAUDE.md +4 -2
  261. package/dist/ui/SignupForm.svelte +4 -2
  262. package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
  263. package/dist/ui/auth_state.svelte.d.ts.map +1 -1
  264. package/dist/ui/auth_state.svelte.js +2 -8
  265. package/dist/ui/backend_probe.svelte.js +3 -3
  266. package/dist/ui/table_state.svelte.d.ts.map +1 -1
  267. package/dist/ui/table_state.svelte.js +1 -8
  268. package/dist/ui/ui_fetch.d.ts +12 -2
  269. package/dist/ui/ui_fetch.d.ts.map +1 -1
  270. package/dist/ui/ui_fetch.js +22 -4
  271. package/package.json +1 -1
  272. package/dist/auth/audit_log_schema_fuz.d.ts +0 -53
  273. package/dist/auth/audit_log_schema_fuz.d.ts.map +0 -1
  274. package/dist/auth/audit_log_schema_fuz.js +0 -50
  275. package/dist/auth/role_schema_fuz.d.ts +0 -30
  276. package/dist/auth/role_schema_fuz.d.ts.map +0 -1
  277. package/dist/auth/role_schema_fuz.js +0 -30
  278. package/dist/auth/scope_kind_schema_fuz.d.ts +0 -31
  279. package/dist/auth/scope_kind_schema_fuz.d.ts.map +0 -1
  280. package/dist/auth/scope_kind_schema_fuz.js +0 -31
@@ -8,7 +8,8 @@
8
8
  * `invalid_reason` and `empty_input_handler_guarded` to fuz_schema's
9
9
  * `SchemaMeta`, so the declared refusal reason of an action input, its
10
10
  * handler-guarded marker, and its sensitivity read the same whichever library
11
- * its schema is.
11
+ * its schema is. It also adds JSON Schema's `readOnly` annotation, which
12
+ * `to_json_schema` writes onto the node.
12
13
  *
13
14
  * @module
14
15
  */
@@ -200,7 +200,9 @@ export interface AppServerOptions {
200
200
  * (anything else throws at assembly). Omit or `undefined` to use the
201
201
  * default (1 MiB). Pass `null` to explicitly disable body size limiting,
202
202
  * which adds a security warning to the surface's diagnostics (logged at
203
- * startup).
203
+ * startup). The limit is mounted as a middleware spec at `'*'` ahead of
204
+ * the others (`create_body_limit_middleware_spec`), so every route's
205
+ * error map declares its `413` and `400`; with `null` it is absent.
204
206
  */
205
207
  max_body_size?: number | null;
206
208
  /** Daemon token state for keeper auth. Omit to disable. */
@@ -1 +1 @@
1
- {"version":3,"file":"app_server.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/app_server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,KAAK,OAAO,EAA0B,MAAM,MAAM,CAAC;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAIN,KAAK,WAAW,EAChB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACN,WAAW,EAMX,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGhF,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,eAAe,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AAC;IACnC,2DAA2D;IAC3D,aAAa,EAAE,MAAM,CAAC,uBAAuB,EAAE,WAAW,GAAG,IAAI,CAAC,CAAC;IACnE,uFAAuF;IACvF,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACzC;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GACtC,OAAO,sBAAsB,KAC3B,KAAK,CAAC,oBAAoB,CA0D5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,iBAAiB,GAAU,SAAS,gBAAgB,KAAG,OAAO,CAAC,SAAS,CAQpF,CAAC"}
@@ -21,6 +21,7 @@ import { create_static_middleware } from './static.js';
21
21
  import { log_startup_summary } from './startup.js';
22
22
  import { create_app_error_handler } from './app_error_handler.js';
23
23
  import { create_app_surface_spec } from '../http/surface.js';
24
+ import { create_dev_route_error_check } from '../http/dev_route_error_check.js';
24
25
  import { apply_middleware_specs, apply_route_specs, prefix_route_specs } from '../http/route_spec.js';
25
26
  import { check_bootstrap_status, create_bootstrap_route_specs } from '../auth/bootstrap_routes.js';
26
27
  import { create_surface_route_spec } from './surface_route.js';
@@ -28,7 +29,7 @@ import { flush_request_effects } from '../http/pending_effects.js';
28
29
  import { assert_credential_routes_in_auth_scope, assert_endpoint_in_auth_scope, assert_middleware_stack_mounted, create_auth_middleware_specs } from '../auth/middleware.js';
29
30
  import { fuz_auth_guard_resolver } from '../auth/auth_guard_resolver.js';
30
31
  import { create_fuz_authorization_handler } from '../auth/request_context.js';
31
- import { create_body_limit_middleware } from '../http/body_limit.js';
32
+ import { create_body_limit_middleware_spec } from '../http/body_limit.js';
32
33
  import { admit_origin_wildcards, ALLOWED_ORIGINS_VAR } from '../http/origin_wildcard.js';
33
34
  import { create_rpc_endpoint } from '../actions/action_rpc.js';
34
35
  import { register_action_ws } from '../actions/register_action_ws.js';
@@ -277,10 +278,11 @@ const assemble_app_server = async (options, releases) => {
277
278
  log.warn(`${ALLOWED_ORIGINS_VAR}: ${warning} (origin ${entry})`);
278
279
  }
279
280
  // body size limit — rejects oversized payloads before auth/validation; the
280
- // middleware throws on a cap that is not a safe integer 0 or more
281
- const body_limit_middleware = options.max_body_size === null
281
+ // middleware throws on a cap that is not a safe integer 0 or more. A spec,
282
+ // so the surface and each route's error map declare its 413 and 400.
283
+ const body_limit_spec = options.max_body_size === null
282
284
  ? null
283
- : create_body_limit_middleware(options.max_body_size ?? DEFAULT_BODY_LIMIT_BYTES);
285
+ : create_body_limit_middleware_spec(options.max_body_size ?? DEFAULT_BODY_LIMIT_BYTES);
284
286
  // Rate limiters — the ones built here are the server's to dispose, on
285
287
  // close or when assembly fails.
286
288
  const { mode: rate_limiter_mode, limiters: rate_limiters, built: built_rate_limiters } = resolve_rate_limiters(options);
@@ -471,10 +473,13 @@ const assemble_app_server = async (options, releases) => {
471
473
  seen_paths.add(endpoint.path);
472
474
  }
473
475
  }
474
- // Surface + logging
475
- const surface_middleware = options.post_route_middleware
476
- ? [...middleware_specs, ...options.post_route_middleware]
477
- : middleware_specs;
476
+ // Surface + logging — the body limit first, where it runs, ahead of the
477
+ // middleware specs
478
+ const surface_middleware = [
479
+ ...(body_limit_spec ? [body_limit_spec] : []),
480
+ ...middleware_specs,
481
+ ...(options.post_route_middleware ?? [])
482
+ ];
478
483
  const all_event_specs = [
479
484
  ...(options.event_specs ?? []),
480
485
  ...(audit_sse ? audit_log_event_specs : [])
@@ -506,6 +511,15 @@ const assemble_app_server = async (options, releases) => {
506
511
  // above all — answers here: 503 for a failed pool checkout, Hono's default
507
512
  // 500 for anything else.
508
513
  app.onError(create_app_error_handler(log));
514
+ // DEV only, and outermost, so it sees what every layer answers: logs a JSON
515
+ // error at a status its route's error map doesn't declare, or off its schema
516
+ const dev_route_error_check = create_dev_route_error_check({
517
+ route_specs,
518
+ route_error_maps: surface_spec.route_error_maps,
519
+ log
520
+ });
521
+ if (dev_route_error_check)
522
+ app.use('*', dev_route_error_check);
509
523
  // Two-queue side-effect flush. `pending_effects` collects eager
510
524
  // fire-and-forget promises (audit emits, api-token usage). `post_commit_effects` collects deferred thunks pushed via
511
525
  // `emit_after_commit` (WS notifications, anything that must observe a
@@ -545,8 +559,8 @@ const assemble_app_server = async (options, releases) => {
545
559
  app.use(logger((msg) => log.info(msg)));
546
560
  }
547
561
  // body size limit, built with the option checks above
548
- if (body_limit_middleware) {
549
- app.use(body_limit_middleware);
562
+ if (body_limit_spec) {
563
+ apply_middleware_specs(app, [body_limit_spec]);
550
564
  }
551
565
  apply_middleware_specs(app, middleware_specs);
552
566
  const authorize = create_fuz_authorization_handler({ db: deps.db });
@@ -1 +1 @@
1
- {"version":3,"file":"serve_fact_route.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/serve_fact_route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmIG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAgBtD,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAU5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAoCjD,MAAM,WAAW,+BAA+B;IAC/C,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACZ;AAkJD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iCAAiC,GAC7C,SAAS,+BAA+B,KACtC,SA0DF,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,+BAA+B,KACtC,SA+CF,CAAC"}
1
+ {"version":3,"file":"serve_fact_route.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/serve_fact_route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmIG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AActD,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQ5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAkBjD,MAAM,WAAW,+BAA+B;IAC/C,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACZ;AAkJD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iCAAiC,GAC7C,SAAS,+BAA+B,KACtC,SAyDF,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,+BAA+B,KACtC,SA8CF,CAAC"}
@@ -133,16 +133,12 @@
133
133
  import { open } from 'node:fs/promises';
134
134
  import { Readable } from 'node:stream';
135
135
  import { join } from 'node:path';
136
- import { FactHashSchema, Uuid } from '../primitive_schemas.js';
137
- import { ActingActor } from '../primitive_schemas_fuz.js';
138
- import { z } from 'zod';
139
- import { object } from '@fuzdev/fuz_schema/schema.ts';
136
+ import { ActingActor, FactHashSchema, Uuid } from '../primitive_schemas_fuz.js';
137
+ import { literal, object } from '@fuzdev/fuz_schema/schema.ts';
140
138
  import { build_request_context, get_public_account_id, get_request_context, has_scoped_role } from '../auth/request_context.js';
141
139
  import { ROLE_ADMIN } from '../auth/role_schema.js';
142
140
  import { query_active_actors_by_account } from '../auth/account_queries.js';
143
141
  import { get_route_params } from '../http/route_spec.js';
144
- import { ERROR_INVALID_ROUTE_PARAMS } from '../http/error_schemas.js';
145
- import { WireIssue } from '../schema_issues.js';
146
142
  import { query_get_fact, query_get_fact_meta } from '../db/fact_queries.js';
147
143
  import { to_uint8 } from '../db/fact_store.js';
148
144
  import { query_cell_get } from '../db/cell_queries.js';
@@ -157,30 +153,13 @@ import { FACT_CACHE_CONTROL, FACT_SECURITY_HEADERS } from './fact_security_heade
157
153
  * standard params-validation error shape (`ERROR_INVALID_ROUTE_PARAMS`),
158
154
  * which the round-trip validator expects.
159
155
  */
160
- const bare_hash_params_schema = z.strictObject({
161
- hash: FactHashSchema
162
- });
156
+ const bare_hash_params_schema = object({ hash: FactHashSchema });
163
157
  /**
164
158
  * Path-param schema for the cell-scoped route. `cell_id` validates as a
165
159
  * `Uuid`; `hash` as the canonical fact-hash form. Malformed values 400 via
166
160
  * the standard params-validation shape.
167
161
  */
168
- const cell_fact_params_schema = z.strictObject({
169
- cell_id: Uuid,
170
- hash: FactHashSchema
171
- });
172
- /**
173
- * Shared error-schema entry: tighten the auto-derived 400 to the literal
174
- * emitted by params validation. `issues` is optional because the framework
175
- * emits it through `dev_only` — a production body carries the `error`
176
- * literal alone.
177
- */
178
- const params_400_error = {
179
- 400: z.looseObject({
180
- error: z.literal(ERROR_INVALID_ROUTE_PARAMS),
181
- issues: z.array(WireIssue).optional()
182
- })
183
- };
162
+ const cell_fact_params_schema = object({ cell_id: Uuid, hash: FactHashSchema });
184
163
  /**
185
164
  * Serve a fact's bytes by hash, after the caller has been authorized for it.
186
165
  *
@@ -325,10 +304,9 @@ export const create_serve_cell_fact_route_spec = (options) => {
325
304
  reads_credential: true,
326
305
  description: "Serve content-addressed fact bytes through a named referencing cell. 404 unless the cell admits the caller via can_view_cell (or the steward arm: the governing root's manager reading a pending or rejected contribution) AND references the hash (per-reference, never union-of-referrers).",
327
306
  params: cell_fact_params_schema,
328
- input: z.null(),
307
+ input: literal(null),
329
308
  // The body is a binary stream; no JSON output schema applies.
330
- output: z.null(),
331
- errors: params_400_error,
309
+ output: literal(null),
332
310
  handler: async (c, route) => {
333
311
  const { cell_id, hash } = get_route_params(c);
334
312
  // Resolve the named cell. Missing / soft-deleted → 404 (masked).
@@ -409,10 +387,9 @@ export const create_serve_fact_route_spec = (options) => {
409
387
  // invariant 2 requires the `acting?` slot. On a GET it lives on
410
388
  // `query` (a multi-actor admin disambiguates via `?acting=<actor>`).
411
389
  query: object({ acting: ActingActor }),
412
- input: z.null(),
390
+ input: literal(null),
413
391
  // The body is a binary stream; no JSON output schema applies.
414
- output: z.null(),
415
- errors: params_400_error,
392
+ output: literal(null),
416
393
  handler: async (c, route) => {
417
394
  const { hash } = get_route_params(c);
418
395
  // Defense-in-depth: the auth phase already gated this on the admin
@@ -1 +1 @@
1
- {"version":3,"file":"surface_route.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/surface_route.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IACnC,2GAA2G;IAC3G,OAAO,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,mBAAmB,KAAG,SAmBvE,CAAC"}
1
+ {"version":3,"file":"surface_route.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/surface_route.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IACnC,2GAA2G;IAC3G,OAAO,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,mBAAmB,KAAG,SAmBvE,CAAC"}
@@ -7,8 +7,7 @@
7
7
  *
8
8
  * @module
9
9
  */
10
- import { z } from 'zod';
11
- import { object } from '@fuzdev/fuz_schema/schema.ts';
10
+ import { array, literal, loose_object, object } from '@fuzdev/fuz_schema/schema.ts';
12
11
  import { ActingActor } from '../primitive_schemas_fuz.js';
13
12
  import { ROLE_ADMIN } from '../auth/role_schema.js';
14
13
  /**
@@ -39,9 +38,9 @@ export const create_surface_route_spec = (options) => ({
39
38
  handler: (c) => c.json(options.surface),
40
39
  description: 'Application surface (routes, middleware, schemas) — admin only',
41
40
  query: object({ acting: ActingActor }),
42
- input: z.null(),
43
- output: z.looseObject({
44
- routes: z.array(z.looseObject({})),
45
- middleware: z.array(z.looseObject({}))
41
+ input: literal(null),
42
+ output: loose_object({
43
+ routes: array(loose_object({})),
44
+ middleware: array(loose_object({}))
46
45
  })
47
46
  });
@@ -122,7 +122,7 @@
122
122
  *
123
123
  * @module
124
124
  */
125
- import { z } from 'zod';
125
+ import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
126
126
  /** Result of the facts-location check. */
127
127
  export interface NginxFactsValidation {
128
128
  /** `true` when every rule passes. */
@@ -149,13 +149,18 @@ export declare const validate_facts_internal_location: (config: string, facts_lo
149
149
  * X-Accel serving is impossible to enable without proving at boot that the
150
150
  * facts location is `internal;` and carries the fact hardening headers — a
151
151
  * public facts location would bypass every cell-visibility check. A
152
- * Zod-branded type: the brand can't be forged without an explicit cast, so the
153
- * factory is the only ordinary construction path.
152
+ * branded `@fuzdev/fuz_schema` `object`: the brand can't be forged without an
153
+ * explicit cast, so the factory is the only ordinary construction path.
154
154
  */
155
- export declare const XAccelConfig: z.core.$ZodBranded<z.ZodObject<{
156
- redirect_prefix: z.ZodString;
157
- }, z.core.$strict>, "XAccelConfig", "out">;
158
- export type XAccelConfig = z.infer<typeof XAccelConfig>;
155
+ export declare const XAccelConfig: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<{
156
+ redirect_prefix: string;
157
+ }, "XAccelConfig">, {
158
+ redirect_prefix: string;
159
+ }, "object", {
160
+ /** The validated redirect prefix the serving path prepends (e.g. `/_facts/`). */
161
+ redirect_prefix: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
162
+ }>;
163
+ export type XAccelConfig = Infer<typeof XAccelConfig>;
159
164
  /**
160
165
  * A misconfigured X-Accel facts location — a fail-loud boot error thrown by
161
166
  * `create_x_accel_config`.
@@ -1 +1 @@
1
- {"version":3,"file":"x_accel.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/x_accel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,0CAA0C;AAC1C,MAAM,WAAW,oBAAoB;IACpC,qCAAqC;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,wDAAwD;IACxD,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC,GAC5C,QAAQ,MAAM,EACd,gBAAgB,MAAM,KACpB,oBAYF,CAAC;AA+IF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY;;0CAKF,CAAC;AACxB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;gBACnB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;CAKjC;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,GACjC,iBAAiB,MAAM,EACvB,cAAc,MAAM,KAClB,YAMF,CAAC"}
1
+ {"version":3,"file":"x_accel.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/x_accel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AAEH,OAAO,EAAyC,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAIjG,0CAA0C;AAC1C,MAAM,WAAW,oBAAoB;IACpC,qCAAqC;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,wDAAwD;IACxD,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC,GAC5C,QAAQ,MAAM,EACd,gBAAgB,MAAM,KACpB,oBAYF,CAAC;AA+IF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY;;;;;IAEvB,iFAAiF;;EAIlF,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAEtD;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;gBACnB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;CAKjC;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,GACjC,iBAAiB,MAAM,EACvB,cAAc,MAAM,KAClB,YAMF,CAAC"}
@@ -122,7 +122,7 @@
122
122
  *
123
123
  * @module
124
124
  */
125
- import { z } from 'zod';
125
+ import { brand, object, parse_or_throw, string } from '@fuzdev/fuz_schema/schema.ts';
126
126
  import { FACT_SECURITY_HEADERS, fact_security_header_directives } from './fact_security_headers.js';
127
127
  /**
128
128
  * Assert the nginx config serves the X-Accel facts prefix only from `internal;`
@@ -275,15 +275,13 @@ const collect_errors = (config, facts_location) => {
275
275
  * X-Accel serving is impossible to enable without proving at boot that the
276
276
  * facts location is `internal;` and carries the fact hardening headers — a
277
277
  * public facts location would bypass every cell-visibility check. A
278
- * Zod-branded type: the brand can't be forged without an explicit cast, so the
279
- * factory is the only ordinary construction path.
278
+ * branded `@fuzdev/fuz_schema` `object`: the brand can't be forged without an
279
+ * explicit cast, so the factory is the only ordinary construction path.
280
280
  */
281
- export const XAccelConfig = z
282
- .strictObject({
281
+ export const XAccelConfig = brand(object({
283
282
  /** The validated redirect prefix the serving path prepends (e.g. `/_facts/`). */
284
- redirect_prefix: z.string()
285
- })
286
- .brand('XAccelConfig');
283
+ redirect_prefix: string
284
+ }), 'XAccelConfig');
287
285
  /**
288
286
  * A misconfigured X-Accel facts location — a fail-loud boot error thrown by
289
287
  * `create_x_accel_config`.
@@ -317,7 +315,7 @@ export const create_x_accel_config = (redirect_prefix, nginx_config) => {
317
315
  if (!validation.ok) {
318
316
  throw new XAccelConfigError(validation.errors);
319
317
  }
320
- return XAccelConfig.parse({ redirect_prefix });
318
+ return parse_or_throw(XAccelConfig, { redirect_prefix });
321
319
  };
322
320
  /** Strip every trailing `/` so `/_facts/` and `/_facts` compare equal. */
323
321
  const trim_trailing_slashes = (value) => value.replace(/\/+$/, '');
@@ -38,7 +38,7 @@ time (never runtime), where a throwing guard would break `vite build`.
38
38
  - `create_stub_api_middleware({include_daemon_token?, origin_carve_outs?})` — stub `MiddlewareSpec[]` matching `create_auth_middleware_specs`'s output (origin, optional daemon_token, session, request_context, bearer_auth) for surface generation without booting real auth — the same names, paths, order, and declared `errors` (`origin` declares a 403; `bearer_auth` and `daemon_token` declare none, since both soft-fail through `next()`), pinned against the real factory by `auth/middleware.mounted.test.ts`. The surface merges middleware errors into every route under the path, so a stub declaring more would widen the test surface with statuses the live server never returns. Each spec gets its own pass-through handler (not the shared `stub_mw`), so `assert_middleware_stack_mounted` tells the layers apart. See `auth/CLAUDE.md` §Middleware for the real stack.
39
39
  - `create_stub_app_backend(options?)` — stub `AppBackend` with no database: `create_stub_app_deps()` (or `options.deps`), no migration results, a `close` that does nothing (or `options.close`). For assembling a server in tests that never reach the database.
40
40
  - `create_stub_app_server_context(session_options)` — stub `AppServerContext` over `create_stub_app_backend()`; rate limiters null, `bootstrap_status.available: false`.
41
- - `create_test_app_surface_spec(options)` — builds an `AppSurfaceSpec` mirroring `create_app_server`'s route assembly, in its order (consumer routes, then bootstrap routes, RPC endpoint routes, and `GET /api/surface`, + stub middleware + surface generation). `GET /api/surface` is listed only with `surface_route: true`, as `create_app_server` mounts it only when opted in — pass the same value to both so the surface-derived suites probe it exactly when the live server serves it. `daemon_token: true` lists the `daemon_token` layer `create_app_server` mounts when given a `daemon_token_state` (`create_test_app` always passes one, and `default_in_process_suite_options` sets it, along with `app_options.surface_route`); `testing/test_app_server.db.test.ts` pins the stub's routes (order, auth, error schemas, applicable middleware) and middleware names against `create_test_app`'s for every `surface_route` setting. Its middleware list mirrors the real one — a stub `trusted_proxy` spec at `'*'`, then the stub auth stack — so every route's `applicable_middleware` starts with `trusted_proxy` (a route outside `/api/*` lists `['trusted_proxy', 'origin']`, since the origin check covers every path, and a route under an origin carve-out drops `origin`), as on the live server. `CreateTestAppSurfaceSpecOptions`: `session_options`, `create_route_specs`, `env_schema?`, `event_specs?`, `rpc_endpoints?`, `ws_endpoints?`, `allowed_origins?`, `origin_carve_outs?`, `transform_middleware?`, `bootstrap?`, `surface_route?`, `daemon_token?`. Throws, like `create_app_server`, on an endpoint path outside `AUTH_MIDDLEWARE_PATH` (`assert_endpoint_in_auth_scope`), on a route that reads or mints a credential outside it (`assert_credential_routes_in_auth_scope`), on an origin carve-out that overlaps that scope (`assert_origin_carve_outs_valid`), and on a `transform_middleware` that moves, drops, duplicates, reorders, wraps, or replaces the stub proxy spec or a stub auth spec (`assert_middleware_stack_mounted`); the transform receives shallow copies in a fresh array, so an in-place mutation can't slip past the check. Throws on a `ws_endpoints` spec with no `allowed_origins` of its own when no `allowed_origins` option is given (there is no server list to default from). Bootstrap is opt-in (symmetric with `create_app_server` — omit to skip; pass the same value as prod to mount routes at `bootstrap.route_prefix ?? '/api/account'`). Single source of truth for attack-surface tests — track `create_app_server` wiring changes here.
41
+ - `create_test_app_surface_spec(options)` — builds an `AppSurfaceSpec` mirroring `create_app_server`'s route assembly, in its order (consumer routes, then bootstrap routes, RPC endpoint routes, and `GET /api/surface`, + stub middleware + surface generation). `GET /api/surface` is listed only with `surface_route: true`, as `create_app_server` mounts it only when opted in — pass the same value to both so the surface-derived suites probe it exactly when the live server serves it. `daemon_token: true` lists the `daemon_token` layer `create_app_server` mounts when given a `daemon_token_state` (`create_test_app` always passes one, and `default_in_process_suite_options` sets it, along with `app_options.surface_route`); `testing/test_app_server.db.test.ts` pins the stub's routes (order, auth, error schemas, applicable middleware) and middleware names against `create_test_app`'s for every `surface_route` setting. Its middleware list mirrors the real one — the body limit's shape at `'*'` (`body_limit_middleware_shape` with a stub handler, left out with `max_body_size: null`), a stub `trusted_proxy` spec at `'*'`, then the stub auth stack — so every route's `applicable_middleware` starts with `body_limit`, `trusted_proxy` (a route outside `/api/*` lists `['body_limit', 'trusted_proxy', 'origin']`, since the origin check covers every path, and a route under an origin carve-out drops `origin`), as on the live server, and every route's error map carries the limit's 413 and 400 and the origin check's 403 `forbidden_origin`. `CreateTestAppSurfaceSpecOptions`: `session_options`, `create_route_specs`, `env_schema?`, `event_specs?`, `rpc_endpoints?`, `ws_endpoints?`, `allowed_origins?`, `origin_carve_outs?`, `transform_middleware?`, `bootstrap?`, `surface_route?`, `daemon_token?`, `max_body_size?`. Throws, like `create_app_server`, on an endpoint path outside `AUTH_MIDDLEWARE_PATH` (`assert_endpoint_in_auth_scope`), on a route that reads or mints a credential outside it (`assert_credential_routes_in_auth_scope`), on an origin carve-out that overlaps that scope (`assert_origin_carve_outs_valid`), and on a `transform_middleware` that moves, drops, duplicates, reorders, wraps, or replaces the stub proxy spec or a stub auth spec (`assert_middleware_stack_mounted`); the transform receives shallow copies in a fresh array, so an in-place mutation can't slip past the check. Throws on a `ws_endpoints` spec with no `allowed_origins` of its own when no `allowed_origins` option is given (there is no server list to default from). Bootstrap is opt-in (symmetric with `create_app_server` — omit to skip; pass the same value as prod to mount routes at `bootstrap.route_prefix ?? '/api/account'`). Single source of truth for attack-surface tests — track `create_app_server` wiring changes here.
42
42
 
43
43
  Throwing stubs surface mock escape: a test that accidentally reaches into
44
44
  stub territory breaks immediately with a label-scoped error rather than
@@ -127,6 +127,16 @@ mismatch.
127
127
  - `create_recording_audit_emitter(calls_ref?)` — no-op `AuditEmitter` pushing every `emit` and `emit_pool` call into `calls`. Pass `calls_ref` to write into a caller-owned array; omit to let the helper allocate. Returns `{emitter, calls}` — destructure `emitter` as the `audit` dep and read `calls` to assert. `add_listener` records (never fires) and returns a remover with the production semantics, so `listener_count` tracks what a server registered and released. Replaces per-file capturing emitters previously duplicated across `password_change.test.ts`, `audit_log.test.ts`, etc.
128
128
  - `RecordingAuditEmitter` — `{emitter: AuditEmitter; calls: Array<AuditLogInput>}`.
129
129
 
130
+ ### `token_scope_fixtures.ts` — scope documents built to a size
131
+
132
+ `token_scope_methods_at_bytes(bytes, filler)` — method names whose `methods`
133
+ scope document is exactly `bytes` compact UTF-8 bytes, the unit
134
+ `MAX_TOKEN_SCOPE_BYTES` counts: `account_token_list`, names ending in `filler`
135
+ (multibyte for a document far under its byte size in UTF-16 code units), and
136
+ an ASCII pad. The Rust spine's tests build the same list, so a boundary pinned
137
+ on one spine is the boundary on the other. `token_scope_methods_bytes(methods)`
138
+ measures one. Hono-free, imported by the cross-process token suite.
139
+
130
140
  ### `connection_closer_helpers.ts` — `ConnectionCloser` test doubles
131
141
 
132
142
  - `create_recording_closer()` — `{closer, calls}`; `closer.close_connections(target)` records the `target` and `close_all_connections()` records `{kind: 'all'}` into `calls`, closing nothing. To see a handler's closes, add it to the backend's closer (`ctx.deps.connection_closer.add(closer)`) or build the factory's deps with it. The closes are queued post-commit, so they have run by the time a `create_test_app` response is in hand (`await_pending_effects: true` flushes both queues).
@@ -407,8 +417,9 @@ or Postgres and runs in the `cross-ts` CI job.
407
417
  - `assert_surface_deterministic(build_surface)` — build twice, `deepStrictEqual` results; catches nondeterminism in surface generation.
408
418
  - `assert_only_expected_public_routes(surface, list)` — bidirectional: no unexpected public routes, no missing expected ones. Format: `['GET /health', 'POST /api/account/login']`.
409
419
  - `assert_full_middleware_stack(surface, prefix, mws)` — every route under `prefix` has exactly `mws` as its middleware chain.
410
- - `get_route_error_schema(lookup, route, status)` — reads from a pre-built merged-error-schema map; the schema is Zod or fuz_schema (`ValidationSchema`).
411
- - `assert_error_schema_valid(lookup, route, status, body)` — assert a schema exists + parses the body (`parse_any`); a mismatch throws an `Error` carrying the issues.
420
+ - `get_route_error_schema(lookup, route, status)` — reads the route's error map (`lookup` is `AppSurfaceSpec.route_error_maps`) at a status, a fuz_schema schema.
421
+ - `assert_error_schema_valid(lookup, route, status, body)` — assert the route declares the status, and the body parses against the status's schema (`parse_any`), a union of its definitions' `literal(code)` bodies, so a code the route doesn't declare at the status fails the parse; a mismatch throws an `Error` carrying the issues. Every adversarial refusal runs through it.
422
+ - `assert_error_response_declared(errors, jsonrpc, response, label)` — a JSON error response (400 and up) is one the route's map declares, by `check_route_error` (the DEV error check's rule: 500 `internal_error` / 503 `service_unavailable` always accepted, a JSON-RPC envelope on a `jsonrpc` route skipped, a success or non-JSON response passing); what the attack-surface suite's `correct auth passes guard` holds each answer to.
412
423
 
413
424
  ### `surface_invariants.ts` — structural + policy invariants
414
425
 
@@ -421,10 +432,10 @@ Structural invariants (options-free, universal):
421
432
  - `assert_query_routes_declare_400` — every route with query has 400.
422
433
  - `assert_descriptions_present` — every route has a non-empty description.
423
434
  - `assert_no_duplicate_routes` — no duplicate method+path pairs.
424
- - `assert_middleware_errors_propagated` — every middleware-declared error status appears on every applicable route.
425
- - `assert_error_schemas_structurally_valid` — every declared error schema has an `error` property at the top level (matches `ApiError`).
426
- - `assert_error_code_status_consistency` — the same `z.literal()` error code never appears at two different HTTP statuses.
427
- - `assert_404_schemas_use_specific_errors` — routes with params declaring 404 must use `z.literal()` or `z.enum()`, not generic `z.string()`.
435
+ - `assert_middleware_errors_propagated` — every middleware-declared error status appears on every applicable route. Holds by construction on a generated surface (the route error map unions the layers); it checks a snapshot or a hand-built surface.
436
+ - `assert_error_codes_specific` — every declared error body (each union branch, routes and middleware) has an `error` that is a `const` or an `enum` — a definition built by `rest_error`; the one tightness invariant.
437
+ - `assert_error_codes_well_formed` — every declared `error` code matches `REST_ERROR_CODE_PATTERN` (`^[a-z][a-z0-9_]*$`): a code, never prose, which goes in `message`.
438
+ - `assert_error_code_status_consistency` — the same `const` error code (a definition's `literal`) never appears at two different HTTP statuses, read through every `anyOf` / `oneOf` branch.
428
439
 
429
440
  RPC / WS structural invariants (options-free, apply over `surface.rpc_endpoints`
430
441
 
@@ -448,14 +459,6 @@ Policy invariants (configurable, sensible defaults):
448
459
  - `assert_mutation_routes_use_post` — routes with input schemas must not be GET (bypasses browser GET idempotency assumptions).
449
460
  - `assert_keeper_routes_under_prefix` — keeper routes must be under `keeper_route_prefixes` (default `['/api/']`).
450
461
 
451
- Tightness audit:
452
-
453
- - `audit_error_schema_tightness(surface) => Array<ErrorSchemaAuditEntry>` — classifies every route × status combination as `'literal' | 'enum' | 'generic'`.
454
- - `assert_error_schema_tightness(surface, options?)` — fails routes below a threshold (`min_specificity`, default `'enum'`) with `allowlist` + `ignore_statuses` escape hatches.
455
- - `fuz_app_stock_route_tightness_allowlist` — currently empty. Every fuz_app-shipped route (account login/password/bootstrap/signup, db health/tables/:name/tables/:name/rows/:id) has been tightened in place to `z.enum([...])` / `z.literal(...)` against every emit-site code. Kept as a forward-compatibility hook for future stock routes that need an interim exemption; paths assume the standard `/api/account` + `/api/db` prefixes.
456
- - `default_error_schema_tightness` — `{ignore_statuses: [401, 403, 429], allowlist: fuz_app_stock_route_tightness_allowlist}`. Applied by `describe_standard_attack_surface_tests` when `error_schema_tightness` is omitted; pass an override config or `null` to opt out.
457
- - **Merge semantics in `describe_standard_attack_surface_tests`**: consumer-supplied `allowlist` and `ignore_statuses` are concatenated underneath the defaults (stock entries first, consumer entries last), so consumer allowlists are additive rather than replacing. Scalar fields like `min_specificity` are overwritten by the consumer. Exported as `resolve_standard_error_schema_tightness(consumer_options)` for consumers calling `assert_error_schema_tightness` directly outside the suite.
458
-
459
462
  Aggregate runners (called by the standard attack-surface suite):
460
463
 
461
464
  - `assert_surface_invariants(surface)` — runs all route-level structural assertions.
@@ -464,7 +467,12 @@ Aggregate runners (called by the standard attack-surface suite):
464
467
 
465
468
  ### `error_coverage.ts` — reachability tracking
466
469
 
467
- `ErrorCoverageCollector` tracks which declared error paths get exercised.
470
+ `ErrorCoverageCollector` tracks which declared error paths get exercised:
471
+ each code of each route's error map (`resolve_route_error_map`), one path per
472
+ (status, code), read from its definitions. `new ErrorCoverageCollector(route_error_maps?)`
473
+ takes the maps (`AppSurfaceSpec.route_error_maps`, middleware included); without
474
+ them a route's own map is read. The standard suites pass
475
+ `surface_source.route_error_maps`.
468
476
  Observations live in a `Set<string>` keyed by `"METHOD /spec-path:STATUS"` or
469
477
  `"METHOD /spec-path:STATUS:CODE"` — the two shapes coexist and a status-only
470
478
  observation satisfies the "any-code" coverage rule for all declared codes at
@@ -474,11 +482,10 @@ Methods:
474
482
 
475
483
  - `record(specs, method, path, status, code?)` — resolves concrete paths back to spec templates (e.g. `/api/accounts/abc` → `/api/accounts/:id`).
476
484
  - `assert_and_record(specs, method, path, response, code?)` — wraps `assert_response_matches_spec` and auto-extracts `body.error` from the JSON body via `response.clone()`. Pass an explicit `code` when the body was already consumed.
477
- - `uncovered(specs, options?)` — per-status rows for generic schemas, per-code rows for `z.literal` / `z.enum` schemas.
485
+ - `uncovered(specs, options?)` — one `{method, path, status, code}` row per declared code never observed.
478
486
 
479
487
  Support functions:
480
488
 
481
- - `extract_declared_error_codes(schema)` — reads the object's `error` field, Zod (`schema.shape.error`) or fuz_schema (`get_schema_entries`, any object kind under any wrappers); returns the literal value(s) for `z.literal` / `z.enum` / `literal` / `one_of`, `null` otherwise.
482
489
  - `assert_error_coverage(collector, specs, options?)` — logs `[error coverage] covered/total (N.M%)` with uncovered list; fails when `min_coverage > 0` and the ratio falls below.
483
490
  - `DEFAULT_INTEGRATION_ERROR_COVERAGE = 0.2` — conservative baseline for the standard integration/admin suites; consumers tighten as their own test coverage matures.
484
491
 
@@ -495,7 +502,7 @@ naming it.
495
502
  - `detect_format(field_schema)` — `detect_json_schema_format` over `to_field_json_schema`: the `format`, `'pattern'` for a regex, or `null`.
496
503
  - `generate_valid_value(field, field_schema)` — base-type switch producing a valid sample (UUIDs → nil UUID, strings → `'xxxxxxxxxx'`, numbers → `1`, objects → `generate_valid_object` against the field schema, so a nested refinement is satisfied too, enums → first entry, records → `{}`, a void field → `undefined`, etc.). For branded-string refinements, walks a fallback chain synthesized from the `pattern` string the JSON Schema representation exposes: fixed-length hex (`^[0-9a-f]{N}$` — blake3 / sha256 / md5 digests; `0`.repeat(N)), prefix-lengthed slug (`^<prefix>_[A-Za-z0-9_-]{N}$` — `ApiTokenId`-style ids; `<prefix>_` + `x`.repeat(N)), absolute path prefix, URL prefix, two `/`-joined segments (an `owner/name` slug). First candidate the field accepts is used.
497
504
  - `generate_valid_string_param(field, field_schema)` — a string a URL-sourced field (route param, query value) accepts: the nil UUID for a UUID field, else the first of `test_value`, the generated valid value as a string, `1`, `0`, `true`, `false`, the field's JSON Schema `default` or lower bound as a string (a preprocessed integer whose minimum is above one) and a synthesized string the field accepts; `null` when none does. The params and query case generators build their base from it.
498
- - `resolve_valid_path(path, params_schema?)` — swaps `:param` for a value the params schema accepts. Prefers `test_<name>` wherever the field schema admits it (the param name keeps failure messages readable); otherwise a UUID param takes the nil UUID and anything else is synthesized from the schema, percent-encoded. A synthesized value containing `/` is refused (it would route elsewhere) and falls back to `test_<name>`.
505
+ - `resolve_valid_path(path, params_schema?)` — swaps each whole param segment (`:name`, `:name{re}`, optional or not, read as Hono reads a template: `split_route_template` / `parse_route_param`) for a value the params schema accepts; a `:` inside a literal segment (`files:upload`) stays. Prefers `test_<name>` wherever the field schema admits it (the param name keeps failure messages readable); otherwise a UUID param takes the nil UUID and anything else is synthesized from the schema, percent-encoded. A synthesized value containing `/` is refused (it would route elsewhere) and falls back to `test_<name>`.
499
506
  - `to_route_content_type(route)` — the `Content-Type` a well-formed request to the route sends: `application/json`, or `application/octet-stream` for a `raw_body` route. Every `POST` route refuses anything else with 415 before its other gates, so every probe in the harnesses (auth, params and query fuzz, 404, data exposure, round trip) sends it, body or not.
500
507
  - `generate_valid_object(object_schema, schema) => {value, result}` — required and defaulted fields; when `schema` (refinements included) refuses those, each optional field alone in declaration order, the first that parses; failing that, the optional fields added cumulatively until it parses. Covers a `.refine()` over optional fields (at least one of, exactly one of, both of) at any depth, and, where one optional field suffices, keeps the others (an `acting` declared first) out. Returns the last `parse_any` result (`GeneratedObject`) and leaves the throw to the caller, which renders its issues with `format_issues` (`schema_issues.ts`).
501
508
  - `generate_valid_object_with_field(object_schema, schema, base, field)` — a valid object carrying `field`, built from the valid `base`: `base` itself when it carries the field; else the field joins `base`, with the optional fields `base` omits filled as `generate_valid_object` fills them (a pair rule: `scope_kind` needs `scope_id`); failing that, the field replaces `base`'s optional fields, refilled around it (exactly one of: adding `slug` drops `id`). `null` when no object the generator builds carries the field. The body a single-fault case on a field the base omits changes.
@@ -503,9 +510,9 @@ naming it.
503
510
 
504
511
  ### `integration_helpers.ts` — route lookup + body checks
505
512
 
506
- - `find_route_spec(specs, method, path)` — exact match then parameterized match (`:foo` matches any segment).
513
+ - `find_route_spec(specs, method, path)` — the first spec in list (mount) order whose method and path template match, as Hono dispatches (the hono-free `find_mounted_route`; the DEV check reads Hono's own router), `HEAD` read as `GET`, the path read as Hono reads it (pathname, percent-decoded); a template passed as the path (a segment that is `*` or starts with `:`) finds its own spec first, outranking mount order.
507
514
  - `find_auth_route(specs, suffix, method)` — suffix-ending match for REST auth routes; decouples tests from consumer prefix. `suffix` is typed as `RestAuthRouteSuffix` and throws at runtime on unknown values (only login/logout/password/verify/signup/bootstrap remain on REST).
508
- - `assert_response_matches_spec(specs, method, path, response)` — 2xx → validates against `spec.output`; non-2xx → validates against merged error schemas for that status. Non-JSON responses allowed only when no schema applies.
515
+ - `assert_response_matches_spec(specs, method, path, response, route_error_maps?)` — 2xx → validates against `spec.output`; an error status (400 and up) → `assert_error_response_declared` against the route's error map — the one in `route_error_maps` (`AppSurfaceSpec.route_error_maps`, middleware included), else the route's own: a status the map lacks throws (`Undeclared error status (S): METHOD path: …`), as does a body off its schema, with the DEV error check's exemptions (500 `internal_error`, 503 `service_unavailable`, a JSON-RPC envelope on a `jsonrpc` route). Non-JSON responses allowed only when no schema applies. The round trips and `ErrorCoverageCollector.assert_and_record` run through it.
509
516
  - `assert_no_error_info_leakage(body, context)` — rejects field-name patterns (`stack`, `trace`, `sql`, …) + value patterns (`node_modules`, stack-like `at …`, `.ts:NN`).
510
517
  - `assert_rate_limit_retry_after_header(response, body)` — `Retry-After` numeric header equals `Math.ceil(body.retry_after)`.
511
518
  - `sensitive_field_blocklist` — `['password_hash', 'token_hash']`; never in any response body.
@@ -522,12 +529,12 @@ Single-call bundle of 5 top-level groups (10 named tests + every adversarial
522
529
  case per route):
523
530
 
524
531
  1. **attack surface snapshot** — `matches committed snapshot`, `is deterministic`.
525
- 2. **attack surface structure** — `only expected public routes`, `full middleware stack on API routes`, `surface invariants`, `rpc/ws surface invariants`, `security policy`, `error schema tightness` (logs counts and asserts against `default_error_schema_tightness` by default; pass an override config or `null` via `error_schema_tightness`).
526
- 3. **adversarial HTTP auth enforcement** — `unauthenticated → 401`, `wrong role → 403` × roles, `authenticated without role → 403`, `credential-gated routes reject a disallowed credential → 403`, `correct auth passes guard`. The role blocks cover role routes the session-credentialed role apps reach (a keeper route's channel gate answers first); the credential block probes every `auth.credential_types` route on the first builtin channel its allowlist omits, using `AuthTestApps.by_credential_type` (one keeper-role app per builtin channel; `keeper` is its `daemon_token` entry).
532
+ 2. **attack surface structure** — `only expected public routes`, `full middleware stack on API routes`, `surface invariants`, `rpc/ws surface invariants`, `security policy`.
533
+ 3. **adversarial HTTP auth enforcement** — `unauthenticated → 401`, `wrong role → 403` × roles, `authenticated without role → 403`, `credential-gated routes reject a disallowed credential → 403`, `correct auth passes guard`. Every refusal is held to the route's own error map (`assert_error_schema_valid`: the status, the code at it, the body), and `correct auth passes guard`, which takes any status but the gates' from a handler on stub deps, holds a JSON error it answers to the map too (`assert_error_response_declared`). The role blocks cover role routes the session-credentialed role apps reach (a keeper route's channel gate answers first); the credential block probes every `auth.credential_types` route on the first builtin channel its allowlist omits, using `AuthTestApps.by_credential_type` (one keeper-role app per builtin channel; `keeper` is its `daemon_token` entry).
527
534
  4. **adversarial input validation** — delegated to `describe_adversarial_input`.
528
535
  5. **adversarial 404 response validation** — delegated to `describe_adversarial_404`.
529
536
 
530
- Options: `{build: () => AppSurfaceSpec, snapshot_path, expected_public_routes, expected_api_middleware, roles, api_path_prefix?, security_policy?, error_schema_tightness?, skip_routes?}`.
537
+ Options: `{build: () => AppSurfaceSpec, snapshot_path, expected_public_routes, expected_api_middleware, roles, api_path_prefix?, security_policy?, skip_routes?}`.
531
538
 
532
539
  `skip_routes` is a list of `'METHOD /path'` surface keys the three
533
540
  adversarial sub-suites drop, forwarded to each of them (it also sits on
@@ -546,7 +553,9 @@ Also exported: `describe_adversarial_auth(options)` (group 3 on its own).
546
553
  query validation failures at every route with correct-auth credentials so
547
554
  validation middleware is actually exercised (not short-circuited by 401).
548
555
  All cases expect 400 with one of `ERROR_INVALID_REQUEST_BODY` /
549
- `_INVALID_JSON_BODY` / `_INVALID_ROUTE_PARAMS` / `_INVALID_QUERY_PARAMS`.
556
+ `_INVALID_JSON_BODY` / `_INVALID_ROUTE_PARAMS` / `_INVALID_QUERY_PARAMS`, a
557
+ code the route's own error map declares at 400, and a body its schema there
558
+ accepts (`assert_error_schema_valid`).
550
559
 
551
560
  The generators live in the hono-free `adversarial_input_cases.ts`, so the
552
561
  cross-process suites reuse them:
@@ -564,14 +573,11 @@ rather than `ERROR_INVALID_JSON_BODY`.
564
573
 
565
574
  ### `adversarial_404.ts` — 404 schema conformance
566
575
 
567
- `describe_adversarial_404({build, roles})` — for every route with `params` +
568
- 404 in `error_schemas` + an extractable error code (`z.literal` or first
569
- `z.enum`, fuz_schema `literal` or first `one_of`), replaces the handler with a
570
- stub returning `{error: <code>}`, fires with nil-UUID params, asserts 404 +
571
- body matches the declared 404 schema, Zod or fuz_schema (`parse_any`). No DB needed. The code comes from `extract_404_error_code(schema)`,
572
- which reads the output-side JSON Schema of a Zod or fuz_schema schema with
573
- `unrepresentable: 'any'`, so a field JSON Schema can't say beside `error`
574
- (a transform) no longer drops the route from the suite.
576
+ `describe_adversarial_404({build, roles})` — for every route with `params` and
577
+ a 404 definition of its own in `errors`, replaces the handler with a stub
578
+ returning `{error: <code>}` (the first 404 definition's code), fires with
579
+ nil-UUID params, asserts 404, a code the route error map declares at 404, and a body its 404
580
+ accepts (`assert_error_schema_valid`, `AppSurfaceSpec.route_error_maps`). No DB needed.
575
581
 
576
582
  ### `adversarial_headers.ts` — header injection suite
577
583
 
@@ -796,7 +802,7 @@ as `'/path method_name'`, and pushed WS params as `'/path method_name params'`
796
802
 
797
803
  Two test groups:
798
804
 
799
- 1. IP rate limiting on login — fires `max_attempts + 1` requests; last should be 429 with `RateLimitError` body + valid `Retry-After` header.
805
+ 1. IP rate limiting on login — fires `max_attempts + 1` requests; last should be 429 with a `REST_RATE_LIMIT_EXCEEDED` body + valid `Retry-After` header.
800
806
  2. Per-account rate limiting on login — same username exhausts the bucket; a different username is not blocked.
801
807
 
802
808
  No bearer group — the bearer path carries no rate limiter on either spine
@@ -839,11 +845,9 @@ auth-related routes (login/logout/verify/sessions/tokens/password/signup)
839
845
  and asserts `DEFAULT_INTEGRATION_ERROR_COVERAGE` (20%). Bootstrap is
840
846
  excluded because no describe block in this suite drives it — its declared
841
847
  codes would always be uncovered. Consumer-specific routes aren't exercised
842
- here either — they don't count against the baseline. 403 authorization
843
- denials (the credential-channel gate on `/logout` + `/password`, the invite
844
- gate on `/signup`) are likewise excluded via `ignore_statuses: [403]` — they're
845
- exercised by the conformance + attack-surface suites, not this lifecycle suite.
846
- Override with
848
+ here either — they don't count against the baseline. The declared paths are
849
+ the route error maps of `surface_source`, middleware included (the origin
850
+ check's 403, the body limit's 413 and 400). Override with
847
851
  `error_coverage_min?: number` (set to `0` to skip the assertion — useful for
848
852
  minimal route sets whose declared error codes outpace the suite's
849
853
  denial-path drivers).
@@ -873,7 +877,7 @@ header/account mismatch. Direct-grant fixtures (test focuses on revoke or
873
877
  isolation, not the consent path) go through `create_test_role_grant_direct`
874
878
  from `db_entities.ts`.
875
879
 
876
- Required options: `{setup_test, surface_source, session_options, rpc_endpoints: RpcEndpointsSuiteOption, roles: RoleSchemaResult, admin_prefix?}`.
880
+ Required options: `{setup_test, surface_source, session_options, rpc_endpoints: RpcEndpointsSuiteOption, roles: RoleRegistry, admin_prefix?}`.
877
881
 
878
882
  fuz_app runs it cross-process through the standard bundle
879
883
  and in-process as a consumer wires it
@@ -2572,7 +2576,11 @@ a `{kind:'ttl', days}` mint returns and stores a bounded `expires_at`
2572
2576
  (create output + `account_token_list` read-back), `{kind:'eternal'}` stores
2573
2577
  NULL, an omitted or out-of-range lifetime 400s identically on both
2574
2578
  spines, and a `name` at `API_TOKEN_NAME_LENGTH_MAX` mints and reads back whole
2575
- while one UTF-16 code unit past it is `invalid_params`. It also pins the
2579
+ while one UTF-16 code unit past it is `invalid_params`. It pins the scope cap
2580
+ as compact UTF-8 bytes at mint and at read: a two-byte scope at
2581
+ `MAX_TOKEN_SCOPE_BYTES`, and an ASCII one under it whose printed `jsonb` text
2582
+ is past it, mint, authenticate as bearers and list as `N methods`; one byte
2583
+ past the cap is `invalid_params` with `ERROR_TOKEN_SCOPE_INVALID`. It also pins the
2576
2584
  credential legs' order from stored state: a bearer sent beside a winning
2577
2585
  daemon token keeps `last_used_at` null (never validated), against a token used
2578
2586
  alone whose touch lands. Exists because the action-manifest parity gate captures no param
@@ -2680,7 +2688,7 @@ check.
2680
2688
  ### Identity-primitive parity — `cross_backend/identity_parity.ts`
2681
2689
 
2682
2690
  `describe_identity_parity_cross_tests({setup_test, login_path?, signup_path?, bootstrap_path?, password_path?})` —
2683
- the imperative suite pinning the `primitive_schemas` twins (`Username`,
2691
+ the imperative suite pinning the identity primitives (`Username`,
2684
2692
  `UsernameProvided`, `Email`) + login/signup input handling end-to-end over real
2685
2693
  HTTP (flat REST `/login` + `/signup`, so imperative, not a `conformance_table`
2686
2694
  row). The facets, each a TS↔Rust reimplementation pair that the spec-derived
@@ -2699,7 +2707,7 @@ round-trip / conformance suites never vary:
2699
2707
  - **Login input validation** — malformed login input → 400 `invalid_request_body`
2700
2708
  on every spine: whitespace-only username (empty after trim), over-long username
2701
2709
  (> 255), empty password, unknown body key (strict object). TS runs the full
2702
- `LoginInput` Zod schema; the Rust spine enforces the same shape in
2710
+ `LoginInput` schema; the Rust spine enforces the same shape in
2703
2711
  `account_login` (closed a cluster where three of these fell through to a
2704
2712
  lookup-miss 401 on Rust and a whitespace-only identifier 401'd on TS). Asserted
2705
2713
  by error reason, not just status.
@@ -2707,7 +2715,10 @@ round-trip / conformance suites never vary:
2707
2715
  padded creation name (space, tab, U+0085) → 400, never trimmed into a legal
2708
2716
  one — at signup, and at bootstrap (`bootstrap_path`, default
2709
2717
  `/api/account/bootstrap`, `null` to skip), where the body is validated ahead
2710
- of the window check, so the 400 holds after bootstrap completed.
2718
+ of the window check, so the 400 holds after bootstrap completed. There the
2719
+ `token` past `BOOTSTRAP_TOKEN_LENGTH_MAX` UTF-16 code units is 400 and one at
2720
+ it reaches the closed window's 403, ASCII, two-byte, and astral, so both
2721
+ spines count code units, not bytes or scalar values.
2711
2722
  - **Length + format regex parity** — both `[USERNAME_LENGTH_MIN,
2712
2723
  USERNAME_LENGTH_MAX]` = `[3, 39]` boundary edges (just-outside → 400,
2713
2724
  just-inside → 403 no-matching-invite) and the creation regex shape (leading
@@ -1,6 +1,6 @@
1
1
  import './assert_dev_env.js';
2
2
  import type { SessionOptions } from '../auth/session_cookie.js';
3
- import { type RoleSchemaResult } from '../auth/role_schema.js';
3
+ import { type RoleRegistry } from '../auth/role_schema.js';
4
4
  import { type RpcEndpointsSuiteOption } from './rpc_helpers.js';
5
5
  import type { AppSurfaceSpec } from '../http/surface.js';
6
6
  import type { SetupTest } from './cross_backend/setup.js';
@@ -22,8 +22,8 @@ export interface StandardAdminIntegrationTestOptions {
22
22
  surface_source: AppSurfaceSpec;
23
23
  /** Session config — needed for cookie_name + factory-form rpc_endpoints resolution. */
24
24
  session_options: SessionOptions<string>;
25
- /** Role schema result from `create_role_schema()` — used to determine valid/invalid/web-grantable roles. */
26
- roles: RoleSchemaResult;
25
+ /** Role registry from `create_role_registry()` — used to determine valid/invalid/web-grantable roles. */
26
+ roles: RoleRegistry;
27
27
  /**
28
28
  * RPC endpoint specs — the source `RpcAction` arrays. Required; role_grant
29
29
  * grant/revoke are RPC-only and the suite hard-fails without them.