@classytic/arc 2.52.0 → 2.53.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 (222) hide show
  1. package/README.md +2 -1
  2. package/dist/{EventTransport-DeNze_-C.mjs → EventTransport-B3jTKMQH.mjs} +2 -2
  3. package/dist/{HookSystem-DTffXM1X.mjs → HookSystem-DNwxV463.mjs} +2 -2
  4. package/dist/{ResourceRegistry-tlqXSZoK.mjs → ResourceRegistry-Ck7RFodL.mjs} +2 -2
  5. package/dist/{acquire-7JKEkKnN.mjs → acquire-DkLruwhL.mjs} +1 -1
  6. package/dist/audit/index.d.mts +1 -1
  7. package/dist/audit/index.mjs +4 -4
  8. package/dist/auth/audit.mjs +1 -1
  9. package/dist/auth/index.d.mts +1 -1
  10. package/dist/auth/index.mjs +7 -7
  11. package/dist/auth/redis-session.mjs +1 -1
  12. package/dist/auth/social/index.mjs +1 -1
  13. package/dist/{authorizationDecision-DKmH4tZ-.mjs → authorizationDecision-gB5-bHDp.mjs} +5 -5
  14. package/dist/bootError-BT3z3cvX.mjs +38 -0
  15. package/dist/{boundedMap-zxGBpXX0.mjs → boundedMap-Ddw2yGb2.mjs} +1 -1
  16. package/dist/{buildHandler-ZDV6LRZ_.mjs → buildHandler-B8IDGmhD.mjs} +5 -5
  17. package/dist/cache/index.mjs +4 -4
  18. package/dist/{caching-DceUN9Xk.mjs → caching-BitJDAY0.mjs} +2 -2
  19. package/dist/{claimed-DsP5Hi_f.mjs → claimed-CM_-lFHX.mjs} +1 -1
  20. package/dist/cleanup/index.d.mts +2 -2
  21. package/dist/cleanup/index.mjs +4 -4
  22. package/dist/cli/commands/describe.d.mts +18 -1
  23. package/dist/cli/commands/describe.mjs +39 -7
  24. package/dist/cli/commands/docs.mjs +3 -3
  25. package/dist/cli/commands/doctor.d.mts +3 -1
  26. package/dist/cli/commands/doctor.mjs +135 -22
  27. package/dist/cli/commands/generate.mjs +2 -2
  28. package/dist/cli/commands/init.mjs +2 -2
  29. package/dist/cli/commands/introspect.mjs +2 -2
  30. package/dist/cli/index.mjs +3 -3
  31. package/dist/{constants-Ca2IQFy2.mjs → constants-D9EiaO5s.mjs} +1 -1
  32. package/dist/context/index.d.mts +5 -2
  33. package/dist/context/index.mjs +5 -5
  34. package/dist/core/index.d.mts +2 -2
  35. package/dist/core/index.mjs +7 -7
  36. package/dist/{core-M18RhMqi.mjs → core-B_06Fcn0.mjs} +3 -3
  37. package/dist/{createActionRouter-zXlrwWVs.mjs → createActionRouter-DtxUXOCI.mjs} +5 -5
  38. package/dist/{createAggregationRouter-CN0Da9nC.mjs → createAggregationRouter-BMiKyDoW.mjs} +7 -7
  39. package/dist/{createApp-BC67ACu4.mjs → createApp-CEdGZtkP.mjs} +207 -44
  40. package/dist/{createMcpServer-CS2KOVP6.d.mts → createMcpServer-Bk3ls5jS.d.mts} +1 -1
  41. package/dist/{defineAggregation-DqAGb5oI.mjs → defineAggregation-DUsrGcsm.mjs} +1 -1
  42. package/dist/{defineResource-DC5UqkQv.mjs → defineResource-q8TsJpOm.mjs} +92 -36
  43. package/dist/deprecation-DX625dth.mjs +27 -0
  44. package/dist/discovery/index.mjs +1 -1
  45. package/dist/docs/index.d.mts +1 -1
  46. package/dist/docs/index.mjs +3 -3
  47. package/dist/{elevation-DiXVg98q.mjs → elevation-NJ3908pJ.mjs} +5 -5
  48. package/dist/encryption/index.mjs +3 -3
  49. package/dist/{errorHandler-BUTm9P_f.mjs → errorHandler-Ke6PGvF7.mjs} +7 -4
  50. package/dist/{errors-DxpHZBlW.mjs → errors-Ukhmfmmx.mjs} +1 -1
  51. package/dist/{eventPlugin-BY38F6yK.d.mts → eventPlugin-BeJasppx.d.mts} +7 -18
  52. package/dist/{eventPlugin-ZsIQPRso.mjs → eventPlugin-DTKAgSvb.mjs} +10 -8
  53. package/dist/{eventTypes-D-pFtqT1.mjs → eventTypes-DpDQtyR6.mjs} +2 -2
  54. package/dist/events/index.d.mts +2 -2
  55. package/dist/events/index.mjs +8 -8
  56. package/dist/events/transports/redis-stream-entry.mjs +4 -4
  57. package/dist/events/transports/redis.mjs +2 -2
  58. package/dist/factory/index.d.mts +28 -5
  59. package/dist/factory/index.mjs +12 -7
  60. package/dist/{fastify-augmentation-CPReFhZ1.d.mts → fastify-augmentation-DjxuSRG4.d.mts} +4 -3
  61. package/dist/{fieldTypes-f-3TZgR3.mjs → fieldTypes-BtFpQO6I.mjs} +2 -2
  62. package/dist/{fields-kCbIDTjA.mjs → fields-B7fuROWK.mjs} +1 -1
  63. package/dist/{filter-merge-UJCgjbZR.mjs → filter-merge-BuzZ-r9z.mjs} +1 -1
  64. package/dist/{generate-CLpmzbJ_.mjs → generate-c4F39pk1.mjs} +4 -4
  65. package/dist/{headers-Bh47h0XH.mjs → headers-Ib7BDgRI.mjs} +2 -2
  66. package/dist/{health-CEpgVAl7.mjs → health-22T82HAa.mjs} +1 -1
  67. package/dist/health-skjSwNaC.d.mts +36 -0
  68. package/dist/hooks/index.d.mts +1 -1
  69. package/dist/hooks/index.mjs +2 -2
  70. package/dist/http-cache/index.mjs +4 -4
  71. package/dist/http-cache/purgers/cloudflare.mjs +2 -2
  72. package/dist/http-cache/purgers/fastly.mjs +2 -2
  73. package/dist/http-cache/testing/index.mjs +1 -1
  74. package/dist/idempotency/index.d.mts +7 -1
  75. package/dist/idempotency/index.mjs +9 -7
  76. package/dist/idempotency/redis.mjs +2 -2
  77. package/dist/{index-CMNpMBtW.d.mts → index-BzUyno-u.d.mts} +14 -5
  78. package/dist/{index-yXXCsKl7.d.mts → index-CXqYFGoH.d.mts} +13 -4
  79. package/dist/{index-CSbDhif4.d.mts → index-CaBFPmnu.d.mts} +10 -6
  80. package/dist/{index-DCH08eqQ.d.mts → index-DWn0o4U7.d.mts} +2 -2
  81. package/dist/{index-DLCcLUQT.d.mts → index-DtHACefu.d.mts} +109 -116
  82. package/dist/index.d.mts +5 -5
  83. package/dist/index.mjs +12 -12
  84. package/dist/{init-B43DXBpc.mjs → init-XY5slyuS.mjs} +3 -3
  85. package/dist/integrations/event-gateway.mjs +2 -2
  86. package/dist/integrations/index.d.mts +1 -1
  87. package/dist/integrations/index.mjs +1 -1
  88. package/dist/integrations/jobs/index.mjs +3 -3
  89. package/dist/integrations/mcp/index.d.mts +9 -4
  90. package/dist/integrations/mcp/index.mjs +2 -2
  91. package/dist/integrations/mcp/testing.d.mts +2 -2
  92. package/dist/integrations/mcp/testing.mjs +2 -2
  93. package/dist/integrations/streamline.mjs +3 -3
  94. package/dist/integrations/webhooks.d.mts +1 -1
  95. package/dist/integrations/webhooks.mjs +4 -4
  96. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  97. package/dist/integrations/websocket-redis.mjs +1 -1
  98. package/dist/integrations/websocket.mjs +2 -2
  99. package/dist/invariants-COekUeoh.mjs +120 -0
  100. package/dist/{jsonBody-CkKs6dA_.mjs → jsonBody-BNlcGUnb.mjs} +2 -2
  101. package/dist/{keys-DHrHnT0f.mjs → keys-DwvXJwUX.mjs} +1 -1
  102. package/dist/{loadResources-CFdzAWQZ.mjs → loadResources-izEeQLO_.mjs} +3 -3
  103. package/dist/{loadResourcesFromEntry-DkoSiJsI.mjs → loadResourcesFromEntry-CijqjbHE.mjs} +2 -2
  104. package/dist/logger/index.mjs +2 -2
  105. package/dist/{logger-DJwz_-Pl.mjs → logger-DdMS0XC_.mjs} +1 -1
  106. package/dist/{mcpPlugin-CA_MDFlS.mjs → mcpPlugin-D0tSZqKk.mjs} +24 -22
  107. package/dist/{memory-B9CFHbA_.mjs → memory-Ay0haw9n.mjs} +3 -3
  108. package/dist/{metrics-DSKv-T9K.mjs → metrics-Bpgf4UL6.mjs} +3 -3
  109. package/dist/middleware/index.d.mts +1 -1
  110. package/dist/middleware/index.mjs +3 -3
  111. package/dist/migrations/index.mjs +2 -2
  112. package/dist/{module-C0JCsnO7.mjs → module-BLrTmMyk.mjs} +1 -1
  113. package/dist/{multiTenant-QtDzxx_K.d.mts → multiTenant-Cf0Ye-Wu.d.mts} +1 -1
  114. package/dist/{multipartBody-Bxz-q6hI.mjs → multipartBody-L2gr96df.mjs} +1 -1
  115. package/dist/{observeSend-DfNkdGww.mjs → observeSend-B7FEdk_g.mjs} +1 -1
  116. package/dist/{openapi-Dmp7Ipsi.mjs → openapi-COrL_33P.mjs} +6 -6
  117. package/dist/outbox-admin/index.d.mts +1 -1
  118. package/dist/outbox-admin/index.mjs +6 -6
  119. package/dist/{outbox-module-vT6PaThj.mjs → outbox-module-BY2HtnjU.mjs} +7 -7
  120. package/dist/{outbox-module-DzW6zwWJ.d.mts → outbox-module-C1QWMloZ.d.mts} +5 -8
  121. package/dist/permissions/index.d.mts +2 -2
  122. package/dist/permissions/index.mjs +8 -8
  123. package/dist/{permissions-Cga6KBOX.mjs → permissions-CEyeDHtT.mjs} +36 -17
  124. package/dist/{pipe-CqPweKdL.mjs → pipe-DIAr91at.mjs} +2 -2
  125. package/dist/pipeline/index.d.mts +1 -1
  126. package/dist/pipeline/index.mjs +2 -2
  127. package/dist/{plan-CbDTFbTj.mjs → plan-BhKHIkFl.mjs} +75 -20
  128. package/dist/{plugin-8Z1khbAI.mjs → plugin-D6hrdx-j.mjs} +72 -38
  129. package/dist/plugins/index.d.mts +4 -3
  130. package/dist/plugins/index.mjs +18 -18
  131. package/dist/plugins/response-cache.mjs +4 -4
  132. package/dist/plugins/tracing-entry.mjs +177 -85
  133. package/dist/{pluralize-D4vcPLVs.mjs → pluralize-CJKgYkVc.mjs} +1 -1
  134. package/dist/presetPermission-2pcRVYRG.mjs +23 -0
  135. package/dist/presets/filesUpload.d.mts +4 -2
  136. package/dist/presets/filesUpload.mjs +11 -6
  137. package/dist/presets/index.d.mts +6 -4
  138. package/dist/presets/index.mjs +2 -2
  139. package/dist/presets/multiTenant.d.mts +1 -1
  140. package/dist/presets/multiTenant.mjs +5 -5
  141. package/dist/presets/search.d.mts +2 -2
  142. package/dist/presets/search.mjs +54 -38
  143. package/dist/{presets-D28IABZe.mjs → presets-st11ePNn.mjs} +150 -41
  144. package/dist/{projection-aHCtDQQ9.mjs → projection-B4rqiJTi.mjs} +2 -2
  145. package/dist/{purger.types-CNFmEtFu.mjs → purger.types-BcHeAhY_.mjs} +1 -1
  146. package/dist/{queryCachePlugin-CwpEjCwz.mjs → queryCachePlugin-BgSc2bga.mjs} +6 -6
  147. package/dist/rateLimitKey-DLGdeFd2.mjs +138 -0
  148. package/dist/{realtime-Dvu8ES2z.mjs → realtime-CpYpIFsm.mjs} +11 -11
  149. package/dist/registry/index.d.mts +2 -2
  150. package/dist/registry/index.mjs +3 -3
  151. package/dist/{registry-DmxbzW7-.mjs → registry-BQsdAlZ_.mjs} +2 -2
  152. package/dist/{relay-CEaCmUfG.mjs → relay-CmT3gtkP.mjs} +11 -12
  153. package/dist/{renewingLease-g2FjB3im.mjs → renewingLease-DaoP0K-e.mjs} +1 -1
  154. package/dist/{replyHelpers-CSByAX_Z.mjs → replyHelpers-SiLr1wK4.mjs} +2 -2
  155. package/dist/{requestContext-yc7MSgmq.mjs → requestContext-B-TjFpWt.mjs} +8 -3
  156. package/dist/{health-W4S2yFBL.mjs → requestId-ClcKoWLq.mjs} +154 -116
  157. package/dist/{requirement-Dm8njSoC.mjs → requirement-BygDzjDS.mjs} +1 -1
  158. package/dist/{resourceRateLimit-PQaY3HW1.mjs → resourceRateLimit-DdIYis3m.mjs} +2 -2
  159. package/dist/{rolldown-runtime-BBBkGgwA.mjs → rolldown-runtime-Cy6j0m8_.mjs} +1 -1
  160. package/dist/{routeValidator-fuG51bQA.mjs → routeValidator-Bn-x2gaJ.mjs} +1 -1
  161. package/dist/{runtimeCapabilities-B8IT7xiQ.mjs → runtimeCapabilities-DY20Pibh.mjs} +7 -2
  162. package/dist/{schedules-0-aS4jDV.mjs → schedules-CwqC0Mp0.mjs} +5 -5
  163. package/dist/{schemaConverter-Cs3SwP4R.mjs → schemaConverter-XoLKVpzG.mjs} +2 -2
  164. package/dist/{schemaIR-By8XiNeE.mjs → schemaIR-DP7mMj7c.mjs} +16 -16
  165. package/dist/schemas/index.mjs +1 -1
  166. package/dist/scim/index.mjs +2 -2
  167. package/dist/scope/index.d.mts +6 -2
  168. package/dist/scope/index.mjs +5 -5
  169. package/dist/{scope-BWNAlBj0.mjs → scope-B0vgM2Zw.mjs} +4 -4
  170. package/dist/{shutdown-Cf-27xsS.mjs → shutdown-C76Hn-Th.mjs} +1 -1
  171. package/dist/{simpleEqualityMatcher-e-dgJcUO.mjs → simpleEqualityMatcher-Qbl-11cE.mjs} +1 -1
  172. package/dist/{sse-C3bj5qWi.mjs → sse-eyb8lNuI.mjs} +7 -7
  173. package/dist/{sseStream-BYZbpFDa.mjs → sseStream-BsBesrfw.mjs} +2 -2
  174. package/dist/{store-helpers-B9HierHY.mjs → store-helpers-D1yIVa91.mjs} +1 -1
  175. package/dist/{streaming-EN8NJWxr.mjs → streaming-DKziqs1Z.mjs} +1 -1
  176. package/dist/{subscriberIdentity-DSqCh38x.mjs → subscriberIdentity-DpdSQMQq.mjs} +1 -1
  177. package/dist/{tenancy-CAqjGQcQ.mjs → tenancy-YuRYsOPr.mjs} +2 -2
  178. package/dist/{tenantPreparation-CVBWarqs.mjs → tenantPreparation-Bk8ouRB3.mjs} +17 -5
  179. package/dist/testing/cleanupStoreContract.mjs +1 -1
  180. package/dist/testing/index.d.mts +4 -4
  181. package/dist/testing/index.mjs +11 -11
  182. package/dist/testing/outboxStoreContract.mjs +2 -2
  183. package/dist/testing/requiredPorts.d.mts +1 -1
  184. package/dist/testing/requiredPorts.mjs +2 -2
  185. package/dist/testing/storageContract.mjs +1 -1
  186. package/dist/{timing-CKI_Oyub.mjs → timing-BtIDIdQz.mjs} +1 -1
  187. package/dist/{transactionContext-D0UZFoSy.mjs → transactionContext-BsQ5ortM.mjs} +1 -1
  188. package/dist/{typeGuards-CLYkmBLT.mjs → typeGuards-Cr2_zEW0.mjs} +1 -1
  189. package/dist/types/index.d.mts +2 -2
  190. package/dist/types/index.mjs +1 -1
  191. package/dist/types/storage.mjs +1 -1
  192. package/dist/{types-BeEJm-DV.d.mts → types-CQhHTZXs.d.mts} +48 -35
  193. package/dist/{types-B4E0sc6D.d.mts → types-DWFgq8EP.d.mts} +1 -1
  194. package/dist/{types-Cunc4shv.mjs → types-ZvdR7MVa.mjs} +4 -4
  195. package/dist/usage/index.mjs +4 -4
  196. package/dist/{userHelpers-cT5j1kgp.mjs → userHelpers-CwpEK36a.mjs} +1 -1
  197. package/dist/utils/index.d.mts +1 -1
  198. package/dist/utils/index.mjs +12 -12
  199. package/dist/{utils-DlNkm1dI.mjs → utils-CnrfcYMq.mjs} +6 -6
  200. package/dist/{validate-63QThRoS.mjs → validate-BTQBh-Dr.mjs} +3 -3
  201. package/dist/{versioning-f2YGmh4i.mjs → versioning-DiLykI6U.mjs} +3 -3
  202. package/dist/{workScope-DwspXz70.mjs → workScope-C3tPz_Gt.mjs} +2 -2
  203. package/package.json +34 -9
  204. package/skills/arc/SKILL.md +5 -5
  205. package/skills/arc/references/api-reference.md +1 -1
  206. package/skills/arc/references/boot.md +17 -2
  207. package/skills/arc/references/events.md +0 -1
  208. package/skills/arc/references/mcp-setup.md +3 -2
  209. package/skills/arc/references/multi-tenancy.md +1 -1
  210. package/skills/arc/references/production-api.md +19 -12
  211. package/skills/arc/references/production-audit.md +1 -1
  212. package/skills/arc/references/production-boot.md +3 -3
  213. package/skills/arc/references/production-idempotency.md +2 -2
  214. package/skills/arc/references/production-observability.md +14 -2
  215. package/skills/arc/references/production-reliability.md +1 -1
  216. package/skills/arc/references/querying.md +1 -2
  217. package/skills/arc/references/resources.md +8 -6
  218. package/skills/arc/references/testing.md +1 -1
  219. package/skills/arc-code-review/references/arc-cheatsheet.md +1 -1
  220. package/skills/arc-code-review/references/recipe-scope-permissions.md +1 -1
  221. package/skills/arc-module-publishing/references/resource-assembly.md +2 -2
  222. package/dist/rateLimitKey-D9dl3FQn.mjs +0 -40
@@ -1,10 +1,10 @@
1
1
 
2
- import { h as ModuleSetupContext, m as ModuleDisposer, o as ArcPorts, p as PortName, r as ArcModuleInput, u as ModuleName } from "../types-BeEJm-DV.mjs";
3
- import "../index-CSbDhif4.mjs";
4
- import { r as CreateAppOptions } from "../index-yXXCsKl7.mjs";
2
+ import { _ as ModuleDisposer, g as PortName, o as ArcPorts, p as ModuleName, r as ArcModuleInput, v as ModuleSetupContext } from "../types-CQhHTZXs.mjs";
3
+ import "../index-CaBFPmnu.mjs";
4
+ import { r as CreateAppOptions } from "../index-CXqYFGoH.mjs";
5
5
  import { i as RequestScope } from "../types-DnkIALZ8.mjs";
6
6
  import { l as PermissionCheck, t as AnyRecord } from "../base-HXNgPQww.mjs";
7
- import { F as ResourceDefinition } from "../index-DLCcLUQT.mjs";
7
+ import { F as ResourceDefinition } from "../index-DtHACefu.mjs";
8
8
  import { StorageContractSetup, StorageContractSetupResult, runStorageContract } from "./storageContract.mjs";
9
9
  import { StandardRepo } from "@classytic/repo-core/repository";
10
10
  import { FastifyInstance, FastifyServerOptions } from "fastify";
@@ -1,13 +1,13 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
- import { d as resolveModule, l as isLazyBridge, o as resolveModuleClosure } from "../plan-CbDTFbTj.mjs";
3
- import { h as asModulePorts, r as createApp } from "../createApp-BC67ACu4.mjs";
4
- import { n as getModuleExports } from "../module-C0JCsnO7.mjs";
5
- import { g as getUserId } from "../types-Cunc4shv.mjs";
6
- import { t as defineAggregation } from "../defineAggregation-DqAGb5oI.mjs";
7
- import { f as BaseController } from "../plugin-8Z1khbAI.mjs";
8
- import { t as defineResource } from "../defineResource-DC5UqkQv.mjs";
9
- import { t as CRUD_OPERATIONS } from "../constants-Ca2IQFy2.mjs";
10
- import { E as requireOrgRole } from "../permissions-Cga6KBOX.mjs";
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
+ import { d as resolveModule, l as isLazyBridge, o as resolveModuleClosure } from "../plan-BhKHIkFl.mjs";
3
+ import { h as asModulePorts, r as createApp } from "../createApp-CEdGZtkP.mjs";
4
+ import { n as getModuleExports } from "../module-BLrTmMyk.mjs";
5
+ import { g as getUserId } from "../types-ZvdR7MVa.mjs";
6
+ import { t as defineAggregation } from "../defineAggregation-DUsrGcsm.mjs";
7
+ import { f as BaseController } from "../plugin-D6hrdx-j.mjs";
8
+ import { t as defineResource } from "../defineResource-q8TsJpOm.mjs";
9
+ import { t as CRUD_OPERATIONS } from "../constants-D9EiaO5s.mjs";
10
+ import { E as requireOrgRole } from "../permissions-CEyeDHtT.mjs";
11
11
  import { runStorageContract } from "./storageContract.mjs";
12
12
  import Fastify from "fastify";
13
13
  import { mkdir, mkdtemp, readFile, readdir, rm, stat } from "node:fs/promises";
@@ -1873,7 +1873,7 @@ function pickDefaultAuth(authMode, callerAuth) {
1873
1873
  };
1874
1874
  }
1875
1875
  async function createTestApp(options = {}) {
1876
- const { createApp } = await import("../createApp-BC67ACu4.mjs").then((n) => n.i);
1876
+ const { createApp } = await import("../createApp-CEdGZtkP.mjs").then((n) => n.i);
1877
1877
  const { resources = [], db = "in-memory", connectMongoose = false, authMode = "jwt", defaultOrgId, plugins, auth: callerAuth, ...appOptions } = options;
1878
1878
  let dbHandle;
1879
1879
  let dbUri;
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
- import { t as claimedAttempts } from "../claimed-DsP5Hi_f.mjs";
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
+ import { t as claimedAttempts } from "../claimed-CM_-lFHX.mjs";
3
3
  import { OutboxConflictError, OutboxOwnershipError } from "@classytic/primitives/outbox";
4
4
  import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
5
5
  // src/testing/outboxStoreContract.ts
@@ -1,5 +1,5 @@
1
1
 
2
- import { r as ArcModuleInput } from "../types-BeEJm-DV.mjs";
2
+ import { r as ArcModuleInput } from "../types-CQhHTZXs.mjs";
3
3
  export interface RequiredPortsOptions {
4
4
  /** Modules composed alongside — the peers the module `dependsOn` or `requires.modules`. */
5
5
  readonly with?: readonly ArcModuleInput[];
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
- import { c as declareModules, d as resolveModule, i as planModules, r as compositionProblems } from "../plan-CbDTFbTj.mjs";
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
+ import { c as declareModules, d as resolveModule, i as planModules, r as compositionProblems } from "../plan-BhKHIkFl.mjs";
3
3
  // src/testing/requiredPorts.ts
4
4
  /**
5
5
  * Assert a module declares EXACTLY `ports` as required, and that composing it without any one of
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
2
  import { afterAll, beforeAll, describe, expect, it } from "vitest";
3
3
  // src/testing/storageContract.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
2
  import { createHash } from "node:crypto";
3
3
  // src/utils/operationIdentity.ts
4
4
  /** Security context included in idempotency identities across transports. */
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  // src/context/transactionContext.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
2
  // src/utils/typeGuards.ts
3
3
  /** Check if fastify has the events plugin registered */
4
4
  function hasEvents(instance) {
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { i as RequestScope } from "../types-DnkIALZ8.mjs";
3
3
  import { a as UserLike, c as DataPolicy, d as UserBase, i as ObjectId, l as PermissionCheck, n as ArcRequest, o as UserOrganization, r as JWTPayload, s as AuthorizationDecision, t as AnyRecord, u as PermissionContext } from "../base-HXNgPQww.mjs";
4
- import { $ as ResourceHookContext, A as RequestWithExtras, At as RouteMethod, B as OnTenantDeleteConfig, Bn as ControllerLike, C as RequestIdOptions, Ct as ResourceCacheConfig, D as FastifyWithAuth, Dt as ActionsMap, E as FastifyRequestExtras, Et as ActionHandlerFn, Fn as MutationWriteContext, Ft as AuthenticatorContext, G as CrudRouteKey, Gn as RawRouteHandler, H as PresetFunction, Hn as IController, I as CrudController, In as ResourceWrites, It as JwtContext, J as MiddlewareConfig, K as CrudSchemas, Kn as RouteHandler, L as ResourceConfig, Ln as WriteContext, Lt as TokenPair, Mt as AuthHelpers, Nt as AuthPluginOptions, O as FastifyWithDecorators, On as BaseControllerOptions, Ot as RouteDefinition, Pt as Authenticator, Q as FieldRule, R as ResourceIdempotencyConfig, Rn as WriteVerbKey, S as IntrospectionPluginOptions, T as EventsDecorator, Tt as ActionEntry, U as PresetHook, Un as IControllerResponse, V as ResolvedTenantPurge, Vn as FastifyHandler, W as PresetResult, Wn as IRequestContext, X as RouteSchemaOptions, Y as OpenApiSchemas, Z as ArcFieldRule, _ as ServiceContext, a as IntrospectionData, b as HealthCheck, c as ResourceMetadata, d as LookupOption, et as ResourceHooks, f as OwnershipCheck, g as RequestContext, h as QueryParserInterface, i as PaginationResult, jt as RateLimitConfig, k as MiddlewareHandler, kt as RouteMcpConfig, l as ArcInternalMetadata, m as PopulateOption, n as InferDocType, nt as EventDefinition, o as RegistryEntry, p as ParsedQuery, q as LookupPolicy, r as InferResourceDoc, s as RegistryStats, t as InferAdapterDoc, tt as ResourceExtensions, u as ControllerQueryOptions, v as CrudRouterOptions, w as ArcDecorator, wt as ActionDefinition, x as HealthOptions, y as GracefulShutdownOptions, z as ResourcePermissions, zn as ControllerHandler } from "../index-DLCcLUQT.mjs";
4
+ import { $ as FieldRule, A as RequestWithExtras, At as RouteMcpConfig, B as OnTenantDeleteConfig, Bn as ControllerHandler, C as RequestIdOptions, D as FastifyWithAuth, Dt as ActionHandlerFn, E as FastifyRequestExtras, Et as ActionEntry, Ft as Authenticator, G as PresetResult, Gn as IRequestContext, H as PresetController, Hn as FastifyHandler, I as CrudController, In as MutationWriteContext, It as AuthenticatorContext, J as LookupPolicy, K as CrudRouteKey, Kn as RawRouteHandler, L as ResourceConfig, Ln as ResourceWrites, Lt as JwtContext, Mt as RateLimitConfig, Nt as AuthHelpers, O as FastifyWithDecorators, Ot as ActionsMap, Pt as AuthPluginOptions, Q as ArcFieldRule, R as ResourceIdempotencyConfig, Rn as WriteContext, Rt as TokenPair, S as IntrospectionPluginOptions, T as EventsDecorator, Tt as ActionDefinition, U as PresetFunction, Un as IController, V as ResolvedTenantPurge, Vn as ControllerLike, W as PresetHook, Wn as IControllerResponse, X as OpenApiSchemas, Y as MiddlewareConfig, Z as RouteSchemaOptions, _ as ServiceContext, a as IntrospectionData, b as HealthCheck, c as ResourceMetadata, d as LookupOption, et as ResourceHookContext, f as OwnershipCheck, g as RequestContext, h as QueryParserInterface, i as PaginationResult, jt as RouteMethod, k as MiddlewareHandler, kn as BaseControllerOptions, kt as RouteDefinition, l as ArcInternalMetadata, m as PopulateOption, n as InferDocType, nt as ResourceExtensions, o as RegistryEntry, p as ParsedQuery, q as CrudSchemas, qn as RouteHandler, r as InferResourceDoc, rt as EventDefinition, s as RegistryStats, t as InferAdapterDoc, tt as ResourceHooks, u as ControllerQueryOptions, v as CrudRouterOptions, w as ArcDecorator, wt as ResourceCacheConfig, x as HealthOptions, y as GracefulShutdownOptions, z as ResourcePermissions, zn as WriteVerbKey } from "../index-DtHACefu.mjs";
5
5
  import { n as ElevationOptions, t as ElevationEvent } from "../elevation-DPD0hcU-.mjs";
6
- export type { ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AnyRecord, ArcDecorator, ArcFieldRule, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, AuthorizationDecision, BaseControllerOptions, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRouteKey, CrudRouterOptions, CrudSchemas, DataPolicy, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, LookupOption, LookupPolicy, MiddlewareConfig, MiddlewareHandler, MutationWriteContext, ObjectId, OnTenantDeleteConfig, OpenApiSchemas, OwnershipCheck, PaginationResult, ParsedQuery, PermissionCheck, PermissionContext, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryParserInterface, RateLimitConfig, RawRouteHandler, RegistryEntry, RegistryStats, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResolvedTenantPurge, ResourceCacheConfig, ResourceConfig, ResourceExtensions, ResourceHookContext, ResourceHooks, ResourceIdempotencyConfig, ResourceMetadata, ResourcePermissions, ResourceWrites, RouteDefinition, RouteHandler, RouteMcpConfig, RouteMethod, RouteSchemaOptions, ServiceContext, TokenPair, UserBase, UserLike, UserOrganization, WriteContext, WriteVerbKey };
6
+ export type { ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AnyRecord, ArcDecorator, ArcFieldRule, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, AuthorizationDecision, BaseControllerOptions, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRouteKey, CrudRouterOptions, CrudSchemas, DataPolicy, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, LookupOption, LookupPolicy, MiddlewareConfig, MiddlewareHandler, MutationWriteContext, ObjectId, OnTenantDeleteConfig, OpenApiSchemas, OwnershipCheck, PaginationResult, ParsedQuery, PermissionCheck, PermissionContext, PopulateOption, PresetController, PresetFunction, PresetHook, PresetResult, QueryParserInterface, RateLimitConfig, RawRouteHandler, RegistryEntry, RegistryStats, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResolvedTenantPurge, ResourceCacheConfig, ResourceConfig, ResourceExtensions, ResourceHookContext, ResourceHooks, ResourceIdempotencyConfig, ResourceMetadata, ResourcePermissions, ResourceWrites, RouteDefinition, RouteHandler, RouteMcpConfig, RouteMethod, RouteSchemaOptions, ServiceContext, TokenPair, UserBase, UserLike, UserOrganization, WriteContext, WriteVerbKey };
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
2
  export {};
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
2
  export {};
@@ -1,41 +1,9 @@
1
1
 
2
2
  import { n as DomainEvent, r as EventHandler } from "./EventTransport-CYEoCJGe.mjs";
3
3
  import { n as ErrorMapper } from "./errorHandler-B9r88jZV.mjs";
4
+ import { t as HealthCheck } from "./health-skjSwNaC.mjs";
4
5
  import { FastifyInstance, FastifyPluginAsync } from "fastify";
5
6
  import { LockAdapter } from "@classytic/repo-core/lock";
6
- interface HealthCheck {
7
- /** Name of the dependency */
8
- name: string;
9
- /**
10
- * Function that returns true if healthy, false otherwise.
11
- *
12
- * Receives an `AbortSignal` aborted when the check's timeout elapses —
13
- * pass it to fetch/driver calls so a stalled dependency probe actually
14
- * STOPS instead of accumulating an abandoned operation per readiness
15
- * poll. Ignoring the parameter is fine (back-compat): the timeout still
16
- * bounds how long the PROBE waits, just not the underlying work.
17
- */
18
- check: (signal?: AbortSignal) => Promise<boolean> | boolean;
19
- /** Optional timeout in ms (default: 5000) */
20
- timeout?: number;
21
- /** Whether this check is critical for readiness (default: true) */
22
- critical?: boolean;
23
- }
24
- interface HealthOptions {
25
- /** Route prefix (default: '/_health') */
26
- prefix?: string;
27
- /** Health check dependencies */
28
- checks?: readonly HealthCheck[];
29
- /** Enable metrics endpoint (default: false) */
30
- metrics?: boolean;
31
- /** Custom metrics collector function */
32
- metricsCollector?: () => Promise<string> | string;
33
- /** Version info to include in responses */
34
- version?: string;
35
- /** Collect HTTP request metrics (default: true if metrics enabled) */
36
- collectHttpMetrics?: boolean;
37
- }
38
- declare const _default$1: FastifyPluginAsync<HealthOptions>;
39
7
  /**
40
8
  * Daily gate — "once per LOCAL calendar day, at/after a wall-clock time in an IANA zone".
41
9
  *
@@ -525,9 +493,54 @@ interface EventHandlerDefinition {
525
493
  */
526
494
  durability?: "retry" | "boundary";
527
495
  }
528
- interface ArcModule<TExports = unknown, TPorts extends PortName = PortName, TOptionalPorts extends PortName = PortName> {
496
+ /**
497
+ * The decisions a module's factory made from its own config, as plain data
498
+ * (strings, numbers, booleans, null, arrays, plain objects). Printed by
499
+ * `arc describe` and the boot error, so NEVER put a secret in it.
500
+ */
501
+ type ModuleFacts = {
502
+ readonly [key: string]: unknown;
503
+ };
504
+ /** Every composed module's facts by name (`{}` for a module that declares none). */
505
+ type ComposedModuleFacts = {
506
+ readonly [moduleName: string]: ModuleFacts | undefined;
507
+ };
508
+ /**
509
+ * A rule over facts, evaluated once at boot before any module setup. Fatal under every
510
+ * preset: every failure is collected, then boot throws one `ArcBootError`.
511
+ */
512
+ interface ModuleInvariant<TFacts extends ModuleFacts = ModuleFacts> {
513
+ /** Stable code, conventionally `<module>.<rule>`, e.g. `media.upload-receiver`. */
514
+ readonly code: string;
515
+ /** One line telling the operator what to change. */
516
+ readonly fix: string;
517
+ /**
518
+ * Pure and synchronous: `true` passes; `false` or a short reason string fails.
519
+ * `all` holds every composed module's facts by name, for cross-module rules.
520
+ */
521
+ check(facts: Readonly<TFacts>, all: ComposedModuleFacts): boolean | string;
522
+ }
523
+ interface ArcModule<TExports = unknown, TPorts extends PortName = PortName, TOptionalPorts extends PortName = PortName, TFacts extends ModuleFacts = ModuleFacts> {
529
524
  /** Stable identifier — appears in boot logs and duplicate-module detection. */
530
525
  readonly name: string;
526
+ /**
527
+ * The config decisions this module's factory made, as plain serialisable data — no
528
+ * secrets. Read by `invariants` (this module's and others') and printed by `arc describe`.
529
+ */
530
+ readonly facts?: TFacts;
531
+ /**
532
+ * Rules over `facts` checked before any module's `plugins`/`bootstrap` runs, so a
533
+ * module that contradicts itself (or a sibling) never boots:
534
+ *
535
+ * ```ts
536
+ * defineModule({ name: "media",
537
+ * facts: { driver: cfg.driver, uploadReceiver: cfg.receiver },
538
+ * invariants: [{ code: "media.upload-receiver", fix: "enable the receiver or use a cloud driver",
539
+ * check: (f) => f.driver !== "local" || f.uploadReceiver || "local driver with the receiver off" }],
540
+ * })
541
+ * ```
542
+ */
543
+ readonly invariants?: readonly ModuleInvariant<TFacts>[];
531
544
  /**
532
545
  * Names of modules this one must be composed AFTER. A dependency's
533
546
  * `bootstrap` (and its `fastify.arc.modules[dep]` export) is always live
@@ -822,4 +835,4 @@ interface ArcCompositionConfig {}
822
835
  type ModuleName = ArcCompositionConfig extends {
823
836
  readonly strictModuleNames: true;
824
837
  } ? keyof ArcModuleRegistry & string : string;
825
- export { DailyLedger as A, ScheduleStats as C, DailyClock as D, DailyClaimInfo as E, HealthCheck as F, HealthOptions as I, _default$1 as L, MemoryDailyLedger as M, createDailyGate as N, DailyGate as O, createMemoryDailyLedger as P, ScheduleRunContext as S, _default as T, ResourceLike as _, ArcPortRegistry as a, DailyScheduleOptions as b, LazyBridge as c, ModulePorts as d, ModuleRequirements as f, LoadResourcesOptions as g, ModuleSetupContext as h, ArcModuleRegistry as i, DailyRunOutcome as j, DailyGateOptions as k, ModuleContribution as l, ModuleDisposer as m, ArcModule as n, ArcPorts as o, PortName as p, ArcModuleInput as r, EventHandlerDefinition as s, ArcCompositionConfig as t, ModuleName as u, ResourceModule as v, SchedulesPluginOptions as w, ScheduleDefinition as x, loadResources as y };
838
+ export { DailyClock as A, DailyScheduleOptions as C, SchedulesPluginOptions as D, ScheduleStats as E, MemoryDailyLedger as F, createDailyGate as I, createMemoryDailyLedger as L, DailyGateOptions as M, DailyLedger as N, _default as O, DailyRunOutcome as P, loadResources as S, ScheduleRunContext as T, ModuleDisposer as _, ArcPortRegistry as a, ResourceLike as b, EventHandlerDefinition as c, ModuleFacts as d, ModuleInvariant as f, PortName as g, ModuleRequirements as h, ArcModuleRegistry as i, DailyGate as j, DailyClaimInfo as k, LazyBridge as l, ModulePorts as m, ArcModule as n, ArcPorts as o, ModuleName as p, ArcModuleInput as r, ComposedModuleFacts as s, ArcCompositionConfig as t, ModuleContribution as u, ModuleSetupContext as v, ScheduleDefinition as w, ResourceModule as x, LoadResourcesOptions as y };
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { i as ResourceRateLimiter } from "./resourceRateLimit-BPiESPtG.mjs";
3
- import { F as ResourceDefinition } from "./index-DLCcLUQT.mjs";
3
+ import { F as ResourceDefinition } from "./index-DtHACefu.mjs";
4
4
  import { z } from "zod";
5
5
  /** Behavioral hints for MCP clients (tool annotations per MCP spec) */
6
6
  interface ToolAnnotations {
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
- import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-DxpHZBlW.mjs";
3
- import { n as requireSingleHeaderValue } from "./headers-Bh47h0XH.mjs";
4
- import { t as getUserId$1 } from "./userHelpers-cT5j1kgp.mjs";
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
+ import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-Ukhmfmmx.mjs";
3
+ import { n as requireSingleHeaderValue } from "./headers-Ib7BDgRI.mjs";
4
+ import { t as getUserId$1 } from "./userHelpers-CwpEK36a.mjs";
5
5
  // src/scope/types.ts
6
6
  /**
7
7
  * Request Scope — The One Standard
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
- import { t as ArcError } from "../errors-DxpHZBlW.mjs";
3
- import { c as getOrgId, g as getUserId, i as getClientId } from "../types-Cunc4shv.mjs";
4
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-B8IT7xiQ.mjs";
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
+ import { t as ArcError } from "../errors-Ukhmfmmx.mjs";
3
+ import { c as getOrgId, g as getUserId, i as getClientId } from "../types-ZvdR7MVa.mjs";
4
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-DY20Pibh.mjs";
5
5
  import { usagePeriod } from "@classytic/repo-core/usage";
6
6
  import fp from "fastify-plugin";
7
7
  // src/usage/requireQuota.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
2
  // src/utils/userHelpers.ts
3
3
  /**
4
4
  * Extract a user ID from a user object. Accepts `id` or `_id` — returns
@@ -2,7 +2,7 @@
2
2
  import { a as NotFoundError, c as RateLimitError, d as ValidationError, f as createDomainError, i as ForbiddenError, l as ServiceUnavailableError, m as isArcError, n as ConflictError, o as OrgAccessDeniedError, p as createError, r as ErrorOptions, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-DTo0me1o.mjs";
3
3
  import { n as ErrorMapper } from "../errorHandler-B9r88jZV.mjs";
4
4
  import { F as getHeader, I as requireSingleHeaderValue, P as ArcHeaders } from "../types-DnkIALZ8.mjs";
5
- import { Y as OpenApiSchemas, h as QueryParserInterface, p as ParsedQuery } from "../index-DLCcLUQT.mjs";
5
+ import { X as OpenApiSchemas, h as QueryParserInterface, p as ParsedQuery } from "../index-DtHACefu.mjs";
6
6
  import { a as SSE_DEFAULT_DRAIN_TIMEOUT_MS, c as SseStreamOptions, i as registerSseStats, l as openSseStream, n as SseConnectionGauge, o as SSE_DEFAULT_MAX_BUFFERED_BYTES, r as createSseConnectionGauge, s as SseStream, t as SSEStats } from "../sseStats-DQqNN385.mjs";
7
7
  import { f as getUserId, m as normalizeRoles, p as getUserRoles, t as AnyRecord } from "../base-HXNgPQww.mjs";
8
8
  import { errorContractSchema } from "@classytic/repo-core/errors";
@@ -1,13 +1,13 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
- import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-DxpHZBlW.mjs";
3
- import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-e-dgJcUO.mjs";
4
- import { n as requireSingleHeaderValue, t as getHeader } from "../headers-Bh47h0XH.mjs";
5
- import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-cT5j1kgp.mjs";
6
- import { A as MONGO_DIALECT, C as listResponse, D as responses, E as queryParams, O as ArcQueryParser, S as keysetListResponse, T as paginationSchema, _ as bareListResponse, a as defineGuard, b as getDefaultCrudSchemas, c as withCompensation, d as CircuitBreakerError, f as CircuitBreakerRegistry, g as aggregateListResponse, h as createCircuitBreakerRegistry, i as handleRaw, j as NEUTRAL_DIALECT, k as createQueryParser, l as RedisCircuitBreakerState, m as createCircuitBreaker, n as createReplayHub, o as defineErrorMapper, p as CircuitState, r as lastEventIdOf, s as defineCompensation, t as createStateMachine, u as CircuitBreaker, v as deleteResponse, w as offsetListResponse, x as getListQueryParams, y as errorContractSchema } from "../utils-DlNkm1dI.mjs";
7
- import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-Cs3SwP4R.mjs";
8
- import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-EN8NJWxr.mjs";
9
- import { a as registerSseStats, i as createSseConnectionGauge, n as SSE_DEFAULT_MAX_BUFFERED_BYTES, r as openSseStream, t as SSE_DEFAULT_DRAIN_TIMEOUT_MS } from "../sseStream-BYZbpFDa.mjs";
10
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-B8IT7xiQ.mjs";
11
- import { i as runAdmittedWork, r as registerShutdownParticipant } from "../shutdown-Cf-27xsS.mjs";
12
- import { t as hasEvents } from "../typeGuards-CLYkmBLT.mjs";
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
+ import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-Ukhmfmmx.mjs";
3
+ import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-Qbl-11cE.mjs";
4
+ import { n as requireSingleHeaderValue, t as getHeader } from "../headers-Ib7BDgRI.mjs";
5
+ import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-CwpEK36a.mjs";
6
+ import { A as MONGO_DIALECT, C as listResponse, D as responses, E as queryParams, O as ArcQueryParser, S as keysetListResponse, T as paginationSchema, _ as bareListResponse, a as defineGuard, b as getDefaultCrudSchemas, c as withCompensation, d as CircuitBreakerError, f as CircuitBreakerRegistry, g as aggregateListResponse, h as createCircuitBreakerRegistry, i as handleRaw, j as NEUTRAL_DIALECT, k as createQueryParser, l as RedisCircuitBreakerState, m as createCircuitBreaker, n as createReplayHub, o as defineErrorMapper, p as CircuitState, r as lastEventIdOf, s as defineCompensation, t as createStateMachine, u as CircuitBreaker, v as deleteResponse, w as offsetListResponse, x as getListQueryParams, y as errorContractSchema } from "../utils-CnrfcYMq.mjs";
7
+ import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-XoLKVpzG.mjs";
8
+ import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-DKziqs1Z.mjs";
9
+ import { a as registerSseStats, i as createSseConnectionGauge, n as SSE_DEFAULT_MAX_BUFFERED_BYTES, r as openSseStream, t as SSE_DEFAULT_DRAIN_TIMEOUT_MS } from "../sseStream-BsBesrfw.mjs";
10
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-DY20Pibh.mjs";
11
+ import { i as runAdmittedWork, r as registerShutdownParticipant } from "../shutdown-C76Hn-Th.mjs";
12
+ import { t as hasEvents } from "../typeGuards-Cr2_zEW0.mjs";
13
13
  export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, RedisCircuitBreakerState, SSE_DEFAULT_DRAIN_TIMEOUT_MS, SSE_DEFAULT_MAX_BUFFERED_BYTES, ServiceUnavailableError, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, ValidationError, aggregateListResponse, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createReplayHub, createSseConnectionGauge, createStateMachine, declareRuntimeCapability, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, lastEventIdOf, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, registerShutdownParticipant, registerSseStats, requireSingleHeaderValue, responses, runAdmittedWork, simpleEqualityMatcher, toJsonSchema, withCompensation };
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
- import { t as ArcError, u as ValidationError } from "./errors-DxpHZBlW.mjs";
3
- import { t as runObservingSend } from "./observeSend-DfNkdGww.mjs";
4
- import { h as RESERVED_QUERY_PARAMS } from "./constants-Ca2IQFy2.mjs";
5
- import { t as arcLog } from "./logger-DJwz_-Pl.mjs";
6
- import { a as registerSseStats } from "./sseStream-BYZbpFDa.mjs";
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
+ import { t as ArcError, u as ValidationError } from "./errors-Ukhmfmmx.mjs";
3
+ import { t as runObservingSend } from "./observeSend-B7FEdk_g.mjs";
4
+ import { h as RESERVED_QUERY_PARAMS } from "./constants-D9EiaO5s.mjs";
5
+ import { t as arcLog } from "./logger-DdMS0XC_.mjs";
6
+ import { a as registerSseStats } from "./sseStream-BsBesrfw.mjs";
7
7
  import { errorContractSchema as errorContractSchema$1 } from "@classytic/repo-core/errors";
8
8
  import { readEnv } from "@classytic/primitives/environment";
9
9
  import { OPERATOR_DESCRIPTIONS, URL_OPERATORS, escapeRegex, isQueryGrammarError, readFilterClauses, readPageRequest, readSearch, readSelect, readSort } from "@classytic/repo-core/query-parser";
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-BBBkGgwA.mjs";
3
- import { x as pathTouchesBlocked } from "./plugin-8Z1khbAI.mjs";
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-Cy6j0m8_.mjs";
3
+ import { x as pathTouchesBlocked } from "./plugin-D6hrdx-j.mjs";
4
4
  // src/core/aggregation/normalize.ts
5
5
  /**
6
6
  * Framework cap on URL-driven aggregation limits when the host opts
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-BBBkGgwA.mjs";
3
- import { d as createDomainError } from "./errors-DxpHZBlW.mjs";
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-Cy6j0m8_.mjs";
3
+ import { d as createDomainError } from "./errors-Ukhmfmmx.mjs";
4
4
  import fp from "fastify-plugin";
5
5
  // src/plugins/versioning.ts
6
6
  var versioning_exports = /* @__PURE__ */ __exportAll({ default: () => versioning_default });
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.52.0 | MIT | https://classytic.com */
2
- import { n as requestContext } from "./requestContext-yc7MSgmq.mjs";
1
+ /*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
2
+ import { n as requestContext } from "./requestContext-B-TjFpWt.mjs";
3
3
  // src/context/workScope.ts
4
4
  /** Enter a scope for `fn`, or run it inside the active one. */
5
5
  function runWorkScope(seed, fn) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classytic/arc",
3
- "version": "2.52.0",
3
+ "version": "2.53.0",
4
4
  "description": "Resource-oriented backend framework for Fastify - clean, minimal, powerful, tree-shakable",
5
5
  "type": "module",
6
6
  "exports": {
@@ -338,6 +338,7 @@
338
338
  "check:type-lane": "node scripts/check-type-lane.mjs",
339
339
  "lint": "biome check src/ && npm run check:skills",
340
340
  "check:skills": "node scripts/check-skills.mjs",
341
+ "check:docs-imports": "node scripts/check-docs-imports.mjs",
341
342
  "lint:fix": "biome check --fix src/",
342
343
  "lint:all": "biome check src/ tests/",
343
344
  "test": "vitest run",
@@ -399,12 +400,16 @@
399
400
  "@modelcontextprotocol/client": ">=2.4.0",
400
401
  "@modelcontextprotocol/node": ">=2.1.2",
401
402
  "@modelcontextprotocol/server": ">=2.4.0",
402
- "@opentelemetry/api": ">=1.9.0",
403
- "@opentelemetry/auto-instrumentations-node": ">=0.40.0",
404
- "@opentelemetry/exporter-trace-otlp-http": ">=0.50.0",
405
- "@opentelemetry/instrumentation-http": ">=0.50.0",
406
- "@opentelemetry/instrumentation-mongodb": ">=0.40.0",
407
- "@opentelemetry/sdk-node": ">=0.50.0",
403
+ "@opentelemetry/api": ">=1.10.0",
404
+ "@opentelemetry/auto-instrumentations-node": ">=0.83.1",
405
+ "@opentelemetry/context-async-hooks": ">=3.1.1",
406
+ "@opentelemetry/core": ">=3.1.1",
407
+ "@opentelemetry/exporter-trace-otlp-http": ">=0.301.2",
408
+ "@opentelemetry/instrumentation-http": ">=0.301.2",
409
+ "@opentelemetry/instrumentation-mongodb": ">=0.78.0",
410
+ "@opentelemetry/resources": ">=3.1.1",
411
+ "@opentelemetry/sdk-trace": ">=3.1.1",
412
+ "@opentelemetry/semantic-conventions": ">=1.45.0",
408
413
  "better-auth": ">=1.7.18",
409
414
  "bullmq": ">=6.7.2",
410
415
  "fastify": ">=5.12.8",
@@ -465,6 +470,12 @@
465
470
  "@opentelemetry/auto-instrumentations-node": {
466
471
  "optional": true
467
472
  },
473
+ "@opentelemetry/context-async-hooks": {
474
+ "optional": true
475
+ },
476
+ "@opentelemetry/core": {
477
+ "optional": true
478
+ },
468
479
  "@opentelemetry/exporter-trace-otlp-http": {
469
480
  "optional": true
470
481
  },
@@ -474,7 +485,13 @@
474
485
  "@opentelemetry/instrumentation-mongodb": {
475
486
  "optional": true
476
487
  },
477
- "@opentelemetry/sdk-node": {
488
+ "@opentelemetry/resources": {
489
+ "optional": true
490
+ },
491
+ "@opentelemetry/sdk-trace": {
492
+ "optional": true
493
+ },
494
+ "@opentelemetry/semantic-conventions": {
478
495
  "optional": true
479
496
  },
480
497
  "better-auth": {
@@ -538,7 +555,15 @@
538
555
  "@modelcontextprotocol/client": "^2.4.0",
539
556
  "@modelcontextprotocol/node": "^2.1.2",
540
557
  "@modelcontextprotocol/server": "^2.4.0",
541
- "@opentelemetry/api": "^1.10.0",
558
+ "@opentelemetry/api": "1.10.0",
559
+ "@opentelemetry/auto-instrumentations-node": "0.83.1",
560
+ "@opentelemetry/context-async-hooks": "3.1.1",
561
+ "@opentelemetry/exporter-trace-otlp-http": "0.301.2",
562
+ "@opentelemetry/instrumentation-http": "0.301.2",
563
+ "@opentelemetry/instrumentation-mongodb": "0.78.0",
564
+ "@opentelemetry/resources": "3.1.1",
565
+ "@opentelemetry/sdk-trace": "3.1.1",
566
+ "@opentelemetry/semantic-conventions": "1.45.0",
542
567
  "@types/node": "^26.6.6",
543
568
  "@types/qs": "^6.15.1",
544
569
  "@vitest/coverage-v8": "^5.1.0",
@@ -56,16 +56,16 @@ const app = await createApp({
56
56
  });
57
57
  ```
58
58
 
59
- Validated route, parsed once:
59
+ Custom route, parsed once. A function `handler` runs the full pipeline and becomes an MCP tool:
60
60
 
61
61
  ```typescript
62
62
  import { parsed, routeInput } from '@classytic/arc/core';
63
63
  const body = z.object({ title: z.string().trim().min(2), tags: z.array(z.string()).default([]) });
64
64
  routes: [{ method: 'POST', path: '/notes', permissions: requireAuth(), ...routeInput({ body }),
65
- rawHandler: async (req, reply) => reply.send(await notes.create(parsed(body, req.body))) }]
65
+ handler: async (ctx) => ({ data: await notes.create(parsed(body, ctx.body)) }) }]
66
66
  ```
67
67
 
68
- Daily job: `scheduledJobs: [{ name: 'sweep', every: 600_000, daily: { hour: 2, zone: 'Asia/Dhaka', ledger }, handler: async (f, ctx) => sweep(ctx?.day) }]`.
68
+ `rawHandler: (req, reply)` skips the pipeline: only for streams, raw-body webhooks, files, redirects.
69
69
 
70
70
  Test: `const ctx = await createTestApp({ resources: [productResource] }); expectArc(await ctx.app.inject({ method: 'GET', url: '/products' })).ok();`
71
71
 
@@ -75,8 +75,8 @@ Test: `const ctx = await createTestApp({ resources: [productResource] }); expect
75
75
  - `.default()` stays optional on the wire (zod input direction); `.refine()` needs `routeInput` or `parse: true`.
76
76
  - `request.user` is undefined on public routes: guard it.
77
77
  - Public + row filter needs `allowPublic({ policy })`, not `allow({ policy })`.
78
- - A non-writable field in a body is 403; an `immutable` field is silently stripped.
79
- - An unknown filter key is dropped (widens results): `strictFilterFields: true`.
78
+ - A non-writable or `immutable` field in a body is 403, not stripped.
79
+ - An unknown filter key is 400, not dropped; `strictFilterFields: false` drops.
80
80
  - `distributed` runtime needs shared stores and a schedule `lock` or `singleReplica`.
81
81
  - Own `setNotFoundHandler` needs `errorHandler: { notFound: false }`.
82
82
  - Refusing hook: `return reply.send(...)` or throw, never a bare send.
@@ -6,7 +6,7 @@ Import only from these subpaths (tree-shaken, no deep imports). Authoritative li
6
6
  |---|---|
7
7
  | `@classytic/arc` | `defineResource`, `defineAction`, `defineAggregation`, `defineResourceVariants`, `mergeResourceConfig`, `BaseController`, `BaseCrudController`, `BulkMixin`, `SlugMixin`, `SoftDeleteMixin`, `TreeMixin`, permission helpers, `ArcError`, `NotFoundError`, `ValidationError`, `createDomainError`, constants (`CRUD_OPERATIONS`, `DEFAULT_LIMIT` ...) |
8
8
  | `/core` | Same resource and controller API plus `routeInput`, `crudInput`, `parsed`, `noPayloadSchema`, `createCrudRouter`, `QueryResolver`, `AccessControl`, `BodySanitizer`, `validateResourceConfig` |
9
- | `/factory` | `createApp`, `createWorker`, `loadResources`, `defineModule`, `extendModule`, `getModuleExports`, `orderModules`, `planModules`, `verifyModuleGraph`, `renderModuleGraph`, `toAsyncApi`, `toFetchHandler`, `eventTopology`, `verifyEventDurability`, `createRelayNudge`, presets (`productionPreset`, `developmentPreset`, `testingPreset`, `edgePreset`) |
9
+ | `/factory` | `createApp`, `createWorker`, `loadResources`, `defineModule`, `ArcBootError`, `extendModule`, `getModuleExports`, `orderModules`, `planModules`, `verifyModuleGraph`, `renderModuleGraph`, `toAsyncApi`, `toFetchHandler`, `eventTopology`, `verifyEventDurability`, `createRelayNudge`, presets (`productionPreset`, `developmentPreset`, `testingPreset`, `edgePreset`) |
10
10
  | `/permissions` | `allowPublic`, `requireAuth`, `requireRoles`, `requireOwnership`, `requireOrgMembership`, `requireOrgRole`, `requireTeamMembership`, `requireServiceScope`, `requireScopeContext`, `requireOrgInScope`, `requirePlatformRole`, `requireGrant`, `requireAgentScope`, `requireMandate`, `requireDPoP`, `allOf`, `anyOf`, `not`, `when`, `allow`, `deny`, `denyAll`, `permissionMatrix`, `createDynamicPermissionMatrix`, `createRoleHierarchy`, `fields`, `roles`, `introspectModule` |
11
11
  | `/scope` | `getUserId`, `getOrgId`, `getOrgRoles`, `getTeamId`, `getClientId`, `getScopeContext`, `getRequestScope`, `getServiceScopes`, `getMandate`, `getDPoPJkt`, `isMember`, `isService`, `isElevated`, `isAuthenticated`, `hasOrgAccess`, `isOrgInScope`, `requireUserId`, `requireOrgId`, `requireTeamId`, `requireClientId`, `elevationPlugin`, `createTenantKeyGenerator`, `PUBLIC_SCOPE`, `AUTHENTICATED_SCOPE` |
12
12
  | `/presets` (+ `/presets/tenant`, `/files-upload`, `/search`) | `multiTenantPreset`, `softDeletePreset`, `bulkPreset`, `slugLookupPreset`, `treePreset`, `ownedByUserPreset`, `auditedPreset`, `searchPreset`, `filesUploadPreset`, `registerPreset`, `applyPresets` |
@@ -34,6 +34,21 @@ Boot order is fixed: `beforeBoot` -> module graph -> arc core -> `plugins` -> `b
34
34
  | `stores` | event transport, query cache, idempotency, etc.; arc closes only stores it built |
35
35
  | `rateLimit.plan` | per-plan ceilings: `{ resolve, limits: { free: { max: 60 }, enterprise: false }, default }` |
36
36
 
37
+ ### Module facts and invariants
38
+
39
+ A module whose config decisions contradict each other should fail boot, not its first request:
40
+
41
+ ```typescript
42
+ defineModule({
43
+ name: 'media',
44
+ facts: { driver: cfg.driver, uploadReceiver: cfg.receiver }, // plain data, never secrets
45
+ invariants: [{ code: 'media.upload-receiver', fix: 'enable the receiver or use a cloud driver',
46
+ check: (f, all) => f.driver !== 'local' || f.uploadReceiver || 'local driver, receiver off' }],
47
+ });
48
+ ```
49
+
50
+ `check` is pure and sync: `true` passes, `false` or a reason string fails; `all` maps every composed module's facts by name. Runs after planning, before any module `plugins`/`bootstrap`, under every preset; all failures throw one `ArcBootError` (`problems: [{ code, module, message, fix }]`). Every createApp config failure is an `ArcBootError` with a code: match `err.code` / `err.problems`, not message text.
51
+
37
52
  `createWorker(sameOptions)` (`@classytic/arc/factory`) boots the headless process: no HTTP, runs events, schedules and relays. Error disclosure (`includeStack`, `exposeInternalMessages`) derives from `preset`, else the environment; host keys merge over the derived pair.
38
53
 
39
54
  Unknown routes answer `404 { code: 'arc.not_found', message, status, correlationId }` by default. A host that calls `setNotFoundHandler` itself passes `errorHandler: { notFound: false }` (Fastify allows one per scope); `notFound: (request, reply) => ...` replaces arc's.
@@ -65,7 +80,7 @@ import { defineGuard } from '@classytic/arc/utils';
65
80
 
66
81
  middlewares: { create: [multipartBody({ allowedMimeTypes: ['image/png'], maxFileSize: 5_000_000 })] } // no-op for JSON
67
82
  routeGuards: [tenantGuard.preHandler] // every route; order: auth, permissions, cache/idempotency, routeGuards, route preHandler
68
- routes: [{ method: 'POST', path: '/export', handler: 'export', permissions: requireAuth(),
83
+ routes: [{ method: 'POST', path: '/export', handler: (ctx) => ctrl.export(ctx), permissions: requireAuth(),
69
84
  rateLimit: { max: 5, timeWindow: '1 minute' } }] // false = never throttle
70
85
  routes: [{ preAuth: [(req) => { req.headers.authorization = `Bearer ${req.query.token}`; }] }] // EventSource token
71
86
  ```
@@ -77,4 +92,4 @@ routes: [{ preAuth: [(req) => { req.headers.authorization = `Bearer ${req.query.
77
92
 
78
93
  ## CLI
79
94
 
80
- `arc init my-api --mongokit --better-auth --ts` scaffolds; `arc generate resource product [--mcp]`; `arc docs ./openapi.json --entry ./dist/index.js`; `arc introspect`; `arc describe <file> --json`; `arc doctor`.
95
+ `arc init my-api --mongokit --better-auth --ts` scaffolds; `arc generate resource product [--mcp]`; `arc docs ./openapi.json --entry ./dist/index.js`; `arc introspect`; `arc describe <file> --json` (resources, plus `modules` with facts and invariant results for exported module objects; never boots); `arc doctor` (static: env vars implied by installed deps and `.env.example`, `[info]` notes for unset `trustProxy` and no readiness checks).
@@ -38,7 +38,6 @@ Without `createApp`: `await fastify.register(eventPlugin, { transport })` from `
38
38
  | `registry`, `validateMode` | Payload validation on publish: `'warn'` (default with registry) \| `'reject'` \| `'off'` |
39
39
  | `onPublish`, `onPublishError` | Telemetry callbacks (isolated, never affect delivery) |
40
40
  | `warnOnDuplicate` | Dual-publish detector, on outside production |
41
- | `wal` | Low-level hook; not at-least-once. Use the outbox |
42
41
 
43
42
  CRUD events auto-emit on `arcPlugins.emitEvents` (default true) as `<resource>.created|updated|deleted` with payload `{ resource, operation, data, userId?, organizationId?, timestamp }`. Build names with `crudEventType('product', 'created')`. Lifecycle names: `ARC_LIFECYCLE_EVENTS`.
44
43
 
@@ -24,10 +24,11 @@ const app = await createApp({
24
24
  | `create` | `create_{name}` | not destructive, not idempotent |
25
25
  | `update`, `delete` | `update_{name}`, `delete_{name}` | `destructiveHint`, `idempotentHint` |
26
26
  | `actions` | `{action}_{name}` (input: `id` + action schema) | `destructiveHint` |
27
- | custom routes (function or string handler) | `{operation or slug}_{name}` | by HTTP method: GET/HEAD read-only; PUT/DELETE destructive + idempotent; POST/PATCH destructive |
27
+ | custom routes | `{operation or slug}_{name}` | by HTTP method: GET/HEAD read-only; PUT/DELETE destructive + idempotent; POST/PATCH destructive |
28
28
 
29
29
  - CRUD hints are all explicit and include `openWorldHint: false`; an omitted hint means the cautious spec default.
30
- - A CRUD op becomes a tool only when `permissions.<op>` is declared and the op is not in `disabledRoutes`.
30
+ - A CRUD op becomes a tool only when `permissions.<op>` is declared and the op is not left out of a `crud` allow-list.
31
+ - `crud: false` mounts no CRUD routes but keeps every permitted CRUD tool. For "no HTTP CRUD, only these tools", pair it with `overrides: { <resource>: { operations: ['list', 'get'] } }`.
31
32
  - Tools run the same controller pipeline as REST: auth, tenant scope, permission policy, hooks, field masking, events.
32
33
  - `list_*` accepts `page`, `limit`, `cursor` (keyset; `page` ignored when set), `sort`, `search`, `select`, `populate`, filters. `get_*` accepts `id`, `select`. `limit` max follows the resource `queryParser.maxLimit`.
33
34
  - Mutating tools accept `_idempotencyKey` when an idempotency store is wired (register `idempotencyPlugin` before `mcpPlugin`). `idempotency.required` on a resource without a store throws at boot.
@@ -73,7 +73,7 @@ multiTenantPreset({ tenantFields: [
73
73
  2. `kind: 'elevated'` without an org bypasses tenant filtering: unusable for normal per-org access.
74
74
  3. Mark the tenant field `systemManaged` in `fieldRules`: `BodySanitizer` strips client values and the scope value is injected on write.
75
75
  4. The preset overwrites a body-supplied org on UPDATE (blocks tenant hopping). Elevated without an org still bypasses.
76
- 5. `createTenantKeyGenerator()` (`@classytic/arc/scope`) keys rate limits by org for member/service/elevated, else user or IP.
76
+ 5. `createApp`'s default rate-limit key is per signed-in user, per IP when anonymous. For one quota per org: `keyGenerator: createTenantKeyGenerator({ strategy: 'organization' })` (`@classytic/arc/scope`; also the behaviour when `strategy` is omitted).
77
77
 
78
78
  ## Helpers (`@classytic/arc/scope`)
79
79