@wildo-ai/saas-models 1.1.7 → 1.1.8

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 (861) hide show
  1. package/dist/esm/__tests__/setup.d.ts.map +1 -1
  2. package/dist/esm/__tests__/setup.js.map +1 -1
  3. package/dist/esm/_inspect.d.ts.map +1 -1
  4. package/dist/esm/_inspect.js.map +1 -1
  5. package/dist/esm/applications/application-metadata.shared.resources-config.schemas.d.ts.map +1 -1
  6. package/dist/esm/applications/application-metadata.shared.resources-config.schemas.js.map +1 -1
  7. package/dist/esm/applications/application-subject.shared.schemas.d.ts.map +1 -1
  8. package/dist/esm/applications/application-subject.shared.schemas.js.map +1 -1
  9. package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
  10. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
  11. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  12. package/dist/esm/applications/applications-context.schemas.js.map +1 -1
  13. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  14. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  15. package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
  16. package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
  17. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
  18. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
  19. package/dist/esm/billing/billing-account.shared.schemas.d.ts.map +1 -1
  20. package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
  21. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
  22. package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
  23. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  24. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  25. package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
  26. package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
  27. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
  28. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
  29. package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
  30. package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
  31. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
  32. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
  33. package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
  34. package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
  35. package/dist/esm/billing/price.shared.resources-config.schemas.d.ts.map +1 -1
  36. package/dist/esm/billing/price.shared.resources-config.schemas.js.map +1 -1
  37. package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
  38. package/dist/esm/billing/price.shared.schemas.js.map +1 -1
  39. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  40. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  41. package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
  42. package/dist/esm/billing/product-definition.shared.schemas.js.map +1 -1
  43. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
  44. package/dist/esm/billing/product.shared.resources-config.schemas.js.map +1 -1
  45. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  46. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  47. package/dist/esm/billing/promotions.shared.resources-config.schemas.d.ts.map +1 -1
  48. package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
  49. package/dist/esm/billing/promotions.shared.schemas.d.ts.map +1 -1
  50. package/dist/esm/billing/promotions.shared.schemas.js.map +1 -1
  51. package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts.map +1 -1
  52. package/dist/esm/billing/public-pricing-catalog.shared.atoms.js.map +1 -1
  53. package/dist/esm/billing/public-pricing-catalog.shared.d.ts.map +1 -1
  54. package/dist/esm/billing/public-pricing-catalog.shared.js.map +1 -1
  55. package/dist/esm/billing/referral-reward.shared.schemas.d.ts.map +1 -1
  56. package/dist/esm/billing/referral-reward.shared.schemas.js.map +1 -1
  57. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
  58. package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
  59. package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
  60. package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
  61. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  62. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  63. package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
  64. package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
  65. package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts.map +1 -1
  66. package/dist/esm/billing/usage-flush-evidence.shared.schemas.js.map +1 -1
  67. package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
  68. package/dist/esm/billing/usage-record.shared.resources-config.schemas.js.map +1 -1
  69. package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
  70. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  71. package/dist/esm/charts/aggregation-query.shared.schemas.d.ts.map +1 -1
  72. package/dist/esm/charts/aggregation-query.shared.schemas.js.map +1 -1
  73. package/dist/esm/charts/aggregation.shared.definitions.d.ts.map +1 -1
  74. package/dist/esm/charts/aggregation.shared.definitions.js.map +1 -1
  75. package/dist/esm/charts/chart-definition-builder.shared.d.ts.map +1 -1
  76. package/dist/esm/charts/chart-definition-builder.shared.js.map +1 -1
  77. package/dist/esm/companion/artifact-placement.shared.definitions.d.ts.map +1 -1
  78. package/dist/esm/companion/artifact-placement.shared.definitions.js.map +1 -1
  79. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  80. package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
  81. package/dist/esm/companion/shared-library-companion.shared.definitions.d.ts.map +1 -1
  82. package/dist/esm/companion/shared-library-companion.shared.definitions.js.map +1 -1
  83. package/dist/esm/companion-exports.d.ts.map +1 -1
  84. package/dist/esm/companion-exports.js.map +1 -1
  85. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  86. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
  87. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts.map +1 -1
  88. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js.map +1 -1
  89. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -1
  90. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -1
  91. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts.map +1 -1
  92. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.js.map +1 -1
  93. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  94. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
  95. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  96. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  97. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  98. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  99. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  100. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  101. package/dist/esm/compliance/data-classification/data-classification.shared.schemas.d.ts.map +1 -1
  102. package/dist/esm/compliance/data-classification/data-classification.shared.schemas.js.map +1 -1
  103. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts.map +1 -1
  104. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js.map +1 -1
  105. package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts.map +1 -1
  106. package/dist/esm/compliance/documents/governed-documents.shared.schemas.js.map +1 -1
  107. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts.map +1 -1
  108. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js.map +1 -1
  109. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts.map +1 -1
  110. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js.map +1 -1
  111. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
  112. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
  113. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts.map +1 -1
  114. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js.map +1 -1
  115. package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts.map +1 -1
  116. package/dist/esm/compliance/privacy/client-storage.shared.schemas.js.map +1 -1
  117. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts.map +1 -1
  118. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js.map +1 -1
  119. package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts.map +1 -1
  120. package/dist/esm/compliance/privacy/consent-purposes.shared.js.map +1 -1
  121. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -1
  122. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -1
  123. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
  124. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js.map +1 -1
  125. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
  126. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
  127. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts.map +1 -1
  128. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js.map +1 -1
  129. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts.map +1 -1
  130. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js.map +1 -1
  131. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts.map +1 -1
  132. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js.map +1 -1
  133. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
  134. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -1
  135. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
  136. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
  137. package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.d.ts.map +1 -1
  138. package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.js.map +1 -1
  139. package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.d.ts.map +1 -1
  140. package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.js.map +1 -1
  141. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
  142. package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
  143. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts.map +1 -1
  144. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js.map +1 -1
  145. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts.map +1 -1
  146. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js.map +1 -1
  147. package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
  148. package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
  149. package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts.map +1 -1
  150. package/dist/esm/compliance/privacy/retention-binding.shared.utils.js.map +1 -1
  151. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts.map +1 -1
  152. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js.map +1 -1
  153. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts.map +1 -1
  154. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js.map +1 -1
  155. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts.map +1 -1
  156. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js.map +1 -1
  157. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts.map +1 -1
  158. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js.map +1 -1
  159. package/dist/esm/compliance/privacy/sharing.shared.schemas.d.ts.map +1 -1
  160. package/dist/esm/compliance/privacy/sharing.shared.schemas.js.map +1 -1
  161. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts.map +1 -1
  162. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js.map +1 -1
  163. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts.map +1 -1
  164. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js.map +1 -1
  165. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
  166. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
  167. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.d.ts.map +1 -1
  168. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js.map +1 -1
  169. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
  170. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
  171. package/dist/esm/compliance/review-cadence.shared.schemas.d.ts.map +1 -1
  172. package/dist/esm/compliance/review-cadence.shared.schemas.js.map +1 -1
  173. package/dist/esm/compliance/risk-posture.shared.schemas.d.ts.map +1 -1
  174. package/dist/esm/compliance/risk-posture.shared.schemas.js.map +1 -1
  175. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
  176. package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
  177. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  178. package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
  179. package/dist/esm/config/app-frontend-type.shared.schemas.d.ts.map +1 -1
  180. package/dist/esm/config/app-frontend-type.shared.schemas.js.map +1 -1
  181. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
  182. package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
  183. package/dist/esm/config/brand-assets.shared.schemas.d.ts.map +1 -1
  184. package/dist/esm/config/brand-assets.shared.schemas.js.map +1 -1
  185. package/dist/esm/config/configuration-validation.shared.schemas.d.ts.map +1 -1
  186. package/dist/esm/config/configuration-validation.shared.schemas.js.map +1 -1
  187. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  188. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  189. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts.map +1 -1
  190. package/dist/esm/config/frontend/chart-definition.shared.schemas.js.map +1 -1
  191. package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts.map +1 -1
  192. package/dist/esm/config/frontend/chart-registration-alignment.shared.js.map +1 -1
  193. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
  194. package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
  195. package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts.map +1 -1
  196. package/dist/esm/config/frontend/onboarding.shared.schemas.js.map +1 -1
  197. package/dist/esm/config/postgresql.shared.schemas.d.ts.map +1 -1
  198. package/dist/esm/config/postgresql.shared.schemas.js.map +1 -1
  199. package/dist/esm/config/registration-acquisition-policy.shared.utils.d.ts.map +1 -1
  200. package/dist/esm/config/registration-acquisition-policy.shared.utils.js.map +1 -1
  201. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  202. package/dist/esm/config-authoring.entry.js.map +1 -1
  203. package/dist/esm/crdt/crdt-merge.shared.utils.d.ts.map +1 -1
  204. package/dist/esm/crdt/crdt-merge.shared.utils.js.map +1 -1
  205. package/dist/esm/data-seeding/data-seeding-config.shared.schemas.d.ts.map +1 -1
  206. package/dist/esm/data-seeding/data-seeding-config.shared.schemas.js.map +1 -1
  207. package/dist/esm/errors/caught-error-description.shared.utils.d.ts.map +1 -1
  208. package/dist/esm/errors/caught-error-description.shared.utils.js.map +1 -1
  209. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  210. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  211. package/dist/esm/errors/errors.shared.definitions.d.ts.map +1 -1
  212. package/dist/esm/errors/errors.shared.definitions.js.map +1 -1
  213. package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
  214. package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
  215. package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
  216. package/dist/esm/errors/errors.shared.utils.js.map +1 -1
  217. package/dist/esm/errors/resource-access-forbidden.shared.error.d.ts.map +1 -1
  218. package/dist/esm/errors/resource-access-forbidden.shared.error.js.map +1 -1
  219. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -1
  220. package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -1
  221. package/dist/esm/errors/zod-issue-formatting.shared.utils.d.ts.map +1 -1
  222. package/dist/esm/errors/zod-issue-formatting.shared.utils.js.map +1 -1
  223. package/dist/esm/exports/tabular-csv.shared.utils.d.ts.map +1 -1
  224. package/dist/esm/exports/tabular-csv.shared.utils.js.map +1 -1
  225. package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts.map +1 -1
  226. package/dist/esm/external-data/external-data-pipeline-description.shared.js.map +1 -1
  227. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts.map +1 -1
  228. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js.map +1 -1
  229. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  230. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  231. package/dist/esm/external-data/external-data-provenance.shared.d.ts.map +1 -1
  232. package/dist/esm/external-data/external-data-provenance.shared.js.map +1 -1
  233. package/dist/esm/external-data.exports.d.ts.map +1 -1
  234. package/dist/esm/external-data.exports.js.map +1 -1
  235. package/dist/esm/external-providers/compose-provider-registry.shared.d.ts.map +1 -1
  236. package/dist/esm/external-providers/compose-provider-registry.shared.js.map +1 -1
  237. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  238. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  239. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  240. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  241. package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -1
  242. package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -1
  243. package/dist/esm/external-providers/external-providers.shared.schemas.d.ts.map +1 -1
  244. package/dist/esm/external-providers/external-providers.shared.schemas.js.map +1 -1
  245. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  246. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.js.map +1 -1
  247. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -1
  248. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
  249. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -1
  250. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -1
  251. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  252. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  253. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -1
  254. package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -1
  255. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts.map +1 -1
  256. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js.map +1 -1
  257. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts.map +1 -1
  258. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js.map +1 -1
  259. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts.map +1 -1
  260. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js.map +1 -1
  261. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts.map +1 -1
  262. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js.map +1 -1
  263. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -1
  264. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -1
  265. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  266. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  267. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  268. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  269. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -1
  270. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -1
  271. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -1
  272. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -1
  273. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
  274. package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
  275. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts.map +1 -1
  276. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js.map +1 -1
  277. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
  278. package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
  279. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts.map +1 -1
  280. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js.map +1 -1
  281. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts.map +1 -1
  282. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js.map +1 -1
  283. package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts.map +1 -1
  284. package/dist/esm/external-providers/provider-tier-rule.shared.utils.js.map +1 -1
  285. package/dist/esm/external-providers/provider-usage-cost.shared.d.ts.map +1 -1
  286. package/dist/esm/external-providers/provider-usage-cost.shared.js.map +1 -1
  287. package/dist/esm/external-providers/provider-usage-pricing.example.d.ts.map +1 -1
  288. package/dist/esm/external-providers/provider-usage-pricing.example.js.map +1 -1
  289. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts.map +1 -1
  290. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js.map +1 -1
  291. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
  292. package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
  293. package/dist/esm/features/connected-feature.example.d.ts.map +1 -1
  294. package/dist/esm/features/connected-feature.example.js.map +1 -1
  295. package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
  296. package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
  297. package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
  298. package/dist/esm/features/feature-builders.shared.js.map +1 -1
  299. package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
  300. package/dist/esm/features/feature-definition.shared.schemas.js.map +1 -1
  301. package/dist/esm/features/feature-registry.shared.d.ts.map +1 -1
  302. package/dist/esm/features/feature-registry.shared.js.map +1 -1
  303. package/dist/esm/features/feature-resolution.shared.schemas.d.ts.map +1 -1
  304. package/dist/esm/features/feature-resolution.shared.schemas.js.map +1 -1
  305. package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
  306. package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
  307. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
  308. package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
  309. package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts.map +1 -1
  310. package/dist/esm/files/file-remote-reference-link.shared.schemas.js.map +1 -1
  311. package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -1
  312. package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -1
  313. package/dist/esm/files/files.shared.resources-config.schemas.d.ts.map +1 -1
  314. package/dist/esm/files/files.shared.resources-config.schemas.js.map +1 -1
  315. package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
  316. package/dist/esm/files/files.shared.schemas.js.map +1 -1
  317. package/dist/esm/files/files.shared.utils.d.ts.map +1 -1
  318. package/dist/esm/files/files.shared.utils.js.map +1 -1
  319. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  320. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js.map +1 -1
  321. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
  322. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js.map +1 -1
  323. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
  324. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js.map +1 -1
  325. package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.d.ts.map +1 -1
  326. package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.js.map +1 -1
  327. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  328. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  329. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
  330. package/dist/esm/flows-actors/agent-traceability.shared.schemas.js.map +1 -1
  331. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts.map +1 -1
  332. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js.map +1 -1
  333. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts.map +1 -1
  334. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js.map +1 -1
  335. package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
  336. package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
  337. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts.map +1 -1
  338. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js.map +1 -1
  339. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
  340. package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
  341. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts.map +1 -1
  342. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js.map +1 -1
  343. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map +1 -1
  344. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js.map +1 -1
  345. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  346. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  347. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts.map +1 -1
  348. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js.map +1 -1
  349. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
  350. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js.map +1 -1
  351. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  352. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  353. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts.map +1 -1
  354. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js.map +1 -1
  355. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
  356. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
  357. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts.map +1 -1
  358. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
  359. package/dist/esm/flows-actors/flows-actors.system.shared.definitions.d.ts.map +1 -1
  360. package/dist/esm/flows-actors/flows-actors.system.shared.definitions.js.map +1 -1
  361. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  362. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
  363. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  364. package/dist/esm/flows-actors/flows.shared.schemas.js.map +1 -1
  365. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -1
  366. package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -1
  367. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -1
  368. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -1
  369. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts.map +1 -1
  370. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js.map +1 -1
  371. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts.map +1 -1
  372. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js.map +1 -1
  373. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts.map +1 -1
  374. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js.map +1 -1
  375. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts.map +1 -1
  376. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js.map +1 -1
  377. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts.map +1 -1
  378. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js.map +1 -1
  379. package/dist/esm/flows-actors/prompt-ir.shared.schemas.d.ts.map +1 -1
  380. package/dist/esm/flows-actors/prompt-ir.shared.schemas.js.map +1 -1
  381. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -1
  382. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -1
  383. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -1
  384. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -1
  385. package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts.map +1 -1
  386. package/dist/esm/flows-actors/review-deadlines.shared.schemas.js.map +1 -1
  387. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
  388. package/dist/esm/flows-actors/tasks.actors.shared.schemas.js.map +1 -1
  389. package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts.map +1 -1
  390. package/dist/esm/flows-actors/work-attribution.shared.schemas.js.map +1 -1
  391. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts.map +1 -1
  392. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js.map +1 -1
  393. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -1
  394. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -1
  395. package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts.map +1 -1
  396. package/dist/esm/guidance/guidance-flow.shared.schemas.js.map +1 -1
  397. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
  398. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js.map +1 -1
  399. package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
  400. package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
  401. package/dist/esm/guidance/guidance-state.shared.utils.d.ts.map +1 -1
  402. package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
  403. package/dist/esm/guidance/lifecycle-config.shared.schemas.d.ts.map +1 -1
  404. package/dist/esm/guidance/lifecycle-config.shared.schemas.js.map +1 -1
  405. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
  406. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js.map +1 -1
  407. package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
  408. package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
  409. package/dist/esm/guidance/milestone-builders.shared.d.ts.map +1 -1
  410. package/dist/esm/guidance/milestone-builders.shared.js.map +1 -1
  411. package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts.map +1 -1
  412. package/dist/esm/guidance/milestone-definition.shared.schemas.js.map +1 -1
  413. package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts.map +1 -1
  414. package/dist/esm/guidance/progression-presentation.shared.schemas.js.map +1 -1
  415. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
  416. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js.map +1 -1
  417. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  418. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  419. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.d.ts.map +1 -1
  420. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js.map +1 -1
  421. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  422. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  423. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts.map +1 -1
  424. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js.map +1 -1
  425. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts.map +1 -1
  426. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js.map +1 -1
  427. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -1
  428. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -1
  429. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts.map +1 -1
  430. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js.map +1 -1
  431. package/dist/esm/i18n/application-config-vocabulary.shared.d.ts.map +1 -1
  432. package/dist/esm/i18n/application-config-vocabulary.shared.js.map +1 -1
  433. package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts.map +1 -1
  434. package/dist/esm/i18n/engine-open-vocabulary-values.shared.js.map +1 -1
  435. package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts.map +1 -1
  436. package/dist/esm/i18n/engine-open-vocabulary.shared.js.map +1 -1
  437. package/dist/esm/i18n/interpolate-label-params.shared.utils.d.ts.map +1 -1
  438. package/dist/esm/i18n/interpolate-label-params.shared.utils.js.map +1 -1
  439. package/dist/esm/i18n/labelling.dto.shared.schemas.d.ts.map +1 -1
  440. package/dist/esm/i18n/labelling.dto.shared.schemas.js.map +1 -1
  441. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts.map +1 -1
  442. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js.map +1 -1
  443. package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts.map +1 -1
  444. package/dist/esm/inbound/conversation-threads.shared.schemas.js.map +1 -1
  445. package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts.map +1 -1
  446. package/dist/esm/inbound/inbound-channels.shared.schemas.js.map +1 -1
  447. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts.map +1 -1
  448. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js.map +1 -1
  449. package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts.map +1 -1
  450. package/dist/esm/inbound/inbound-delivery.shared.schemas.js.map +1 -1
  451. package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts.map +1 -1
  452. package/dist/esm/inbound/inbound-endpoint-env.shared.js.map +1 -1
  453. package/dist/esm/index.d.ts.map +1 -1
  454. package/dist/esm/index.js.map +1 -1
  455. package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +1 -1
  456. package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.js.map +1 -1
  457. package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +1 -1
  458. package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +1 -1
  459. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts.map +1 -1
  460. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js.map +1 -1
  461. package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -1
  462. package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -1
  463. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -1
  464. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
  465. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -1
  466. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -1
  467. package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +1 -1
  468. package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +1 -1
  469. package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
  470. package/dist/esm/meta-workflows.exports.js.map +1 -1
  471. package/dist/esm/monitoring/monitoring.shared.schemas.d.ts.map +1 -1
  472. package/dist/esm/monitoring/monitoring.shared.schemas.js.map +1 -1
  473. package/dist/esm/notifications/email/email-context.shared.schemas.d.ts.map +1 -1
  474. package/dist/esm/notifications/email/email-context.shared.schemas.js.map +1 -1
  475. package/dist/esm/notifications/email/email-submission.shared.enums.d.ts.map +1 -1
  476. package/dist/esm/notifications/email/email-submission.shared.enums.js.map +1 -1
  477. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  478. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  479. package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
  480. package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
  481. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts.map +1 -1
  482. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js.map +1 -1
  483. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts.map +1 -1
  484. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js.map +1 -1
  485. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -1
  486. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js.map +1 -1
  487. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  488. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
  489. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts.map +1 -1
  490. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js.map +1 -1
  491. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  492. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  493. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
  494. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
  495. package/dist/esm/notifications/notification-badges.core.definitions.d.ts.map +1 -1
  496. package/dist/esm/notifications/notification-badges.core.definitions.js.map +1 -1
  497. package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
  498. package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
  499. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
  500. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
  501. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  502. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  503. package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts.map +1 -1
  504. package/dist/esm/organizations/application-owner-organization.shared.schemas.js.map +1 -1
  505. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts.map +1 -1
  506. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
  507. package/dist/esm/organizations/organization-features.shared.schemas.d.ts.map +1 -1
  508. package/dist/esm/organizations/organization-features.shared.schemas.js.map +1 -1
  509. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
  510. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
  511. package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
  512. package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
  513. package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.d.ts.map +1 -1
  514. package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.js.map +1 -1
  515. package/dist/esm/organizations/organization-notifications.shared.schemas.d.ts.map +1 -1
  516. package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
  517. package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  518. package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.js.map +1 -1
  519. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
  520. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  521. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts.map +1 -1
  522. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.js.map +1 -1
  523. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  524. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  525. package/dist/esm/organizations/organization-unit-inheritance.shared.d.ts.map +1 -1
  526. package/dist/esm/organizations/organization-unit-inheritance.shared.js.map +1 -1
  527. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.d.ts.map +1 -1
  528. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js.map +1 -1
  529. package/dist/esm/organizations/organization-unit-members.shared.schemas.d.ts.map +1 -1
  530. package/dist/esm/organizations/organization-unit-members.shared.schemas.js.map +1 -1
  531. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts.map +1 -1
  532. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js.map +1 -1
  533. package/dist/esm/organizations/organization-unit-narrowing.example.d.ts.map +1 -1
  534. package/dist/esm/organizations/organization-unit-narrowing.example.js.map +1 -1
  535. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  536. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  537. package/dist/esm/organizations/organization-units.shared.path.d.ts.map +1 -1
  538. package/dist/esm/organizations/organization-units.shared.path.js.map +1 -1
  539. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
  540. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
  541. package/dist/esm/organizations/organization-units.shared.schemas.d.ts.map +1 -1
  542. package/dist/esm/organizations/organization-units.shared.schemas.js.map +1 -1
  543. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  544. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  545. package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
  546. package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
  547. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts.map +1 -1
  548. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js.map +1 -1
  549. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts.map +1 -1
  550. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js.map +1 -1
  551. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts.map +1 -1
  552. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js.map +1 -1
  553. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts.map +1 -1
  554. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js.map +1 -1
  555. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts.map +1 -1
  556. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js.map +1 -1
  557. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts.map +1 -1
  558. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js.map +1 -1
  559. package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts.map +1 -1
  560. package/dist/esm/organizations/service-provider-relationships.shared.schemas.js.map +1 -1
  561. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
  562. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
  563. package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
  564. package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
  565. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  566. package/dist/esm/public-runtime/index.js.map +1 -1
  567. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
  568. package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
  569. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  570. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  571. package/dist/esm/queue/jobs.shared.utils.d.ts.map +1 -1
  572. package/dist/esm/queue/jobs.shared.utils.js.map +1 -1
  573. package/dist/esm/queue/queues.shared.schemas.d.ts.map +1 -1
  574. package/dist/esm/queue/queues.shared.schemas.js.map +1 -1
  575. package/dist/esm/queue/queues.shared.utils.d.ts.map +1 -1
  576. package/dist/esm/queue/queues.shared.utils.js.map +1 -1
  577. package/dist/esm/queue/rabbitmq-queue-args.shared.d.ts.map +1 -1
  578. package/dist/esm/queue/rabbitmq-queue-args.shared.js.map +1 -1
  579. package/dist/esm/rag/rag-retrieval-health.shared.d.ts.map +1 -1
  580. package/dist/esm/rag/rag-retrieval-health.shared.js.map +1 -1
  581. package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
  582. package/dist/esm/requests/header-keys.shared.js.map +1 -1
  583. package/dist/esm/requests/http-requests.shared.d.ts.map +1 -1
  584. package/dist/esm/requests/http-requests.shared.js.map +1 -1
  585. package/dist/esm/requests/idempotency-key.shared.d.ts.map +1 -1
  586. package/dist/esm/requests/idempotency-key.shared.js.map +1 -1
  587. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
  588. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
  589. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  590. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  591. package/dist/esm/requests/rate-limits.shared.schemas.d.ts.map +1 -1
  592. package/dist/esm/requests/rate-limits.shared.schemas.js.map +1 -1
  593. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  594. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  595. package/dist/esm/resources/child-operations.shared.schemas.d.ts.map +1 -1
  596. package/dist/esm/resources/child-operations.shared.schemas.js.map +1 -1
  597. package/dist/esm/resources/collection-query-parameters.shared.d.ts.map +1 -1
  598. package/dist/esm/resources/collection-query-parameters.shared.js.map +1 -1
  599. package/dist/esm/resources/context-policy.shared.schemas.d.ts.map +1 -1
  600. package/dist/esm/resources/context-policy.shared.schemas.js.map +1 -1
  601. package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts.map +1 -1
  602. package/dist/esm/resources/embedded-resource-mark.shared.utils.js.map +1 -1
  603. package/dist/esm/resources/relationship-display.shared.schemas.d.ts.map +1 -1
  604. package/dist/esm/resources/relationship-display.shared.schemas.js.map +1 -1
  605. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  606. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  607. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  608. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  609. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  610. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  611. package/dist/esm/resources/resources-relationships.shared.factory.d.ts.map +1 -1
  612. package/dist/esm/resources/resources-relationships.shared.factory.js.map +1 -1
  613. package/dist/esm/resources/resources-serialization.shared.schemas.d.ts.map +1 -1
  614. package/dist/esm/resources/resources-serialization.shared.schemas.js.map +1 -1
  615. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  616. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  617. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  618. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  619. package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
  620. package/dist/esm/resources/resources.shared.utils.js.map +1 -1
  621. package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
  622. package/dist/esm/resources/utils/collection-export.shared.utils.js.map +1 -1
  623. package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts.map +1 -1
  624. package/dist/esm/resources/utils/composition-cascade-deletability.validation.js.map +1 -1
  625. package/dist/esm/resources/utils/composition-seedability.validation.d.ts.map +1 -1
  626. package/dist/esm/resources/utils/composition-seedability.validation.js.map +1 -1
  627. package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.d.ts.map +1 -1
  628. package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.js.map +1 -1
  629. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts.map +1 -1
  630. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js.map +1 -1
  631. package/dist/esm/resources/utils/duplicate-relationship-registration.validation.d.ts.map +1 -1
  632. package/dist/esm/resources/utils/duplicate-relationship-registration.validation.js.map +1 -1
  633. package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts.map +1 -1
  634. package/dist/esm/resources/utils/field-value-disclosure.utils.js.map +1 -1
  635. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts.map +1 -1
  636. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js.map +1 -1
  637. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts.map +1 -1
  638. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js.map +1 -1
  639. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts.map +1 -1
  640. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js.map +1 -1
  641. package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.d.ts.map +1 -1
  642. package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.js.map +1 -1
  643. package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -1
  644. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -1
  645. package/dist/esm/resources/utils/repository-dto-builder.utils.d.ts.map +1 -1
  646. package/dist/esm/resources/utils/repository-dto-builder.utils.js.map +1 -1
  647. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts.map +1 -1
  648. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js.map +1 -1
  649. package/dist/esm/resources/utils/required-fk-fillability.validation.d.ts.map +1 -1
  650. package/dist/esm/resources/utils/required-fk-fillability.validation.js.map +1 -1
  651. package/dist/esm/resources/utils/resource-operation-type-guards.utils.d.ts.map +1 -1
  652. package/dist/esm/resources/utils/resource-operation-type-guards.utils.js.map +1 -1
  653. package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
  654. package/dist/esm/resources/utils/resource-polymorphism.factory.js.map +1 -1
  655. package/dist/esm/resources/utils/resource-polymorphism.relationships.d.ts.map +1 -1
  656. package/dist/esm/resources/utils/resource-polymorphism.relationships.js.map +1 -1
  657. package/dist/esm/resources/utils/resource-polymorphism.schemas.d.ts.map +1 -1
  658. package/dist/esm/resources/utils/resource-polymorphism.schemas.js.map +1 -1
  659. package/dist/esm/resources/utils/resource-polymorphism.utils.d.ts.map +1 -1
  660. package/dist/esm/resources/utils/resource-polymorphism.utils.js.map +1 -1
  661. package/dist/esm/resources/utils/resource-subtree.utils.d.ts.map +1 -1
  662. package/dist/esm/resources/utils/resource-subtree.utils.js.map +1 -1
  663. package/dist/esm/resources/utils/resources-config-context-needs.utils.d.ts.map +1 -1
  664. package/dist/esm/resources/utils/resources-config-context-needs.utils.js.map +1 -1
  665. package/dist/esm/resources/utils/resources-config-naming.utils.d.ts.map +1 -1
  666. package/dist/esm/resources/utils/resources-config-naming.utils.js.map +1 -1
  667. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
  668. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
  669. package/dist/esm/resources/utils/resources-config-operations.path.utils.d.ts.map +1 -1
  670. package/dist/esm/resources/utils/resources-config-operations.path.utils.js.map +1 -1
  671. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts.map +1 -1
  672. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js.map +1 -1
  673. package/dist/esm/resources/utils/resources-config-operations.utils.d.ts.map +1 -1
  674. package/dist/esm/resources/utils/resources-config-operations.utils.js.map +1 -1
  675. package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
  676. package/dist/esm/resources/utils/resources-serialization.utils.js.map +1 -1
  677. package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
  678. package/dist/esm/resources/utils/resources-summary.utils.js.map +1 -1
  679. package/dist/esm/resources/utils/schema-family-builder.utils.d.ts.map +1 -1
  680. package/dist/esm/resources/utils/schema-family-builder.utils.js.map +1 -1
  681. package/dist/esm/resources/utils/schema-type-inference.utils.d.ts.map +1 -1
  682. package/dist/esm/resources/utils/schema-type-inference.utils.js.map +1 -1
  683. package/dist/esm/resources/utils/schema-type-utils.d.ts.map +1 -1
  684. package/dist/esm/resources/utils/schema-type-utils.js.map +1 -1
  685. package/dist/esm/resources/utils/schema-variant-resolver.utils.d.ts.map +1 -1
  686. package/dist/esm/resources/utils/schema-variant-resolver.utils.js.map +1 -1
  687. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  688. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  689. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.d.ts.map +1 -1
  690. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js.map +1 -1
  691. package/dist/esm/resources/work-unit.shared.schemas.d.ts.map +1 -1
  692. package/dist/esm/resources/work-unit.shared.schemas.js.map +1 -1
  693. package/dist/esm/runtime/domain-module.shared.definitions.d.ts.map +1 -1
  694. package/dist/esm/runtime/domain-module.shared.definitions.js.map +1 -1
  695. package/dist/esm/runtime/execution-context.shared.schemas.d.ts.map +1 -1
  696. package/dist/esm/runtime/execution-context.shared.schemas.js.map +1 -1
  697. package/dist/esm/runtime/runtime.shared.schemas.d.ts.map +1 -1
  698. package/dist/esm/runtime/runtime.shared.schemas.js.map +1 -1
  699. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  700. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  701. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  702. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  703. package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts.map +1 -1
  704. package/dist/esm/security/api-keys/api-keys.shared.schemas.js.map +1 -1
  705. package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.d.ts.map +1 -1
  706. package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.js.map +1 -1
  707. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  708. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  709. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
  710. package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
  711. package/dist/esm/security/authentications/authentication.shared.utils.d.ts.map +1 -1
  712. package/dist/esm/security/authentications/authentication.shared.utils.js.map +1 -1
  713. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
  714. package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
  715. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts.map +1 -1
  716. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js.map +1 -1
  717. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts.map +1 -1
  718. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js.map +1 -1
  719. package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts.map +1 -1
  720. package/dist/esm/security/authentications/password-blocklist.shared.utils.js.map +1 -1
  721. package/dist/esm/security/authentications/password-reset.shared.dto.schemas.d.ts.map +1 -1
  722. package/dist/esm/security/authentications/password-reset.shared.dto.schemas.js.map +1 -1
  723. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
  724. package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
  725. package/dist/esm/security/authentications/same-origin-redirect-path.shared.d.ts.map +1 -1
  726. package/dist/esm/security/authentications/same-origin-redirect-path.shared.js.map +1 -1
  727. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts.map +1 -1
  728. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
  729. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
  730. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js.map +1 -1
  731. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
  732. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  733. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.d.ts.map +1 -1
  734. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
  735. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts.map +1 -1
  736. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js.map +1 -1
  737. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts.map +1 -1
  738. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js.map +1 -1
  739. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
  740. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
  741. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.d.ts.map +1 -1
  742. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.js.map +1 -1
  743. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts.map +1 -1
  744. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js.map +1 -1
  745. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts.map +1 -1
  746. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js.map +1 -1
  747. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -1
  748. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -1
  749. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts.map +1 -1
  750. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js.map +1 -1
  751. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts.map +1 -1
  752. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js.map +1 -1
  753. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  754. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  755. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  756. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  757. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
  758. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
  759. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  760. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  761. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
  762. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
  763. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  764. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -1
  765. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts.map +1 -1
  766. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js.map +1 -1
  767. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  768. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
  769. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
  770. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
  771. package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
  772. package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
  773. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
  774. package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
  775. package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
  776. package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
  777. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts.map +1 -1
  778. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js.map +1 -1
  779. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -1
  780. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -1
  781. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -1
  782. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -1
  783. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -1
  784. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
  785. package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts.map +1 -1
  786. package/dist/esm/security/credential-rotation-grace.shared.utils.js.map +1 -1
  787. package/dist/esm/security/crypto-keys/crypto-keys.shared.schemas.d.ts.map +1 -1
  788. package/dist/esm/security/crypto-keys/crypto-keys.shared.schemas.js.map +1 -1
  789. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  790. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  791. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  792. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  793. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
  794. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
  795. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts.map +1 -1
  796. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js.map +1 -1
  797. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
  798. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
  799. package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.d.ts.map +1 -1
  800. package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.js.map +1 -1
  801. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -1
  802. package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -1
  803. package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts.map +1 -1
  804. package/dist/esm/security/submission-challenge/submission-challenge.shared.js.map +1 -1
  805. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts.map +1 -1
  806. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js.map +1 -1
  807. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts.map +1 -1
  808. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js.map +1 -1
  809. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -1
  810. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -1
  811. package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts.map +1 -1
  812. package/dist/esm/systems-of-record/system-of-record-env.shared.js.map +1 -1
  813. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -1
  814. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -1
  815. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -1
  816. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -1
  817. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -1
  818. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -1
  819. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts.map +1 -1
  820. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js.map +1 -1
  821. package/dist/esm/testing/resource-config-builders.d.ts.map +1 -1
  822. package/dist/esm/testing/resource-config-builders.js.map +1 -1
  823. package/dist/esm/testing.d.ts.map +1 -1
  824. package/dist/esm/testing.js.map +1 -1
  825. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts.map +1 -1
  826. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js.map +1 -1
  827. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
  828. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
  829. package/dist/esm/users/anonymous-users.shared.schema.d.ts.map +1 -1
  830. package/dist/esm/users/anonymous-users.shared.schema.js.map +1 -1
  831. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
  832. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
  833. package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
  834. package/dist/esm/users/inbound-contacts.shared.schemas.js.map +1 -1
  835. package/dist/esm/users/user-consent-decision.shared.utils.d.ts.map +1 -1
  836. package/dist/esm/users/user-consent-decision.shared.utils.js.map +1 -1
  837. package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
  838. package/dist/esm/users/user-credentials.shared.resources-config.schemas.js.map +1 -1
  839. package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
  840. package/dist/esm/users/user-credentials.shared.schemas.js.map +1 -1
  841. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
  842. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js.map +1 -1
  843. package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
  844. package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
  845. package/dist/esm/users/user-preferences-reset.shared.utils.d.ts.map +1 -1
  846. package/dist/esm/users/user-preferences-reset.shared.utils.js.map +1 -1
  847. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  848. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
  849. package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  850. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
  851. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  852. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
  853. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  854. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js.map +1 -1
  855. package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
  856. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  857. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  858. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  859. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  860. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  861. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"resources-config.shared.factory.js","sourceRoot":"","sources":["../../../src/resources/resources-config.shared.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,g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,CAAC;YACH,CAAC;YACD,OAAO;QACT,CAAC;QACD;YACE,OAAO;IACX,CAAC;AACH,CAAC","sourcesContent":["import { ResourceConfiguration_QueueConfigSchema } from '../queue/queues.shared.schemas';\nimport { markEmbeddedResourceSchema } from './embedded-resource-mark.shared.utils';\nimport { normalizeScheduledRecoveryPolicy } from '../queue/jobs.shared.schemas';\n/**\n * Operations Shared Schemas\n *\n * Reusable operation schemas for bulk actions and common operations\n */\n\n\nimport {\n EnumLikeType,\n ExpiresInDurationSchema,\n PrimitiveZodType,\n getImpersonalizeMaskValue,\n getImpersonalizeTreatment,\n getZodObjectShape,\n getZodType,\n isBackendOnlyField,\n isDiscriminatorField,\n isExcludedFromCreate,\n isExcludedFromUpdate,\n isBusinessKeyField,\n isZodObject,\n isSummaryField,\n isTemplatableFileField,\n isUniqueField,\n getUniqueFieldParams,\n isVirtualField,\n toPatchOptionalField,\n z_file,\n mainSchemaFieldIsClearable,\n unwrapSchema,\n getDataCategories,\n markPatchRequestDtoObject,\n isDBIndexed,\n} from '@wildo-ai/zod-decorators';\nimport { z } from 'zod';\nimport { ErrorType } from '../errors/errors.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind, RetentionStatus, RetentionStatusSchema, StatutoryRetentionGround } from '../compliance/privacy/impersonalization.shared.schemas';\nimport {\n buildImpersonalizeScrubPatch,\n collectDeclaredPersonalDataFields,\n IMPERSONALIZE_MASK_CONSTANT,\n isImpersonalizeNeverScrubFloorField,\n resolveImpersonalizeMaskValue,\n resolveImpersonalizeResetValue,\n} from '../compliance/privacy/impersonalization-scrub.shared.utils';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\nimport {\n DataRetentionClass,\n RETENTION_STARTED_AT_FIELD_NAME,\n ResourceRetentionBindingSchema,\n RetentionStartPoint,\n type ResourceRetentionBinding,\n} from '../compliance/privacy/retention-schedule.shared.schemas';\nimport { collectRowTtlPolicies, resolveRetentionStartFieldName } from '../compliance/privacy/retention-binding.shared.utils';\nimport { unknownPersonalDataCategories } from '../compliance/privacy/personal-data-category.shared.schemas';\n/*\n * entrypoint-closure-waiver: this root-reachable module imports the external-data AUTHORING\n * contract, which only `@wildo-ai/saas-models/external-data` publishes (see\n * `external-data.exports.ts` for why that subpath exists).\n *\n * MEASURED SAFE 2026-08-29 by the probe `package-public-entrypoints.md` prescribes — a consumer\n * importing ONLY the package root, re-exporting these surfaces and deriving their parameter types\n * so declaration emit must WRITE them rather than alias them, compiled with `declaration: true`:\n * zero TS2742 / TS2883 / TS7056, and the emitted `.d.ts` names `@wildo-ai/saas-models` with no\n * `node_modules/...` path anywhere in it.\n *\n * The mechanism, so the next reader need not re-derive it: every crossing here is an EXPLICIT\n * ANNOTATION inside this package, so TypeScript emits a RELATIVE intra-package import in our own\n * `.d.ts` — which resolves by PATH for any consumer, whatever the exports map says. TS2742 bites\n * only when TypeScript must INVENT a specifier for an INFERRED type. Re-run the probe if a\n * root-exported contract here ever starts inferring one.\n */\nimport { HttpApiResourceBindingSchema, assertHttpApiBindingDialectCoherence } from '../http-api-binding/http-api-binding.shared.schemas';\nimport {\n assertHttpApiWriteDeclarationCoherence,\n collectHttpApiWriteOperationFacts,\n resolveHttpApiWriteIdempotencyKeyRequirement,\n resolveHttpApiWriteVerb,\n} from './utils/http-api-write-declaration.shared.utils';\nimport { describeNoSubjectDataStanceContradiction, personalFieldsContradictingNoSubjectDataStance } from './utils/no-subject-data-stance-coherence.shared.utils';\nimport {\n HTTP_API_ENGINE_INJECTED_FIELDS,\n HTTP_API_TENANT_ANCHOR_FIELD,\n READ_THROUGH_ORGANIZATION_UNIT_FIELD_NAME,\n} from '../http-api-binding/read-through-engine-anchors.shared';\nimport { HttpApiTransportDialect } from '../http-api-binding/http-api-transport-dialect.shared';\nimport {\n ExternalDataConditionalOutcomeKind,\n ExternalDataDestinationPopulation,\n ExternalDataFieldCoercion,\n ExternalDataFieldOwner,\n ExternalDataMappingEntryKind,\n ExternalDataOrphanPolicy,\n ExternalDataPipelineDeclarationSchema,\n ExternalDataPipelineDirection,\n ExternalDataUnmappedValuePolicy,\n assertExternalDataPipelineDeclarationCoherence,\n resolveExternalDataFieldOwner,\n resolveExternalDataRemoteReferenceValueShape,\n type ExternalDataFieldMappingEntry,\n type ExternalDataPipelineDeclaration,\n} from '../external-data/external-data-pipeline.shared.schemas';\nimport {\n CoreM2MNotificationChannel,\n CoreUserNotificationChannel,\n CoreUserNotificationTarget,\n M2MNotificationDefinition,\n M2MNotificationDefinitionSchema,\n UserNotificationDefinition,\n UserNotificationDefinitionSchema,\n} from '../notifications/notifications.shared.schemas';\nimport { HttpMethod } from '../requests/http-requests.shared';\nimport { isSubmissionChallengeActionName, type ResourceOperationSubmissionChallenge } from '../security/submission-challenge/submission-challenge.shared';\nimport type { TokenAuthenticationConfig, TokenGenerationConfig, TokenRevocationConfig } from '../security/authentications/consumable-token.shared.schemas';\nimport { ConsumableToken_ConsumptionMode, TokenAuthenticationPolicy } from '../security/authentications/consumable-token.shared.schemas';\nimport {\n OPERATION_VARIANT_KEY,\n type AnyResourceConfiguration,\n type CollectionViewFields_List,\n RequiredFeaturesConfig,\n RequiredFeaturesNormalized,\n wrapRequestDtoAsBulk,\n resolveBulkOperationMaxSelection,\n Resources_Filter_BaseSchema,\n Resources_Filter_DateRangeSchema,\n Resources_Filter_NumberRangeSchema,\n isResourcesFilterNumberRangeSchema,\n Resources_PaginationRequestSchema,\n createPaginationRequestSchema,\n DEFAULT_LIST_PAGE_CEILING,\n DEFAULT_SEARCH_PAGE_CEILING,\n createPaginationResponseMetadataSchema,\n ResourceConfiguration,\n ResourceConfiguration_Operation_ApiCall,\n ResourceConfiguration_Operation,\n ResourceConfiguration_OperationVariant_BuilderParameters,\n ResourceConfiguration_Operation_BuilderParameters,\n ResourceConfiguration_BuilderParameters,\n ResourceConfiguration_InheritanceSchemaDefinition,\n ResourceConfiguration_ResourceRelationships,\n ResourceGeneratedOperationKind,\n ResourcePaginatedResponseResultSchema,\n ResourceSearchQueryRequestResult,\n ResourceSystemAccessMode,\n PersistenceAdapter,\n isPersistenceAdapter,\n SortOrder,\n ValidOperationKeys,\n ResourceCollectionExportConfig,\n ResourceCollectionExportFormat,\n ResourceCollectionExportRowScope,\n ResourceCollectionExportResponseSchema,\n getResourcesFilterPresenceTarget,\n} from './resources-config.shared.schemas';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier, ResourceType } from './resources.shared.core.definitions';\nimport { requestSchemaCarriesField } from './utils/request-schema-field-carriage.shared.utils';\nimport {\n PRIMARY_SCOPE_FIELD_IDENTIFIERS,\n PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE,\n FIELD_IDENTIFIER_TO_PRIMARY_SCOPE,\n RelationshipNature,\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceOperation_ServiceRuntimeMode,\n ResourceParentResourceRequirement,\n ResourcePrimaryScope,\n ResourceRelationship,\n ResourceRelationshipBulkAction,\n ResourceRelationshipBulkActionResultSchema,\n ResourceRelationshipBulkClearOperationRequestSchema,\n ResourceRelationshipBulkCreateOperationRequestSchema,\n ResourceRelationshipBulkLinkOperationRequestSchema,\n ResourceRelationshipBulkReplaceOperationRequestSchema,\n ResourceRelationshipBulkSetOperationRequestSchema,\n ResourceRelationshipBulkUnlinkOperationRequestSchema,\n ResourceRelationshipDeclaration,\n ResourceRelationshipAccessScopeStrategy,\n ResourceRelationshipCardinality,\n ResourceTranspositionPolicy\n} from './resources.shared.schemas';\n\nimport { createResourcesRelationship } from './resources-relationships.shared.factory';\nimport { Resources_SharedUtils } from './resources.shared.utils';\nimport { ResourcesConfigOperationsDtosBuilderUtils } from './utils/resources-config-operations.dtos-builder.utils';\nimport { ResourcesSummaryUtils } from './utils/resources-summary.utils';\nimport { collectTemplatableFileFieldPaths, stripTemplatableFileFieldsRecursively } from './utils/templatable-file-fields.shared.utils';\nimport { selectByPersistenceAdapter, type PersistenceAdapterCases } from './utils/persistence-adapter-discrimination.shared.utils';\nimport {\n isServiceResolvableDefaultOperation,\n SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES,\n URL_BEARING_OPERATION_VARIANT_TYPES,\n} from './utils/resource-operation-type-guards.utils';\n\nimport { describeCaughtError } from '../errors/caught-error-description.shared.utils';\n// --------------------------------\n// Error Helpers\n// --------------------------------\n\n/**\n * Creates a configuration error with ErrorType.CONFIGURATION\n * Used for resource configuration validation errors at build time\n */\n/**\n * Reject an `.impersonalizeWith()` treatment declared BELOW the top level of a retention-governed\n * resource's schema (gate G-FILE / scrub-coverage).\n *\n * The impersonalize writer builds its `$set` from the TOP-LEVEL shape only, and file links are stored\n * under a dotted canonical path (`billingContact.signedMandate`). A nested treatment therefore never\n * reaches the scrub patch and never matches a linked file's `linkedFieldName`: the row flips to\n * RETAINED while the nested personal field — and any file beneath it — survive fully intact, with an\n * audit event asserting the record was impersonalized.\n *\n * Recursive scrubbing (dotted-path patches + the matching file-path recursion) is deliberately out of\n * v1 scope, so this fails at CONFIG BUILD instead of silently under-scrubbing at erasure time. Walks\n * nested ZodObjects (through optional/nullable/default/array wrappers) and every discriminated-union\n * option, mirroring how the runtime resolves field paths.\n */\nfunction assertNoNestedImpersonalizeTreatment(\n schema: z.ZodTypeAny,\n resourceIdentifier: string,\n): void {\n const visited = new Set<unknown>();\n\n const walk = (candidate: z.ZodTypeAny | undefined, path: string, isTopLevel: boolean): void => {\n if (!candidate || visited.has(candidate)) return;\n visited.add(candidate);\n\n if (!isTopLevel && getImpersonalizeTreatment(candidate) !== undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] field '${path}' declares an impersonalize treatment, but it is NESTED. ` +\n `The scrub writes a top-level $set only, so a nested treatment would be silently ignored — the row ` +\n `would flip to RETAINED with '${path}' (and any file linked under it) fully intact. Move the field to ` +\n `the top level, or scrub the whole containing field instead (REMOVE on the parent object).`\n );\n }\n\n const shape = getZodObjectShape(unwrapSchema(candidate) ?? candidate);\n for (const [childName, childSchema] of Object.entries(shape ?? {})) {\n walk(childSchema as z.ZodTypeAny, path ? `${path}.${childName}` : childName, false);\n }\n };\n\n // Top-level fields are legitimately treatable; only their DESCENDANTS are the problem.\n const topLevelShape = getZodObjectShape(schema);\n for (const [fieldName, fieldSchema] of Object.entries(topLevelShape ?? {})) {\n const unwrapped = unwrapSchema(fieldSchema as z.ZodTypeAny) ?? (fieldSchema as z.ZodTypeAny);\n const nestedShape = getZodObjectShape(unwrapped);\n for (const [childName, childSchema] of Object.entries(nestedShape ?? {})) {\n walk(childSchema as z.ZodTypeAny, `${fieldName}.${childName}`, false);\n }\n }\n}\n\nfunction createConfigurationError(message: string): Error {\n const error = new Error(message);\n (error as any).type = ErrorType.CONFIGURATION;\n return error;\n}\n\n/**\n * Whether a dotted path names a field of the resource, descending through nested objects.\n *\n * Dotted because the PostgreSQL filter sanitizer admits a `field.sub` path under a planned JSONB root,\n * so a filter or sort key may legitimately address a nested field. Each segment is unwrapped\n * (optional, default, nullable) before its shape is read.\n */\nfunction schemaHasFieldPath(shape: Record<string, unknown>, path: string): boolean {\n let current: Record<string, unknown> | undefined = shape;\n for (const segment of path.split('.')) {\n const field = current?.[segment] as z.ZodTypeAny | undefined;\n if (!field) return false;\n const unwrapped = (unwrapSchema(field) ?? field) as z.ZodTypeAny;\n current = isZodObject(unwrapped) ? (getZodObjectShape(unwrapped) as Record<string, unknown>) : undefined;\n }\n return true;\n}\n\n/**\n * Refuse a collection operation whose `filterFields`, `sortFields` or own-field `searchableFields` name\n * something the resource does not have (#1806, #1952).\n *\n * Both lists are passed to the repository VERBATIM — the filter allow-list and the sort allow-list are\n * the declared names, nothing else — so a name that is not a field compiles into a condition on a\n * column that does not exist. On MongoDB that matches nothing and answers an empty page; on PostgreSQL\n * a filter fails on a missing column and a sort is silently dropped. Either way the caller gets a wrong\n * answer with no error saying the filter is unsupported, and the published API reference advertises a\n * query parameter that cannot work. Four such names had shipped when this was written: `role` on the\n * organization-member searches (the field is `roles`), `joinedAt` there and on the user searches (no\n * such field), and `hasExpiration` on six credential searches (a question about `expiresAt`, which\n * nothing translated).\n *\n * A filter key is admitted when it names a field, or when it is a presence filter\n * (`createResourcesFilterPresenceSchema`) whose TARGET names one — that is the one declared\n * translation there is. A function-valued entry — the old \"filter-ref transformer\" slot — is refused:\n * nothing ever applied it, so its key reached the database untranslated, which is this defect again.\n *\n * `searchableFields` joined the check with #1952: an own-field name reaches the repository verbatim like the\n * other two, and `ORGANIZATIONS`' SEARCH had shipped `email`, a field an organization does not have — every\n * organization search then failed on PostgreSQL (`column \"email\" does not exist`) while MongoDB quietly\n * matched nothing. A RELATIONAL entry is checked for its `localField`, the half that lives on this resource;\n * its `relatedJoinField` and `fields` belong to the related resource, which is not known here, and a related\n * resource that cannot be resolved already contributes nothing at query time (the fail-safe documented on\n * `SearchableRelationDescriptor`). `_id` is refused as a searchable field even though it is a field: search is a\n * substring match, and MongoDB stores `_id` as an ObjectId and refuses a regex on it, so the search would answer\n * 500 there. A row is found by id through a READ or an `_id` filter.\n *\n * Checked against the EFFECTIVE schema, after the framework injects its own fields, because those are\n * the fields a row actually carries.\n */\nfunction assertCollectionFieldsNameResourceFields(params: {\n resourceIdentifier: string;\n operationLabel: string;\n schemaShape: Record<string, unknown>;\n filterFields: Record<string, unknown> | undefined;\n sortFields: readonly string[] | undefined;\n searchableFields?: readonly unknown[] | undefined;\n}): void {\n const { resourceIdentifier, operationLabel, schemaShape, filterFields, sortFields, searchableFields } = params;\n for (const [key, declaration] of Object.entries(filterFields ?? {})) {\n if (typeof declaration === 'function') {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: filter \"${key}\" is a function. Filter-ref transformers are not supported — nothing applies them, so the key would reach the database untranslated. `\n + 'Declare the field\\'s Zod type, or `createResourcesFilterPresenceSchema(<field>)` for a \"has <field>\" filter.',\n );\n }\n const presenceTarget = getResourcesFilterPresenceTarget(declaration);\n if (presenceTarget !== undefined) {\n if (!schemaHasFieldPath(schemaShape, presenceTarget)) {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: presence filter \"${key}\" asks about \"${presenceTarget}\", which is not a field of the resource.`,\n );\n }\n continue;\n }\n if (!schemaHasFieldPath(schemaShape, key)) {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: filter \"${key}\" is not a field of the resource, so it would match nothing. `\n + 'Name a field, or declare `createResourcesFilterPresenceSchema(<field>)` for a \"has <field>\" filter.',\n );\n }\n }\n for (const field of sortFields ?? []) {\n if (!schemaHasFieldPath(schemaShape, field)) {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: sort field \"${field}\" is not a field of the resource, so sorting by it would be ignored.`,\n );\n }\n }\n for (const entry of searchableFields ?? []) {\n const ownField = typeof entry === 'string' ? entry : undefined;\n const localField = entry && typeof entry === 'object' ? (entry as { localField?: unknown }).localField : undefined;\n if (ownField === '_id') {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: \"_id\" cannot be a searchable field. Search is a substring match, and MongoDB refuses a regex on an ObjectId; find a row by id with a READ or an \\`_id\\` filter.`,\n );\n }\n if (ownField !== undefined && !schemaHasFieldPath(schemaShape, ownField)) {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: searchable field \"${ownField}\" is not a field of the resource, so a search on it fails on PostgreSQL and matches nothing on MongoDB.`,\n );\n }\n if (typeof localField === 'string' && !schemaHasFieldPath(schemaShape, localField)) {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: relational searchable entry joins on \"${localField}\", which is not a field of the resource.`,\n );\n }\n }\n}\n\n/**\n * Creates a validation error with ErrorType.VALIDATION\n * Used for runtime data validation errors\n */\nfunction createValidationError(message: string): Error {\n const error = new Error(message);\n (error as any).type = ErrorType.VALIDATION;\n return error;\n}\n\n/**\n * Reads the shared authority rather than re-listing the members: the URL-bearing\n * set is consumed by the route-mount gate, the URL/DTO resolver and this factory,\n * and a variant type added to one copy but not another silently changes which\n * operations get routes.\n */\nfunction isUrlisableOperationVariantType(variantType: ResourceOperationVariantType): boolean {\n return URL_BEARING_OPERATION_VARIANT_TYPES.includes(variantType);\n}\n\n/**\n * Refuse a `submissionChallenge` declaration the runtime could never honour (#1985).\n *\n * - On a variant that receives no HTTP request (INTERNAL_CALL, a cron or batch job, REPOSITORY_ONLY), no caller can send\n * the `x-submission-challenge-response` header, and such a variant is reached by the server rather than by a visitor.\n * The declaration would say \"protected\" while refusing every unauthenticated execution.\n * - An action outside the captcha vendor's grammar would be minted by no vendor, so every token for it would be refused\n * and only the proof of work could answer: a protection that silently loses half of itself.\n *\n * Thrown while the resource configuration is BUILT, so the application cannot start with either shape. The INLINE\n * requirement is checked at application start instead, because the runtime mode can be set after this factory runs.\n */\nfunction assertSubmissionChallengeDeclaration(\n operation: string,\n variantType: ResourceOperationVariantType,\n declaration: ResourceOperationSubmissionChallenge | undefined,\n): void {\n if (declaration === undefined) return;\n if (!isUrlisableOperationVariantType(variantType)) {\n throw createConfigurationError(\n `Operation '${operation}' declares a submission challenge on a '${variantType}' variant. Only a variant reached by an `\n + 'HTTP request can receive the challenge answer; declare it on the API_CALL variant a visitor calls.',\n );\n }\n if (!isSubmissionChallengeActionName(declaration.action)) {\n throw createConfigurationError(\n `Operation '${operation}' declares the submission-challenge action '${String(declaration.action)}'. An action is 1 to 100 `\n + 'letters, digits, underscores or slashes, the only names a captcha vendor mints tokens for.',\n );\n }\n}\n\n/**\n * The operations a `retentionPolicy` resource must expose to the SERVICE dispatch\n * layer, with the retention primitive that needs each one.\n *\n * Every entry is consumed by BOTH halves of the retention operation contract — the\n * presence check (is it declared in `coreOperations`?) and the resolvability check\n * (does it have a default variant `getServiceOperationPathDefault` can serve?) — so\n * adding a fourth primitive here extends both at once. Listing the ops twice is how\n * a primitive gets a presence guard and no resolvability guard.\n */\nconst RETENTION_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS: readonly {\n operation: CoreResourceOperation;\n primitive: string;\n why: string;\n}[] = [\n {\n operation: CoreResourceOperation.UPDATE_MANY,\n primitive: 'updateManyAsSystem',\n why: 'the impersonalize writer scrubs rows in place via updateManyAsSystem',\n },\n {\n operation: CoreResourceOperation.READ,\n primitive: 'readRetainedAsSystem',\n why: 'the see-through read primitive readRetainedAsSystem surfaces a single retained record via READ',\n },\n {\n operation: CoreResourceOperation.LIST,\n primitive: 'listRetainedAsSystem',\n why: 'the see-through read primitive listRetainedAsSystem surfaces retained records via LIST',\n },\n];\n\n/**\n * The operations an `isAnonymizable` resource must expose to the SERVICE dispatch\n * layer, with the `AnonymousSessionBackendService` primitive that needs each one.\n *\n * Sibling of {@link RETENTION_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS} and consumed by\n * the same TWO halves — presence (is it declared in `coreOperations`?) and\n * resolvability (does it have a default variant `getServiceOperationPathDefault`\n * can serve?). A separate constant rather than a shared one, because the two\n * capabilities demand different operations for different reasons and merging them\n * would make each entry's `why` unreadable.\n *\n * **Each entry is a DISJUNCTION, and that is the whole design decision.** Retention\n * needs three specific operations, so its constant is a flat list of single ops.\n * The anonymous-session cleanup needs to DELETE a known id set, and\n * `deleteOwnedRecords` deliberately serves that with `DELETE_MANY` when the\n * resource publishes one and per-row `DELETE` otherwise — so demanding\n * `DELETE_MANY` would force every anonymizable resource to publish a bulk-delete\n * surface it may not want (`draftNotes`, the only such resource today, publishes\n * `DELETE` alone), while demanding `DELETE` would refuse a resource that\n * legitimately publishes only the bulk form. The honest requirement is \"at least\n * one of these resolves\", which is exactly what the runtime probes.\n *\n * Measured 2026-09-09: before this guard existed, `deleteOwnedRecords` resolved\n * `DELETE_MANY` unconditionally, so for `draftNotes` the cleanup batch's phase 1\n * threw on every run — the per-session catch counted an error and the\n * `ANONYMOUS_USERS` anchor row was never removed. The runtime is now correct; this\n * constant is what refuses the configuration at boot instead of discovering it at\n * the first sweep.\n */\nconst ANONYMIZABLE_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS: readonly {\n /** Alternatives — the requirement is satisfied when AT LEAST ONE of these is declared / resolvable. */\n operations: readonly CoreResourceOperation[];\n primitive: string;\n why: string;\n}[] = [\n {\n operations: [CoreResourceOperation.LIST],\n primitive: 'listAnonymousRecords',\n why: 'the transposition and cleanup lookups list a session\\'s rows via LIST',\n },\n {\n operations: [CoreResourceOperation.UPDATE_MANY],\n primitive: 'reassignOwnership (updateManyAsSystem)',\n why: 'the anon→user transposition rewrites { userId, anonymousUserId } via updateManyAsSystem',\n },\n {\n operations: [CoreResourceOperation.DELETE_MANY, CoreResourceOperation.DELETE],\n primitive: 'deleteOwnedRecords',\n why: 'the expired-session sweep, the DISCARD transposition arm and the REPLACE pre-delete all remove '\n + 'a known id set, preferring DELETE_MANY and falling back to per-row DELETE',\n },\n];\n\n/** Human-readable \"A or B\" rendering of one requirement group's alternatives. */\nfunction describeOperationAlternatives(operations: readonly CoreResourceOperation[]): string {\n return operations.length === 1 ? String(operations[0]) : operations.join(' or ');\n}\n\nfunction assertOperationPathKeySegment(value: string, label: string, operation: string): void {\n if (value.includes(' | ')) {\n throw createConfigurationError(\n `Operation '${operation}' cannot use ${label} '${value}' because operation path keys reserve the delimiter ' | '`,\n );\n }\n}\n\nfunction createGeneratedRelationshipBulkOperations(\n operations: any[],\n relevantRelationships: ResourceRelationship[],\n resourceIdentifier: ResourceType,\n allResourceFieldIdentifiers: Partial<Record<ResourceType, string>> | Record<string, string>\n): any[] {\n const baseBulkUpdateOperations = operations.filter((operation) =>\n isUrlisableOperationVariantType(operation.variantType)\n && operation.operationIdentifier === CoreResourceOperation.UPDATE\n && 'isBulkOperation' in operation\n && operation.isBulkOperation === true\n );\n\n if (baseBulkUpdateOperations.length > 1) {\n throw createConfigurationError(\n `[${resourceIdentifier}] generated bulk relationship operations require exactly one API bulk UPDATE base operation, but found ${baseBulkUpdateOperations.length}`\n );\n }\n\n const [baseBulkUpdateOperation] = baseBulkUpdateOperations;\n\n if (!baseBulkUpdateOperation) {\n return [];\n }\n\n const generatedOperations: any[] = [];\n const knownOperationIdentifiers = new Set(\n operations.map((operation) => String(operation.operationIdentifier))\n );\n\n for (const relationship of relevantRelationships) {\n const relationshipField = Resources_SharedUtils.resolveRelationshipObjectIdentityForResource(\n relationship,\n resourceIdentifier,\n allResourceFieldIdentifiers\n ).objectFieldName;\n const allowedActions = Resources_SharedUtils.resolveAllowedBulkRelationshipActionsForResource(\n relationship,\n resourceIdentifier\n );\n\n for (const action of allowedActions) {\n const operationIdentifier = Resources_SharedUtils.buildRelationshipBulkOperationIdentifier(\n action,\n relationshipField\n );\n\n if (knownOperationIdentifiers.has(operationIdentifier)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] generated bulk relationship operation \"${operationIdentifier}\" collides with an existing operation identifier`\n );\n }\n\n knownOperationIdentifiers.add(operationIdentifier);\n\n const requestDto = (() => {\n switch (action) {\n case ResourceRelationshipBulkAction.SET:\n return ResourceRelationshipBulkSetOperationRequestSchema;\n case ResourceRelationshipBulkAction.CLEAR:\n return ResourceRelationshipBulkClearOperationRequestSchema;\n case ResourceRelationshipBulkAction.CREATE:\n return ResourceRelationshipBulkCreateOperationRequestSchema;\n case ResourceRelationshipBulkAction.LINK:\n return ResourceRelationshipBulkLinkOperationRequestSchema;\n case ResourceRelationshipBulkAction.UNLINK:\n return ResourceRelationshipBulkUnlinkOperationRequestSchema;\n case ResourceRelationshipBulkAction.REPLACE:\n return ResourceRelationshipBulkReplaceOperationRequestSchema;\n }\n })();\n\n generatedOperations.push({\n ...baseBulkUpdateOperation,\n operationIdentifier,\n isDefault: false,\n isOperationDefault: false,\n isBulkOperation: true,\n resourceOperationLike: CoreResourceOperation.UPDATE_MANY,\n requestDto,\n // Generated bulk-relationship ops own an explicit request contract (the\n // bulk action schema above) — preserve it verbatim, never rebuild.\n hasCustomRequestDto: true,\n responseDto: ResourceRelationshipBulkActionResultSchema,\n hasCustomResponseDto: true,\n basicPrefixOperation: undefined,\n notificationBadgeOperations: [],\n userNotifications: [],\n m2mNotifications: [],\n tokenGeneration: undefined,\n tokenRevocation: undefined,\n });\n }\n }\n\n return generatedOperations;\n}\n\nexport function reconcileGeneratedRelationshipBulkOperations(\n resourceConfigurations: Record<string, AnyResourceConfiguration>,\n allResourceRelationships: ResourceRelationship[],\n allResourceFieldIdentifiers: Partial<Record<ResourceType, string>> | Record<string, string>\n): void {\n for (const [resourceType, resourceConfiguration] of Object.entries(resourceConfigurations)) {\n if (!Array.isArray(resourceConfiguration.operations)) {\n continue;\n }\n\n const currentResourceType = resourceType as ResourceType;\n const nonGeneratedOperations = resourceConfiguration.operations.filter(\n (operation) => !Resources_SharedUtils.parseRelationshipBulkOperationIdentifier(String(operation.operationIdentifier))\n );\n const relevantRelationships = allResourceRelationships.filter(\n (relationship) =>\n relationship.resourceType1 === currentResourceType\n || relationship.resourceType2 === currentResourceType\n );\n\n resourceConfiguration.operations = [\n ...nonGeneratedOperations,\n ...createGeneratedRelationshipBulkOperations(\n nonGeneratedOperations,\n relevantRelationships,\n currentResourceType,\n allResourceFieldIdentifiers\n ),\n ];\n }\n}\n\n/**\n * Derive the file-export companion of every LIST/SEARCH operation that declared\n * `collectionExport`.\n *\n * ## Why derived rather than authored\n *\n * The export must be exactly as reachable as the listing it exports — never more. Copying the source\n * operation wholesale and overriding only what must differ makes that structural: an author cannot\n * give the export wider `roles`, a different parent-scope path, or a laxer variant, because they\n * never write it. It is the same construction `createGeneratedFileRegenerateOperations` uses one\n * function above.\n *\n * ## What is deliberately CLEARED rather than inherited\n *\n * `mcp` is the one that matters. A LIST curated onto an MCP server is a PAGINATED read tool; its\n * export companion returns the whole result set in a single call, which is a different risk profile.\n * Spreading the source operation would silently turn \"this app declared an export\" into \"this app\n * grew a new agent tool that exfiltrates the table\", so the flag is dropped and an application that\n * genuinely wants an agent-callable export has to say so.\n *\n * The notification/token fields are cleared for the same reason they are on the regenerate\n * companion: they describe effects of the SOURCE operation and firing them again on an export would\n * double-notify.\n */\nfunction createGeneratedCollectionExportOperations(params: {\n operations: any[];\n resourceIdentifier: ResourceType;\n}): any[] {\n const knownOperationIdentifiers = new Set(\n params.operations.map((operation) => String(operation.operationIdentifier)),\n );\n\n const exportOperations: any[] = [];\n\n for (const operation of params.operations) {\n const exportConfig = (operation as { collectionExport?: ResourceCollectionExportConfig }).collectionExport;\n if (!exportConfig) {\n continue;\n }\n\n const sourceOperationIdentifier = String(operation.operationIdentifier);\n\n if (!isUrlisableOperationVariantType(operation.variantType)) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" declares collectionExport but is not URL-bearing; an export has no route to live on`\n );\n }\n\n // The source's CORE verb decides which service call the export re-runs, and it is the only thing\n // that can: a custom operation carries LIST/SEARCH semantics through `resourceOperationLike`.\n const sourceCoreOperation = (operation.resourceOperationLike ?? operation.operationIdentifier) as CoreResourceOperation;\n if (sourceCoreOperation !== CoreResourceOperation.LIST && sourceCoreOperation !== CoreResourceOperation.SEARCH) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" declares collectionExport but is neither LIST nor SEARCH (resolved core operation: ${String(sourceCoreOperation)})`\n );\n }\n\n // Empty arrays are a startup error, never a silent \"offer everything\" — the same rule\n // `mcp.servers` follows, so the declaration always reads as \"exactly these\".\n if (!exportConfig.formats || exportConfig.formats.length === 0) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" declares collectionExport with no formats; declare at least one, or omit collectionExport entirely`\n );\n }\n if (!exportConfig.rowScopes || exportConfig.rowScopes.length === 0) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" declares collectionExport with no rowScopes; declare at least one, or omit collectionExport entirely`\n );\n }\n // A PDF is rendered by a template, so declaring the format without naming one leaves the export\n // nothing to render with; naming one without the format is a declaration nothing reads (#1645).\n const offersPdf = exportConfig.formats.includes(ResourceCollectionExportFormat.PDF);\n if (offersPdf && !exportConfig.pdfTemplateId?.trim()) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" offers the PDF collection-export format but names no pdfTemplateId; a PDF export is rendered by a template`\n );\n }\n if (!offersPdf && exportConfig.pdfTemplateId !== undefined) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" names collectionExport.pdfTemplateId but does not offer the PDF format; add ResourceCollectionExportFormat.PDF or remove the template id`\n );\n }\n if (exportConfig.maximumExportedRows !== undefined && exportConfig.maximumExportedRows <= 0) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" declares a non-positive collectionExport.maximumExportedRows; omit it for no ceiling`\n );\n }\n // A PDF cannot stream: the template lays out every row at once, in memory, before a byte is sent. So a\n // whole-set PDF must declare how many rows it will hold — an unbounded one is an allocation any\n // caller with the listing's roles can make as large as the table (#1645). CSV and JSON stream and\n // keep their optional ceiling.\n if (offersPdf\n && exportConfig.rowScopes.includes(ResourceCollectionExportRowScope.FULL_RESULT_SET)\n && exportConfig.maximumExportedRows === undefined) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" offers a whole-set PDF export without collectionExport.maximumExportedRows; a PDF is built in memory from every row, so it must declare its ceiling`\n );\n }\n\n const operationIdentifier = Resources_SharedUtils.buildGeneratedCollectionExportOperationIdentifier(sourceOperationIdentifier);\n if (knownOperationIdentifiers.has(operationIdentifier)) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] generated collection export operation \"${operationIdentifier}\" collides with an existing operation identifier`\n );\n }\n knownOperationIdentifiers.add(operationIdentifier);\n\n exportOperations.push({\n ...operation,\n operationIdentifier,\n isDefault: false,\n isOperationDefault: false,\n isBulkOperation: false,\n httpVerb: HttpMethod.GET,\n // Keeps the URL builder treating it as collection-level, and gives a SEARCH export the\n // `search` segment its source already has — so the two exports of one resource cannot collide.\n resourceOperationLike: sourceCoreOperation,\n generatedOperation: {\n kind: ResourceGeneratedOperationKind.GENERATED_COLLECTION_EXPORT,\n sourceOperationIdentifier,\n sourceCoreOperation,\n export: exportConfig,\n },\n // The export takes the SOURCE's query contract (filters, sort, q, pagination) verbatim plus its\n // own two selectors, so \"export what I am looking at\" is expressible without a second grammar.\n responseDto: ResourceCollectionExportResponseSchema,\n internalDto: ResourceCollectionExportResponseSchema,\n hasCustomResponseDto: true,\n // Cleared, not inherited — see this function's docstring.\n mcp: undefined,\n collectionExport: undefined,\n basicPrefixOperation: undefined,\n notificationBadgeOperations: [],\n userNotifications: [],\n m2mNotifications: [],\n tokenGeneration: undefined,\n tokenRevocation: undefined,\n });\n }\n\n return exportOperations;\n}\n\nfunction createGeneratedFileRegenerateOperations(params: {\n operations: any[];\n resourceIdentifier: ResourceType;\n resourceFieldIdentifier: string;\n mainSchema: z.ZodTypeAny;\n generatedFileDiscoverySchema?: z.ZodTypeAny;\n persistenceAdapter?: unknown;\n}): any[] {\n const generatedFileDiscoverySchema = params.generatedFileDiscoverySchema ?? params.mainSchema;\n const collectedFields = collectTemplatableFileFieldPaths(generatedFileDiscoverySchema);\n const arrayContainedFields = collectedFields.filter((field) => field.isInsideArray);\n if (arrayContainedFields.length > 0) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] generated PDF file fields inside arrays or dynamic containers are not supported in v1: ${arrayContainedFields.map((field) => field.fieldName).join(', ')}`\n );\n }\n\n const generatedFields = collectedFields.filter(\n (field) => !field.isInsideArray,\n );\n if (generatedFields.length === 0) {\n return [];\n }\n /**\n * A generated document is MATERIALIZED: rendering it writes a FILES metadata row that must\n * commit in the SAME native transaction as the row that owns it, or a failure between the two\n * leaves either a dangling document reference or an orphaned blob. So the only question this\n * guard can honestly ask of a DECLARATION is whether the declared adapter is one that HAS a\n * transactional local store at all.\n *\n * ## What changed, and why the old shape was wrong rather than merely conservative\n *\n * This refused every adapter except MongoDB, on the grounds that file metadata was pinned to\n * MongoDB, so a generated PDF on a PostgreSQL resource would have crossed adapters. That reason\n * is gone: FILES was un-pinned and now FOLLOWS the application's default adapter\n * (`files.shared.resources-config.schemas.ts:43-67`), precisely so a resource and its file\n * metadata share one native transaction. A PostgreSQL application whose FILES is therefore also\n * PostgreSQL was being refused at authoring time for a boundary that no longer exists.\n *\n * The ASYMMETRY was the tell, and it is the reason this could not be left alone: `undefined` —\n * \"follow the application default\" — was and is admitted, so the identical resource in the\n * identical PostgreSQL application was already authorable by SAYING LESS. A guard whose answer\n * depends on whether a redundant declaration was written is testing the declaration, not the\n * capability.\n *\n * ## What still refuses, and why that half is load-bearing\n *\n * `INTROSPECTION` rows are recomputed per read — there is no store and no transaction. `HTTP_API`\n * rows live in someone else's system and are read-only by construction. Neither can own a\n * locally-materialized document row, and unlike the PostgreSQL case that is knowable from the\n * declaration alone, so refusing at authoring time is strictly better than discovering it on the\n * first write. `getDatabaseServiceForAdapter` says the same thing at runtime, for the same two\n * adapters, in the same words.\n *\n * ## Shape\n *\n * Expressed as an exhaustive `PersistenceAdapterCases` map rather than a comparison, so a fifth\n * backing kind is a COMPILE error here instead of silently inheriting whichever arm an `else`\n * happened to mean — the failure mode `selectByPersistenceAdapter` exists to remove, and the one\n * the previous `!== MONGODB` shape genuinely had in the other direction (it would have refused a\n * future stored adapter without anyone deciding to).\n *\n * `isPersistenceAdapter` runs FIRST so an erased or unknown declaration keeps refusing through\n * `createConfigurationError` with the resource and the field list named, rather than through the\n * selector's plain `Error`. This factory is a shared-tier authoring surface: its refusals are\n * read by an application author, and the field list is the actionable half.\n *\n * ## What this guard deliberately does NOT decide\n *\n * It cannot see the application's default adapter, so it cannot tell whether THIS resource and\n * FILES resolve to the same store — a resource declaring `POSTGRESQL` inside a MongoDB-default\n * application is a real cross-adapter boundary and must still be refused. That refusal is made\n * where the resolved adapters are actually known, at\n * `services-registry-handler.backend.service.ts` →\n * `assertGeneratedFileMaterializationCommitsWithRow`, which asks the persistence unit of work\n * whether `{this resource, FILES-as-ATOMIC}` can commit atomically and throws\n * `MIXED_PERSISTENCE_ADAPTERS` when it cannot. It gates all three materialization entry points\n * (create, createMany, regenerate) and, unlike this one, also covers the undeclared case this\n * guard has always waved through — which is why relaxing here narrows nothing.\n */\n const GENERATED_DOCUMENT_MATERIALIZATION_SUPPORT: PersistenceAdapterCases<boolean> = {\n [PersistenceAdapter.MONGODB]: true,\n [PersistenceAdapter.POSTGRESQL]: true,\n [PersistenceAdapter.INTROSPECTION]: false,\n [PersistenceAdapter.HTTP_API]: false,\n };\n if (params.persistenceAdapter !== undefined) {\n const declaredAdapter = params.persistenceAdapter;\n const materializationIsSupported = isPersistenceAdapter(declaredAdapter)\n && selectByPersistenceAdapter(declaredAdapter, GENERATED_DOCUMENT_MATERIALIZATION_SUPPORT);\n if (!materializationIsSupported) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] generated PDF file fields require a persistence adapter with a transactional local store, `\n + `so that the generated file's metadata row commits with the row that owns it `\n + `(declared adapter: '${String(declaredAdapter)}'; supported: `\n + `'${PersistenceAdapter.MONGODB}', '${PersistenceAdapter.POSTGRESQL}', or no declaration to follow the application default): `\n + `${generatedFields.map((field) => field.fieldName).join(', ')}`\n );\n }\n }\n\n const baseUpdateOperation = params.operations.find((operation) =>\n isUrlisableOperationVariantType(operation.variantType)\n && operation.operationIdentifier === CoreResourceOperation.UPDATE\n && 'isBulkOperation' in operation\n && operation.isBulkOperation !== true\n && operation.isOperationDefault === true\n );\n if (!baseUpdateOperation) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] generated file regenerate operations require a default non-bulk URL-bearing UPDATE operation`\n );\n }\n\n const knownOperationIdentifiers = new Set(\n params.operations.map((operation) => String(operation.operationIdentifier))\n );\n const responseDto = z.object({\n /*\n * A FILE value, marked as one (`z_file()`), not the bare `SingleFileValueSchema` shape. The shape alone is a plain\n * `{ fileId, updatedAt }` object, so every label walk read it as a nested object of two fields: the application\n * labelling planner planned `fields.file.fileId` and `fields.file.updatedAt` for every resource carrying a generated\n * PDF, words no screen reads (#1959). Marked, it classifies as `FieldSchemaType.FILE` like the field it was\n * regenerated from, and is labelled — and displayed — as one file. Generated files are PDFs (`generation` pins that\n * mime type on the source field), so the response says the same; the `generation` block itself names one template\n * and cannot describe a DTO shared by every generated field of the resource.\n */\n file: z_file({ allowedMimeTypes: 'PDF' }).describe('The newly generated file.'),\n // The record is this resource's own, so its fields are described by its specification (#1625).\n resource: markEmbeddedResourceSchema(generatedFileDiscoverySchema, String(params.resourceIdentifier))\n .describe('The record after the regenerated file was stored on it.'),\n });\n\n return generatedFields.map(({ fieldName }) => {\n const operationIdentifier = Resources_SharedUtils.buildGeneratedFileRegenerateOperationIdentifier(fieldName);\n if (knownOperationIdentifiers.has(operationIdentifier)) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] generated file regenerate operation \"${operationIdentifier}\" collides with an existing operation identifier`\n );\n }\n knownOperationIdentifiers.add(operationIdentifier);\n\n return {\n ...baseUpdateOperation,\n operationIdentifier,\n isDefault: false,\n isOperationDefault: false,\n isBulkOperation: false,\n httpVerb: HttpMethod.POST,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n generatedOperation: {\n kind: ResourceGeneratedOperationKind.GENERATED_FILE_REGENERATE,\n fieldName,\n },\n requestDto: z.object({}),\n // Generated file-regenerate ops own their request contract: an intentionally\n // empty body (regeneration is UPDATE-like but takes no input). Preserve it,\n // do not rebuild from mainSchema decorators.\n hasCustomRequestDto: true,\n responseDto,\n internalDto: responseDto,\n hasCustomResponseDto: true,\n basicPrefixOperation: undefined,\n notificationBadgeOperations: [],\n userNotifications: [],\n m2mNotifications: [],\n tokenGeneration: undefined,\n tokenRevocation: undefined,\n };\n });\n}\n\n// --------------------------------\n// Token Config Validation\n// --------------------------------\n\nconst BULK_MUTATION_CORE_OPERATIONS: ReadonlySet<CoreResourceOperation> = new Set([\n CoreResourceOperation.CREATE_MANY,\n CoreResourceOperation.UPDATE_MANY,\n CoreResourceOperation.DELETE_MANY,\n]);\nconst TOKEN_STATE_EFFECT_UNSUPPORTED_CORE_OPERATIONS: ReadonlySet<CoreResourceOperation> = new Set([\n ...BULK_MUTATION_CORE_OPERATIONS,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.COUNT,\n]);\n\nfunction isCoreBulkMutationOperation(\n operationIdentifier: unknown,\n): boolean {\n return BULK_MUTATION_CORE_OPERATIONS.has(\n operationIdentifier as CoreResourceOperation,\n );\n}\n\nfunction isTokenStateEffectUnsupportedOperation(\n operationIdentifier: unknown,\n): boolean {\n return TOKEN_STATE_EFFECT_UNSUPPORTED_CORE_OPERATIONS.has(\n operationIdentifier as CoreResourceOperation,\n );\n}\n\n/**\n * Validates tokenGeneration configuration at build time.\n * Catches common mistakes before the app starts.\n */\nfunction validateTokenGenerationConfig(\n config: TokenGenerationConfig,\n resourceIdentifier: string,\n operationIdentifier: string,\n): void {\n const prefix = `[${resourceIdentifier}.${operationIdentifier}] tokenGeneration`;\n\n // BOUNDED_REUSE requires maxUses\n if (config.consumptionMode === ConsumableToken_ConsumptionMode.BOUNDED_REUSE) {\n if (config.maxUses == null || config.maxUses < 1) {\n throw createConfigurationError(\n `${prefix}: consumptionMode is BOUNDED_REUSE but maxUses is ${config.maxUses ?? 'missing'}. ` +\n `BOUNDED_REUSE tokens must specify maxUses >= 1.`,\n );\n }\n }\n\n // maxUses should NOT be set for non-BOUNDED_REUSE modes (likely a mistake)\n if (config.consumptionMode !== ConsumableToken_ConsumptionMode.BOUNDED_REUSE && config.maxUses != null) {\n throw createConfigurationError(\n `${prefix}: maxUses is set (${config.maxUses}) but consumptionMode is ${config.consumptionMode}. ` +\n `maxUses is only valid for BOUNDED_REUSE tokens. Remove maxUses or change consumptionMode.`,\n );\n }\n\n // tokenType is required\n if (!config.tokenType) {\n throw createConfigurationError(`${prefix}: tokenType is required.`);\n }\n\n // expiresIn is required\n if (config.expiresIn == null) {\n throw createConfigurationError(`${prefix}: expiresIn is required (static value or derived function).`);\n }\n\n // If expiresIn is static, validate shape (minutes, hours, days only; value >= 1)\n if (typeof config.expiresIn !== 'function') {\n const result = ExpiresInDurationSchema.safeParse(config.expiresIn);\n if (!result.success) {\n const msg = result.error.issues.map((i) => i.message).join('; ');\n throw createConfigurationError(`${prefix}: expiresIn validation failed: ${msg}`);\n }\n }\n\n // W7.3b: createsOneOffSession requires consumeAt\n if (config.createsOneOffSession && !config.consumeAt) {\n throw createConfigurationError(\n `${prefix}: createsOneOffSession is true but consumeAt is missing. ` +\n `Specify 'EXCHANGE' or 'TARGET_OPERATION'.`,\n );\n }\n\n // W7.3b: consumeAt without createsOneOffSession is a mistake\n if (config.consumeAt && !config.createsOneOffSession) {\n throw createConfigurationError(\n `${prefix}: consumeAt is set ('${config.consumeAt}') but createsOneOffSession is not true. ` +\n `consumeAt only applies to one-off session tokens.`,\n );\n }\n}\n\n/**\n * Validates tokenAuthentication configuration at build time.\n *\n * **The only thing this refuses is an EMPTY `types` array, and that is the whole point.**\n * `types: []` is well-typed, reads as \"no restriction needed\", and used to fail OPEN: the runtime\n * collapsed an empty list to `undefined` and `ConsumableTokenBackendService.validateToken` treats\n * `undefined` as \"the caller does its own binding check\", so the operation accepted EVERY consumable\n * token type in the system — a password-reset link, an email-verification link, an OAuth state token\n * — with that token's `roles` flowing into the execution context. That is the confused-deputy shape:\n * one token namespace, several verifiers, and an audience check that was optional at the verifier.\n *\n * Refusing here rather than at the verifier is deliberate. A runtime refusal turns an authoring\n * mistake into a request-time failure on a path nobody may exercise before production; a build-time\n * refusal makes the shape unrepresentable, because a resource config is constructed at module load\n * and an application carrying one cannot boot. `validateToken` ALSO refuses an empty array now, as\n * the chokepoint backstop for a config that never passed through this factory — see issue #313.\n *\n * An operation that genuinely wants no type constraint has no expression here and must not get one:\n * the correct authoring is to name every type the operation accepts. A verifier that owns its own\n * binding check (the file-share download, `validateFileToken`) calls `validateToken` directly and\n * never declares `tokenAuthentication` at all.\n */\nfunction validateTokenAuthenticationConfig(\n config: TokenAuthenticationConfig,\n resourceIdentifier: string,\n operationIdentifier: string,\n): void {\n const prefix = `[${resourceIdentifier}.${operationIdentifier}] tokenAuthentication`;\n\n if (!config.types || config.types.length === 0) {\n throw createConfigurationError(\n `${prefix}: types must be a non-empty array of the consumable token types this operation accepts. ` +\n `An empty list is not \"no restriction\" — it would accept EVERY consumable token type in the ` +\n `system (password-reset, email-verification, OAuth state, …) as authentication for this ` +\n `operation, with that token's roles. Name the types explicitly.`,\n );\n }\n\n if (!config.policy) {\n throw createConfigurationError(\n `${prefix}: policy is required (ALTERNATIVE — the token replaces JWT auth; or ADDITIVE — the ` +\n `token is required on top of it).`,\n );\n }\n}\n\n/**\n * Validates tokenRevocation configuration at build time.\n */\nfunction validateTokenRevocationConfig(\n config: TokenRevocationConfig,\n resourceIdentifier: string,\n operationIdentifier: string,\n): void {\n const prefix = `[${resourceIdentifier}.${operationIdentifier}] tokenRevocation`;\n\n if (!config.tokenTypes || config.tokenTypes.length === 0) {\n throw createConfigurationError(`${prefix}: tokenTypes must be a non-empty array of token types to revoke.`);\n }\n}\n\n// --------------------------------\n// Required Features Normalization\n// --------------------------------\n\n/**\n * Normalizes requiredFeatures input to the full form.\n * - undefined → undefined (no features required)\n * - string[] → { features: [...], mode: 'OR' } (shorthand)\n * - full config → passed through as-is\n */\nfunction normalizeRequiredFeatures(input: RequiredFeaturesConfig | undefined): RequiredFeaturesNormalized | undefined {\n if (input === undefined) return undefined;\n if (Array.isArray(input)) {\n // Shorthand: string[] → { features: [...], mode: 'OR' }\n return { features: input, mode: 'OR' };\n }\n return input;\n}\n\n// --------------------------------\n// DTO Auto-Derivation Utilities\n// --------------------------------\n\n/**\n * @wildo_source:part:start saas.models.resource-config.system-managed-fields facet:layer:shared facet:audience:app-developer\n *\n * The field names the framework owns. They are removed from every generated CREATE and UPDATE\n * request contract, for every resource, whatever your schema declares and whatever a caller sends.\n *\n * Declaring one of these in a resource schema is fine and often necessary — the framework maintains\n * the value. What you cannot do is accept it from a client, default it in a form, or require it on a\n * create: the field is stripped before validation runs, so a form that collects it submits a value\n * that is discarded, and a schema that requires it rejects every request.\n *\n * | field | who writes it |\n * |---|---|\n * | `_id` | the persistence layer (or your own `.isPrimaryKey()` field, stored beneath it) |\n * | `createdAt` / `updatedAt` / `deletedAt` | the repository, on write |\n * | `createdByUserId` | the repository, stamped from the execution context on CREATE, immutable afterwards |\n * | `_version_db_doc` | the framework's optimistic-concurrency marker |\n *\n * The failure this prevents is quiet and was paid for once: a create form validating against a\n * reserved field that no form collects fails every submit with `expected string, received undefined`,\n * and the schema looks correct while it does. So the exclusion is unconditional and does not depend\n * on the resource author remembering `.excludeFromCreate()`.\n *\n * ⚠️ A NARROWER set — `_id`, `createdAt`, `updatedAt`, `deletedAt`, `_version_db_doc` — is\n * additionally *mandatory-discard*: even a trusted in-process system write cannot re-attach those\n * through `preserveServerInjectedFields`. `createdByUserId` is deliberately not in that set, because\n * an engine flow creating a row on somebody's behalf legitimately needs to stamp it.\n */\nconst SYSTEM_MANAGED_FIELDS = ['_id', 'createdAt', 'updatedAt', 'deletedAt', 'createdByUserId', '_version_db_doc'] as const;\n/** @wildo_source:part:end saas.models.resource-config.system-managed-fields */\n\n// PRIMARY_SCOPE_FIELD_IDENTIFIERS and getPrimaryScopeFieldIdentifier imported from resources.shared.schemas\n\n/**\n * Build a CREATE request DTO from the main schema using decorators.\n *\n * Excludes:\n * - System-managed fields (_id, createdAt, updatedAt, etc.)\n * - Virtual fields (computed, not stored)\n * - Fields with excludeFromCreate decorator\n *\n * NOTE: Backend-only fields (isBackendOnly) are NOT excluded from CREATE DTOs.\n * The isBackendOnly decorator controls RESPONSE filtering (what is returned to clients),\n * not REQUEST filtering (what can be set during creation). Backend operations need to\n * set fields like passwordHash, apiKey, etc. directly during resource creation.\n *\n * @param mainSchema - The main resource schema\n * @param customExclusions - Additional fields to exclude\n * @returns A new schema with only creatable fields\n */\nexport function buildCreateRequestDto<T extends z.ZodTypeAny>(\n mainSchema: T,\n customExclusions?: string[]\n): z.ZodTypeAny {\n try {\n const shape = getZodObjectShape(mainSchema);\n const createShape: Record<string, z.ZodTypeAny> = {};\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const typedSchema = fieldSchema as z.ZodTypeAny;\n\n // Exclude system-managed fields\n if ((SYSTEM_MANAGED_FIELDS as readonly string[]).includes(fieldName)) continue;\n\n // Exclude primary scope field identifiers (auto-populated from context)\n if ((PRIMARY_SCOPE_FIELD_IDENTIFIERS as readonly string[]).includes(fieldName)) continue;\n\n // Exclude virtual fields (computed, not stored)\n if (isVirtualField(typedSchema)) continue;\n\n // Exclude explicitly marked fields\n if (isExcludedFromCreate(typedSchema)) continue;\n\n // Exclude generated file fields; clients cannot upload or author values\n // that are materialized by framework-owned operations.\n if (isTemplatableFileField(typedSchema)) continue;\n\n // NOTE: Backend-only fields are NOT excluded here.\n // isBackendOnly controls response filtering, not request filtering.\n // Backend operations need to set fields like passwordHash directly.\n\n // Exclude non-discriminator literals (fixed values auto-populated by backend)\n // Discriminator literals are kept for variant selection\n const unwrapped = unwrapSchema(typedSchema);\n if (getZodType(unwrapped) === 'literal' && !isDiscriminatorField(typedSchema)) continue;\n\n // Exclude custom exclusions\n if (customExclusions?.includes(fieldName)) continue;\n\n createShape[fieldName] = stripTemplatableFileFieldsRecursively(fieldSchema as z.ZodTypeAny);\n }\n\n return stripTemplatableFileFieldsRecursively(z.object(createShape));\n } catch {\n // If schema is not an object, return as-is\n return mainSchema;\n }\n}\n\n\n\n\n/**\n * Build an UPDATE request DTO from the main schema using decorators.\n *\n * Excludes:\n * - System-managed fields (_id, createdAt, updatedAt, etc.)\n * - Virtual fields (computed, not stored)\n * - Fields with excludeFromUpdate decorator\n *\n * NOTE: Backend-only fields (isBackendOnly) are NOT excluded from UPDATE DTOs.\n * The isBackendOnly decorator controls RESPONSE filtering (what is returned to clients),\n * not REQUEST filtering (what can be set during updates). Backend operations may need\n * to update fields like passwordHash, apiKey, etc. directly.\n *\n * All remaining fields are made optional for PATCH-style updates.\n *\n * @param mainSchema - The main resource schema\n * @param customExclusions - Additional fields to exclude\n * @returns A new partial schema with only updatable fields\n */\nfunction buildUpdateRequestDto<T extends z.ZodTypeAny>(\n mainSchema: T,\n customExclusions?: string[]\n): z.ZodTypeAny {\n try {\n const shape = getZodObjectShape(mainSchema);\n const updateShape: Record<string, z.ZodTypeAny> = {};\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const typedSchema = fieldSchema as z.ZodTypeAny;\n\n // Exclude system-managed fields\n if ((SYSTEM_MANAGED_FIELDS as readonly string[]).includes(fieldName)) continue;\n\n // Exclude primary scope field identifiers (immutable, context-derived)\n if ((PRIMARY_SCOPE_FIELD_IDENTIFIERS as readonly string[]).includes(fieldName)) continue;\n\n // Exclude virtual fields (computed, not stored)\n if (isVirtualField(typedSchema)) continue;\n\n // Exclude explicitly marked fields\n if (isExcludedFromUpdate(typedSchema)) continue;\n\n // Exclude generated file fields; explicit regenerate operations own\n // refreshing these values instead of generic UPDATE payloads.\n if (isTemplatableFileField(typedSchema)) continue;\n\n // NOTE: Backend-only fields are NOT excluded here.\n // isBackendOnly controls response filtering, not request filtering.\n // Backend operations may need to update fields like passwordHash.\n\n // Exclude ALL literal fields (immutable after creation)\n const unwrapped = unwrapSchema(typedSchema);\n if (getZodType(unwrapped) === 'literal') continue;\n\n // Exclude custom exclusions\n if (customExclusions?.includes(fieldName)) continue;\n\n // Make field optional for PATCH-style update, peeling any `.default()` so\n // an omitted field is never re-materialized to its default and written\n // back over the stored value (see `toPatchOptionalField`).\n updateShape[fieldName] = toPatchOptionalField(\n stripTemplatableFileFieldsRecursively(fieldSchema as z.ZodTypeAny),\n );\n }\n\n // PATCH write rule: absent key untouched, null clears — the fact a form reads to clear a field (#989).\n return stripTemplatableFileFieldsRecursively(markPatchRequestDtoObject(z.object(updateShape)));\n } catch {\n // If schema is not an object, return as-is\n return mainSchema;\n }\n}\n\n/**\n * Derives the appropriate request DTO based on operation type.\n *\n * - CREATE: Uses buildCreateRequestDto (excludes excludeFromCreate fields)\n * - UPDATE: Uses buildUpdateRequestDto (excludes excludeFromUpdate fields, all partial)\n * - READ/DELETE and custom operations without an explicit DTO: empty object\n *\n * This is an early factory placeholder. The final DTO pass in\n * ResourcesConfigOperationsDtosBuilderUtils applies inherited schemas, the\n * shared no-body operation policy, and SEARCH query schemas derived from\n * collection-view metadata.\n *\n * @param operation - The operation identifier\n * @param mainSchema - The main resource schema\n * @param providedDto - Explicitly provided DTO (takes precedence)\n * @returns The appropriate request DTO schema\n */\nexport function deriveRequestDto<T extends z.ZodTypeAny>(\n operation: string,\n mainSchema: T,\n providedDto?: z.ZodTypeAny\n): z.ZodTypeAny {\n // If explicit DTO is provided, use it (for custom operations)\n if (providedDto !== undefined) {\n return stripTemplatableFileFieldsRecursively(providedDto);\n }\n\n // Auto-derive based on operation type\n switch (operation) {\n case CoreResourceOperation.CREATE:\n return buildCreateRequestDto(mainSchema);\n case CoreResourceOperation.UPDATE:\n return buildUpdateRequestDto(mainSchema);\n case CoreResourceOperation.READ:\n case CoreResourceOperation.DELETE:\n // READ and DELETE don't need request bodies (just URL params)\n return z.object({});\n default:\n // For custom operations without explicit DTO, return empty object\n // (custom operations should provide their own requestDto)\n return z.object({});\n }\n}\n\n// --------------------------------\n// Decorator Combination Validation\n// --------------------------------\n\n/**\n * Validates that decorated fields don't have invalid decorator combinations.\n *\n * Invalid combinations:\n * - isSummaryField + isBackendOnly: Backend-only fields can't be in summaries\n * - isDiscriminator + excludeFromCreate: Discriminator is required for create operations\n *\n * @param mainSchema - The main schema to validate\n * @param resourceIdentifier - Resource name for error messages\n * @throws Error if invalid decorator combinations are found\n */\nfunction validateDecoratorCombinations(\n mainSchema: z.ZodTypeAny,\n resourceIdentifier: string\n): void {\n const issues: string[] = [];\n\n try {\n const shape = getZodObjectShape(mainSchema);\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const typedSchema = fieldSchema as z.ZodTypeAny;\n\n // Check: isSummaryField + isBackendOnly is invalid\n if (isSummaryField(typedSchema) && isBackendOnlyField(typedSchema)) {\n issues.push(\n `Field '${fieldName}' has both isSummaryField and isBackendOnly decorators. ` +\n `Backend-only fields cannot be included in summary responses.`\n );\n }\n\n // Check: isDiscriminator + excludeFromCreate is invalid\n if (isDiscriminatorField(typedSchema) && isExcludedFromCreate(typedSchema)) {\n issues.push(\n `Field '${fieldName}' has both isDiscriminator and excludeFromCreate decorators. ` +\n `Discriminator fields must be present in create requests to determine the variant type.`\n );\n }\n\n // Check: isDiscriminator + excludeFromUpdate is a warning (logged but not an error)\n // Discriminators are typically immutable, so this might be intentional\n }\n } catch {\n // Schema may not be an object, skip validation\n return;\n }\n\n if (issues.length > 0) {\n throw createConfigurationError(\n `Resource '${resourceIdentifier}' has invalid decorator combinations:\\n` +\n issues.map(issue => ` - ${issue}`).join('\\n')\n );\n }\n}\n\n// --------------------------------\n// Helper Types\n// --------------------------------\n\n/**\n * User notification definition for ResourceConfiguration builder.\n * Omits 'primaryScope' (auto-derived) and 'identifier' (auto-generated).\n *\n * Note: customNotificationRef is optional but REQUIRED when there are 2+ notifications\n * of the same target type in the same operation.\n *\n * Distributive omit: `UserNotificationDefinition` is a discriminated union (by\n * `channel`); a bare `Omit<Union, K>` collapses to only the COMMON keys and silently\n * drops every channel-specific field (the EMAIL variant's `recipientEmailField`, the\n * FRONT_END_SUCCESS variant's `celebration`/`nextStep`). Distributing over each union\n * member preserves those per-channel fields for config authoring.\n */\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\ntype UserNotificationDefinitionWithoutPrimaryScopeAndIdentifier = DistributiveOmit<UserNotificationDefinition, 'primaryScope' | 'identifier'>;\ntype M2MNotificationDefinitionWithoutIdentifier = Omit<M2MNotificationDefinition, 'identifier'>;\n\n// --------------------------------\n// Helper Functions\n// --------------------------------\n\n/**\n * Transforms and categorizes resource relationships into parent/child/self buckets.\n *\n * ## Flat Categorization (No Separate Conditional Bucket)\n *\n * ALL relationships — including those with `discriminator` or `condition` — are placed\n * into the same three buckets (parentRelationships, childRelationships, selfRelationships).\n * Conditional relationships carry their filter inline on the relationship object itself,\n * so runtime consumers evaluate conditions when actual parent data is available:\n *\n * - **ResourceContextBackendService**: Checks discriminator/condition in `fetchChildResourcesWithPolicy`\n * against the parentResource BEFORE querying children.\n * - **ServicesRegistryHandler**: Uses `filterRelationshipsByParent()` at 4 points\n * (nested CREATE, READ, UPDATE, lifecycle DELETE) to filter active child relationships.\n * - **ContainerNested** (frontend): Evaluates discriminator/condition against parentData\n * with try-catch safety to prevent React tree crashes.\n *\n * Previously, a separate `inheritanceSchemaRelationships` bucket existed but was never\n * consumed at runtime, making the conditional system non-functional. That bucket has\n * been removed in favor of this flat, inline approach.\n *\n * ## M:N Relationship Decomposition\n *\n * Many-to-many relationships are decomposed into synthetic 1:N relationships:\n * - **Junction table**: Gets two parent relationships (one from each entity side),\n * with OPTIONAL_CONTEXT. These do NOT carry discriminator/condition (the junction\n * table itself doesn't need condition awareness — it's the entity sides that do).\n * - **Entity sides**: Each gets a child relationship to the junction table.\n * These DO carry the original `discriminator` and `condition` from the M:N declaration,\n * ensuring conditional M:N relationships work correctly.\n *\n * Important: this decomposition is an internal compilation step, not a second\n * developer-facing configuration surface. Developers declare one M:N\n * association with `jointResourceType`; the factory derives the synthetic\n * junction-facing edges needed by DTO builders, URL generation, and runtime\n * services.\n *\n * ## Relationship Direction Convention\n *\n * - `resourceType1` = parent, `resourceType2` = child\n * - `foreignKeyField` lives on the child (resourceType2) and points to the parent\n * - Example: USERS → USER_PROFILES with foreignKeyField: 'userId'\n * means userId is a field on USER_PROFILES pointing to USERS\n *\n * @param resourceRelationships - All relationships from the registry\n * @param resourceIdentifier - The resource type being processed\n * @returns Categorized relationships + set of available parent resource types\n */\nfunction transformResourceRelationships(\n resourceRelationships: ResourceRelationship[],\n resourceIdentifier: ResourceType\n): {\n processedResourceRelationships: ResourceConfiguration_ResourceRelationships;\n availableParentResourceTypes: Set<ResourceType>;\n} {\n // Categorize ALL relationships (including those with discriminator) into parent/child/self.\n // Relationships with a discriminator carry their filter inline on the relationship object itself,\n // so runtime consumers (ResourceContext, ContainerNested, services-registry-handler) evaluate\n // the discriminator at read/write time — no separate bucket is needed.\n //\n // Parent relationships are defined as: parent → child (resourceType1 → resourceType2)\n // When processing a resource, we look for relationships where we are the child (resourceType2)\n //\n // The foreignKeyField in these relationships specifies the FK field on the CHILD (resourceType2)\n // that points to the parent. This is the standard pattern for parent-child relationships.\n // Example: USERS → USER_PROFILES with foreignKeyField: 'userId'\n // - userId field is on USER_PROFILES, pointing to USERS\n // - USERS is the parent of USER_PROFILES\n //\n // NOTE: FK reference relationships (like TODOS → USERS with assignedToUserId)\n // where resourceType1 has a FK field pointing to resourceType2 are handled separately\n // at URL generation time, not here.\n // See: resources-config-operations.urls-builder.utils.ts:generateSyntheticFKParents()\n\n // F-8 fix: Filter out disabled relationships at the source.\n // All downstream consumers (ResourceContext, ServicesRegistryHandler, ContainerNested,\n // DTO builder) receive these categorized arrays, so filtering here prevents disabled\n // relationships from being processed anywhere in the pipeline.\n const activeRelationships = resourceRelationships.filter(rel => !rel.isDisabled);\n\n const isManyToMany = (rel: ResourceRelationship) =>\n rel.cardinality1 === ResourceRelationshipCardinality.MANY &&\n rel.cardinality2 === ResourceRelationshipCardinality.MANY &&\n rel.jointResourceType;\n\n const processedResourceRelationships: ResourceConfiguration_ResourceRelationships = {\n // Filter out M:N relationships — they're peer relationships via a junction table,\n // transformed into synthetic 1:N relationships in the M:N processing section below.\n parentRelationships: activeRelationships.filter(rel =>\n rel.resourceType2 === resourceIdentifier &&\n rel.resourceType1 !== resourceIdentifier &&\n !isManyToMany(rel)\n ),\n childRelationships: activeRelationships.filter(rel =>\n rel.resourceType1 === resourceIdentifier &&\n rel.resourceType2 !== resourceIdentifier &&\n !isManyToMany(rel)\n ),\n // Self-referencing 1:N/1:1 relationships (tree/graph structures).\n // M:N self-refs are excluded — they're handled entirely through M:N decomposition\n // (synthetic junction-table relationships go into parent/child buckets).\n selfRelationships: activeRelationships.filter(rel =>\n rel.resourceType1 === resourceIdentifier && rel.resourceType2 === resourceIdentifier &&\n !isManyToMany(rel)\n ),\n };\n\n // ========================================\n // PROCESS MANY-TO-MANY JOINT RESOURCE RELATIONSHIPS\n // ========================================\n\n const compileSyntheticRelationship = (\n relationshipDeclaration: ResourceRelationshipDeclaration\n ): ResourceRelationship =>\n Resources_SharedUtils.compileRelationshipDeclaration(relationshipDeclaration);\n\n /**\n * Build the synthetic **scope-anchored peer-under-scope** edge for an M:N\n * (scope-required reference search). It makes a target peer `T` addressable\n * UNDER the other peer `S` for SEARCH/LIST ONLY — e.g.\n * `/organizations/{organizationId}/users/search` — and tags it with the\n * junction `J` so the backend (a) scopes the `T` query via a junction subquery\n * (`T._id ∈ { J.targetFk : J.scopeFk = S_id }` — `T` holds no real FK column\n * for `S`) and (b) authorizes by `S`-membership instead of `T`'s own scope.\n * `OPTIONAL_CONTEXT` so the bare `/users/search` (global) route also survives;\n * `urlOperationScope` keeps this off READ/CREATE/UPDATE/DELETE routes (a\n * peer-under-scope path is a read-only access pattern).\n */\n const buildScopeAnchoredPeerEdge = (\n scopeType: ResourceType,\n targetType: ResourceType,\n junction: ResourceType,\n isDisabled: boolean,\n ): ResourceRelationship =>\n compileSyntheticRelationship({\n cardinality1: ResourceRelationshipCardinality.ONE, // one scope S\n cardinality2: ResourceRelationshipCardinality.MANY, // many targets T\n resourceType1: scopeType, // S — the URL parent (anchor scope)\n resourceType2: targetType, // T — the searched collection (current peer)\n nature: RelationshipNature.REFERENCE,\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.OPTIONAL_CONTEXT,\n isPrimaryScope: false,\n isDisabled,\n allowCycle: false,\n scopeViaJunction: junction,\n urlOperationScope: [CoreResourceOperation.SEARCH, CoreResourceOperation.LIST],\n });\n\n // Find many-to-many relationships with joint resource types (from ALL active relationships,\n // including those with discriminators — a conditional M:N is still an M:N)\n const manyToManyRelationships = activeRelationships.filter(rel =>\n rel.cardinality1 === ResourceRelationshipCardinality.MANY &&\n rel.cardinality2 === ResourceRelationshipCardinality.MANY &&\n rel.jointResourceType\n );\n\n // Additional relationships to add based on many-to-many joint resource logic\n const additionalRelationships: ResourceRelationship[] = [];\n\n manyToManyRelationships.forEach(m2mRel => {\n Resources_SharedUtils.assertSupportedManyToManySyntheticExpansion(m2mRel);\n const { resourceType1: entity1Type, resourceType2: entity2Type, jointResourceType, foreignKeyField } = m2mRel;\n\n if (resourceIdentifier === jointResourceType) {\n // ========================================\n // JUNCTION TABLE: Current resource IS the joint resource\n // ========================================\n // For many-to-many, the junction table can be accessed from BOTH sides:\n // - /organizations/{orgId}/organization-members\n // - /users/{userId}/organization-members\n // Both parents use OPTIONAL_CONTEXT so each generates independent URL paths\n //\n // NOTE: Junction table parent relationships do NOT carry discriminator/condition\n // from the original M:N. The junction table itself doesn't need condition awareness —\n // it's the entity→junction direction that carries conditions, because the entity\n // is the \"parent\" whose data is evaluated. The junction table looks UP to both\n // entities as parents, and parent traversal intentionally skips discriminator checks\n // (see fetchParentResourcesWithPolicy in ResourceContextBackendService).\n\n // Relationship: entity1 → joint resource (entity1 is a parent of junction table)\n const relationFromEntity1 = compileSyntheticRelationship({\n cardinality1: ResourceRelationshipCardinality.ONE, // One entity1\n cardinality2: ResourceRelationshipCardinality.MANY, // Many joint records\n resourceType1: entity1Type, // entity1 (e.g., ORGANIZATIONS)\n resourceType2: resourceIdentifier, // joint resource (e.g., ORGANIZATION_MEMBERS)\n jointResourceType,\n nature: m2mRel.resolvedSemantics.nature,\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.OPTIONAL_CONTEXT,\n isPrimaryScope: false,\n isDisabled: m2mRel.isDisabled || false,\n allowCycle: false,\n // Preserve context policy and childOperations from original relationship\n contextPolicy: m2mRel.contextPolicy,\n read: m2mRel.read,\n childOperations: m2mRel.childOperations,\n foreignKeyField: m2mRel.foreignKeyField,\n });\n additionalRelationships.push(relationFromEntity1);\n\n // Relationship: entity2 → joint resource (entity2 is ALSO a parent of junction table)\n const relationFromEntity2 = compileSyntheticRelationship({\n cardinality1: ResourceRelationshipCardinality.ONE, // One entity2\n cardinality2: ResourceRelationshipCardinality.MANY, // Many joint records\n resourceType1: entity2Type, // entity2 (e.g., USERS)\n resourceType2: resourceIdentifier, // joint resource (e.g., ORGANIZATION_MEMBERS)\n jointResourceType,\n nature: m2mRel.resolvedSemantics.nature,\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.OPTIONAL_CONTEXT, // Both sides are optional\n isPrimaryScope: false,\n isDisabled: m2mRel.isDisabled || false,\n allowCycle: false,\n // Preserve context policy and childOperations from original relationship\n contextPolicy: m2mRel.contextPolicy,\n read: m2mRel.read,\n childOperations: m2mRel.childOperations,\n // For M:N self-referencing, foreignKeyField distinguishes source/target in junction table\n foreignKeyField: foreignKeyField,\n });\n additionalRelationships.push(relationFromEntity2);\n\n } else if (resourceIdentifier === entity1Type) {\n // ========================================\n // ENTITY1: Current resource is the first entity in the relationship\n // ========================================\n // Entity1 has junction table as child (for child relationships).\n // The synthetic entity→junction relationship DOES carry discriminator/condition\n // from the original M:N declaration (lines below). This ensures that conditional\n // M:N relationships (e.g., \"users have projects only when role=DEVELOPER\") are\n // correctly gated at runtime when looking DOWN from entity1 to the junction.\n\n if (!jointResourceType)\n throw createConfigurationError(`Many-to-many relationship between ${entity1Type} and ${entity2Type} must have a jointResourceType`);\n\n const relationToJoint = compileSyntheticRelationship({\n cardinality1: ResourceRelationshipCardinality.ONE, // One entity\n cardinality2: ResourceRelationshipCardinality.MANY, // Many joint records\n resourceType1: resourceIdentifier, // current entity\n resourceType2: jointResourceType, // joint resource\n jointResourceType,\n nature: m2mRel.resolvedSemantics.nature,\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.OPTIONAL_CONTEXT,\n isPrimaryScope: false,\n isDisabled: m2mRel.isDisabled || false,\n allowCycle: m2mRel.allowCycle || false,\n contextPolicy: m2mRel.contextPolicy,\n read: m2mRel.read,\n childOperations: m2mRel.childOperations,\n foreignKeyField: m2mRel.foreignKeyField,\n discriminator: m2mRel.discriminator,\n condition: m2mRel.condition,\n display: m2mRel.display,\n });\n additionalRelationships.push(relationToJoint);\n\n // Scope-anchored read edge: this resource (entity1, the target T) becomes\n // addressable under entity2 (the scope S) for SEARCH/LIST via the junction.\n additionalRelationships.push(\n buildScopeAnchoredPeerEdge(entity2Type, resourceIdentifier, jointResourceType, m2mRel.isDisabled || false),\n );\n\n } else if (resourceIdentifier === entity2Type) {\n // ========================================\n // ENTITY2: Current resource is the second entity in the relationship\n // ========================================\n // Entity2 also has junction table as child (for child relationships).\n // Same as Entity1: carries discriminator/condition from the M:N declaration\n // to enable conditional gating when looking DOWN from entity2 to the junction.\n\n if (!jointResourceType)\n throw createConfigurationError(`Many-to-many relationship between ${entity1Type} and ${entity2Type} must have a jointResourceType`);\n\n const relationToJoint = compileSyntheticRelationship({\n cardinality1: ResourceRelationshipCardinality.ONE, // One entity\n cardinality2: ResourceRelationshipCardinality.MANY, // Many joint records\n resourceType1: resourceIdentifier, // current entity\n resourceType2: jointResourceType, // joint resource\n jointResourceType,\n nature: m2mRel.resolvedSemantics.nature,\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.OPTIONAL_CONTEXT,\n isPrimaryScope: false,\n isDisabled: m2mRel.isDisabled || false,\n allowCycle: m2mRel.allowCycle || false,\n contextPolicy: m2mRel.contextPolicy,\n read: m2mRel.read,\n childOperations: m2mRel.childOperations,\n foreignKeyField: foreignKeyField,\n discriminator: m2mRel.discriminator,\n condition: m2mRel.condition,\n display: m2mRel.display,\n });\n additionalRelationships.push(relationToJoint);\n\n // Scope-anchored read edge: this resource (entity2, the target T) becomes\n // addressable under entity1 (the scope S) for SEARCH/LIST via the junction.\n additionalRelationships.push(\n buildScopeAnchoredPeerEdge(entity1Type, resourceIdentifier, jointResourceType, m2mRel.isDisabled || false),\n );\n }\n });\n\n // Add the additional relationships to the appropriate categories\n additionalRelationships.forEach(rel => {\n if (rel.resourceType2 === resourceIdentifier && rel.resourceType1 !== resourceIdentifier) {\n processedResourceRelationships.parentRelationships.push(rel);\n } else if (rel.resourceType1 === resourceIdentifier && rel.resourceType2 !== resourceIdentifier) {\n processedResourceRelationships.childRelationships.push(rel);\n } else if (rel.resourceType1 === resourceIdentifier && rel.resourceType2 === resourceIdentifier) {\n processedResourceRelationships.selfRelationships.push(rel);\n }\n });\n\n // Create set of available parent resource types for validation.\n // Includes selfRelationships because a self-ref acts as its own parent (tree roots).\n const availableParentResourceTypes = new Set([\n ...processedResourceRelationships.parentRelationships.map(rel => rel.resourceType1),\n ...processedResourceRelationships.selfRelationships.map(rel => rel.resourceType1),\n ]);\n\n return {\n processedResourceRelationships,\n availableParentResourceTypes\n };\n}\n\n/**\n * Processes parent resource access scope strategy overrides for an operation.\n *\n * Creates a shallow copy of the relationship buckets with overridden `accessScopeStrategy`\n * values for specific parent resource types. This allows per-operation customization of\n * how parent resources are resolved in URL paths (e.g., making an optional parent\n * mandatory for a specific operation).\n *\n * The returned object has exactly three fields: `parentRelationships`, `childRelationships`,\n * `selfRelationships`. There is no `inheritanceSchemaRelationships` field — that structure\n * was removed as part of the relationship condition refactor.\n *\n * @param resourceRelationships - The base relationship buckets (from transformResourceRelationships)\n * @param availableParentResourceTypes - Set of valid parent resource types for validation\n * @param parentResourceAccessScopeStrategyOverrides - Overrides to apply\n * @param operationIdentifier - The operation name (for error messages)\n * @returns A new ResourceConfiguration_ResourceRelationships with overrides applied\n */\nfunction processParentResourceAccessScopeStrategyOverrides(\n resourceRelationships: ResourceConfiguration_ResourceRelationships,\n availableParentResourceTypes: Set<ResourceType>,\n parentResourceAccessScopeStrategyOverrides: { resourceType: ResourceType, accessScopeStrategy: ResourceRelationshipAccessScopeStrategy }[],\n operationIdentifier: string\n): ResourceConfiguration_ResourceRelationships {\n if (!parentResourceAccessScopeStrategyOverrides || parentResourceAccessScopeStrategyOverrides.length === 0) {\n return resourceRelationships;\n }\n\n // Validate that all override resources exist in parent relationships\n for (const override of parentResourceAccessScopeStrategyOverrides) {\n if (!availableParentResourceTypes.has(override.resourceType)) {\n throw createConfigurationError(`Operation '${operationIdentifier}' has access scope strategy override for parent resource '${override.resourceType}' but it's not available in parent relationships`);\n }\n }\n\n // Create a map for quick lookup of overrides\n const overrideMap = new Map<ResourceType, ResourceRelationshipAccessScopeStrategy>();\n parentResourceAccessScopeStrategyOverrides.forEach(override => {\n overrideMap.set(override.resourceType, override.accessScopeStrategy);\n });\n\n const applyOverride = (rel: ResourceRelationship): ResourceRelationship => {\n const overrideStrategy = overrideMap.get(rel.resourceType1);\n return overrideStrategy !== undefined ? { ...rel, accessScopeStrategy: overrideStrategy } : rel;\n };\n\n const updatedResourceRelationships: ResourceConfiguration_ResourceRelationships = {\n parentRelationships: resourceRelationships.parentRelationships.map(applyOverride),\n childRelationships: [...resourceRelationships.childRelationships],\n // Self-refs act as their own parent — scope strategy overrides must apply.\n selfRelationships: resourceRelationships.selfRelationships.map(applyOverride),\n };\n\n return updatedResourceRelationships;\n}\n\n/**\n * Processes user notifications by adding primaryScope and auto-generating identifiers\n * Format: ${resourceIdentifier}_${operationIdentifier}_${target}_${customNotificationRef?}_${userRoles.join(\"_\")}_${level}\n *\n * Validates that when there are 2+ notifications with the same target in the same operation,\n * each one must have a unique customNotificationRef to distinguish them.\n */\nfunction processUserNotifications(\n userNotifications: UserNotificationDefinitionWithoutPrimaryScopeAndIdentifier[],\n resourceIdentifier: ResourceType,\n operationIdentifier: string,\n resourcePrimaryScope: ResourcePrimaryScope\n): UserNotificationDefinition[] {\n\n // ========================================\n // VALIDATE DUPLICATE TARGET NOTIFICATIONS\n // ========================================\n\n // Group notifications by target+channel to find duplicates\n const notificationsByTargetChannel = new Map<string, UserNotificationDefinitionWithoutPrimaryScopeAndIdentifier[]>();\n userNotifications.forEach(n => {\n const key = `${n.target}_${n.channel}`;\n if (!notificationsByTargetChannel.has(key)) {\n notificationsByTargetChannel.set(key, []);\n }\n notificationsByTargetChannel.get(key)!.push(n);\n });\n\n // Validate customNotificationRef for groups with 2+ notifications\n for (const [targetChannel, notifications] of notificationsByTargetChannel.entries()) {\n if (notifications.length >= 2) {\n // Check that all have customNotificationRef\n const missingRefs = notifications.filter(n => !n.customNotificationRef);\n if (missingRefs.length > 0) {\n throw createConfigurationError(\n `Operation '${resourceIdentifier}_${operationIdentifier}' has ${notifications.length} notifications with target_channel '${targetChannel}'. ` +\n `When there are 2+ notifications with the same target, each must have a unique 'customNotificationRef' to distinguish them. ` +\n `${missingRefs.length} notification(s) are missing customNotificationRef.`\n );\n }\n\n // Check that all customNotificationRefs are unique\n const refs = notifications.map(n => n.customNotificationRef);\n const uniqueRefs = new Set(refs);\n if (uniqueRefs.size !== refs.length) {\n throw createConfigurationError(\n `Operation '${resourceIdentifier}_${operationIdentifier}' has duplicate customNotificationRef values for target_channel '${targetChannel}'. ` +\n `Each notification with the same target must have a unique customNotificationRef. ` +\n `Found refs: [${refs.join(', ')}]`\n );\n }\n }\n }\n\n // ========================================\n // GENERATE IDENTIFIERS\n // ========================================\n\n return userNotifications.map(notification => {\n // Auto-generate identifier: ${resourceIdentifier}_${current_operation}_${target}_${customNotificationRef?}_${userRoles.join(\"_\")}_${level}\n const identifierParts = [\n resourceIdentifier,\n operationIdentifier,\n notification.target\n ];\n\n // Add customNotificationRef if present (for disambiguation)\n if (notification.customNotificationRef) {\n identifierParts.push(notification.customNotificationRef);\n }\n\n // Add userRoles if present\n if (notification.userRoles && notification.userRoles.length > 0) {\n identifierParts.push(notification.userRoles.join(\"_\"));\n }\n\n // Add level if present\n if (notification.level) {\n identifierParts.push(notification.level);\n }\n\n const autoGeneratedIdentifier = identifierParts.join(\"_\");\n\n const processed = {\n ...notification,\n identifier: autoGeneratedIdentifier,\n primaryScope: resourcePrimaryScope\n };\n assertUserNotificationDeclarationIsDeliverable(processed, resourceIdentifier, operationIdentifier);\n return processed;\n });\n}\n\n/**\n * Refuse a declared user notification the dispatcher could never deliver (#1874).\n *\n * `UserNotificationDefinitionSchema` states what is deliverable — a channel the dispatcher has an arm for, and a\n * `userRoles` filter only on a target that reads it (#495) — but no build step ever parsed a declaration against it,\n * so both rules held only in the type system and a test. A notification on an unknown channel (`'slack'`) was\n * accepted and every dispatch sent nothing, visible only at debug level. Parsing here makes the same rule hold for\n * every configuration, typed or not, at the moment it is built — the way the factory already refuses a filter,\n * sort or search field that names nothing.\n */\nfunction assertUserNotificationDeclarationIsDeliverable(\n notification: unknown,\n resourceIdentifier: ResourceType,\n operationIdentifier: string,\n): void {\n const parsed = UserNotificationDefinitionSchema.safeParse(notification);\n if (parsed.success) return;\n const declared = notification as { channel?: unknown; target?: unknown };\n const problems = parsed.error.issues.map((issue) => `${issue.path.join('.') || '(notification)'}: ${issue.message}`).join('; ');\n // A channel or target outside its vocabulary fails every member of the channel union, and Zod reports that as one\n // path-less \"Invalid input\" — so those two are named from the value itself, with the members that would be valid.\n const channelIsKnown = (Object.values(CoreUserNotificationChannel) as unknown[]).includes(declared.channel);\n const targetIsKnown = (Object.values(CoreUserNotificationTarget) as unknown[]).includes(declared.target);\n const reason = !channelIsKnown\n ? `no delivery exists for channel '${String(declared.channel)}'. A channel must be one of ${quoteMembers(CoreUserNotificationChannel)}`\n : !targetIsKnown\n ? `'${String(declared.target)}' is not a notification target. A target must be one of ${quoteMembers(CoreUserNotificationTarget)}`\n : problems;\n throw createConfigurationError(\n `Operation '${resourceIdentifier}_${operationIdentifier}' declares a user notification (target '${String(declared.target)}', channel '${String(declared.channel)}') that cannot be delivered: ${reason}.`,\n );\n}\n\n/** `'a', 'b', 'c'` — the members of a closed vocabulary, as a refusal names them. */\nfunction quoteMembers(vocabulary: Record<string, string>): string {\n return Object.values(vocabulary).map((member) => `'${member}'`).join(', ');\n}\n\n/**\n * Processes M2M notifications by auto-generating identifiers\n * Format: ${resourceIdentifier}_${operationIdentifier}_${channel}\n *\n * Each declaration is parsed against `M2MNotificationDefinitionSchema` and an undeliverable channel is refused\n * here, when the configuration is built. It used to be accepted and to throw \"not implemented\" at dispatch — after\n * the write, where the throw also skipped every later M2M notification of the same operation.\n */\nfunction processM2MNotifications(\n m2mNotifications: M2MNotificationDefinitionWithoutIdentifier[],\n resourceIdentifier: ResourceType,\n operationIdentifier: string\n): M2MNotificationDefinitionWithoutIdentifier[] {\n return m2mNotifications.map(notification => {\n // Auto-generate identifier: ${resourceIdentifier}_${current_operation}_${channel}\n const autoGeneratedIdentifier = [\n resourceIdentifier,\n operationIdentifier,\n notification.channel\n ].join(\"_\");\n\n const processed = {\n ...notification,\n identifier: autoGeneratedIdentifier\n };\n const parsed = M2MNotificationDefinitionSchema.safeParse(processed);\n if (!parsed.success) {\n throw createConfigurationError(\n `Operation '${resourceIdentifier}_${operationIdentifier}' declares an M2M notification on channel '${String(notification.channel)}' that cannot be delivered: `\n + `${parsed.error.issues.map((issue) => `${issue.path.join('.') || '(notification)'}: ${issue.message}`).join('; ')}. `\n + `A channel must be one of ${quoteMembers(CoreM2MNotificationChannel)}.`,\n );\n }\n return processed;\n });\n}\n\n// --------------------------------\n// Resources Pagination Response\n// --------------------------------\n\n\nfunction createResourcePaginatedResponseSchema<T extends z.ZodTypeAny>(params: {\n dataSchema: T;\n validateArrayConstraints?: boolean;\n maxResultsPerPageLimit?: number;\n}): z.ZodType<ResourcePaginatedResponseResultSchema<T>> {\n\n const {\n dataSchema,\n validateArrayConstraints = true,\n maxResultsPerPageLimit = 50\n } = params;\n\n // Comprehensive parameter validation\n if (!dataSchema) {\n throw createConfigurationError('Data schema is required and cannot be null or undefined');\n }\n\n // Use duck typing instead of instanceof to avoid version conflicts\n if (typeof dataSchema !== 'object' ||\n typeof dataSchema.parse !== 'function' ||\n typeof dataSchema.safeParse !== 'function' ||\n !dataSchema._def) {\n throw createConfigurationError(`Data schema must be a valid Zod schema type. Got: ${typeof dataSchema}, constructor: ${dataSchema?.constructor?.name}`);\n }\n\n if (validateArrayConstraints) {\n if (typeof maxResultsPerPageLimit !== 'number' || maxResultsPerPageLimit < 0) {\n throw createConfigurationError('Max results per page limit must be a non-negative number');\n }\n }\n\n // Create strongly typed array schema with optional constraints\n const createDataArraySchema = (schema: T) => {\n let arraySchema = z.array(schema);\n\n if (validateArrayConstraints) {\n if (maxResultsPerPageLimit > 0) {\n arraySchema = arraySchema.max(maxResultsPerPageLimit, `Data array cannot contain more than ${maxResultsPerPageLimit} items`);\n }\n }\n\n return arraySchema;\n };\n\n // Runtime validation with comprehensive error messages\n const validatePaginatedResponse = (input: any): input is ResourcePaginatedResponseResultSchema<T> => {\n // Validate root structure\n if (!input || typeof input !== 'object') {\n throw createValidationError('Paginated response must be an object');\n }\n\n // Validate data field existence\n if (!('data' in input)) {\n throw createValidationError('Paginated response must have a \"data\" field');\n }\n\n // Validate data is an array\n if (!Array.isArray(input.data)) {\n throw createValidationError('Data field must be an array');\n }\n\n // Validate array constraints if enabled\n if (validateArrayConstraints) {\n if (input.data.length > maxResultsPerPageLimit) {\n throw createValidationError(`Data array cannot contain more than ${maxResultsPerPageLimit} items, got ${input.data.length}`);\n }\n }\n\n // Validate pagination field existence\n if (!('pagination' in input)) {\n throw createValidationError('Paginated response must have a \"pagination\" field');\n }\n\n // Validate pagination structure\n if (!input.pagination || typeof input.pagination !== 'object') {\n throw createValidationError('Pagination field must be an object');\n }\n\n // Validate required pagination fields\n const requiredPaginationFields = ['page', 'limit', 'total', 'totalPages'];\n for (const field of requiredPaginationFields) {\n if (!(field in input.pagination)) {\n throw createValidationError(`Pagination must have a \"${field}\" field`);\n }\n\n if (typeof input.pagination[field] !== 'number') {\n throw createValidationError(`Pagination \"${field}\" must be a number`);\n }\n\n if (input.pagination[field] < 0) {\n throw createValidationError(`Pagination \"${field}\" must be non-negative`);\n }\n }\n\n // Validate pagination logic\n if (input.pagination.page > input.pagination.totalPages && input.pagination.totalPages > 0) {\n throw createValidationError('Current page cannot exceed total pages');\n }\n\n if (input.pagination.limit <= 0) {\n throw createValidationError('Pagination limit must be positive');\n }\n\n return true;\n };\n\n // Create the result schema with comprehensive validation\n const resultSchema = z.object({\n data: createDataArraySchema(dataSchema),\n // Bounded by the SAME ceiling as the data array above. `limit` reports the page size actually\n // served, so a stricter bound here rejects pages this very schema just declared valid.\n pagination: createPaginationResponseMetadataSchema(maxResultsPerPageLimit)\n }).refine(validatePaginatedResponse, {\n message: \"Invalid paginated response structure\"\n });\n\n return resultSchema as z.ZodType<ResourcePaginatedResponseResultSchema<T>>;\n}\n\n\n\n// --------------------------------\n// Resource Search Query Request\n// --------------------------------\n\n/**\n * The ONE authority for the `{ pagination, sorting, filters }` argument envelope every\n * collection-shaped operation accepts.\n *\n * Exported rather than factory-private because a second surface needs the identical shape: the MCP\n * tool adapter advertises this envelope for collection tools whose `requestDto` is empty. A LIST\n * operation keeps `requestDto: z.object({})` — its filters travel in the QUERY STRING over HTTP, so\n * giving it a request BODY would misdescribe the REST contract and the generated OpenAPI — yet the\n * MCP dispatch normalises the very same envelope for it. Advertising had to be fixed without\n * touching the DTO, and that means this builder is reachable from both places.\n *\n * Deriving the shape a second time in the adapter was the rejected alternative: a filter allow-list\n * that drifts between the surface that ADVERTISES it and the surface that ENFORCES it is precisely\n * the defect class this envelope already caused once.\n */\nexport function createResourceSearchQueryRequestSchema<\n TFilterFields extends Record<string, PrimitiveZodType> | undefined,\n TSortFields extends readonly string[] | undefined,\n>(params: {\n filterFields: TFilterFields;\n allowedSortFields: TSortFields;\n pagination: boolean;\n /**\n * The operation's declared page ceiling, mirrored onto the REQUEST side.\n *\n * Without it the request DTO refuses any `pagination.limit` above a hard-coded 100 while the\n * repository and the response DTO both honour the declared value — so an operation declaring 200\n * advertises a limit it answers **400** to. Found 2026-08-12 by an e2e probe asking `users SEARCH`\n * (declared 200) for 120: `pagination.limit: Too big: expected number to be <=100`.\n *\n * Defaults to 100 — the bound this schema has always enforced — so an un-migrated caller keeps\n * exactly its current contract.\n */\n maxPaginatedResultPerPageLimit?: number;\n}): ResourceSearchQueryRequestResult<TFilterFields, TSortFields> {\n\n const { filterFields, allowedSortFields = [], pagination = true, maxPaginatedResultPerPageLimit } = params;\n\n // Validate input parameters\n if (filterFields !== undefined && typeof filterFields !== 'object') {\n throw createConfigurationError('Filter fields must be an object');\n }\n\n if (allowedSortFields && !Array.isArray(allowedSortFields)) {\n throw createConfigurationError('Allowed sort fields must be an array');\n }\n\n if (allowedSortFields && allowedSortFields.length > 0 && !allowedSortFields.every(field => typeof field === 'string' && field.length > 0)) {\n throw createConfigurationError('All sort fields must be non-empty strings');\n }\n\n // Strongly typed filter schema creation\n const createFilterSchema = <T extends Record<string, PrimitiveZodType>>(fields: T) => {\n const processedFields: Record<string, z.ZodOptional<any>> = {};\n\n Object.entries(fields).forEach(([key, schema]) => {\n // Type-safe schema processing based on schema type\n if (schema instanceof z.ZodDate) {\n processedFields[key] = Resources_Filter_DateRangeSchema.optional();\n } else if (isResourcesFilterNumberRangeSchema(schema)) {\n // Already the range vocabulary — the author wrote it, which is the opt-in. Named here\n // rather than left to the fallback below so the numeric range is a VISIBLE branch beside\n // the date one; the two are the framework's only structured filter shapes and a reader\n // looking for \"which filters are ranges\" must find both in one place.\n processedFields[key] = Resources_Filter_NumberRangeSchema.optional();\n } else if (schema instanceof z.ZodString) {\n processedFields[key] = (schema as z.ZodString).optional();\n } else if (schema instanceof z.ZodNumber) {\n processedFields[key] = (schema as z.ZodNumber).optional();\n } else if (schema instanceof z.ZodBoolean) {\n processedFields[key] = (schema as z.ZodBoolean).optional();\n } else if (schema instanceof z.ZodEnum) {\n processedFields[key] = (schema as z.ZodEnum<any>).optional();\n } else {\n // Fallback for other primitive types\n processedFields[key] = (schema as z.ZodTypeAny).optional();\n }\n });\n\n return Resources_Filter_BaseSchema.extend(processedFields);\n };\n\n // Strongly typed sorting schema creation\n const createSortingSchema = (fields: readonly string[]) => {\n const sortingFields: Record<string, z.ZodOptional<z.ZodObject<any>>> = {};\n\n fields.forEach(field => {\n sortingFields[field] = z.object({\n field: z.literal(field),\n order: z.enum(SortOrder).default(SortOrder.ASC),\n priority: z.number().min(0).default(0)\n }).optional();\n });\n\n return z.object(sortingFields).optional();\n };\n\n\n // Build the schema dynamically based on parameters\n const schemaConfig: any = {};\n\n // Add pagination if enabled.\n //\n // Built from the operation's ceiling rather than the shared default-bounded constant, so the limit\n // a caller may REQUEST, the limit the repository will SERVE and the limit the response DTO ACCEPTS\n // are one number. They were three, and the request side was the strictest — which is why a\n // declared ceiling above 100 was unreachable over HTTP no matter what the other two allowed.\n if (pagination) {\n schemaConfig.pagination = createPaginationRequestSchema(maxPaginatedResultPerPageLimit).optional();\n }\n\n // Add sorting if allowed fields are provided\n if (allowedSortFields && allowedSortFields.length > 0) {\n schemaConfig.sorting = createSortingSchema(allowedSortFields);\n }\n\n // Add filtering based on filter fields\n if (filterFields !== undefined && Object.keys(filterFields).length > 0) {\n schemaConfig.filters = createFilterSchema(filterFields).optional();\n } else {\n schemaConfig.filters = Resources_Filter_BaseSchema.optional();\n }\n\n // Create the final schema with validation\n const resultSchema = z.object(schemaConfig);\n\n return resultSchema as ResourceSearchQueryRequestResult<TFilterFields, TSortFields>;\n}\n\n\n\n\n\n// Helper function to determine HTTP verb based on operation\nfunction getDefaultHttpVerbForOperation(operation: string): HttpMethod {\n switch (operation) {\n case CoreResourceOperation.READ:\n case CoreResourceOperation.LIST:\n case CoreResourceOperation.SEARCH:\n case CoreResourceOperation.COUNT:\n return HttpMethod.GET;\n case CoreResourceOperation.CREATE:\n case CoreResourceOperation.CREATE_MANY:\n return HttpMethod.POST;\n case CoreResourceOperation.UPDATE:\n case CoreResourceOperation.UPDATE_MANY:\n return HttpMethod.PUT;\n case CoreResourceOperation.DELETE:\n case CoreResourceOperation.DELETE_MANY:\n return HttpMethod.DELETE;\n default:\n return HttpMethod.POST; // Default for unknown operations\n }\n}\n\n/**\n * Determines if an operation variant should be marked as the default operation within its variantType group\n * Handles the complex logic for single vs multiple variants and explicit defaults\n *\n * Rules after validation:\n * 1. If only one variant exists in the group, it becomes the group default UNLESS the author\n * explicitly opted it out with `isDefault: false`. An omitted/`undefined` `isDefault` still\n * becomes the group default — only an explicit `false` is honored.\n *\n * Rationale: a sole `isDefault: false` variant is a real authoring signal that this transport\n * has NO default for the operation. Example: `users.list` declares an `INTERNAL_CALL` default\n * plus a single keyed `API_CALL` \"admin\" variant marked `isDefault: false` — there is no public\n * default URL listing, only the admin-keyed one. The prior behavior force-defaulted such a\n * variant, which (a) contradicted author intent and (b) produced two `isOperationDefault === true`\n * operations for one operation identifier across transport groups (one per group) — a latent\n * hazard for any consumer that filters defaults across transports (e.g. a set-filter that matches\n * >1 and throws). Honoring the explicit `false` keeps each transport group with at most one\n * default and makes the variant resolvable only via its keyed path resolver, which is the intent.\n * See `.claude/plans/internal-call-operation-path-resolution.md` (D6 + RESOLUTION).\n * 2. If multiple variants exist in the group, validation requires exactly one `isDefault=true`.\n * 3. Fallback selection is kept for direct/test-only callers that bypass factory validation,\n * but authored multi-variant groups must never rely on array order.\n */\nfunction determineOperationVariantDefault(\n variantsOfSameType: ResourceConfiguration_OperationVariant_BuilderParameters<any>[],\n currentVariant: ResourceConfiguration_OperationVariant_BuilderParameters<any>\n): boolean {\n // Rule 1: A single variant of this type is the group default UNLESS the author\n // explicitly opted out with `isDefault: false`. An omitted/`undefined` `isDefault`\n // still becomes the default — only an explicit `false` is honored (see JSDoc above).\n if (variantsOfSameType.length === 1) {\n return currentVariant.isDefault !== false;\n }\n\n // Rule 2: Find explicit isDefault=true within this variant type group\n const explicitDefaultVariant = variantsOfSameType.find(variant =>\n variant.isDefault === true\n );\n\n // If we found an explicit default, check if current variant is it\n if (explicitDefaultVariant) {\n return currentVariant === explicitDefaultVariant;\n }\n\n // Rule 3: No explicit isDefault=true found, use first variant that doesn't have isDefault=false\n const firstNonFalseVariant = variantsOfSameType.find(variant =>\n variant.isDefault !== false\n );\n\n if (firstNonFalseVariant) {\n return currentVariant === firstNonFalseVariant;\n }\n\n // Fallback: if all variants have isDefault=false, first one becomes default anyway\n return currentVariant === variantsOfSameType[0];\n}\n\nconst RESERVED_OPERATION_VARIANT_KEYS = new Set([\n 'isdefault',\n 'novariantkey',\n]);\nconst AUTO_OPERATION_VARIANT_KEYS = new Set([\n OPERATION_VARIANT_KEY.SUMMARY,\n OPERATION_VARIANT_KEY.CONTEXT,\n]);\n\nfunction isDataModeVariantKeyAllowedForOperation(\n operation: string,\n variant: ResourceConfiguration_OperationVariant_BuilderParameters<any>,\n): boolean {\n const effectiveOperation = variant.resourceOperationLike ?? operation;\n return effectiveOperation === CoreResourceOperation.READ\n || effectiveOperation === CoreResourceOperation.LIST\n || effectiveOperation === CoreResourceOperation.SEARCH;\n}\n\n// --------------------------------\n// Resources Shared Configuration\n// --------------------------------\n\n/**\n * Creates a resource configuration from builder parameters.\n * NOTE: TDatabaseSchema has been removed. Backend-only fields are now marked with\n * the isBackendOnly decorator in mainSchema and are stripped at the service layer.\n */\nexport function createResourceConfiguration_Initialization<\n TCustomOperationEnum extends EnumLikeType | undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined,\n TMainSchema extends z.ZodTypeAny,\n>(params: ResourceConfiguration_BuilderParameters<\n TCustomOperationEnum, TCoreOperationEnum, TMainSchema\n>): ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {\n\n const {\n mainSchema,\n resourceIdentifier,\n resourceFieldIdentifier,\n resourceRelationships,\n inheritenceSchemaDefinition,\n isSystemResource = false,\n // Defaulted TRUE — the safe direction. A resource that never considered whether its primary key\n // names the caller keeps the identity-coherence refusal; only a deliberate `false` relaxes it.\n primaryKeyIdentifiesInitiator = true,\n // Fail-closed default: a resource that does not author `systemAccessPolicy`\n // gets an explicit all-verbs-FORBIDDEN policy, so the resolved config is\n // self-documenting and every system-context primitive\n // (`readAsSystem`/`listAsSystem` and the trusted\n // `createAsSystem`/`updateAsSystem`/`updateManyAsSystem` writes) rejects it\n // by default.\n systemAccessPolicy = {\n read: ResourceSystemAccessMode.FORBIDDEN,\n list: ResourceSystemAccessMode.FORBIDDEN,\n create: ResourceSystemAccessMode.FORBIDDEN,\n update: ResourceSystemAccessMode.FORBIDDEN,\n updateMany: ResourceSystemAccessMode.FORBIDDEN,\n },\n isAnonymizable = false,\n // Carried through UNCHANGED and with no default. Absent means \"this resource is not the erasure\n // lane\", which is true of almost every resource — a default here would make every resource claim\n // to be one. The bindings are validated at boot, not here: this factory has the declaration but\n // not the registry, and a name resolves against the resource's own schema and operations.\n subjectErasureLane,\n transpositionPolicy,\n retentionPolicy,\n dataSubjectPolicy,\n retentionBinding: authoredRetentionBinding,\n portabilityPolicy,\n // #1598: `true` makes every row of this resource a CASE a model call can be attributed to. No default\n // beyond `false`: a case is a product decision, and an unset flag means the resource is not one.\n workUnit = false,\n persistenceAdapter,\n persistenceAdapterIsolation,\n httpApiBinding,\n introspectionBinding,\n coreOperations,\n customOperation,\n operationsConfiguration,\n } = params;\n\n /**\n * HTTP_API ↔ binding coherence — enforced at AUTHORING, both directions, because each half\n * alone is a contradiction the backend could only discover later and worse:\n * - `HTTP_API` without a binding is a resource whose rows live \"somewhere over HTTP\" with no\n * target, key, identity or erasure story — nothing downstream can repair that;\n * - a binding on a platform-backed resource is a declaration nothing will ever read, i.e. a\n * config that LOOKS externally bound and silently is not.\n * The binding's CONTENT is validated here too (Zod parse) so a malformed declaration names its\n * defect at the factory, not at boot. (ETL plan Step 3; registration-time checks that need the\n * RESOLVED adapter or the live registry — scope expressibility, retention/anonymizable/scope-root\n * refusals — live in the backend registry validation, which structurally cannot run here.)\n */\n if (persistenceAdapter === PersistenceAdapter.HTTP_API && httpApiBinding === undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] persistenceAdapter 'http-api' requires the companion 'httpApiBinding' declaration (provider, dialect, key fields, identity, tenancy, erasure).`\n );\n }\n if (persistenceAdapter === PersistenceAdapter.INTROSPECTION && introspectionBinding === undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] persistenceAdapter 'introspection' requires an 'introspectionBinding' naming the companion behavior whose output becomes this resource's rows.`\n );\n }\n if (introspectionBinding !== undefined && persistenceAdapter !== PersistenceAdapter.INTROSPECTION) {\n throw createConfigurationError(\n `[${resourceIdentifier}] 'introspectionBinding' is declared but persistenceAdapter is '${String(persistenceAdapter ?? 'undeclared (application default)')}' — a binding on a stored resource would never be read. Declare persistenceAdapter: 'introspection' or remove the binding.`\n );\n }\n if (httpApiBinding !== undefined && persistenceAdapter !== PersistenceAdapter.HTTP_API) {\n throw createConfigurationError(\n `[${resourceIdentifier}] 'httpApiBinding' is declared but persistenceAdapter is '${String(persistenceAdapter ?? 'undeclared (application default)')}' — a binding on a platform-backed resource would never be read. Declare persistenceAdapter: 'http-api' or remove the binding.`\n );\n }\n /**\n * `persistenceAdapterIsolation` alongside `HTTP_API` is REFUSED, because the claim it makes is\n * one the adapter has already settled — so honouring it would be honouring nothing.\n *\n * The declaration exists to buy a resource admission past the one-adapter rule when it disagrees\n * with the application default: its author asserts the resource takes part in no cross-adapter\n * atomic write, and the resources registry admits it and logs the admitted set. An `HTTP_API`\n * resource is admitted by that same rule WITHOUT any such assertion, on the adapter's own nature —\n * it is not a second platform store, it owns no transactions, and it cannot be an application\n * default. The registry's exemption is therefore ordered BEFORE the isolation branch and returns\n * first, so on an `HTTP_API` resource the isolation claim is never read.\n *\n * Silently ignoring it is the outcome worth preventing. An author who writes the field believes\n * they have bought something, and every later reader believes the resource's admission depends on\n * it — so a future change to the isolation door would look like it affected this resource when it\n * could not. A field whose absence and presence are indistinguishable is worse than a rejected\n * one; this is the same reasoning as the sibling refusal directly above, where a binding on a\n * platform-backed resource is refused precisely because nothing would ever read it.\n */\n if (persistenceAdapter === PersistenceAdapter.HTTP_API && persistenceAdapterIsolation !== undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] 'persistenceAdapterIsolation' is declared alongside persistenceAdapter 'http-api', where it is never read — an http-api resource is admitted past the one-adapter rule on the adapter's own nature, not on an isolation claim. Remove the isolation declaration.`\n );\n }\n // The RESOLVED binding, not the authored one. An author writes the schema's INPUT shape\n // (`HttpApiResourceBindingAuthored`), so defaults like `verifyMetadataAtBoot`, `connection` and\n // `remoteCallSemantics` may be absent from what they typed; every consumer reads the parsed shape\n // and is entitled to find them. The parse result used to be DISCARDED — harmless only because\n // authoring demanded every field, which is precisely the burden the authored shape removes.\n const resolvedHttpApiBinding = httpApiBinding === undefined ? undefined : (() => {\n const bindingParse = HttpApiResourceBindingSchema.safeParse(httpApiBinding);\n if (!bindingParse.success) {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid httpApiBinding declaration: ${bindingParse.error.issues.map((issue) => `${issue.path.join('.') || '(root)'}: ${issue.message}`).join('; ')}`\n );\n }\n try {\n assertHttpApiBindingDialectCoherence(bindingParse.data);\n } catch (error) {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid httpApiBinding declaration: ${describeCaughtError(error)}`\n );\n }\n return bindingParse.data;\n })();\n\n /**\n * `externalDataPipeline` — the inbound ETL pipeline on an ordinary LOCAL resource (partial-resource\n * coverage v3; PR-3/PR-4). Validated at AUTHORING like `httpApiBinding` above: shape (Zod),\n * schema-independent coherence (`assertExternalDataPipelineDeclarationCoherence` — S1 tenancy\n * confinement, unique mapping targets, coercion×dialect), the source binding's own dialect\n * coherence, and every mainSchema-dependent rule:\n *\n * - the pipeline is FORBIDDEN on an HTTP_API-adapter resource (a virtual resource IS the\n * remote side — chaining a pipeline onto read-through would re-create the composite v1\n * rejected);\n * - `remoteKeyLocalField` exists, is a STRING, and is declared `.isBusinessKey()` +\n * `excludeFromCreate` + `excludeFromUpdate` — SYNC's idempotent upsert keys on it and no\n * caller may mint or move it (boot-CHECKED, not factory-mutated: the app author sees the\n * truth in their own schema file);\n * - every mapped local field exists and is `excludeFromCreate`/`excludeFromUpdate`\n * (remote-authoritative — D-P5), and a non-`required` REMOTE_FIELD target must ACCEPT\n * ABSENCE (optional/nullable/default wrapper), or an absent remote value would have nowhere\n * honest to land (v3.1 §3);\n * - `ISO_STRING_TO_DATE` targets must be date fields;\n * - `population: CLOSED` refuses declared caller CREATE operations (D-P8) — INCLUDING a custom\n * operation that is create-shaped through `resourceOperationLike`. Enumerating only\n * `coreOperations` was the earlier, narrower form and it was a real hole: a custom operation\n * is exactly where an author expresses \"mint a row my own way\", so it is the likeliest way\n * into a CLOSED population, not an exotic one.\n */\n const externalDataPipeline = params.externalDataPipeline === undefined ? undefined : (() => {\n const refuse = (message: string): never => {\n throw createConfigurationError(`[${resourceIdentifier}] invalid externalDataPipeline declaration: ${message}`);\n };\n if (persistenceAdapter === PersistenceAdapter.HTTP_API) {\n refuse(\"an HTTP_API-adapter (virtual) resource cannot ALSO declare a pipeline — it IS the remote side; declare the pipeline on the LOCAL destination resource instead.\");\n }\n const declarationParse = ExternalDataPipelineDeclarationSchema.safeParse(params.externalDataPipeline);\n if (!declarationParse.success) {\n refuse(declarationParse.error.issues.map((issue) => `${issue.path.join('.') || '(root)'}: ${issue.message}`).join('; '));\n }\n const declaration = declarationParse.data!;\n try {\n assertExternalDataPipelineDeclarationCoherence(declaration);\n assertHttpApiBindingDialectCoherence(declaration.binding);\n } catch (error) {\n refuse(describeCaughtError(error));\n }\n // #1679 / #1690 — whether the binding may open writes is the declaration's own coherence (an INBOUND pipeline\n // refuses them, an OUTBOUND one requires them), checked above by `assertExternalDataPipelineDeclarationCoherence`.\n\n const shape = getZodObjectShape(mainSchema);\n if (declaration.direction === ExternalDataPipelineDirection.OUTBOUND) {\n validateExternalDataOutboundDeclarationAgainstSchema(declaration, shape, params.externalDataPipeline as Record<string, unknown>, refuse);\n return declaration;\n }\n const requireMappedTarget = (fieldName: string, context: string): z.ZodTypeAny => {\n const fieldSchema = shape[fieldName];\n if (!fieldSchema) refuse(`${context}: local field '${fieldName}' does not exist on mainSchema.`);\n if (!isExcludedFromCreate(fieldSchema!) || !isExcludedFromUpdate(fieldSchema!)) {\n refuse(\n `${context}: local field '${fieldName}' must be declared .excludeFromCreate() and .excludeFromUpdate() — it is REMOTE-AUTHORITATIVE (written only by the pipeline), and the exclusion is also what renders it read-only end to end (DTO → UI).`\n );\n }\n return fieldSchema!;\n };\n\n const keyFieldSchema = requireMappedTarget(declaration.remoteKeyLocalField, 'remoteKeyLocalField');\n if (!(unwrapSchema(keyFieldSchema) instanceof z.ZodString)) {\n refuse(`remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must be a STRING field — it stores the synthesized remote id.`);\n }\n if (!isBusinessKeyField(keyFieldSchema)) {\n refuse(\n `remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must be declared .isBusinessKey() — SYNC's idempotent upsert keys on it, and the business-key declaration is what makes the load MERGE instead of duplicate.`\n );\n }\n // ...and `.isUnique()` ON TOP, which is NOT redundant with the line above: the SQL schema\n // planner derives a UNIQUE constraint from `.isUnique()` and never from `.isBusinessKey()`.\n // Without it the merge contract is upheld only by our own read-then-write, so two concurrent\n // runs of one pipeline can leave TWO rows for one remote row — the exact duplication the whole\n // business-key design exists to prevent, and precisely what a store-level constraint refuses\n // for free.\n //\n // Required rather than suggested because this is an invariant with N call sites (every\n // destination any application ever declares) and a silent failure mode: nothing misbehaves\n // until two runs overlap, and by then the duplicate rows already exist. Found by the first\n // dogfood — the generated migration gave the key a PLAIN index and the omission was invisible\n // in every test, because a single-threaded upsert merges correctly with or without it.\n if (!isUniqueField(keyFieldSchema)) {\n refuse(\n `remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must ALSO be declared .isUnique(). The schema planner derives a UNIQUE constraint from .isUnique() and NOT from .isBusinessKey(), so without it the store would accept two rows for one remote row whenever two runs overlap — the merge would be enforced only by this engine's read-then-write, never by the database.`\n );\n }\n\n /*\n * The two PARTITION stamps (#1058 E4), when the source instance is partitioned.\n *\n * Validated through `requireMappedTarget` like every other engine-written target, so both\n * inherit the `.excludeFromCreate()/.excludeFromUpdate()` requirement — these decide who may see\n * a row and whether an orphan pass deletes it, and a caller that could write either could move\n * its own rows into another subsidiary's confinement or out of the orphan comparison entirely.\n *\n * Both must ACCEPT ABSENCE, and that is the one rule the sibling `remoteKeyLocalField` does not\n * share. A row whose partition field is unset is SHARED (E2) — it belongs to every caller and to\n * no unit — so both stamps land `null` on it. A required target would reject exactly the rows\n * the decision says everyone may see, and it would reject them at LOAD time, per row, with a\n * reason about a field the author never wrote a value for.\n */\n for (const [label, partitionField] of [\n ['partitionUnitLocalField', declaration.partitionUnitLocalField],\n ['partitionKeyLocalField', declaration.partitionKeyLocalField],\n ] as const) {\n if (partitionField === undefined) continue;\n const partitionSchema = requireMappedTarget(partitionField, label);\n if (!(unwrapSchema(partitionSchema) instanceof z.ZodString)) {\n refuse(\n `${label}: '${partitionField}' must be a STRING field — it stores ${label === 'partitionUnitLocalField' ? 'an ORGANIZATION_UNITS id' : \"the remote partition key in the canonical text an assignment row holds\"}.`\n );\n }\n if (unwrapSchema(partitionSchema) === partitionSchema) {\n refuse(\n `${label}: '${partitionField}' must be optional or nullable. A row whose remote partition field is unset is SHARED — it belongs to every caller and to no unit — and this stamp lands null on it, so a required target rejects exactly the rows every caller is entitled to see.`\n );\n }\n }\n\n /*\n * #1723 — a BIDIRECTIONAL pipeline's fields each have an OWNER, and the ownership rules follow it: a REMOTE field is\n * the system of record's (excluded from caller writes, exactly as on an INBOUND pipeline); a LOCAL or BOTH field is\n * the application's too, so callers must be able to write it — excluding it from both create and update would make\n * the pipeline send a value nobody decided, the OUTBOUND rule.\n */\n const requireSentTarget = (fieldName: string, context: string): z.ZodTypeAny => {\n const fieldSchema = shape[fieldName];\n if (!fieldSchema) refuse(`${context}: local field '${fieldName}' does not exist on mainSchema.`);\n if (isExcludedFromCreate(fieldSchema!) && isExcludedFromUpdate(fieldSchema!)) {\n refuse(\n `${context}: '${fieldName}' is sent to the system of record (owner LOCAL or BOTH) and is declared .excludeFromCreate() and `\n + '.excludeFromUpdate(), so no caller can ever set it and the pipeline would send a value nobody decided. Let callers write it, or declare it owner: REMOTE.',\n );\n }\n return fieldSchema!;\n };\n if (declaration.direction === ExternalDataPipelineDirection.BIDIRECTIONAL) {\n // Rows born locally have no remote key until their create is sent, and \"no key\" must stay out of the unique index\n // on every store: absent, never null (MongoDB indexes an explicit null) — the OUTBOUND rule (#2039 review).\n if (keyFieldSchema.safeParse(null).success) {\n refuse(`remoteKeyLocalField: '${declaration.remoteKeyLocalField}' accepts null. Declare it .optional(), not .nullable(): its unique index ignores a row with no key only while \"no key\" is ABSENT.`);\n }\n if (declaration.population === ExternalDataDestinationPopulation.OPEN && unwrapSchema(keyFieldSchema) === keyFieldSchema) {\n refuse(`remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must be optional — population OPEN lets rows be born here, and such a row has no remote key until its create is sent.`);\n }\n }\n\n for (const entry of declaration.mapping) {\n const owner = resolveExternalDataFieldOwner(entry);\n const targetSchema = owner === ExternalDataFieldOwner.REMOTE\n ? requireMappedTarget(entry.localField, `mapping('${entry.localField}')`)\n : requireSentTarget(entry.localField, `mapping('${entry.localField}')`);\n if (entry.kind === ExternalDataMappingEntryKind.REMOTE_FIELD && owner !== ExternalDataFieldOwner.LOCAL) {\n if (!entry.required && unwrapSchema(targetSchema) === targetSchema) {\n refuse(\n `mapping('${entry.localField}'): a non-required remote field can be ABSENT on a row, and absence lands as null — the target must be optional/nullable/defaulted, or declare required: true (absent rows are then rejected and reported per row).`\n );\n }\n if (entry.coercion === ExternalDataFieldCoercion.ISO_STRING_TO_DATE && !(unwrapSchema(targetSchema) instanceof z.ZodDate)) {\n refuse(`mapping('${entry.localField}'): coercion ISO_STRING_TO_DATE targets a date field.`);\n }\n // ⚠ Odoo spells ABSENT values as literal `false` (v3.1 §3 / PR-8), so on an Odoo source\n // the false→null coercion is the DEFAULT — resolved HERE, at authoring time, because this\n // is the one place the destination field's type is known: a genuine BOOLEAN target keeps\n // its `false` (Odoo booleans really are `false`), everything else would otherwise persist\n // a literal `false` into a string/date/number field. The runtime transform then applies\n // only RESOLVED coercions and carries no schema knowledge.\n if (\n declaration.binding.dialect === HttpApiTransportDialect.ODOO_JSONRPC\n && entry.coercion === ExternalDataFieldCoercion.NONE\n && !(unwrapSchema(targetSchema) instanceof z.ZodBoolean)\n ) {\n entry.coercion = ExternalDataFieldCoercion.ODOO_FALSE_AS_NULL;\n }\n }\n /*\n * #1684 — a REMOTE_REFERENCE writes a LOCAL foreign key, resolved after the load.\n *\n * STRING, because the value is a local row id (a pipeline target) or a synthesized key (a virtual\n * target), and both are strings. ABSENCE-CAPABLE, because an empty remote reference and an unresolved\n * one both leave it empty — a required target would make every row whose parent is not loaded yet\n * unwritable. The relationship half (the field IS a declared foreign key to the target) is checked\n * below, once relationships are compiled; whether the target is a pipeline destination or a virtual\n * resource on the same system of record needs the TARGET's configuration, which only the resources\n * registry holds, so it is refused at startup.\n *\n * The value shape defaults from the dialect HERE, like the Odoo false→null coercion above: this is the\n * one place both the dialect and the author's silence are known, and the runtime reads only the\n * resolved value.\n */\n if (entry.kind === ExternalDataMappingEntryKind.REMOTE_REFERENCE) {\n if (!(unwrapSchema(targetSchema) instanceof z.ZodString)) {\n refuse(`mapping('${entry.localField}'): a REMOTE_REFERENCE writes a local foreign key, so its target must be a STRING field.`);\n }\n if (unwrapSchema(targetSchema) === targetSchema) {\n refuse(\n `mapping('${entry.localField}'): a REMOTE_REFERENCE leaves its foreign key EMPTY while the reference is empty or its target is not loaded yet, so the field must be optional or nullable.`\n );\n }\n entry.valueShape = resolveExternalDataRemoteReferenceValueShape(entry, declaration.binding.dialect);\n }\n validateExternalDataExpressionAgainstTarget(entry, targetSchema, declaration.binding.dialect, refuse);\n }\n\n if (declaration.population === ExternalDataDestinationPopulation.CLOSED) {\n // Enumerate by the operation's EFFECTIVE semantics, never by its identifier: a CORE operation\n // is its own semantics, while a CUSTOM one declares them per variant through\n // `resourceOperationLike` (the same resolution `isDataModeVariantKeyAllowedForOperation`\n // uses). Both sources are unioned because neither sees the other's members — `coreOperations`\n // can name an operation with no authored configuration entry, and `operationsConfiguration`\n // is where a custom operation exists at all.\n const createShaped: ReadonlySet<unknown> = new Set<unknown>([\n CoreResourceOperation.CREATE,\n CoreResourceOperation.CREATE_MANY,\n ]);\n const declaredCreates = new Set<string>();\n for (const operation of (coreOperations as unknown[])) {\n if (createShaped.has(operation)) declaredCreates.add(String(operation));\n }\n for (const [operationKey, operationConfig] of Object.entries((operationsConfiguration ?? {}) as Record<string, unknown>)) {\n const variants = (operationConfig as { variants?: Array<{ resourceOperationLike?: unknown }> })?.variants ?? [];\n const effectiveOperations: unknown[] = variants.length > 0\n ? variants.map((variant) => variant.resourceOperationLike ?? operationKey)\n : [operationKey];\n if (effectiveOperations.some((effective) => createShaped.has(effective))) {\n declaredCreates.add(operationKey);\n }\n }\n if (declaredCreates.size > 0) {\n refuse(\n `population CLOSED: every row comes from the pipeline, so caller CREATE operations (${[...declaredCreates].sort().join(', ')}) are refused — declare population: OPEN if users may mint rows beside the synced ones. A CUSTOM operation counts when a variant declares a create-shaped resourceOperationLike.`\n );\n }\n }\n\n return declaration;\n })();\n\n const normalizedResourceRelationships = Resources_SharedUtils.ensureCompiledRelationships(\n resourceRelationships\n );\n\n // ========================================\n // VALIDATE DECORATOR COMBINATIONS\n // ========================================\n\n // Validate that mainSchema doesn't have invalid decorator combinations\n validateDecoratorCombinations(mainSchema, resourceIdentifier as string);\n\n // ========================================\n // DERIVE RESOURCE PRIMARY SCOPE\n // ========================================\n //\n // Two derivation signals are permitted (no silent default). A third\n // mechanism — polymorphic factories — is mechanically a special case of (2):\n //\n // 1. SELF-ANCHOR — the resource itself is one of the canonical scope roots\n // (USERS, ORGANIZATIONS, APPLICATION, ANONYMOUS_USERS). The PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE\n // map encodes that bijection.\n //\n // 2. FLAGGED RELATIONSHIP — exactly one relationship involving this resource\n // has `isPrimaryScope: true`. The rel-factory enforces that the flag can\n // only be set on a parent (not a child-side) and that the parent resolves\n // to a known scope-root in the primaryScopeMap, so reading\n // `primaryScopeRelationship.primaryScope` here always yields a valid enum.\n //\n // 3. POLYMORPHIC VARIANT (special case of 2) — resources built via\n // `createPolymorphicResourceConfigurations(...)` (e.g. SSO connections,\n // billing accounts, subscriptions, M2M webhooks). The polymorphic factory\n // auto-injects an `isPrimaryScope: true` rel per declared variant, so each\n // variant resolves through path (2) without the author having to re-declare\n // the anchor manually. If you reach the throw below for a polymorphic\n // resource, the variant declaration is missing its scope mapping — fix\n // the polymorphic config, NOT the registry rel list.\n //\n // If no derivation signal is present we THROW. The framework cannot quietly\n // assume a scope: scope drives auth, notifications, execution context, URL\n // routing, and cross-tenant isolation. A wrong default would be a silent\n // security regression. Every resource author MUST declare scope explicitly\n // via one of the three signals above.\n //\n // Migration: if you hit this throw, add a STANDALONE primary rel from the\n // owning scope-root (e.g. `ORGANIZATIONS → yourResource`,\n // `USERS → yourResource`, `APPLICATION → yourResource`) with\n // `accessScopeStrategy: STANDALONE` and `isPrimaryScope: true`. STANDALONE\n // keeps the rel inert for URL routing while declaring the structural\n // ownership anchor — see `resources-relationships.shared.factory.ts` Guard 1.\n\n const selfScopeEntry = Object.entries(PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE).find(\n ([, coreType]) => coreType === resourceIdentifier\n );\n\n const relevantRelationships = normalizedResourceRelationships.filter(rel =>\n rel.resourceType1 === resourceIdentifier || rel.resourceType2 === resourceIdentifier\n );\n const primaryScopeRelationship = relevantRelationships.find(rel => rel.isPrimaryScope === true);\n\n let resourcePrimaryScope: ResourcePrimaryScope;\n if (selfScopeEntry) {\n resourcePrimaryScope = selfScopeEntry[0] as ResourcePrimaryScope;\n } else if (primaryScopeRelationship?.primaryScope) {\n resourcePrimaryScope = primaryScopeRelationship.primaryScope;\n } else {\n throw createConfigurationError(\n `[${resourceIdentifier}] Cannot derive resourcePrimaryScope.\\n` +\n `\\n` +\n `A resource configuration MUST declare its primary scope via one of:\\n` +\n ` (1) Self-anchor — the resource itself is a canonical scope root\\n` +\n ` (USERS, ORGANIZATIONS, APPLICATION, ANONYMOUS_USERS).\\n` +\n ` (2) Flagged relationship — exactly one parent relationship carries\\n` +\n ` \\`isPrimaryScope: true\\` (parent resolves to a known scope root).\\n` +\n ` (3) Polymorphic variant — resources built via\\n` +\n ` \\`createPolymorphicResourceConfigurations(...)\\` get an\\n` +\n ` \\`isPrimaryScope: true\\` rel auto-injected per variant. If you\\n` +\n ` reach this throw for a polymorphic resource, your variant\\n` +\n ` declaration is missing its scope mapping — fix the polymorphic\\n` +\n ` config, NOT the registry rel list.\\n` +\n `\\n` +\n `No signal was found for resource '${resourceIdentifier}'.\\n` +\n `\\n` +\n `Fix: add a primary-anchor relationship in the registry. For an internal\\n` +\n `resource that should NOT be URL-routed under its scope parent, use:\\n` +\n `\\n` +\n ` createResourcesRelationship(\\n` +\n ` CoreResourceType.ORGANIZATIONS, '${resourceIdentifier as string}',\\n` +\n ` ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY,\\n` +\n ` {\\n` +\n ` accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.STANDALONE,\\n` +\n ` isPrimaryScope: true,\\n` +\n ` nature: RelationshipNature.REFERENCE,\\n` +\n ` contextPolicy: { enabled: false },\\n` +\n ` }\\n` +\n ` )\\n` +\n `\\n` +\n `For a routable child resource, drop the STANDALONE strategy and add\\n` +\n `\\`isPrimaryScope: true\\` to the existing parent relationship.\\n` +\n `\\n` +\n `Background: the framework no longer falls back to a silent ORGANIZATIONS\\n` +\n `default — primary scope drives auth, notifications, execution context,\\n` +\n `URL routing, and cross-tenant isolation, so a wrong default would be a\\n` +\n `silent security regression. See \\`resources-config.shared.factory.ts\\`\\n` +\n `(DERIVE RESOURCE PRIMARY SCOPE) for the full rationale.`\n );\n }\n\n // ========================================\n // HTTP_API × PRIMARY SCOPE — a system of record's rows belong to the OWNER organization\n // ========================================\n //\n // Rows read out of a system of record are STAMPED with the organization that owns the application\n // (#1055 §6), and the engine's per-row gate reads that stamp. Three things have to be true of the\n // resource for the stamp to mean anything, and all three are checkable HERE.\n //\n // ## Why here, and not at registration — R13 was measured and is wrong on this half\n //\n // #1055's review pass says \"the resource factory never sees relationships\", so the anchor check\n // must move to boot registration. It does see them: `resourceRelationships` is a parameter of this\n // function (a resource config is a FUNCTION of the registry's relationship list — see any\n // `*.resources-config.ts`), and `primaryScopeRelationship` is resolved from it thirty lines up.\n //\n // So the split the plan prescribed buys nothing and costs the author their error at the moment they\n // write the file. What genuinely CANNOT be checked here is the INSTANCE — whether `system` names a\n // declared one and whether the dialects agree — because the saas configuration is not in scope in\n // an application's `shared-lib`. That half stays at registration, which is the first place both the\n // binding and the declaration are visible.\n if (resolvedHttpApiBinding !== undefined) {\n if (resourcePrimaryScope !== ResourcePrimaryScope.ORGANIZATIONS) {\n throw createConfigurationError(\n `[${resourceIdentifier}] an http-api resource must be ORGANIZATIONS-scoped, and this one resolves to `\n + `'${resourcePrimaryScope}'. Its rows are stamped with the organization that owns the application, and the `\n + `per-row tenant gate reads that stamp — an APPLICATION- or USER_SELF-scoped resource has no organization in `\n + `its execution context to compare it against, so every read would be decided by a field nothing could match.`\n );\n }\n\n /*\n * The anchor must be REQUIRES_CONTEXT, and it must name no foreign key.\n *\n * STANDALONE is the one that was MEASURED to fail rather than reasoned about: it answered\n * 403 `parent_scope_denied` to an ORG_OWNER, because `initiatorIds.organizationId` is filled only\n * from URL parameters and a standalone resource is not routed under its scope parent.\n *\n * A `foreignKeyField` would be a field the projection can never fill: a remote row carries no\n * Wildo organization id, which is the entire reason the stamp exists. Naming one would make every\n * row look as though it declared a tenant it does not have.\n */\n if (primaryScopeRelationship !== undefined) {\n if (primaryScopeRelationship.accessScopeStrategy !== ResourceRelationshipAccessScopeStrategy.REQUIRES_CONTEXT) {\n throw createConfigurationError(\n `[${resourceIdentifier}] an http-api resource's primary-scope relationship must be REQUIRES_CONTEXT, and this `\n + `one is '${String(primaryScopeRelationship.accessScopeStrategy)}'. A STANDALONE anchor is not routed under its `\n + `organization, so the execution context carries no organization id and an ORG_OWNER is answered `\n + `403 parent_scope_denied — measured, not inferred.`\n );\n }\n if (primaryScopeRelationship.foreignKeyField !== undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] an http-api resource's primary-scope relationship declares `\n + `foreignKeyField '${String(primaryScopeRelationship.foreignKeyField)}', which the projection can never fill — `\n + `a remote row carries no Wildo organization id. The tenant anchor is STAMPED onto the projected row from the `\n + `application's owner organization; remove the foreign key.`\n );\n }\n }\n }\n\n // ========================================\n // HTTP_API × WRITES — what a writable read-through resource must declare (#1679)\n // ========================================\n //\n // Everything decidable from this one file: the verbs the binding opens against the operations that\n // perform them, no bulk write, INLINE only, no `Idempotency-Key: accepted`. (The erasure-stance rule\n // that used to sit here is the #2010 check just above, which covers reads as well.) The rules and their reasons live on\n // `assertHttpApiWriteDeclarationCoherence`. What needs the saas configuration (the instance's\n // partition field) or the engine's dialect registry (whether the dialect can write at all) is\n // checked at boot registration instead.\n if (resolvedHttpApiBinding !== undefined) {\n // #2010: a read-through resource's fields ARE the remote row's, so personal-data categories on them contradict a\n // NO_SUBJECT_DATA stance whether or not the binding writes. The rule and its remedy live on the util.\n const personalFields = personalFieldsContradictingNoSubjectDataStance({ stance: resolvedHttpApiBinding.erasure.stance, mainSchema });\n if (personalFields.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid httpApiBinding erasure stance: ${describeNoSubjectDataStanceContradiction({ system: resolvedHttpApiBinding.system, personalFields })}`,\n );\n }\n try {\n assertHttpApiWriteDeclarationCoherence({\n binding: resolvedHttpApiBinding,\n operations: collectHttpApiWriteOperationFacts(\n coreOperations as readonly unknown[],\n operationsConfiguration as Readonly<Record<string, unknown>> | undefined,\n ),\n mainSchema,\n });\n } catch (error) {\n throw createConfigurationError(`[${resourceIdentifier}] invalid httpApiBinding write declaration: ${describeCaughtError(error)}`);\n }\n }\n\n // ========================================\n // EXTERNAL-DATA PIPELINE × PRIMARY SCOPE — the destination is ORGANIZATIONS-owned, and the ENGINE\n // supplies the tenant\n // ========================================\n //\n // Since #868 a pipeline load STAMPS every entry with the organization that owns the application\n // (#1054), under the destination's own declared foreign key. So the question this rule asks has\n // inverted: it used to demand that the AUTHOR supply the tenant, and now it demands that the author\n // leave room for the ENGINE to.\n //\n // ## What the previous rule was, and why it could not stay\n //\n // It refused a required scope FK that no mapping supplied, because a load genuinely carried no\n // tenant. MEASURED 2026-09-11 against a real Mongo store, through the real engines, on a\n // destination shaped exactly like Wonder Todos' `externalCustomers`:\n //\n // | declaration | run | rows | tenant | reachable |\n // |-----------------------------------------------|--------------|------|--------|-----------|\n // | no mapping onto the scope FK | completed | 2 | NO | 0 |\n // | a CONSTANT mapping onto the scope FK | completed | 2 | YES | 2 |\n //\n // The first row is why a refusal existed at all: a `completed-pass` run with `entriesFailed: 0`\n // that writes rows no contextual read can find. A silent success producing unreachable data is\n // strictly worse than a refusal.\n //\n // But both remedies it offered are now WRONG. A `CONSTANT` id cannot be authored — organizations\n // are created at runtime, so there is no id to commit — and a STANDALONE anchor was measured to\n // answer 403 `parent_scope_denied` to an ORG_OWNER, because `initiatorIds.organizationId` is filled\n // only from URL parameters and a standalone resource is not routed under its scope parent. The rule\n // was refusing the one correct shape and recommending two broken ones.\n //\n // ## What it refuses now, and why each one is a LIE rather than an incompleteness\n //\n // Every clause below rejects a declaration that would be UNTRUE if it ran, which is the test\n // `application-creation-directive.md` sets for a refusal. None of them asks anyone to decide\n // anything: each names the one shape that works.\n if (externalDataPipeline !== undefined) {\n // #2010: the fields a pipeline copies are what its source holds, so personal-data categories on them contradict\n // a NO_SUBJECT_DATA stance on its binding. A CONSTANT entry reads nothing from the source; an unmapped field is\n // the application's own. The same fields the privacy notice's source statement counts.\n const copiedFields = new Set(externalDataPipeline.mapping\n .filter((entry) => entry.kind !== ExternalDataMappingEntryKind.CONSTANT)\n .map((entry) => entry.localField));\n const copiedPersonalFields = personalFieldsContradictingNoSubjectDataStance({\n stance: externalDataPipeline.binding.erasure.stance,\n mainSchema,\n sourcedFields: copiedFields,\n });\n if (copiedPersonalFields.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid externalDataPipeline erasure stance: ${describeNoSubjectDataStanceContradiction({ system: externalDataPipeline.binding.system, personalFields: copiedPersonalFields })}`,\n );\n }\n const pipelineDestinationRefusal = (reason: string): never => {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid externalDataPipeline declaration: ${reason}\n`\n + `\n`\n + `A pipeline reads a SYSTEM OF RECORD — a deployment the operator runs, read with the application's own\n`\n + `service identity — so every row it loads belongs to the organization that OWNS the application, and the\n`\n + `engine stamps that organization onto each entry as it is built. What the destination owes is somewhere\n`\n + `to put it: an ORGANIZATIONS primary scope, reached through a ROUTED relationship\n`\n + `(accessScopeStrategy: REQUIRES_CONTEXT) that names a REQUIRED foreignKeyField, with that field mapped by\n`\n + `nothing and declared .excludeFromCreate().excludeFromUpdate().`\n );\n };\n\n // (a) The destination must be ORGANIZATIONS-scoped. Decision Q2 of #1049: system-of-record data\n // belongs to the owner organization, so an APPLICATION- or USER_SELF-scoped destination is a\n // statement about ownership that contradicts where the rows come from.\n if (resourcePrimaryScope !== ResourcePrimaryScope.ORGANIZATIONS) {\n pipelineDestinationRefusal(\n `its primary scope is ${String(resourcePrimaryScope)}, and a system-of-record destination must be ORGANIZATIONS.`,\n );\n }\n\n // (b) There must BE a routed scope relationship carrying a foreign key. Without one the stamp has\n // nowhere to land: a field the schema does not declare is dropped by the strict re-parse, and\n // the row lands unanchored — the measured failure above, arriving through the fix for it.\n // STANDALONE is called out by name because it is the remedy the previous rule recommended.\n if (primaryScopeRelationship === undefined) {\n pipelineDestinationRefusal('it declares no primary-scope relationship, so a loaded row has no tenant field.');\n }\n if (primaryScopeRelationship!.accessScopeStrategy === ResourceRelationshipAccessScopeStrategy.STANDALONE) {\n pipelineDestinationRefusal(\n 'its primary-scope relationship is STANDALONE. A standalone resource is not routed under its organization, so '\n + '`initiatorIds.organizationId` is never filled and an ORG_OWNER is answered 403 parent_scope_denied — measured '\n + 'on `billableServices`, 2026-09-14. This was the previous rule\\'s own first recommendation.',\n );\n }\n const scopeForeignKeyField = primaryScopeRelationship!.foreignKeyField;\n if (scopeForeignKeyField === undefined) {\n pipelineDestinationRefusal(\n 'its primary-scope relationship names no foreignKeyField, so there is no column to stamp the owner organization '\n + 'onto. (A VIRTUAL read-through resource is the opposite case and must NOT name one — its rows are projected, '\n + 'never stored.)',\n );\n }\n\n // (c) Nothing may MAP onto the tenant field. Two sources of truth for the tenant is the defect,\n // not a convenience: a mapping wins at load time and the stamp becomes decoration.\n if (externalDataPipeline.mapping.some((entry) => entry.localField === scopeForeignKeyField)) {\n pipelineDestinationRefusal(\n `a mapping entry writes '${String(scopeForeignKeyField)}', which the engine stamps. Two sources of truth for the `\n + 'tenant is exactly the ambiguity this rule exists to remove — remove the mapping entry.',\n );\n }\n\n // (d) The tenant field must be REQUIRED. Optional means \"a row without a tenant is legal\", and no\n // row loaded from a system of record is: an untenanted row is unreadable, and the schema would\n // be promising that it is a supported state.\n const scopeFieldSchema = getZodObjectShape(mainSchema)[scopeForeignKeyField!];\n if (scopeFieldSchema === undefined) {\n pipelineDestinationRefusal(\n `its primary-scope relationship names foreignKeyField '${String(scopeForeignKeyField)}', which the schema does not `\n + 'declare. The stamp would be dropped by the strict re-parse and every row would land unanchored.',\n );\n }\n // `unwrapSchema` strips optional/nullable/default wrappers, so an unwrapped schema IDENTICAL to\n // the declared one means nothing wrapped it — the same test the mapping validation above uses.\n if (unwrapSchema(scopeFieldSchema!) !== scopeFieldSchema!) {\n pipelineDestinationRefusal(\n `'${String(scopeForeignKeyField)}' is optional, nullable or defaulted. A row loaded from a system of record always `\n + 'has an owner, so an absent tenant is not a state this resource can be in — and declaring it legal makes an '\n + 'unreadable row look like a supported one.',\n );\n }\n\n // (e) The tenant field must be excluded from CREATE and UPDATE. It is engine-supplied, so a\n // client that could send it could hand its own rows to another organization — and one that\n // could update it could move them.\n if (!isExcludedFromCreate(scopeFieldSchema!) || !isExcludedFromUpdate(scopeFieldSchema!)) {\n pipelineDestinationRefusal(\n `'${String(scopeForeignKeyField)}' is engine-supplied and must be declared `\n + '.excludeFromCreate().excludeFromUpdate(). Without them a caller can name the tenant on a write — creating a row '\n + 'under another organization, or moving an existing one out of its own.',\n );\n }\n\n /*\n * (f) The destination population is NOT constrained here, and that DIVERGES from #868's review\n * decision R2(e), which said to refuse `OPEN` in this slice. Recorded rather than done quietly.\n *\n * R2(e)'s reason was that \"caller-minted rows under another organization contradict 'belongs to\n * the owner'\". Two things measured against that:\n *\n * - Nothing depends on the claim being universally true. The per-row tenant gate reads each\n * row's own anchor, so a loaded row owned by the owner organization and a caller-minted row\n * owned by its creator are both read correctly, by different people. There is no site that\n * asserts \"every row of this resource belongs to the owner\".\n * - A caller cannot name the tenant anyway: clause (e) above requires `.excludeFromCreate()`, so\n * a caller-minted row takes its organization from the request context like any other, and the\n * orphan walk cannot reach it either — the walk filters on `__seed.seedKey`, which a\n * caller-minted row does not carry.\n *\n * And the deciding one is this repository's own test for a refusal\n * (`application-creation-directive.md`): if this refuses, what does the operator do next? The\n * answer would be \"change your product decision about whether callers may add rows\" — a\n * DECISION, not a repair to an untrue artifact. That makes it a workflow gate rather than a\n * refusal, and the directive says a workflow must MARK rather than block.\n *\n * Refusing it would also have made three shipped, tested behaviours unreachable: the CREATE/UPDATE\n * DTO stripping that protects remote-authoritative fields on caller-minted rows, the admission of\n * create-shaped custom operations, and the admission of a declared caller CREATE. Those pins live\n * in `external-data-pipeline-coherence.test.ts` and still pass.\n */\n\n /*\n * (g) #1684 — every REMOTE_REFERENCE writes the foreign key of a DECLARED relationship to its target.\n *\n * The relationship is what makes the written value a foreign key to the rest of the framework — a\n * picker, a nested read, a cascade — rather than a string that happens to hold a row id. So a reference\n * whose local field is not the `foreignKeyField` of a relationship between this resource and the target\n * would write a value nothing treats as a link: refused. A self-reference (Odoo `res.partner.parent_id`)\n * is a relationship whose two ends are this resource.\n *\n * Checked here, where relationships are compiled; the target's own kind (pipeline destination or virtual\n * resource on the same system of record) and the orphan-cascade acknowledgement need the TARGET's\n * configuration and are refused at startup by the resources registry.\n */\n for (const entry of externalDataPipeline.mapping) {\n if (entry.kind !== ExternalDataMappingEntryKind.REMOTE_REFERENCE) continue;\n const declaresEdge = relevantRelationships.some((relationship) =>\n relationship.foreignKeyField === entry.localField\n && ((relationship.resourceType1 as string) === entry.targetResourceType || (relationship.resourceType2 as string) === entry.targetResourceType)\n && ((relationship.resourceType1 as string) === (resourceIdentifier as string) || (relationship.resourceType2 as string) === (resourceIdentifier as string)));\n if (!declaresEdge) {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid externalDataPipeline declaration: mapping('${entry.localField}') is a REMOTE_REFERENCE to `\n + `'${entry.targetResourceType}', and no relationship between '${String(resourceIdentifier)}' and '${entry.targetResourceType}' `\n + `names '${entry.localField}' as its foreignKeyField. Declare the relationship (a self-reference is a relationship whose two `\n + 'ends are this resource) so the resolved value is a foreign key the rest of the framework follows, not a bare id.',\n );\n }\n }\n }\n\n // ========================================\n // isAnonymizable VALIDATION & ENRICHMENT (W7.3a)\n // ========================================\n\n let effectiveMainSchema: TMainSchema = mainSchema;\n let effectiveResourceRelationships = normalizedResourceRelationships;\n let effectiveSystemAccessPolicy = systemAccessPolicy;\n\n if (isAnonymizable) {\n if (resourcePrimaryScope !== ResourcePrimaryScope.USER_SELF) {\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires primaryScope USER_SELF, got ${resourcePrimaryScope}.`\n );\n }\n\n try {\n const shape = getZodObjectShape(mainSchema);\n const userIdField = shape['userId'];\n if (!userIdField) {\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires a 'userId' field in mainSchema.`\n );\n }\n const nullResult = (userIdField as z.ZodTypeAny).safeParse(null);\n if (!nullResult.success) {\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires 'userId' field to accept null ` +\n `(anonymous records have no userId). Use z.string().nullable().`\n );\n }\n } catch (e) {\n if ((e as any)?.type === ErrorType.CONFIGURATION) throw e;\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true but mainSchema is not a ZodObject (cannot validate userId field).`\n );\n }\n\n // PRESENCE half of the anonymizable operation contract: each requirement group must have at\n // least one of its alternatives declared at all. The RESOLVABILITY half — that a declared op\n // has a variant `AnonymousSessionBackendService` can actually dispatch — runs later, once the\n // operation variants are assembled (search `ANONYMIZABLE_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS`).\n // Deliberately two checks, exactly as for `retentionPolicy`, because they have two different\n // fixes: \"declare the op\" vs \"declare it with a service-resolvable variant\".\n for (const { operations: alternatives, primitive, why } of ANONYMIZABLE_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS) {\n if (alternatives.some((alternative) => coreOperations.includes(alternative as any))) {\n continue;\n }\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires ${describeOperationAlternatives(alternatives)} ` +\n `in coreOperations (${primitive}: ${why}).`\n );\n }\n\n effectiveMainSchema = (mainSchema as any).extend({\n anonymousUserId: z.string().optional().nullable().isDBIndexed()\n }) as TMainSchema;\n\n const anonymousRelationship = createResourcesRelationship(\n CoreResourceType.ANONYMOUS_USERS as ResourceType,\n resourceIdentifier,\n ResourceRelationshipCardinality.ONE,\n primaryScopeRelationship!.cardinality2,\n {\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.STANDALONE,\n foreignKeyField: 'anonymousUserId',\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n nature: primaryScopeRelationship!.resolvedSemantics.nature,\n read: primaryScopeRelationship!.read,\n contextPolicy: { enabled: false },\n childOperations: primaryScopeRelationship!.childOperations?.lifecycle\n ? { lifecycle: primaryScopeRelationship!.childOperations.lifecycle }\n : undefined,\n }\n );\n effectiveResourceRelationships = [...normalizedResourceRelationships, anonymousRelationship];\n\n // ── Derive the transposition system-access grant (W7.3a) ──────────────\n //\n // Anonymous→user ownership transposition (`AnonymousSessionBackendService`)\n // rewrites `{ userId, anonymousUserId }` across every anonymizable resource\n // via `SystemAccessBackendService.updateManyAsSystem`. That primitive is\n // fail-closed on `systemAccessPolicy.updateMany` PER RESOURCE, and both FKs\n // it writes are context-auto-populated names the client-shaped request DTO\n // strips — so WITHOUT the grant the transposition would either throw\n // `CONFIGURATION` (fail-closed) or silently no-op, stranding the converting\n // user's rows under the anonymous id until the cleanup batch deletes them\n // (user-visible data loss).\n //\n // This grant is DERIVED, not authored, precisely because it is not an\n // incidental capability: it is THE mechanism `isAnonymizable` exists to\n // enable. The factory already REQUIRES `UPDATE_MANY` in `coreOperations`\n // above \"for transposition batch update\"; that core operation is\n // unreachable by the transposition service without this system-access\n // opt-in, so deriving it here COMPLETES an existing coupling rather than\n // inventing a new one — and removes a guaranteed per-app footgun (every\n // app marking a resource `isAnonymizable` would otherwise have to remember\n // the grant, and the engine core ships zero anonymizable resources to model\n // it from).\n //\n // Distinct from the `systemAccessPolicy` ⟂ `isSystemResource` separation\n // documented on the policy type: `isSystemResource` is a broad, ACL-\n // orthogonal marker (framework infra does NOT imply an ACL bypass is\n // acceptable), whereas `isAnonymizable` has a single, specific engine\n // behaviour that requires exactly `updateManyAsSystem`. The derived value\n // is materialised into the RESOLVED config below (not hidden in factory\n // control flow), so specs, audits, and `assertSystemAccessAllowed` all see\n // `updateMany: ALLOWED`. Any explicitly-authored `systemAccessPolicy` on an\n // anonymizable resource is preserved for its other verbs; only `updateMany`\n // is forced ALLOWED (a transposition-required resource cannot opt out of\n // its own transposition).\n //\n // FAIL-LOUD (not silent-override): if the author EXPLICITLY declared\n // `updateMany: FORBIDDEN`, that contradicts `isAnonymizable` (the resource\n // asks for transposition yet forbids the only primitive that performs it).\n // Silently flipping it to ALLOWED would erase an explicit security\n // declaration — dishonest. Throw instead. We read the RAW authored policy\n // (`params.systemAccessPolicy`), NOT the destructured value: an unauthored\n // policy is defaulted to all-verbs-FORBIDDEN above, and forcing THAT to\n // ALLOWED is the intended, non-contradictory derive (the common case). Only\n // a hand-written `updateMany: FORBIDDEN` is the contradiction we reject.\n if (params.systemAccessPolicy?.updateMany === ResourceSystemAccessMode.FORBIDDEN) {\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires systemAccessPolicy.updateMany = ALLOWED ` +\n `(anonymous→user transposition rewrites { userId, anonymousUserId } via updateManyAsSystem), but ` +\n `this resource explicitly authored updateMany: FORBIDDEN. A transposition-required resource cannot ` +\n `opt out of its own transposition — remove the explicit FORBIDDEN (the grant is derived automatically) ` +\n `or drop isAnonymizable.`\n );\n }\n effectiveSystemAccessPolicy = {\n ...systemAccessPolicy,\n updateMany: ResourceSystemAccessMode.ALLOWED,\n };\n }\n\n // ========================================\n // retentionPolicy VALIDATION & ENRICHMENT (impersonalization-on-erasure)\n // ========================================\n //\n // Mirror of the isAnonymizable branch above, for the OTHER trusted-write axis:\n // on erasure a retention-governed resource is impersonalized-and-retained\n // (personal fields scrubbed via `updateManyAsSystem`, row KEPT) instead of\n // hard-deleted. Injects the per-record `retentionStatus` marker and derives the\n // system-access grants the capability requires. RESOURCE-level: the per-edge\n // trigger (`onParentDelete.strategy = IMPERSONALIZE_AND_RETAIN`) and per-field scrub\n // (`.impersonalizeWith()`) are declared separately.\n if (retentionPolicy?.mode) {\n // PRESENCE half of the retention operation contract: each required op must be declared at all.\n // The RESOLVABILITY half — that the declared op has a variant the retention primitives can\n // actually dispatch — runs later, once the operation variants are assembled (search\n // `RETENTION_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS`). Deliberately two checks, because they have\n // two different fixes: \"declare the op\" vs \"declare it with a service-resolvable variant\".\n for (const { operation: requiredOperation, why } of RETENTION_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS) {\n if (!coreOperations.includes(requiredOperation as any)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires ${requiredOperation} in coreOperations (${why}).`\n );\n }\n }\n\n // Guard (framework-quality): `retentionStatus` / `impersonalizedAt` are framework-reserved\n // injected names. Zod-4 `.extend()` SILENTLY OVERWRITES a duplicate key, so a resource that\n // already declares one would have its own field clobbered on opt-in — fail loud instead. The\n // same `getZodObjectShape` call also yields a friendly config error if `mainSchema` is not a\n // ZodObject (the marker cannot be injected into a non-object schema).\n // EXPLICIT object check. (Do NOT rely on `getZodObjectShape` throwing — it returns `{}` for a\n // union, so a try/catch around it is dead code and the real failure surfaces later as an\n // undiagnosable `effectiveMainSchema.extend is not a function`.)\n if (!isZodObject(effectiveMainSchema)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires a ZodObject mainSchema (cannot inject the ` +\n `retentionStatus marker into a non-object schema — polymorphic/union mainSchemas are not yet supported).`\n );\n }\n\n const existingShape = getZodObjectShape(effectiveMainSchema);\n for (const reservedField of ['retentionStatus', 'impersonalizedAt'] as const) {\n if (existingShape[reservedField]) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy injects a reserved '${reservedField}' field, but this ` +\n `resource already declares one. Rename that field or drop retentionPolicy (the marker is factory-injected).`\n );\n }\n }\n\n // ========================================\n // IMPERSONALIZE TREATMENT VALIDATION — fail loud at CONFIG BUILD, not on the erasure path.\n // ========================================\n //\n // The impersonalize writer scrubs via `updateManyAsSystem`, whose STRICT update-DTO parse runs\n // over the scrub patch. A treatment the declared field schema cannot accept therefore throws\n // INSIDE the parent-delete transaction and ROLLS BACK the erasure — the worst possible moment to\n // discover a config mistake. Every check below is a pure `safeParse` against the AUTHORED field\n // schema, so it catches every axis at once without a type taxonomy:\n //\n // - REMOVE writes `null`, which the field-clearing contract resolves into either a stored null\n // (null-accepting field) or a removed key (merely `.optional()`). Both are what REMOVE asks\n // for, so the requirement is that the field be CLEARABLE — i.e. not required and not\n // `.default()`-wrapped, since a default's output type is non-optional.\n // HISTORY, because this comment justified a stricter guard for months: update DTOs used to\n // be made `.optional()` and NEVER `.nullable()`, so a non-nullish field really did reject\n // the scrub, and the capability was non-functional for every non-nullable field. That\n // changed when `toPatchOptionalField` began admitting null for clearable fields; the guard\n // below was left demanding `.nullish()` and so failed startup on valid declarations.\n // - MASK writes the field's EFFECTIVE mask value — its own `maskValue` override, or\n // `IMPERSONALIZE_MASK_CONSTANT`. Beyond the obvious number/date/enum/boolean mismatches, the\n // default constant also fails CONSTRAINED strings — `z.email()`, `z.uuid()`, `.min(n)` — i.e.\n // exactly the PII fields most likely to be masked, which is why the override exists. A\n // \"MASK is string-only\" rule would NOT be sufficient. An override is validated against the\n // field's own schema here, and is rejected outright on a non-MASK treatment (nothing would\n // write it).\n // - A resource that opts into retentionPolicy but declares ZERO treatments would flip rows to\n // `RETAINED` with every personal field intact: a compliance-grade lie (it LOOKS erased).\n for (const [fieldName, fieldSchema] of Object.entries(existingShape)) {\n const treatment = getImpersonalizeTreatment(fieldSchema as z.ZodTypeAny);\n if (treatment === undefined) continue;\n\n // Floor fields are never scrubbed, so their schema need not accept a scrub value. Reuse the\n // writer's own floor predicate — one authority, so the guard can never drift from the scrub.\n if (isImpersonalizeNeverScrubFloorField(fieldName)) continue;\n\n // D1 allows SEVERING the person-link (`userId` / `anonymousUserId`) — but only when a NON-person\n // scope survives to anchor the retained row. If the person-link IS the resource's primary scope,\n // nulling it strips the row's only tenant anchor: contextual scoping can no longer reach it, so\n // the retained record becomes invisible even to the audited see-through path that retention\n // exists to serve (retained-but-unreachable ≠ retained).\n const severedScope = FIELD_IDENTIFIER_TO_PRIMARY_SCOPE[fieldName];\n if (\n treatment === RedactionType.REMOVE &&\n severedScope !== undefined &&\n severedScope === resourcePrimaryScope\n ) {\n throw createConfigurationError(\n `[${resourceIdentifier}] field '${fieldName}' declares impersonalize treatment REMOVE, but it is this ` +\n `resource's PRIMARY scope ('${severedScope}'). Severing the primary-scope link would leave the retained ` +\n `row with no tenant anchor — unreachable through contextual scoping, including the audited see-through ` +\n `read. Keep the primary-scope link (use KEEP) and scrub the personal FIELDS instead.`\n );\n }\n\n // NOTE ON UNIQUE-INDEXED FIELDS (gate G-BKEY): a scrub writes the SAME value to every row in\n // the batch (`null` for REMOVE, one shared mask constant for MASK), which on a plain unique\n // index would collide (E11000) and abort the erasure. That is NOT rejected here, because the\n // schema layer scopes every unique index on a retention-governed resource to NON-RETAINED rows\n // (`partialFilterExpression`, see `buildRetentionPartialFilterExpression`): the scrubbed rows\n // become RETAINED in the same write, leave the index, and therefore cannot collide — the same\n // property that stops a retained row from permanently locking out re-creation of its key.\n // ⚠️ This guard's absence DEPENDS on that partial index. If the partial filter is ever removed,\n // a treatment on a unique field becomes an erasure-aborting defect again.\n\n // A maskValue is meaningful ONLY under MASK — no other treatment writes it. Declaring one\n // elsewhere means the author believes a specific value will be stored while the writer would\n // null the field (REMOVE) or leave it untouched (KEEP): the declaration and the behaviour\n // disagree, which is the same class of silent compliance lie the zero-scrub guard prevents.\n // Checked BEFORE the per-treatment branches, and independently of them — as an arm of that\n // if/else chain it would be unreachable for exactly the treatments it needs to reject.\n if (treatment !== RedactionType.MASK && getImpersonalizeMaskValue(fieldSchema as z.ZodTypeAny) !== undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] field '${fieldName}' declares an impersonalize maskValue but its treatment is ` +\n `'${treatment}', not MASK — nothing would ever write that value. Use MASK to store it, or drop the maskValue.`\n );\n }\n\n if (treatment === RedactionType.REMOVE) {\n // REMOVE writes `null`, and the field-clearing contract decides what that PERSISTS as: a\n // null-accepting field stores the null, a merely-`.optional()` field has the key removed.\n // Either outcome is what REMOVE asks for, so the requirement is CLEARABILITY, not\n // null-acceptance.\n //\n // This guard used to demand `.nullish()` and justify it with \"update DTOs are made\n // .optional(), never .nullable()\". That was true when it was written and is not any more —\n // `toPatchOptionalField` now admits null for every clearable field. Left unchanged, the\n // guard rejected a perfectly valid `.optional()` + REMOVE declaration at CONFIG BUILD, i.e.\n // it failed application startup, and explained the refusal with a rule that no longer\n // exists.\n if (!mainSchemaFieldIsClearable(fieldSchema as z.ZodTypeAny)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] field '${fieldName}' declares impersonalize treatment REMOVE, which clears the ` +\n `field, but the field is required (or carries a \\`.default()\\`, whose output type is non-optional). A ` +\n `field that must always hold a value cannot be scrubbed by removal — declare it \\`.optional()\\` or ` +\n `\\`.nullish()\\`, or use MASK to overwrite it with a placeholder instead.`\n );\n }\n } else if (treatment === RedactionType.MASK) {\n // Validate the EFFECTIVE value — the field's own `maskValue` override when it declares one,\n // the framework constant otherwise — resolved through the SAME helper the scrub writer uses,\n // so a config that passes here cannot produce a write the update DTO rejects mid-erasure.\n const effectiveMaskValue = resolveImpersonalizeMaskValue(fieldSchema as z.ZodTypeAny);\n if (!(fieldSchema as z.ZodTypeAny).safeParse(effectiveMaskValue).success) {\n throw createConfigurationError(\n effectiveMaskValue === IMPERSONALIZE_MASK_CONSTANT\n ? `[${resourceIdentifier}] field '${fieldName}' declares impersonalize treatment MASK, but its schema ` +\n `rejects the default mask constant '${IMPERSONALIZE_MASK_CONSTANT}'. That constant is an unconstrained ` +\n `string, so a number/date/enum/boolean — or a CONSTRAINED string such as z.email()/z.uuid()/.min(n) — ` +\n `cannot hold it. Either declare a field-specific value the schema accepts ` +\n `(\\`.impersonalizeWith(MASK, { maskValue: '...' })\\`), or use REMOVE on a \\`.nullish()\\` field.`\n : `[${resourceIdentifier}] field '${fieldName}' declares impersonalize treatment MASK with ` +\n `maskValue '${effectiveMaskValue}', but its own schema rejects that value. The mask is written ` +\n `verbatim through the strict update-DTO parse, so it must satisfy every constraint the field ` +\n `declares (format, length, enum membership).`\n );\n }\n } else if (treatment === RedactionType.RESET) {\n /*\n * RESET returns the field to its schema default — the treatment for a field that is non-nullable\n * WITH a `.default()`, where REMOVE (needs clearable) and MASK (needs a string) both refuse.\n *\n * The RULES live in `resolveImpersonalizeResetValue`, deliberately, and are NOT restated here: it\n * refuses a field with no default, and one that is merely `.optional()` (whose default IS\n * undefined, so nothing would be scrubbed). One authority, because a second copy of either check\n * would drift from the writer that actually runs them.\n *\n * What this arm adds is WHERE the failure surfaces. Called here, the refusal is a CONFIGURATION\n * error naming the RESOURCE. Left to fall through, the same resolver still runs — via\n * `buildImpersonalizeScrubPatch` further down this function — but throws a bare Error naming only\n * the field, which boot does not classify as a configuration fault.\n */\n try {\n resolveImpersonalizeResetValue(fieldSchema as z.ZodTypeAny, fieldName);\n } catch (error) {\n throw createConfigurationError(\n `[${resourceIdentifier}] ${describeCaughtError(error)}`\n );\n }\n }\n }\n\n // Count what the WRITER would actually scrub, not what was merely declared. `KEEP` treatments and\n // treatments on never-scrub floor fields are both skipped by `buildImpersonalizeScrubPatch`, so\n // counting declarations would let a resource satisfy this guard with a patch that is EMPTY — rows\n // flipping to RETAINED with every field intact, which is precisely the compliance lie the guard\n // exists to prevent. Deriving the count from the writer keeps ONE authority for \"what gets scrubbed\".\n // FAIL LOUD on a NESTED treatment. Both the guard above and the writer walk TOP-LEVEL keys only\n // (`getMergedObjectOrUnionShape` merges union options; it does not descend into nested objects, and\n // `getMetadataRecursive` traverses wrappers but never a ZodObject's shape). So a\n // `.impersonalizeWith()` declared on a nested field — `billingContact.email`, or a nested\n // `z_file()` — is SILENTLY IGNORED: the row flips to RETAINED while that field, and any file linked\n // under its dotted path, survive intact. That is the compliance lie this whole block exists to\n // prevent, reached through a door the top-level walk cannot see. Recursive scrubbing is deliberately\n // out of v1 scope, so an unscrubable nested treatment must be a BOOT ERROR rather than a silent skip.\n assertNoNestedImpersonalizeTreatment(effectiveMainSchema, resourceIdentifier);\n\n // The two modes assert OPPOSITE things about this resource's fields, so each fails loud on the\n // other's shape. Neither is a warning: a mismatch here means the config claims something about\n // personal data that the runtime would not honour.\n const effectiveScrubPatch = buildImpersonalizeScrubPatch(effectiveMainSchema);\n if (retentionPolicy.mode === ErasureRetentionMode.RETAIN_ONLY) {\n // RETAIN_ONLY asserts \"this resource holds no personal data of its own\". A treatment contradicts\n // that claim — and would be silently ignored at erasure time, since RETAIN_ONLY writes only the\n // markers. Fail rather than let the declaration and the behaviour disagree.\n if (Object.keys(effectiveScrubPatch).length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy.mode = RETAIN_ONLY asserts this resource holds no personal data of ` +\n `its own, but field(s) [${Object.keys(effectiveScrubPatch).join(', ')}] declare an impersonalize treatment. ` +\n `Those treatments would never run. Use mode = RETAIN_AND_IMPERSONALIZE to actually scrub them, or remove them.`\n );\n }\n /*\n * The SECOND direction, and until 2026-08-31 it did not exist.\n *\n * The check above sees a field with a TREATMENT. This one sees a field DECLARED as personal data\n * and given no treatment — which is the shape a wrong `RETAIN_ONLY` actually takes. Without it,\n * the cheap mode was also the one that failed silently: a resource whose fields carry\n * `.dataCategories()` could assert it holds no personal data, pass every gate, and put that\n * assertion into a governed document. `RETAIN_AND_IMPERSONALIZE` never had the hole — it is\n * refused when nothing would be scrubbed.\n *\n * This catches a CONTRADICTION, not an omission. A resource that classified nothing still passes,\n * because \"nobody declared a category\" and \"there is no personal data\" are indistinguishable\n * here; that is the category inventory's question. A clean result is not a proof.\n */\n const declaredPersonalDataFields = collectDeclaredPersonalDataFields(effectiveMainSchema);\n if (declaredPersonalDataFields.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy.mode = RETAIN_ONLY asserts this resource holds no personal data of ` +\n `its own, but field(s) [${declaredPersonalDataFields.join(', ')}] declare .dataCategories(). The resource ` +\n `cannot both hold personal data and hold none. Use mode = RETAIN_AND_IMPERSONALIZE and give those fields an ` +\n `impersonalize treatment, or — if the category is wrong — correct the field. Scope foreign keys and ` +\n `createdByUserId are excluded here: they link a row to a person without being personal data the row holds.`\n );\n }\n } else if (Object.keys(effectiveScrubPatch).length === 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy.mode = RETAIN_AND_IMPERSONALIZE but NO field would actually be ` +\n `scrubbed (KEEP treatments and treatments on never-scrub floor fields such as scope FKs / createdByUserId ` +\n `do not count). Erasure would flip rows to RETAINED with every personal field intact — a record ` +\n `that looks scrubbed but is not. Mark at least one non-floor personal field REMOVE or MASK, or — if this ` +\n `resource genuinely holds no personal data of its own — declare mode = RETAIN_ONLY instead.`\n );\n }\n\n // Inject the per-record retention marker. Server-managed (excluded from client\n // create/update, hidden), DB-indexed for the hidden-by-default filter predicate\n // + the future disposal clock. Defaults to ACTIVE; only the impersonalize writer\n // flips it to RETAINED via updateManyAsSystem (which re-attaches verb-excluded\n // fields after the strict parse — see deriveTrustedSystemWritePreservedFields).\n effectiveMainSchema = (effectiveMainSchema as any).extend({\n retentionStatus: RetentionStatusSchema\n /*\n * A framework VOCABULARY, declared as one. `RetentionStatus` is injected onto every resource\n * that declares a `retentionPolicy`, so without this its members would take their words from\n * each field PATH in turn — the same enum described afresh per resource, by an LLM that\n * reaches a different phrasing each time. `.systemEnum()` routes them to\n * `system_enums.RetentionStatus.*`, authored once and read everywhere.\n *\n * It changes nothing visible today, deliberately: the field is `.isHidden()` in both modes,\n * so the planner now asks for no words for it at all (#1298). The declaration is here so\n * that the day a surface shows a retention state — a retained-row badge, an erasure report —\n * it inherits ONE vocabulary rather than starting the per-path drift that #1298 measured on\n * its sibling `impersonalizedAt`, which had collected eleven English labels unseen.\n */\n .systemEnum('RetentionStatus')\n .default(RetentionStatus.ACTIVE)\n .isDBIndexed()\n .excludeFromCreate()\n .excludeFromUpdate()\n .isHidden(),\n impersonalizedAt: z.date()\n .optional()\n .isDBIndexed()\n .excludeFromCreate()\n .excludeFromUpdate()\n .isHidden(),\n }) as TMainSchema;\n\n // Derive the impersonalization system-access grants (parallel to the\n // isAnonymizable updateMany derive above): `updateMany` for the in-place scrub,\n // `seeRetained` for the audited see-through read of retained rows. FAIL-LOUD, not\n // silent-override: if the author EXPLICITLY declared either verb FORBIDDEN, that\n // contradicts retentionPolicy (the resource asks to be retained-and-scrubbed yet\n // forbids the only primitive that performs / audits it). We read the RAW authored\n // policy (`params.systemAccessPolicy`) — an unauthored policy defaults to\n // all-verbs-FORBIDDEN, and deriving THAT to ALLOWED is the intended common case.\n if (params.systemAccessPolicy?.updateMany === ResourceSystemAccessMode.FORBIDDEN) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires systemAccessPolicy.updateMany = ALLOWED ` +\n `(the impersonalize writer scrubs in place via updateManyAsSystem), but this resource explicitly ` +\n `authored updateMany: FORBIDDEN. Remove it (the grant is derived automatically) or drop retentionPolicy.`\n );\n }\n if (params.systemAccessPolicy?.seeRetained === ResourceSystemAccessMode.FORBIDDEN) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires systemAccessPolicy.seeRetained = ALLOWED ` +\n `(the audited see-through read of retained rows), but this resource explicitly authored ` +\n `seeRetained: FORBIDDEN. Remove it (the grant is derived automatically) or drop retentionPolicy.`\n );\n }\n effectiveSystemAccessPolicy = {\n ...effectiveSystemAccessPolicy,\n updateMany: ResourceSystemAccessMode.ALLOWED,\n seeRetained: ResourceSystemAccessMode.ALLOWED,\n };\n }\n\n // ========================================\n // retentionBinding VALIDATION & ENRICHMENT (#1613 — how long a row is kept)\n // ========================================\n //\n // A separate axis from `retentionPolicy` above: that one is what an ERASURE does to a row, this one\n // is how long the row lives. Every refusal here is about the binding being UNENFORCEABLE as written —\n // a clock that reads a field the row does not have, or two retention authorities on one row — and\n // each names the exact fix, because the alternative is a period the application publishes and the\n // sweep silently cannot honour.\n //\n // assurance-control: WILDO.PRIVACY.STORAGE_LIMITATION — a declared retention class is refused at\n // configuration build unless the sweep can actually compute when each row expires.\n // A tenant's rows never expire by `.ttl()` (#1634). MongoDB deletes a TTL row itself, with no application code\n // running, so no legal hold, cascade or file release could ever reach it — and a hold on an organization claims\n // to suspend EVERY deletion of that organization's data. `.ttl()` is for application-scoped framework plumbing\n // (job executions, job payloads); a tenant resource binds a retention class, whose sweep asks the hold.\n if (resourcePrimaryScope === ResourcePrimaryScope.ORGANIZATIONS) {\n const tenantTtlFields = collectRowTtlPolicies(effectiveMainSchema).map((policy) => policy.fieldName);\n if (tenantTtlFields.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] is scoped to an organization and declares .ttl() on [${tenantTtlFields.join(', ')}]. ` +\n `A tenant's rows are never expired by the database's own TTL, which no legal hold can suspend: bind a ` +\n `retentionBinding instead (its sweep deletes through the service layer and skips held rows).`\n );\n }\n }\n\n let retentionBinding: ResourceRetentionBinding | undefined;\n if (authoredRetentionBinding !== undefined) {\n const parsedBinding = ResourceRetentionBindingSchema.safeParse(authoredRetentionBinding);\n if (!parsedBinding.success) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding is invalid: ${parsedBinding.error.issues.map((issue) => `${issue.path.join('.') || '(root)'}: ${issue.message}`).join('; ')}.`\n );\n }\n retentionBinding = parsedBinding.data;\n if (!isZodObject(effectiveMainSchema)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding requires a ZodObject mainSchema: the retention clock is a field of the row.`\n );\n }\n const bindingShape = getZodObjectShape(effectiveMainSchema) as Record<string, z.ZodTypeAny>;\n\n // One row, one retention authority. `.ttl()` expires the row by a fixed number of seconds, and on\n // MongoDB natively with no application code running — so no cascade, file release or hold could\n // ever run for it. Two authorities on one row also means two answers to \"when does this go\".\n const ttlFields = collectRowTtlPolicies(effectiveMainSchema).map((policy) => policy.fieldName);\n if (ttlFields.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] declares BOTH retentionBinding (${retentionBinding.retentionClass}) and .ttl() on ` +\n `[${ttlFields.join(', ')}]. One row takes one retention authority: remove the .ttl() and let the class ` +\n `period apply (the retention sweep deletes through the service layer, so cascades, files and RAG chunks ` +\n `go with the row), or drop retentionBinding if this is framework plumbing that holds no business data.`\n );\n }\n\n const namesClosureField = retentionBinding.closureFieldName !== undefined;\n const isClosureEvent = retentionBinding.startPoint === RetentionStartPoint.CLOSURE_EVENT;\n if (isClosureEvent !== namesClosureField) {\n throw createConfigurationError(\n isClosureEvent\n ? `[${resourceIdentifier}] retentionBinding.startPoint CLOSURE_EVENT requires closureFieldName: the date field ` +\n `whose value is the closure instant. While it is null the row never expires.`\n : `[${resourceIdentifier}] retentionBinding.closureFieldName is only meaningful with startPoint CLOSURE_EVENT ` +\n `(got ${retentionBinding.startPoint}). Remove it, or use CLOSURE_EVENT.`\n );\n }\n\n if (retentionBinding.startPoint === RetentionStartPoint.SCOPE_DELETED) {\n // The clock is the ORGANIZATION's deletion, so the row must name an organization.\n if (!bindingShape.organizationId) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding.startPoint SCOPE_DELETED counts from the row's organization being ` +\n `marked for deletion, but this resource has no organizationId field. Use CREATED, LAST_UPDATED or CLOSURE_EVENT.`\n );\n }\n if (bindingShape[RETENTION_STARTED_AT_FIELD_NAME]) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding SCOPE_DELETED injects a reserved '${RETENTION_STARTED_AT_FIELD_NAME}' ` +\n `field, but this resource already declares one. Rename that field (the retention clock is factory-injected).`\n );\n }\n // The ONE stored retention instant. Nothing on the row records when its organization was marked,\n // and the organization row itself is destroyed by the purge, so the purge stamps it here first.\n // Server-owned in every direction: no caller can author it on create or update, it never leaves the\n // backend, and it is indexed because the sweep queries it on every run.\n effectiveMainSchema = (effectiveMainSchema as any).extend({\n [RETENTION_STARTED_AT_FIELD_NAME]: z.date()\n .optional()\n .isDBIndexed()\n .excludeFromCreate()\n .excludeFromUpdate()\n .isBackendOnly()\n .isHidden(),\n }) as TMainSchema;\n } else {\n // Every other start point READS an instant the row already carries, so that field must exist,\n // be a date, and — for the closure field the author chose — be indexed (the sweep queries it on\n // every run). `createdAt`/`updatedAt` are indexed by convention and maintained by both adapters.\n const startFieldName = resolveRetentionStartFieldName(retentionBinding);\n const startFieldSchema = bindingShape[startFieldName];\n if (!startFieldSchema || getZodType(unwrapSchema(startFieldSchema)) !== 'date') {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding.startPoint ${retentionBinding.startPoint} reads the row's ` +\n `'${startFieldName}', which must be a date field of this resource${startFieldSchema ? ' (it is not a date)' : ' (it does not exist)'}.` +\n (isClosureEvent ? ' Name a z.date() field that is set when the record closes.' : ` Declare ${startFieldName}: z.date() on the schema.`)\n );\n }\n if (isClosureEvent && !isDBIndexed(startFieldSchema)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding closure field '${startFieldName}' must be .isDBIndexed(): the ` +\n `retention sweep selects expired rows by it on every run, and an unindexed scan grows with the table.`\n );\n }\n }\n }\n\n // ========================================\n // retentionPolicy.statutoryRetention (#1635 — a statute keeps the row through an erasure)\n // ========================================\n //\n // Read AFTER both axes above are resolved, because every rule here is a relation BETWEEN them: the\n // ground lives on the erasure treatment (`retentionPolicy`), and the period it lasts for lives on the\n // binding (`retentionBinding`). Each refusal names the declaration that would make it true.\n //\n // assurance-control: WILDO.PRIVACY.STORAGE_LIMITATION — a row kept through an erasure on a statutory ground\n // must be bound to the period that ground lasts for, and to a start point whose clock a restricted row can reach.\n const statutoryRetention = retentionPolicy?.mode ? retentionPolicy.statutoryRetention : undefined;\n if (retentionBinding?.retentionClass === DataRetentionClass.BUSINESS_RECORDS && !statutoryRetention) {\n // Invariant 1 of #1635. A BUSINESS_RECORDS row is kept because the law says so; without the ground an\n // erasure would treat it as the author's choice (or, with no retentionPolicy at all, reach it through the\n // delete cascade's default) and could not tell the data subject why it was kept or until when.\n throw createConfigurationError(\n `[${resourceIdentifier}] binds retention class BUSINESS_RECORDS, whose period is a statutory minimum, but declares no ` +\n `retentionPolicy.statutoryRetention. Declare retentionPolicy: { mode, statutoryRetention: { ground: ` +\n `StatutoryRetentionGround.LEGAL_OBLIGATION, rationale: '<the statute>' } } (and a dataSubjectPolicy), so a subject ` +\n `erasure RESTRICTS these rows until their period ends instead of deleting records the law requires kept. If no ` +\n `statute applies, bind RESOURCE_DATA instead.`\n );\n }\n if (statutoryRetention) {\n if (!Object.values(StatutoryRetentionGround).includes(statutoryRetention.ground)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy.statutoryRetention.ground '${String(statutoryRetention.ground)}' is not a ` +\n `StatutoryRetentionGround (${Object.values(StatutoryRetentionGround).join(', ')}).`\n );\n }\n if (typeof statutoryRetention.rationale !== 'string' || statutoryRetention.rationale.trim().length === 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy.statutoryRetention.rationale is empty. Name the statute that requires these ` +\n `rows kept — an operator answering a data subject has to be able to say which law, and a ground with no law named ` +\n `is a claim nobody can check.`\n );\n }\n if (retentionBinding?.retentionClass !== DataRetentionClass.BUSINESS_RECORDS) {\n // The PERIOD the ground lasts for is the BUSINESS_RECORDS class period: without that binding there is no end,\n // and a statutory ground with no end is a standing retention nobody decided.\n throw createConfigurationError(\n `[${resourceIdentifier}] declares retentionPolicy.statutoryRetention but ${retentionBinding ? `binds ${retentionBinding.retentionClass}` : 'declares no retentionBinding'}. ` +\n `A statutory ground lasts for the statutory period, which is dataRetention[BUSINESS_RECORDS]: bind ` +\n `retentionBinding: { retentionClass: DataRetentionClass.BUSINESS_RECORDS, startPoint: RetentionStartPoint.END_OF_CALENDAR_YEAR }.`\n );\n }\n if (retentionBinding.startPoint === RetentionStartPoint.CLOSURE_EVENT || retentionBinding.startPoint === RetentionStartPoint.LAST_UPDATED) {\n // Both clocks are ones a RESTRICTED row cannot keep honestly. A restricted row is frozen — every ordinary write is\n // refused — so a CLOSURE_EVENT row that is still open when its subject is erased can never be closed, and would be\n // kept forever. And the restriction is itself a write, which moves `updatedAt`, so a LAST_UPDATED clock would be\n // RESTARTED by the very erasure that reports when it ends. Neither is how a statute counts: HGB §257(5) and\n // AO §147(4) count from the end of the calendar year.\n throw createConfigurationError(\n `[${resourceIdentifier}] declares retentionPolicy.statutoryRetention with retentionBinding.startPoint ` +\n `${retentionBinding.startPoint}, a clock a restricted row cannot keep: ` +\n (retentionBinding.startPoint === RetentionStartPoint.CLOSURE_EVENT\n ? `an erasure freezes the row, so a record still open when its subject is erased could never be closed and would be kept forever. `\n : `the restriction write moves updatedAt, so the erasure would restart the period it reports. `) +\n `Use END_OF_CALENDAR_YEAR (how commercial and tax statutes count), CREATED, or SCOPE_DELETED.`\n );\n }\n }\n\n // ── dataSubjectPolicy: WHO the row is, and whose session an erasure ends ──────────────────────\n //\n // Placed AFTER the retention operation contract on purpose: a config can be wrong in several ways\n // at once, and the contract's errors are the more specific ones (\"declare UPDATE_MANY\", \"rename\n // your reserved field\"). Running this first masked them, so an author fixing a missing operation\n // was told to declare a data-subject policy instead.\n //\n // Paired with `retentionPolicy` in BOTH directions, because a retention-governed resource is\n // exactly one that `eraseSubjectAsSystem` accepts as a subject (the orchestrator refuses a subject\n // with no retention policy), and a `dataSubjectPolicy` on anything else describes an erasure that\n // can never happen.\n //\n // Undeclared is REFUSED rather than defaulted: there is no safe default. Assuming\n // NO_PRINCIPAL would silently drop a real person's session revocation; assuming a linked\n // principal would revoke whoever a user foreign key happens to name — on `TODOS` that is the\n // author, the assignee and the escalation contact, none of whom is the data subject. Refusing is\n // what forces the decision, matching the subject-EXPORT model's treatment of an undeclared resource.\n if (retentionPolicy?.mode && !dataSubjectPolicy) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires a dataSubjectPolicy. A retention-governed ` +\n `resource can be passed to eraseSubjectAsSystem as a data subject, so it must declare WHOSE ` +\n `SESSION an erasure ends: ResourceDataSubjectKind.NO_PRINCIPAL (nobody's — either an ordinary ` +\n `record whose user foreign keys name actors rather than the subject, OR a person with no ` +\n `account such as a CRM contact or a lead), SELF_PRINCIPAL (the row is the person and its own ` +\n `id is the session principal), or LINKED_PRINCIPAL with sessionPrincipalField (the person ` +\n `signs in as a different USERS row). Note this is NOT \"is the row about a person\" — that is ` +\n `answered by retentionPolicy.mode. This is never inferred from a user foreign key — doing so ` +\n `would revoke the sessions of owners and assignees instead of the subject.`\n );\n }\n if (dataSubjectPolicy && !retentionPolicy?.mode) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy requires retentionPolicy. Without one this resource ` +\n `can never be an erasure subject (eraseSubjectAsSystem refuses a subject that is not ` +\n `retention-governed), so the declaration would describe an erasure that cannot happen.`\n );\n }\n if (dataSubjectPolicy) {\n const namesPrincipalField = dataSubjectPolicy.kind === ResourceDataSubjectKind.LINKED_PRINCIPAL;\n if (namesPrincipalField && !dataSubjectPolicy.sessionPrincipalField) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy.kind = LINKED_PRINCIPAL requires ` +\n `sessionPrincipalField — the field naming the USERS row whose session an erasure of this row ` +\n `must end. Without it the erasure has no principal to revoke and the declaration would be inert.`\n );\n }\n if (!namesPrincipalField && dataSubjectPolicy.sessionPrincipalField) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy.sessionPrincipalField is only valid under ` +\n `kind = LINKED_PRINCIPAL (got '${dataSubjectPolicy.kind}'). Under SELF_PRINCIPAL the row's own ` +\n `id IS the principal, and under NO_PRINCIPAL there is no principal at all — so naming a ` +\n `field here is a contradiction, not a redundancy.`\n );\n }\n // The named link must not ALSO be scrubbed. This is a COHERENCE guard, not a prerequisite of the\n // revocation: the principal is resolved BEFORE the scrub (a post-commit read is impossible — the\n // row is RETAINED and hidden by then, and the only see-through door demands a privileged human),\n // so a scrubbed field would still be readable when it matters. It is refused because declaring one\n // field to be BOTH the link to a person and personal data to destroy is a contradiction, and it\n // leaves the retained row unable to say whose session was ended.\n //\n // Derived from the WRITER (`buildImpersonalizeScrubPatch`) rather than from a treatment count —\n // the same discipline the zero-scrub guard uses, because only the writer knows which declarations\n // actually produce a scrub.\n if (namesPrincipalField && mainSchema instanceof z.ZodObject) {\n const principalField = dataSubjectPolicy.sessionPrincipalField as string;\n if (!(principalField in (mainSchema.shape as Record<string, unknown>))) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy.sessionPrincipalField = '${principalField}' is not ` +\n `a top-level field of this resource's mainSchema.`\n );\n }\n if (principalField in buildImpersonalizeScrubPatch(mainSchema)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy.sessionPrincipalField = '${principalField}' is ` +\n `SCRUBBED by the erasure (it carries an .impersonalizeWith() treatment the writer acts on). A ` +\n `field cannot be both the link naming this person's login and personal data to destroy — the ` +\n `retained row would be left unable to say whose session was ended. Remove the treatment from ` +\n `that field (a user id is a link, not personal data of this row) or name a different field.`\n );\n }\n }\n\n // The system LIST grant the principal lookup needs.\n //\n // `eraseSubjectAsSystem` resolves the principal by reading the subject rows through\n // `listAsSystem`, which fail-closes on `systemAccessPolicy.list`. The retention derivation grants\n // only `updateMany` + `seeRetained`, and an unauthored policy is all-verbs-FORBIDDEN — so without\n // this the lookup would throw, be swallowed as best-effort, resolve to NO principals, and the\n // erased person's session would quietly survive. That is the exact failure this whole capability\n // exists to close, so the grant is derived from the declaration that requires it.\n //\n // Reads the RAW authored policy (`params.systemAccessPolicy`) — an unauthored policy defaults to\n // all-verbs-FORBIDDEN, and deriving THAT to ALLOWED is the intended common case.\n //\n // Scoped to LINKED_PRINCIPAL deliberately: SELF_PRINCIPAL needs no read (the subject ids ARE the\n // user ids) and NO_PRINCIPAL reads nothing at all, so neither earns a widened system surface.\n if (namesPrincipalField) {\n if (params.systemAccessPolicy?.list === ResourceSystemAccessMode.FORBIDDEN) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy.kind = LINKED_PRINCIPAL requires ` +\n `systemAccessPolicy.list = ALLOWED (the erasure reads the subject rows to resolve the session ` +\n `principal), but this resource explicitly authored list: FORBIDDEN. Remove it (the grant is ` +\n `derived automatically) or declare a different dataSubjectPolicy.kind.`\n );\n }\n effectiveSystemAccessPolicy = {\n ...effectiveSystemAccessPolicy,\n list: ResourceSystemAccessMode.ALLOWED,\n };\n }\n }\n\n // ========================================\n // DATA-CATEGORY VOCABULARY VALIDATION\n // ========================================\n //\n // `.dataCategories()` stores opaque strings: `zod-decorators` sits BELOW this package and cannot\n // import `PersonalDataCategory`, so its chokepoint can only check that non-empty strings were\n // declared. This is the layer that owns the enum, so this is where membership is checked.\n //\n // UNCONDITIONAL, unlike the impersonalize guards above — those run only inside `retentionPolicy`\n // because a treatment is meaningless without one. A data category is meaningful on any resource:\n // a hard-deleted resource still HOLDS personal data while it exists, and a privacy notice must\n // enumerate it. Gating this on retentionPolicy would silently exempt exactly the resources that\n // opted out of retention.\n //\n // A typo'd category is worse than an undeclared one and that is why this is a BOOT ERROR rather\n // than a warning: `'contact_details'` (underscore) is not a member, so the field would be counted\n // as CATEGORIZED by the gap report — it carries a declaration — while contributing nothing to the\n // notice's category list. The field disappears from the inventory while looking annotated in the\n // schema, which is the failure this whole capability exists to prevent.\n //\n // TOP-LEVEL fields only, deliberately matching `resolveResourcePersonalDataCategories`: a nested\n // declaration is invisible to the reader, so validating it here would certify a value nothing\n // consumes. Unlike a nested `.impersonalizeWith()` — which is a boot error because the row would\n // flip to RETAINED with the field intact — a nested category breaks nothing at runtime; it simply\n // never reaches a notice.\n /*\n * ENGINE-INJECTED ANCHORS on a read-through resource (#1058 R7).\n *\n * ## What is being injected, and why an author cannot declare it\n *\n * A VIRTUAL resource's schema describes the REMOTE entity. Every field in it comes from the\n * target, and there is no local row — which is exactly why such a resource may carry no field of\n * ours, no file and no retrieval corpus. So the two anchors the engine needs have nowhere to be\n * authored:\n *\n * - `organizationId` — the application's OWNER organization, stamped onto every projected row\n * (#1055 §6). The engine's per-row tenant gate reads it; without it, every read answered\n * `row_carries_no_tenant_anchor`;\n * - `organizationUnitId` — the ORGANIZATION UNIT owning the row's remote PARTITION (#1058 §3),\n * and the field `READ_THROUGH_ORGANIZATION_UNIT_FIELD_NAME` names as this resource's derived\n * `unitFieldName`.\n *\n * Both were already WRITTEN by the projector before this. What they lacked was a declared place:\n * the resource's own contract, its specification and its OpenAPI knew nothing of two fields every\n * served row carries. `billable-services.schemas.ts` names that gap as this slice's, and this is\n * it — the declaration, not the stamp.\n *\n * ## Required vs optional, which is a statement about the rows\n *\n * `organizationId` is REQUIRED: a row that reaches a caller always has one, because the repository\n * refuses with `OWNER_ORGANIZATION_ABSENT` before serving anything when there is no owner.\n *\n * `organizationUnitId` is OPTIONAL, and that is not caution. Two kinds of row genuinely have no\n * unit — a SHARED row whose partition field is unset (E2, an Odoo product belonging to no company)\n * and a row of a partition no operator has assigned (E3). Declaring it required would make both\n * states illegal in a contract that serves them.\n *\n * ## Neither can be changed, and only the unit can be NAMED — on a create (#1679)\n *\n * `organizationId` is excluded from CREATE and UPDATE, for the reason the pipeline lane states about\n * its own tenant stamp: a caller who could send it could hand rows to another organization, and one\n * who could update it could move them. The owner is the application's, never a caller's.\n *\n * `organizationUnitId` is excluded from UPDATE for the same reason — a row's partition never moves —\n * and is ADMITTED on CREATE, because on a writable resource it is how a caller says which unit's\n * partition a new row belongs to. It is never sent to the remote system: the repository resolves the\n * unit to its assigned partition key, checks it against the caller's grant, and writes the PARTITION\n * field itself (#1679). A member confined to one unit need not send it at all; an organization-wide\n * caller, or a member of several units, must. On a resource with no CREATE operation the admission is\n * inert, since there is no create DTO for it to appear in.\n */\n if (persistenceAdapter === PersistenceAdapter.HTTP_API) {\n // EXPLICIT object check, for the reason the retention injection above records: `getZodObjectShape`\n // returns `{}` for a union, so a try/catch around it is dead code and the real failure surfaces\n // later as an undiagnosable `extend is not a function`.\n if (!isZodObject(effectiveMainSchema)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] persistenceAdapter 'http-api' injects the '${HTTP_API_ENGINE_INJECTED_FIELDS.join(\"' and '\")}' `\n + 'anchors, which requires a ZodObject mainSchema — polymorphic/union mainSchemas are not supported on a '\n + 'read-through resource.'\n );\n }\n\n const httpApiShape = getZodObjectShape(effectiveMainSchema);\n for (const injectedField of HTTP_API_ENGINE_INJECTED_FIELDS) {\n /*\n * Zod-4 `.extend()` SILENTLY OVERWRITES a duplicate key, so an author's own field would be\n * clobbered rather than reported. Refused for a second reason too: the engine stamps this field\n * on every projected row regardless, so an authored one could never be the value served — it\n * would be a declaration the author can read in their own schema and never observe taking\n * effect.\n */\n if (httpApiShape[injectedField]) {\n throw createConfigurationError(\n `[${resourceIdentifier}] declares '${injectedField}', which the engine INJECTS on every http-api resource and `\n + 'STAMPS on every projected row. An authored field of that name is never the value served — remove it.'\n );\n }\n\n /*\n * And nothing in the BINDING may target them either.\n *\n * The projector applies both stamps LAST, so a mapping onto one is inert rather than dangerous\n * — which is precisely why it must be refused here. An authoring mistake that silently does\n * nothing is worse than one that fails: the author reads a declaration that looks like it\n * decides the tenant, and no run ever disagrees with them.\n *\n * This refusal is what the projector's own comment has claimed since #1055. It did not exist —\n * measured 2026-09-18 across `saas-models`, `saas-backend-lib` and `saas-specifications`, where\n * the only mapping-target refusals were the external-data PIPELINE's. It matters more now than\n * it did then: before this block the fields were undeclared, so an author had no reason to\n * think of them; declaring them is what makes mapping onto one a thing somebody would try.\n */\n if (resolvedHttpApiBinding?.fieldMappings.some((mapping) => mapping.localField === injectedField)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] httpApiBinding maps a remote field onto '${injectedField}', which the engine stamps `\n + 'after every mapping. The mapping can never take effect — remove it.'\n );\n }\n if (resolvedHttpApiBinding?.keyFields.some((keyField) => keyField.localField === injectedField)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] httpApiBinding declares a key component landing on '${injectedField}', which the engine `\n + 'stamps after every key component. Name a different localField.'\n );\n }\n }\n\n effectiveMainSchema = (effectiveMainSchema as any).extend({\n /*\n * `.isDBIndexed().isForeignKey()` on the tenant anchor, and the reason is a MEASUREMENT rather\n * than a convention.\n *\n * The SQL planner plans a table for an http-api resource today, and before this injection it\n * derived the tenant column — WITH its index — from the primary-scope relationship. A bare\n * `z.string()` here takes precedence over that derivation, so the first `wildo db diff` after\n * the injection reported `DROP_INDEX organizationId` on Wonder Todos: a declared field\n * silently replacing a derived one, and dropping its index on the way past.\n *\n * These decorators restore the plan the relationship produced. They are also what\n * `resource-schema-awareness.md` requires of every `organizationId` in an application's own\n * schema, so the injected field now matches what an author would have had to write.\n */\n [HTTP_API_TENANT_ANCHOR_FIELD]: z.string()\n .isDBIndexed()\n .isForeignKey()\n .excludeFromCreate()\n .excludeFromUpdate(),\n /*\n * NOT indexed, deliberately. A read-through resource has no local row, so nothing ever queries\n * this table by unit — the confinement is a predicate pushed to the REMOTE, in the remote's own\n * partition key. An index here would cost a migration on every PostgreSQL-backed surface to\n * serve a query that cannot be issued.\n */\n [READ_THROUGH_ORGANIZATION_UNIT_FIELD_NAME]: z.string()\n .optional()\n .excludeFromUpdate()\n // Described here because no application authors this field (#1625): every read-through resource gets it.\n .describe('The organization unit that owns the part of the external system this record lives in. Absent for a record every unit shares, or one in a part no unit has been assigned. On a create it names the unit the new record goes to; it never changes afterwards.'),\n }) as TMainSchema;\n }\n\n if (isZodObject(effectiveMainSchema)) {\n for (const [fieldName, fieldSchema] of Object.entries(getZodObjectShape(effectiveMainSchema))) {\n const declared = getDataCategories(fieldSchema as z.ZodTypeAny);\n if (declared === undefined) continue;\n const unknownCategories = unknownPersonalDataCategories(declared);\n if (unknownCategories.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] field '${fieldName}' declares data categor${unknownCategories.length === 1 ? 'y' : 'ies'} ` +\n `[${unknownCategories.join(', ')}] that ${unknownCategories.length === 1 ? 'is' : 'are'} not a PersonalDataCategory member. ` +\n `A value outside the vocabulary counts the field as CATEGORIZED — so it is excluded from the ` +\n `uncategorized-field gap report — while contributing nothing to the privacy notice's category list. ` +\n `Use a PersonalDataCategory member, or drop the declaration if the field holds no personal data.`\n );\n }\n }\n }\n\n // ========================================\n // TRANSFORM RESOURCE RELATIONSHIPS\n // ========================================\n\n const { processedResourceRelationships, availableParentResourceTypes } = transformResourceRelationships(effectiveResourceRelationships, resourceIdentifier);\n\n // ========================================\n // DERIVE SUMMARY SCHEMA FROM isSummaryField DECORATORS\n // ========================================\n\n // Auto-derive summary schema for LIST/SEARCH operations from isSummaryField decorators\n // This replaces manual responseSummaryDto definitions\n // Must be computed BEFORE operations loop so LIST operations can use it\n const derivedSummarySchema = inheritenceSchemaDefinition\n ? ResourcesSummaryUtils.deriveSummarySchemaForDiscriminatedUnion(\n effectiveMainSchema as unknown as z.ZodObject<z.ZodRawShape>,\n inheritenceSchemaDefinition as unknown as ResourceConfiguration_InheritanceSchemaDefinition<any, z.ZodObject<z.ZodRawShape>>\n )\n : ResourcesSummaryUtils.deriveSummarySchema(effectiveMainSchema);\n\n // ========================================\n // FLATTEN OPERATIONS AND SEARCHABLE CONFIGURATIONS\n // ========================================\n\n const operations: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>[] = [];\n\n // Extract autoVariants config (default all true)\n const autoVariants = params.autoVariants || {};\n const autoVariantsRead = autoVariants.read || {};\n const autoVariantsList = autoVariants.list || {};\n const enableReadSummary = autoVariantsRead.enableSummary !== false; // default true\n const enableReadContext = autoVariantsRead.enableContext !== false; // default true\n const enableListSummary = autoVariantsList.enableSummary !== false; // default true\n const enableListContext = autoVariantsList.enableContext !== false; // default true\n\n // Process operation configurations\n for (const [operation, config] of Object.entries(operationsConfiguration) as [ValidOperationKeys<TCustomOperationEnum, TCoreOperationEnum>, ResourceConfiguration_Operation_BuilderParameters<TMainSchema>][]) {\n assertOperationPathKeySegment(String(operation), 'operation identifier', String(operation));\n\n // Validate isDefault logic by grouping variants by their variantType\n const variantsByType = new Map<ResourceOperationVariantType, ResourceConfiguration_OperationVariant_BuilderParameters<TMainSchema>[]>();\n\n // Group variants by their type\n config.variants.forEach(variant => {\n if (!variantsByType.has(variant.variantType)) {\n variantsByType.set(variant.variantType, []);\n }\n variantsByType.get(variant.variantType)!.push(variant);\n });\n\n // Validate each variant type group. URL-bearing variants form a shared\n // operation identity space (`API_CALL` and `API_CALL_WITH_CALLBACK` are\n // both selected by operation/default/key at many call sites), so their\n // default/key invariants are validated as one combined group below.\n for (const [variantType, variantsGroup] of variantsByType.entries()) {\n if (!isUrlisableOperationVariantType(variantType) && variantsGroup.length > 1) {\n const explicitDefaults = variantsGroup.filter((variant) =>\n variant.isDefault === true\n );\n if (explicitDefaults.length === 0) {\n throw createConfigurationError(`Operation '${operation}' with multiple ${variantType} variants must have at least one with isDefault=true`);\n }\n if (explicitDefaults.length > 1) {\n throw createConfigurationError(`Operation '${operation}' with multiple ${variantType} variants cannot declare more than one with isDefault=true`);\n }\n }\n\n if (isUrlisableOperationVariantType(variantType)) {\n for (const variant of variantsGroup) {\n // 🔒 Fail-closed guard: a URL-bearing variant with an EMPTY roles array\n // is not \"skip the role check\" — it is a guaranteed 403. The runtime gate\n // (`AuthorizationsBackendService.validateOperationRoles`) evaluates\n // `roles.some(...)`, and `[].some()` is always false, so EVERY caller is\n // denied. There is no legitimate empty-roles URL operation: public ops use\n // `APP_PUBLIC`, anonymous ops use `APP_ANONYMOUS`, user-self ops use\n // `APP_USER` (row ownership is enforced separately by the scope authorizer).\n // Catch the mistake at config-build time instead of shipping a dead endpoint.\n // (INTERNAL_CALL / REPOSITORY_ONLY variants are exempt — not URL-bearing, so\n // this loop never sees them; their empty roles are inert.)\n if (!variant.roles || variant.roles.length === 0) {\n throw createConfigurationError(\n `Operation '${operation}' has a URL-bearing (${variantType}) variant with an empty roles array. ` +\n `An empty roles array is fail-CLOSED: the authorization gate evaluates roles.some(...), which is ` +\n `always false for [], so every caller is denied (403). Specify at least one role — e.g. ` +\n `CORE_APP_ROLES.APP_USER (user-self / any authenticated user), CORE_APP_ROLES.APP_PUBLIC (public), ` +\n `CORE_APP_ROLES.APP_ANONYMOUS (anonymous), or the appropriate ORG/APP role.`,\n );\n }\n if (variant.variantKey) {\n assertOperationPathKeySegment(variant.variantKey, 'variantKey', String(operation));\n }\n if (variant.variantKey && RESERVED_OPERATION_VARIANT_KEYS.has(variant.variantKey.toLowerCase())) {\n throw createConfigurationError(\n `Operation '${operation}' cannot use reserved variantKey '${variant.variantKey}'`,\n );\n }\n if (variant.variantKey && AUTO_OPERATION_VARIANT_KEYS.has(variant.variantKey.toLowerCase() as typeof OPERATION_VARIANT_KEY.SUMMARY | typeof OPERATION_VARIANT_KEY.CONTEXT)\n && variant.variantKey !== variant.variantKey.toLowerCase()\n ) {\n throw createConfigurationError(\n `Operation '${operation}' must use canonical lowercase variantKey '${variant.variantKey.toLowerCase()}' for generated variant semantics`,\n );\n }\n if (variant.variantKey && AUTO_OPERATION_VARIANT_KEYS.has(variant.variantKey.toLowerCase() as typeof OPERATION_VARIANT_KEY.SUMMARY | typeof OPERATION_VARIANT_KEY.CONTEXT)\n && !isDataModeVariantKeyAllowedForOperation(String(operation), variant)\n ) {\n throw createConfigurationError(\n `Operation '${operation}' cannot use data-mode variantKey '${variant.variantKey}' unless it is READ, LIST, or SEARCH-like`,\n );\n }\n }\n }\n }\n\n const urlisableVariants = config.variants.filter((variant) => isUrlisableOperationVariantType(variant.variantType));\n const explicitUrlisableDefaults = urlisableVariants.filter((variant) => variant.isDefault === true);\n if (urlisableVariants.length > 1) {\n if (explicitUrlisableDefaults.length === 0) {\n throw createConfigurationError(\n `Operation '${operation}' with multiple URL-bearing variants must have exactly one with isDefault=true`,\n );\n }\n if (explicitUrlisableDefaults.length > 1) {\n throw createConfigurationError(\n `Operation '${operation}' cannot declare more than one default URL-bearing variant across API_CALL and API_CALL_WITH_CALLBACK`,\n );\n }\n }\n // A single URL-bearing variant is the URL default UNLESS the author explicitly set\n // `isDefault: false` — mirrors `determineOperationVariantDefault` Rule 1 so the stored\n // `isOperationDefault` flag and this validation set never disagree. When the opt-out is\n // honored, the sole `isDefault: false` URL variant is treated as non-default here, which\n // correctly routes it through the \"non-default URL-bearing variant must declare a\n // variantKey\" check below — a sole opted-out URL variant with no variantKey would\n // otherwise be unresolvable by BOTH the default and the keyed path resolver.\n const urlisableDefaultVariants = urlisableVariants.length === 1\n ? urlisableVariants.filter((variant) => variant.isDefault !== false)\n : explicitUrlisableDefaults;\n\n const urlisableVariantKeys = new Set<string>();\n for (const variant of urlisableVariants) {\n const willBeDefault = urlisableDefaultVariants.includes(variant);\n\n if (variant.variantKey) {\n const normalizedVariantKey = variant.variantKey.toLowerCase();\n if (urlisableVariantKeys.has(normalizedVariantKey)) {\n throw createConfigurationError(\n `Operation '${operation}' cannot reuse variantKey '${variant.variantKey}' across URL-bearing variants`,\n );\n }\n urlisableVariantKeys.add(normalizedVariantKey);\n }\n\n if (willBeDefault) {\n continue;\n }\n\n if (!variant.variantKey) {\n throw createConfigurationError(\n `Operation '${operation}' cannot declare a non-default URL-bearing variant without a variantKey`,\n );\n }\n\n }\n\n // Process parent resource access scope strategy overrides for this operation\n const operationResourceRelationships = processParentResourceAccessScopeStrategyOverrides(\n processedResourceRelationships,\n availableParentResourceTypes,\n config.parentResourceAccessScopeStrategyOverrides || [],\n operation as string\n );\n\n // Process user notifications using helper function\n const userNotifications = processUserNotifications(\n config.userNotifications || [],\n resourceIdentifier,\n operation,\n resourcePrimaryScope\n );\n\n // Process m2mNotifications using helper function\n const m2mNotifications = processM2MNotifications(\n config.m2mNotifications || [],\n resourceIdentifier,\n operation\n );\n\n // Parse once so partial authored policies keep defaults and every variant shares the same policy.\n const queueConfig = ResourceConfiguration_QueueConfigSchema.parse(config.queueConfig);\n\n // Process each variant to create flattened operations\n config.variants.forEach((variantParams, variantIndex) => {\n // Note: Cascading delete is now handled via childOperations.lifecycle.onParentDelete on relationships\n // No longer processed at operation variant level\n\n // Determine if this variant is the operation default. URL-bearing\n // variants share one default/key identity space across API and callback\n // transports; non-URL transports keep variant-type-local defaults.\n const variantsOfSameType = variantsByType.get(variantParams.variantType) || [];\n const isOperationDefault = isUrlisableOperationVariantType(variantParams.variantType)\n ? determineOperationVariantDefault(urlisableVariants, variantParams)\n : determineOperationVariantDefault(variantsOfSameType, variantParams);\n\n // Determine effective operation for DTO derivation\n // For custom operations, use resourceOperationLike if it maps to CREATE or UPDATE\n const isCustomOperation = !coreOperations.includes(operation as any);\n const effectiveOperationForDto = isCustomOperation\n ? (variantParams.resourceOperationLike || operation)\n : operation;\n\n // ── Dev-time guardrail: custom op borrowing a NON-object envelope verb ──\n // A custom operation that borrows DELETE / DELETE_MANY / COUNT via\n // `resourceOperationLike` inherits that verb's DEFAULT response envelope\n // (`{ id }` / `{ deletedIds, deletedCount }` / `{ count }`) as\n // its responseDto AND internalDto. That envelope is almost never what a\n // custom op actually returns, so at runtime the service output fails\n // `transformOutput`'s `internalDto.parse` → HTTP 500\n // (`service_resource_transformation_failed`). Warn — do NOT throw: a custom\n // op that legitimately returns a bare id / `{ count }` is valid, so this is\n // a misconfiguration signal, not an invariant. Surfacing it at registry\n // build beats discovering it on first invocation.\n //\n // Scope note: this deliberately does NOT cover UPDATE / CREATE / READ\n // borrowing. Those verbs' default response IS the resource object, which is\n // correct for the many custom mutation ops that return the mutated entity —\n // a static check cannot tell those from the (rarer) ones that return a\n // non-resource shape (e.g. `{ url }`, `{ message }`). Those are guarded by\n // an authored `customResponseDto` + the built-operation DTO tests instead.\n if (isCustomOperation && !(variantParams as { customResponseDto?: unknown }).customResponseDto\n && (\n variantParams.resourceOperationLike === CoreResourceOperation.DELETE\n || variantParams.resourceOperationLike === CoreResourceOperation.DELETE_MANY\n || variantParams.resourceOperationLike === CoreResourceOperation.COUNT\n )\n ) {\n console.warn(\n `[wildo:resource-config] Custom operation \"${String(resourceIdentifier)}.${String(operation)}\" `\n + `borrows ${String(variantParams.resourceOperationLike)} via resourceOperationLike but declares no `\n + `customResponseDto. It will inherit that verb's default response envelope, which almost never `\n + `matches a custom operation's output and will fail output validation (HTTP 500) at invocation. `\n + `Declare a customResponseDto matching the operation's true return shape.`,\n );\n }\n\n // Auto-derive requestDto from decorators if not explicitly provided\n const derivedRequestDto = deriveRequestDto(\n effectiveOperationForDto as string,\n effectiveMainSchema,\n variantParams.requestDto\n );\n\n // Auto-derive responseDto based on operation type\n // - LIST: use derivedSummarySchema (only isSummaryField fields)\n // - READ/CREATE/UPDATE: use effectiveMainSchema (full object)\n // - DELETE: returns just the deleted ID (handled elsewhere)\n // - customResponseDto overrides if provided\n const deriveResponseDto = (): z.ZodTypeAny => {\n if ((variantParams as any).customResponseDto) {\n return (variantParams as any).customResponseDto;\n }\n if (operation === CoreResourceOperation.LIST\n || (variantParams as any).resourceOperationLike === CoreResourceOperation.LIST) {\n return derivedSummarySchema;\n }\n if (operation === CoreResourceOperation.SEARCH\n || (variantParams as any).resourceOperationLike === CoreResourceOperation.SEARCH) {\n return derivedSummarySchema;\n }\n return effectiveMainSchema;\n };\n\n // Derive the responseDto for this operation (temporary, will be replaced by buildAllOperationDtos)\n const operationResponseDto = deriveResponseDto();\n\n // Create base operation fields shared by all operation types\n // Note: DTOs (requestDto, responseDto, summaryDto, contextDto, internalDto, repositoryDto)\n // will be pre-computed by buildAllOperationDtos() after all operations are created.\n // We set temporary DTOs here for type compatibility, but they will be replaced.\n const baseOperationFields = {\n isDisabled: params.isDisabled ?? false,\n mainSchema: effectiveMainSchema,\n resourcePrimaryScope,\n resourceIdentifier,\n resourceFieldIdentifier,\n resourceRelationships: operationResourceRelationships,\n isSystemResource,\n operationIdentifier: operation,\n isOperationDefault,\n serviceRuntimeMode: config.serviceRuntimeMode || ResourceOperation_ServiceRuntimeMode.INLINE,\n queueConfig,\n requestDto: derivedRequestDto, // Temporary - will be replaced by buildAllOperationDtos\n responseDto: operationResponseDto, // Temporary - will be replaced by buildAllOperationDtos\n // When the variant supplied an explicit `requestDto`, it is an author-owned\n // contract the DTO builder must preserve verbatim. Otherwise `derivedRequestDto`\n // is an auto-derived TEMPORARY placeholder built from the base object (before\n // inheritance is known), so the builder must rebuild it — as a per-variant union\n // for inheritance resources. See `hasCustomRequestDto` in the operation schema.\n hasCustomRequestDto: !!(variantParams as any).requestDto,\n hasCustomResponseDto: !!(variantParams as any).customResponseDto,\n notificationBadgeOperations: config.notificationBadgeOperations || [],\n userNotifications,\n m2mNotifications,\n // Carried verbatim rather than normalized: it is one authored object with no derived\n // parts, unlike the notification families above, which the factory stamps with scope and\n // identifier. `undefined` means the operation consumes no metered product.\n recordsUsage: config.recordsUsage,\n // Same reasoning: one authored object, carried as-is. `undefined` means this operation\n // declares no purpose of its own beyond whatever `serviceConsentRequirement` already\n // requires application-wide (#1258 Step 3).\n consentGate: config.consentGate,\n // Fields from ResourceConfiguration_OperationVariant_Base\n variantType: variantParams.variantType,\n resourceOperationLike: variantParams.resourceOperationLike,\n generatedOperation: variantParams.generatedOperation,\n // Forwarded here rather than inside the collection-view enrichment below, which is an\n // explicit ALLOW-LIST reached only by LIST/SEARCH-shaped variants. Copying it there would\n // make a `collectionExport` declared on the wrong verb vanish silently; copying it here\n // lets it reach `createGeneratedCollectionExportOperations`, which refuses it by name.\n collectionExport: (variantParams as any).collectionExport,\n requiredFeatures: normalizeRequiredFeatures(variantParams.requiredFeatures),\n riskLevel: variantParams.riskLevel || ResourceOperationRiskLevel.LOW,\n // Undeclared stays undefined on purpose: `resolveOperationReversibility` derives the\n // answer from `resourceOperationLike` when the field is absent, so defaulting it here\n // would freeze the derivation at config time and make a DELETE added later look reversible.\n reversibility: variantParams.reversibility,\n // Forwarded for the same reason as the flags below: the frontend resources client reads it\n // off the RUNTIME operation, so dropping it here would leave a declared long-run timeout\n // silently unapplied and the 30s default cutting the request (issue #237).\n clientRequestTimeoutMs: variantParams.clientRequestTimeoutMs,\n roles: variantParams.roles,\n // Forwarded, not defaulted: the startup guard and the request-time refusal both read it\n // off the RUNTIME operation. This block re-lists variant fields rather than spreading\n // them, so a new variant field that is not added here is silently dropped between\n // authoring and runtime.\n unimplementedAcknowledgement: variantParams.unimplementedAcknowledgement,\n // Forwarded for the same reason: `enforceStepUpAuth` reads it off the RUNTIME operation, so\n // an unforwarded flag would leave the authored requirement silently unenforced — the exact\n // failure mode the flag exists to prevent.\n requiresStepUpAuthentication: variantParams.requiresStepUpAuthentication,\n // Forwarded for the same reason: the controller, the service tier and the frontend client all read it off the\n // RUNTIME operation, so an unforwarded declaration would refuse every keyed request as undeclared. On a\n // read-through WRITE it is DERIVED as REQUIRED (#1679): a remote write cannot be rolled back, so every retry\n // must replay the first outcome — see `resolveHttpApiWriteIdempotencyKeyRequirement`.\n idempotencyKey: resolveHttpApiWriteIdempotencyKeyRequirement(\n variantParams.idempotencyKey,\n persistenceAdapter === PersistenceAdapter.HTTP_API\n && resolveHttpApiWriteVerb(isCustomOperation ? (variantParams.resourceOperationLike ?? operation) : operation) !== undefined,\n ),\n // Forwarded for the same reason (#1985): `doOperation` asks the challenge off the RUNTIME operation, and the OpenAPI\n // projector documents the header from it. An unforwarded declaration would leave a public form unprotected while\n // its configuration says otherwise. A bulk twin inherits it with the rest of these fields.\n submissionChallenge: variantParams.submissionChallenge,\n admitsCrossTenantPlatformAdministration: variantParams.admitsCrossTenantPlatformAdministration,\n // Same forwarding obligation as its cross-tenant sibling: the authorizer reads this off the\n // RUNTIME operation, so dropping it here would silently re-close the admin surface.\n admitsCrossSubjectUserAdministration: variantParams.admitsCrossSubjectUserAdministration,\n // Third sibling, same forwarding obligation: the scope-root directory classification reads\n // this off the RUNTIME operation, so dropping it here would re-close a door whose declared\n // collection shape is the only thing that makes it safe (#1267).\n admitsSelfConfinedScopeRootWrite: variantParams.admitsSelfConfinedScopeRootWrite,\n // Forwarded for the same reason again: the post-commit audit emission reads it off the\n // RUNTIME operation. Dropping it would either lose an authored below-floor opt-in (a silent\n // audit gap) or lose an authored suppression (a duplicate row next to a purpose-built event).\n auditableEvent: variantParams.auditableEvent,\n mcp: variantParams.mcp,\n customServiceImplementationModes: variantParams.customServiceImplementationModes || [],\n basicPrefixOperation: variantParams.basicPrefixOperation,\n // Travels WITH `basicPrefixOperation` — it declares which of that hook's fields survive the\n // repository's strict re-parse even when the caller also sent them. Dropping it here would\n // silently reduce the hook to the added-key inference it exists to correct.\n authoritativeFields: variantParams.authoritativeFields,\n // Forwarded for the same reason as its siblings above: the write-integrity guard reads the\n // per-variant reference POLICY off the RUNTIME operation. Dropping it here degrades every\n // variant to the relationship's baseline membership — so an authored `qualifyingStatuses` /\n // `requiredRoles` / `false` would be silently inert while the config claims otherwise. (This\n // is not hypothetical: it shipped that way once, and the e2e caught it as a PENDING and a\n // REVOKED partnership both admitting a share.)\n referenceConstraints: variantParams.referenceConstraints,\n };\n\n\n\n assertSubmissionChallengeDeclaration(String(operation), variantParams.variantType, variantParams.submissionChallenge);\n\n if (isUrlisableOperationVariantType(variantParams.variantType)) {\n const apiCallParams = variantParams as ResourceConfiguration_OperationVariant_BuilderParameters<TMainSchema> & {\n variantType: ResourceOperationVariantType.API_CALL | ResourceOperationVariantType.API_CALL_WITH_CALLBACK\n };\n const isCallbackVariant = apiCallParams.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK;\n const callbackParams = apiCallParams as {\n callbackUrl?: string;\n callbackTimeout?: number;\n callbackRetryAttempts?: number;\n };\n\n // Determine if this is a custom operation and get the operation to check\n const isCustomOperation = !coreOperations.includes(operation as any);\n const operationToCheck = isCustomOperation ? apiCallParams.resourceOperationLike : operation;\n\n // Validate bulk operation business rules - check against the relevant operation\n const haveBulkOperation = apiCallParams.haveBulkOperation || false;\n if (haveBulkOperation && (operationToCheck === CoreResourceOperation.READ || operationToCheck === CoreResourceOperation.LIST)) {\n throw createConfigurationError(`Operation '${operation}' cannot have bulk operations (read and list are not bulkable)`);\n }\n /*\n * A bulk twin of CREATE has no coherent meaning, so it is refused rather than half-built (#1551).\n *\n * The twin keeps `operationIdentifier: 'create'`, so the controller, the service dispatcher and both\n * repositories route it to the SINGLE-row create; only the request DTO pretended otherwise, and this\n * factory and the DTO builder even disagreed on which pretence. Batch creation is CREATE_MANY, whose\n * request is the `{ data: row[] }` envelope its service reads. No authored resource declared a bulk\n * twin of CREATE when this refusal was added (22 `haveBulkOperation` declarations, all on DELETE or\n * UPDATE-like operations).\n */\n if (haveBulkOperation && operationToCheck === CoreResourceOperation.CREATE) {\n throw createConfigurationError(\n `Operation '${operation}' cannot have a bulk twin: every tier would run it as a single-row create. `\n + `Declare ${CoreResourceOperation.CREATE_MANY} for batch creation — its request is { data: row[] }.`,\n );\n }\n const tokenStateSideEffects = [\n ...(apiCallParams.tokenGeneration ? ['tokenGeneration'] : []),\n ...(apiCallParams.tokenRevocation ? ['tokenRevocation'] : []),\n ];\n if (\n tokenStateSideEffects.length > 0\n && (\n haveBulkOperation\n || isTokenStateEffectUnsupportedOperation(operationToCheck)\n )\n ) {\n throw createConfigurationError(\n `Operation '${operation}' cannot combine collection/bulk result semantics with ${tokenStateSideEffects.join(' and ')}. `\n + 'Token generation and revocation each require one canonical related resource state; collection, aggregate, and '\n + 'bulk operations do not expose a single related resource identity. Split the token side effect into a singular '\n + 'operation or remove the collection/bulk variant.',\n );\n }\n if (apiCallParams.tokenRevocation && operationToCheck === CoreResourceOperation.CREATE\n ) {\n throw createConfigurationError(\n `Operation '${operation}' cannot revoke tokens before a CREATE operation because no current resource state exists. `\n + 'Move token revocation to an operation that addresses an existing resource.',\n );\n }\n\n /*\n * (After the token-state checks, so a declaration that breaks both is told about the token rule too.)\n *\n * A client-facing core UPDATE_MANY or DELETE_MANY is a route that can never succeed, so it is refused\n * (#1793).\n *\n * This loop builds it as a NON-bulk operation (`isBulkOperation: false` below) mounted on the\n * collection path, and only a bulk operation has its selector lifted out of the body — `_ids` by the\n * service's `doOperation`, `_match` by the controller. So no request shape can reach\n * `updateMany` / `deleteMany` with a target, and the route answers every call with\n * `service_resource_validation_failed`. Measured on a running stack against an escalation-policy\n * collection before its variant moved: `{}`, `{ _ids: [...] }`, a filter and a field patch were all\n * refused, while GET on the same collection answered 200.\n *\n * The two working doors are named in the message: INTERNAL_CALL keeps the operation as the service\n * capability retention scrubs and anonymous-ownership transfer call with an explicit target, and a\n * `haveBulkOperation: true` variant on UPDATE / DELETE (or a custom operation) is the client bulk door,\n * with its selector, its max-selection limit and its place in the bulk bar. Scoped to the CORE\n * identifiers: a custom operation that borrows `resourceOperationLike: UPDATE_MANY` has its own request\n * and implementation and is unaffected. CREATE_MANY's `{ data: row[] }` form works and is untouched.\n */\n if (\n !isCustomOperation\n && (operation === CoreResourceOperation.UPDATE_MANY || operation === CoreResourceOperation.DELETE_MANY)\n ) {\n throw createConfigurationError(\n `Operation '${operation}' cannot be declared ${apiCallParams.variantType}: a client-facing core ${operation} is mounted `\n + 'as a non-bulk route, no selector ever reaches it, and it refuses every request. '\n + `Declare it ${ResourceOperationVariantType.INTERNAL_CALL} for a service-side capability, or give `\n + `${operation === CoreResourceOperation.UPDATE_MANY ? CoreResourceOperation.UPDATE : CoreResourceOperation.DELETE} `\n + 'a `haveBulkOperation: true` variant for a client bulk action.',\n );\n }\n\n // Determine HTTP verb - for custom operations, use resourceOperationLike\n let httpVerb: HttpMethod;\n if (isCustomOperation) {\n // For custom operations, resourceOperationLike is mandatory and we use its HTTP verb\n if (!apiCallParams.resourceOperationLike) {\n throw createConfigurationError(`Operation '${operation}' is a custom operation and must specify resourceOperationLike`);\n }\n httpVerb = getDefaultHttpVerbForOperation(apiCallParams.resourceOperationLike);\n } else {\n // For core operations, use the operation itself\n httpVerb = getDefaultHttpVerbForOperation(operation);\n }\n\n\n\n // ── Build-time validation for token configs ──\n if (apiCallParams.tokenGeneration) {\n validateTokenGenerationConfig(\n apiCallParams.tokenGeneration,\n resourceIdentifier as string,\n operation as string,\n );\n }\n if (apiCallParams.tokenRevocation) {\n validateTokenRevocationConfig(\n apiCallParams.tokenRevocation,\n resourceIdentifier as string,\n operation as string,\n );\n }\n if (apiCallParams.tokenAuthentication) {\n validateTokenAuthenticationConfig(\n apiCallParams.tokenAuthentication,\n resourceIdentifier as string,\n operation as string,\n );\n }\n\n const apiCallOperationFields = {\n ...baseOperationFields,\n httpVerb,\n isApiKeyAccessDisabled: apiCallParams.isApiKeyAccessDisabled || false,\n isBulkOperation: false, // Normal operation\n tokenAuthentication: apiCallParams.tokenAuthentication,\n tokenGeneration: apiCallParams.tokenGeneration,\n tokenRevocation: apiCallParams.tokenRevocation,\n // Per-endpoint rate-limit policy: forwarded from the\n // builder params to the resolved operation. Read at runtime by\n // `RateLimitBackendService.checkPolicyForVariant` at the controller\n // pre-flight seam. `undefined` means the global HTTP limiter is the\n // only gate for this route.\n rateLimit: apiCallParams.rateLimit,\n enabledCondition: apiCallParams.enabledCondition,\n isDefault: apiCallParams.isDefault,\n variantKey: apiCallParams.variantKey,\n ...(isCallbackVariant ? {\n callbackUrl: callbackParams.callbackUrl,\n callbackTimeout: callbackParams.callbackTimeout ?? 300,\n callbackRetryAttempts: callbackParams.callbackRetryAttempts ?? 3,\n } : {}),\n };\n\n // ── Collection-view enrichment ──────────────────────────────────\n // When an operation is SEARCH-like or LIST-like (by identity or resourceOperationLike),\n // extract collection-view fields from the variant params and compute derived schemas.\n const isSearchLike = operation === CoreResourceOperation.SEARCH\n || (variantParams as any).resourceOperationLike === CoreResourceOperation.SEARCH;\n const isListLike = operation === CoreResourceOperation.LIST\n || (variantParams as any).resourceOperationLike === CoreResourceOperation.LIST;\n\n if (isSearchLike || isListLike) {\n assertCollectionFieldsNameResourceFields({\n resourceIdentifier: String(resourceIdentifier),\n operationLabel: `operation \"${String(operation)}\"${apiCallParams.variantKey ? ` (variant \"${apiCallParams.variantKey}\")` : ''}`,\n schemaShape: getZodObjectShape(effectiveMainSchema) as Record<string, unknown>,\n filterFields: (variantParams as any).filterFields,\n sortFields: (variantParams as any).sortFields,\n searchableFields: isSearchLike ? (variantParams as any).searchableFields : undefined,\n });\n }\n\n if (isSearchLike) {\n const pageSize = (variantParams as any).pageSize ?? 20;\n const isSearchable = (variantParams as any).isSearchable !== false;\n const searchableFields = (variantParams as any).searchableFields || [];\n const searchableOptions = (variantParams as any).searchableOptions || { caseSensitive: false, fullMatchOnly: false };\n const rawFilterFields = (variantParams as any).filterFields || {};\n const sortFields = (variantParams as any).sortFields || [];\n const maxPaginatedResultPerPageLimit = (variantParams as any).maxPaginatedResultPerPageLimit || DEFAULT_SEARCH_PAGE_CEILING;\n\n // Every entry is a Zod type by now: `assertCollectionFieldsNameResourceFields` refused the\n // function-valued slot above.\n const filterFields = rawFilterFields as Record<string, PrimitiveZodType>;\n\n const searchQueryRequestSchema = createResourceSearchQueryRequestSchema({\n filterFields,\n allowedSortFields: sortFields,\n pagination: true,\n // The SAME value the response schema below is built from. That equality is the point:\n // request, repository and response must agree on one ceiling.\n maxPaginatedResultPerPageLimit\n });\n\n const paginatedResponseSchema = createResourcePaginatedResponseSchema({\n dataSchema: derivedSummarySchema,\n validateArrayConstraints: true,\n maxResultsPerPageLimit: maxPaginatedResultPerPageLimit\n });\n // An author's `customResponseDto` wins here exactly as it does for every other operation\n // (`deriveResponseDto` above). This block used to overwrite it with the generated schema and\n // stamp `hasCustomResponseDto: false`, so a searchable variant silently lost the contract it\n // declared — found when inbound deliveries declared one to keep the raw payload out of a page\n // (#1596). A custom DTO must carry the same page ceiling as this variant.\n const customSearchResponseDto = (variantParams as any).customResponseDto as z.ZodTypeAny | undefined;\n\n Object.assign(apiCallOperationFields, {\n pageSize,\n isSearchable,\n searchableFields,\n searchableOptions,\n filterFields: rawFilterFields,\n sortFields,\n maxPaginatedResultPerPageLimit,\n searchQueryRequestSchema,\n responseDto: customSearchResponseDto ?? paginatedResponseSchema,\n hasCustomResponseDto: customSearchResponseDto !== undefined,\n });\n }\n\n if (isListLike) {\n const listEnrichment: Record<string, unknown> = {\n pageSize: (variantParams as any).pageSize ?? 20,\n searchEnabled: (variantParams as any).searchEnabled ?? true,\n filtersEnabled: (variantParams as any).filtersEnabled ?? true,\n // LIST has one pagination authority. Keep the effective ceiling on the resolved\n // operation so request/response DTO construction, repositories, auto-generated\n // SUMMARY/CONTEXT variants and API-reference projection all observe the same value.\n maxPaginatedResultPerPageLimit: (variantParams as any).maxPaginatedResultPerPageLimit ?? DEFAULT_LIST_PAGE_CEILING,\n };\n if ((variantParams as any).filterFields !== undefined) {\n listEnrichment.filterFields = (variantParams as any).filterFields;\n }\n if ((variantParams as any).sortFields !== undefined) {\n listEnrichment.sortFields = (variantParams as any).sortFields;\n }\n Object.assign(apiCallOperationFields, listEnrichment);\n }\n // ── End collection-view enrichment ──────────────────────────────\n\n // Add normal operation\n operations.push(apiCallOperationFields as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>);\n\n // Add bulk operation if enabled\n if (haveBulkOperation) {\n // The documented, enforced batch limit (`BULK_OPERATION_DEFAULT_MAX_SELECTION` unless the\n // variant declares `bulkOperationMaxSelection`). A bulk CREATE is bounded on its `data` rows\n // for the same reason a bulk UPDATE/DELETE is bounded on its `_ids`.\n const bulkMaxSelection = resolveBulkOperationMaxSelection(apiCallParams as { bulkOperationMaxSelection?: number });\n const rowRequestDto = apiCallOperationFields.requestDto;\n // The DTO builder rebuilds this later from the same function; both must agree.\n const bulkDto = wrapRequestDtoAsBulk({\n rowRequestDto: rowRequestDto && !(rowRequestDto instanceof z.ZodObject && Object.keys(rowRequestDto.shape).length === 0)\n ? rowRequestDto\n : undefined,\n maxSelection: bulkMaxSelection,\n // The DTO builder's predicate, verbatim, so the two constructions cannot disagree: a bulk twin\n // of CREATE is refused above, and only CREATE_MANY takes `{ data: [] }`.\n isCreate: operationToCheck === CoreResourceOperation.CREATE_MANY,\n });\n\n const bulkOperationFields = {\n ...apiCallOperationFields,\n isBulkOperation: true,\n isOperationDefault: false, // Bulk operations are never default\n requestDto: bulkDto,\n bulkOperationMaxSelection: bulkMaxSelection,\n };\n\n operations.push(bulkOperationFields as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>);\n }\n\n } else {\n // Handle other variant types (CronJob, BatchJob, InternalCall, RepositoryOnly)\n const { variantType, ...specificFields } = variantParams; // Extract variantType and get rest\n\n const nonApiCallOperation = {\n ...baseOperationFields,\n ...specificFields,\n ...((variantParams.variantType === ResourceOperationVariantType.CRON_JOB || variantParams.variantType === ResourceOperationVariantType.BATCH_JOB)\n ? { scheduledRecovery: normalizeScheduledRecoveryPolicy(variantParams.scheduledRecovery) }\n : {}),\n };\n\n operations.push(nonApiCallOperation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>);\n }\n });\n\n // ========================================\n // PROCESS AUTO-VARIANTS FOR READ AND LIST\n // ========================================\n\n // Only process auto-variants for READ and LIST core operations\n if (operation === CoreResourceOperation.READ || operation === CoreResourceOperation.LIST) {\n // Reuse the flattened default URL-bearing operation so auto-variants inherit the same\n // resolved default identity as the rest of the resource config.\n const defaultApiCallVariant = [...operations].reverse().find((candidate) => (\n candidate.operationIdentifier === operation\n && isUrlisableOperationVariantType(candidate.variantType)\n && candidate.isOperationDefault === true\n && !('isBulkOperation' in candidate && candidate.isBulkOperation === true)\n )) as (\n ResourceConfiguration_Operation_ApiCall<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> |\n Extract<\n ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n { variantType: ResourceOperationVariantType.API_CALL_WITH_CALLBACK }\n >\n ) | undefined;\n\n if (!defaultApiCallVariant) {\n // Skip auto-variants if no default variant exists\n continue;\n }\n\n const defaultListCollectionFields = defaultApiCallVariant as typeof defaultApiCallVariant & CollectionViewFields_List;\n\n // Check which variants already exist\n const existingVariantKeys = new Set(\n operations.filter((candidate) => (\n candidate.operationIdentifier === operation\n && isUrlisableOperationVariantType(candidate.variantType)\n && candidate.variantKey\n && !('isBulkOperation' in candidate && candidate.isBulkOperation === true)\n ))\n .map((candidate) => candidate.variantKey!.toLowerCase())\n );\n\n // Helper to create auto-variant operation\n // Note: DTOs will be pre-computed by buildAllOperationDtos() after all operations are created.\n // We set temporary DTOs here for type compatibility, but they will be replaced.\n const createAutoVariantOperation = (\n variantKey: typeof OPERATION_VARIANT_KEY.SUMMARY | typeof OPERATION_VARIANT_KEY.CONTEXT,\n responseDto: z.ZodTypeAny,\n isDefault: boolean\n ): ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> => {\n const baseOperationFields = {\n isDisabled: params.isDisabled ?? false,\n mainSchema: effectiveMainSchema,\n resourcePrimaryScope,\n resourceIdentifier,\n resourceFieldIdentifier,\n resourceRelationships: operationResourceRelationships,\n isSystemResource,\n operationIdentifier: operation,\n isOperationDefault: false, // Auto-variants are never operation default\n serviceRuntimeMode: config.serviceRuntimeMode || ResourceOperation_ServiceRuntimeMode.INLINE,\n queueConfig,\n requestDto: defaultApiCallVariant.requestDto || deriveRequestDto(operation as string, effectiveMainSchema, undefined), // Temporary - will be replaced by buildAllOperationDtos\n // Forwarded for the same reason as `unimplementedAcknowledgement` below: an auto-variant\n // is a projection of the default variant, so it inherits that variant's request contract\n // and must report the same provenance. Dropping it would make a projection of an\n // AUTHORED contract look auto-derived to the request-contract-breadth guard.\n hasCustomRequestDto: defaultApiCallVariant.hasCustomRequestDto ?? !!defaultApiCallVariant.requestDto,\n responseDto, // Temporary - will be replaced by buildAllOperationDtos\n // Stamped like every other factory-built operation, and it is what makes \"temporary\" true. An\n // auto-variant's `responseDto` is framework-derived, but without the flag the DTO rebuild\n // fell back to its structural heuristic, found the temporary schema \"significantly\n // different\" from the rebuilt one and PRESERVED it as custom. For a CONTEXT variant that\n // temporary schema is the context DTO of the empty-registry factory pass, so the full-\n // registry rebuild added the runtime relationship field BESIDE the fallback one:\n // `users/self/context` declared both `userSelfPreference` and `userSelfPreferences`, at\n // runtime and in the published API reference (#582).\n hasCustomResponseDto: false,\n notificationBadgeOperations: config.notificationBadgeOperations || [],\n userNotifications,\n m2mNotifications,\n variantType: defaultApiCallVariant.variantType,\n resourceOperationLike: defaultApiCallVariant.resourceOperationLike,\n requiredFeatures: normalizeRequiredFeatures(defaultApiCallVariant.requiredFeatures),\n riskLevel: defaultApiCallVariant.riskLevel || ResourceOperationRiskLevel.LOW,\n // Inherited like riskLevel: an auto-variant is a projection of the default variant, so a\n // SUMMARY or CONTEXT derivative of an irreversible operation is equally irreversible.\n reversibility: defaultApiCallVariant.reversibility,\n // Inherited like riskLevel: an auto-variant is a projection of the default variant. The\n // read-shaped projections are unlikely to need it, but inheriting keeps \"projection of\n // the default\" a single consistent rule rather than a per-field accident.\n clientRequestTimeoutMs: defaultApiCallVariant.clientRequestTimeoutMs,\n roles: defaultApiCallVariant.roles, // Inherit roles from default variant\n // Inherited for the same reason as roles: an auto-variant is a projection of the\n // default variant, so if the default is a known implementation gap its SUMMARY /\n // CONTEXT derivatives are equally unserviceable and must refuse identically.\n unimplementedAcknowledgement: defaultApiCallVariant.unimplementedAcknowledgement,\n // Inherited for the same reason: an auto-variant is a projection of the default variant,\n // so a SUMMARY / CONTEXT derivative of a step-up-gated operation must demand the same\n // proof. (Today the auto-variants are read-shaped and `enforceStepUpAuth` exempts reads\n // anyway — inheriting keeps that a property of the exemption list rather than an accident\n // of this projection.)\n requiresStepUpAuthentication: defaultApiCallVariant.requiresStepUpAuthentication,\n // Inherited like step-up: an auto-variant projects the default variant's contract, header included.\n idempotencyKey: defaultApiCallVariant.idempotencyKey,\n // Inherited like the Idempotency-Key: a projection of a protected operation asks the same challenge (#1985).\n submissionChallenge: defaultApiCallVariant.submissionChallenge,\n admitsCrossTenantPlatformAdministration: defaultApiCallVariant.admitsCrossTenantPlatformAdministration,\n // Inherited for the same reason as the cross-tenant flag: an auto-variant is a PROJECTION of\n // the default operation and must make the same addressing claim, or it would refuse the very\n // subjects the operation it projects is admitted to administer.\n admitsCrossSubjectUserAdministration: defaultApiCallVariant.admitsCrossSubjectUserAdministration,\n // Inherited for the same reason as both siblings: an auto-variant projects the default\n // variant's contract, and a projection that dropped this claim would be classified as an\n // unconfined directory write while the operation it projects is not.\n admitsSelfConfinedScopeRootWrite: defaultApiCallVariant.admitsSelfConfinedScopeRootWrite,\n // Inherited for the same reason: an auto-variant is a projection of the default variant,\n // so it must make the same audit claim. Inheriting a `suppressGenericEvent` matters most —\n // the purpose-built event that supersedes the default covers its projections too, and a\n // projection that dropped the suppression would write the duplicate row the flag prevents.\n auditableEvent: defaultApiCallVariant.auditableEvent,\n mcp: defaultApiCallVariant.mcp, // Inherit MCP exposure from default variant (non-default variants aren't MCP-enumerated anyway)\n customServiceImplementationModes: defaultApiCallVariant.customServiceImplementationModes || [],\n basicPrefixOperation: defaultApiCallVariant.basicPrefixOperation,\n // Inherited alongside the hook itself — an auto-variant that ran the prefix without its\n // ownership declaration would drop the very field the hook exists to force.\n authoritativeFields: defaultApiCallVariant.authoritativeFields,\n // Inherited for the same reason as `roles`: an auto-variant is a PROJECTION of the default\n // variant, so it must confine a written reference exactly as the operation it projects does.\n // (Read-shaped auto-variants write nothing today, so this is inert for them — inheriting\n // keeps that a property of what they DO rather than an accident of this projection.)\n referenceConstraints: defaultApiCallVariant.referenceConstraints,\n httpVerb: defaultApiCallVariant.httpVerb,\n isApiKeyAccessDisabled: defaultApiCallVariant.isApiKeyAccessDisabled || false,\n isBulkOperation: false,\n tokenAuthentication: defaultApiCallVariant.tokenAuthentication,\n tokenGeneration: defaultApiCallVariant.tokenGeneration,\n tokenRevocation: defaultApiCallVariant.tokenRevocation,\n // Auto-variants (READ.summary, READ.context, LIST.summary, …)\n // inherit the default variant's rate-limit policy by design — a\n // single declaration on the default URL-bearing variant covers all\n // derived auto-variants. Authors who need a per-variant override\n // declare the variant explicitly instead of relying on auto-generation.\n rateLimit: defaultApiCallVariant.rateLimit,\n enabledCondition: defaultApiCallVariant.enabledCondition,\n isDefault: isDefault,\n variantKey: variantKey,\n ...(operation === CoreResourceOperation.LIST ? {\n // A generated representation changes only the response DATA SHAPE. It remains the same\n // collection operation, so its query contract must be identical to the canonical default\n // variant. Otherwise selecting SUMMARY or CONTEXT silently removes filters, sorting or\n // the authored page ceiling from the public contract.\n pageSize: defaultListCollectionFields.pageSize,\n searchEnabled: defaultListCollectionFields.searchEnabled,\n filtersEnabled: defaultListCollectionFields.filtersEnabled,\n filterFields: defaultListCollectionFields.filterFields,\n sortFields: defaultListCollectionFields.sortFields,\n maxPaginatedResultPerPageLimit: defaultListCollectionFields.maxPaginatedResultPerPageLimit,\n } : {}),\n ...(defaultApiCallVariant.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK ? {\n callbackUrl: defaultApiCallVariant.callbackUrl,\n callbackTimeout: defaultApiCallVariant.callbackTimeout,\n callbackRetryAttempts: defaultApiCallVariant.callbackRetryAttempts,\n } : {}),\n };\n\n // ── Build-time validation for auto-variant token configs ──\n if (defaultApiCallVariant.tokenGeneration) {\n validateTokenGenerationConfig(\n defaultApiCallVariant.tokenGeneration,\n resourceIdentifier as string,\n `${operation as string}.${variantKey}`,\n );\n }\n if (defaultApiCallVariant.tokenRevocation) {\n validateTokenRevocationConfig(\n defaultApiCallVariant.tokenRevocation,\n resourceIdentifier as string,\n `${operation as string}.${variantKey}`,\n );\n }\n // `tokenAuthentication` is deliberately NOT re-validated here, and the absence is a decision\n // rather than an omission (issue #313). `defaultApiCallVariant` is SELECTED from `operations`\n // — variants that were built, and validated, by the authored path above — so its\n // `tokenAuthentication` cannot be a value that block has not already refused. A guard here\n // would be unreachable, and an unreachable guard is not defence in depth: it is an untested\n // claim that reads like coverage (`.claude/rules/invariant-call-site-enumeration.md` #25,\n // #19). Measured: neutering it left every pin in\n // `token-authentication-type-list.guard.test.ts` green.\n //\n // The same is true of the two blocks immediately above — they predate this note and are kept\n // as found, but do not add a fourth on their model.\n\n return baseOperationFields as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>;\n };\n\n // Generate READ.summary variant\n if (operation === CoreResourceOperation.READ && enableReadSummary && !existingVariantKeys.has(OPERATION_VARIANT_KEY.SUMMARY)) {\n const summaryResponseDto = derivedSummarySchema;\n operations.push(createAutoVariantOperation(OPERATION_VARIANT_KEY.SUMMARY, summaryResponseDto, false));\n }\n\n // Generate READ.context variant\n if (operation === CoreResourceOperation.READ && enableReadContext && !existingVariantKeys.has(OPERATION_VARIANT_KEY.CONTEXT)) {\n const contextResponseDto = effectiveMainSchema; // Full schema for context\n operations.push(createAutoVariantOperation(OPERATION_VARIANT_KEY.CONTEXT, contextResponseDto, false));\n }\n\n // Generate LIST.summary variant\n if (operation === CoreResourceOperation.LIST && enableListSummary && !existingVariantKeys.has(OPERATION_VARIANT_KEY.SUMMARY)) {\n const summaryResponseDto = createResourcePaginatedResponseSchema({\n dataSchema: derivedSummarySchema,\n validateArrayConstraints: true,\n maxResultsPerPageLimit: defaultListCollectionFields.maxPaginatedResultPerPageLimit,\n });\n operations.push(createAutoVariantOperation(OPERATION_VARIANT_KEY.SUMMARY, summaryResponseDto, false));\n }\n\n // Generate LIST.context variant\n if (operation === CoreResourceOperation.LIST && enableListContext && !existingVariantKeys.has(OPERATION_VARIANT_KEY.CONTEXT)) {\n const contextResponseDto = createResourcePaginatedResponseSchema({\n dataSchema: effectiveMainSchema,\n validateArrayConstraints: true,\n maxResultsPerPageLimit: defaultListCollectionFields.maxPaginatedResultPerPageLimit,\n });\n operations.push(createAutoVariantOperation(OPERATION_VARIANT_KEY.CONTEXT, contextResponseDto, false));\n }\n }\n }\n\n // ========================================\n // CROSS-OPERATION TOKEN VALIDATION (E1)\n // ========================================\n\n // Detect invalid pairing: tokenGeneration with consumeAt:EXCHANGE + tokenAuthentication with ADDITIVE policy\n // When token is consumed at exchange, no consumable token value is carried into the session,\n // so ADDITIVE operations that require the token will silently fail.\n const generatedTokenTypes = new Map<string, 'EXCHANGE' | 'TARGET_OPERATION'>();\n const additiveTokenTypes = new Set<string>();\n\n for (const op of operations) {\n if ('tokenGeneration' in op && op.tokenGeneration?.createsOneOffSession && op.tokenGeneration.consumeAt) {\n generatedTokenTypes.set(op.tokenGeneration.tokenType as string, op.tokenGeneration.consumeAt);\n }\n if ('tokenAuthentication' in op && op.tokenAuthentication?.policy === TokenAuthenticationPolicy.ADDITIVE) {\n for (const t of op.tokenAuthentication.types) {\n additiveTokenTypes.add(t as string);\n }\n }\n }\n\n for (const [tokenType, consumeAt] of generatedTokenTypes) {\n if (consumeAt === 'EXCHANGE' && additiveTokenTypes.has(tokenType)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] tokenType '${tokenType}': consumeAt is 'EXCHANGE' but another operation ` +\n `uses this tokenType with ADDITIVE policy. EXCHANGE consumes the token before the session starts, ` +\n `so no token value will be available for ADDITIVE operations. Use 'TARGET_OPERATION' instead.`,\n );\n }\n }\n\n // ========================================\n // BUILD FINAL RESULT\n // ========================================\n\n // Build the final resource configuration to pass to buildAllOperationDtos\n // W7.3a: Warn if isAnonymizable but no operation has APP_ANONYMOUS role\n if (isAnonymizable) {\n const hasAnonymousRole = operations.some(op => op.roles.includes('APP_ANONYMOUS'));\n if (!hasAnonymousRole) {\n console.warn(\n `[${resourceIdentifier}] isAnonymizable: true but no operation has APP_ANONYMOUS in roles. ` +\n `Anonymous users won't be able to access any operation on this resource.`\n );\n }\n }\n\n operations.push(\n ...createGeneratedRelationshipBulkOperations(\n operations,\n relevantRelationships,\n resourceIdentifier,\n {\n ...coreResourceShared_FieldIdentifier,\n [resourceIdentifier]: resourceFieldIdentifier,\n }\n )\n );\n\n const generatedFileDiscoverySchema = ResourcesConfigOperationsDtosBuilderUtils.buildSchemaWithInheritance(\n effectiveMainSchema,\n inheritenceSchemaDefinition,\n );\n\n operations.push(\n ...createGeneratedFileRegenerateOperations({\n operations,\n resourceIdentifier,\n resourceFieldIdentifier,\n mainSchema: effectiveMainSchema,\n generatedFileDiscoverySchema,\n persistenceAdapter,\n })\n );\n\n // AFTER the file-regenerate companions, and over the same fully-assembled set: a generated\n // relationship-bulk operation is never a LIST/SEARCH, so ordering cannot change the outcome — but\n // deriving from the complete set means a future generated LIST would be covered without a second\n // call site to remember.\n operations.push(\n ...createGeneratedCollectionExportOperations({\n operations,\n resourceIdentifier,\n })\n );\n\n // ── Fail-closed guard: no anonymous BULK MUTATION (W7.3a hardening) ─────\n //\n // An anonymous caller may legitimately be granted single-record CREATE / READ\n // / LIST / UPDATE / DELETE (e.g. draft-notes lead capture), but a bulk MUTATION\n // (CREATE_MANY / UPDATE_MANY / DELETE_MANY) granted to `APP_ANONYMOUS` is an\n // unauthenticated mass-write surface — a whole-collection destructive footgun\n // no app should be able to author by accident. The framework provided ZERO\n // enforcement here (only a non-blocking \"isAnonymizable without any anon op\"\n // warning existed), so this fails closed at config-build time. Read-shaped\n // collection ops (LIST / SEARCH / COUNT) are intentionally NOT flagged —\n // anonymous listing of one's own anonymous rows is a supported pattern.\n //\n // Runs over the FULLY-assembled operation set (authored + generated\n // relationship-bulk + file-regenerate) so a generated bulk op that inherited\n // anonymous roles from its base is caught too. Zero violations exist today.\n for (const operation of operations) {\n // A resource op is a bulk MUTATION iff EITHER its identifier is a core bulk\n // verb (create_many / update_many / delete_many) OR it carries the\n // `isBulkOperation` flag. The flag is sufficient on its own: the factory\n // rejects `haveBulkOperation` on READ / LIST above (\"read and list are not\n // bulkable\"), so `isBulkOperation === true` is GUARANTEED to be a mutation —\n // it covers the opt-in bulk UPDATE/DELETE companions AND the generated\n // relationship-bulk ops (whose `operationIdentifier` is a relationship id,\n // not a core verb, so clause 1 alone would miss them). `operationIdentifier`\n // is the (core | custom) op union and `isBulkOperation` exists only on some\n // variants of the discriminated union — narrow with `in` and compare by\n // string value (enum members ARE their string values); the CronJob variant\n // carries neither.\n const isBulkMutation =\n isCoreBulkMutationOperation(operation.operationIdentifier)\n || ('isBulkOperation' in operation && operation.isBulkOperation === true);\n if (isBulkMutation && operation.roles.includes('APP_ANONYMOUS')) {\n throw createConfigurationError(\n `[${resourceIdentifier}] operation '${String(operation.operationIdentifier)}' grants APP_ANONYMOUS on a ` +\n `bulk MUTATION (create_many / update_many / delete_many). Unauthenticated mass-write is forbidden — ` +\n `anonymous access is only permitted on single-record operations (and read-shaped collection ops: ` +\n `list / search / count). Remove APP_ANONYMOUS from this operation's roles.`\n );\n }\n }\n\n // ── RESOLVABILITY half of the retention operation contract ──────────────\n //\n // The presence half ran with the other `retentionPolicy` validations above: it proved\n // UPDATE_MANY / READ / LIST are declared. Being DECLARED is not the same as being REACHABLE,\n // and the gap between the two is a config that boots green and breaks on the first erasure.\n //\n // All three retention primitives resolve their operation through\n // `ResourcesRegistryBackendService.getServiceOperationPathDefault`, which admits ONLY the\n // variant types in `SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES` and only when the variant is\n // the operation DEFAULT. `REPOSITORY_ONLY` is route-less exactly like `INTERNAL_CALL` — so it\n // is the natural-looking choice for \"the capability without a new HTTP surface\" — but it is\n // deliberately excluded there and served by the separate `getRepositoryOperationPathDefault`\n // transport. A `REPOSITORY_ONLY` UPDATE_MANY therefore satisfied the presence check and then\n // failed to resolve mid-erasure. That is not hypothetical: the `USERS` opt-in shipped it, every\n // config test passed, and only a completion review caught it.\n //\n // Runs HERE, not with the presence half, because `isOperationDefault` is computed by the\n // operations loop above (it is variant-type-LOCAL — a lone variant marked `isDefault: false`\n // yields NO default for its transport group, which this check must see). Reads the SAME\n // predicate the resolver applies, so a config this guard accepts is a config the resolver can\n // serve, by construction rather than by two lists agreeing.\n if (retentionPolicy?.mode) {\n for (const { operation: requiredOperation, primitive } of RETENTION_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS) {\n if (operations.some((candidate) => isServiceResolvableDefaultOperation(candidate, requiredOperation))) {\n continue;\n }\n\n const declaredVariants = operations\n .filter((candidate) => candidate.operationIdentifier === requiredOperation)\n .map((candidate) => `${candidate.variantType}${candidate.variantKey ? `:${candidate.variantKey}` : ''}` +\n `${candidate.isOperationDefault ? ' (default)' : ''}`);\n\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires ${requiredOperation} to be SERVICE-RESOLVABLE, but it ` +\n `declares no DEFAULT variant of an accepted type. Declared variants: ` +\n `[${declaredVariants.length > 0 ? declaredVariants.join(', ') : 'none'}]. The retention primitive ` +\n `${primitive} resolves this operation through getServiceOperationPathDefault, which accepts only ` +\n `[${SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES.join(', ')}] and only the operation default. ` +\n `REPOSITORY_ONLY is route-less but is served by the SEPARATE getRepositoryOperationPathDefault ` +\n `transport, so it passes the \"operation exists\" check and then FAILS TO RESOLVE the moment an ` +\n `erasure runs. Use ${ResourceOperationVariantType.INTERNAL_CALL} for a capability that must stay ` +\n `route-less (it is both route-less and service-resolvable), and make sure it is the default for ` +\n `its transport group — a lone variant marked \\`isDefault: false\\` leaves the group with NO default.`\n );\n }\n }\n\n // ── RESOLVABILITY of the retention-class sweep's delete (#1613) ───────────\n //\n // The class sweep deletes expired rows through the SERVICE layer — so cascades, file release and RAG\n // chunk removal run — preferring a DELETE_MANY and falling back to per-row DELETE, exactly the\n // anonymous-session cleanup's disjunction. A binding with neither resolvable would boot green and then\n // fail the first sweep that found an expired row, which is a published period nothing can enforce.\n if (retentionBinding) {\n const deleteAlternatives = [CoreResourceOperation.DELETE_MANY, CoreResourceOperation.DELETE];\n if (!deleteAlternatives.some((alternative) =>\n operations.some((candidate) => isServiceResolvableDefaultOperation(candidate, alternative)))) {\n const declaredVariants = operations\n .filter((candidate) => deleteAlternatives.includes(candidate.operationIdentifier as CoreResourceOperation))\n .map((candidate) => `${String(candidate.operationIdentifier)}/${candidate.variantType}${candidate.isOperationDefault ? ' (default)' : ''}`);\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding requires DELETE_MANY or DELETE to be SERVICE-RESOLVABLE: the retention ` +\n `sweep deletes expired rows through the service layer so cascades, files and RAG chunks go with them. ` +\n `Declared variants: [${declaredVariants.length > 0 ? declaredVariants.join(', ') : 'none'}]. Declare one as the ` +\n `default ${ResourceOperationVariantType.INTERNAL_CALL} variant (route-less and service-resolvable); ` +\n `REPOSITORY_ONLY is served by a different transport and does not resolve.`\n );\n }\n\n }\n\n // ── RESOLVABILITY half of the ANONYMIZABLE operation contract ───────────\n //\n // Same two-halves shape as retention above, for the other dynamic-loop capability. The presence\n // half proved that each requirement group has an alternative DECLARED; this proves one of them\n // is REACHABLE by `AnonymousSessionBackendService`, whose three primitives\n // (`listAnonymousRecords` / `updateManyAsSystem` / `deleteOwnedRecords`) all resolve through\n // `getServiceOperationPathDefault`.\n //\n // Runs HERE rather than with the presence half for the same reason retention's does:\n // `isOperationDefault` is computed by the operations loop above, and it is variant-type-LOCAL —\n // a lone variant marked `isDefault: false` leaves its transport group with NO default.\n //\n // Reads the SAME predicate the resolver applies (`isServiceResolvableDefaultOperation`), and the\n // same predicate `deleteOwnedRecords` probes with when it chooses between DELETE_MANY and\n // per-row DELETE — so the guard, the runtime chooser and the resolver cannot disagree.\n if (isAnonymizable) {\n for (const { operations: alternatives, primitive, why } of ANONYMIZABLE_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS) {\n if (alternatives.some((alternative) =>\n operations.some((candidate) => isServiceResolvableDefaultOperation(candidate, alternative)))) {\n continue;\n }\n\n const declaredVariants = operations\n .filter((candidate) => alternatives.includes(candidate.operationIdentifier as CoreResourceOperation))\n .map((candidate) => `${String(candidate.operationIdentifier)}/${candidate.variantType}` +\n `${candidate.variantKey ? `:${candidate.variantKey}` : ''}${candidate.isOperationDefault ? ' (default)' : ''}`);\n\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires ${describeOperationAlternatives(alternatives)} ` +\n `to be SERVICE-RESOLVABLE, but no accepted DEFAULT variant is declared. Declared variants: ` +\n `[${declaredVariants.length > 0 ? declaredVariants.join(', ') : 'none'}]. The anonymous-session ` +\n `primitive ${primitive} (${why}) resolves through getServiceOperationPathDefault, which accepts ` +\n `only [${SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES.join(', ')}] and only the operation default. ` +\n `REPOSITORY_ONLY is route-less but is served by the SEPARATE getRepositoryOperationPathDefault ` +\n `transport, so it passes the \"operation exists\" check and then FAILS TO RESOLVE the moment an ` +\n `anonymous session converts or expires. Use ${ResourceOperationVariantType.INTERNAL_CALL} for a ` +\n `capability that must stay route-less, and make sure it is the default for its transport group.`\n );\n }\n }\n\n const resourceConfig: ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> = {\n isDisabled: params.isDisabled ?? false,\n resourcePrimaryScope,\n resourceIdentifier,\n resourceFieldIdentifier,\n coreOperations,\n customOperation,\n mainSchema: effectiveMainSchema,\n resourceRelationships: processedResourceRelationships,\n inheritenceSchemaDefinition,\n persistenceAdapter,\n persistenceAdapterIsolation,\n httpApiBinding: resolvedHttpApiBinding,\n introspectionBinding,\n externalDataPipeline,\n isSystemResource,\n primaryKeyIdentifiesInitiator,\n systemAccessPolicy: effectiveSystemAccessPolicy,\n subjectErasureLane,\n isAnonymizable,\n transpositionPolicy: isAnonymizable\n ? (transpositionPolicy ?? ResourceTranspositionPolicy.ADD)\n : ResourceTranspositionPolicy.ADD,\n // Normalize (mirror transpositionPolicy): the RESOLVED retentionPolicy is present IFF the resource\n // opted in. An absent `mode` is an opt-in-shaped opt-out that injects no marker\n // and derives no grants, so it must NOT ship a truthy resolved value — else a consumer doing\n // `if (config.retentionPolicy)` would treat a non-opted-in resource as retention-governed.\n retentionPolicy: retentionPolicy?.mode ? retentionPolicy : undefined,\n // Paired with `retentionPolicy` by the guards above, so these two are present together or not at all.\n dataSubjectPolicy: retentionPolicy?.mode ? dataSubjectPolicy : undefined,\n // Validated and parsed above, so the resolved value is exactly the strict-parsed declaration.\n retentionBinding,\n // Normalize (mirror retentionPolicy): the resolved portabilityPolicy is present IFF the\n // resource actually declared a default. An absent `defaultProvenance` is a policy-shaped\n // opt-out, and shipping a truthy-but-empty object would make an Art. 20 export believe a\n // default exists and silently include fields nobody classified.\n portabilityPolicy: portabilityPolicy?.defaultProvenance ? portabilityPolicy : undefined,\n workUnit,\n operations: operations // Temporary - will be replaced\n };\n\n // Pre-compute all DTOs for each operation using buildAllOperationDtos\n // Note: Registry is empty for now - it's mainly used for cross-references in nested DTOs\n // If needed, the registry can be passed as a parameter to the factory function\n const resourceRegistry = new Map<ResourceType, any>();\n const operationsWithDtos = operations.map(operation =>\n ResourcesConfigOperationsDtosBuilderUtils.buildAllOperationDtos(\n operation,\n resourceConfig,\n resourceRegistry\n )\n );\n\n // ── A closure clock is SERVER-OWNED (#1613 review F1) ─────────────────\n //\n // `CLOSURE_EVENT` deletes a row the declared period after its closure date. If ANY client-routed\n // operation's request can carry that date, a caller can backdate it and the next sweep deletes an OPEN\n // record — without DELETE permission and without the period passing. Checked HERE, against the FINAL\n // request DTOs, so it covers every shape uniformly: create, create_many, update, update_many and every\n // custom operation with its own request schema (a \"close\" operation taking the date is the same hole).\n // Route-less variants (INTERNAL_CALL, REPOSITORY_ONLY) are the owning code's own writes and pass; the\n // handlers that own the field declare it in `authoritativeFields`. `isNotEditable()` enforces nothing here.\n if (retentionBinding?.startPoint === RetentionStartPoint.CLOSURE_EVENT && retentionBinding.closureFieldName) {\n const closureFieldName = retentionBinding.closureFieldName;\n const clientRouted = new Set<string>([ResourceOperationVariantType.API_CALL, ResourceOperationVariantType.API_CALL_WITH_CALLBACK]);\n const writers = operationsWithDtos.filter((operation: any) =>\n clientRouted.has(operation.variantType as string) && requestSchemaCarriesField(operation.requestDto, closureFieldName));\n if (writers.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding closure field '${closureFieldName}' is writable by a client-routed ` +\n `${[...new Set(writers.map((writer: any) => String(writer.operationIdentifier)))].join('/')}: a caller could backdate ` +\n `it and the retention sweep would delete an open record. Mark it .excludeFromCreate().excludeFromUpdate(), keep it ` +\n `out of any custom request schema, and set it in the owning handlers, declaring it in authoritativeFields so their ` +\n `write survives the re-parse.`\n );\n }\n }\n\n return {\n isDisabled: params.isDisabled ?? false,\n resourcePrimaryScope,\n resourceIdentifier,\n resourceFieldIdentifier,\n coreOperations,\n customOperation,\n mainSchema: effectiveMainSchema,\n resourceRelationships: processedResourceRelationships,\n inheritenceSchemaDefinition,\n persistenceAdapter,\n persistenceAdapterIsolation,\n httpApiBinding: resolvedHttpApiBinding,\n introspectionBinding,\n externalDataPipeline,\n isSystemResource,\n primaryKeyIdentifiesInitiator,\n systemAccessPolicy: effectiveSystemAccessPolicy,\n subjectErasureLane,\n isAnonymizable,\n transpositionPolicy: isAnonymizable\n ? (transpositionPolicy ?? ResourceTranspositionPolicy.ADD)\n : ResourceTranspositionPolicy.ADD,\n // Normalize (mirror transpositionPolicy): resolved retentionPolicy present IFF opted-in — see the\n // internal resourceConfig object above for the full rationale.\n retentionPolicy: retentionPolicy?.mode ? retentionPolicy : undefined,\n // Paired with `retentionPolicy` by the guards above, so these two are present together or not at all.\n dataSubjectPolicy: retentionPolicy?.mode ? dataSubjectPolicy : undefined,\n // Validated and parsed above, so the resolved value is exactly the strict-parsed declaration.\n retentionBinding,\n // Normalize (mirror retentionPolicy): the resolved portabilityPolicy is present IFF the\n // resource actually declared a default. An absent `defaultProvenance` is a policy-shaped\n // opt-out, and shipping a truthy-but-empty object would make an Art. 20 export believe a\n // default exists and silently include fields nobody classified.\n portabilityPolicy: portabilityPolicy?.defaultProvenance ? portabilityPolicy : undefined,\n workUnit,\n operations: operationsWithDtos\n };\n}\n\n/**\n * Why a declared constant cannot be written to a local field, or `null` when it can (#1685). The field's own Zod type\n * decides: an enum takes only its members, a string / number / boolean field only that primitive. Any other field\n * type cannot be checked from here, and an expression writing an unchecked value is refused rather than trusted.\n */\nfunction describeExternalDataConstantMisfit(value: unknown, targetSchema: z.ZodTypeAny): string | null {\n const inner = unwrapSchema(targetSchema);\n if (inner instanceof z.ZodEnum) {\n const members = inner.options as readonly unknown[];\n return members.includes(value) ? null : `${JSON.stringify(value)} is not a member of the field's enum (${members.map((member) => JSON.stringify(member)).join(', ')})`;\n }\n if (inner instanceof z.ZodString) return typeof value === 'string' ? null : `${JSON.stringify(value)} is not a string`;\n if (inner instanceof z.ZodNumber) return typeof value === 'number' ? null : `${JSON.stringify(value)} is not a number`;\n if (inner instanceof z.ZodBoolean) return typeof value === 'boolean' ? null : `${JSON.stringify(value)} is not a boolean`;\n return `a declared value cannot be checked against this field's type (${getZodType(inner)})`;\n}\n\n\n/**\n * The destination-schema half of an OUTBOUND pipeline's coherence (#1690) — the arrows of the INBOUND rules reversed.\n *\n * - every SENT field (a mapping entry's `localField`) exists and is the application's own: a field declared\n * `.excludeFromCreate()` AND `.excludeFromUpdate()` is one no caller can ever set, so sending it would send a value\n * nobody decided. (Excluded from one of the two is fine — a field set once on create and never changed is common.)\n * - `remoteKeyLocalField` exists, is a STRING, ACCEPTS ABSENCE (a row is created locally before the system of record\n * has assigned it a key) and is excluded from create and update: the engine writes it, once, from the create's\n * answer, and a caller that could write it could point a local row at any remote record. No `.isBusinessKey()` or\n * `.isUnique()` is required: nothing upserts on it, and the engine never writes one key to two rows.\n * - `partitionUnitLocalField`, when declared, exists, is a STRING and accepts absence — the unit a row belongs to,\n * which decides the partition it is created in. A row with no unit is not sent on a partitioned instance.\n * - a REMOTE_REFERENCE's local foreign key is a STRING that accepts absence (it is the caller's link, possibly empty),\n * and its value shape is resolved from the dialect exactly as for an inbound entry, because the reverse translation\n * sends the target's key in that shape.\n * - `population` and `orphanPolicy` describe an INBOUND load and are refused when AUTHORED with anything but their\n * default. Both carry defaults, so the parsed declaration cannot tell a written value from an omitted one; the\n * authored object can. A value EQUAL to the default is let through, because a declaration that was parsed once\n * already (a configuration re-materialized from its own parsed pipeline) carries both, and it declares nothing an\n * inbound load would read differently.\n */\nfunction validateExternalDataOutboundDeclarationAgainstSchema(\n declaration: ExternalDataPipelineDeclaration,\n shape: Record<string, z.ZodTypeAny>,\n authored: Record<string, unknown>,\n refuse: (message: string) => never,\n): void {\n const defaults = { population: ExternalDataDestinationPopulation.CLOSED, orphanPolicy: ExternalDataOrphanPolicy.REPORT } as const;\n for (const field of ['population', 'orphanPolicy'] as const) {\n if (authored[field] !== undefined && authored[field] !== defaults[field]) {\n refuse(`${field}: describes the rows an INBOUND pass loads, and an OUTBOUND pipeline loads none — it sends the destination's own rows. Remove it.`);\n }\n }\n const requireStringAcceptingAbsence = (fieldName: string, context: string): z.ZodTypeAny => {\n const fieldSchema = shape[fieldName];\n if (!fieldSchema) refuse(`${context}: local field '${fieldName}' does not exist on mainSchema.`);\n if (!(unwrapSchema(fieldSchema!) instanceof z.ZodString)) refuse(`${context}: '${fieldName}' must be a STRING field.`);\n if (unwrapSchema(fieldSchema!) === fieldSchema!) refuse(`${context}: '${fieldName}' must be optional or nullable — a row can exist locally without it.`);\n return fieldSchema!;\n };\n\n const keySchema = requireStringAcceptingAbsence(declaration.remoteKeyLocalField, 'remoteKeyLocalField');\n /*\n * ONE RECORD, ONE ROW (#2039 review) — made a property of the STORE rather than of each code path that writes the key.\n *\n * A remote key names one record of the system of record, so two local rows holding it would each send their edits to\n * that record, overwriting each other's. The pass cannot make that (the system of record mints a fresh key per create),\n * but an operator's answer to an unknown create can, and a check at the door is a read-then-write any concurrent writer\n * slips past. A UNIQUE index cannot be slipped past, on any path.\n *\n * It must IGNORE rows with no key yet — every row before its first send has none. `.isUnique()` gives exactly that on\n * both stores: its default is sparse, which MongoDB builds as a sparse (or, on a retention-governed resource, a\n * `$exists`-partial) unique index and PostgreSQL plans with NULLs distinct. MongoDB's one blind spot is an EXPLICIT null,\n * which a sparse index still indexes — so the field must also refuse null: `.optional()`, never `.nullable()`, which\n * makes \"absent\" the only empty state a validated write can store.\n *\n * Checked rather than applied by the factory, for the inbound rule's reason (the same field there must be declared\n * `.isUnique()`, \"boot-CHECKED, not factory-mutated\"): the application's own schema file shows the index it gets, and\n * the migration its planner writes is the one its author reads.\n */\n const uniqueParams = getUniqueFieldParams(keySchema);\n if (uniqueParams === undefined || uniqueParams.sparse === false || (uniqueParams.scope !== undefined && uniqueParams.scope !== 'global') || uniqueParams.compoundWith !== undefined) {\n refuse(\n `remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must be declared .isUnique() — one remote record, one local row: two rows holding `\n + 'one key would each overwrite the other\\'s record. Plain `.isUnique()` (global, sparse, the default) ignores the rows not yet sent.',\n );\n }\n if (keySchema.safeParse(null).success) {\n refuse(\n `remoteKeyLocalField: '${declaration.remoteKeyLocalField}' accepts null. Declare it .optional(), not .nullable(): its unique index ignores a row `\n + 'with no key only while \"no key\" is ABSENT — MongoDB indexes an explicit null, so a second unsent row would collide with the first.',\n );\n }\n if (!isExcludedFromCreate(keySchema) || !isExcludedFromUpdate(keySchema)) {\n refuse(\n `remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must be declared .excludeFromCreate() and .excludeFromUpdate() — the engine `\n + 'writes it once, from the key the system of record answers a create with, and a caller that could write it could point a local row '\n + 'at any remote record.',\n );\n }\n if (declaration.partitionUnitLocalField !== undefined) {\n requireStringAcceptingAbsence(declaration.partitionUnitLocalField, 'partitionUnitLocalField');\n }\n\n for (const entry of declaration.mapping) {\n const context = `mapping('${entry.localField}')`;\n const fieldSchema = shape[entry.localField];\n if (!fieldSchema) refuse(`${context}: local field '${entry.localField}' does not exist on mainSchema.`);\n if (isExcludedFromCreate(fieldSchema!) && isExcludedFromUpdate(fieldSchema!)) {\n refuse(\n `${context}: '${entry.localField}' is declared .excludeFromCreate() and .excludeFromUpdate(), so no caller can ever set it and an OUTBOUND `\n + 'pipeline would send a value nobody decided. A field this pipeline SENDS is the application\\'s own: let callers write it.',\n );\n }\n if (entry.kind === ExternalDataMappingEntryKind.REMOTE_REFERENCE) {\n requireStringAcceptingAbsence(entry.localField, context);\n entry.valueShape = resolveExternalDataRemoteReferenceValueShape(entry, declaration.binding.dialect);\n }\n }\n}\n\n/**\n * The destination-schema half of a declared expression's validation (#1685): what the local field must be for the\n * expression to write it — and, for a plain CONSTANT, whether the constant fits an enum or primitive field. The schema-independent half (duplicate codes, identity arithmetic, a concatenation of\n * literals) is `assertExternalDataPipelineDeclarationCoherence`'s.\n *\n * Runs where every other mapping target is checked — the resource factory, at module load, i.e. at startup — so a\n * renamed enum member, a mistyped constant or an expression pointed at the wrong kind of field stops the boot with\n * the entry named, instead of rejecting every row of every run. A remote field that does not exist cannot be known\n * here, offline; the extraction requests every field an expression reads, so the SOURCE refuses it on the first run\n * (Odoo raises \"Invalid field\", an OData service refuses an unknown `$select` property) rather than every row landing\n * null.\n *\n * Also RESOLVES, as for a `REMOTE_FIELD` entry, Odoo's absent-as-false coercion on a `CONDITIONAL` outcome that\n * copies a remote field: this is the one place the dialect and the target type are both known.\n */\nfunction validateExternalDataExpressionAgainstTarget(\n entry: ExternalDataFieldMappingEntry,\n targetSchema: z.ZodTypeAny,\n dialect: HttpApiTransportDialect,\n refuse: (message: string) => never,\n): void {\n const at = `mapping('${entry.localField}')`;\n const inner = unwrapSchema(targetSchema);\n const acceptsAbsence = inner !== targetSchema;\n // `required` exists on every expression but CONDITIONAL, whose strict shape refuses it — so only the others may\n // be told to declare it.\n const requireAbsenceCapable = (why: string): void => {\n if (acceptsAbsence) return;\n refuse(entry.kind === ExternalDataMappingEntryKind.CONDITIONAL\n ? `${at}: ${why}, so the field must be optional or nullable.`\n : `${at}: ${why}, so the field must be optional or nullable — or declare required: true (such rows are then rejected and reported).`);\n };\n switch (entry.kind) {\n /*\n * A CONSTANT, checked where a check is possible (#1685 review): a member the enum does not have, or a value of the\n * wrong primitive type, fails the boot rather than every row's load. A field of another type (a date, an object)\n * is left alone: a constant cannot express one, and refusing it would refuse declarations nothing proves wrong.\n */\n case ExternalDataMappingEntryKind.CONSTANT: {\n if (inner instanceof z.ZodEnum || inner instanceof z.ZodString || inner instanceof z.ZodNumber || inner instanceof z.ZodBoolean) {\n const misfit = describeExternalDataConstantMisfit(entry.constant, targetSchema);\n if (misfit !== null) refuse(`${at}.constant: ${misfit}.`);\n }\n return;\n }\n case ExternalDataMappingEntryKind.ENUM_MAP: {\n if (!(inner instanceof z.ZodEnum)) refuse(`${at}: an ENUM_MAP writes a member of a local enum, so its target must be an enum field.`);\n for (const { remoteValue, localValue } of entry.values) {\n const misfit = describeExternalDataConstantMisfit(localValue, targetSchema);\n if (misfit !== null) refuse(`${at}.values: the code ${JSON.stringify(remoteValue)} maps to ${misfit}.`);\n }\n if (entry.unmapped.policy === ExternalDataUnmappedValuePolicy.USE_DEFAULT) {\n const misfit = describeExternalDataConstantMisfit(entry.unmapped.localValue, targetSchema);\n if (misfit !== null) refuse(`${at}.unmapped.localValue: ${misfit}.`);\n }\n if (!entry.required) requireAbsenceCapable('an absent remote code lands null');\n return;\n }\n case ExternalDataMappingEntryKind.CONCATENATION:\n if (!(inner instanceof z.ZodString)) refuse(`${at}: a CONCATENATION writes a string, so its target must be a string field.`);\n if (!entry.required) requireAbsenceCapable('a row whose every remote part is absent lands null');\n return;\n case ExternalDataMappingEntryKind.ARITHMETIC:\n if (!(inner instanceof z.ZodNumber)) refuse(`${at}: an ARITHMETIC entry writes a number, so its target must be a number field.`);\n if (!entry.required) requireAbsenceCapable('an absent remote value lands null');\n return;\n case ExternalDataMappingEntryKind.CONDITIONAL: {\n const outcomes = [...entry.cases.map((entryCase) => entryCase.then), entry.otherwise];\n for (const outcome of outcomes) {\n if (outcome.kind === ExternalDataConditionalOutcomeKind.CONSTANT) {\n const misfit = describeExternalDataConstantMisfit(outcome.constant, targetSchema);\n if (misfit !== null) refuse(`${at}: an outcome writes ${misfit}.`);\n continue;\n }\n requireAbsenceCapable(`the outcome copying '${outcome.remoteField}' lands null when that field is absent`);\n // As for a REMOTE_FIELD entry: the timestamp coercion produces a Date, so it targets a date field.\n if (outcome.coercion === ExternalDataFieldCoercion.ISO_STRING_TO_DATE && !(inner instanceof z.ZodDate)) {\n refuse(`${at}: the outcome copying '${outcome.remoteField}' declares ISO_STRING_TO_DATE, which targets a date field.`);\n }\n // Odoo's false→null default, resolved as for a REMOTE_FIELD entry: a genuine boolean target keeps its false.\n if (dialect === HttpApiTransportDialect.ODOO_JSONRPC && outcome.coercion === ExternalDataFieldCoercion.NONE && !(inner instanceof z.ZodBoolean)) {\n outcome.coercion = ExternalDataFieldCoercion.ODOO_FALSE_AS_NULL;\n }\n }\n return;\n }\n default:\n return;\n }\n}\n"]}
1
+ {"version":3,"file":"resources-config.shared.factory.js","sourceRoot":"","sources":["../../../../src/resources/resources-config.shared.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAC;AAChF;;;;GAIG;AAGH,OAAO,EAEL,uBAAuB,EAEvB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,oBAA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AE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;YACtF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAC/B,IAAI,OAAO,CAAC,IAAI,KAAK,kCAAkC,CAAC,QAAQ,EAAE,CAAC;oBACjE,MAAM,MAAM,GAAG,kCAAkC,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;oBAClF,IAAI,MAAM,KAAK,IAAI;wBAAE,MAAM,CAAC,GAAG,EAAE,uBAAuB,MAAM,GAAG,CAAC,CAAC;oBACnE,SAAS;gBACX,CAAC;gBACD,qBAAqB,CAAC,wBAAwB,OAAO,CAAC,WAAW,wCAAwC,CAAC,CAAC;gBAC3G,mGAAmG;gBACnG,IAAI,OAAO,CAAC,QAAQ,KAAK,yBAAyB,CAAC,kBAAkB,IAAI,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;oBACvG,MAAM,CAAC,GAAG,EAAE,0BAA0B,OAAO,CAAC,WAAW,4DAA4D,CAAC,CAAC;gBACzH,CAAC;gBACD,6GAA6G;gBAC7G,IAAI,OAAO,KAAK,uBAAuB,CAAC,YAAY,IAAI,OAAO,CAAC,QAAQ,KAAK,yBAAyB,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC;oBAChJ,OAAO,CAAC,QAAQ,GAAG,yBAAyB,CAAC,kBAAkB,CAAC;gBAClE,CAAC;YACH,CAAC;YACD,OAAO;QACT,CAAC;QACD;YACE,OAAO;IACX,CAAC;AACH,CAAC","sourcesContent":["import { ResourceConfiguration_QueueConfigSchema } from '../queue/queues.shared.schemas';\nimport { markEmbeddedResourceSchema } from './embedded-resource-mark.shared.utils';\nimport { normalizeScheduledRecoveryPolicy } from '../queue/jobs.shared.schemas';\n/**\n * Operations Shared Schemas\n *\n * Reusable operation schemas for bulk actions and common operations\n */\n\n\nimport {\n EnumLikeType,\n ExpiresInDurationSchema,\n PrimitiveZodType,\n getImpersonalizeMaskValue,\n getImpersonalizeTreatment,\n getZodObjectShape,\n getZodType,\n isBackendOnlyField,\n isDiscriminatorField,\n isExcludedFromCreate,\n isExcludedFromUpdate,\n isBusinessKeyField,\n isZodObject,\n isSummaryField,\n isTemplatableFileField,\n isUniqueField,\n getUniqueFieldParams,\n isVirtualField,\n toPatchOptionalField,\n z_file,\n mainSchemaFieldIsClearable,\n unwrapSchema,\n getDataCategories,\n markPatchRequestDtoObject,\n isDBIndexed,\n} from '@wildo-ai/zod-decorators';\nimport { z } from 'zod';\nimport { ErrorType } from '../errors/errors.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind, RetentionStatus, RetentionStatusSchema, StatutoryRetentionGround } from '../compliance/privacy/impersonalization.shared.schemas';\nimport {\n buildImpersonalizeScrubPatch,\n collectDeclaredPersonalDataFields,\n IMPERSONALIZE_MASK_CONSTANT,\n isImpersonalizeNeverScrubFloorField,\n resolveImpersonalizeMaskValue,\n resolveImpersonalizeResetValue,\n} from '../compliance/privacy/impersonalization-scrub.shared.utils';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\nimport {\n DataRetentionClass,\n RETENTION_STARTED_AT_FIELD_NAME,\n ResourceRetentionBindingSchema,\n RetentionStartPoint,\n type ResourceRetentionBinding,\n} from '../compliance/privacy/retention-schedule.shared.schemas';\nimport { collectRowTtlPolicies, resolveRetentionStartFieldName } from '../compliance/privacy/retention-binding.shared.utils';\nimport { unknownPersonalDataCategories } from '../compliance/privacy/personal-data-category.shared.schemas';\n/*\n * entrypoint-closure-waiver: this root-reachable module imports the external-data AUTHORING\n * contract, which only `@wildo-ai/saas-models/external-data` publishes (see\n * `external-data.exports.ts` for why that subpath exists).\n *\n * MEASURED SAFE 2026-08-29 by the probe `package-public-entrypoints.md` prescribes — a consumer\n * importing ONLY the package root, re-exporting these surfaces and deriving their parameter types\n * so declaration emit must WRITE them rather than alias them, compiled with `declaration: true`:\n * zero TS2742 / TS2883 / TS7056, and the emitted `.d.ts` names `@wildo-ai/saas-models` with no\n * `node_modules/...` path anywhere in it.\n *\n * The mechanism, so the next reader need not re-derive it: every crossing here is an EXPLICIT\n * ANNOTATION inside this package, so TypeScript emits a RELATIVE intra-package import in our own\n * `.d.ts` — which resolves by PATH for any consumer, whatever the exports map says. TS2742 bites\n * only when TypeScript must INVENT a specifier for an INFERRED type. Re-run the probe if a\n * root-exported contract here ever starts inferring one.\n */\nimport { HttpApiResourceBindingSchema, assertHttpApiBindingDialectCoherence } from '../http-api-binding/http-api-binding.shared.schemas';\nimport {\n assertHttpApiWriteDeclarationCoherence,\n collectHttpApiWriteOperationFacts,\n resolveHttpApiWriteIdempotencyKeyRequirement,\n resolveHttpApiWriteVerb,\n} from './utils/http-api-write-declaration.shared.utils';\nimport { describeNoSubjectDataStanceContradiction, personalFieldsContradictingNoSubjectDataStance } from './utils/no-subject-data-stance-coherence.shared.utils';\nimport {\n HTTP_API_ENGINE_INJECTED_FIELDS,\n HTTP_API_TENANT_ANCHOR_FIELD,\n READ_THROUGH_ORGANIZATION_UNIT_FIELD_NAME,\n} from '../http-api-binding/read-through-engine-anchors.shared';\nimport { HttpApiTransportDialect } from '../http-api-binding/http-api-transport-dialect.shared';\nimport {\n ExternalDataConditionalOutcomeKind,\n ExternalDataDestinationPopulation,\n ExternalDataFieldCoercion,\n ExternalDataFieldOwner,\n ExternalDataMappingEntryKind,\n ExternalDataOrphanPolicy,\n ExternalDataPipelineDeclarationSchema,\n ExternalDataPipelineDirection,\n ExternalDataUnmappedValuePolicy,\n assertExternalDataPipelineDeclarationCoherence,\n resolveExternalDataFieldOwner,\n resolveExternalDataRemoteReferenceValueShape,\n type ExternalDataFieldMappingEntry,\n type ExternalDataPipelineDeclaration,\n} from '../external-data/external-data-pipeline.shared.schemas';\nimport {\n CoreM2MNotificationChannel,\n CoreUserNotificationChannel,\n CoreUserNotificationTarget,\n M2MNotificationDefinition,\n M2MNotificationDefinitionSchema,\n UserNotificationDefinition,\n UserNotificationDefinitionSchema,\n} from '../notifications/notifications.shared.schemas';\nimport { HttpMethod } from '../requests/http-requests.shared';\nimport { isSubmissionChallengeActionName, type ResourceOperationSubmissionChallenge } from '../security/submission-challenge/submission-challenge.shared';\nimport type { TokenAuthenticationConfig, TokenGenerationConfig, TokenRevocationConfig } from '../security/authentications/consumable-token.shared.schemas';\nimport { ConsumableToken_ConsumptionMode, TokenAuthenticationPolicy } from '../security/authentications/consumable-token.shared.schemas';\nimport {\n OPERATION_VARIANT_KEY,\n type AnyResourceConfiguration,\n type CollectionViewFields_List,\n RequiredFeaturesConfig,\n RequiredFeaturesNormalized,\n wrapRequestDtoAsBulk,\n resolveBulkOperationMaxSelection,\n Resources_Filter_BaseSchema,\n Resources_Filter_DateRangeSchema,\n Resources_Filter_NumberRangeSchema,\n isResourcesFilterNumberRangeSchema,\n Resources_PaginationRequestSchema,\n createPaginationRequestSchema,\n DEFAULT_LIST_PAGE_CEILING,\n DEFAULT_SEARCH_PAGE_CEILING,\n createPaginationResponseMetadataSchema,\n ResourceConfiguration,\n ResourceConfiguration_Operation_ApiCall,\n ResourceConfiguration_Operation,\n ResourceConfiguration_OperationVariant_BuilderParameters,\n ResourceConfiguration_Operation_BuilderParameters,\n ResourceConfiguration_BuilderParameters,\n ResourceConfiguration_InheritanceSchemaDefinition,\n ResourceConfiguration_ResourceRelationships,\n ResourceGeneratedOperationKind,\n ResourcePaginatedResponseResultSchema,\n ResourceSearchQueryRequestResult,\n ResourceSystemAccessMode,\n PersistenceAdapter,\n isPersistenceAdapter,\n SortOrder,\n ValidOperationKeys,\n ResourceCollectionExportConfig,\n ResourceCollectionExportFormat,\n ResourceCollectionExportRowScope,\n ResourceCollectionExportResponseSchema,\n getResourcesFilterPresenceTarget,\n} from './resources-config.shared.schemas';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier, ResourceType } from './resources.shared.core.definitions';\nimport { requestSchemaCarriesField } from './utils/request-schema-field-carriage.shared.utils';\nimport {\n PRIMARY_SCOPE_FIELD_IDENTIFIERS,\n PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE,\n FIELD_IDENTIFIER_TO_PRIMARY_SCOPE,\n RelationshipNature,\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceOperation_ServiceRuntimeMode,\n ResourceParentResourceRequirement,\n ResourcePrimaryScope,\n ResourceRelationship,\n ResourceRelationshipBulkAction,\n ResourceRelationshipBulkActionResultSchema,\n ResourceRelationshipBulkClearOperationRequestSchema,\n ResourceRelationshipBulkCreateOperationRequestSchema,\n ResourceRelationshipBulkLinkOperationRequestSchema,\n ResourceRelationshipBulkReplaceOperationRequestSchema,\n ResourceRelationshipBulkSetOperationRequestSchema,\n ResourceRelationshipBulkUnlinkOperationRequestSchema,\n ResourceRelationshipDeclaration,\n ResourceRelationshipAccessScopeStrategy,\n ResourceRelationshipCardinality,\n ResourceTranspositionPolicy\n} from './resources.shared.schemas';\n\nimport { createResourcesRelationship } from './resources-relationships.shared.factory';\nimport { Resources_SharedUtils } from './resources.shared.utils';\nimport { ResourcesConfigOperationsDtosBuilderUtils } from './utils/resources-config-operations.dtos-builder.utils';\nimport { ResourcesSummaryUtils } from './utils/resources-summary.utils';\nimport { collectTemplatableFileFieldPaths, stripTemplatableFileFieldsRecursively } from './utils/templatable-file-fields.shared.utils';\nimport { selectByPersistenceAdapter, type PersistenceAdapterCases } from './utils/persistence-adapter-discrimination.shared.utils';\nimport {\n isServiceResolvableDefaultOperation,\n SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES,\n URL_BEARING_OPERATION_VARIANT_TYPES,\n} from './utils/resource-operation-type-guards.utils';\n\nimport { describeCaughtError } from '../errors/caught-error-description.shared.utils';\n// --------------------------------\n// Error Helpers\n// --------------------------------\n\n/**\n * Creates a configuration error with ErrorType.CONFIGURATION\n * Used for resource configuration validation errors at build time\n */\n/**\n * Reject an `.impersonalizeWith()` treatment declared BELOW the top level of a retention-governed\n * resource's schema (gate G-FILE / scrub-coverage).\n *\n * The impersonalize writer builds its `$set` from the TOP-LEVEL shape only, and file links are stored\n * under a dotted canonical path (`billingContact.signedMandate`). A nested treatment therefore never\n * reaches the scrub patch and never matches a linked file's `linkedFieldName`: the row flips to\n * RETAINED while the nested personal field — and any file beneath it — survive fully intact, with an\n * audit event asserting the record was impersonalized.\n *\n * Recursive scrubbing (dotted-path patches + the matching file-path recursion) is deliberately out of\n * v1 scope, so this fails at CONFIG BUILD instead of silently under-scrubbing at erasure time. Walks\n * nested ZodObjects (through optional/nullable/default/array wrappers) and every discriminated-union\n * option, mirroring how the runtime resolves field paths.\n */\nfunction assertNoNestedImpersonalizeTreatment(\n schema: z.ZodTypeAny,\n resourceIdentifier: string,\n): void {\n const visited = new Set<unknown>();\n\n const walk = (candidate: z.ZodTypeAny | undefined, path: string, isTopLevel: boolean): void => {\n if (!candidate || visited.has(candidate)) return;\n visited.add(candidate);\n\n if (!isTopLevel && getImpersonalizeTreatment(candidate) !== undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] field '${path}' declares an impersonalize treatment, but it is NESTED. ` +\n `The scrub writes a top-level $set only, so a nested treatment would be silently ignored — the row ` +\n `would flip to RETAINED with '${path}' (and any file linked under it) fully intact. Move the field to ` +\n `the top level, or scrub the whole containing field instead (REMOVE on the parent object).`\n );\n }\n\n const shape = getZodObjectShape(unwrapSchema(candidate) ?? candidate);\n for (const [childName, childSchema] of Object.entries(shape ?? {})) {\n walk(childSchema as z.ZodTypeAny, path ? `${path}.${childName}` : childName, false);\n }\n };\n\n // Top-level fields are legitimately treatable; only their DESCENDANTS are the problem.\n const topLevelShape = getZodObjectShape(schema);\n for (const [fieldName, fieldSchema] of Object.entries(topLevelShape ?? {})) {\n const unwrapped = unwrapSchema(fieldSchema as z.ZodTypeAny) ?? (fieldSchema as z.ZodTypeAny);\n const nestedShape = getZodObjectShape(unwrapped);\n for (const [childName, childSchema] of Object.entries(nestedShape ?? {})) {\n walk(childSchema as z.ZodTypeAny, `${fieldName}.${childName}`, false);\n }\n }\n}\n\nfunction createConfigurationError(message: string): Error {\n const error = new Error(message);\n (error as any).type = ErrorType.CONFIGURATION;\n return error;\n}\n\n/**\n * Whether a dotted path names a field of the resource, descending through nested objects.\n *\n * Dotted because the PostgreSQL filter sanitizer admits a `field.sub` path under a planned JSONB root,\n * so a filter or sort key may legitimately address a nested field. Each segment is unwrapped\n * (optional, default, nullable) before its shape is read.\n */\nfunction schemaHasFieldPath(shape: Record<string, unknown>, path: string): boolean {\n let current: Record<string, unknown> | undefined = shape;\n for (const segment of path.split('.')) {\n const field = current?.[segment] as z.ZodTypeAny | undefined;\n if (!field) return false;\n const unwrapped = (unwrapSchema(field) ?? field) as z.ZodTypeAny;\n current = isZodObject(unwrapped) ? (getZodObjectShape(unwrapped) as Record<string, unknown>) : undefined;\n }\n return true;\n}\n\n/**\n * Refuse a collection operation whose `filterFields`, `sortFields` or own-field `searchableFields` name\n * something the resource does not have (#1806, #1952).\n *\n * Both lists are passed to the repository VERBATIM — the filter allow-list and the sort allow-list are\n * the declared names, nothing else — so a name that is not a field compiles into a condition on a\n * column that does not exist. On MongoDB that matches nothing and answers an empty page; on PostgreSQL\n * a filter fails on a missing column and a sort is silently dropped. Either way the caller gets a wrong\n * answer with no error saying the filter is unsupported, and the published API reference advertises a\n * query parameter that cannot work. Four such names had shipped when this was written: `role` on the\n * organization-member searches (the field is `roles`), `joinedAt` there and on the user searches (no\n * such field), and `hasExpiration` on six credential searches (a question about `expiresAt`, which\n * nothing translated).\n *\n * A filter key is admitted when it names a field, or when it is a presence filter\n * (`createResourcesFilterPresenceSchema`) whose TARGET names one — that is the one declared\n * translation there is. A function-valued entry — the old \"filter-ref transformer\" slot — is refused:\n * nothing ever applied it, so its key reached the database untranslated, which is this defect again.\n *\n * `searchableFields` joined the check with #1952: an own-field name reaches the repository verbatim like the\n * other two, and `ORGANIZATIONS`' SEARCH had shipped `email`, a field an organization does not have — every\n * organization search then failed on PostgreSQL (`column \"email\" does not exist`) while MongoDB quietly\n * matched nothing. A RELATIONAL entry is checked for its `localField`, the half that lives on this resource;\n * its `relatedJoinField` and `fields` belong to the related resource, which is not known here, and a related\n * resource that cannot be resolved already contributes nothing at query time (the fail-safe documented on\n * `SearchableRelationDescriptor`). `_id` is refused as a searchable field even though it is a field: search is a\n * substring match, and MongoDB stores `_id` as an ObjectId and refuses a regex on it, so the search would answer\n * 500 there. A row is found by id through a READ or an `_id` filter.\n *\n * Checked against the EFFECTIVE schema, after the framework injects its own fields, because those are\n * the fields a row actually carries.\n */\nfunction assertCollectionFieldsNameResourceFields(params: {\n resourceIdentifier: string;\n operationLabel: string;\n schemaShape: Record<string, unknown>;\n filterFields: Record<string, unknown> | undefined;\n sortFields: readonly string[] | undefined;\n searchableFields?: readonly unknown[] | undefined;\n}): void {\n const { resourceIdentifier, operationLabel, schemaShape, filterFields, sortFields, searchableFields } = params;\n for (const [key, declaration] of Object.entries(filterFields ?? {})) {\n if (typeof declaration === 'function') {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: filter \"${key}\" is a function. Filter-ref transformers are not supported — nothing applies them, so the key would reach the database untranslated. `\n + 'Declare the field\\'s Zod type, or `createResourcesFilterPresenceSchema(<field>)` for a \"has <field>\" filter.',\n );\n }\n const presenceTarget = getResourcesFilterPresenceTarget(declaration);\n if (presenceTarget !== undefined) {\n if (!schemaHasFieldPath(schemaShape, presenceTarget)) {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: presence filter \"${key}\" asks about \"${presenceTarget}\", which is not a field of the resource.`,\n );\n }\n continue;\n }\n if (!schemaHasFieldPath(schemaShape, key)) {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: filter \"${key}\" is not a field of the resource, so it would match nothing. `\n + 'Name a field, or declare `createResourcesFilterPresenceSchema(<field>)` for a \"has <field>\" filter.',\n );\n }\n }\n for (const field of sortFields ?? []) {\n if (!schemaHasFieldPath(schemaShape, field)) {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: sort field \"${field}\" is not a field of the resource, so sorting by it would be ignored.`,\n );\n }\n }\n for (const entry of searchableFields ?? []) {\n const ownField = typeof entry === 'string' ? entry : undefined;\n const localField = entry && typeof entry === 'object' ? (entry as { localField?: unknown }).localField : undefined;\n if (ownField === '_id') {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: \"_id\" cannot be a searchable field. Search is a substring match, and MongoDB refuses a regex on an ObjectId; find a row by id with a READ or an \\`_id\\` filter.`,\n );\n }\n if (ownField !== undefined && !schemaHasFieldPath(schemaShape, ownField)) {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: searchable field \"${ownField}\" is not a field of the resource, so a search on it fails on PostgreSQL and matches nothing on MongoDB.`,\n );\n }\n if (typeof localField === 'string' && !schemaHasFieldPath(schemaShape, localField)) {\n throw createConfigurationError(\n `Resource \"${resourceIdentifier}\" ${operationLabel}: relational searchable entry joins on \"${localField}\", which is not a field of the resource.`,\n );\n }\n }\n}\n\n/**\n * Creates a validation error with ErrorType.VALIDATION\n * Used for runtime data validation errors\n */\nfunction createValidationError(message: string): Error {\n const error = new Error(message);\n (error as any).type = ErrorType.VALIDATION;\n return error;\n}\n\n/**\n * Reads the shared authority rather than re-listing the members: the URL-bearing\n * set is consumed by the route-mount gate, the URL/DTO resolver and this factory,\n * and a variant type added to one copy but not another silently changes which\n * operations get routes.\n */\nfunction isUrlisableOperationVariantType(variantType: ResourceOperationVariantType): boolean {\n return URL_BEARING_OPERATION_VARIANT_TYPES.includes(variantType);\n}\n\n/**\n * Refuse a `submissionChallenge` declaration the runtime could never honour (#1985).\n *\n * - On a variant that receives no HTTP request (INTERNAL_CALL, a cron or batch job, REPOSITORY_ONLY), no caller can send\n * the `x-submission-challenge-response` header, and such a variant is reached by the server rather than by a visitor.\n * The declaration would say \"protected\" while refusing every unauthenticated execution.\n * - An action outside the captcha vendor's grammar would be minted by no vendor, so every token for it would be refused\n * and only the proof of work could answer: a protection that silently loses half of itself.\n *\n * Thrown while the resource configuration is BUILT, so the application cannot start with either shape. The INLINE\n * requirement is checked at application start instead, because the runtime mode can be set after this factory runs.\n */\nfunction assertSubmissionChallengeDeclaration(\n operation: string,\n variantType: ResourceOperationVariantType,\n declaration: ResourceOperationSubmissionChallenge | undefined,\n): void {\n if (declaration === undefined) return;\n if (!isUrlisableOperationVariantType(variantType)) {\n throw createConfigurationError(\n `Operation '${operation}' declares a submission challenge on a '${variantType}' variant. Only a variant reached by an `\n + 'HTTP request can receive the challenge answer; declare it on the API_CALL variant a visitor calls.',\n );\n }\n if (!isSubmissionChallengeActionName(declaration.action)) {\n throw createConfigurationError(\n `Operation '${operation}' declares the submission-challenge action '${String(declaration.action)}'. An action is 1 to 100 `\n + 'letters, digits, underscores or slashes, the only names a captcha vendor mints tokens for.',\n );\n }\n}\n\n/**\n * The operations a `retentionPolicy` resource must expose to the SERVICE dispatch\n * layer, with the retention primitive that needs each one.\n *\n * Every entry is consumed by BOTH halves of the retention operation contract — the\n * presence check (is it declared in `coreOperations`?) and the resolvability check\n * (does it have a default variant `getServiceOperationPathDefault` can serve?) — so\n * adding a fourth primitive here extends both at once. Listing the ops twice is how\n * a primitive gets a presence guard and no resolvability guard.\n */\nconst RETENTION_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS: readonly {\n operation: CoreResourceOperation;\n primitive: string;\n why: string;\n}[] = [\n {\n operation: CoreResourceOperation.UPDATE_MANY,\n primitive: 'updateManyAsSystem',\n why: 'the impersonalize writer scrubs rows in place via updateManyAsSystem',\n },\n {\n operation: CoreResourceOperation.READ,\n primitive: 'readRetainedAsSystem',\n why: 'the see-through read primitive readRetainedAsSystem surfaces a single retained record via READ',\n },\n {\n operation: CoreResourceOperation.LIST,\n primitive: 'listRetainedAsSystem',\n why: 'the see-through read primitive listRetainedAsSystem surfaces retained records via LIST',\n },\n];\n\n/**\n * The operations an `isAnonymizable` resource must expose to the SERVICE dispatch\n * layer, with the `AnonymousSessionBackendService` primitive that needs each one.\n *\n * Sibling of {@link RETENTION_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS} and consumed by\n * the same TWO halves — presence (is it declared in `coreOperations`?) and\n * resolvability (does it have a default variant `getServiceOperationPathDefault`\n * can serve?). A separate constant rather than a shared one, because the two\n * capabilities demand different operations for different reasons and merging them\n * would make each entry's `why` unreadable.\n *\n * **Each entry is a DISJUNCTION, and that is the whole design decision.** Retention\n * needs three specific operations, so its constant is a flat list of single ops.\n * The anonymous-session cleanup needs to DELETE a known id set, and\n * `deleteOwnedRecords` deliberately serves that with `DELETE_MANY` when the\n * resource publishes one and per-row `DELETE` otherwise — so demanding\n * `DELETE_MANY` would force every anonymizable resource to publish a bulk-delete\n * surface it may not want (`draftNotes`, the only such resource today, publishes\n * `DELETE` alone), while demanding `DELETE` would refuse a resource that\n * legitimately publishes only the bulk form. The honest requirement is \"at least\n * one of these resolves\", which is exactly what the runtime probes.\n *\n * Measured 2026-09-09: before this guard existed, `deleteOwnedRecords` resolved\n * `DELETE_MANY` unconditionally, so for `draftNotes` the cleanup batch's phase 1\n * threw on every run — the per-session catch counted an error and the\n * `ANONYMOUS_USERS` anchor row was never removed. The runtime is now correct; this\n * constant is what refuses the configuration at boot instead of discovering it at\n * the first sweep.\n */\nconst ANONYMIZABLE_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS: readonly {\n /** Alternatives — the requirement is satisfied when AT LEAST ONE of these is declared / resolvable. */\n operations: readonly CoreResourceOperation[];\n primitive: string;\n why: string;\n}[] = [\n {\n operations: [CoreResourceOperation.LIST],\n primitive: 'listAnonymousRecords',\n why: 'the transposition and cleanup lookups list a session\\'s rows via LIST',\n },\n {\n operations: [CoreResourceOperation.UPDATE_MANY],\n primitive: 'reassignOwnership (updateManyAsSystem)',\n why: 'the anon→user transposition rewrites { userId, anonymousUserId } via updateManyAsSystem',\n },\n {\n operations: [CoreResourceOperation.DELETE_MANY, CoreResourceOperation.DELETE],\n primitive: 'deleteOwnedRecords',\n why: 'the expired-session sweep, the DISCARD transposition arm and the REPLACE pre-delete all remove '\n + 'a known id set, preferring DELETE_MANY and falling back to per-row DELETE',\n },\n];\n\n/** Human-readable \"A or B\" rendering of one requirement group's alternatives. */\nfunction describeOperationAlternatives(operations: readonly CoreResourceOperation[]): string {\n return operations.length === 1 ? String(operations[0]) : operations.join(' or ');\n}\n\nfunction assertOperationPathKeySegment(value: string, label: string, operation: string): void {\n if (value.includes(' | ')) {\n throw createConfigurationError(\n `Operation '${operation}' cannot use ${label} '${value}' because operation path keys reserve the delimiter ' | '`,\n );\n }\n}\n\nfunction createGeneratedRelationshipBulkOperations(\n operations: any[],\n relevantRelationships: ResourceRelationship[],\n resourceIdentifier: ResourceType,\n allResourceFieldIdentifiers: Partial<Record<ResourceType, string>> | Record<string, string>\n): any[] {\n const baseBulkUpdateOperations = operations.filter((operation) =>\n isUrlisableOperationVariantType(operation.variantType)\n && operation.operationIdentifier === CoreResourceOperation.UPDATE\n && 'isBulkOperation' in operation\n && operation.isBulkOperation === true\n );\n\n if (baseBulkUpdateOperations.length > 1) {\n throw createConfigurationError(\n `[${resourceIdentifier}] generated bulk relationship operations require exactly one API bulk UPDATE base operation, but found ${baseBulkUpdateOperations.length}`\n );\n }\n\n const [baseBulkUpdateOperation] = baseBulkUpdateOperations;\n\n if (!baseBulkUpdateOperation) {\n return [];\n }\n\n const generatedOperations: any[] = [];\n const knownOperationIdentifiers = new Set(\n operations.map((operation) => String(operation.operationIdentifier))\n );\n\n for (const relationship of relevantRelationships) {\n const relationshipField = Resources_SharedUtils.resolveRelationshipObjectIdentityForResource(\n relationship,\n resourceIdentifier,\n allResourceFieldIdentifiers\n ).objectFieldName;\n const allowedActions = Resources_SharedUtils.resolveAllowedBulkRelationshipActionsForResource(\n relationship,\n resourceIdentifier\n );\n\n for (const action of allowedActions) {\n const operationIdentifier = Resources_SharedUtils.buildRelationshipBulkOperationIdentifier(\n action,\n relationshipField\n );\n\n if (knownOperationIdentifiers.has(operationIdentifier)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] generated bulk relationship operation \"${operationIdentifier}\" collides with an existing operation identifier`\n );\n }\n\n knownOperationIdentifiers.add(operationIdentifier);\n\n const requestDto = (() => {\n switch (action) {\n case ResourceRelationshipBulkAction.SET:\n return ResourceRelationshipBulkSetOperationRequestSchema;\n case ResourceRelationshipBulkAction.CLEAR:\n return ResourceRelationshipBulkClearOperationRequestSchema;\n case ResourceRelationshipBulkAction.CREATE:\n return ResourceRelationshipBulkCreateOperationRequestSchema;\n case ResourceRelationshipBulkAction.LINK:\n return ResourceRelationshipBulkLinkOperationRequestSchema;\n case ResourceRelationshipBulkAction.UNLINK:\n return ResourceRelationshipBulkUnlinkOperationRequestSchema;\n case ResourceRelationshipBulkAction.REPLACE:\n return ResourceRelationshipBulkReplaceOperationRequestSchema;\n }\n })();\n\n generatedOperations.push({\n ...baseBulkUpdateOperation,\n operationIdentifier,\n isDefault: false,\n isOperationDefault: false,\n isBulkOperation: true,\n resourceOperationLike: CoreResourceOperation.UPDATE_MANY,\n requestDto,\n // Generated bulk-relationship ops own an explicit request contract (the\n // bulk action schema above) — preserve it verbatim, never rebuild.\n hasCustomRequestDto: true,\n responseDto: ResourceRelationshipBulkActionResultSchema,\n hasCustomResponseDto: true,\n basicPrefixOperation: undefined,\n notificationBadgeOperations: [],\n userNotifications: [],\n m2mNotifications: [],\n tokenGeneration: undefined,\n tokenRevocation: undefined,\n });\n }\n }\n\n return generatedOperations;\n}\n\nexport function reconcileGeneratedRelationshipBulkOperations(\n resourceConfigurations: Record<string, AnyResourceConfiguration>,\n allResourceRelationships: ResourceRelationship[],\n allResourceFieldIdentifiers: Partial<Record<ResourceType, string>> | Record<string, string>\n): void {\n for (const [resourceType, resourceConfiguration] of Object.entries(resourceConfigurations)) {\n if (!Array.isArray(resourceConfiguration.operations)) {\n continue;\n }\n\n const currentResourceType = resourceType as ResourceType;\n const nonGeneratedOperations = resourceConfiguration.operations.filter(\n (operation) => !Resources_SharedUtils.parseRelationshipBulkOperationIdentifier(String(operation.operationIdentifier))\n );\n const relevantRelationships = allResourceRelationships.filter(\n (relationship) =>\n relationship.resourceType1 === currentResourceType\n || relationship.resourceType2 === currentResourceType\n );\n\n resourceConfiguration.operations = [\n ...nonGeneratedOperations,\n ...createGeneratedRelationshipBulkOperations(\n nonGeneratedOperations,\n relevantRelationships,\n currentResourceType,\n allResourceFieldIdentifiers\n ),\n ];\n }\n}\n\n/**\n * Derive the file-export companion of every LIST/SEARCH operation that declared\n * `collectionExport`.\n *\n * ## Why derived rather than authored\n *\n * The export must be exactly as reachable as the listing it exports — never more. Copying the source\n * operation wholesale and overriding only what must differ makes that structural: an author cannot\n * give the export wider `roles`, a different parent-scope path, or a laxer variant, because they\n * never write it. It is the same construction `createGeneratedFileRegenerateOperations` uses one\n * function above.\n *\n * ## What is deliberately CLEARED rather than inherited\n *\n * `mcp` is the one that matters. A LIST curated onto an MCP server is a PAGINATED read tool; its\n * export companion returns the whole result set in a single call, which is a different risk profile.\n * Spreading the source operation would silently turn \"this app declared an export\" into \"this app\n * grew a new agent tool that exfiltrates the table\", so the flag is dropped and an application that\n * genuinely wants an agent-callable export has to say so.\n *\n * The notification/token fields are cleared for the same reason they are on the regenerate\n * companion: they describe effects of the SOURCE operation and firing them again on an export would\n * double-notify.\n */\nfunction createGeneratedCollectionExportOperations(params: {\n operations: any[];\n resourceIdentifier: ResourceType;\n}): any[] {\n const knownOperationIdentifiers = new Set(\n params.operations.map((operation) => String(operation.operationIdentifier)),\n );\n\n const exportOperations: any[] = [];\n\n for (const operation of params.operations) {\n const exportConfig = (operation as { collectionExport?: ResourceCollectionExportConfig }).collectionExport;\n if (!exportConfig) {\n continue;\n }\n\n const sourceOperationIdentifier = String(operation.operationIdentifier);\n\n if (!isUrlisableOperationVariantType(operation.variantType)) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" declares collectionExport but is not URL-bearing; an export has no route to live on`\n );\n }\n\n // The source's CORE verb decides which service call the export re-runs, and it is the only thing\n // that can: a custom operation carries LIST/SEARCH semantics through `resourceOperationLike`.\n const sourceCoreOperation = (operation.resourceOperationLike ?? operation.operationIdentifier) as CoreResourceOperation;\n if (sourceCoreOperation !== CoreResourceOperation.LIST && sourceCoreOperation !== CoreResourceOperation.SEARCH) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" declares collectionExport but is neither LIST nor SEARCH (resolved core operation: ${String(sourceCoreOperation)})`\n );\n }\n\n // Empty arrays are a startup error, never a silent \"offer everything\" — the same rule\n // `mcp.servers` follows, so the declaration always reads as \"exactly these\".\n if (!exportConfig.formats || exportConfig.formats.length === 0) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" declares collectionExport with no formats; declare at least one, or omit collectionExport entirely`\n );\n }\n if (!exportConfig.rowScopes || exportConfig.rowScopes.length === 0) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" declares collectionExport with no rowScopes; declare at least one, or omit collectionExport entirely`\n );\n }\n // A PDF is rendered by a template, so declaring the format without naming one leaves the export\n // nothing to render with; naming one without the format is a declaration nothing reads (#1645).\n const offersPdf = exportConfig.formats.includes(ResourceCollectionExportFormat.PDF);\n if (offersPdf && !exportConfig.pdfTemplateId?.trim()) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" offers the PDF collection-export format but names no pdfTemplateId; a PDF export is rendered by a template`\n );\n }\n if (!offersPdf && exportConfig.pdfTemplateId !== undefined) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" names collectionExport.pdfTemplateId but does not offer the PDF format; add ResourceCollectionExportFormat.PDF or remove the template id`\n );\n }\n if (exportConfig.maximumExportedRows !== undefined && exportConfig.maximumExportedRows <= 0) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" declares a non-positive collectionExport.maximumExportedRows; omit it for no ceiling`\n );\n }\n // A PDF cannot stream: the template lays out every row at once, in memory, before a byte is sent. So a\n // whole-set PDF must declare how many rows it will hold — an unbounded one is an allocation any\n // caller with the listing's roles can make as large as the table (#1645). CSV and JSON stream and\n // keep their optional ceiling.\n if (offersPdf\n && exportConfig.rowScopes.includes(ResourceCollectionExportRowScope.FULL_RESULT_SET)\n && exportConfig.maximumExportedRows === undefined) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] operation \"${sourceOperationIdentifier}\" offers a whole-set PDF export without collectionExport.maximumExportedRows; a PDF is built in memory from every row, so it must declare its ceiling`\n );\n }\n\n const operationIdentifier = Resources_SharedUtils.buildGeneratedCollectionExportOperationIdentifier(sourceOperationIdentifier);\n if (knownOperationIdentifiers.has(operationIdentifier)) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] generated collection export operation \"${operationIdentifier}\" collides with an existing operation identifier`\n );\n }\n knownOperationIdentifiers.add(operationIdentifier);\n\n exportOperations.push({\n ...operation,\n operationIdentifier,\n isDefault: false,\n isOperationDefault: false,\n isBulkOperation: false,\n httpVerb: HttpMethod.GET,\n // Keeps the URL builder treating it as collection-level, and gives a SEARCH export the\n // `search` segment its source already has — so the two exports of one resource cannot collide.\n resourceOperationLike: sourceCoreOperation,\n generatedOperation: {\n kind: ResourceGeneratedOperationKind.GENERATED_COLLECTION_EXPORT,\n sourceOperationIdentifier,\n sourceCoreOperation,\n export: exportConfig,\n },\n // The export takes the SOURCE's query contract (filters, sort, q, pagination) verbatim plus its\n // own two selectors, so \"export what I am looking at\" is expressible without a second grammar.\n responseDto: ResourceCollectionExportResponseSchema,\n internalDto: ResourceCollectionExportResponseSchema,\n hasCustomResponseDto: true,\n // Cleared, not inherited — see this function's docstring.\n mcp: undefined,\n collectionExport: undefined,\n basicPrefixOperation: undefined,\n notificationBadgeOperations: [],\n userNotifications: [],\n m2mNotifications: [],\n tokenGeneration: undefined,\n tokenRevocation: undefined,\n });\n }\n\n return exportOperations;\n}\n\nfunction createGeneratedFileRegenerateOperations(params: {\n operations: any[];\n resourceIdentifier: ResourceType;\n resourceFieldIdentifier: string;\n mainSchema: z.ZodTypeAny;\n generatedFileDiscoverySchema?: z.ZodTypeAny;\n persistenceAdapter?: unknown;\n}): any[] {\n const generatedFileDiscoverySchema = params.generatedFileDiscoverySchema ?? params.mainSchema;\n const collectedFields = collectTemplatableFileFieldPaths(generatedFileDiscoverySchema);\n const arrayContainedFields = collectedFields.filter((field) => field.isInsideArray);\n if (arrayContainedFields.length > 0) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] generated PDF file fields inside arrays or dynamic containers are not supported in v1: ${arrayContainedFields.map((field) => field.fieldName).join(', ')}`\n );\n }\n\n const generatedFields = collectedFields.filter(\n (field) => !field.isInsideArray,\n );\n if (generatedFields.length === 0) {\n return [];\n }\n /**\n * A generated document is MATERIALIZED: rendering it writes a FILES metadata row that must\n * commit in the SAME native transaction as the row that owns it, or a failure between the two\n * leaves either a dangling document reference or an orphaned blob. So the only question this\n * guard can honestly ask of a DECLARATION is whether the declared adapter is one that HAS a\n * transactional local store at all.\n *\n * ## What changed, and why the old shape was wrong rather than merely conservative\n *\n * This refused every adapter except MongoDB, on the grounds that file metadata was pinned to\n * MongoDB, so a generated PDF on a PostgreSQL resource would have crossed adapters. That reason\n * is gone: FILES was un-pinned and now FOLLOWS the application's default adapter\n * (`files.shared.resources-config.schemas.ts:43-67`), precisely so a resource and its file\n * metadata share one native transaction. A PostgreSQL application whose FILES is therefore also\n * PostgreSQL was being refused at authoring time for a boundary that no longer exists.\n *\n * The ASYMMETRY was the tell, and it is the reason this could not be left alone: `undefined` —\n * \"follow the application default\" — was and is admitted, so the identical resource in the\n * identical PostgreSQL application was already authorable by SAYING LESS. A guard whose answer\n * depends on whether a redundant declaration was written is testing the declaration, not the\n * capability.\n *\n * ## What still refuses, and why that half is load-bearing\n *\n * `INTROSPECTION` rows are recomputed per read — there is no store and no transaction. `HTTP_API`\n * rows live in someone else's system and are read-only by construction. Neither can own a\n * locally-materialized document row, and unlike the PostgreSQL case that is knowable from the\n * declaration alone, so refusing at authoring time is strictly better than discovering it on the\n * first write. `getDatabaseServiceForAdapter` says the same thing at runtime, for the same two\n * adapters, in the same words.\n *\n * ## Shape\n *\n * Expressed as an exhaustive `PersistenceAdapterCases` map rather than a comparison, so a fifth\n * backing kind is a COMPILE error here instead of silently inheriting whichever arm an `else`\n * happened to mean — the failure mode `selectByPersistenceAdapter` exists to remove, and the one\n * the previous `!== MONGODB` shape genuinely had in the other direction (it would have refused a\n * future stored adapter without anyone deciding to).\n *\n * `isPersistenceAdapter` runs FIRST so an erased or unknown declaration keeps refusing through\n * `createConfigurationError` with the resource and the field list named, rather than through the\n * selector's plain `Error`. This factory is a shared-tier authoring surface: its refusals are\n * read by an application author, and the field list is the actionable half.\n *\n * ## What this guard deliberately does NOT decide\n *\n * It cannot see the application's default adapter, so it cannot tell whether THIS resource and\n * FILES resolve to the same store — a resource declaring `POSTGRESQL` inside a MongoDB-default\n * application is a real cross-adapter boundary and must still be refused. That refusal is made\n * where the resolved adapters are actually known, at\n * `services-registry-handler.backend.service.ts` →\n * `assertGeneratedFileMaterializationCommitsWithRow`, which asks the persistence unit of work\n * whether `{this resource, FILES-as-ATOMIC}` can commit atomically and throws\n * `MIXED_PERSISTENCE_ADAPTERS` when it cannot. It gates all three materialization entry points\n * (create, createMany, regenerate) and, unlike this one, also covers the undeclared case this\n * guard has always waved through — which is why relaxing here narrows nothing.\n */\n const GENERATED_DOCUMENT_MATERIALIZATION_SUPPORT: PersistenceAdapterCases<boolean> = {\n [PersistenceAdapter.MONGODB]: true,\n [PersistenceAdapter.POSTGRESQL]: true,\n [PersistenceAdapter.INTROSPECTION]: false,\n [PersistenceAdapter.HTTP_API]: false,\n };\n if (params.persistenceAdapter !== undefined) {\n const declaredAdapter = params.persistenceAdapter;\n const materializationIsSupported = isPersistenceAdapter(declaredAdapter)\n && selectByPersistenceAdapter(declaredAdapter, GENERATED_DOCUMENT_MATERIALIZATION_SUPPORT);\n if (!materializationIsSupported) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] generated PDF file fields require a persistence adapter with a transactional local store, `\n + `so that the generated file's metadata row commits with the row that owns it `\n + `(declared adapter: '${String(declaredAdapter)}'; supported: `\n + `'${PersistenceAdapter.MONGODB}', '${PersistenceAdapter.POSTGRESQL}', or no declaration to follow the application default): `\n + `${generatedFields.map((field) => field.fieldName).join(', ')}`\n );\n }\n }\n\n const baseUpdateOperation = params.operations.find((operation) =>\n isUrlisableOperationVariantType(operation.variantType)\n && operation.operationIdentifier === CoreResourceOperation.UPDATE\n && 'isBulkOperation' in operation\n && operation.isBulkOperation !== true\n && operation.isOperationDefault === true\n );\n if (!baseUpdateOperation) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] generated file regenerate operations require a default non-bulk URL-bearing UPDATE operation`\n );\n }\n\n const knownOperationIdentifiers = new Set(\n params.operations.map((operation) => String(operation.operationIdentifier))\n );\n const responseDto = z.object({\n /*\n * A FILE value, marked as one (`z_file()`), not the bare `SingleFileValueSchema` shape. The shape alone is a plain\n * `{ fileId, updatedAt }` object, so every label walk read it as a nested object of two fields: the application\n * labelling planner planned `fields.file.fileId` and `fields.file.updatedAt` for every resource carrying a generated\n * PDF, words no screen reads (#1959). Marked, it classifies as `FieldSchemaType.FILE` like the field it was\n * regenerated from, and is labelled — and displayed — as one file. Generated files are PDFs (`generation` pins that\n * mime type on the source field), so the response says the same; the `generation` block itself names one template\n * and cannot describe a DTO shared by every generated field of the resource.\n */\n file: z_file({ allowedMimeTypes: 'PDF' }).describe('The newly generated file.'),\n // The record is this resource's own, so its fields are described by its specification (#1625).\n resource: markEmbeddedResourceSchema(generatedFileDiscoverySchema, String(params.resourceIdentifier))\n .describe('The record after the regenerated file was stored on it.'),\n });\n\n return generatedFields.map(({ fieldName }) => {\n const operationIdentifier = Resources_SharedUtils.buildGeneratedFileRegenerateOperationIdentifier(fieldName);\n if (knownOperationIdentifiers.has(operationIdentifier)) {\n throw createConfigurationError(\n `[${params.resourceIdentifier}] generated file regenerate operation \"${operationIdentifier}\" collides with an existing operation identifier`\n );\n }\n knownOperationIdentifiers.add(operationIdentifier);\n\n return {\n ...baseUpdateOperation,\n operationIdentifier,\n isDefault: false,\n isOperationDefault: false,\n isBulkOperation: false,\n httpVerb: HttpMethod.POST,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n generatedOperation: {\n kind: ResourceGeneratedOperationKind.GENERATED_FILE_REGENERATE,\n fieldName,\n },\n requestDto: z.object({}),\n // Generated file-regenerate ops own their request contract: an intentionally\n // empty body (regeneration is UPDATE-like but takes no input). Preserve it,\n // do not rebuild from mainSchema decorators.\n hasCustomRequestDto: true,\n responseDto,\n internalDto: responseDto,\n hasCustomResponseDto: true,\n basicPrefixOperation: undefined,\n notificationBadgeOperations: [],\n userNotifications: [],\n m2mNotifications: [],\n tokenGeneration: undefined,\n tokenRevocation: undefined,\n };\n });\n}\n\n// --------------------------------\n// Token Config Validation\n// --------------------------------\n\nconst BULK_MUTATION_CORE_OPERATIONS: ReadonlySet<CoreResourceOperation> = new Set([\n CoreResourceOperation.CREATE_MANY,\n CoreResourceOperation.UPDATE_MANY,\n CoreResourceOperation.DELETE_MANY,\n]);\nconst TOKEN_STATE_EFFECT_UNSUPPORTED_CORE_OPERATIONS: ReadonlySet<CoreResourceOperation> = new Set([\n ...BULK_MUTATION_CORE_OPERATIONS,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.COUNT,\n]);\n\nfunction isCoreBulkMutationOperation(\n operationIdentifier: unknown,\n): boolean {\n return BULK_MUTATION_CORE_OPERATIONS.has(\n operationIdentifier as CoreResourceOperation,\n );\n}\n\nfunction isTokenStateEffectUnsupportedOperation(\n operationIdentifier: unknown,\n): boolean {\n return TOKEN_STATE_EFFECT_UNSUPPORTED_CORE_OPERATIONS.has(\n operationIdentifier as CoreResourceOperation,\n );\n}\n\n/**\n * Validates tokenGeneration configuration at build time.\n * Catches common mistakes before the app starts.\n */\nfunction validateTokenGenerationConfig(\n config: TokenGenerationConfig,\n resourceIdentifier: string,\n operationIdentifier: string,\n): void {\n const prefix = `[${resourceIdentifier}.${operationIdentifier}] tokenGeneration`;\n\n // BOUNDED_REUSE requires maxUses\n if (config.consumptionMode === ConsumableToken_ConsumptionMode.BOUNDED_REUSE) {\n if (config.maxUses == null || config.maxUses < 1) {\n throw createConfigurationError(\n `${prefix}: consumptionMode is BOUNDED_REUSE but maxUses is ${config.maxUses ?? 'missing'}. ` +\n `BOUNDED_REUSE tokens must specify maxUses >= 1.`,\n );\n }\n }\n\n // maxUses should NOT be set for non-BOUNDED_REUSE modes (likely a mistake)\n if (config.consumptionMode !== ConsumableToken_ConsumptionMode.BOUNDED_REUSE && config.maxUses != null) {\n throw createConfigurationError(\n `${prefix}: maxUses is set (${config.maxUses}) but consumptionMode is ${config.consumptionMode}. ` +\n `maxUses is only valid for BOUNDED_REUSE tokens. Remove maxUses or change consumptionMode.`,\n );\n }\n\n // tokenType is required\n if (!config.tokenType) {\n throw createConfigurationError(`${prefix}: tokenType is required.`);\n }\n\n // expiresIn is required\n if (config.expiresIn == null) {\n throw createConfigurationError(`${prefix}: expiresIn is required (static value or derived function).`);\n }\n\n // If expiresIn is static, validate shape (minutes, hours, days only; value >= 1)\n if (typeof config.expiresIn !== 'function') {\n const result = ExpiresInDurationSchema.safeParse(config.expiresIn);\n if (!result.success) {\n const msg = result.error.issues.map((i) => i.message).join('; ');\n throw createConfigurationError(`${prefix}: expiresIn validation failed: ${msg}`);\n }\n }\n\n // W7.3b: createsOneOffSession requires consumeAt\n if (config.createsOneOffSession && !config.consumeAt) {\n throw createConfigurationError(\n `${prefix}: createsOneOffSession is true but consumeAt is missing. ` +\n `Specify 'EXCHANGE' or 'TARGET_OPERATION'.`,\n );\n }\n\n // W7.3b: consumeAt without createsOneOffSession is a mistake\n if (config.consumeAt && !config.createsOneOffSession) {\n throw createConfigurationError(\n `${prefix}: consumeAt is set ('${config.consumeAt}') but createsOneOffSession is not true. ` +\n `consumeAt only applies to one-off session tokens.`,\n );\n }\n}\n\n/**\n * Validates tokenAuthentication configuration at build time.\n *\n * **The only thing this refuses is an EMPTY `types` array, and that is the whole point.**\n * `types: []` is well-typed, reads as \"no restriction needed\", and used to fail OPEN: the runtime\n * collapsed an empty list to `undefined` and `ConsumableTokenBackendService.validateToken` treats\n * `undefined` as \"the caller does its own binding check\", so the operation accepted EVERY consumable\n * token type in the system — a password-reset link, an email-verification link, an OAuth state token\n * — with that token's `roles` flowing into the execution context. That is the confused-deputy shape:\n * one token namespace, several verifiers, and an audience check that was optional at the verifier.\n *\n * Refusing here rather than at the verifier is deliberate. A runtime refusal turns an authoring\n * mistake into a request-time failure on a path nobody may exercise before production; a build-time\n * refusal makes the shape unrepresentable, because a resource config is constructed at module load\n * and an application carrying one cannot boot. `validateToken` ALSO refuses an empty array now, as\n * the chokepoint backstop for a config that never passed through this factory — see issue #313.\n *\n * An operation that genuinely wants no type constraint has no expression here and must not get one:\n * the correct authoring is to name every type the operation accepts. A verifier that owns its own\n * binding check (the file-share download, `validateFileToken`) calls `validateToken` directly and\n * never declares `tokenAuthentication` at all.\n */\nfunction validateTokenAuthenticationConfig(\n config: TokenAuthenticationConfig,\n resourceIdentifier: string,\n operationIdentifier: string,\n): void {\n const prefix = `[${resourceIdentifier}.${operationIdentifier}] tokenAuthentication`;\n\n if (!config.types || config.types.length === 0) {\n throw createConfigurationError(\n `${prefix}: types must be a non-empty array of the consumable token types this operation accepts. ` +\n `An empty list is not \"no restriction\" — it would accept EVERY consumable token type in the ` +\n `system (password-reset, email-verification, OAuth state, …) as authentication for this ` +\n `operation, with that token's roles. Name the types explicitly.`,\n );\n }\n\n if (!config.policy) {\n throw createConfigurationError(\n `${prefix}: policy is required (ALTERNATIVE — the token replaces JWT auth; or ADDITIVE — the ` +\n `token is required on top of it).`,\n );\n }\n}\n\n/**\n * Validates tokenRevocation configuration at build time.\n */\nfunction validateTokenRevocationConfig(\n config: TokenRevocationConfig,\n resourceIdentifier: string,\n operationIdentifier: string,\n): void {\n const prefix = `[${resourceIdentifier}.${operationIdentifier}] tokenRevocation`;\n\n if (!config.tokenTypes || config.tokenTypes.length === 0) {\n throw createConfigurationError(`${prefix}: tokenTypes must be a non-empty array of token types to revoke.`);\n }\n}\n\n// --------------------------------\n// Required Features Normalization\n// --------------------------------\n\n/**\n * Normalizes requiredFeatures input to the full form.\n * - undefined → undefined (no features required)\n * - string[] → { features: [...], mode: 'OR' } (shorthand)\n * - full config → passed through as-is\n */\nfunction normalizeRequiredFeatures(input: RequiredFeaturesConfig | undefined): RequiredFeaturesNormalized | undefined {\n if (input === undefined) return undefined;\n if (Array.isArray(input)) {\n // Shorthand: string[] → { features: [...], mode: 'OR' }\n return { features: input, mode: 'OR' };\n }\n return input;\n}\n\n// --------------------------------\n// DTO Auto-Derivation Utilities\n// --------------------------------\n\n/**\n * @wildo_source:part:start saas.models.resource-config.system-managed-fields facet:layer:shared facet:audience:app-developer\n *\n * The field names the framework owns. They are removed from every generated CREATE and UPDATE\n * request contract, for every resource, whatever your schema declares and whatever a caller sends.\n *\n * Declaring one of these in a resource schema is fine and often necessary — the framework maintains\n * the value. What you cannot do is accept it from a client, default it in a form, or require it on a\n * create: the field is stripped before validation runs, so a form that collects it submits a value\n * that is discarded, and a schema that requires it rejects every request.\n *\n * | field | who writes it |\n * |---|---|\n * | `_id` | the persistence layer (or your own `.isPrimaryKey()` field, stored beneath it) |\n * | `createdAt` / `updatedAt` / `deletedAt` | the repository, on write |\n * | `createdByUserId` | the repository, stamped from the execution context on CREATE, immutable afterwards |\n * | `_version_db_doc` | the framework's optimistic-concurrency marker |\n *\n * The failure this prevents is quiet and was paid for once: a create form validating against a\n * reserved field that no form collects fails every submit with `expected string, received undefined`,\n * and the schema looks correct while it does. So the exclusion is unconditional and does not depend\n * on the resource author remembering `.excludeFromCreate()`.\n *\n * ⚠️ A NARROWER set — `_id`, `createdAt`, `updatedAt`, `deletedAt`, `_version_db_doc` — is\n * additionally *mandatory-discard*: even a trusted in-process system write cannot re-attach those\n * through `preserveServerInjectedFields`. `createdByUserId` is deliberately not in that set, because\n * an engine flow creating a row on somebody's behalf legitimately needs to stamp it.\n */\nconst SYSTEM_MANAGED_FIELDS = ['_id', 'createdAt', 'updatedAt', 'deletedAt', 'createdByUserId', '_version_db_doc'] as const;\n/** @wildo_source:part:end saas.models.resource-config.system-managed-fields */\n\n// PRIMARY_SCOPE_FIELD_IDENTIFIERS and getPrimaryScopeFieldIdentifier imported from resources.shared.schemas\n\n/**\n * Build a CREATE request DTO from the main schema using decorators.\n *\n * Excludes:\n * - System-managed fields (_id, createdAt, updatedAt, etc.)\n * - Virtual fields (computed, not stored)\n * - Fields with excludeFromCreate decorator\n *\n * NOTE: Backend-only fields (isBackendOnly) are NOT excluded from CREATE DTOs.\n * The isBackendOnly decorator controls RESPONSE filtering (what is returned to clients),\n * not REQUEST filtering (what can be set during creation). Backend operations need to\n * set fields like passwordHash, apiKey, etc. directly during resource creation.\n *\n * @param mainSchema - The main resource schema\n * @param customExclusions - Additional fields to exclude\n * @returns A new schema with only creatable fields\n */\nexport function buildCreateRequestDto<T extends z.ZodTypeAny>(\n mainSchema: T,\n customExclusions?: string[]\n): z.ZodTypeAny {\n try {\n const shape = getZodObjectShape(mainSchema);\n const createShape: Record<string, z.ZodTypeAny> = {};\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const typedSchema = fieldSchema as z.ZodTypeAny;\n\n // Exclude system-managed fields\n if ((SYSTEM_MANAGED_FIELDS as readonly string[]).includes(fieldName)) continue;\n\n // Exclude primary scope field identifiers (auto-populated from context)\n if ((PRIMARY_SCOPE_FIELD_IDENTIFIERS as readonly string[]).includes(fieldName)) continue;\n\n // Exclude virtual fields (computed, not stored)\n if (isVirtualField(typedSchema)) continue;\n\n // Exclude explicitly marked fields\n if (isExcludedFromCreate(typedSchema)) continue;\n\n // Exclude generated file fields; clients cannot upload or author values\n // that are materialized by framework-owned operations.\n if (isTemplatableFileField(typedSchema)) continue;\n\n // NOTE: Backend-only fields are NOT excluded here.\n // isBackendOnly controls response filtering, not request filtering.\n // Backend operations need to set fields like passwordHash directly.\n\n // Exclude non-discriminator literals (fixed values auto-populated by backend)\n // Discriminator literals are kept for variant selection\n const unwrapped = unwrapSchema(typedSchema);\n if (getZodType(unwrapped) === 'literal' && !isDiscriminatorField(typedSchema)) continue;\n\n // Exclude custom exclusions\n if (customExclusions?.includes(fieldName)) continue;\n\n createShape[fieldName] = stripTemplatableFileFieldsRecursively(fieldSchema as z.ZodTypeAny);\n }\n\n return stripTemplatableFileFieldsRecursively(z.object(createShape));\n } catch {\n // If schema is not an object, return as-is\n return mainSchema;\n }\n}\n\n\n\n\n/**\n * Build an UPDATE request DTO from the main schema using decorators.\n *\n * Excludes:\n * - System-managed fields (_id, createdAt, updatedAt, etc.)\n * - Virtual fields (computed, not stored)\n * - Fields with excludeFromUpdate decorator\n *\n * NOTE: Backend-only fields (isBackendOnly) are NOT excluded from UPDATE DTOs.\n * The isBackendOnly decorator controls RESPONSE filtering (what is returned to clients),\n * not REQUEST filtering (what can be set during updates). Backend operations may need\n * to update fields like passwordHash, apiKey, etc. directly.\n *\n * All remaining fields are made optional for PATCH-style updates.\n *\n * @param mainSchema - The main resource schema\n * @param customExclusions - Additional fields to exclude\n * @returns A new partial schema with only updatable fields\n */\nfunction buildUpdateRequestDto<T extends z.ZodTypeAny>(\n mainSchema: T,\n customExclusions?: string[]\n): z.ZodTypeAny {\n try {\n const shape = getZodObjectShape(mainSchema);\n const updateShape: Record<string, z.ZodTypeAny> = {};\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const typedSchema = fieldSchema as z.ZodTypeAny;\n\n // Exclude system-managed fields\n if ((SYSTEM_MANAGED_FIELDS as readonly string[]).includes(fieldName)) continue;\n\n // Exclude primary scope field identifiers (immutable, context-derived)\n if ((PRIMARY_SCOPE_FIELD_IDENTIFIERS as readonly string[]).includes(fieldName)) continue;\n\n // Exclude virtual fields (computed, not stored)\n if (isVirtualField(typedSchema)) continue;\n\n // Exclude explicitly marked fields\n if (isExcludedFromUpdate(typedSchema)) continue;\n\n // Exclude generated file fields; explicit regenerate operations own\n // refreshing these values instead of generic UPDATE payloads.\n if (isTemplatableFileField(typedSchema)) continue;\n\n // NOTE: Backend-only fields are NOT excluded here.\n // isBackendOnly controls response filtering, not request filtering.\n // Backend operations may need to update fields like passwordHash.\n\n // Exclude ALL literal fields (immutable after creation)\n const unwrapped = unwrapSchema(typedSchema);\n if (getZodType(unwrapped) === 'literal') continue;\n\n // Exclude custom exclusions\n if (customExclusions?.includes(fieldName)) continue;\n\n // Make field optional for PATCH-style update, peeling any `.default()` so\n // an omitted field is never re-materialized to its default and written\n // back over the stored value (see `toPatchOptionalField`).\n updateShape[fieldName] = toPatchOptionalField(\n stripTemplatableFileFieldsRecursively(fieldSchema as z.ZodTypeAny),\n );\n }\n\n // PATCH write rule: absent key untouched, null clears — the fact a form reads to clear a field (#989).\n return stripTemplatableFileFieldsRecursively(markPatchRequestDtoObject(z.object(updateShape)));\n } catch {\n // If schema is not an object, return as-is\n return mainSchema;\n }\n}\n\n/**\n * Derives the appropriate request DTO based on operation type.\n *\n * - CREATE: Uses buildCreateRequestDto (excludes excludeFromCreate fields)\n * - UPDATE: Uses buildUpdateRequestDto (excludes excludeFromUpdate fields, all partial)\n * - READ/DELETE and custom operations without an explicit DTO: empty object\n *\n * This is an early factory placeholder. The final DTO pass in\n * ResourcesConfigOperationsDtosBuilderUtils applies inherited schemas, the\n * shared no-body operation policy, and SEARCH query schemas derived from\n * collection-view metadata.\n *\n * @param operation - The operation identifier\n * @param mainSchema - The main resource schema\n * @param providedDto - Explicitly provided DTO (takes precedence)\n * @returns The appropriate request DTO schema\n */\nexport function deriveRequestDto<T extends z.ZodTypeAny>(\n operation: string,\n mainSchema: T,\n providedDto?: z.ZodTypeAny\n): z.ZodTypeAny {\n // If explicit DTO is provided, use it (for custom operations)\n if (providedDto !== undefined) {\n return stripTemplatableFileFieldsRecursively(providedDto);\n }\n\n // Auto-derive based on operation type\n switch (operation) {\n case CoreResourceOperation.CREATE:\n return buildCreateRequestDto(mainSchema);\n case CoreResourceOperation.UPDATE:\n return buildUpdateRequestDto(mainSchema);\n case CoreResourceOperation.READ:\n case CoreResourceOperation.DELETE:\n // READ and DELETE don't need request bodies (just URL params)\n return z.object({});\n default:\n // For custom operations without explicit DTO, return empty object\n // (custom operations should provide their own requestDto)\n return z.object({});\n }\n}\n\n// --------------------------------\n// Decorator Combination Validation\n// --------------------------------\n\n/**\n * Validates that decorated fields don't have invalid decorator combinations.\n *\n * Invalid combinations:\n * - isSummaryField + isBackendOnly: Backend-only fields can't be in summaries\n * - isDiscriminator + excludeFromCreate: Discriminator is required for create operations\n *\n * @param mainSchema - The main schema to validate\n * @param resourceIdentifier - Resource name for error messages\n * @throws Error if invalid decorator combinations are found\n */\nfunction validateDecoratorCombinations(\n mainSchema: z.ZodTypeAny,\n resourceIdentifier: string\n): void {\n const issues: string[] = [];\n\n try {\n const shape = getZodObjectShape(mainSchema);\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const typedSchema = fieldSchema as z.ZodTypeAny;\n\n // Check: isSummaryField + isBackendOnly is invalid\n if (isSummaryField(typedSchema) && isBackendOnlyField(typedSchema)) {\n issues.push(\n `Field '${fieldName}' has both isSummaryField and isBackendOnly decorators. ` +\n `Backend-only fields cannot be included in summary responses.`\n );\n }\n\n // Check: isDiscriminator + excludeFromCreate is invalid\n if (isDiscriminatorField(typedSchema) && isExcludedFromCreate(typedSchema)) {\n issues.push(\n `Field '${fieldName}' has both isDiscriminator and excludeFromCreate decorators. ` +\n `Discriminator fields must be present in create requests to determine the variant type.`\n );\n }\n\n // Check: isDiscriminator + excludeFromUpdate is a warning (logged but not an error)\n // Discriminators are typically immutable, so this might be intentional\n }\n } catch {\n // Schema may not be an object, skip validation\n return;\n }\n\n if (issues.length > 0) {\n throw createConfigurationError(\n `Resource '${resourceIdentifier}' has invalid decorator combinations:\\n` +\n issues.map(issue => ` - ${issue}`).join('\\n')\n );\n }\n}\n\n// --------------------------------\n// Helper Types\n// --------------------------------\n\n/**\n * User notification definition for ResourceConfiguration builder.\n * Omits 'primaryScope' (auto-derived) and 'identifier' (auto-generated).\n *\n * Note: customNotificationRef is optional but REQUIRED when there are 2+ notifications\n * of the same target type in the same operation.\n *\n * Distributive omit: `UserNotificationDefinition` is a discriminated union (by\n * `channel`); a bare `Omit<Union, K>` collapses to only the COMMON keys and silently\n * drops every channel-specific field (the EMAIL variant's `recipientEmailField`, the\n * FRONT_END_SUCCESS variant's `celebration`/`nextStep`). Distributing over each union\n * member preserves those per-channel fields for config authoring.\n */\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\ntype UserNotificationDefinitionWithoutPrimaryScopeAndIdentifier = DistributiveOmit<UserNotificationDefinition, 'primaryScope' | 'identifier'>;\ntype M2MNotificationDefinitionWithoutIdentifier = Omit<M2MNotificationDefinition, 'identifier'>;\n\n// --------------------------------\n// Helper Functions\n// --------------------------------\n\n/**\n * Transforms and categorizes resource relationships into parent/child/self buckets.\n *\n * ## Flat Categorization (No Separate Conditional Bucket)\n *\n * ALL relationships — including those with `discriminator` or `condition` — are placed\n * into the same three buckets (parentRelationships, childRelationships, selfRelationships).\n * Conditional relationships carry their filter inline on the relationship object itself,\n * so runtime consumers evaluate conditions when actual parent data is available:\n *\n * - **ResourceContextBackendService**: Checks discriminator/condition in `fetchChildResourcesWithPolicy`\n * against the parentResource BEFORE querying children.\n * - **ServicesRegistryHandler**: Uses `filterRelationshipsByParent()` at 4 points\n * (nested CREATE, READ, UPDATE, lifecycle DELETE) to filter active child relationships.\n * - **ContainerNested** (frontend): Evaluates discriminator/condition against parentData\n * with try-catch safety to prevent React tree crashes.\n *\n * Previously, a separate `inheritanceSchemaRelationships` bucket existed but was never\n * consumed at runtime, making the conditional system non-functional. That bucket has\n * been removed in favor of this flat, inline approach.\n *\n * ## M:N Relationship Decomposition\n *\n * Many-to-many relationships are decomposed into synthetic 1:N relationships:\n * - **Junction table**: Gets two parent relationships (one from each entity side),\n * with OPTIONAL_CONTEXT. These do NOT carry discriminator/condition (the junction\n * table itself doesn't need condition awareness — it's the entity sides that do).\n * - **Entity sides**: Each gets a child relationship to the junction table.\n * These DO carry the original `discriminator` and `condition` from the M:N declaration,\n * ensuring conditional M:N relationships work correctly.\n *\n * Important: this decomposition is an internal compilation step, not a second\n * developer-facing configuration surface. Developers declare one M:N\n * association with `jointResourceType`; the factory derives the synthetic\n * junction-facing edges needed by DTO builders, URL generation, and runtime\n * services.\n *\n * ## Relationship Direction Convention\n *\n * - `resourceType1` = parent, `resourceType2` = child\n * - `foreignKeyField` lives on the child (resourceType2) and points to the parent\n * - Example: USERS → USER_PROFILES with foreignKeyField: 'userId'\n * means userId is a field on USER_PROFILES pointing to USERS\n *\n * @param resourceRelationships - All relationships from the registry\n * @param resourceIdentifier - The resource type being processed\n * @returns Categorized relationships + set of available parent resource types\n */\nfunction transformResourceRelationships(\n resourceRelationships: ResourceRelationship[],\n resourceIdentifier: ResourceType\n): {\n processedResourceRelationships: ResourceConfiguration_ResourceRelationships;\n availableParentResourceTypes: Set<ResourceType>;\n} {\n // Categorize ALL relationships (including those with discriminator) into parent/child/self.\n // Relationships with a discriminator carry their filter inline on the relationship object itself,\n // so runtime consumers (ResourceContext, ContainerNested, services-registry-handler) evaluate\n // the discriminator at read/write time — no separate bucket is needed.\n //\n // Parent relationships are defined as: parent → child (resourceType1 → resourceType2)\n // When processing a resource, we look for relationships where we are the child (resourceType2)\n //\n // The foreignKeyField in these relationships specifies the FK field on the CHILD (resourceType2)\n // that points to the parent. This is the standard pattern for parent-child relationships.\n // Example: USERS → USER_PROFILES with foreignKeyField: 'userId'\n // - userId field is on USER_PROFILES, pointing to USERS\n // - USERS is the parent of USER_PROFILES\n //\n // NOTE: FK reference relationships (like TODOS → USERS with assignedToUserId)\n // where resourceType1 has a FK field pointing to resourceType2 are handled separately\n // at URL generation time, not here.\n // See: resources-config-operations.urls-builder.utils.ts:generateSyntheticFKParents()\n\n // F-8 fix: Filter out disabled relationships at the source.\n // All downstream consumers (ResourceContext, ServicesRegistryHandler, ContainerNested,\n // DTO builder) receive these categorized arrays, so filtering here prevents disabled\n // relationships from being processed anywhere in the pipeline.\n const activeRelationships = resourceRelationships.filter(rel => !rel.isDisabled);\n\n const isManyToMany = (rel: ResourceRelationship) =>\n rel.cardinality1 === ResourceRelationshipCardinality.MANY &&\n rel.cardinality2 === ResourceRelationshipCardinality.MANY &&\n rel.jointResourceType;\n\n const processedResourceRelationships: ResourceConfiguration_ResourceRelationships = {\n // Filter out M:N relationships — they're peer relationships via a junction table,\n // transformed into synthetic 1:N relationships in the M:N processing section below.\n parentRelationships: activeRelationships.filter(rel =>\n rel.resourceType2 === resourceIdentifier &&\n rel.resourceType1 !== resourceIdentifier &&\n !isManyToMany(rel)\n ),\n childRelationships: activeRelationships.filter(rel =>\n rel.resourceType1 === resourceIdentifier &&\n rel.resourceType2 !== resourceIdentifier &&\n !isManyToMany(rel)\n ),\n // Self-referencing 1:N/1:1 relationships (tree/graph structures).\n // M:N self-refs are excluded — they're handled entirely through M:N decomposition\n // (synthetic junction-table relationships go into parent/child buckets).\n selfRelationships: activeRelationships.filter(rel =>\n rel.resourceType1 === resourceIdentifier && rel.resourceType2 === resourceIdentifier &&\n !isManyToMany(rel)\n ),\n };\n\n // ========================================\n // PROCESS MANY-TO-MANY JOINT RESOURCE RELATIONSHIPS\n // ========================================\n\n const compileSyntheticRelationship = (\n relationshipDeclaration: ResourceRelationshipDeclaration\n ): ResourceRelationship =>\n Resources_SharedUtils.compileRelationshipDeclaration(relationshipDeclaration);\n\n /**\n * Build the synthetic **scope-anchored peer-under-scope** edge for an M:N\n * (scope-required reference search). It makes a target peer `T` addressable\n * UNDER the other peer `S` for SEARCH/LIST ONLY — e.g.\n * `/organizations/{organizationId}/users/search` — and tags it with the\n * junction `J` so the backend (a) scopes the `T` query via a junction subquery\n * (`T._id ∈ { J.targetFk : J.scopeFk = S_id }` — `T` holds no real FK column\n * for `S`) and (b) authorizes by `S`-membership instead of `T`'s own scope.\n * `OPTIONAL_CONTEXT` so the bare `/users/search` (global) route also survives;\n * `urlOperationScope` keeps this off READ/CREATE/UPDATE/DELETE routes (a\n * peer-under-scope path is a read-only access pattern).\n */\n const buildScopeAnchoredPeerEdge = (\n scopeType: ResourceType,\n targetType: ResourceType,\n junction: ResourceType,\n isDisabled: boolean,\n ): ResourceRelationship =>\n compileSyntheticRelationship({\n cardinality1: ResourceRelationshipCardinality.ONE, // one scope S\n cardinality2: ResourceRelationshipCardinality.MANY, // many targets T\n resourceType1: scopeType, // S — the URL parent (anchor scope)\n resourceType2: targetType, // T — the searched collection (current peer)\n nature: RelationshipNature.REFERENCE,\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.OPTIONAL_CONTEXT,\n isPrimaryScope: false,\n isDisabled,\n allowCycle: false,\n scopeViaJunction: junction,\n urlOperationScope: [CoreResourceOperation.SEARCH, CoreResourceOperation.LIST],\n });\n\n // Find many-to-many relationships with joint resource types (from ALL active relationships,\n // including those with discriminators — a conditional M:N is still an M:N)\n const manyToManyRelationships = activeRelationships.filter(rel =>\n rel.cardinality1 === ResourceRelationshipCardinality.MANY &&\n rel.cardinality2 === ResourceRelationshipCardinality.MANY &&\n rel.jointResourceType\n );\n\n // Additional relationships to add based on many-to-many joint resource logic\n const additionalRelationships: ResourceRelationship[] = [];\n\n manyToManyRelationships.forEach(m2mRel => {\n Resources_SharedUtils.assertSupportedManyToManySyntheticExpansion(m2mRel);\n const { resourceType1: entity1Type, resourceType2: entity2Type, jointResourceType, foreignKeyField } = m2mRel;\n\n if (resourceIdentifier === jointResourceType) {\n // ========================================\n // JUNCTION TABLE: Current resource IS the joint resource\n // ========================================\n // For many-to-many, the junction table can be accessed from BOTH sides:\n // - /organizations/{orgId}/organization-members\n // - /users/{userId}/organization-members\n // Both parents use OPTIONAL_CONTEXT so each generates independent URL paths\n //\n // NOTE: Junction table parent relationships do NOT carry discriminator/condition\n // from the original M:N. The junction table itself doesn't need condition awareness —\n // it's the entity→junction direction that carries conditions, because the entity\n // is the \"parent\" whose data is evaluated. The junction table looks UP to both\n // entities as parents, and parent traversal intentionally skips discriminator checks\n // (see fetchParentResourcesWithPolicy in ResourceContextBackendService).\n\n // Relationship: entity1 → joint resource (entity1 is a parent of junction table)\n const relationFromEntity1 = compileSyntheticRelationship({\n cardinality1: ResourceRelationshipCardinality.ONE, // One entity1\n cardinality2: ResourceRelationshipCardinality.MANY, // Many joint records\n resourceType1: entity1Type, // entity1 (e.g., ORGANIZATIONS)\n resourceType2: resourceIdentifier, // joint resource (e.g., ORGANIZATION_MEMBERS)\n jointResourceType,\n nature: m2mRel.resolvedSemantics.nature,\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.OPTIONAL_CONTEXT,\n isPrimaryScope: false,\n isDisabled: m2mRel.isDisabled || false,\n allowCycle: false,\n // Preserve context policy and childOperations from original relationship\n contextPolicy: m2mRel.contextPolicy,\n read: m2mRel.read,\n childOperations: m2mRel.childOperations,\n foreignKeyField: m2mRel.foreignKeyField,\n });\n additionalRelationships.push(relationFromEntity1);\n\n // Relationship: entity2 → joint resource (entity2 is ALSO a parent of junction table)\n const relationFromEntity2 = compileSyntheticRelationship({\n cardinality1: ResourceRelationshipCardinality.ONE, // One entity2\n cardinality2: ResourceRelationshipCardinality.MANY, // Many joint records\n resourceType1: entity2Type, // entity2 (e.g., USERS)\n resourceType2: resourceIdentifier, // joint resource (e.g., ORGANIZATION_MEMBERS)\n jointResourceType,\n nature: m2mRel.resolvedSemantics.nature,\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.OPTIONAL_CONTEXT, // Both sides are optional\n isPrimaryScope: false,\n isDisabled: m2mRel.isDisabled || false,\n allowCycle: false,\n // Preserve context policy and childOperations from original relationship\n contextPolicy: m2mRel.contextPolicy,\n read: m2mRel.read,\n childOperations: m2mRel.childOperations,\n // For M:N self-referencing, foreignKeyField distinguishes source/target in junction table\n foreignKeyField: foreignKeyField,\n });\n additionalRelationships.push(relationFromEntity2);\n\n } else if (resourceIdentifier === entity1Type) {\n // ========================================\n // ENTITY1: Current resource is the first entity in the relationship\n // ========================================\n // Entity1 has junction table as child (for child relationships).\n // The synthetic entity→junction relationship DOES carry discriminator/condition\n // from the original M:N declaration (lines below). This ensures that conditional\n // M:N relationships (e.g., \"users have projects only when role=DEVELOPER\") are\n // correctly gated at runtime when looking DOWN from entity1 to the junction.\n\n if (!jointResourceType)\n throw createConfigurationError(`Many-to-many relationship between ${entity1Type} and ${entity2Type} must have a jointResourceType`);\n\n const relationToJoint = compileSyntheticRelationship({\n cardinality1: ResourceRelationshipCardinality.ONE, // One entity\n cardinality2: ResourceRelationshipCardinality.MANY, // Many joint records\n resourceType1: resourceIdentifier, // current entity\n resourceType2: jointResourceType, // joint resource\n jointResourceType,\n nature: m2mRel.resolvedSemantics.nature,\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.OPTIONAL_CONTEXT,\n isPrimaryScope: false,\n isDisabled: m2mRel.isDisabled || false,\n allowCycle: m2mRel.allowCycle || false,\n contextPolicy: m2mRel.contextPolicy,\n read: m2mRel.read,\n childOperations: m2mRel.childOperations,\n foreignKeyField: m2mRel.foreignKeyField,\n discriminator: m2mRel.discriminator,\n condition: m2mRel.condition,\n display: m2mRel.display,\n });\n additionalRelationships.push(relationToJoint);\n\n // Scope-anchored read edge: this resource (entity1, the target T) becomes\n // addressable under entity2 (the scope S) for SEARCH/LIST via the junction.\n additionalRelationships.push(\n buildScopeAnchoredPeerEdge(entity2Type, resourceIdentifier, jointResourceType, m2mRel.isDisabled || false),\n );\n\n } else if (resourceIdentifier === entity2Type) {\n // ========================================\n // ENTITY2: Current resource is the second entity in the relationship\n // ========================================\n // Entity2 also has junction table as child (for child relationships).\n // Same as Entity1: carries discriminator/condition from the M:N declaration\n // to enable conditional gating when looking DOWN from entity2 to the junction.\n\n if (!jointResourceType)\n throw createConfigurationError(`Many-to-many relationship between ${entity1Type} and ${entity2Type} must have a jointResourceType`);\n\n const relationToJoint = compileSyntheticRelationship({\n cardinality1: ResourceRelationshipCardinality.ONE, // One entity\n cardinality2: ResourceRelationshipCardinality.MANY, // Many joint records\n resourceType1: resourceIdentifier, // current entity\n resourceType2: jointResourceType, // joint resource\n jointResourceType,\n nature: m2mRel.resolvedSemantics.nature,\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.OPTIONAL_CONTEXT,\n isPrimaryScope: false,\n isDisabled: m2mRel.isDisabled || false,\n allowCycle: m2mRel.allowCycle || false,\n contextPolicy: m2mRel.contextPolicy,\n read: m2mRel.read,\n childOperations: m2mRel.childOperations,\n foreignKeyField: foreignKeyField,\n discriminator: m2mRel.discriminator,\n condition: m2mRel.condition,\n display: m2mRel.display,\n });\n additionalRelationships.push(relationToJoint);\n\n // Scope-anchored read edge: this resource (entity2, the target T) becomes\n // addressable under entity1 (the scope S) for SEARCH/LIST via the junction.\n additionalRelationships.push(\n buildScopeAnchoredPeerEdge(entity1Type, resourceIdentifier, jointResourceType, m2mRel.isDisabled || false),\n );\n }\n });\n\n // Add the additional relationships to the appropriate categories\n additionalRelationships.forEach(rel => {\n if (rel.resourceType2 === resourceIdentifier && rel.resourceType1 !== resourceIdentifier) {\n processedResourceRelationships.parentRelationships.push(rel);\n } else if (rel.resourceType1 === resourceIdentifier && rel.resourceType2 !== resourceIdentifier) {\n processedResourceRelationships.childRelationships.push(rel);\n } else if (rel.resourceType1 === resourceIdentifier && rel.resourceType2 === resourceIdentifier) {\n processedResourceRelationships.selfRelationships.push(rel);\n }\n });\n\n // Create set of available parent resource types for validation.\n // Includes selfRelationships because a self-ref acts as its own parent (tree roots).\n const availableParentResourceTypes = new Set([\n ...processedResourceRelationships.parentRelationships.map(rel => rel.resourceType1),\n ...processedResourceRelationships.selfRelationships.map(rel => rel.resourceType1),\n ]);\n\n return {\n processedResourceRelationships,\n availableParentResourceTypes\n };\n}\n\n/**\n * Processes parent resource access scope strategy overrides for an operation.\n *\n * Creates a shallow copy of the relationship buckets with overridden `accessScopeStrategy`\n * values for specific parent resource types. This allows per-operation customization of\n * how parent resources are resolved in URL paths (e.g., making an optional parent\n * mandatory for a specific operation).\n *\n * The returned object has exactly three fields: `parentRelationships`, `childRelationships`,\n * `selfRelationships`. There is no `inheritanceSchemaRelationships` field — that structure\n * was removed as part of the relationship condition refactor.\n *\n * @param resourceRelationships - The base relationship buckets (from transformResourceRelationships)\n * @param availableParentResourceTypes - Set of valid parent resource types for validation\n * @param parentResourceAccessScopeStrategyOverrides - Overrides to apply\n * @param operationIdentifier - The operation name (for error messages)\n * @returns A new ResourceConfiguration_ResourceRelationships with overrides applied\n */\nfunction processParentResourceAccessScopeStrategyOverrides(\n resourceRelationships: ResourceConfiguration_ResourceRelationships,\n availableParentResourceTypes: Set<ResourceType>,\n parentResourceAccessScopeStrategyOverrides: { resourceType: ResourceType, accessScopeStrategy: ResourceRelationshipAccessScopeStrategy }[],\n operationIdentifier: string\n): ResourceConfiguration_ResourceRelationships {\n if (!parentResourceAccessScopeStrategyOverrides || parentResourceAccessScopeStrategyOverrides.length === 0) {\n return resourceRelationships;\n }\n\n // Validate that all override resources exist in parent relationships\n for (const override of parentResourceAccessScopeStrategyOverrides) {\n if (!availableParentResourceTypes.has(override.resourceType)) {\n throw createConfigurationError(`Operation '${operationIdentifier}' has access scope strategy override for parent resource '${override.resourceType}' but it's not available in parent relationships`);\n }\n }\n\n // Create a map for quick lookup of overrides\n const overrideMap = new Map<ResourceType, ResourceRelationshipAccessScopeStrategy>();\n parentResourceAccessScopeStrategyOverrides.forEach(override => {\n overrideMap.set(override.resourceType, override.accessScopeStrategy);\n });\n\n const applyOverride = (rel: ResourceRelationship): ResourceRelationship => {\n const overrideStrategy = overrideMap.get(rel.resourceType1);\n return overrideStrategy !== undefined ? { ...rel, accessScopeStrategy: overrideStrategy } : rel;\n };\n\n const updatedResourceRelationships: ResourceConfiguration_ResourceRelationships = {\n parentRelationships: resourceRelationships.parentRelationships.map(applyOverride),\n childRelationships: [...resourceRelationships.childRelationships],\n // Self-refs act as their own parent — scope strategy overrides must apply.\n selfRelationships: resourceRelationships.selfRelationships.map(applyOverride),\n };\n\n return updatedResourceRelationships;\n}\n\n/**\n * Processes user notifications by adding primaryScope and auto-generating identifiers\n * Format: ${resourceIdentifier}_${operationIdentifier}_${target}_${customNotificationRef?}_${userRoles.join(\"_\")}_${level}\n *\n * Validates that when there are 2+ notifications with the same target in the same operation,\n * each one must have a unique customNotificationRef to distinguish them.\n */\nfunction processUserNotifications(\n userNotifications: UserNotificationDefinitionWithoutPrimaryScopeAndIdentifier[],\n resourceIdentifier: ResourceType,\n operationIdentifier: string,\n resourcePrimaryScope: ResourcePrimaryScope\n): UserNotificationDefinition[] {\n\n // ========================================\n // VALIDATE DUPLICATE TARGET NOTIFICATIONS\n // ========================================\n\n // Group notifications by target+channel to find duplicates\n const notificationsByTargetChannel = new Map<string, UserNotificationDefinitionWithoutPrimaryScopeAndIdentifier[]>();\n userNotifications.forEach(n => {\n const key = `${n.target}_${n.channel}`;\n if (!notificationsByTargetChannel.has(key)) {\n notificationsByTargetChannel.set(key, []);\n }\n notificationsByTargetChannel.get(key)!.push(n);\n });\n\n // Validate customNotificationRef for groups with 2+ notifications\n for (const [targetChannel, notifications] of notificationsByTargetChannel.entries()) {\n if (notifications.length >= 2) {\n // Check that all have customNotificationRef\n const missingRefs = notifications.filter(n => !n.customNotificationRef);\n if (missingRefs.length > 0) {\n throw createConfigurationError(\n `Operation '${resourceIdentifier}_${operationIdentifier}' has ${notifications.length} notifications with target_channel '${targetChannel}'. ` +\n `When there are 2+ notifications with the same target, each must have a unique 'customNotificationRef' to distinguish them. ` +\n `${missingRefs.length} notification(s) are missing customNotificationRef.`\n );\n }\n\n // Check that all customNotificationRefs are unique\n const refs = notifications.map(n => n.customNotificationRef);\n const uniqueRefs = new Set(refs);\n if (uniqueRefs.size !== refs.length) {\n throw createConfigurationError(\n `Operation '${resourceIdentifier}_${operationIdentifier}' has duplicate customNotificationRef values for target_channel '${targetChannel}'. ` +\n `Each notification with the same target must have a unique customNotificationRef. ` +\n `Found refs: [${refs.join(', ')}]`\n );\n }\n }\n }\n\n // ========================================\n // GENERATE IDENTIFIERS\n // ========================================\n\n return userNotifications.map(notification => {\n // Auto-generate identifier: ${resourceIdentifier}_${current_operation}_${target}_${customNotificationRef?}_${userRoles.join(\"_\")}_${level}\n const identifierParts = [\n resourceIdentifier,\n operationIdentifier,\n notification.target\n ];\n\n // Add customNotificationRef if present (for disambiguation)\n if (notification.customNotificationRef) {\n identifierParts.push(notification.customNotificationRef);\n }\n\n // Add userRoles if present\n if (notification.userRoles && notification.userRoles.length > 0) {\n identifierParts.push(notification.userRoles.join(\"_\"));\n }\n\n // Add level if present\n if (notification.level) {\n identifierParts.push(notification.level);\n }\n\n const autoGeneratedIdentifier = identifierParts.join(\"_\");\n\n const processed = {\n ...notification,\n identifier: autoGeneratedIdentifier,\n primaryScope: resourcePrimaryScope\n };\n assertUserNotificationDeclarationIsDeliverable(processed, resourceIdentifier, operationIdentifier);\n return processed;\n });\n}\n\n/**\n * Refuse a declared user notification the dispatcher could never deliver (#1874).\n *\n * `UserNotificationDefinitionSchema` states what is deliverable — a channel the dispatcher has an arm for, and a\n * `userRoles` filter only on a target that reads it (#495) — but no build step ever parsed a declaration against it,\n * so both rules held only in the type system and a test. A notification on an unknown channel (`'slack'`) was\n * accepted and every dispatch sent nothing, visible only at debug level. Parsing here makes the same rule hold for\n * every configuration, typed or not, at the moment it is built — the way the factory already refuses a filter,\n * sort or search field that names nothing.\n */\nfunction assertUserNotificationDeclarationIsDeliverable(\n notification: unknown,\n resourceIdentifier: ResourceType,\n operationIdentifier: string,\n): void {\n const parsed = UserNotificationDefinitionSchema.safeParse(notification);\n if (parsed.success) return;\n const declared = notification as { channel?: unknown; target?: unknown };\n const problems = parsed.error.issues.map((issue) => `${issue.path.join('.') || '(notification)'}: ${issue.message}`).join('; ');\n // A channel or target outside its vocabulary fails every member of the channel union, and Zod reports that as one\n // path-less \"Invalid input\" — so those two are named from the value itself, with the members that would be valid.\n const channelIsKnown = (Object.values(CoreUserNotificationChannel) as unknown[]).includes(declared.channel);\n const targetIsKnown = (Object.values(CoreUserNotificationTarget) as unknown[]).includes(declared.target);\n const reason = !channelIsKnown\n ? `no delivery exists for channel '${String(declared.channel)}'. A channel must be one of ${quoteMembers(CoreUserNotificationChannel)}`\n : !targetIsKnown\n ? `'${String(declared.target)}' is not a notification target. A target must be one of ${quoteMembers(CoreUserNotificationTarget)}`\n : problems;\n throw createConfigurationError(\n `Operation '${resourceIdentifier}_${operationIdentifier}' declares a user notification (target '${String(declared.target)}', channel '${String(declared.channel)}') that cannot be delivered: ${reason}.`,\n );\n}\n\n/** `'a', 'b', 'c'` — the members of a closed vocabulary, as a refusal names them. */\nfunction quoteMembers(vocabulary: Record<string, string>): string {\n return Object.values(vocabulary).map((member) => `'${member}'`).join(', ');\n}\n\n/**\n * Processes M2M notifications by auto-generating identifiers\n * Format: ${resourceIdentifier}_${operationIdentifier}_${channel}\n *\n * Each declaration is parsed against `M2MNotificationDefinitionSchema` and an undeliverable channel is refused\n * here, when the configuration is built. It used to be accepted and to throw \"not implemented\" at dispatch — after\n * the write, where the throw also skipped every later M2M notification of the same operation.\n */\nfunction processM2MNotifications(\n m2mNotifications: M2MNotificationDefinitionWithoutIdentifier[],\n resourceIdentifier: ResourceType,\n operationIdentifier: string\n): M2MNotificationDefinitionWithoutIdentifier[] {\n return m2mNotifications.map(notification => {\n // Auto-generate identifier: ${resourceIdentifier}_${current_operation}_${channel}\n const autoGeneratedIdentifier = [\n resourceIdentifier,\n operationIdentifier,\n notification.channel\n ].join(\"_\");\n\n const processed = {\n ...notification,\n identifier: autoGeneratedIdentifier\n };\n const parsed = M2MNotificationDefinitionSchema.safeParse(processed);\n if (!parsed.success) {\n throw createConfigurationError(\n `Operation '${resourceIdentifier}_${operationIdentifier}' declares an M2M notification on channel '${String(notification.channel)}' that cannot be delivered: `\n + `${parsed.error.issues.map((issue) => `${issue.path.join('.') || '(notification)'}: ${issue.message}`).join('; ')}. `\n + `A channel must be one of ${quoteMembers(CoreM2MNotificationChannel)}.`,\n );\n }\n return processed;\n });\n}\n\n// --------------------------------\n// Resources Pagination Response\n// --------------------------------\n\n\nfunction createResourcePaginatedResponseSchema<T extends z.ZodTypeAny>(params: {\n dataSchema: T;\n validateArrayConstraints?: boolean;\n maxResultsPerPageLimit?: number;\n}): z.ZodType<ResourcePaginatedResponseResultSchema<T>> {\n\n const {\n dataSchema,\n validateArrayConstraints = true,\n maxResultsPerPageLimit = 50\n } = params;\n\n // Comprehensive parameter validation\n if (!dataSchema) {\n throw createConfigurationError('Data schema is required and cannot be null or undefined');\n }\n\n // Use duck typing instead of instanceof to avoid version conflicts\n if (typeof dataSchema !== 'object' ||\n typeof dataSchema.parse !== 'function' ||\n typeof dataSchema.safeParse !== 'function' ||\n !dataSchema._def) {\n throw createConfigurationError(`Data schema must be a valid Zod schema type. Got: ${typeof dataSchema}, constructor: ${dataSchema?.constructor?.name}`);\n }\n\n if (validateArrayConstraints) {\n if (typeof maxResultsPerPageLimit !== 'number' || maxResultsPerPageLimit < 0) {\n throw createConfigurationError('Max results per page limit must be a non-negative number');\n }\n }\n\n // Create strongly typed array schema with optional constraints\n const createDataArraySchema = (schema: T) => {\n let arraySchema = z.array(schema);\n\n if (validateArrayConstraints) {\n if (maxResultsPerPageLimit > 0) {\n arraySchema = arraySchema.max(maxResultsPerPageLimit, `Data array cannot contain more than ${maxResultsPerPageLimit} items`);\n }\n }\n\n return arraySchema;\n };\n\n // Runtime validation with comprehensive error messages\n const validatePaginatedResponse = (input: any): input is ResourcePaginatedResponseResultSchema<T> => {\n // Validate root structure\n if (!input || typeof input !== 'object') {\n throw createValidationError('Paginated response must be an object');\n }\n\n // Validate data field existence\n if (!('data' in input)) {\n throw createValidationError('Paginated response must have a \"data\" field');\n }\n\n // Validate data is an array\n if (!Array.isArray(input.data)) {\n throw createValidationError('Data field must be an array');\n }\n\n // Validate array constraints if enabled\n if (validateArrayConstraints) {\n if (input.data.length > maxResultsPerPageLimit) {\n throw createValidationError(`Data array cannot contain more than ${maxResultsPerPageLimit} items, got ${input.data.length}`);\n }\n }\n\n // Validate pagination field existence\n if (!('pagination' in input)) {\n throw createValidationError('Paginated response must have a \"pagination\" field');\n }\n\n // Validate pagination structure\n if (!input.pagination || typeof input.pagination !== 'object') {\n throw createValidationError('Pagination field must be an object');\n }\n\n // Validate required pagination fields\n const requiredPaginationFields = ['page', 'limit', 'total', 'totalPages'];\n for (const field of requiredPaginationFields) {\n if (!(field in input.pagination)) {\n throw createValidationError(`Pagination must have a \"${field}\" field`);\n }\n\n if (typeof input.pagination[field] !== 'number') {\n throw createValidationError(`Pagination \"${field}\" must be a number`);\n }\n\n if (input.pagination[field] < 0) {\n throw createValidationError(`Pagination \"${field}\" must be non-negative`);\n }\n }\n\n // Validate pagination logic\n if (input.pagination.page > input.pagination.totalPages && input.pagination.totalPages > 0) {\n throw createValidationError('Current page cannot exceed total pages');\n }\n\n if (input.pagination.limit <= 0) {\n throw createValidationError('Pagination limit must be positive');\n }\n\n return true;\n };\n\n // Create the result schema with comprehensive validation\n const resultSchema = z.object({\n data: createDataArraySchema(dataSchema),\n // Bounded by the SAME ceiling as the data array above. `limit` reports the page size actually\n // served, so a stricter bound here rejects pages this very schema just declared valid.\n pagination: createPaginationResponseMetadataSchema(maxResultsPerPageLimit)\n }).refine(validatePaginatedResponse, {\n message: \"Invalid paginated response structure\"\n });\n\n return resultSchema as z.ZodType<ResourcePaginatedResponseResultSchema<T>>;\n}\n\n\n\n// --------------------------------\n// Resource Search Query Request\n// --------------------------------\n\n/**\n * The ONE authority for the `{ pagination, sorting, filters }` argument envelope every\n * collection-shaped operation accepts.\n *\n * Exported rather than factory-private because a second surface needs the identical shape: the MCP\n * tool adapter advertises this envelope for collection tools whose `requestDto` is empty. A LIST\n * operation keeps `requestDto: z.object({})` — its filters travel in the QUERY STRING over HTTP, so\n * giving it a request BODY would misdescribe the REST contract and the generated OpenAPI — yet the\n * MCP dispatch normalises the very same envelope for it. Advertising had to be fixed without\n * touching the DTO, and that means this builder is reachable from both places.\n *\n * Deriving the shape a second time in the adapter was the rejected alternative: a filter allow-list\n * that drifts between the surface that ADVERTISES it and the surface that ENFORCES it is precisely\n * the defect class this envelope already caused once.\n */\nexport function createResourceSearchQueryRequestSchema<\n TFilterFields extends Record<string, PrimitiveZodType> | undefined,\n TSortFields extends readonly string[] | undefined,\n>(params: {\n filterFields: TFilterFields;\n allowedSortFields: TSortFields;\n pagination: boolean;\n /**\n * The operation's declared page ceiling, mirrored onto the REQUEST side.\n *\n * Without it the request DTO refuses any `pagination.limit` above a hard-coded 100 while the\n * repository and the response DTO both honour the declared value — so an operation declaring 200\n * advertises a limit it answers **400** to. Found 2026-08-12 by an e2e probe asking `users SEARCH`\n * (declared 200) for 120: `pagination.limit: Too big: expected number to be <=100`.\n *\n * Defaults to 100 — the bound this schema has always enforced — so an un-migrated caller keeps\n * exactly its current contract.\n */\n maxPaginatedResultPerPageLimit?: number;\n}): ResourceSearchQueryRequestResult<TFilterFields, TSortFields> {\n\n const { filterFields, allowedSortFields = [], pagination = true, maxPaginatedResultPerPageLimit } = params;\n\n // Validate input parameters\n if (filterFields !== undefined && typeof filterFields !== 'object') {\n throw createConfigurationError('Filter fields must be an object');\n }\n\n if (allowedSortFields && !Array.isArray(allowedSortFields)) {\n throw createConfigurationError('Allowed sort fields must be an array');\n }\n\n if (allowedSortFields && allowedSortFields.length > 0 && !allowedSortFields.every(field => typeof field === 'string' && field.length > 0)) {\n throw createConfigurationError('All sort fields must be non-empty strings');\n }\n\n // Strongly typed filter schema creation\n const createFilterSchema = <T extends Record<string, PrimitiveZodType>>(fields: T) => {\n const processedFields: Record<string, z.ZodOptional<any>> = {};\n\n Object.entries(fields).forEach(([key, schema]) => {\n // Type-safe schema processing based on schema type\n if (schema instanceof z.ZodDate) {\n processedFields[key] = Resources_Filter_DateRangeSchema.optional();\n } else if (isResourcesFilterNumberRangeSchema(schema)) {\n // Already the range vocabulary — the author wrote it, which is the opt-in. Named here\n // rather than left to the fallback below so the numeric range is a VISIBLE branch beside\n // the date one; the two are the framework's only structured filter shapes and a reader\n // looking for \"which filters are ranges\" must find both in one place.\n processedFields[key] = Resources_Filter_NumberRangeSchema.optional();\n } else if (schema instanceof z.ZodString) {\n processedFields[key] = (schema as z.ZodString).optional();\n } else if (schema instanceof z.ZodNumber) {\n processedFields[key] = (schema as z.ZodNumber).optional();\n } else if (schema instanceof z.ZodBoolean) {\n processedFields[key] = (schema as z.ZodBoolean).optional();\n } else if (schema instanceof z.ZodEnum) {\n processedFields[key] = (schema as z.ZodEnum<any>).optional();\n } else {\n // Fallback for other primitive types\n processedFields[key] = (schema as z.ZodTypeAny).optional();\n }\n });\n\n return Resources_Filter_BaseSchema.extend(processedFields);\n };\n\n // Strongly typed sorting schema creation\n const createSortingSchema = (fields: readonly string[]) => {\n const sortingFields: Record<string, z.ZodOptional<z.ZodObject<any>>> = {};\n\n fields.forEach(field => {\n sortingFields[field] = z.object({\n field: z.literal(field),\n order: z.enum(SortOrder).default(SortOrder.ASC),\n priority: z.number().min(0).default(0)\n }).optional();\n });\n\n return z.object(sortingFields).optional();\n };\n\n\n // Build the schema dynamically based on parameters\n const schemaConfig: any = {};\n\n // Add pagination if enabled.\n //\n // Built from the operation's ceiling rather than the shared default-bounded constant, so the limit\n // a caller may REQUEST, the limit the repository will SERVE and the limit the response DTO ACCEPTS\n // are one number. They were three, and the request side was the strictest — which is why a\n // declared ceiling above 100 was unreachable over HTTP no matter what the other two allowed.\n if (pagination) {\n schemaConfig.pagination = createPaginationRequestSchema(maxPaginatedResultPerPageLimit).optional();\n }\n\n // Add sorting if allowed fields are provided\n if (allowedSortFields && allowedSortFields.length > 0) {\n schemaConfig.sorting = createSortingSchema(allowedSortFields);\n }\n\n // Add filtering based on filter fields\n if (filterFields !== undefined && Object.keys(filterFields).length > 0) {\n schemaConfig.filters = createFilterSchema(filterFields).optional();\n } else {\n schemaConfig.filters = Resources_Filter_BaseSchema.optional();\n }\n\n // Create the final schema with validation\n const resultSchema = z.object(schemaConfig);\n\n return resultSchema as ResourceSearchQueryRequestResult<TFilterFields, TSortFields>;\n}\n\n\n\n\n\n// Helper function to determine HTTP verb based on operation\nfunction getDefaultHttpVerbForOperation(operation: string): HttpMethod {\n switch (operation) {\n case CoreResourceOperation.READ:\n case CoreResourceOperation.LIST:\n case CoreResourceOperation.SEARCH:\n case CoreResourceOperation.COUNT:\n return HttpMethod.GET;\n case CoreResourceOperation.CREATE:\n case CoreResourceOperation.CREATE_MANY:\n return HttpMethod.POST;\n case CoreResourceOperation.UPDATE:\n case CoreResourceOperation.UPDATE_MANY:\n return HttpMethod.PUT;\n case CoreResourceOperation.DELETE:\n case CoreResourceOperation.DELETE_MANY:\n return HttpMethod.DELETE;\n default:\n return HttpMethod.POST; // Default for unknown operations\n }\n}\n\n/**\n * Determines if an operation variant should be marked as the default operation within its variantType group\n * Handles the complex logic for single vs multiple variants and explicit defaults\n *\n * Rules after validation:\n * 1. If only one variant exists in the group, it becomes the group default UNLESS the author\n * explicitly opted it out with `isDefault: false`. An omitted/`undefined` `isDefault` still\n * becomes the group default — only an explicit `false` is honored.\n *\n * Rationale: a sole `isDefault: false` variant is a real authoring signal that this transport\n * has NO default for the operation. Example: `users.list` declares an `INTERNAL_CALL` default\n * plus a single keyed `API_CALL` \"admin\" variant marked `isDefault: false` — there is no public\n * default URL listing, only the admin-keyed one. The prior behavior force-defaulted such a\n * variant, which (a) contradicted author intent and (b) produced two `isOperationDefault === true`\n * operations for one operation identifier across transport groups (one per group) — a latent\n * hazard for any consumer that filters defaults across transports (e.g. a set-filter that matches\n * >1 and throws). Honoring the explicit `false` keeps each transport group with at most one\n * default and makes the variant resolvable only via its keyed path resolver, which is the intent.\n * See `.claude/plans/internal-call-operation-path-resolution.md` (D6 + RESOLUTION).\n * 2. If multiple variants exist in the group, validation requires exactly one `isDefault=true`.\n * 3. Fallback selection is kept for direct/test-only callers that bypass factory validation,\n * but authored multi-variant groups must never rely on array order.\n */\nfunction determineOperationVariantDefault(\n variantsOfSameType: ResourceConfiguration_OperationVariant_BuilderParameters<any>[],\n currentVariant: ResourceConfiguration_OperationVariant_BuilderParameters<any>\n): boolean {\n // Rule 1: A single variant of this type is the group default UNLESS the author\n // explicitly opted out with `isDefault: false`. An omitted/`undefined` `isDefault`\n // still becomes the default — only an explicit `false` is honored (see JSDoc above).\n if (variantsOfSameType.length === 1) {\n return currentVariant.isDefault !== false;\n }\n\n // Rule 2: Find explicit isDefault=true within this variant type group\n const explicitDefaultVariant = variantsOfSameType.find(variant =>\n variant.isDefault === true\n );\n\n // If we found an explicit default, check if current variant is it\n if (explicitDefaultVariant) {\n return currentVariant === explicitDefaultVariant;\n }\n\n // Rule 3: No explicit isDefault=true found, use first variant that doesn't have isDefault=false\n const firstNonFalseVariant = variantsOfSameType.find(variant =>\n variant.isDefault !== false\n );\n\n if (firstNonFalseVariant) {\n return currentVariant === firstNonFalseVariant;\n }\n\n // Fallback: if all variants have isDefault=false, first one becomes default anyway\n return currentVariant === variantsOfSameType[0];\n}\n\nconst RESERVED_OPERATION_VARIANT_KEYS = new Set([\n 'isdefault',\n 'novariantkey',\n]);\nconst AUTO_OPERATION_VARIANT_KEYS = new Set([\n OPERATION_VARIANT_KEY.SUMMARY,\n OPERATION_VARIANT_KEY.CONTEXT,\n]);\n\nfunction isDataModeVariantKeyAllowedForOperation(\n operation: string,\n variant: ResourceConfiguration_OperationVariant_BuilderParameters<any>,\n): boolean {\n const effectiveOperation = variant.resourceOperationLike ?? operation;\n return effectiveOperation === CoreResourceOperation.READ\n || effectiveOperation === CoreResourceOperation.LIST\n || effectiveOperation === CoreResourceOperation.SEARCH;\n}\n\n// --------------------------------\n// Resources Shared Configuration\n// --------------------------------\n\n/**\n * Creates a resource configuration from builder parameters.\n * NOTE: TDatabaseSchema has been removed. Backend-only fields are now marked with\n * the isBackendOnly decorator in mainSchema and are stripped at the service layer.\n */\nexport function createResourceConfiguration_Initialization<\n TCustomOperationEnum extends EnumLikeType | undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined,\n TMainSchema extends z.ZodTypeAny,\n>(params: ResourceConfiguration_BuilderParameters<\n TCustomOperationEnum, TCoreOperationEnum, TMainSchema\n>): ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {\n\n const {\n mainSchema,\n resourceIdentifier,\n resourceFieldIdentifier,\n resourceRelationships,\n inheritenceSchemaDefinition,\n isSystemResource = false,\n // Defaulted TRUE — the safe direction. A resource that never considered whether its primary key\n // names the caller keeps the identity-coherence refusal; only a deliberate `false` relaxes it.\n primaryKeyIdentifiesInitiator = true,\n // Fail-closed default: a resource that does not author `systemAccessPolicy`\n // gets an explicit all-verbs-FORBIDDEN policy, so the resolved config is\n // self-documenting and every system-context primitive\n // (`readAsSystem`/`listAsSystem` and the trusted\n // `createAsSystem`/`updateAsSystem`/`updateManyAsSystem` writes) rejects it\n // by default.\n systemAccessPolicy = {\n read: ResourceSystemAccessMode.FORBIDDEN,\n list: ResourceSystemAccessMode.FORBIDDEN,\n create: ResourceSystemAccessMode.FORBIDDEN,\n update: ResourceSystemAccessMode.FORBIDDEN,\n updateMany: ResourceSystemAccessMode.FORBIDDEN,\n },\n isAnonymizable = false,\n // Carried through UNCHANGED and with no default. Absent means \"this resource is not the erasure\n // lane\", which is true of almost every resource — a default here would make every resource claim\n // to be one. The bindings are validated at boot, not here: this factory has the declaration but\n // not the registry, and a name resolves against the resource's own schema and operations.\n subjectErasureLane,\n transpositionPolicy,\n retentionPolicy,\n dataSubjectPolicy,\n retentionBinding: authoredRetentionBinding,\n portabilityPolicy,\n // #1598: `true` makes every row of this resource a CASE a model call can be attributed to. No default\n // beyond `false`: a case is a product decision, and an unset flag means the resource is not one.\n workUnit = false,\n persistenceAdapter,\n persistenceAdapterIsolation,\n httpApiBinding,\n introspectionBinding,\n coreOperations,\n customOperation,\n operationsConfiguration,\n } = params;\n\n /**\n * HTTP_API ↔ binding coherence — enforced at AUTHORING, both directions, because each half\n * alone is a contradiction the backend could only discover later and worse:\n * - `HTTP_API` without a binding is a resource whose rows live \"somewhere over HTTP\" with no\n * target, key, identity or erasure story — nothing downstream can repair that;\n * - a binding on a platform-backed resource is a declaration nothing will ever read, i.e. a\n * config that LOOKS externally bound and silently is not.\n * The binding's CONTENT is validated here too (Zod parse) so a malformed declaration names its\n * defect at the factory, not at boot. (ETL plan Step 3; registration-time checks that need the\n * RESOLVED adapter or the live registry — scope expressibility, retention/anonymizable/scope-root\n * refusals — live in the backend registry validation, which structurally cannot run here.)\n */\n if (persistenceAdapter === PersistenceAdapter.HTTP_API && httpApiBinding === undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] persistenceAdapter 'http-api' requires the companion 'httpApiBinding' declaration (provider, dialect, key fields, identity, tenancy, erasure).`\n );\n }\n if (persistenceAdapter === PersistenceAdapter.INTROSPECTION && introspectionBinding === undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] persistenceAdapter 'introspection' requires an 'introspectionBinding' naming the companion behavior whose output becomes this resource's rows.`\n );\n }\n if (introspectionBinding !== undefined && persistenceAdapter !== PersistenceAdapter.INTROSPECTION) {\n throw createConfigurationError(\n `[${resourceIdentifier}] 'introspectionBinding' is declared but persistenceAdapter is '${String(persistenceAdapter ?? 'undeclared (application default)')}' — a binding on a stored resource would never be read. Declare persistenceAdapter: 'introspection' or remove the binding.`\n );\n }\n if (httpApiBinding !== undefined && persistenceAdapter !== PersistenceAdapter.HTTP_API) {\n throw createConfigurationError(\n `[${resourceIdentifier}] 'httpApiBinding' is declared but persistenceAdapter is '${String(persistenceAdapter ?? 'undeclared (application default)')}' — a binding on a platform-backed resource would never be read. Declare persistenceAdapter: 'http-api' or remove the binding.`\n );\n }\n /**\n * `persistenceAdapterIsolation` alongside `HTTP_API` is REFUSED, because the claim it makes is\n * one the adapter has already settled — so honouring it would be honouring nothing.\n *\n * The declaration exists to buy a resource admission past the one-adapter rule when it disagrees\n * with the application default: its author asserts the resource takes part in no cross-adapter\n * atomic write, and the resources registry admits it and logs the admitted set. An `HTTP_API`\n * resource is admitted by that same rule WITHOUT any such assertion, on the adapter's own nature —\n * it is not a second platform store, it owns no transactions, and it cannot be an application\n * default. The registry's exemption is therefore ordered BEFORE the isolation branch and returns\n * first, so on an `HTTP_API` resource the isolation claim is never read.\n *\n * Silently ignoring it is the outcome worth preventing. An author who writes the field believes\n * they have bought something, and every later reader believes the resource's admission depends on\n * it — so a future change to the isolation door would look like it affected this resource when it\n * could not. A field whose absence and presence are indistinguishable is worse than a rejected\n * one; this is the same reasoning as the sibling refusal directly above, where a binding on a\n * platform-backed resource is refused precisely because nothing would ever read it.\n */\n if (persistenceAdapter === PersistenceAdapter.HTTP_API && persistenceAdapterIsolation !== undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] 'persistenceAdapterIsolation' is declared alongside persistenceAdapter 'http-api', where it is never read — an http-api resource is admitted past the one-adapter rule on the adapter's own nature, not on an isolation claim. Remove the isolation declaration.`\n );\n }\n // The RESOLVED binding, not the authored one. An author writes the schema's INPUT shape\n // (`HttpApiResourceBindingAuthored`), so defaults like `verifyMetadataAtBoot`, `connection` and\n // `remoteCallSemantics` may be absent from what they typed; every consumer reads the parsed shape\n // and is entitled to find them. The parse result used to be DISCARDED — harmless only because\n // authoring demanded every field, which is precisely the burden the authored shape removes.\n const resolvedHttpApiBinding = httpApiBinding === undefined ? undefined : (() => {\n const bindingParse = HttpApiResourceBindingSchema.safeParse(httpApiBinding);\n if (!bindingParse.success) {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid httpApiBinding declaration: ${bindingParse.error.issues.map((issue) => `${issue.path.join('.') || '(root)'}: ${issue.message}`).join('; ')}`\n );\n }\n try {\n assertHttpApiBindingDialectCoherence(bindingParse.data);\n } catch (error) {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid httpApiBinding declaration: ${describeCaughtError(error)}`\n );\n }\n return bindingParse.data;\n })();\n\n /**\n * `externalDataPipeline` — the inbound ETL pipeline on an ordinary LOCAL resource (partial-resource\n * coverage v3; PR-3/PR-4). Validated at AUTHORING like `httpApiBinding` above: shape (Zod),\n * schema-independent coherence (`assertExternalDataPipelineDeclarationCoherence` — S1 tenancy\n * confinement, unique mapping targets, coercion×dialect), the source binding's own dialect\n * coherence, and every mainSchema-dependent rule:\n *\n * - the pipeline is FORBIDDEN on an HTTP_API-adapter resource (a virtual resource IS the\n * remote side — chaining a pipeline onto read-through would re-create the composite v1\n * rejected);\n * - `remoteKeyLocalField` exists, is a STRING, and is declared `.isBusinessKey()` +\n * `excludeFromCreate` + `excludeFromUpdate` — SYNC's idempotent upsert keys on it and no\n * caller may mint or move it (boot-CHECKED, not factory-mutated: the app author sees the\n * truth in their own schema file);\n * - every mapped local field exists and is `excludeFromCreate`/`excludeFromUpdate`\n * (remote-authoritative — D-P5), and a non-`required` REMOTE_FIELD target must ACCEPT\n * ABSENCE (optional/nullable/default wrapper), or an absent remote value would have nowhere\n * honest to land (v3.1 §3);\n * - `ISO_STRING_TO_DATE` targets must be date fields;\n * - `population: CLOSED` refuses declared caller CREATE operations (D-P8) — INCLUDING a custom\n * operation that is create-shaped through `resourceOperationLike`. Enumerating only\n * `coreOperations` was the earlier, narrower form and it was a real hole: a custom operation\n * is exactly where an author expresses \"mint a row my own way\", so it is the likeliest way\n * into a CLOSED population, not an exotic one.\n */\n const externalDataPipeline = params.externalDataPipeline === undefined ? undefined : (() => {\n const refuse = (message: string): never => {\n throw createConfigurationError(`[${resourceIdentifier}] invalid externalDataPipeline declaration: ${message}`);\n };\n if (persistenceAdapter === PersistenceAdapter.HTTP_API) {\n refuse(\"an HTTP_API-adapter (virtual) resource cannot ALSO declare a pipeline — it IS the remote side; declare the pipeline on the LOCAL destination resource instead.\");\n }\n const declarationParse = ExternalDataPipelineDeclarationSchema.safeParse(params.externalDataPipeline);\n if (!declarationParse.success) {\n refuse(declarationParse.error.issues.map((issue) => `${issue.path.join('.') || '(root)'}: ${issue.message}`).join('; '));\n }\n const declaration = declarationParse.data!;\n try {\n assertExternalDataPipelineDeclarationCoherence(declaration);\n assertHttpApiBindingDialectCoherence(declaration.binding);\n } catch (error) {\n refuse(describeCaughtError(error));\n }\n // #1679 / #1690 — whether the binding may open writes is the declaration's own coherence (an INBOUND pipeline\n // refuses them, an OUTBOUND one requires them), checked above by `assertExternalDataPipelineDeclarationCoherence`.\n\n const shape = getZodObjectShape(mainSchema);\n if (declaration.direction === ExternalDataPipelineDirection.OUTBOUND) {\n validateExternalDataOutboundDeclarationAgainstSchema(declaration, shape, params.externalDataPipeline as Record<string, unknown>, refuse);\n return declaration;\n }\n const requireMappedTarget = (fieldName: string, context: string): z.ZodTypeAny => {\n const fieldSchema = shape[fieldName];\n if (!fieldSchema) refuse(`${context}: local field '${fieldName}' does not exist on mainSchema.`);\n if (!isExcludedFromCreate(fieldSchema!) || !isExcludedFromUpdate(fieldSchema!)) {\n refuse(\n `${context}: local field '${fieldName}' must be declared .excludeFromCreate() and .excludeFromUpdate() — it is REMOTE-AUTHORITATIVE (written only by the pipeline), and the exclusion is also what renders it read-only end to end (DTO → UI).`\n );\n }\n return fieldSchema!;\n };\n\n const keyFieldSchema = requireMappedTarget(declaration.remoteKeyLocalField, 'remoteKeyLocalField');\n if (!(unwrapSchema(keyFieldSchema) instanceof z.ZodString)) {\n refuse(`remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must be a STRING field — it stores the synthesized remote id.`);\n }\n if (!isBusinessKeyField(keyFieldSchema)) {\n refuse(\n `remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must be declared .isBusinessKey() — SYNC's idempotent upsert keys on it, and the business-key declaration is what makes the load MERGE instead of duplicate.`\n );\n }\n // ...and `.isUnique()` ON TOP, which is NOT redundant with the line above: the SQL schema\n // planner derives a UNIQUE constraint from `.isUnique()` and never from `.isBusinessKey()`.\n // Without it the merge contract is upheld only by our own read-then-write, so two concurrent\n // runs of one pipeline can leave TWO rows for one remote row — the exact duplication the whole\n // business-key design exists to prevent, and precisely what a store-level constraint refuses\n // for free.\n //\n // Required rather than suggested because this is an invariant with N call sites (every\n // destination any application ever declares) and a silent failure mode: nothing misbehaves\n // until two runs overlap, and by then the duplicate rows already exist. Found by the first\n // dogfood — the generated migration gave the key a PLAIN index and the omission was invisible\n // in every test, because a single-threaded upsert merges correctly with or without it.\n if (!isUniqueField(keyFieldSchema)) {\n refuse(\n `remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must ALSO be declared .isUnique(). The schema planner derives a UNIQUE constraint from .isUnique() and NOT from .isBusinessKey(), so without it the store would accept two rows for one remote row whenever two runs overlap — the merge would be enforced only by this engine's read-then-write, never by the database.`\n );\n }\n\n /*\n * The two PARTITION stamps (#1058 E4), when the source instance is partitioned.\n *\n * Validated through `requireMappedTarget` like every other engine-written target, so both\n * inherit the `.excludeFromCreate()/.excludeFromUpdate()` requirement — these decide who may see\n * a row and whether an orphan pass deletes it, and a caller that could write either could move\n * its own rows into another subsidiary's confinement or out of the orphan comparison entirely.\n *\n * Both must ACCEPT ABSENCE, and that is the one rule the sibling `remoteKeyLocalField` does not\n * share. A row whose partition field is unset is SHARED (E2) — it belongs to every caller and to\n * no unit — so both stamps land `null` on it. A required target would reject exactly the rows\n * the decision says everyone may see, and it would reject them at LOAD time, per row, with a\n * reason about a field the author never wrote a value for.\n */\n for (const [label, partitionField] of [\n ['partitionUnitLocalField', declaration.partitionUnitLocalField],\n ['partitionKeyLocalField', declaration.partitionKeyLocalField],\n ] as const) {\n if (partitionField === undefined) continue;\n const partitionSchema = requireMappedTarget(partitionField, label);\n if (!(unwrapSchema(partitionSchema) instanceof z.ZodString)) {\n refuse(\n `${label}: '${partitionField}' must be a STRING field — it stores ${label === 'partitionUnitLocalField' ? 'an ORGANIZATION_UNITS id' : \"the remote partition key in the canonical text an assignment row holds\"}.`\n );\n }\n if (unwrapSchema(partitionSchema) === partitionSchema) {\n refuse(\n `${label}: '${partitionField}' must be optional or nullable. A row whose remote partition field is unset is SHARED — it belongs to every caller and to no unit — and this stamp lands null on it, so a required target rejects exactly the rows every caller is entitled to see.`\n );\n }\n }\n\n /*\n * #1723 — a BIDIRECTIONAL pipeline's fields each have an OWNER, and the ownership rules follow it: a REMOTE field is\n * the system of record's (excluded from caller writes, exactly as on an INBOUND pipeline); a LOCAL or BOTH field is\n * the application's too, so callers must be able to write it — excluding it from both create and update would make\n * the pipeline send a value nobody decided, the OUTBOUND rule.\n */\n const requireSentTarget = (fieldName: string, context: string): z.ZodTypeAny => {\n const fieldSchema = shape[fieldName];\n if (!fieldSchema) refuse(`${context}: local field '${fieldName}' does not exist on mainSchema.`);\n if (isExcludedFromCreate(fieldSchema!) && isExcludedFromUpdate(fieldSchema!)) {\n refuse(\n `${context}: '${fieldName}' is sent to the system of record (owner LOCAL or BOTH) and is declared .excludeFromCreate() and `\n + '.excludeFromUpdate(), so no caller can ever set it and the pipeline would send a value nobody decided. Let callers write it, or declare it owner: REMOTE.',\n );\n }\n return fieldSchema!;\n };\n if (declaration.direction === ExternalDataPipelineDirection.BIDIRECTIONAL) {\n // Rows born locally have no remote key until their create is sent, and \"no key\" must stay out of the unique index\n // on every store: absent, never null (MongoDB indexes an explicit null) — the OUTBOUND rule (#2039 review).\n if (keyFieldSchema.safeParse(null).success) {\n refuse(`remoteKeyLocalField: '${declaration.remoteKeyLocalField}' accepts null. Declare it .optional(), not .nullable(): its unique index ignores a row with no key only while \"no key\" is ABSENT.`);\n }\n if (declaration.population === ExternalDataDestinationPopulation.OPEN && unwrapSchema(keyFieldSchema) === keyFieldSchema) {\n refuse(`remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must be optional — population OPEN lets rows be born here, and such a row has no remote key until its create is sent.`);\n }\n }\n\n for (const entry of declaration.mapping) {\n const owner = resolveExternalDataFieldOwner(entry);\n const targetSchema = owner === ExternalDataFieldOwner.REMOTE\n ? requireMappedTarget(entry.localField, `mapping('${entry.localField}')`)\n : requireSentTarget(entry.localField, `mapping('${entry.localField}')`);\n if (entry.kind === ExternalDataMappingEntryKind.REMOTE_FIELD && owner !== ExternalDataFieldOwner.LOCAL) {\n if (!entry.required && unwrapSchema(targetSchema) === targetSchema) {\n refuse(\n `mapping('${entry.localField}'): a non-required remote field can be ABSENT on a row, and absence lands as null — the target must be optional/nullable/defaulted, or declare required: true (absent rows are then rejected and reported per row).`\n );\n }\n if (entry.coercion === ExternalDataFieldCoercion.ISO_STRING_TO_DATE && !(unwrapSchema(targetSchema) instanceof z.ZodDate)) {\n refuse(`mapping('${entry.localField}'): coercion ISO_STRING_TO_DATE targets a date field.`);\n }\n // ⚠ Odoo spells ABSENT values as literal `false` (v3.1 §3 / PR-8), so on an Odoo source\n // the false→null coercion is the DEFAULT — resolved HERE, at authoring time, because this\n // is the one place the destination field's type is known: a genuine BOOLEAN target keeps\n // its `false` (Odoo booleans really are `false`), everything else would otherwise persist\n // a literal `false` into a string/date/number field. The runtime transform then applies\n // only RESOLVED coercions and carries no schema knowledge.\n if (\n declaration.binding.dialect === HttpApiTransportDialect.ODOO_JSONRPC\n && entry.coercion === ExternalDataFieldCoercion.NONE\n && !(unwrapSchema(targetSchema) instanceof z.ZodBoolean)\n ) {\n entry.coercion = ExternalDataFieldCoercion.ODOO_FALSE_AS_NULL;\n }\n }\n /*\n * #1684 — a REMOTE_REFERENCE writes a LOCAL foreign key, resolved after the load.\n *\n * STRING, because the value is a local row id (a pipeline target) or a synthesized key (a virtual\n * target), and both are strings. ABSENCE-CAPABLE, because an empty remote reference and an unresolved\n * one both leave it empty — a required target would make every row whose parent is not loaded yet\n * unwritable. The relationship half (the field IS a declared foreign key to the target) is checked\n * below, once relationships are compiled; whether the target is a pipeline destination or a virtual\n * resource on the same system of record needs the TARGET's configuration, which only the resources\n * registry holds, so it is refused at startup.\n *\n * The value shape defaults from the dialect HERE, like the Odoo false→null coercion above: this is the\n * one place both the dialect and the author's silence are known, and the runtime reads only the\n * resolved value.\n */\n if (entry.kind === ExternalDataMappingEntryKind.REMOTE_REFERENCE) {\n if (!(unwrapSchema(targetSchema) instanceof z.ZodString)) {\n refuse(`mapping('${entry.localField}'): a REMOTE_REFERENCE writes a local foreign key, so its target must be a STRING field.`);\n }\n if (unwrapSchema(targetSchema) === targetSchema) {\n refuse(\n `mapping('${entry.localField}'): a REMOTE_REFERENCE leaves its foreign key EMPTY while the reference is empty or its target is not loaded yet, so the field must be optional or nullable.`\n );\n }\n entry.valueShape = resolveExternalDataRemoteReferenceValueShape(entry, declaration.binding.dialect);\n }\n validateExternalDataExpressionAgainstTarget(entry, targetSchema, declaration.binding.dialect, refuse);\n }\n\n if (declaration.population === ExternalDataDestinationPopulation.CLOSED) {\n // Enumerate by the operation's EFFECTIVE semantics, never by its identifier: a CORE operation\n // is its own semantics, while a CUSTOM one declares them per variant through\n // `resourceOperationLike` (the same resolution `isDataModeVariantKeyAllowedForOperation`\n // uses). Both sources are unioned because neither sees the other's members — `coreOperations`\n // can name an operation with no authored configuration entry, and `operationsConfiguration`\n // is where a custom operation exists at all.\n const createShaped: ReadonlySet<unknown> = new Set<unknown>([\n CoreResourceOperation.CREATE,\n CoreResourceOperation.CREATE_MANY,\n ]);\n const declaredCreates = new Set<string>();\n for (const operation of (coreOperations as unknown[])) {\n if (createShaped.has(operation)) declaredCreates.add(String(operation));\n }\n for (const [operationKey, operationConfig] of Object.entries((operationsConfiguration ?? {}) as Record<string, unknown>)) {\n const variants = (operationConfig as { variants?: Array<{ resourceOperationLike?: unknown }> })?.variants ?? [];\n const effectiveOperations: unknown[] = variants.length > 0\n ? variants.map((variant) => variant.resourceOperationLike ?? operationKey)\n : [operationKey];\n if (effectiveOperations.some((effective) => createShaped.has(effective))) {\n declaredCreates.add(operationKey);\n }\n }\n if (declaredCreates.size > 0) {\n refuse(\n `population CLOSED: every row comes from the pipeline, so caller CREATE operations (${[...declaredCreates].sort().join(', ')}) are refused — declare population: OPEN if users may mint rows beside the synced ones. A CUSTOM operation counts when a variant declares a create-shaped resourceOperationLike.`\n );\n }\n }\n\n return declaration;\n })();\n\n const normalizedResourceRelationships = Resources_SharedUtils.ensureCompiledRelationships(\n resourceRelationships\n );\n\n // ========================================\n // VALIDATE DECORATOR COMBINATIONS\n // ========================================\n\n // Validate that mainSchema doesn't have invalid decorator combinations\n validateDecoratorCombinations(mainSchema, resourceIdentifier as string);\n\n // ========================================\n // DERIVE RESOURCE PRIMARY SCOPE\n // ========================================\n //\n // Two derivation signals are permitted (no silent default). A third\n // mechanism — polymorphic factories — is mechanically a special case of (2):\n //\n // 1. SELF-ANCHOR — the resource itself is one of the canonical scope roots\n // (USERS, ORGANIZATIONS, APPLICATION, ANONYMOUS_USERS). The PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE\n // map encodes that bijection.\n //\n // 2. FLAGGED RELATIONSHIP — exactly one relationship involving this resource\n // has `isPrimaryScope: true`. The rel-factory enforces that the flag can\n // only be set on a parent (not a child-side) and that the parent resolves\n // to a known scope-root in the primaryScopeMap, so reading\n // `primaryScopeRelationship.primaryScope` here always yields a valid enum.\n //\n // 3. POLYMORPHIC VARIANT (special case of 2) — resources built via\n // `createPolymorphicResourceConfigurations(...)` (e.g. SSO connections,\n // billing accounts, subscriptions, M2M webhooks). The polymorphic factory\n // auto-injects an `isPrimaryScope: true` rel per declared variant, so each\n // variant resolves through path (2) without the author having to re-declare\n // the anchor manually. If you reach the throw below for a polymorphic\n // resource, the variant declaration is missing its scope mapping — fix\n // the polymorphic config, NOT the registry rel list.\n //\n // If no derivation signal is present we THROW. The framework cannot quietly\n // assume a scope: scope drives auth, notifications, execution context, URL\n // routing, and cross-tenant isolation. A wrong default would be a silent\n // security regression. Every resource author MUST declare scope explicitly\n // via one of the three signals above.\n //\n // Migration: if you hit this throw, add a STANDALONE primary rel from the\n // owning scope-root (e.g. `ORGANIZATIONS → yourResource`,\n // `USERS → yourResource`, `APPLICATION → yourResource`) with\n // `accessScopeStrategy: STANDALONE` and `isPrimaryScope: true`. STANDALONE\n // keeps the rel inert for URL routing while declaring the structural\n // ownership anchor — see `resources-relationships.shared.factory.ts` Guard 1.\n\n const selfScopeEntry = Object.entries(PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE).find(\n ([, coreType]) => coreType === resourceIdentifier\n );\n\n const relevantRelationships = normalizedResourceRelationships.filter(rel =>\n rel.resourceType1 === resourceIdentifier || rel.resourceType2 === resourceIdentifier\n );\n const primaryScopeRelationship = relevantRelationships.find(rel => rel.isPrimaryScope === true);\n\n let resourcePrimaryScope: ResourcePrimaryScope;\n if (selfScopeEntry) {\n resourcePrimaryScope = selfScopeEntry[0] as ResourcePrimaryScope;\n } else if (primaryScopeRelationship?.primaryScope) {\n resourcePrimaryScope = primaryScopeRelationship.primaryScope;\n } else {\n throw createConfigurationError(\n `[${resourceIdentifier}] Cannot derive resourcePrimaryScope.\\n` +\n `\\n` +\n `A resource configuration MUST declare its primary scope via one of:\\n` +\n ` (1) Self-anchor — the resource itself is a canonical scope root\\n` +\n ` (USERS, ORGANIZATIONS, APPLICATION, ANONYMOUS_USERS).\\n` +\n ` (2) Flagged relationship — exactly one parent relationship carries\\n` +\n ` \\`isPrimaryScope: true\\` (parent resolves to a known scope root).\\n` +\n ` (3) Polymorphic variant — resources built via\\n` +\n ` \\`createPolymorphicResourceConfigurations(...)\\` get an\\n` +\n ` \\`isPrimaryScope: true\\` rel auto-injected per variant. If you\\n` +\n ` reach this throw for a polymorphic resource, your variant\\n` +\n ` declaration is missing its scope mapping — fix the polymorphic\\n` +\n ` config, NOT the registry rel list.\\n` +\n `\\n` +\n `No signal was found for resource '${resourceIdentifier}'.\\n` +\n `\\n` +\n `Fix: add a primary-anchor relationship in the registry. For an internal\\n` +\n `resource that should NOT be URL-routed under its scope parent, use:\\n` +\n `\\n` +\n ` createResourcesRelationship(\\n` +\n ` CoreResourceType.ORGANIZATIONS, '${resourceIdentifier as string}',\\n` +\n ` ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY,\\n` +\n ` {\\n` +\n ` accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.STANDALONE,\\n` +\n ` isPrimaryScope: true,\\n` +\n ` nature: RelationshipNature.REFERENCE,\\n` +\n ` contextPolicy: { enabled: false },\\n` +\n ` }\\n` +\n ` )\\n` +\n `\\n` +\n `For a routable child resource, drop the STANDALONE strategy and add\\n` +\n `\\`isPrimaryScope: true\\` to the existing parent relationship.\\n` +\n `\\n` +\n `Background: the framework no longer falls back to a silent ORGANIZATIONS\\n` +\n `default — primary scope drives auth, notifications, execution context,\\n` +\n `URL routing, and cross-tenant isolation, so a wrong default would be a\\n` +\n `silent security regression. See \\`resources-config.shared.factory.ts\\`\\n` +\n `(DERIVE RESOURCE PRIMARY SCOPE) for the full rationale.`\n );\n }\n\n // ========================================\n // HTTP_API × PRIMARY SCOPE — a system of record's rows belong to the OWNER organization\n // ========================================\n //\n // Rows read out of a system of record are STAMPED with the organization that owns the application\n // (#1055 §6), and the engine's per-row gate reads that stamp. Three things have to be true of the\n // resource for the stamp to mean anything, and all three are checkable HERE.\n //\n // ## Why here, and not at registration — R13 was measured and is wrong on this half\n //\n // #1055's review pass says \"the resource factory never sees relationships\", so the anchor check\n // must move to boot registration. It does see them: `resourceRelationships` is a parameter of this\n // function (a resource config is a FUNCTION of the registry's relationship list — see any\n // `*.resources-config.ts`), and `primaryScopeRelationship` is resolved from it thirty lines up.\n //\n // So the split the plan prescribed buys nothing and costs the author their error at the moment they\n // write the file. What genuinely CANNOT be checked here is the INSTANCE — whether `system` names a\n // declared one and whether the dialects agree — because the saas configuration is not in scope in\n // an application's `shared-lib`. That half stays at registration, which is the first place both the\n // binding and the declaration are visible.\n if (resolvedHttpApiBinding !== undefined) {\n if (resourcePrimaryScope !== ResourcePrimaryScope.ORGANIZATIONS) {\n throw createConfigurationError(\n `[${resourceIdentifier}] an http-api resource must be ORGANIZATIONS-scoped, and this one resolves to `\n + `'${resourcePrimaryScope}'. Its rows are stamped with the organization that owns the application, and the `\n + `per-row tenant gate reads that stamp — an APPLICATION- or USER_SELF-scoped resource has no organization in `\n + `its execution context to compare it against, so every read would be decided by a field nothing could match.`\n );\n }\n\n /*\n * The anchor must be REQUIRES_CONTEXT, and it must name no foreign key.\n *\n * STANDALONE is the one that was MEASURED to fail rather than reasoned about: it answered\n * 403 `parent_scope_denied` to an ORG_OWNER, because `initiatorIds.organizationId` is filled only\n * from URL parameters and a standalone resource is not routed under its scope parent.\n *\n * A `foreignKeyField` would be a field the projection can never fill: a remote row carries no\n * Wildo organization id, which is the entire reason the stamp exists. Naming one would make every\n * row look as though it declared a tenant it does not have.\n */\n if (primaryScopeRelationship !== undefined) {\n if (primaryScopeRelationship.accessScopeStrategy !== ResourceRelationshipAccessScopeStrategy.REQUIRES_CONTEXT) {\n throw createConfigurationError(\n `[${resourceIdentifier}] an http-api resource's primary-scope relationship must be REQUIRES_CONTEXT, and this `\n + `one is '${String(primaryScopeRelationship.accessScopeStrategy)}'. A STANDALONE anchor is not routed under its `\n + `organization, so the execution context carries no organization id and an ORG_OWNER is answered `\n + `403 parent_scope_denied — measured, not inferred.`\n );\n }\n if (primaryScopeRelationship.foreignKeyField !== undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] an http-api resource's primary-scope relationship declares `\n + `foreignKeyField '${String(primaryScopeRelationship.foreignKeyField)}', which the projection can never fill — `\n + `a remote row carries no Wildo organization id. The tenant anchor is STAMPED onto the projected row from the `\n + `application's owner organization; remove the foreign key.`\n );\n }\n }\n }\n\n // ========================================\n // HTTP_API × WRITES — what a writable read-through resource must declare (#1679)\n // ========================================\n //\n // Everything decidable from this one file: the verbs the binding opens against the operations that\n // perform them, no bulk write, INLINE only, no `Idempotency-Key: accepted`. (The erasure-stance rule\n // that used to sit here is the #2010 check just above, which covers reads as well.) The rules and their reasons live on\n // `assertHttpApiWriteDeclarationCoherence`. What needs the saas configuration (the instance's\n // partition field) or the engine's dialect registry (whether the dialect can write at all) is\n // checked at boot registration instead.\n if (resolvedHttpApiBinding !== undefined) {\n // #2010: a read-through resource's fields ARE the remote row's, so personal-data categories on them contradict a\n // NO_SUBJECT_DATA stance whether or not the binding writes. The rule and its remedy live on the util.\n const personalFields = personalFieldsContradictingNoSubjectDataStance({ stance: resolvedHttpApiBinding.erasure.stance, mainSchema });\n if (personalFields.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid httpApiBinding erasure stance: ${describeNoSubjectDataStanceContradiction({ system: resolvedHttpApiBinding.system, personalFields })}`,\n );\n }\n try {\n assertHttpApiWriteDeclarationCoherence({\n binding: resolvedHttpApiBinding,\n operations: collectHttpApiWriteOperationFacts(\n coreOperations as readonly unknown[],\n operationsConfiguration as Readonly<Record<string, unknown>> | undefined,\n ),\n mainSchema,\n });\n } catch (error) {\n throw createConfigurationError(`[${resourceIdentifier}] invalid httpApiBinding write declaration: ${describeCaughtError(error)}`);\n }\n }\n\n // ========================================\n // EXTERNAL-DATA PIPELINE × PRIMARY SCOPE — the destination is ORGANIZATIONS-owned, and the ENGINE\n // supplies the tenant\n // ========================================\n //\n // Since #868 a pipeline load STAMPS every entry with the organization that owns the application\n // (#1054), under the destination's own declared foreign key. So the question this rule asks has\n // inverted: it used to demand that the AUTHOR supply the tenant, and now it demands that the author\n // leave room for the ENGINE to.\n //\n // ## What the previous rule was, and why it could not stay\n //\n // It refused a required scope FK that no mapping supplied, because a load genuinely carried no\n // tenant. MEASURED 2026-09-11 against a real Mongo store, through the real engines, on a\n // destination shaped exactly like Wonder Todos' `externalCustomers`:\n //\n // | declaration | run | rows | tenant | reachable |\n // |-----------------------------------------------|--------------|------|--------|-----------|\n // | no mapping onto the scope FK | completed | 2 | NO | 0 |\n // | a CONSTANT mapping onto the scope FK | completed | 2 | YES | 2 |\n //\n // The first row is why a refusal existed at all: a `completed-pass` run with `entriesFailed: 0`\n // that writes rows no contextual read can find. A silent success producing unreachable data is\n // strictly worse than a refusal.\n //\n // But both remedies it offered are now WRONG. A `CONSTANT` id cannot be authored — organizations\n // are created at runtime, so there is no id to commit — and a STANDALONE anchor was measured to\n // answer 403 `parent_scope_denied` to an ORG_OWNER, because `initiatorIds.organizationId` is filled\n // only from URL parameters and a standalone resource is not routed under its scope parent. The rule\n // was refusing the one correct shape and recommending two broken ones.\n //\n // ## What it refuses now, and why each one is a LIE rather than an incompleteness\n //\n // Every clause below rejects a declaration that would be UNTRUE if it ran, which is the test\n // `application-creation-directive.md` sets for a refusal. None of them asks anyone to decide\n // anything: each names the one shape that works.\n if (externalDataPipeline !== undefined) {\n // #2010: the fields a pipeline copies are what its source holds, so personal-data categories on them contradict\n // a NO_SUBJECT_DATA stance on its binding. A CONSTANT entry reads nothing from the source; an unmapped field is\n // the application's own. The same fields the privacy notice's source statement counts.\n const copiedFields = new Set(externalDataPipeline.mapping\n .filter((entry) => entry.kind !== ExternalDataMappingEntryKind.CONSTANT)\n .map((entry) => entry.localField));\n const copiedPersonalFields = personalFieldsContradictingNoSubjectDataStance({\n stance: externalDataPipeline.binding.erasure.stance,\n mainSchema,\n sourcedFields: copiedFields,\n });\n if (copiedPersonalFields.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid externalDataPipeline erasure stance: ${describeNoSubjectDataStanceContradiction({ system: externalDataPipeline.binding.system, personalFields: copiedPersonalFields })}`,\n );\n }\n const pipelineDestinationRefusal = (reason: string): never => {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid externalDataPipeline declaration: ${reason}\n`\n + `\n`\n + `A pipeline reads a SYSTEM OF RECORD — a deployment the operator runs, read with the application's own\n`\n + `service identity — so every row it loads belongs to the organization that OWNS the application, and the\n`\n + `engine stamps that organization onto each entry as it is built. What the destination owes is somewhere\n`\n + `to put it: an ORGANIZATIONS primary scope, reached through a ROUTED relationship\n`\n + `(accessScopeStrategy: REQUIRES_CONTEXT) that names a REQUIRED foreignKeyField, with that field mapped by\n`\n + `nothing and declared .excludeFromCreate().excludeFromUpdate().`\n );\n };\n\n // (a) The destination must be ORGANIZATIONS-scoped. Decision Q2 of #1049: system-of-record data\n // belongs to the owner organization, so an APPLICATION- or USER_SELF-scoped destination is a\n // statement about ownership that contradicts where the rows come from.\n if (resourcePrimaryScope !== ResourcePrimaryScope.ORGANIZATIONS) {\n pipelineDestinationRefusal(\n `its primary scope is ${String(resourcePrimaryScope)}, and a system-of-record destination must be ORGANIZATIONS.`,\n );\n }\n\n // (b) There must BE a routed scope relationship carrying a foreign key. Without one the stamp has\n // nowhere to land: a field the schema does not declare is dropped by the strict re-parse, and\n // the row lands unanchored — the measured failure above, arriving through the fix for it.\n // STANDALONE is called out by name because it is the remedy the previous rule recommended.\n if (primaryScopeRelationship === undefined) {\n pipelineDestinationRefusal('it declares no primary-scope relationship, so a loaded row has no tenant field.');\n }\n if (primaryScopeRelationship!.accessScopeStrategy === ResourceRelationshipAccessScopeStrategy.STANDALONE) {\n pipelineDestinationRefusal(\n 'its primary-scope relationship is STANDALONE. A standalone resource is not routed under its organization, so '\n + '`initiatorIds.organizationId` is never filled and an ORG_OWNER is answered 403 parent_scope_denied — measured '\n + 'on `billableServices`, 2026-09-14. This was the previous rule\\'s own first recommendation.',\n );\n }\n const scopeForeignKeyField = primaryScopeRelationship!.foreignKeyField;\n if (scopeForeignKeyField === undefined) {\n pipelineDestinationRefusal(\n 'its primary-scope relationship names no foreignKeyField, so there is no column to stamp the owner organization '\n + 'onto. (A VIRTUAL read-through resource is the opposite case and must NOT name one — its rows are projected, '\n + 'never stored.)',\n );\n }\n\n // (c) Nothing may MAP onto the tenant field. Two sources of truth for the tenant is the defect,\n // not a convenience: a mapping wins at load time and the stamp becomes decoration.\n if (externalDataPipeline.mapping.some((entry) => entry.localField === scopeForeignKeyField)) {\n pipelineDestinationRefusal(\n `a mapping entry writes '${String(scopeForeignKeyField)}', which the engine stamps. Two sources of truth for the `\n + 'tenant is exactly the ambiguity this rule exists to remove — remove the mapping entry.',\n );\n }\n\n // (d) The tenant field must be REQUIRED. Optional means \"a row without a tenant is legal\", and no\n // row loaded from a system of record is: an untenanted row is unreadable, and the schema would\n // be promising that it is a supported state.\n const scopeFieldSchema = getZodObjectShape(mainSchema)[scopeForeignKeyField!];\n if (scopeFieldSchema === undefined) {\n pipelineDestinationRefusal(\n `its primary-scope relationship names foreignKeyField '${String(scopeForeignKeyField)}', which the schema does not `\n + 'declare. The stamp would be dropped by the strict re-parse and every row would land unanchored.',\n );\n }\n // `unwrapSchema` strips optional/nullable/default wrappers, so an unwrapped schema IDENTICAL to\n // the declared one means nothing wrapped it — the same test the mapping validation above uses.\n if (unwrapSchema(scopeFieldSchema!) !== scopeFieldSchema!) {\n pipelineDestinationRefusal(\n `'${String(scopeForeignKeyField)}' is optional, nullable or defaulted. A row loaded from a system of record always `\n + 'has an owner, so an absent tenant is not a state this resource can be in — and declaring it legal makes an '\n + 'unreadable row look like a supported one.',\n );\n }\n\n // (e) The tenant field must be excluded from CREATE and UPDATE. It is engine-supplied, so a\n // client that could send it could hand its own rows to another organization — and one that\n // could update it could move them.\n if (!isExcludedFromCreate(scopeFieldSchema!) || !isExcludedFromUpdate(scopeFieldSchema!)) {\n pipelineDestinationRefusal(\n `'${String(scopeForeignKeyField)}' is engine-supplied and must be declared `\n + '.excludeFromCreate().excludeFromUpdate(). Without them a caller can name the tenant on a write — creating a row '\n + 'under another organization, or moving an existing one out of its own.',\n );\n }\n\n /*\n * (f) The destination population is NOT constrained here, and that DIVERGES from #868's review\n * decision R2(e), which said to refuse `OPEN` in this slice. Recorded rather than done quietly.\n *\n * R2(e)'s reason was that \"caller-minted rows under another organization contradict 'belongs to\n * the owner'\". Two things measured against that:\n *\n * - Nothing depends on the claim being universally true. The per-row tenant gate reads each\n * row's own anchor, so a loaded row owned by the owner organization and a caller-minted row\n * owned by its creator are both read correctly, by different people. There is no site that\n * asserts \"every row of this resource belongs to the owner\".\n * - A caller cannot name the tenant anyway: clause (e) above requires `.excludeFromCreate()`, so\n * a caller-minted row takes its organization from the request context like any other, and the\n * orphan walk cannot reach it either — the walk filters on `__seed.seedKey`, which a\n * caller-minted row does not carry.\n *\n * And the deciding one is this repository's own test for a refusal\n * (`application-creation-directive.md`): if this refuses, what does the operator do next? The\n * answer would be \"change your product decision about whether callers may add rows\" — a\n * DECISION, not a repair to an untrue artifact. That makes it a workflow gate rather than a\n * refusal, and the directive says a workflow must MARK rather than block.\n *\n * Refusing it would also have made three shipped, tested behaviours unreachable: the CREATE/UPDATE\n * DTO stripping that protects remote-authoritative fields on caller-minted rows, the admission of\n * create-shaped custom operations, and the admission of a declared caller CREATE. Those pins live\n * in `external-data-pipeline-coherence.test.ts` and still pass.\n */\n\n /*\n * (g) #1684 — every REMOTE_REFERENCE writes the foreign key of a DECLARED relationship to its target.\n *\n * The relationship is what makes the written value a foreign key to the rest of the framework — a\n * picker, a nested read, a cascade — rather than a string that happens to hold a row id. So a reference\n * whose local field is not the `foreignKeyField` of a relationship between this resource and the target\n * would write a value nothing treats as a link: refused. A self-reference (Odoo `res.partner.parent_id`)\n * is a relationship whose two ends are this resource.\n *\n * Checked here, where relationships are compiled; the target's own kind (pipeline destination or virtual\n * resource on the same system of record) and the orphan-cascade acknowledgement need the TARGET's\n * configuration and are refused at startup by the resources registry.\n */\n for (const entry of externalDataPipeline.mapping) {\n if (entry.kind !== ExternalDataMappingEntryKind.REMOTE_REFERENCE) continue;\n const declaresEdge = relevantRelationships.some((relationship) =>\n relationship.foreignKeyField === entry.localField\n && ((relationship.resourceType1 as string) === entry.targetResourceType || (relationship.resourceType2 as string) === entry.targetResourceType)\n && ((relationship.resourceType1 as string) === (resourceIdentifier as string) || (relationship.resourceType2 as string) === (resourceIdentifier as string)));\n if (!declaresEdge) {\n throw createConfigurationError(\n `[${resourceIdentifier}] invalid externalDataPipeline declaration: mapping('${entry.localField}') is a REMOTE_REFERENCE to `\n + `'${entry.targetResourceType}', and no relationship between '${String(resourceIdentifier)}' and '${entry.targetResourceType}' `\n + `names '${entry.localField}' as its foreignKeyField. Declare the relationship (a self-reference is a relationship whose two `\n + 'ends are this resource) so the resolved value is a foreign key the rest of the framework follows, not a bare id.',\n );\n }\n }\n }\n\n // ========================================\n // isAnonymizable VALIDATION & ENRICHMENT (W7.3a)\n // ========================================\n\n let effectiveMainSchema: TMainSchema = mainSchema;\n let effectiveResourceRelationships = normalizedResourceRelationships;\n let effectiveSystemAccessPolicy = systemAccessPolicy;\n\n if (isAnonymizable) {\n if (resourcePrimaryScope !== ResourcePrimaryScope.USER_SELF) {\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires primaryScope USER_SELF, got ${resourcePrimaryScope}.`\n );\n }\n\n try {\n const shape = getZodObjectShape(mainSchema);\n const userIdField = shape['userId'];\n if (!userIdField) {\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires a 'userId' field in mainSchema.`\n );\n }\n const nullResult = (userIdField as z.ZodTypeAny).safeParse(null);\n if (!nullResult.success) {\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires 'userId' field to accept null ` +\n `(anonymous records have no userId). Use z.string().nullable().`\n );\n }\n } catch (e) {\n if ((e as any)?.type === ErrorType.CONFIGURATION) throw e;\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true but mainSchema is not a ZodObject (cannot validate userId field).`\n );\n }\n\n // PRESENCE half of the anonymizable operation contract: each requirement group must have at\n // least one of its alternatives declared at all. The RESOLVABILITY half — that a declared op\n // has a variant `AnonymousSessionBackendService` can actually dispatch — runs later, once the\n // operation variants are assembled (search `ANONYMIZABLE_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS`).\n // Deliberately two checks, exactly as for `retentionPolicy`, because they have two different\n // fixes: \"declare the op\" vs \"declare it with a service-resolvable variant\".\n for (const { operations: alternatives, primitive, why } of ANONYMIZABLE_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS) {\n if (alternatives.some((alternative) => coreOperations.includes(alternative as any))) {\n continue;\n }\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires ${describeOperationAlternatives(alternatives)} ` +\n `in coreOperations (${primitive}: ${why}).`\n );\n }\n\n effectiveMainSchema = (mainSchema as any).extend({\n anonymousUserId: z.string().optional().nullable().isDBIndexed()\n }) as TMainSchema;\n\n const anonymousRelationship = createResourcesRelationship(\n CoreResourceType.ANONYMOUS_USERS as ResourceType,\n resourceIdentifier,\n ResourceRelationshipCardinality.ONE,\n primaryScopeRelationship!.cardinality2,\n {\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.STANDALONE,\n foreignKeyField: 'anonymousUserId',\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n nature: primaryScopeRelationship!.resolvedSemantics.nature,\n read: primaryScopeRelationship!.read,\n contextPolicy: { enabled: false },\n childOperations: primaryScopeRelationship!.childOperations?.lifecycle\n ? { lifecycle: primaryScopeRelationship!.childOperations.lifecycle }\n : undefined,\n }\n );\n effectiveResourceRelationships = [...normalizedResourceRelationships, anonymousRelationship];\n\n // ── Derive the transposition system-access grant (W7.3a) ──────────────\n //\n // Anonymous→user ownership transposition (`AnonymousSessionBackendService`)\n // rewrites `{ userId, anonymousUserId }` across every anonymizable resource\n // via `SystemAccessBackendService.updateManyAsSystem`. That primitive is\n // fail-closed on `systemAccessPolicy.updateMany` PER RESOURCE, and both FKs\n // it writes are context-auto-populated names the client-shaped request DTO\n // strips — so WITHOUT the grant the transposition would either throw\n // `CONFIGURATION` (fail-closed) or silently no-op, stranding the converting\n // user's rows under the anonymous id until the cleanup batch deletes them\n // (user-visible data loss).\n //\n // This grant is DERIVED, not authored, precisely because it is not an\n // incidental capability: it is THE mechanism `isAnonymizable` exists to\n // enable. The factory already REQUIRES `UPDATE_MANY` in `coreOperations`\n // above \"for transposition batch update\"; that core operation is\n // unreachable by the transposition service without this system-access\n // opt-in, so deriving it here COMPLETES an existing coupling rather than\n // inventing a new one — and removes a guaranteed per-app footgun (every\n // app marking a resource `isAnonymizable` would otherwise have to remember\n // the grant, and the engine core ships zero anonymizable resources to model\n // it from).\n //\n // Distinct from the `systemAccessPolicy` ⟂ `isSystemResource` separation\n // documented on the policy type: `isSystemResource` is a broad, ACL-\n // orthogonal marker (framework infra does NOT imply an ACL bypass is\n // acceptable), whereas `isAnonymizable` has a single, specific engine\n // behaviour that requires exactly `updateManyAsSystem`. The derived value\n // is materialised into the RESOLVED config below (not hidden in factory\n // control flow), so specs, audits, and `assertSystemAccessAllowed` all see\n // `updateMany: ALLOWED`. Any explicitly-authored `systemAccessPolicy` on an\n // anonymizable resource is preserved for its other verbs; only `updateMany`\n // is forced ALLOWED (a transposition-required resource cannot opt out of\n // its own transposition).\n //\n // FAIL-LOUD (not silent-override): if the author EXPLICITLY declared\n // `updateMany: FORBIDDEN`, that contradicts `isAnonymizable` (the resource\n // asks for transposition yet forbids the only primitive that performs it).\n // Silently flipping it to ALLOWED would erase an explicit security\n // declaration — dishonest. Throw instead. We read the RAW authored policy\n // (`params.systemAccessPolicy`), NOT the destructured value: an unauthored\n // policy is defaulted to all-verbs-FORBIDDEN above, and forcing THAT to\n // ALLOWED is the intended, non-contradictory derive (the common case). Only\n // a hand-written `updateMany: FORBIDDEN` is the contradiction we reject.\n if (params.systemAccessPolicy?.updateMany === ResourceSystemAccessMode.FORBIDDEN) {\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires systemAccessPolicy.updateMany = ALLOWED ` +\n `(anonymous→user transposition rewrites { userId, anonymousUserId } via updateManyAsSystem), but ` +\n `this resource explicitly authored updateMany: FORBIDDEN. A transposition-required resource cannot ` +\n `opt out of its own transposition — remove the explicit FORBIDDEN (the grant is derived automatically) ` +\n `or drop isAnonymizable.`\n );\n }\n effectiveSystemAccessPolicy = {\n ...systemAccessPolicy,\n updateMany: ResourceSystemAccessMode.ALLOWED,\n };\n }\n\n // ========================================\n // retentionPolicy VALIDATION & ENRICHMENT (impersonalization-on-erasure)\n // ========================================\n //\n // Mirror of the isAnonymizable branch above, for the OTHER trusted-write axis:\n // on erasure a retention-governed resource is impersonalized-and-retained\n // (personal fields scrubbed via `updateManyAsSystem`, row KEPT) instead of\n // hard-deleted. Injects the per-record `retentionStatus` marker and derives the\n // system-access grants the capability requires. RESOURCE-level: the per-edge\n // trigger (`onParentDelete.strategy = IMPERSONALIZE_AND_RETAIN`) and per-field scrub\n // (`.impersonalizeWith()`) are declared separately.\n if (retentionPolicy?.mode) {\n // PRESENCE half of the retention operation contract: each required op must be declared at all.\n // The RESOLVABILITY half — that the declared op has a variant the retention primitives can\n // actually dispatch — runs later, once the operation variants are assembled (search\n // `RETENTION_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS`). Deliberately two checks, because they have\n // two different fixes: \"declare the op\" vs \"declare it with a service-resolvable variant\".\n for (const { operation: requiredOperation, why } of RETENTION_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS) {\n if (!coreOperations.includes(requiredOperation as any)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires ${requiredOperation} in coreOperations (${why}).`\n );\n }\n }\n\n // Guard (framework-quality): `retentionStatus` / `impersonalizedAt` are framework-reserved\n // injected names. Zod-4 `.extend()` SILENTLY OVERWRITES a duplicate key, so a resource that\n // already declares one would have its own field clobbered on opt-in — fail loud instead. The\n // same `getZodObjectShape` call also yields a friendly config error if `mainSchema` is not a\n // ZodObject (the marker cannot be injected into a non-object schema).\n // EXPLICIT object check. (Do NOT rely on `getZodObjectShape` throwing — it returns `{}` for a\n // union, so a try/catch around it is dead code and the real failure surfaces later as an\n // undiagnosable `effectiveMainSchema.extend is not a function`.)\n if (!isZodObject(effectiveMainSchema)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires a ZodObject mainSchema (cannot inject the ` +\n `retentionStatus marker into a non-object schema — polymorphic/union mainSchemas are not yet supported).`\n );\n }\n\n const existingShape = getZodObjectShape(effectiveMainSchema);\n for (const reservedField of ['retentionStatus', 'impersonalizedAt'] as const) {\n if (existingShape[reservedField]) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy injects a reserved '${reservedField}' field, but this ` +\n `resource already declares one. Rename that field or drop retentionPolicy (the marker is factory-injected).`\n );\n }\n }\n\n // ========================================\n // IMPERSONALIZE TREATMENT VALIDATION — fail loud at CONFIG BUILD, not on the erasure path.\n // ========================================\n //\n // The impersonalize writer scrubs via `updateManyAsSystem`, whose STRICT update-DTO parse runs\n // over the scrub patch. A treatment the declared field schema cannot accept therefore throws\n // INSIDE the parent-delete transaction and ROLLS BACK the erasure — the worst possible moment to\n // discover a config mistake. Every check below is a pure `safeParse` against the AUTHORED field\n // schema, so it catches every axis at once without a type taxonomy:\n //\n // - REMOVE writes `null`, which the field-clearing contract resolves into either a stored null\n // (null-accepting field) or a removed key (merely `.optional()`). Both are what REMOVE asks\n // for, so the requirement is that the field be CLEARABLE — i.e. not required and not\n // `.default()`-wrapped, since a default's output type is non-optional.\n // HISTORY, because this comment justified a stricter guard for months: update DTOs used to\n // be made `.optional()` and NEVER `.nullable()`, so a non-nullish field really did reject\n // the scrub, and the capability was non-functional for every non-nullable field. That\n // changed when `toPatchOptionalField` began admitting null for clearable fields; the guard\n // below was left demanding `.nullish()` and so failed startup on valid declarations.\n // - MASK writes the field's EFFECTIVE mask value — its own `maskValue` override, or\n // `IMPERSONALIZE_MASK_CONSTANT`. Beyond the obvious number/date/enum/boolean mismatches, the\n // default constant also fails CONSTRAINED strings — `z.email()`, `z.uuid()`, `.min(n)` — i.e.\n // exactly the PII fields most likely to be masked, which is why the override exists. A\n // \"MASK is string-only\" rule would NOT be sufficient. An override is validated against the\n // field's own schema here, and is rejected outright on a non-MASK treatment (nothing would\n // write it).\n // - A resource that opts into retentionPolicy but declares ZERO treatments would flip rows to\n // `RETAINED` with every personal field intact: a compliance-grade lie (it LOOKS erased).\n for (const [fieldName, fieldSchema] of Object.entries(existingShape)) {\n const treatment = getImpersonalizeTreatment(fieldSchema as z.ZodTypeAny);\n if (treatment === undefined) continue;\n\n // Floor fields are never scrubbed, so their schema need not accept a scrub value. Reuse the\n // writer's own floor predicate — one authority, so the guard can never drift from the scrub.\n if (isImpersonalizeNeverScrubFloorField(fieldName)) continue;\n\n // D1 allows SEVERING the person-link (`userId` / `anonymousUserId`) — but only when a NON-person\n // scope survives to anchor the retained row. If the person-link IS the resource's primary scope,\n // nulling it strips the row's only tenant anchor: contextual scoping can no longer reach it, so\n // the retained record becomes invisible even to the audited see-through path that retention\n // exists to serve (retained-but-unreachable ≠ retained).\n const severedScope = FIELD_IDENTIFIER_TO_PRIMARY_SCOPE[fieldName];\n if (\n treatment === RedactionType.REMOVE &&\n severedScope !== undefined &&\n severedScope === resourcePrimaryScope\n ) {\n throw createConfigurationError(\n `[${resourceIdentifier}] field '${fieldName}' declares impersonalize treatment REMOVE, but it is this ` +\n `resource's PRIMARY scope ('${severedScope}'). Severing the primary-scope link would leave the retained ` +\n `row with no tenant anchor — unreachable through contextual scoping, including the audited see-through ` +\n `read. Keep the primary-scope link (use KEEP) and scrub the personal FIELDS instead.`\n );\n }\n\n // NOTE ON UNIQUE-INDEXED FIELDS (gate G-BKEY): a scrub writes the SAME value to every row in\n // the batch (`null` for REMOVE, one shared mask constant for MASK), which on a plain unique\n // index would collide (E11000) and abort the erasure. That is NOT rejected here, because the\n // schema layer scopes every unique index on a retention-governed resource to NON-RETAINED rows\n // (`partialFilterExpression`, see `buildRetentionPartialFilterExpression`): the scrubbed rows\n // become RETAINED in the same write, leave the index, and therefore cannot collide — the same\n // property that stops a retained row from permanently locking out re-creation of its key.\n // ⚠️ This guard's absence DEPENDS on that partial index. If the partial filter is ever removed,\n // a treatment on a unique field becomes an erasure-aborting defect again.\n\n // A maskValue is meaningful ONLY under MASK — no other treatment writes it. Declaring one\n // elsewhere means the author believes a specific value will be stored while the writer would\n // null the field (REMOVE) or leave it untouched (KEEP): the declaration and the behaviour\n // disagree, which is the same class of silent compliance lie the zero-scrub guard prevents.\n // Checked BEFORE the per-treatment branches, and independently of them — as an arm of that\n // if/else chain it would be unreachable for exactly the treatments it needs to reject.\n if (treatment !== RedactionType.MASK && getImpersonalizeMaskValue(fieldSchema as z.ZodTypeAny) !== undefined) {\n throw createConfigurationError(\n `[${resourceIdentifier}] field '${fieldName}' declares an impersonalize maskValue but its treatment is ` +\n `'${treatment}', not MASK — nothing would ever write that value. Use MASK to store it, or drop the maskValue.`\n );\n }\n\n if (treatment === RedactionType.REMOVE) {\n // REMOVE writes `null`, and the field-clearing contract decides what that PERSISTS as: a\n // null-accepting field stores the null, a merely-`.optional()` field has the key removed.\n // Either outcome is what REMOVE asks for, so the requirement is CLEARABILITY, not\n // null-acceptance.\n //\n // This guard used to demand `.nullish()` and justify it with \"update DTOs are made\n // .optional(), never .nullable()\". That was true when it was written and is not any more —\n // `toPatchOptionalField` now admits null for every clearable field. Left unchanged, the\n // guard rejected a perfectly valid `.optional()` + REMOVE declaration at CONFIG BUILD, i.e.\n // it failed application startup, and explained the refusal with a rule that no longer\n // exists.\n if (!mainSchemaFieldIsClearable(fieldSchema as z.ZodTypeAny)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] field '${fieldName}' declares impersonalize treatment REMOVE, which clears the ` +\n `field, but the field is required (or carries a \\`.default()\\`, whose output type is non-optional). A ` +\n `field that must always hold a value cannot be scrubbed by removal — declare it \\`.optional()\\` or ` +\n `\\`.nullish()\\`, or use MASK to overwrite it with a placeholder instead.`\n );\n }\n } else if (treatment === RedactionType.MASK) {\n // Validate the EFFECTIVE value — the field's own `maskValue` override when it declares one,\n // the framework constant otherwise — resolved through the SAME helper the scrub writer uses,\n // so a config that passes here cannot produce a write the update DTO rejects mid-erasure.\n const effectiveMaskValue = resolveImpersonalizeMaskValue(fieldSchema as z.ZodTypeAny);\n if (!(fieldSchema as z.ZodTypeAny).safeParse(effectiveMaskValue).success) {\n throw createConfigurationError(\n effectiveMaskValue === IMPERSONALIZE_MASK_CONSTANT\n ? `[${resourceIdentifier}] field '${fieldName}' declares impersonalize treatment MASK, but its schema ` +\n `rejects the default mask constant '${IMPERSONALIZE_MASK_CONSTANT}'. That constant is an unconstrained ` +\n `string, so a number/date/enum/boolean — or a CONSTRAINED string such as z.email()/z.uuid()/.min(n) — ` +\n `cannot hold it. Either declare a field-specific value the schema accepts ` +\n `(\\`.impersonalizeWith(MASK, { maskValue: '...' })\\`), or use REMOVE on a \\`.nullish()\\` field.`\n : `[${resourceIdentifier}] field '${fieldName}' declares impersonalize treatment MASK with ` +\n `maskValue '${effectiveMaskValue}', but its own schema rejects that value. The mask is written ` +\n `verbatim through the strict update-DTO parse, so it must satisfy every constraint the field ` +\n `declares (format, length, enum membership).`\n );\n }\n } else if (treatment === RedactionType.RESET) {\n /*\n * RESET returns the field to its schema default — the treatment for a field that is non-nullable\n * WITH a `.default()`, where REMOVE (needs clearable) and MASK (needs a string) both refuse.\n *\n * The RULES live in `resolveImpersonalizeResetValue`, deliberately, and are NOT restated here: it\n * refuses a field with no default, and one that is merely `.optional()` (whose default IS\n * undefined, so nothing would be scrubbed). One authority, because a second copy of either check\n * would drift from the writer that actually runs them.\n *\n * What this arm adds is WHERE the failure surfaces. Called here, the refusal is a CONFIGURATION\n * error naming the RESOURCE. Left to fall through, the same resolver still runs — via\n * `buildImpersonalizeScrubPatch` further down this function — but throws a bare Error naming only\n * the field, which boot does not classify as a configuration fault.\n */\n try {\n resolveImpersonalizeResetValue(fieldSchema as z.ZodTypeAny, fieldName);\n } catch (error) {\n throw createConfigurationError(\n `[${resourceIdentifier}] ${describeCaughtError(error)}`\n );\n }\n }\n }\n\n // Count what the WRITER would actually scrub, not what was merely declared. `KEEP` treatments and\n // treatments on never-scrub floor fields are both skipped by `buildImpersonalizeScrubPatch`, so\n // counting declarations would let a resource satisfy this guard with a patch that is EMPTY — rows\n // flipping to RETAINED with every field intact, which is precisely the compliance lie the guard\n // exists to prevent. Deriving the count from the writer keeps ONE authority for \"what gets scrubbed\".\n // FAIL LOUD on a NESTED treatment. Both the guard above and the writer walk TOP-LEVEL keys only\n // (`getMergedObjectOrUnionShape` merges union options; it does not descend into nested objects, and\n // `getMetadataRecursive` traverses wrappers but never a ZodObject's shape). So a\n // `.impersonalizeWith()` declared on a nested field — `billingContact.email`, or a nested\n // `z_file()` — is SILENTLY IGNORED: the row flips to RETAINED while that field, and any file linked\n // under its dotted path, survive intact. That is the compliance lie this whole block exists to\n // prevent, reached through a door the top-level walk cannot see. Recursive scrubbing is deliberately\n // out of v1 scope, so an unscrubable nested treatment must be a BOOT ERROR rather than a silent skip.\n assertNoNestedImpersonalizeTreatment(effectiveMainSchema, resourceIdentifier);\n\n // The two modes assert OPPOSITE things about this resource's fields, so each fails loud on the\n // other's shape. Neither is a warning: a mismatch here means the config claims something about\n // personal data that the runtime would not honour.\n const effectiveScrubPatch = buildImpersonalizeScrubPatch(effectiveMainSchema);\n if (retentionPolicy.mode === ErasureRetentionMode.RETAIN_ONLY) {\n // RETAIN_ONLY asserts \"this resource holds no personal data of its own\". A treatment contradicts\n // that claim — and would be silently ignored at erasure time, since RETAIN_ONLY writes only the\n // markers. Fail rather than let the declaration and the behaviour disagree.\n if (Object.keys(effectiveScrubPatch).length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy.mode = RETAIN_ONLY asserts this resource holds no personal data of ` +\n `its own, but field(s) [${Object.keys(effectiveScrubPatch).join(', ')}] declare an impersonalize treatment. ` +\n `Those treatments would never run. Use mode = RETAIN_AND_IMPERSONALIZE to actually scrub them, or remove them.`\n );\n }\n /*\n * The SECOND direction, and until 2026-08-31 it did not exist.\n *\n * The check above sees a field with a TREATMENT. This one sees a field DECLARED as personal data\n * and given no treatment — which is the shape a wrong `RETAIN_ONLY` actually takes. Without it,\n * the cheap mode was also the one that failed silently: a resource whose fields carry\n * `.dataCategories()` could assert it holds no personal data, pass every gate, and put that\n * assertion into a governed document. `RETAIN_AND_IMPERSONALIZE` never had the hole — it is\n * refused when nothing would be scrubbed.\n *\n * This catches a CONTRADICTION, not an omission. A resource that classified nothing still passes,\n * because \"nobody declared a category\" and \"there is no personal data\" are indistinguishable\n * here; that is the category inventory's question. A clean result is not a proof.\n */\n const declaredPersonalDataFields = collectDeclaredPersonalDataFields(effectiveMainSchema);\n if (declaredPersonalDataFields.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy.mode = RETAIN_ONLY asserts this resource holds no personal data of ` +\n `its own, but field(s) [${declaredPersonalDataFields.join(', ')}] declare .dataCategories(). The resource ` +\n `cannot both hold personal data and hold none. Use mode = RETAIN_AND_IMPERSONALIZE and give those fields an ` +\n `impersonalize treatment, or — if the category is wrong — correct the field. Scope foreign keys and ` +\n `createdByUserId are excluded here: they link a row to a person without being personal data the row holds.`\n );\n }\n } else if (Object.keys(effectiveScrubPatch).length === 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy.mode = RETAIN_AND_IMPERSONALIZE but NO field would actually be ` +\n `scrubbed (KEEP treatments and treatments on never-scrub floor fields such as scope FKs / createdByUserId ` +\n `do not count). Erasure would flip rows to RETAINED with every personal field intact — a record ` +\n `that looks scrubbed but is not. Mark at least one non-floor personal field REMOVE or MASK, or — if this ` +\n `resource genuinely holds no personal data of its own — declare mode = RETAIN_ONLY instead.`\n );\n }\n\n // Inject the per-record retention marker. Server-managed (excluded from client\n // create/update, hidden), DB-indexed for the hidden-by-default filter predicate\n // + the future disposal clock. Defaults to ACTIVE; only the impersonalize writer\n // flips it to RETAINED via updateManyAsSystem (which re-attaches verb-excluded\n // fields after the strict parse — see deriveTrustedSystemWritePreservedFields).\n effectiveMainSchema = (effectiveMainSchema as any).extend({\n retentionStatus: RetentionStatusSchema\n /*\n * A framework VOCABULARY, declared as one. `RetentionStatus` is injected onto every resource\n * that declares a `retentionPolicy`, so without this its members would take their words from\n * each field PATH in turn — the same enum described afresh per resource, by an LLM that\n * reaches a different phrasing each time. `.systemEnum()` routes them to\n * `system_enums.RetentionStatus.*`, authored once and read everywhere.\n *\n * It changes nothing visible today, deliberately: the field is `.isHidden()` in both modes,\n * so the planner now asks for no words for it at all (#1298). The declaration is here so\n * that the day a surface shows a retention state — a retained-row badge, an erasure report —\n * it inherits ONE vocabulary rather than starting the per-path drift that #1298 measured on\n * its sibling `impersonalizedAt`, which had collected eleven English labels unseen.\n */\n .systemEnum('RetentionStatus')\n .default(RetentionStatus.ACTIVE)\n .isDBIndexed()\n .excludeFromCreate()\n .excludeFromUpdate()\n .isHidden(),\n impersonalizedAt: z.date()\n .optional()\n .isDBIndexed()\n .excludeFromCreate()\n .excludeFromUpdate()\n .isHidden(),\n }) as TMainSchema;\n\n // Derive the impersonalization system-access grants (parallel to the\n // isAnonymizable updateMany derive above): `updateMany` for the in-place scrub,\n // `seeRetained` for the audited see-through read of retained rows. FAIL-LOUD, not\n // silent-override: if the author EXPLICITLY declared either verb FORBIDDEN, that\n // contradicts retentionPolicy (the resource asks to be retained-and-scrubbed yet\n // forbids the only primitive that performs / audits it). We read the RAW authored\n // policy (`params.systemAccessPolicy`) — an unauthored policy defaults to\n // all-verbs-FORBIDDEN, and deriving THAT to ALLOWED is the intended common case.\n if (params.systemAccessPolicy?.updateMany === ResourceSystemAccessMode.FORBIDDEN) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires systemAccessPolicy.updateMany = ALLOWED ` +\n `(the impersonalize writer scrubs in place via updateManyAsSystem), but this resource explicitly ` +\n `authored updateMany: FORBIDDEN. Remove it (the grant is derived automatically) or drop retentionPolicy.`\n );\n }\n if (params.systemAccessPolicy?.seeRetained === ResourceSystemAccessMode.FORBIDDEN) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires systemAccessPolicy.seeRetained = ALLOWED ` +\n `(the audited see-through read of retained rows), but this resource explicitly authored ` +\n `seeRetained: FORBIDDEN. Remove it (the grant is derived automatically) or drop retentionPolicy.`\n );\n }\n effectiveSystemAccessPolicy = {\n ...effectiveSystemAccessPolicy,\n updateMany: ResourceSystemAccessMode.ALLOWED,\n seeRetained: ResourceSystemAccessMode.ALLOWED,\n };\n }\n\n // ========================================\n // retentionBinding VALIDATION & ENRICHMENT (#1613 — how long a row is kept)\n // ========================================\n //\n // A separate axis from `retentionPolicy` above: that one is what an ERASURE does to a row, this one\n // is how long the row lives. Every refusal here is about the binding being UNENFORCEABLE as written —\n // a clock that reads a field the row does not have, or two retention authorities on one row — and\n // each names the exact fix, because the alternative is a period the application publishes and the\n // sweep silently cannot honour.\n //\n // assurance-control: WILDO.PRIVACY.STORAGE_LIMITATION — a declared retention class is refused at\n // configuration build unless the sweep can actually compute when each row expires.\n // A tenant's rows never expire by `.ttl()` (#1634). MongoDB deletes a TTL row itself, with no application code\n // running, so no legal hold, cascade or file release could ever reach it — and a hold on an organization claims\n // to suspend EVERY deletion of that organization's data. `.ttl()` is for application-scoped framework plumbing\n // (job executions, job payloads); a tenant resource binds a retention class, whose sweep asks the hold.\n if (resourcePrimaryScope === ResourcePrimaryScope.ORGANIZATIONS) {\n const tenantTtlFields = collectRowTtlPolicies(effectiveMainSchema).map((policy) => policy.fieldName);\n if (tenantTtlFields.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] is scoped to an organization and declares .ttl() on [${tenantTtlFields.join(', ')}]. ` +\n `A tenant's rows are never expired by the database's own TTL, which no legal hold can suspend: bind a ` +\n `retentionBinding instead (its sweep deletes through the service layer and skips held rows).`\n );\n }\n }\n\n let retentionBinding: ResourceRetentionBinding | undefined;\n if (authoredRetentionBinding !== undefined) {\n const parsedBinding = ResourceRetentionBindingSchema.safeParse(authoredRetentionBinding);\n if (!parsedBinding.success) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding is invalid: ${parsedBinding.error.issues.map((issue) => `${issue.path.join('.') || '(root)'}: ${issue.message}`).join('; ')}.`\n );\n }\n retentionBinding = parsedBinding.data;\n if (!isZodObject(effectiveMainSchema)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding requires a ZodObject mainSchema: the retention clock is a field of the row.`\n );\n }\n const bindingShape = getZodObjectShape(effectiveMainSchema) as Record<string, z.ZodTypeAny>;\n\n // One row, one retention authority. `.ttl()` expires the row by a fixed number of seconds, and on\n // MongoDB natively with no application code running — so no cascade, file release or hold could\n // ever run for it. Two authorities on one row also means two answers to \"when does this go\".\n const ttlFields = collectRowTtlPolicies(effectiveMainSchema).map((policy) => policy.fieldName);\n if (ttlFields.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] declares BOTH retentionBinding (${retentionBinding.retentionClass}) and .ttl() on ` +\n `[${ttlFields.join(', ')}]. One row takes one retention authority: remove the .ttl() and let the class ` +\n `period apply (the retention sweep deletes through the service layer, so cascades, files and RAG chunks ` +\n `go with the row), or drop retentionBinding if this is framework plumbing that holds no business data.`\n );\n }\n\n const namesClosureField = retentionBinding.closureFieldName !== undefined;\n const isClosureEvent = retentionBinding.startPoint === RetentionStartPoint.CLOSURE_EVENT;\n if (isClosureEvent !== namesClosureField) {\n throw createConfigurationError(\n isClosureEvent\n ? `[${resourceIdentifier}] retentionBinding.startPoint CLOSURE_EVENT requires closureFieldName: the date field ` +\n `whose value is the closure instant. While it is null the row never expires.`\n : `[${resourceIdentifier}] retentionBinding.closureFieldName is only meaningful with startPoint CLOSURE_EVENT ` +\n `(got ${retentionBinding.startPoint}). Remove it, or use CLOSURE_EVENT.`\n );\n }\n\n if (retentionBinding.startPoint === RetentionStartPoint.SCOPE_DELETED) {\n // The clock is the ORGANIZATION's deletion, so the row must name an organization.\n if (!bindingShape.organizationId) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding.startPoint SCOPE_DELETED counts from the row's organization being ` +\n `marked for deletion, but this resource has no organizationId field. Use CREATED, LAST_UPDATED or CLOSURE_EVENT.`\n );\n }\n if (bindingShape[RETENTION_STARTED_AT_FIELD_NAME]) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding SCOPE_DELETED injects a reserved '${RETENTION_STARTED_AT_FIELD_NAME}' ` +\n `field, but this resource already declares one. Rename that field (the retention clock is factory-injected).`\n );\n }\n // The ONE stored retention instant. Nothing on the row records when its organization was marked,\n // and the organization row itself is destroyed by the purge, so the purge stamps it here first.\n // Server-owned in every direction: no caller can author it on create or update, it never leaves the\n // backend, and it is indexed because the sweep queries it on every run.\n effectiveMainSchema = (effectiveMainSchema as any).extend({\n [RETENTION_STARTED_AT_FIELD_NAME]: z.date()\n .optional()\n .isDBIndexed()\n .excludeFromCreate()\n .excludeFromUpdate()\n .isBackendOnly()\n .isHidden(),\n }) as TMainSchema;\n } else {\n // Every other start point READS an instant the row already carries, so that field must exist,\n // be a date, and — for the closure field the author chose — be indexed (the sweep queries it on\n // every run). `createdAt`/`updatedAt` are indexed by convention and maintained by both adapters.\n const startFieldName = resolveRetentionStartFieldName(retentionBinding);\n const startFieldSchema = bindingShape[startFieldName];\n if (!startFieldSchema || getZodType(unwrapSchema(startFieldSchema)) !== 'date') {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding.startPoint ${retentionBinding.startPoint} reads the row's ` +\n `'${startFieldName}', which must be a date field of this resource${startFieldSchema ? ' (it is not a date)' : ' (it does not exist)'}.` +\n (isClosureEvent ? ' Name a z.date() field that is set when the record closes.' : ` Declare ${startFieldName}: z.date() on the schema.`)\n );\n }\n if (isClosureEvent && !isDBIndexed(startFieldSchema)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding closure field '${startFieldName}' must be .isDBIndexed(): the ` +\n `retention sweep selects expired rows by it on every run, and an unindexed scan grows with the table.`\n );\n }\n }\n }\n\n // ========================================\n // retentionPolicy.statutoryRetention (#1635 — a statute keeps the row through an erasure)\n // ========================================\n //\n // Read AFTER both axes above are resolved, because every rule here is a relation BETWEEN them: the\n // ground lives on the erasure treatment (`retentionPolicy`), and the period it lasts for lives on the\n // binding (`retentionBinding`). Each refusal names the declaration that would make it true.\n //\n // assurance-control: WILDO.PRIVACY.STORAGE_LIMITATION — a row kept through an erasure on a statutory ground\n // must be bound to the period that ground lasts for, and to a start point whose clock a restricted row can reach.\n const statutoryRetention = retentionPolicy?.mode ? retentionPolicy.statutoryRetention : undefined;\n if (retentionBinding?.retentionClass === DataRetentionClass.BUSINESS_RECORDS && !statutoryRetention) {\n // Invariant 1 of #1635. A BUSINESS_RECORDS row is kept because the law says so; without the ground an\n // erasure would treat it as the author's choice (or, with no retentionPolicy at all, reach it through the\n // delete cascade's default) and could not tell the data subject why it was kept or until when.\n throw createConfigurationError(\n `[${resourceIdentifier}] binds retention class BUSINESS_RECORDS, whose period is a statutory minimum, but declares no ` +\n `retentionPolicy.statutoryRetention. Declare retentionPolicy: { mode, statutoryRetention: { ground: ` +\n `StatutoryRetentionGround.LEGAL_OBLIGATION, rationale: '<the statute>' } } (and a dataSubjectPolicy), so a subject ` +\n `erasure RESTRICTS these rows until their period ends instead of deleting records the law requires kept. If no ` +\n `statute applies, bind RESOURCE_DATA instead.`\n );\n }\n if (statutoryRetention) {\n if (!Object.values(StatutoryRetentionGround).includes(statutoryRetention.ground)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy.statutoryRetention.ground '${String(statutoryRetention.ground)}' is not a ` +\n `StatutoryRetentionGround (${Object.values(StatutoryRetentionGround).join(', ')}).`\n );\n }\n if (typeof statutoryRetention.rationale !== 'string' || statutoryRetention.rationale.trim().length === 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy.statutoryRetention.rationale is empty. Name the statute that requires these ` +\n `rows kept — an operator answering a data subject has to be able to say which law, and a ground with no law named ` +\n `is a claim nobody can check.`\n );\n }\n if (retentionBinding?.retentionClass !== DataRetentionClass.BUSINESS_RECORDS) {\n // The PERIOD the ground lasts for is the BUSINESS_RECORDS class period: without that binding there is no end,\n // and a statutory ground with no end is a standing retention nobody decided.\n throw createConfigurationError(\n `[${resourceIdentifier}] declares retentionPolicy.statutoryRetention but ${retentionBinding ? `binds ${retentionBinding.retentionClass}` : 'declares no retentionBinding'}. ` +\n `A statutory ground lasts for the statutory period, which is dataRetention[BUSINESS_RECORDS]: bind ` +\n `retentionBinding: { retentionClass: DataRetentionClass.BUSINESS_RECORDS, startPoint: RetentionStartPoint.END_OF_CALENDAR_YEAR }.`\n );\n }\n if (retentionBinding.startPoint === RetentionStartPoint.CLOSURE_EVENT || retentionBinding.startPoint === RetentionStartPoint.LAST_UPDATED) {\n // Both clocks are ones a RESTRICTED row cannot keep honestly. A restricted row is frozen — every ordinary write is\n // refused — so a CLOSURE_EVENT row that is still open when its subject is erased can never be closed, and would be\n // kept forever. And the restriction is itself a write, which moves `updatedAt`, so a LAST_UPDATED clock would be\n // RESTARTED by the very erasure that reports when it ends. Neither is how a statute counts: HGB §257(5) and\n // AO §147(4) count from the end of the calendar year.\n throw createConfigurationError(\n `[${resourceIdentifier}] declares retentionPolicy.statutoryRetention with retentionBinding.startPoint ` +\n `${retentionBinding.startPoint}, a clock a restricted row cannot keep: ` +\n (retentionBinding.startPoint === RetentionStartPoint.CLOSURE_EVENT\n ? `an erasure freezes the row, so a record still open when its subject is erased could never be closed and would be kept forever. `\n : `the restriction write moves updatedAt, so the erasure would restart the period it reports. `) +\n `Use END_OF_CALENDAR_YEAR (how commercial and tax statutes count), CREATED, or SCOPE_DELETED.`\n );\n }\n }\n\n // ── dataSubjectPolicy: WHO the row is, and whose session an erasure ends ──────────────────────\n //\n // Placed AFTER the retention operation contract on purpose: a config can be wrong in several ways\n // at once, and the contract's errors are the more specific ones (\"declare UPDATE_MANY\", \"rename\n // your reserved field\"). Running this first masked them, so an author fixing a missing operation\n // was told to declare a data-subject policy instead.\n //\n // Paired with `retentionPolicy` in BOTH directions, because a retention-governed resource is\n // exactly one that `eraseSubjectAsSystem` accepts as a subject (the orchestrator refuses a subject\n // with no retention policy), and a `dataSubjectPolicy` on anything else describes an erasure that\n // can never happen.\n //\n // Undeclared is REFUSED rather than defaulted: there is no safe default. Assuming\n // NO_PRINCIPAL would silently drop a real person's session revocation; assuming a linked\n // principal would revoke whoever a user foreign key happens to name — on `TODOS` that is the\n // author, the assignee and the escalation contact, none of whom is the data subject. Refusing is\n // what forces the decision, matching the subject-EXPORT model's treatment of an undeclared resource.\n if (retentionPolicy?.mode && !dataSubjectPolicy) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires a dataSubjectPolicy. A retention-governed ` +\n `resource can be passed to eraseSubjectAsSystem as a data subject, so it must declare WHOSE ` +\n `SESSION an erasure ends: ResourceDataSubjectKind.NO_PRINCIPAL (nobody's — either an ordinary ` +\n `record whose user foreign keys name actors rather than the subject, OR a person with no ` +\n `account such as a CRM contact or a lead), SELF_PRINCIPAL (the row is the person and its own ` +\n `id is the session principal), or LINKED_PRINCIPAL with sessionPrincipalField (the person ` +\n `signs in as a different USERS row). Note this is NOT \"is the row about a person\" — that is ` +\n `answered by retentionPolicy.mode. This is never inferred from a user foreign key — doing so ` +\n `would revoke the sessions of owners and assignees instead of the subject.`\n );\n }\n if (dataSubjectPolicy && !retentionPolicy?.mode) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy requires retentionPolicy. Without one this resource ` +\n `can never be an erasure subject (eraseSubjectAsSystem refuses a subject that is not ` +\n `retention-governed), so the declaration would describe an erasure that cannot happen.`\n );\n }\n if (dataSubjectPolicy) {\n const namesPrincipalField = dataSubjectPolicy.kind === ResourceDataSubjectKind.LINKED_PRINCIPAL;\n if (namesPrincipalField && !dataSubjectPolicy.sessionPrincipalField) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy.kind = LINKED_PRINCIPAL requires ` +\n `sessionPrincipalField — the field naming the USERS row whose session an erasure of this row ` +\n `must end. Without it the erasure has no principal to revoke and the declaration would be inert.`\n );\n }\n if (!namesPrincipalField && dataSubjectPolicy.sessionPrincipalField) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy.sessionPrincipalField is only valid under ` +\n `kind = LINKED_PRINCIPAL (got '${dataSubjectPolicy.kind}'). Under SELF_PRINCIPAL the row's own ` +\n `id IS the principal, and under NO_PRINCIPAL there is no principal at all — so naming a ` +\n `field here is a contradiction, not a redundancy.`\n );\n }\n // The named link must not ALSO be scrubbed. This is a COHERENCE guard, not a prerequisite of the\n // revocation: the principal is resolved BEFORE the scrub (a post-commit read is impossible — the\n // row is RETAINED and hidden by then, and the only see-through door demands a privileged human),\n // so a scrubbed field would still be readable when it matters. It is refused because declaring one\n // field to be BOTH the link to a person and personal data to destroy is a contradiction, and it\n // leaves the retained row unable to say whose session was ended.\n //\n // Derived from the WRITER (`buildImpersonalizeScrubPatch`) rather than from a treatment count —\n // the same discipline the zero-scrub guard uses, because only the writer knows which declarations\n // actually produce a scrub.\n if (namesPrincipalField && mainSchema instanceof z.ZodObject) {\n const principalField = dataSubjectPolicy.sessionPrincipalField as string;\n if (!(principalField in (mainSchema.shape as Record<string, unknown>))) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy.sessionPrincipalField = '${principalField}' is not ` +\n `a top-level field of this resource's mainSchema.`\n );\n }\n if (principalField in buildImpersonalizeScrubPatch(mainSchema)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy.sessionPrincipalField = '${principalField}' is ` +\n `SCRUBBED by the erasure (it carries an .impersonalizeWith() treatment the writer acts on). A ` +\n `field cannot be both the link naming this person's login and personal data to destroy — the ` +\n `retained row would be left unable to say whose session was ended. Remove the treatment from ` +\n `that field (a user id is a link, not personal data of this row) or name a different field.`\n );\n }\n }\n\n // The system LIST grant the principal lookup needs.\n //\n // `eraseSubjectAsSystem` resolves the principal by reading the subject rows through\n // `listAsSystem`, which fail-closes on `systemAccessPolicy.list`. The retention derivation grants\n // only `updateMany` + `seeRetained`, and an unauthored policy is all-verbs-FORBIDDEN — so without\n // this the lookup would throw, be swallowed as best-effort, resolve to NO principals, and the\n // erased person's session would quietly survive. That is the exact failure this whole capability\n // exists to close, so the grant is derived from the declaration that requires it.\n //\n // Reads the RAW authored policy (`params.systemAccessPolicy`) — an unauthored policy defaults to\n // all-verbs-FORBIDDEN, and deriving THAT to ALLOWED is the intended common case.\n //\n // Scoped to LINKED_PRINCIPAL deliberately: SELF_PRINCIPAL needs no read (the subject ids ARE the\n // user ids) and NO_PRINCIPAL reads nothing at all, so neither earns a widened system surface.\n if (namesPrincipalField) {\n if (params.systemAccessPolicy?.list === ResourceSystemAccessMode.FORBIDDEN) {\n throw createConfigurationError(\n `[${resourceIdentifier}] dataSubjectPolicy.kind = LINKED_PRINCIPAL requires ` +\n `systemAccessPolicy.list = ALLOWED (the erasure reads the subject rows to resolve the session ` +\n `principal), but this resource explicitly authored list: FORBIDDEN. Remove it (the grant is ` +\n `derived automatically) or declare a different dataSubjectPolicy.kind.`\n );\n }\n effectiveSystemAccessPolicy = {\n ...effectiveSystemAccessPolicy,\n list: ResourceSystemAccessMode.ALLOWED,\n };\n }\n }\n\n // ========================================\n // DATA-CATEGORY VOCABULARY VALIDATION\n // ========================================\n //\n // `.dataCategories()` stores opaque strings: `zod-decorators` sits BELOW this package and cannot\n // import `PersonalDataCategory`, so its chokepoint can only check that non-empty strings were\n // declared. This is the layer that owns the enum, so this is where membership is checked.\n //\n // UNCONDITIONAL, unlike the impersonalize guards above — those run only inside `retentionPolicy`\n // because a treatment is meaningless without one. A data category is meaningful on any resource:\n // a hard-deleted resource still HOLDS personal data while it exists, and a privacy notice must\n // enumerate it. Gating this on retentionPolicy would silently exempt exactly the resources that\n // opted out of retention.\n //\n // A typo'd category is worse than an undeclared one and that is why this is a BOOT ERROR rather\n // than a warning: `'contact_details'` (underscore) is not a member, so the field would be counted\n // as CATEGORIZED by the gap report — it carries a declaration — while contributing nothing to the\n // notice's category list. The field disappears from the inventory while looking annotated in the\n // schema, which is the failure this whole capability exists to prevent.\n //\n // TOP-LEVEL fields only, deliberately matching `resolveResourcePersonalDataCategories`: a nested\n // declaration is invisible to the reader, so validating it here would certify a value nothing\n // consumes. Unlike a nested `.impersonalizeWith()` — which is a boot error because the row would\n // flip to RETAINED with the field intact — a nested category breaks nothing at runtime; it simply\n // never reaches a notice.\n /*\n * ENGINE-INJECTED ANCHORS on a read-through resource (#1058 R7).\n *\n * ## What is being injected, and why an author cannot declare it\n *\n * A VIRTUAL resource's schema describes the REMOTE entity. Every field in it comes from the\n * target, and there is no local row — which is exactly why such a resource may carry no field of\n * ours, no file and no retrieval corpus. So the two anchors the engine needs have nowhere to be\n * authored:\n *\n * - `organizationId` — the application's OWNER organization, stamped onto every projected row\n * (#1055 §6). The engine's per-row tenant gate reads it; without it, every read answered\n * `row_carries_no_tenant_anchor`;\n * - `organizationUnitId` — the ORGANIZATION UNIT owning the row's remote PARTITION (#1058 §3),\n * and the field `READ_THROUGH_ORGANIZATION_UNIT_FIELD_NAME` names as this resource's derived\n * `unitFieldName`.\n *\n * Both were already WRITTEN by the projector before this. What they lacked was a declared place:\n * the resource's own contract, its specification and its OpenAPI knew nothing of two fields every\n * served row carries. `billable-services.schemas.ts` names that gap as this slice's, and this is\n * it — the declaration, not the stamp.\n *\n * ## Required vs optional, which is a statement about the rows\n *\n * `organizationId` is REQUIRED: a row that reaches a caller always has one, because the repository\n * refuses with `OWNER_ORGANIZATION_ABSENT` before serving anything when there is no owner.\n *\n * `organizationUnitId` is OPTIONAL, and that is not caution. Two kinds of row genuinely have no\n * unit — a SHARED row whose partition field is unset (E2, an Odoo product belonging to no company)\n * and a row of a partition no operator has assigned (E3). Declaring it required would make both\n * states illegal in a contract that serves them.\n *\n * ## Neither can be changed, and only the unit can be NAMED — on a create (#1679)\n *\n * `organizationId` is excluded from CREATE and UPDATE, for the reason the pipeline lane states about\n * its own tenant stamp: a caller who could send it could hand rows to another organization, and one\n * who could update it could move them. The owner is the application's, never a caller's.\n *\n * `organizationUnitId` is excluded from UPDATE for the same reason — a row's partition never moves —\n * and is ADMITTED on CREATE, because on a writable resource it is how a caller says which unit's\n * partition a new row belongs to. It is never sent to the remote system: the repository resolves the\n * unit to its assigned partition key, checks it against the caller's grant, and writes the PARTITION\n * field itself (#1679). A member confined to one unit need not send it at all; an organization-wide\n * caller, or a member of several units, must. On a resource with no CREATE operation the admission is\n * inert, since there is no create DTO for it to appear in.\n */\n if (persistenceAdapter === PersistenceAdapter.HTTP_API) {\n // EXPLICIT object check, for the reason the retention injection above records: `getZodObjectShape`\n // returns `{}` for a union, so a try/catch around it is dead code and the real failure surfaces\n // later as an undiagnosable `extend is not a function`.\n if (!isZodObject(effectiveMainSchema)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] persistenceAdapter 'http-api' injects the '${HTTP_API_ENGINE_INJECTED_FIELDS.join(\"' and '\")}' `\n + 'anchors, which requires a ZodObject mainSchema — polymorphic/union mainSchemas are not supported on a '\n + 'read-through resource.'\n );\n }\n\n const httpApiShape = getZodObjectShape(effectiveMainSchema);\n for (const injectedField of HTTP_API_ENGINE_INJECTED_FIELDS) {\n /*\n * Zod-4 `.extend()` SILENTLY OVERWRITES a duplicate key, so an author's own field would be\n * clobbered rather than reported. Refused for a second reason too: the engine stamps this field\n * on every projected row regardless, so an authored one could never be the value served — it\n * would be a declaration the author can read in their own schema and never observe taking\n * effect.\n */\n if (httpApiShape[injectedField]) {\n throw createConfigurationError(\n `[${resourceIdentifier}] declares '${injectedField}', which the engine INJECTS on every http-api resource and `\n + 'STAMPS on every projected row. An authored field of that name is never the value served — remove it.'\n );\n }\n\n /*\n * And nothing in the BINDING may target them either.\n *\n * The projector applies both stamps LAST, so a mapping onto one is inert rather than dangerous\n * — which is precisely why it must be refused here. An authoring mistake that silently does\n * nothing is worse than one that fails: the author reads a declaration that looks like it\n * decides the tenant, and no run ever disagrees with them.\n *\n * This refusal is what the projector's own comment has claimed since #1055. It did not exist —\n * measured 2026-09-18 across `saas-models`, `saas-backend-lib` and `saas-specifications`, where\n * the only mapping-target refusals were the external-data PIPELINE's. It matters more now than\n * it did then: before this block the fields were undeclared, so an author had no reason to\n * think of them; declaring them is what makes mapping onto one a thing somebody would try.\n */\n if (resolvedHttpApiBinding?.fieldMappings.some((mapping) => mapping.localField === injectedField)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] httpApiBinding maps a remote field onto '${injectedField}', which the engine stamps `\n + 'after every mapping. The mapping can never take effect — remove it.'\n );\n }\n if (resolvedHttpApiBinding?.keyFields.some((keyField) => keyField.localField === injectedField)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] httpApiBinding declares a key component landing on '${injectedField}', which the engine `\n + 'stamps after every key component. Name a different localField.'\n );\n }\n }\n\n effectiveMainSchema = (effectiveMainSchema as any).extend({\n /*\n * `.isDBIndexed().isForeignKey()` on the tenant anchor, and the reason is a MEASUREMENT rather\n * than a convention.\n *\n * The SQL planner plans a table for an http-api resource today, and before this injection it\n * derived the tenant column — WITH its index — from the primary-scope relationship. A bare\n * `z.string()` here takes precedence over that derivation, so the first `wildo db diff` after\n * the injection reported `DROP_INDEX organizationId` on Wonder Todos: a declared field\n * silently replacing a derived one, and dropping its index on the way past.\n *\n * These decorators restore the plan the relationship produced. They are also what\n * `resource-schema-awareness.md` requires of every `organizationId` in an application's own\n * schema, so the injected field now matches what an author would have had to write.\n */\n [HTTP_API_TENANT_ANCHOR_FIELD]: z.string()\n .isDBIndexed()\n .isForeignKey()\n .excludeFromCreate()\n .excludeFromUpdate(),\n /*\n * NOT indexed, deliberately. A read-through resource has no local row, so nothing ever queries\n * this table by unit — the confinement is a predicate pushed to the REMOTE, in the remote's own\n * partition key. An index here would cost a migration on every PostgreSQL-backed surface to\n * serve a query that cannot be issued.\n */\n [READ_THROUGH_ORGANIZATION_UNIT_FIELD_NAME]: z.string()\n .optional()\n .excludeFromUpdate()\n // Described here because no application authors this field (#1625): every read-through resource gets it.\n .describe('The organization unit that owns the part of the external system this record lives in. Absent for a record every unit shares, or one in a part no unit has been assigned. On a create it names the unit the new record goes to; it never changes afterwards.'),\n }) as TMainSchema;\n }\n\n if (isZodObject(effectiveMainSchema)) {\n for (const [fieldName, fieldSchema] of Object.entries(getZodObjectShape(effectiveMainSchema))) {\n const declared = getDataCategories(fieldSchema as z.ZodTypeAny);\n if (declared === undefined) continue;\n const unknownCategories = unknownPersonalDataCategories(declared);\n if (unknownCategories.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] field '${fieldName}' declares data categor${unknownCategories.length === 1 ? 'y' : 'ies'} ` +\n `[${unknownCategories.join(', ')}] that ${unknownCategories.length === 1 ? 'is' : 'are'} not a PersonalDataCategory member. ` +\n `A value outside the vocabulary counts the field as CATEGORIZED — so it is excluded from the ` +\n `uncategorized-field gap report — while contributing nothing to the privacy notice's category list. ` +\n `Use a PersonalDataCategory member, or drop the declaration if the field holds no personal data.`\n );\n }\n }\n }\n\n // ========================================\n // TRANSFORM RESOURCE RELATIONSHIPS\n // ========================================\n\n const { processedResourceRelationships, availableParentResourceTypes } = transformResourceRelationships(effectiveResourceRelationships, resourceIdentifier);\n\n // ========================================\n // DERIVE SUMMARY SCHEMA FROM isSummaryField DECORATORS\n // ========================================\n\n // Auto-derive summary schema for LIST/SEARCH operations from isSummaryField decorators\n // This replaces manual responseSummaryDto definitions\n // Must be computed BEFORE operations loop so LIST operations can use it\n const derivedSummarySchema = inheritenceSchemaDefinition\n ? ResourcesSummaryUtils.deriveSummarySchemaForDiscriminatedUnion(\n effectiveMainSchema as unknown as z.ZodObject<z.ZodRawShape>,\n inheritenceSchemaDefinition as unknown as ResourceConfiguration_InheritanceSchemaDefinition<any, z.ZodObject<z.ZodRawShape>>\n )\n : ResourcesSummaryUtils.deriveSummarySchema(effectiveMainSchema);\n\n // ========================================\n // FLATTEN OPERATIONS AND SEARCHABLE CONFIGURATIONS\n // ========================================\n\n const operations: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>[] = [];\n\n // Extract autoVariants config (default all true)\n const autoVariants = params.autoVariants || {};\n const autoVariantsRead = autoVariants.read || {};\n const autoVariantsList = autoVariants.list || {};\n const enableReadSummary = autoVariantsRead.enableSummary !== false; // default true\n const enableReadContext = autoVariantsRead.enableContext !== false; // default true\n const enableListSummary = autoVariantsList.enableSummary !== false; // default true\n const enableListContext = autoVariantsList.enableContext !== false; // default true\n\n // Process operation configurations\n for (const [operation, config] of Object.entries(operationsConfiguration) as [ValidOperationKeys<TCustomOperationEnum, TCoreOperationEnum>, ResourceConfiguration_Operation_BuilderParameters<TMainSchema>][]) {\n assertOperationPathKeySegment(String(operation), 'operation identifier', String(operation));\n\n // Validate isDefault logic by grouping variants by their variantType\n const variantsByType = new Map<ResourceOperationVariantType, ResourceConfiguration_OperationVariant_BuilderParameters<TMainSchema>[]>();\n\n // Group variants by their type\n config.variants.forEach(variant => {\n if (!variantsByType.has(variant.variantType)) {\n variantsByType.set(variant.variantType, []);\n }\n variantsByType.get(variant.variantType)!.push(variant);\n });\n\n // Validate each variant type group. URL-bearing variants form a shared\n // operation identity space (`API_CALL` and `API_CALL_WITH_CALLBACK` are\n // both selected by operation/default/key at many call sites), so their\n // default/key invariants are validated as one combined group below.\n for (const [variantType, variantsGroup] of variantsByType.entries()) {\n if (!isUrlisableOperationVariantType(variantType) && variantsGroup.length > 1) {\n const explicitDefaults = variantsGroup.filter((variant) =>\n variant.isDefault === true\n );\n if (explicitDefaults.length === 0) {\n throw createConfigurationError(`Operation '${operation}' with multiple ${variantType} variants must have at least one with isDefault=true`);\n }\n if (explicitDefaults.length > 1) {\n throw createConfigurationError(`Operation '${operation}' with multiple ${variantType} variants cannot declare more than one with isDefault=true`);\n }\n }\n\n if (isUrlisableOperationVariantType(variantType)) {\n for (const variant of variantsGroup) {\n // 🔒 Fail-closed guard: a URL-bearing variant with an EMPTY roles array\n // is not \"skip the role check\" — it is a guaranteed 403. The runtime gate\n // (`AuthorizationsBackendService.validateOperationRoles`) evaluates\n // `roles.some(...)`, and `[].some()` is always false, so EVERY caller is\n // denied. There is no legitimate empty-roles URL operation: public ops use\n // `APP_PUBLIC`, anonymous ops use `APP_ANONYMOUS`, user-self ops use\n // `APP_USER` (row ownership is enforced separately by the scope authorizer).\n // Catch the mistake at config-build time instead of shipping a dead endpoint.\n // (INTERNAL_CALL / REPOSITORY_ONLY variants are exempt — not URL-bearing, so\n // this loop never sees them; their empty roles are inert.)\n if (!variant.roles || variant.roles.length === 0) {\n throw createConfigurationError(\n `Operation '${operation}' has a URL-bearing (${variantType}) variant with an empty roles array. ` +\n `An empty roles array is fail-CLOSED: the authorization gate evaluates roles.some(...), which is ` +\n `always false for [], so every caller is denied (403). Specify at least one role — e.g. ` +\n `CORE_APP_ROLES.APP_USER (user-self / any authenticated user), CORE_APP_ROLES.APP_PUBLIC (public), ` +\n `CORE_APP_ROLES.APP_ANONYMOUS (anonymous), or the appropriate ORG/APP role.`,\n );\n }\n if (variant.variantKey) {\n assertOperationPathKeySegment(variant.variantKey, 'variantKey', String(operation));\n }\n if (variant.variantKey && RESERVED_OPERATION_VARIANT_KEYS.has(variant.variantKey.toLowerCase())) {\n throw createConfigurationError(\n `Operation '${operation}' cannot use reserved variantKey '${variant.variantKey}'`,\n );\n }\n if (variant.variantKey && AUTO_OPERATION_VARIANT_KEYS.has(variant.variantKey.toLowerCase() as typeof OPERATION_VARIANT_KEY.SUMMARY | typeof OPERATION_VARIANT_KEY.CONTEXT)\n && variant.variantKey !== variant.variantKey.toLowerCase()\n ) {\n throw createConfigurationError(\n `Operation '${operation}' must use canonical lowercase variantKey '${variant.variantKey.toLowerCase()}' for generated variant semantics`,\n );\n }\n if (variant.variantKey && AUTO_OPERATION_VARIANT_KEYS.has(variant.variantKey.toLowerCase() as typeof OPERATION_VARIANT_KEY.SUMMARY | typeof OPERATION_VARIANT_KEY.CONTEXT)\n && !isDataModeVariantKeyAllowedForOperation(String(operation), variant)\n ) {\n throw createConfigurationError(\n `Operation '${operation}' cannot use data-mode variantKey '${variant.variantKey}' unless it is READ, LIST, or SEARCH-like`,\n );\n }\n }\n }\n }\n\n const urlisableVariants = config.variants.filter((variant) => isUrlisableOperationVariantType(variant.variantType));\n const explicitUrlisableDefaults = urlisableVariants.filter((variant) => variant.isDefault === true);\n if (urlisableVariants.length > 1) {\n if (explicitUrlisableDefaults.length === 0) {\n throw createConfigurationError(\n `Operation '${operation}' with multiple URL-bearing variants must have exactly one with isDefault=true`,\n );\n }\n if (explicitUrlisableDefaults.length > 1) {\n throw createConfigurationError(\n `Operation '${operation}' cannot declare more than one default URL-bearing variant across API_CALL and API_CALL_WITH_CALLBACK`,\n );\n }\n }\n // A single URL-bearing variant is the URL default UNLESS the author explicitly set\n // `isDefault: false` — mirrors `determineOperationVariantDefault` Rule 1 so the stored\n // `isOperationDefault` flag and this validation set never disagree. When the opt-out is\n // honored, the sole `isDefault: false` URL variant is treated as non-default here, which\n // correctly routes it through the \"non-default URL-bearing variant must declare a\n // variantKey\" check below — a sole opted-out URL variant with no variantKey would\n // otherwise be unresolvable by BOTH the default and the keyed path resolver.\n const urlisableDefaultVariants = urlisableVariants.length === 1\n ? urlisableVariants.filter((variant) => variant.isDefault !== false)\n : explicitUrlisableDefaults;\n\n const urlisableVariantKeys = new Set<string>();\n for (const variant of urlisableVariants) {\n const willBeDefault = urlisableDefaultVariants.includes(variant);\n\n if (variant.variantKey) {\n const normalizedVariantKey = variant.variantKey.toLowerCase();\n if (urlisableVariantKeys.has(normalizedVariantKey)) {\n throw createConfigurationError(\n `Operation '${operation}' cannot reuse variantKey '${variant.variantKey}' across URL-bearing variants`,\n );\n }\n urlisableVariantKeys.add(normalizedVariantKey);\n }\n\n if (willBeDefault) {\n continue;\n }\n\n if (!variant.variantKey) {\n throw createConfigurationError(\n `Operation '${operation}' cannot declare a non-default URL-bearing variant without a variantKey`,\n );\n }\n\n }\n\n // Process parent resource access scope strategy overrides for this operation\n const operationResourceRelationships = processParentResourceAccessScopeStrategyOverrides(\n processedResourceRelationships,\n availableParentResourceTypes,\n config.parentResourceAccessScopeStrategyOverrides || [],\n operation as string\n );\n\n // Process user notifications using helper function\n const userNotifications = processUserNotifications(\n config.userNotifications || [],\n resourceIdentifier,\n operation,\n resourcePrimaryScope\n );\n\n // Process m2mNotifications using helper function\n const m2mNotifications = processM2MNotifications(\n config.m2mNotifications || [],\n resourceIdentifier,\n operation\n );\n\n // Parse once so partial authored policies keep defaults and every variant shares the same policy.\n const queueConfig = ResourceConfiguration_QueueConfigSchema.parse(config.queueConfig);\n\n // Process each variant to create flattened operations\n config.variants.forEach((variantParams, variantIndex) => {\n // Note: Cascading delete is now handled via childOperations.lifecycle.onParentDelete on relationships\n // No longer processed at operation variant level\n\n // Determine if this variant is the operation default. URL-bearing\n // variants share one default/key identity space across API and callback\n // transports; non-URL transports keep variant-type-local defaults.\n const variantsOfSameType = variantsByType.get(variantParams.variantType) || [];\n const isOperationDefault = isUrlisableOperationVariantType(variantParams.variantType)\n ? determineOperationVariantDefault(urlisableVariants, variantParams)\n : determineOperationVariantDefault(variantsOfSameType, variantParams);\n\n // Determine effective operation for DTO derivation\n // For custom operations, use resourceOperationLike if it maps to CREATE or UPDATE\n const isCustomOperation = !coreOperations.includes(operation as any);\n const effectiveOperationForDto = isCustomOperation\n ? (variantParams.resourceOperationLike || operation)\n : operation;\n\n // ── Dev-time guardrail: custom op borrowing a NON-object envelope verb ──\n // A custom operation that borrows DELETE / DELETE_MANY / COUNT via\n // `resourceOperationLike` inherits that verb's DEFAULT response envelope\n // (`{ id }` / `{ deletedIds, deletedCount }` / `{ count }`) as\n // its responseDto AND internalDto. That envelope is almost never what a\n // custom op actually returns, so at runtime the service output fails\n // `transformOutput`'s `internalDto.parse` → HTTP 500\n // (`service_resource_transformation_failed`). Warn — do NOT throw: a custom\n // op that legitimately returns a bare id / `{ count }` is valid, so this is\n // a misconfiguration signal, not an invariant. Surfacing it at registry\n // build beats discovering it on first invocation.\n //\n // Scope note: this deliberately does NOT cover UPDATE / CREATE / READ\n // borrowing. Those verbs' default response IS the resource object, which is\n // correct for the many custom mutation ops that return the mutated entity —\n // a static check cannot tell those from the (rarer) ones that return a\n // non-resource shape (e.g. `{ url }`, `{ message }`). Those are guarded by\n // an authored `customResponseDto` + the built-operation DTO tests instead.\n if (isCustomOperation && !(variantParams as { customResponseDto?: unknown }).customResponseDto\n && (\n variantParams.resourceOperationLike === CoreResourceOperation.DELETE\n || variantParams.resourceOperationLike === CoreResourceOperation.DELETE_MANY\n || variantParams.resourceOperationLike === CoreResourceOperation.COUNT\n )\n ) {\n console.warn(\n `[wildo:resource-config] Custom operation \"${String(resourceIdentifier)}.${String(operation)}\" `\n + `borrows ${String(variantParams.resourceOperationLike)} via resourceOperationLike but declares no `\n + `customResponseDto. It will inherit that verb's default response envelope, which almost never `\n + `matches a custom operation's output and will fail output validation (HTTP 500) at invocation. `\n + `Declare a customResponseDto matching the operation's true return shape.`,\n );\n }\n\n // Auto-derive requestDto from decorators if not explicitly provided\n const derivedRequestDto = deriveRequestDto(\n effectiveOperationForDto as string,\n effectiveMainSchema,\n variantParams.requestDto\n );\n\n // Auto-derive responseDto based on operation type\n // - LIST: use derivedSummarySchema (only isSummaryField fields)\n // - READ/CREATE/UPDATE: use effectiveMainSchema (full object)\n // - DELETE: returns just the deleted ID (handled elsewhere)\n // - customResponseDto overrides if provided\n const deriveResponseDto = (): z.ZodTypeAny => {\n if ((variantParams as any).customResponseDto) {\n return (variantParams as any).customResponseDto;\n }\n if (operation === CoreResourceOperation.LIST\n || (variantParams as any).resourceOperationLike === CoreResourceOperation.LIST) {\n return derivedSummarySchema;\n }\n if (operation === CoreResourceOperation.SEARCH\n || (variantParams as any).resourceOperationLike === CoreResourceOperation.SEARCH) {\n return derivedSummarySchema;\n }\n return effectiveMainSchema;\n };\n\n // Derive the responseDto for this operation (temporary, will be replaced by buildAllOperationDtos)\n const operationResponseDto = deriveResponseDto();\n\n // Create base operation fields shared by all operation types\n // Note: DTOs (requestDto, responseDto, summaryDto, contextDto, internalDto, repositoryDto)\n // will be pre-computed by buildAllOperationDtos() after all operations are created.\n // We set temporary DTOs here for type compatibility, but they will be replaced.\n const baseOperationFields = {\n isDisabled: params.isDisabled ?? false,\n mainSchema: effectiveMainSchema,\n resourcePrimaryScope,\n resourceIdentifier,\n resourceFieldIdentifier,\n resourceRelationships: operationResourceRelationships,\n isSystemResource,\n operationIdentifier: operation,\n isOperationDefault,\n serviceRuntimeMode: config.serviceRuntimeMode || ResourceOperation_ServiceRuntimeMode.INLINE,\n queueConfig,\n requestDto: derivedRequestDto, // Temporary - will be replaced by buildAllOperationDtos\n responseDto: operationResponseDto, // Temporary - will be replaced by buildAllOperationDtos\n // When the variant supplied an explicit `requestDto`, it is an author-owned\n // contract the DTO builder must preserve verbatim. Otherwise `derivedRequestDto`\n // is an auto-derived TEMPORARY placeholder built from the base object (before\n // inheritance is known), so the builder must rebuild it — as a per-variant union\n // for inheritance resources. See `hasCustomRequestDto` in the operation schema.\n hasCustomRequestDto: !!(variantParams as any).requestDto,\n hasCustomResponseDto: !!(variantParams as any).customResponseDto,\n notificationBadgeOperations: config.notificationBadgeOperations || [],\n userNotifications,\n m2mNotifications,\n // Carried verbatim rather than normalized: it is one authored object with no derived\n // parts, unlike the notification families above, which the factory stamps with scope and\n // identifier. `undefined` means the operation consumes no metered product.\n recordsUsage: config.recordsUsage,\n // Same reasoning: one authored object, carried as-is. `undefined` means this operation\n // declares no purpose of its own beyond whatever `serviceConsentRequirement` already\n // requires application-wide (#1258 Step 3).\n consentGate: config.consentGate,\n // Fields from ResourceConfiguration_OperationVariant_Base\n variantType: variantParams.variantType,\n resourceOperationLike: variantParams.resourceOperationLike,\n generatedOperation: variantParams.generatedOperation,\n // Forwarded here rather than inside the collection-view enrichment below, which is an\n // explicit ALLOW-LIST reached only by LIST/SEARCH-shaped variants. Copying it there would\n // make a `collectionExport` declared on the wrong verb vanish silently; copying it here\n // lets it reach `createGeneratedCollectionExportOperations`, which refuses it by name.\n collectionExport: (variantParams as any).collectionExport,\n requiredFeatures: normalizeRequiredFeatures(variantParams.requiredFeatures),\n riskLevel: variantParams.riskLevel || ResourceOperationRiskLevel.LOW,\n // Undeclared stays undefined on purpose: `resolveOperationReversibility` derives the\n // answer from `resourceOperationLike` when the field is absent, so defaulting it here\n // would freeze the derivation at config time and make a DELETE added later look reversible.\n reversibility: variantParams.reversibility,\n // Forwarded for the same reason as the flags below: the frontend resources client reads it\n // off the RUNTIME operation, so dropping it here would leave a declared long-run timeout\n // silently unapplied and the 30s default cutting the request (issue #237).\n clientRequestTimeoutMs: variantParams.clientRequestTimeoutMs,\n roles: variantParams.roles,\n // Forwarded, not defaulted: the startup guard and the request-time refusal both read it\n // off the RUNTIME operation. This block re-lists variant fields rather than spreading\n // them, so a new variant field that is not added here is silently dropped between\n // authoring and runtime.\n unimplementedAcknowledgement: variantParams.unimplementedAcknowledgement,\n // Forwarded for the same reason: `enforceStepUpAuth` reads it off the RUNTIME operation, so\n // an unforwarded flag would leave the authored requirement silently unenforced — the exact\n // failure mode the flag exists to prevent.\n requiresStepUpAuthentication: variantParams.requiresStepUpAuthentication,\n // Forwarded for the same reason: the controller, the service tier and the frontend client all read it off the\n // RUNTIME operation, so an unforwarded declaration would refuse every keyed request as undeclared. On a\n // read-through WRITE it is DERIVED as REQUIRED (#1679): a remote write cannot be rolled back, so every retry\n // must replay the first outcome — see `resolveHttpApiWriteIdempotencyKeyRequirement`.\n idempotencyKey: resolveHttpApiWriteIdempotencyKeyRequirement(\n variantParams.idempotencyKey,\n persistenceAdapter === PersistenceAdapter.HTTP_API\n && resolveHttpApiWriteVerb(isCustomOperation ? (variantParams.resourceOperationLike ?? operation) : operation) !== undefined,\n ),\n // Forwarded for the same reason (#1985): `doOperation` asks the challenge off the RUNTIME operation, and the OpenAPI\n // projector documents the header from it. An unforwarded declaration would leave a public form unprotected while\n // its configuration says otherwise. A bulk twin inherits it with the rest of these fields.\n submissionChallenge: variantParams.submissionChallenge,\n admitsCrossTenantPlatformAdministration: variantParams.admitsCrossTenantPlatformAdministration,\n // Same forwarding obligation as its cross-tenant sibling: the authorizer reads this off the\n // RUNTIME operation, so dropping it here would silently re-close the admin surface.\n admitsCrossSubjectUserAdministration: variantParams.admitsCrossSubjectUserAdministration,\n // Third sibling, same forwarding obligation: the scope-root directory classification reads\n // this off the RUNTIME operation, so dropping it here would re-close a door whose declared\n // collection shape is the only thing that makes it safe (#1267).\n admitsSelfConfinedScopeRootWrite: variantParams.admitsSelfConfinedScopeRootWrite,\n // Forwarded for the same reason again: the post-commit audit emission reads it off the\n // RUNTIME operation. Dropping it would either lose an authored below-floor opt-in (a silent\n // audit gap) or lose an authored suppression (a duplicate row next to a purpose-built event).\n auditableEvent: variantParams.auditableEvent,\n mcp: variantParams.mcp,\n customServiceImplementationModes: variantParams.customServiceImplementationModes || [],\n basicPrefixOperation: variantParams.basicPrefixOperation,\n // Travels WITH `basicPrefixOperation` — it declares which of that hook's fields survive the\n // repository's strict re-parse even when the caller also sent them. Dropping it here would\n // silently reduce the hook to the added-key inference it exists to correct.\n authoritativeFields: variantParams.authoritativeFields,\n // Forwarded for the same reason as its siblings above: the write-integrity guard reads the\n // per-variant reference POLICY off the RUNTIME operation. Dropping it here degrades every\n // variant to the relationship's baseline membership — so an authored `qualifyingStatuses` /\n // `requiredRoles` / `false` would be silently inert while the config claims otherwise. (This\n // is not hypothetical: it shipped that way once, and the e2e caught it as a PENDING and a\n // REVOKED partnership both admitting a share.)\n referenceConstraints: variantParams.referenceConstraints,\n };\n\n\n\n assertSubmissionChallengeDeclaration(String(operation), variantParams.variantType, variantParams.submissionChallenge);\n\n if (isUrlisableOperationVariantType(variantParams.variantType)) {\n const apiCallParams = variantParams as ResourceConfiguration_OperationVariant_BuilderParameters<TMainSchema> & {\n variantType: ResourceOperationVariantType.API_CALL | ResourceOperationVariantType.API_CALL_WITH_CALLBACK\n };\n const isCallbackVariant = apiCallParams.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK;\n const callbackParams = apiCallParams as {\n callbackUrl?: string;\n callbackTimeout?: number;\n callbackRetryAttempts?: number;\n };\n\n // Determine if this is a custom operation and get the operation to check\n const isCustomOperation = !coreOperations.includes(operation as any);\n const operationToCheck = isCustomOperation ? apiCallParams.resourceOperationLike : operation;\n\n // Validate bulk operation business rules - check against the relevant operation\n const haveBulkOperation = apiCallParams.haveBulkOperation || false;\n if (haveBulkOperation && (operationToCheck === CoreResourceOperation.READ || operationToCheck === CoreResourceOperation.LIST)) {\n throw createConfigurationError(`Operation '${operation}' cannot have bulk operations (read and list are not bulkable)`);\n }\n /*\n * A bulk twin of CREATE has no coherent meaning, so it is refused rather than half-built (#1551).\n *\n * The twin keeps `operationIdentifier: 'create'`, so the controller, the service dispatcher and both\n * repositories route it to the SINGLE-row create; only the request DTO pretended otherwise, and this\n * factory and the DTO builder even disagreed on which pretence. Batch creation is CREATE_MANY, whose\n * request is the `{ data: row[] }` envelope its service reads. No authored resource declared a bulk\n * twin of CREATE when this refusal was added (22 `haveBulkOperation` declarations, all on DELETE or\n * UPDATE-like operations).\n */\n if (haveBulkOperation && operationToCheck === CoreResourceOperation.CREATE) {\n throw createConfigurationError(\n `Operation '${operation}' cannot have a bulk twin: every tier would run it as a single-row create. `\n + `Declare ${CoreResourceOperation.CREATE_MANY} for batch creation — its request is { data: row[] }.`,\n );\n }\n const tokenStateSideEffects = [\n ...(apiCallParams.tokenGeneration ? ['tokenGeneration'] : []),\n ...(apiCallParams.tokenRevocation ? ['tokenRevocation'] : []),\n ];\n if (\n tokenStateSideEffects.length > 0\n && (\n haveBulkOperation\n || isTokenStateEffectUnsupportedOperation(operationToCheck)\n )\n ) {\n throw createConfigurationError(\n `Operation '${operation}' cannot combine collection/bulk result semantics with ${tokenStateSideEffects.join(' and ')}. `\n + 'Token generation and revocation each require one canonical related resource state; collection, aggregate, and '\n + 'bulk operations do not expose a single related resource identity. Split the token side effect into a singular '\n + 'operation or remove the collection/bulk variant.',\n );\n }\n if (apiCallParams.tokenRevocation && operationToCheck === CoreResourceOperation.CREATE\n ) {\n throw createConfigurationError(\n `Operation '${operation}' cannot revoke tokens before a CREATE operation because no current resource state exists. `\n + 'Move token revocation to an operation that addresses an existing resource.',\n );\n }\n\n /*\n * (After the token-state checks, so a declaration that breaks both is told about the token rule too.)\n *\n * A client-facing core UPDATE_MANY or DELETE_MANY is a route that can never succeed, so it is refused\n * (#1793).\n *\n * This loop builds it as a NON-bulk operation (`isBulkOperation: false` below) mounted on the\n * collection path, and only a bulk operation has its selector lifted out of the body — `_ids` by the\n * service's `doOperation`, `_match` by the controller. So no request shape can reach\n * `updateMany` / `deleteMany` with a target, and the route answers every call with\n * `service_resource_validation_failed`. Measured on a running stack against an escalation-policy\n * collection before its variant moved: `{}`, `{ _ids: [...] }`, a filter and a field patch were all\n * refused, while GET on the same collection answered 200.\n *\n * The two working doors are named in the message: INTERNAL_CALL keeps the operation as the service\n * capability retention scrubs and anonymous-ownership transfer call with an explicit target, and a\n * `haveBulkOperation: true` variant on UPDATE / DELETE (or a custom operation) is the client bulk door,\n * with its selector, its max-selection limit and its place in the bulk bar. Scoped to the CORE\n * identifiers: a custom operation that borrows `resourceOperationLike: UPDATE_MANY` has its own request\n * and implementation and is unaffected. CREATE_MANY's `{ data: row[] }` form works and is untouched.\n */\n if (\n !isCustomOperation\n && (operation === CoreResourceOperation.UPDATE_MANY || operation === CoreResourceOperation.DELETE_MANY)\n ) {\n throw createConfigurationError(\n `Operation '${operation}' cannot be declared ${apiCallParams.variantType}: a client-facing core ${operation} is mounted `\n + 'as a non-bulk route, no selector ever reaches it, and it refuses every request. '\n + `Declare it ${ResourceOperationVariantType.INTERNAL_CALL} for a service-side capability, or give `\n + `${operation === CoreResourceOperation.UPDATE_MANY ? CoreResourceOperation.UPDATE : CoreResourceOperation.DELETE} `\n + 'a `haveBulkOperation: true` variant for a client bulk action.',\n );\n }\n\n // Determine HTTP verb - for custom operations, use resourceOperationLike\n let httpVerb: HttpMethod;\n if (isCustomOperation) {\n // For custom operations, resourceOperationLike is mandatory and we use its HTTP verb\n if (!apiCallParams.resourceOperationLike) {\n throw createConfigurationError(`Operation '${operation}' is a custom operation and must specify resourceOperationLike`);\n }\n httpVerb = getDefaultHttpVerbForOperation(apiCallParams.resourceOperationLike);\n } else {\n // For core operations, use the operation itself\n httpVerb = getDefaultHttpVerbForOperation(operation);\n }\n\n\n\n // ── Build-time validation for token configs ──\n if (apiCallParams.tokenGeneration) {\n validateTokenGenerationConfig(\n apiCallParams.tokenGeneration,\n resourceIdentifier as string,\n operation as string,\n );\n }\n if (apiCallParams.tokenRevocation) {\n validateTokenRevocationConfig(\n apiCallParams.tokenRevocation,\n resourceIdentifier as string,\n operation as string,\n );\n }\n if (apiCallParams.tokenAuthentication) {\n validateTokenAuthenticationConfig(\n apiCallParams.tokenAuthentication,\n resourceIdentifier as string,\n operation as string,\n );\n }\n\n const apiCallOperationFields = {\n ...baseOperationFields,\n httpVerb,\n isApiKeyAccessDisabled: apiCallParams.isApiKeyAccessDisabled || false,\n isBulkOperation: false, // Normal operation\n tokenAuthentication: apiCallParams.tokenAuthentication,\n tokenGeneration: apiCallParams.tokenGeneration,\n tokenRevocation: apiCallParams.tokenRevocation,\n // Per-endpoint rate-limit policy: forwarded from the\n // builder params to the resolved operation. Read at runtime by\n // `RateLimitBackendService.checkPolicyForVariant` at the controller\n // pre-flight seam. `undefined` means the global HTTP limiter is the\n // only gate for this route.\n rateLimit: apiCallParams.rateLimit,\n enabledCondition: apiCallParams.enabledCondition,\n isDefault: apiCallParams.isDefault,\n variantKey: apiCallParams.variantKey,\n ...(isCallbackVariant ? {\n callbackUrl: callbackParams.callbackUrl,\n callbackTimeout: callbackParams.callbackTimeout ?? 300,\n callbackRetryAttempts: callbackParams.callbackRetryAttempts ?? 3,\n } : {}),\n };\n\n // ── Collection-view enrichment ──────────────────────────────────\n // When an operation is SEARCH-like or LIST-like (by identity or resourceOperationLike),\n // extract collection-view fields from the variant params and compute derived schemas.\n const isSearchLike = operation === CoreResourceOperation.SEARCH\n || (variantParams as any).resourceOperationLike === CoreResourceOperation.SEARCH;\n const isListLike = operation === CoreResourceOperation.LIST\n || (variantParams as any).resourceOperationLike === CoreResourceOperation.LIST;\n\n if (isSearchLike || isListLike) {\n assertCollectionFieldsNameResourceFields({\n resourceIdentifier: String(resourceIdentifier),\n operationLabel: `operation \"${String(operation)}\"${apiCallParams.variantKey ? ` (variant \"${apiCallParams.variantKey}\")` : ''}`,\n schemaShape: getZodObjectShape(effectiveMainSchema) as Record<string, unknown>,\n filterFields: (variantParams as any).filterFields,\n sortFields: (variantParams as any).sortFields,\n searchableFields: isSearchLike ? (variantParams as any).searchableFields : undefined,\n });\n }\n\n if (isSearchLike) {\n const pageSize = (variantParams as any).pageSize ?? 20;\n const isSearchable = (variantParams as any).isSearchable !== false;\n const searchableFields = (variantParams as any).searchableFields || [];\n const searchableOptions = (variantParams as any).searchableOptions || { caseSensitive: false, fullMatchOnly: false };\n const rawFilterFields = (variantParams as any).filterFields || {};\n const sortFields = (variantParams as any).sortFields || [];\n const maxPaginatedResultPerPageLimit = (variantParams as any).maxPaginatedResultPerPageLimit || DEFAULT_SEARCH_PAGE_CEILING;\n\n // Every entry is a Zod type by now: `assertCollectionFieldsNameResourceFields` refused the\n // function-valued slot above.\n const filterFields = rawFilterFields as Record<string, PrimitiveZodType>;\n\n const searchQueryRequestSchema = createResourceSearchQueryRequestSchema({\n filterFields,\n allowedSortFields: sortFields,\n pagination: true,\n // The SAME value the response schema below is built from. That equality is the point:\n // request, repository and response must agree on one ceiling.\n maxPaginatedResultPerPageLimit\n });\n\n const paginatedResponseSchema = createResourcePaginatedResponseSchema({\n dataSchema: derivedSummarySchema,\n validateArrayConstraints: true,\n maxResultsPerPageLimit: maxPaginatedResultPerPageLimit\n });\n // An author's `customResponseDto` wins here exactly as it does for every other operation\n // (`deriveResponseDto` above). This block used to overwrite it with the generated schema and\n // stamp `hasCustomResponseDto: false`, so a searchable variant silently lost the contract it\n // declared — found when inbound deliveries declared one to keep the raw payload out of a page\n // (#1596). A custom DTO must carry the same page ceiling as this variant.\n const customSearchResponseDto = (variantParams as any).customResponseDto as z.ZodTypeAny | undefined;\n\n Object.assign(apiCallOperationFields, {\n pageSize,\n isSearchable,\n searchableFields,\n searchableOptions,\n filterFields: rawFilterFields,\n sortFields,\n maxPaginatedResultPerPageLimit,\n searchQueryRequestSchema,\n responseDto: customSearchResponseDto ?? paginatedResponseSchema,\n hasCustomResponseDto: customSearchResponseDto !== undefined,\n });\n }\n\n if (isListLike) {\n const listEnrichment: Record<string, unknown> = {\n pageSize: (variantParams as any).pageSize ?? 20,\n searchEnabled: (variantParams as any).searchEnabled ?? true,\n filtersEnabled: (variantParams as any).filtersEnabled ?? true,\n // LIST has one pagination authority. Keep the effective ceiling on the resolved\n // operation so request/response DTO construction, repositories, auto-generated\n // SUMMARY/CONTEXT variants and API-reference projection all observe the same value.\n maxPaginatedResultPerPageLimit: (variantParams as any).maxPaginatedResultPerPageLimit ?? DEFAULT_LIST_PAGE_CEILING,\n };\n if ((variantParams as any).filterFields !== undefined) {\n listEnrichment.filterFields = (variantParams as any).filterFields;\n }\n if ((variantParams as any).sortFields !== undefined) {\n listEnrichment.sortFields = (variantParams as any).sortFields;\n }\n Object.assign(apiCallOperationFields, listEnrichment);\n }\n // ── End collection-view enrichment ──────────────────────────────\n\n // Add normal operation\n operations.push(apiCallOperationFields as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>);\n\n // Add bulk operation if enabled\n if (haveBulkOperation) {\n // The documented, enforced batch limit (`BULK_OPERATION_DEFAULT_MAX_SELECTION` unless the\n // variant declares `bulkOperationMaxSelection`). A bulk CREATE is bounded on its `data` rows\n // for the same reason a bulk UPDATE/DELETE is bounded on its `_ids`.\n const bulkMaxSelection = resolveBulkOperationMaxSelection(apiCallParams as { bulkOperationMaxSelection?: number });\n const rowRequestDto = apiCallOperationFields.requestDto;\n // The DTO builder rebuilds this later from the same function; both must agree.\n const bulkDto = wrapRequestDtoAsBulk({\n rowRequestDto: rowRequestDto && !(rowRequestDto instanceof z.ZodObject && Object.keys(rowRequestDto.shape).length === 0)\n ? rowRequestDto\n : undefined,\n maxSelection: bulkMaxSelection,\n // The DTO builder's predicate, verbatim, so the two constructions cannot disagree: a bulk twin\n // of CREATE is refused above, and only CREATE_MANY takes `{ data: [] }`.\n isCreate: operationToCheck === CoreResourceOperation.CREATE_MANY,\n });\n\n const bulkOperationFields = {\n ...apiCallOperationFields,\n isBulkOperation: true,\n isOperationDefault: false, // Bulk operations are never default\n requestDto: bulkDto,\n bulkOperationMaxSelection: bulkMaxSelection,\n };\n\n operations.push(bulkOperationFields as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>);\n }\n\n } else {\n // Handle other variant types (CronJob, BatchJob, InternalCall, RepositoryOnly)\n const { variantType, ...specificFields } = variantParams; // Extract variantType and get rest\n\n const nonApiCallOperation = {\n ...baseOperationFields,\n ...specificFields,\n ...((variantParams.variantType === ResourceOperationVariantType.CRON_JOB || variantParams.variantType === ResourceOperationVariantType.BATCH_JOB)\n ? { scheduledRecovery: normalizeScheduledRecoveryPolicy(variantParams.scheduledRecovery) }\n : {}),\n };\n\n operations.push(nonApiCallOperation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>);\n }\n });\n\n // ========================================\n // PROCESS AUTO-VARIANTS FOR READ AND LIST\n // ========================================\n\n // Only process auto-variants for READ and LIST core operations\n if (operation === CoreResourceOperation.READ || operation === CoreResourceOperation.LIST) {\n // Reuse the flattened default URL-bearing operation so auto-variants inherit the same\n // resolved default identity as the rest of the resource config.\n const defaultApiCallVariant = [...operations].reverse().find((candidate) => (\n candidate.operationIdentifier === operation\n && isUrlisableOperationVariantType(candidate.variantType)\n && candidate.isOperationDefault === true\n && !('isBulkOperation' in candidate && candidate.isBulkOperation === true)\n )) as (\n ResourceConfiguration_Operation_ApiCall<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> |\n Extract<\n ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n { variantType: ResourceOperationVariantType.API_CALL_WITH_CALLBACK }\n >\n ) | undefined;\n\n if (!defaultApiCallVariant) {\n // Skip auto-variants if no default variant exists\n continue;\n }\n\n const defaultListCollectionFields = defaultApiCallVariant as typeof defaultApiCallVariant & CollectionViewFields_List;\n\n // Check which variants already exist\n const existingVariantKeys = new Set(\n operations.filter((candidate) => (\n candidate.operationIdentifier === operation\n && isUrlisableOperationVariantType(candidate.variantType)\n && candidate.variantKey\n && !('isBulkOperation' in candidate && candidate.isBulkOperation === true)\n ))\n .map((candidate) => candidate.variantKey!.toLowerCase())\n );\n\n // Helper to create auto-variant operation\n // Note: DTOs will be pre-computed by buildAllOperationDtos() after all operations are created.\n // We set temporary DTOs here for type compatibility, but they will be replaced.\n const createAutoVariantOperation = (\n variantKey: typeof OPERATION_VARIANT_KEY.SUMMARY | typeof OPERATION_VARIANT_KEY.CONTEXT,\n responseDto: z.ZodTypeAny,\n isDefault: boolean\n ): ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> => {\n const baseOperationFields = {\n isDisabled: params.isDisabled ?? false,\n mainSchema: effectiveMainSchema,\n resourcePrimaryScope,\n resourceIdentifier,\n resourceFieldIdentifier,\n resourceRelationships: operationResourceRelationships,\n isSystemResource,\n operationIdentifier: operation,\n isOperationDefault: false, // Auto-variants are never operation default\n serviceRuntimeMode: config.serviceRuntimeMode || ResourceOperation_ServiceRuntimeMode.INLINE,\n queueConfig,\n requestDto: defaultApiCallVariant.requestDto || deriveRequestDto(operation as string, effectiveMainSchema, undefined), // Temporary - will be replaced by buildAllOperationDtos\n // Forwarded for the same reason as `unimplementedAcknowledgement` below: an auto-variant\n // is a projection of the default variant, so it inherits that variant's request contract\n // and must report the same provenance. Dropping it would make a projection of an\n // AUTHORED contract look auto-derived to the request-contract-breadth guard.\n hasCustomRequestDto: defaultApiCallVariant.hasCustomRequestDto ?? !!defaultApiCallVariant.requestDto,\n responseDto, // Temporary - will be replaced by buildAllOperationDtos\n // Stamped like every other factory-built operation, and it is what makes \"temporary\" true. An\n // auto-variant's `responseDto` is framework-derived, but without the flag the DTO rebuild\n // fell back to its structural heuristic, found the temporary schema \"significantly\n // different\" from the rebuilt one and PRESERVED it as custom. For a CONTEXT variant that\n // temporary schema is the context DTO of the empty-registry factory pass, so the full-\n // registry rebuild added the runtime relationship field BESIDE the fallback one:\n // `users/self/context` declared both `userSelfPreference` and `userSelfPreferences`, at\n // runtime and in the published API reference (#582).\n hasCustomResponseDto: false,\n notificationBadgeOperations: config.notificationBadgeOperations || [],\n userNotifications,\n m2mNotifications,\n variantType: defaultApiCallVariant.variantType,\n resourceOperationLike: defaultApiCallVariant.resourceOperationLike,\n requiredFeatures: normalizeRequiredFeatures(defaultApiCallVariant.requiredFeatures),\n riskLevel: defaultApiCallVariant.riskLevel || ResourceOperationRiskLevel.LOW,\n // Inherited like riskLevel: an auto-variant is a projection of the default variant, so a\n // SUMMARY or CONTEXT derivative of an irreversible operation is equally irreversible.\n reversibility: defaultApiCallVariant.reversibility,\n // Inherited like riskLevel: an auto-variant is a projection of the default variant. The\n // read-shaped projections are unlikely to need it, but inheriting keeps \"projection of\n // the default\" a single consistent rule rather than a per-field accident.\n clientRequestTimeoutMs: defaultApiCallVariant.clientRequestTimeoutMs,\n roles: defaultApiCallVariant.roles, // Inherit roles from default variant\n // Inherited for the same reason as roles: an auto-variant is a projection of the\n // default variant, so if the default is a known implementation gap its SUMMARY /\n // CONTEXT derivatives are equally unserviceable and must refuse identically.\n unimplementedAcknowledgement: defaultApiCallVariant.unimplementedAcknowledgement,\n // Inherited for the same reason: an auto-variant is a projection of the default variant,\n // so a SUMMARY / CONTEXT derivative of a step-up-gated operation must demand the same\n // proof. (Today the auto-variants are read-shaped and `enforceStepUpAuth` exempts reads\n // anyway — inheriting keeps that a property of the exemption list rather than an accident\n // of this projection.)\n requiresStepUpAuthentication: defaultApiCallVariant.requiresStepUpAuthentication,\n // Inherited like step-up: an auto-variant projects the default variant's contract, header included.\n idempotencyKey: defaultApiCallVariant.idempotencyKey,\n // Inherited like the Idempotency-Key: a projection of a protected operation asks the same challenge (#1985).\n submissionChallenge: defaultApiCallVariant.submissionChallenge,\n admitsCrossTenantPlatformAdministration: defaultApiCallVariant.admitsCrossTenantPlatformAdministration,\n // Inherited for the same reason as the cross-tenant flag: an auto-variant is a PROJECTION of\n // the default operation and must make the same addressing claim, or it would refuse the very\n // subjects the operation it projects is admitted to administer.\n admitsCrossSubjectUserAdministration: defaultApiCallVariant.admitsCrossSubjectUserAdministration,\n // Inherited for the same reason as both siblings: an auto-variant projects the default\n // variant's contract, and a projection that dropped this claim would be classified as an\n // unconfined directory write while the operation it projects is not.\n admitsSelfConfinedScopeRootWrite: defaultApiCallVariant.admitsSelfConfinedScopeRootWrite,\n // Inherited for the same reason: an auto-variant is a projection of the default variant,\n // so it must make the same audit claim. Inheriting a `suppressGenericEvent` matters most —\n // the purpose-built event that supersedes the default covers its projections too, and a\n // projection that dropped the suppression would write the duplicate row the flag prevents.\n auditableEvent: defaultApiCallVariant.auditableEvent,\n mcp: defaultApiCallVariant.mcp, // Inherit MCP exposure from default variant (non-default variants aren't MCP-enumerated anyway)\n customServiceImplementationModes: defaultApiCallVariant.customServiceImplementationModes || [],\n basicPrefixOperation: defaultApiCallVariant.basicPrefixOperation,\n // Inherited alongside the hook itself — an auto-variant that ran the prefix without its\n // ownership declaration would drop the very field the hook exists to force.\n authoritativeFields: defaultApiCallVariant.authoritativeFields,\n // Inherited for the same reason as `roles`: an auto-variant is a PROJECTION of the default\n // variant, so it must confine a written reference exactly as the operation it projects does.\n // (Read-shaped auto-variants write nothing today, so this is inert for them — inheriting\n // keeps that a property of what they DO rather than an accident of this projection.)\n referenceConstraints: defaultApiCallVariant.referenceConstraints,\n httpVerb: defaultApiCallVariant.httpVerb,\n isApiKeyAccessDisabled: defaultApiCallVariant.isApiKeyAccessDisabled || false,\n isBulkOperation: false,\n tokenAuthentication: defaultApiCallVariant.tokenAuthentication,\n tokenGeneration: defaultApiCallVariant.tokenGeneration,\n tokenRevocation: defaultApiCallVariant.tokenRevocation,\n // Auto-variants (READ.summary, READ.context, LIST.summary, …)\n // inherit the default variant's rate-limit policy by design — a\n // single declaration on the default URL-bearing variant covers all\n // derived auto-variants. Authors who need a per-variant override\n // declare the variant explicitly instead of relying on auto-generation.\n rateLimit: defaultApiCallVariant.rateLimit,\n enabledCondition: defaultApiCallVariant.enabledCondition,\n isDefault: isDefault,\n variantKey: variantKey,\n ...(operation === CoreResourceOperation.LIST ? {\n // A generated representation changes only the response DATA SHAPE. It remains the same\n // collection operation, so its query contract must be identical to the canonical default\n // variant. Otherwise selecting SUMMARY or CONTEXT silently removes filters, sorting or\n // the authored page ceiling from the public contract.\n pageSize: defaultListCollectionFields.pageSize,\n searchEnabled: defaultListCollectionFields.searchEnabled,\n filtersEnabled: defaultListCollectionFields.filtersEnabled,\n filterFields: defaultListCollectionFields.filterFields,\n sortFields: defaultListCollectionFields.sortFields,\n maxPaginatedResultPerPageLimit: defaultListCollectionFields.maxPaginatedResultPerPageLimit,\n } : {}),\n ...(defaultApiCallVariant.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK ? {\n callbackUrl: defaultApiCallVariant.callbackUrl,\n callbackTimeout: defaultApiCallVariant.callbackTimeout,\n callbackRetryAttempts: defaultApiCallVariant.callbackRetryAttempts,\n } : {}),\n };\n\n // ── Build-time validation for auto-variant token configs ──\n if (defaultApiCallVariant.tokenGeneration) {\n validateTokenGenerationConfig(\n defaultApiCallVariant.tokenGeneration,\n resourceIdentifier as string,\n `${operation as string}.${variantKey}`,\n );\n }\n if (defaultApiCallVariant.tokenRevocation) {\n validateTokenRevocationConfig(\n defaultApiCallVariant.tokenRevocation,\n resourceIdentifier as string,\n `${operation as string}.${variantKey}`,\n );\n }\n // `tokenAuthentication` is deliberately NOT re-validated here, and the absence is a decision\n // rather than an omission (issue #313). `defaultApiCallVariant` is SELECTED from `operations`\n // — variants that were built, and validated, by the authored path above — so its\n // `tokenAuthentication` cannot be a value that block has not already refused. A guard here\n // would be unreachable, and an unreachable guard is not defence in depth: it is an untested\n // claim that reads like coverage (`.claude/rules/invariant-call-site-enumeration.md` #25,\n // #19). Measured: neutering it left every pin in\n // `token-authentication-type-list.guard.test.ts` green.\n //\n // The same is true of the two blocks immediately above — they predate this note and are kept\n // as found, but do not add a fourth on their model.\n\n return baseOperationFields as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>;\n };\n\n // Generate READ.summary variant\n if (operation === CoreResourceOperation.READ && enableReadSummary && !existingVariantKeys.has(OPERATION_VARIANT_KEY.SUMMARY)) {\n const summaryResponseDto = derivedSummarySchema;\n operations.push(createAutoVariantOperation(OPERATION_VARIANT_KEY.SUMMARY, summaryResponseDto, false));\n }\n\n // Generate READ.context variant\n if (operation === CoreResourceOperation.READ && enableReadContext && !existingVariantKeys.has(OPERATION_VARIANT_KEY.CONTEXT)) {\n const contextResponseDto = effectiveMainSchema; // Full schema for context\n operations.push(createAutoVariantOperation(OPERATION_VARIANT_KEY.CONTEXT, contextResponseDto, false));\n }\n\n // Generate LIST.summary variant\n if (operation === CoreResourceOperation.LIST && enableListSummary && !existingVariantKeys.has(OPERATION_VARIANT_KEY.SUMMARY)) {\n const summaryResponseDto = createResourcePaginatedResponseSchema({\n dataSchema: derivedSummarySchema,\n validateArrayConstraints: true,\n maxResultsPerPageLimit: defaultListCollectionFields.maxPaginatedResultPerPageLimit,\n });\n operations.push(createAutoVariantOperation(OPERATION_VARIANT_KEY.SUMMARY, summaryResponseDto, false));\n }\n\n // Generate LIST.context variant\n if (operation === CoreResourceOperation.LIST && enableListContext && !existingVariantKeys.has(OPERATION_VARIANT_KEY.CONTEXT)) {\n const contextResponseDto = createResourcePaginatedResponseSchema({\n dataSchema: effectiveMainSchema,\n validateArrayConstraints: true,\n maxResultsPerPageLimit: defaultListCollectionFields.maxPaginatedResultPerPageLimit,\n });\n operations.push(createAutoVariantOperation(OPERATION_VARIANT_KEY.CONTEXT, contextResponseDto, false));\n }\n }\n }\n\n // ========================================\n // CROSS-OPERATION TOKEN VALIDATION (E1)\n // ========================================\n\n // Detect invalid pairing: tokenGeneration with consumeAt:EXCHANGE + tokenAuthentication with ADDITIVE policy\n // When token is consumed at exchange, no consumable token value is carried into the session,\n // so ADDITIVE operations that require the token will silently fail.\n const generatedTokenTypes = new Map<string, 'EXCHANGE' | 'TARGET_OPERATION'>();\n const additiveTokenTypes = new Set<string>();\n\n for (const op of operations) {\n if ('tokenGeneration' in op && op.tokenGeneration?.createsOneOffSession && op.tokenGeneration.consumeAt) {\n generatedTokenTypes.set(op.tokenGeneration.tokenType as string, op.tokenGeneration.consumeAt);\n }\n if ('tokenAuthentication' in op && op.tokenAuthentication?.policy === TokenAuthenticationPolicy.ADDITIVE) {\n for (const t of op.tokenAuthentication.types) {\n additiveTokenTypes.add(t as string);\n }\n }\n }\n\n for (const [tokenType, consumeAt] of generatedTokenTypes) {\n if (consumeAt === 'EXCHANGE' && additiveTokenTypes.has(tokenType)) {\n throw createConfigurationError(\n `[${resourceIdentifier}] tokenType '${tokenType}': consumeAt is 'EXCHANGE' but another operation ` +\n `uses this tokenType with ADDITIVE policy. EXCHANGE consumes the token before the session starts, ` +\n `so no token value will be available for ADDITIVE operations. Use 'TARGET_OPERATION' instead.`,\n );\n }\n }\n\n // ========================================\n // BUILD FINAL RESULT\n // ========================================\n\n // Build the final resource configuration to pass to buildAllOperationDtos\n // W7.3a: Warn if isAnonymizable but no operation has APP_ANONYMOUS role\n if (isAnonymizable) {\n const hasAnonymousRole = operations.some(op => op.roles.includes('APP_ANONYMOUS'));\n if (!hasAnonymousRole) {\n console.warn(\n `[${resourceIdentifier}] isAnonymizable: true but no operation has APP_ANONYMOUS in roles. ` +\n `Anonymous users won't be able to access any operation on this resource.`\n );\n }\n }\n\n operations.push(\n ...createGeneratedRelationshipBulkOperations(\n operations,\n relevantRelationships,\n resourceIdentifier,\n {\n ...coreResourceShared_FieldIdentifier,\n [resourceIdentifier]: resourceFieldIdentifier,\n }\n )\n );\n\n const generatedFileDiscoverySchema = ResourcesConfigOperationsDtosBuilderUtils.buildSchemaWithInheritance(\n effectiveMainSchema,\n inheritenceSchemaDefinition,\n );\n\n operations.push(\n ...createGeneratedFileRegenerateOperations({\n operations,\n resourceIdentifier,\n resourceFieldIdentifier,\n mainSchema: effectiveMainSchema,\n generatedFileDiscoverySchema,\n persistenceAdapter,\n })\n );\n\n // AFTER the file-regenerate companions, and over the same fully-assembled set: a generated\n // relationship-bulk operation is never a LIST/SEARCH, so ordering cannot change the outcome — but\n // deriving from the complete set means a future generated LIST would be covered without a second\n // call site to remember.\n operations.push(\n ...createGeneratedCollectionExportOperations({\n operations,\n resourceIdentifier,\n })\n );\n\n // ── Fail-closed guard: no anonymous BULK MUTATION (W7.3a hardening) ─────\n //\n // An anonymous caller may legitimately be granted single-record CREATE / READ\n // / LIST / UPDATE / DELETE (e.g. draft-notes lead capture), but a bulk MUTATION\n // (CREATE_MANY / UPDATE_MANY / DELETE_MANY) granted to `APP_ANONYMOUS` is an\n // unauthenticated mass-write surface — a whole-collection destructive footgun\n // no app should be able to author by accident. The framework provided ZERO\n // enforcement here (only a non-blocking \"isAnonymizable without any anon op\"\n // warning existed), so this fails closed at config-build time. Read-shaped\n // collection ops (LIST / SEARCH / COUNT) are intentionally NOT flagged —\n // anonymous listing of one's own anonymous rows is a supported pattern.\n //\n // Runs over the FULLY-assembled operation set (authored + generated\n // relationship-bulk + file-regenerate) so a generated bulk op that inherited\n // anonymous roles from its base is caught too. Zero violations exist today.\n for (const operation of operations) {\n // A resource op is a bulk MUTATION iff EITHER its identifier is a core bulk\n // verb (create_many / update_many / delete_many) OR it carries the\n // `isBulkOperation` flag. The flag is sufficient on its own: the factory\n // rejects `haveBulkOperation` on READ / LIST above (\"read and list are not\n // bulkable\"), so `isBulkOperation === true` is GUARANTEED to be a mutation —\n // it covers the opt-in bulk UPDATE/DELETE companions AND the generated\n // relationship-bulk ops (whose `operationIdentifier` is a relationship id,\n // not a core verb, so clause 1 alone would miss them). `operationIdentifier`\n // is the (core | custom) op union and `isBulkOperation` exists only on some\n // variants of the discriminated union — narrow with `in` and compare by\n // string value (enum members ARE their string values); the CronJob variant\n // carries neither.\n const isBulkMutation =\n isCoreBulkMutationOperation(operation.operationIdentifier)\n || ('isBulkOperation' in operation && operation.isBulkOperation === true);\n if (isBulkMutation && operation.roles.includes('APP_ANONYMOUS')) {\n throw createConfigurationError(\n `[${resourceIdentifier}] operation '${String(operation.operationIdentifier)}' grants APP_ANONYMOUS on a ` +\n `bulk MUTATION (create_many / update_many / delete_many). Unauthenticated mass-write is forbidden — ` +\n `anonymous access is only permitted on single-record operations (and read-shaped collection ops: ` +\n `list / search / count). Remove APP_ANONYMOUS from this operation's roles.`\n );\n }\n }\n\n // ── RESOLVABILITY half of the retention operation contract ──────────────\n //\n // The presence half ran with the other `retentionPolicy` validations above: it proved\n // UPDATE_MANY / READ / LIST are declared. Being DECLARED is not the same as being REACHABLE,\n // and the gap between the two is a config that boots green and breaks on the first erasure.\n //\n // All three retention primitives resolve their operation through\n // `ResourcesRegistryBackendService.getServiceOperationPathDefault`, which admits ONLY the\n // variant types in `SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES` and only when the variant is\n // the operation DEFAULT. `REPOSITORY_ONLY` is route-less exactly like `INTERNAL_CALL` — so it\n // is the natural-looking choice for \"the capability without a new HTTP surface\" — but it is\n // deliberately excluded there and served by the separate `getRepositoryOperationPathDefault`\n // transport. A `REPOSITORY_ONLY` UPDATE_MANY therefore satisfied the presence check and then\n // failed to resolve mid-erasure. That is not hypothetical: the `USERS` opt-in shipped it, every\n // config test passed, and only a completion review caught it.\n //\n // Runs HERE, not with the presence half, because `isOperationDefault` is computed by the\n // operations loop above (it is variant-type-LOCAL — a lone variant marked `isDefault: false`\n // yields NO default for its transport group, which this check must see). Reads the SAME\n // predicate the resolver applies, so a config this guard accepts is a config the resolver can\n // serve, by construction rather than by two lists agreeing.\n if (retentionPolicy?.mode) {\n for (const { operation: requiredOperation, primitive } of RETENTION_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS) {\n if (operations.some((candidate) => isServiceResolvableDefaultOperation(candidate, requiredOperation))) {\n continue;\n }\n\n const declaredVariants = operations\n .filter((candidate) => candidate.operationIdentifier === requiredOperation)\n .map((candidate) => `${candidate.variantType}${candidate.variantKey ? `:${candidate.variantKey}` : ''}` +\n `${candidate.isOperationDefault ? ' (default)' : ''}`);\n\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionPolicy requires ${requiredOperation} to be SERVICE-RESOLVABLE, but it ` +\n `declares no DEFAULT variant of an accepted type. Declared variants: ` +\n `[${declaredVariants.length > 0 ? declaredVariants.join(', ') : 'none'}]. The retention primitive ` +\n `${primitive} resolves this operation through getServiceOperationPathDefault, which accepts only ` +\n `[${SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES.join(', ')}] and only the operation default. ` +\n `REPOSITORY_ONLY is route-less but is served by the SEPARATE getRepositoryOperationPathDefault ` +\n `transport, so it passes the \"operation exists\" check and then FAILS TO RESOLVE the moment an ` +\n `erasure runs. Use ${ResourceOperationVariantType.INTERNAL_CALL} for a capability that must stay ` +\n `route-less (it is both route-less and service-resolvable), and make sure it is the default for ` +\n `its transport group — a lone variant marked \\`isDefault: false\\` leaves the group with NO default.`\n );\n }\n }\n\n // ── RESOLVABILITY of the retention-class sweep's delete (#1613) ───────────\n //\n // The class sweep deletes expired rows through the SERVICE layer — so cascades, file release and RAG\n // chunk removal run — preferring a DELETE_MANY and falling back to per-row DELETE, exactly the\n // anonymous-session cleanup's disjunction. A binding with neither resolvable would boot green and then\n // fail the first sweep that found an expired row, which is a published period nothing can enforce.\n if (retentionBinding) {\n const deleteAlternatives = [CoreResourceOperation.DELETE_MANY, CoreResourceOperation.DELETE];\n if (!deleteAlternatives.some((alternative) =>\n operations.some((candidate) => isServiceResolvableDefaultOperation(candidate, alternative)))) {\n const declaredVariants = operations\n .filter((candidate) => deleteAlternatives.includes(candidate.operationIdentifier as CoreResourceOperation))\n .map((candidate) => `${String(candidate.operationIdentifier)}/${candidate.variantType}${candidate.isOperationDefault ? ' (default)' : ''}`);\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding requires DELETE_MANY or DELETE to be SERVICE-RESOLVABLE: the retention ` +\n `sweep deletes expired rows through the service layer so cascades, files and RAG chunks go with them. ` +\n `Declared variants: [${declaredVariants.length > 0 ? declaredVariants.join(', ') : 'none'}]. Declare one as the ` +\n `default ${ResourceOperationVariantType.INTERNAL_CALL} variant (route-less and service-resolvable); ` +\n `REPOSITORY_ONLY is served by a different transport and does not resolve.`\n );\n }\n\n }\n\n // ── RESOLVABILITY half of the ANONYMIZABLE operation contract ───────────\n //\n // Same two-halves shape as retention above, for the other dynamic-loop capability. The presence\n // half proved that each requirement group has an alternative DECLARED; this proves one of them\n // is REACHABLE by `AnonymousSessionBackendService`, whose three primitives\n // (`listAnonymousRecords` / `updateManyAsSystem` / `deleteOwnedRecords`) all resolve through\n // `getServiceOperationPathDefault`.\n //\n // Runs HERE rather than with the presence half for the same reason retention's does:\n // `isOperationDefault` is computed by the operations loop above, and it is variant-type-LOCAL —\n // a lone variant marked `isDefault: false` leaves its transport group with NO default.\n //\n // Reads the SAME predicate the resolver applies (`isServiceResolvableDefaultOperation`), and the\n // same predicate `deleteOwnedRecords` probes with when it chooses between DELETE_MANY and\n // per-row DELETE — so the guard, the runtime chooser and the resolver cannot disagree.\n if (isAnonymizable) {\n for (const { operations: alternatives, primitive, why } of ANONYMIZABLE_REQUIRED_SERVICE_RESOLVABLE_OPERATIONS) {\n if (alternatives.some((alternative) =>\n operations.some((candidate) => isServiceResolvableDefaultOperation(candidate, alternative)))) {\n continue;\n }\n\n const declaredVariants = operations\n .filter((candidate) => alternatives.includes(candidate.operationIdentifier as CoreResourceOperation))\n .map((candidate) => `${String(candidate.operationIdentifier)}/${candidate.variantType}` +\n `${candidate.variantKey ? `:${candidate.variantKey}` : ''}${candidate.isOperationDefault ? ' (default)' : ''}`);\n\n throw createConfigurationError(\n `[${resourceIdentifier}] isAnonymizable: true requires ${describeOperationAlternatives(alternatives)} ` +\n `to be SERVICE-RESOLVABLE, but no accepted DEFAULT variant is declared. Declared variants: ` +\n `[${declaredVariants.length > 0 ? declaredVariants.join(', ') : 'none'}]. The anonymous-session ` +\n `primitive ${primitive} (${why}) resolves through getServiceOperationPathDefault, which accepts ` +\n `only [${SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES.join(', ')}] and only the operation default. ` +\n `REPOSITORY_ONLY is route-less but is served by the SEPARATE getRepositoryOperationPathDefault ` +\n `transport, so it passes the \"operation exists\" check and then FAILS TO RESOLVE the moment an ` +\n `anonymous session converts or expires. Use ${ResourceOperationVariantType.INTERNAL_CALL} for a ` +\n `capability that must stay route-less, and make sure it is the default for its transport group.`\n );\n }\n }\n\n const resourceConfig: ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> = {\n isDisabled: params.isDisabled ?? false,\n resourcePrimaryScope,\n resourceIdentifier,\n resourceFieldIdentifier,\n coreOperations,\n customOperation,\n mainSchema: effectiveMainSchema,\n resourceRelationships: processedResourceRelationships,\n inheritenceSchemaDefinition,\n persistenceAdapter,\n persistenceAdapterIsolation,\n httpApiBinding: resolvedHttpApiBinding,\n introspectionBinding,\n externalDataPipeline,\n isSystemResource,\n primaryKeyIdentifiesInitiator,\n systemAccessPolicy: effectiveSystemAccessPolicy,\n subjectErasureLane,\n isAnonymizable,\n transpositionPolicy: isAnonymizable\n ? (transpositionPolicy ?? ResourceTranspositionPolicy.ADD)\n : ResourceTranspositionPolicy.ADD,\n // Normalize (mirror transpositionPolicy): the RESOLVED retentionPolicy is present IFF the resource\n // opted in. An absent `mode` is an opt-in-shaped opt-out that injects no marker\n // and derives no grants, so it must NOT ship a truthy resolved value — else a consumer doing\n // `if (config.retentionPolicy)` would treat a non-opted-in resource as retention-governed.\n retentionPolicy: retentionPolicy?.mode ? retentionPolicy : undefined,\n // Paired with `retentionPolicy` by the guards above, so these two are present together or not at all.\n dataSubjectPolicy: retentionPolicy?.mode ? dataSubjectPolicy : undefined,\n // Validated and parsed above, so the resolved value is exactly the strict-parsed declaration.\n retentionBinding,\n // Normalize (mirror retentionPolicy): the resolved portabilityPolicy is present IFF the\n // resource actually declared a default. An absent `defaultProvenance` is a policy-shaped\n // opt-out, and shipping a truthy-but-empty object would make an Art. 20 export believe a\n // default exists and silently include fields nobody classified.\n portabilityPolicy: portabilityPolicy?.defaultProvenance ? portabilityPolicy : undefined,\n workUnit,\n operations: operations // Temporary - will be replaced\n };\n\n // Pre-compute all DTOs for each operation using buildAllOperationDtos\n // Note: Registry is empty for now - it's mainly used for cross-references in nested DTOs\n // If needed, the registry can be passed as a parameter to the factory function\n const resourceRegistry = new Map<ResourceType, any>();\n const operationsWithDtos = operations.map(operation =>\n ResourcesConfigOperationsDtosBuilderUtils.buildAllOperationDtos(\n operation,\n resourceConfig,\n resourceRegistry\n )\n );\n\n // ── A closure clock is SERVER-OWNED (#1613 review F1) ─────────────────\n //\n // `CLOSURE_EVENT` deletes a row the declared period after its closure date. If ANY client-routed\n // operation's request can carry that date, a caller can backdate it and the next sweep deletes an OPEN\n // record — without DELETE permission and without the period passing. Checked HERE, against the FINAL\n // request DTOs, so it covers every shape uniformly: create, create_many, update, update_many and every\n // custom operation with its own request schema (a \"close\" operation taking the date is the same hole).\n // Route-less variants (INTERNAL_CALL, REPOSITORY_ONLY) are the owning code's own writes and pass; the\n // handlers that own the field declare it in `authoritativeFields`. `isNotEditable()` enforces nothing here.\n if (retentionBinding?.startPoint === RetentionStartPoint.CLOSURE_EVENT && retentionBinding.closureFieldName) {\n const closureFieldName = retentionBinding.closureFieldName;\n const clientRouted = new Set<string>([ResourceOperationVariantType.API_CALL, ResourceOperationVariantType.API_CALL_WITH_CALLBACK]);\n const writers = operationsWithDtos.filter((operation: any) =>\n clientRouted.has(operation.variantType as string) && requestSchemaCarriesField(operation.requestDto, closureFieldName));\n if (writers.length > 0) {\n throw createConfigurationError(\n `[${resourceIdentifier}] retentionBinding closure field '${closureFieldName}' is writable by a client-routed ` +\n `${[...new Set(writers.map((writer: any) => String(writer.operationIdentifier)))].join('/')}: a caller could backdate ` +\n `it and the retention sweep would delete an open record. Mark it .excludeFromCreate().excludeFromUpdate(), keep it ` +\n `out of any custom request schema, and set it in the owning handlers, declaring it in authoritativeFields so their ` +\n `write survives the re-parse.`\n );\n }\n }\n\n return {\n isDisabled: params.isDisabled ?? false,\n resourcePrimaryScope,\n resourceIdentifier,\n resourceFieldIdentifier,\n coreOperations,\n customOperation,\n mainSchema: effectiveMainSchema,\n resourceRelationships: processedResourceRelationships,\n inheritenceSchemaDefinition,\n persistenceAdapter,\n persistenceAdapterIsolation,\n httpApiBinding: resolvedHttpApiBinding,\n introspectionBinding,\n externalDataPipeline,\n isSystemResource,\n primaryKeyIdentifiesInitiator,\n systemAccessPolicy: effectiveSystemAccessPolicy,\n subjectErasureLane,\n isAnonymizable,\n transpositionPolicy: isAnonymizable\n ? (transpositionPolicy ?? ResourceTranspositionPolicy.ADD)\n : ResourceTranspositionPolicy.ADD,\n // Normalize (mirror transpositionPolicy): resolved retentionPolicy present IFF opted-in — see the\n // internal resourceConfig object above for the full rationale.\n retentionPolicy: retentionPolicy?.mode ? retentionPolicy : undefined,\n // Paired with `retentionPolicy` by the guards above, so these two are present together or not at all.\n dataSubjectPolicy: retentionPolicy?.mode ? dataSubjectPolicy : undefined,\n // Validated and parsed above, so the resolved value is exactly the strict-parsed declaration.\n retentionBinding,\n // Normalize (mirror retentionPolicy): the resolved portabilityPolicy is present IFF the\n // resource actually declared a default. An absent `defaultProvenance` is a policy-shaped\n // opt-out, and shipping a truthy-but-empty object would make an Art. 20 export believe a\n // default exists and silently include fields nobody classified.\n portabilityPolicy: portabilityPolicy?.defaultProvenance ? portabilityPolicy : undefined,\n workUnit,\n operations: operationsWithDtos\n };\n}\n\n/**\n * Why a declared constant cannot be written to a local field, or `null` when it can (#1685). The field's own Zod type\n * decides: an enum takes only its members, a string / number / boolean field only that primitive. Any other field\n * type cannot be checked from here, and an expression writing an unchecked value is refused rather than trusted.\n */\nfunction describeExternalDataConstantMisfit(value: unknown, targetSchema: z.ZodTypeAny): string | null {\n const inner = unwrapSchema(targetSchema);\n if (inner instanceof z.ZodEnum) {\n const members = inner.options as readonly unknown[];\n return members.includes(value) ? null : `${JSON.stringify(value)} is not a member of the field's enum (${members.map((member) => JSON.stringify(member)).join(', ')})`;\n }\n if (inner instanceof z.ZodString) return typeof value === 'string' ? null : `${JSON.stringify(value)} is not a string`;\n if (inner instanceof z.ZodNumber) return typeof value === 'number' ? null : `${JSON.stringify(value)} is not a number`;\n if (inner instanceof z.ZodBoolean) return typeof value === 'boolean' ? null : `${JSON.stringify(value)} is not a boolean`;\n return `a declared value cannot be checked against this field's type (${getZodType(inner)})`;\n}\n\n\n/**\n * The destination-schema half of an OUTBOUND pipeline's coherence (#1690) — the arrows of the INBOUND rules reversed.\n *\n * - every SENT field (a mapping entry's `localField`) exists and is the application's own: a field declared\n * `.excludeFromCreate()` AND `.excludeFromUpdate()` is one no caller can ever set, so sending it would send a value\n * nobody decided. (Excluded from one of the two is fine — a field set once on create and never changed is common.)\n * - `remoteKeyLocalField` exists, is a STRING, ACCEPTS ABSENCE (a row is created locally before the system of record\n * has assigned it a key) and is excluded from create and update: the engine writes it, once, from the create's\n * answer, and a caller that could write it could point a local row at any remote record. No `.isBusinessKey()` or\n * `.isUnique()` is required: nothing upserts on it, and the engine never writes one key to two rows.\n * - `partitionUnitLocalField`, when declared, exists, is a STRING and accepts absence — the unit a row belongs to,\n * which decides the partition it is created in. A row with no unit is not sent on a partitioned instance.\n * - a REMOTE_REFERENCE's local foreign key is a STRING that accepts absence (it is the caller's link, possibly empty),\n * and its value shape is resolved from the dialect exactly as for an inbound entry, because the reverse translation\n * sends the target's key in that shape.\n * - `population` and `orphanPolicy` describe an INBOUND load and are refused when AUTHORED with anything but their\n * default. Both carry defaults, so the parsed declaration cannot tell a written value from an omitted one; the\n * authored object can. A value EQUAL to the default is let through, because a declaration that was parsed once\n * already (a configuration re-materialized from its own parsed pipeline) carries both, and it declares nothing an\n * inbound load would read differently.\n */\nfunction validateExternalDataOutboundDeclarationAgainstSchema(\n declaration: ExternalDataPipelineDeclaration,\n shape: Record<string, z.ZodTypeAny>,\n authored: Record<string, unknown>,\n refuse: (message: string) => never,\n): void {\n const defaults = { population: ExternalDataDestinationPopulation.CLOSED, orphanPolicy: ExternalDataOrphanPolicy.REPORT } as const;\n for (const field of ['population', 'orphanPolicy'] as const) {\n if (authored[field] !== undefined && authored[field] !== defaults[field]) {\n refuse(`${field}: describes the rows an INBOUND pass loads, and an OUTBOUND pipeline loads none — it sends the destination's own rows. Remove it.`);\n }\n }\n const requireStringAcceptingAbsence = (fieldName: string, context: string): z.ZodTypeAny => {\n const fieldSchema = shape[fieldName];\n if (!fieldSchema) refuse(`${context}: local field '${fieldName}' does not exist on mainSchema.`);\n if (!(unwrapSchema(fieldSchema!) instanceof z.ZodString)) refuse(`${context}: '${fieldName}' must be a STRING field.`);\n if (unwrapSchema(fieldSchema!) === fieldSchema!) refuse(`${context}: '${fieldName}' must be optional or nullable — a row can exist locally without it.`);\n return fieldSchema!;\n };\n\n const keySchema = requireStringAcceptingAbsence(declaration.remoteKeyLocalField, 'remoteKeyLocalField');\n /*\n * ONE RECORD, ONE ROW (#2039 review) — made a property of the STORE rather than of each code path that writes the key.\n *\n * A remote key names one record of the system of record, so two local rows holding it would each send their edits to\n * that record, overwriting each other's. The pass cannot make that (the system of record mints a fresh key per create),\n * but an operator's answer to an unknown create can, and a check at the door is a read-then-write any concurrent writer\n * slips past. A UNIQUE index cannot be slipped past, on any path.\n *\n * It must IGNORE rows with no key yet — every row before its first send has none. `.isUnique()` gives exactly that on\n * both stores: its default is sparse, which MongoDB builds as a sparse (or, on a retention-governed resource, a\n * `$exists`-partial) unique index and PostgreSQL plans with NULLs distinct. MongoDB's one blind spot is an EXPLICIT null,\n * which a sparse index still indexes — so the field must also refuse null: `.optional()`, never `.nullable()`, which\n * makes \"absent\" the only empty state a validated write can store.\n *\n * Checked rather than applied by the factory, for the inbound rule's reason (the same field there must be declared\n * `.isUnique()`, \"boot-CHECKED, not factory-mutated\"): the application's own schema file shows the index it gets, and\n * the migration its planner writes is the one its author reads.\n */\n const uniqueParams = getUniqueFieldParams(keySchema);\n if (uniqueParams === undefined || uniqueParams.sparse === false || (uniqueParams.scope !== undefined && uniqueParams.scope !== 'global') || uniqueParams.compoundWith !== undefined) {\n refuse(\n `remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must be declared .isUnique() — one remote record, one local row: two rows holding `\n + 'one key would each overwrite the other\\'s record. Plain `.isUnique()` (global, sparse, the default) ignores the rows not yet sent.',\n );\n }\n if (keySchema.safeParse(null).success) {\n refuse(\n `remoteKeyLocalField: '${declaration.remoteKeyLocalField}' accepts null. Declare it .optional(), not .nullable(): its unique index ignores a row `\n + 'with no key only while \"no key\" is ABSENT — MongoDB indexes an explicit null, so a second unsent row would collide with the first.',\n );\n }\n if (!isExcludedFromCreate(keySchema) || !isExcludedFromUpdate(keySchema)) {\n refuse(\n `remoteKeyLocalField: '${declaration.remoteKeyLocalField}' must be declared .excludeFromCreate() and .excludeFromUpdate() — the engine `\n + 'writes it once, from the key the system of record answers a create with, and a caller that could write it could point a local row '\n + 'at any remote record.',\n );\n }\n if (declaration.partitionUnitLocalField !== undefined) {\n requireStringAcceptingAbsence(declaration.partitionUnitLocalField, 'partitionUnitLocalField');\n }\n\n for (const entry of declaration.mapping) {\n const context = `mapping('${entry.localField}')`;\n const fieldSchema = shape[entry.localField];\n if (!fieldSchema) refuse(`${context}: local field '${entry.localField}' does not exist on mainSchema.`);\n if (isExcludedFromCreate(fieldSchema!) && isExcludedFromUpdate(fieldSchema!)) {\n refuse(\n `${context}: '${entry.localField}' is declared .excludeFromCreate() and .excludeFromUpdate(), so no caller can ever set it and an OUTBOUND `\n + 'pipeline would send a value nobody decided. A field this pipeline SENDS is the application\\'s own: let callers write it.',\n );\n }\n if (entry.kind === ExternalDataMappingEntryKind.REMOTE_REFERENCE) {\n requireStringAcceptingAbsence(entry.localField, context);\n entry.valueShape = resolveExternalDataRemoteReferenceValueShape(entry, declaration.binding.dialect);\n }\n }\n}\n\n/**\n * The destination-schema half of a declared expression's validation (#1685): what the local field must be for the\n * expression to write it — and, for a plain CONSTANT, whether the constant fits an enum or primitive field. The schema-independent half (duplicate codes, identity arithmetic, a concatenation of\n * literals) is `assertExternalDataPipelineDeclarationCoherence`'s.\n *\n * Runs where every other mapping target is checked — the resource factory, at module load, i.e. at startup — so a\n * renamed enum member, a mistyped constant or an expression pointed at the wrong kind of field stops the boot with\n * the entry named, instead of rejecting every row of every run. A remote field that does not exist cannot be known\n * here, offline; the extraction requests every field an expression reads, so the SOURCE refuses it on the first run\n * (Odoo raises \"Invalid field\", an OData service refuses an unknown `$select` property) rather than every row landing\n * null.\n *\n * Also RESOLVES, as for a `REMOTE_FIELD` entry, Odoo's absent-as-false coercion on a `CONDITIONAL` outcome that\n * copies a remote field: this is the one place the dialect and the target type are both known.\n */\nfunction validateExternalDataExpressionAgainstTarget(\n entry: ExternalDataFieldMappingEntry,\n targetSchema: z.ZodTypeAny,\n dialect: HttpApiTransportDialect,\n refuse: (message: string) => never,\n): void {\n const at = `mapping('${entry.localField}')`;\n const inner = unwrapSchema(targetSchema);\n const acceptsAbsence = inner !== targetSchema;\n // `required` exists on every expression but CONDITIONAL, whose strict shape refuses it — so only the others may\n // be told to declare it.\n const requireAbsenceCapable = (why: string): void => {\n if (acceptsAbsence) return;\n refuse(entry.kind === ExternalDataMappingEntryKind.CONDITIONAL\n ? `${at}: ${why}, so the field must be optional or nullable.`\n : `${at}: ${why}, so the field must be optional or nullable — or declare required: true (such rows are then rejected and reported).`);\n };\n switch (entry.kind) {\n /*\n * A CONSTANT, checked where a check is possible (#1685 review): a member the enum does not have, or a value of the\n * wrong primitive type, fails the boot rather than every row's load. A field of another type (a date, an object)\n * is left alone: a constant cannot express one, and refusing it would refuse declarations nothing proves wrong.\n */\n case ExternalDataMappingEntryKind.CONSTANT: {\n if (inner instanceof z.ZodEnum || inner instanceof z.ZodString || inner instanceof z.ZodNumber || inner instanceof z.ZodBoolean) {\n const misfit = describeExternalDataConstantMisfit(entry.constant, targetSchema);\n if (misfit !== null) refuse(`${at}.constant: ${misfit}.`);\n }\n return;\n }\n case ExternalDataMappingEntryKind.ENUM_MAP: {\n if (!(inner instanceof z.ZodEnum)) refuse(`${at}: an ENUM_MAP writes a member of a local enum, so its target must be an enum field.`);\n for (const { remoteValue, localValue } of entry.values) {\n const misfit = describeExternalDataConstantMisfit(localValue, targetSchema);\n if (misfit !== null) refuse(`${at}.values: the code ${JSON.stringify(remoteValue)} maps to ${misfit}.`);\n }\n if (entry.unmapped.policy === ExternalDataUnmappedValuePolicy.USE_DEFAULT) {\n const misfit = describeExternalDataConstantMisfit(entry.unmapped.localValue, targetSchema);\n if (misfit !== null) refuse(`${at}.unmapped.localValue: ${misfit}.`);\n }\n if (!entry.required) requireAbsenceCapable('an absent remote code lands null');\n return;\n }\n case ExternalDataMappingEntryKind.CONCATENATION:\n if (!(inner instanceof z.ZodString)) refuse(`${at}: a CONCATENATION writes a string, so its target must be a string field.`);\n if (!entry.required) requireAbsenceCapable('a row whose every remote part is absent lands null');\n return;\n case ExternalDataMappingEntryKind.ARITHMETIC:\n if (!(inner instanceof z.ZodNumber)) refuse(`${at}: an ARITHMETIC entry writes a number, so its target must be a number field.`);\n if (!entry.required) requireAbsenceCapable('an absent remote value lands null');\n return;\n case ExternalDataMappingEntryKind.CONDITIONAL: {\n const outcomes = [...entry.cases.map((entryCase) => entryCase.then), entry.otherwise];\n for (const outcome of outcomes) {\n if (outcome.kind === ExternalDataConditionalOutcomeKind.CONSTANT) {\n const misfit = describeExternalDataConstantMisfit(outcome.constant, targetSchema);\n if (misfit !== null) refuse(`${at}: an outcome writes ${misfit}.`);\n continue;\n }\n requireAbsenceCapable(`the outcome copying '${outcome.remoteField}' lands null when that field is absent`);\n // As for a REMOTE_FIELD entry: the timestamp coercion produces a Date, so it targets a date field.\n if (outcome.coercion === ExternalDataFieldCoercion.ISO_STRING_TO_DATE && !(inner instanceof z.ZodDate)) {\n refuse(`${at}: the outcome copying '${outcome.remoteField}' declares ISO_STRING_TO_DATE, which targets a date field.`);\n }\n // Odoo's false→null default, resolved as for a REMOTE_FIELD entry: a genuine boolean target keeps its false.\n if (dialect === HttpApiTransportDialect.ODOO_JSONRPC && outcome.coercion === ExternalDataFieldCoercion.NONE && !(inner instanceof z.ZodBoolean)) {\n outcome.coercion = ExternalDataFieldCoercion.ODOO_FALSE_AS_NULL;\n }\n }\n return;\n }\n default:\n return;\n }\n}\n"]}