ddd-ts-kit 0.101.0 → 0.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (814) hide show
  1. package/CHANGELOG.md +320 -0
  2. package/README.fr.md +11 -12
  3. package/README.md +10 -11
  4. package/dist/acceptance/check-locked-files.d.ts.map +1 -1
  5. package/dist/acceptance/check-locked-files.js +6 -3
  6. package/dist/acceptance/check-locked-files.js.map +1 -1
  7. package/dist/build/emitted-place.d.ts +1 -2
  8. package/dist/build/emitted-place.d.ts.map +1 -1
  9. package/dist/build/emitted-specifier.d.ts +7 -1
  10. package/dist/build/emitted-specifier.d.ts.map +1 -1
  11. package/dist/build/emitted-specifier.js +5 -6
  12. package/dist/build/emitted-specifier.js.map +1 -1
  13. package/dist/build/emitted-target.d.ts +6 -5
  14. package/dist/build/emitted-target.d.ts.map +1 -1
  15. package/dist/build/emitted-target.js +5 -9
  16. package/dist/build/emitted-target.js.map +1 -1
  17. package/dist/build/rewrite-aliases.d.ts.map +1 -1
  18. package/dist/build/rewrite-aliases.js +7 -5
  19. package/dist/build/rewrite-aliases.js.map +1 -1
  20. package/dist/build/rewrite-specifiers.d.ts +7 -6
  21. package/dist/build/rewrite-specifiers.d.ts.map +1 -1
  22. package/dist/build/rewrite-specifiers.js +6 -4
  23. package/dist/build/rewrite-specifiers.js.map +1 -1
  24. package/dist/build/unresolved-problem.d.ts +2 -1
  25. package/dist/build/unresolved-problem.d.ts.map +1 -1
  26. package/dist/build/unresolved-problem.js +2 -2
  27. package/dist/build/unresolved-problem.js.map +1 -1
  28. package/dist/check/baseline/write-baseline.d.ts.map +1 -1
  29. package/dist/check/baseline/write-baseline.js +2 -3
  30. package/dist/check/baseline/write-baseline.js.map +1 -1
  31. package/dist/check/business-names/parameter-lists.js +1 -3
  32. package/dist/check/business-names/parameter-lists.js.map +1 -1
  33. package/dist/check/engine/run-check.d.ts +3 -0
  34. package/dist/check/engine/run-check.d.ts.map +1 -1
  35. package/dist/check/engine/run-check.js +1 -1
  36. package/dist/check/engine/run-check.js.map +1 -1
  37. package/dist/check/errors/kit-error-codes.d.ts.map +1 -1
  38. package/dist/check/errors/kit-error-codes.js +1 -0
  39. package/dist/check/errors/kit-error-codes.js.map +1 -1
  40. package/dist/check/explain/authz-docs.js +1 -1
  41. package/dist/check/explain/authz-docs.js.map +1 -1
  42. package/dist/check/explain/errors-docs.js +1 -1
  43. package/dist/check/explain/errors-docs.js.map +1 -1
  44. package/dist/check/explain/tenancy-docs.d.ts.map +1 -1
  45. package/dist/check/explain/tenancy-docs.js +13 -3
  46. package/dist/check/explain/tenancy-docs.js.map +1 -1
  47. package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
  48. package/dist/check/fixtures/authz-policy-fixtures.js +13 -1
  49. package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
  50. package/dist/check/fixtures/conjunct-cases.d.ts +11 -0
  51. package/dist/check/fixtures/conjunct-cases.d.ts.map +1 -0
  52. package/dist/check/fixtures/conjunct-cases.js +19 -0
  53. package/dist/check/fixtures/conjunct-cases.js.map +1 -0
  54. package/dist/check/fixtures/run-fixture.d.ts +3 -2
  55. package/dist/check/fixtures/run-fixture.d.ts.map +1 -1
  56. package/dist/check/fixtures/run-fixture.js +3 -3
  57. package/dist/check/fixtures/run-fixture.js.map +1 -1
  58. package/dist/check/fixtures/run-self-check.js +1 -1
  59. package/dist/check/fixtures/run-self-check.js.map +1 -1
  60. package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.d.ts +3 -0
  61. package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.d.ts.map +1 -0
  62. package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.js +33 -0
  63. package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.js.map +1 -0
  64. package/dist/check/fixtures/tenancy-conjunct-fixtures.d.ts +4 -0
  65. package/dist/check/fixtures/tenancy-conjunct-fixtures.d.ts.map +1 -0
  66. package/dist/check/fixtures/tenancy-conjunct-fixtures.js +12 -0
  67. package/dist/check/fixtures/tenancy-conjunct-fixtures.js.map +1 -0
  68. package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.d.ts +3 -0
  69. package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.d.ts.map +1 -0
  70. package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.js +49 -0
  71. package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.js.map +1 -0
  72. package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.d.ts +3 -0
  73. package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.d.ts.map +1 -0
  74. package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.js +32 -0
  75. package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.js.map +1 -0
  76. package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.d.ts +3 -0
  77. package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.d.ts.map +1 -0
  78. package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.js +34 -0
  79. package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.js.map +1 -0
  80. package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
  81. package/dist/check/fixtures/tenancy-fixtures.js +2 -0
  82. package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
  83. package/dist/check/rules/authz-policy-asked.d.ts.map +1 -1
  84. package/dist/check/rules/authz-policy-asked.js +45 -6
  85. package/dist/check/rules/authz-policy-asked.js.map +1 -1
  86. package/dist/check/rules/clean-one-export-per-file.js +1 -0
  87. package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
  88. package/dist/check/rules/schema-no-duplicate-shape.js +1 -3
  89. package/dist/check/rules/schema-no-duplicate-shape.js.map +1 -1
  90. package/dist/check/rules/tenancy-scoped-statement.js +2 -2
  91. package/dist/check/rules/tenancy-scoped-statement.js.map +1 -1
  92. package/dist/check/rules/test-spec-required.d.ts.map +1 -1
  93. package/dist/check/rules/test-spec-required.js +3 -1
  94. package/dist/check/rules/test-spec-required.js.map +1 -1
  95. package/dist/check/scan/named-outside-imports.d.ts +3 -0
  96. package/dist/check/scan/named-outside-imports.d.ts.map +1 -0
  97. package/dist/check/scan/named-outside-imports.js +8 -0
  98. package/dist/check/scan/named-outside-imports.js.map +1 -0
  99. package/dist/check/scan/star-exports-of.d.ts +3 -0
  100. package/dist/check/scan/star-exports-of.d.ts.map +1 -0
  101. package/dist/check/scan/star-exports-of.js +8 -0
  102. package/dist/check/scan/star-exports-of.js.map +1 -0
  103. package/dist/check/scan/string-at.d.ts +3 -0
  104. package/dist/check/scan/string-at.d.ts.map +1 -0
  105. package/dist/check/scan/string-at.js +5 -0
  106. package/dist/check/scan/string-at.js.map +1 -0
  107. package/dist/check/tenancy/arguments-of-call.d.ts +3 -0
  108. package/dist/check/tenancy/arguments-of-call.d.ts.map +1 -0
  109. package/dist/check/tenancy/arguments-of-call.js +11 -0
  110. package/dist/check/tenancy/arguments-of-call.js.map +1 -0
  111. package/dist/check/tenancy/bare-expression.d.ts +3 -0
  112. package/dist/check/tenancy/bare-expression.d.ts.map +1 -0
  113. package/dist/check/tenancy/bare-expression.js +9 -0
  114. package/dist/check/tenancy/bare-expression.js.map +1 -0
  115. package/dist/check/tenancy/bracket-depth.d.ts +3 -0
  116. package/dist/check/tenancy/bracket-depth.d.ts.map +1 -0
  117. package/dist/check/tenancy/bracket-depth.js +10 -0
  118. package/dist/check/tenancy/bracket-depth.js.map +1 -0
  119. package/dist/check/tenancy/chain-links.d.ts +17 -0
  120. package/dist/check/tenancy/chain-links.d.ts.map +1 -0
  121. package/dist/check/tenancy/chain-links.js +24 -0
  122. package/dist/check/tenancy/chain-links.js.map +1 -0
  123. package/dist/check/tenancy/choice-branches.d.ts +3 -0
  124. package/dist/check/tenancy/choice-branches.d.ts.map +1 -0
  125. package/dist/check/tenancy/choice-branches.js +39 -0
  126. package/dist/check/tenancy/choice-branches.js.map +1 -0
  127. package/dist/check/tenancy/declaration-before.d.ts +12 -0
  128. package/dist/check/tenancy/declaration-before.d.ts.map +1 -0
  129. package/dist/check/tenancy/declaration-before.js +11 -0
  130. package/dist/check/tenancy/declaration-before.js.map +1 -0
  131. package/dist/check/tenancy/declaration-of.d.ts +1 -5
  132. package/dist/check/tenancy/declaration-of.d.ts.map +1 -1
  133. package/dist/check/tenancy/declaration-of.js +3 -8
  134. package/dist/check/tenancy/declaration-of.js.map +1 -1
  135. package/dist/check/tenancy/drizzle-unscoped.d.ts.map +1 -1
  136. package/dist/check/tenancy/drizzle-unscoped.js +16 -3
  137. package/dist/check/tenancy/drizzle-unscoped.js.map +1 -1
  138. package/dist/check/tenancy/enclosed-by.d.ts +3 -0
  139. package/dist/check/tenancy/enclosed-by.d.ts.map +1 -0
  140. package/dist/check/tenancy/enclosed-by.js +6 -0
  141. package/dist/check/tenancy/enclosed-by.js.map +1 -0
  142. package/dist/check/tenancy/end-of-enclosing.d.ts +7 -0
  143. package/dist/check/tenancy/end-of-enclosing.d.ts.map +1 -0
  144. package/dist/check/tenancy/end-of-enclosing.js +18 -0
  145. package/dist/check/tenancy/end-of-enclosing.js.map +1 -0
  146. package/dist/check/tenancy/holds-condition.d.ts +14 -0
  147. package/dist/check/tenancy/holds-condition.d.ts.map +1 -0
  148. package/dist/check/tenancy/holds-condition.js +26 -0
  149. package/dist/check/tenancy/holds-condition.js.map +1 -0
  150. package/dist/check/tenancy/is-conjunct.d.ts +8 -0
  151. package/dist/check/tenancy/is-conjunct.d.ts.map +1 -0
  152. package/dist/check/tenancy/is-conjunct.js +17 -0
  153. package/dist/check/tenancy/is-conjunct.js.map +1 -0
  154. package/dist/check/tenancy/is-or-link.d.ts +4 -0
  155. package/dist/check/tenancy/is-or-link.d.ts.map +1 -0
  156. package/dist/check/tenancy/is-or-link.js +7 -0
  157. package/dist/check/tenancy/is-or-link.js.map +1 -0
  158. package/dist/check/tenancy/knex-links-outside-condition.d.ts +11 -0
  159. package/dist/check/tenancy/knex-links-outside-condition.d.ts.map +1 -0
  160. package/dist/check/tenancy/knex-links-outside-condition.js +108 -0
  161. package/dist/check/tenancy/knex-links-outside-condition.js.map +1 -0
  162. package/dist/check/tenancy/knex-unscoped.d.ts +3 -1
  163. package/dist/check/tenancy/knex-unscoped.d.ts.map +1 -1
  164. package/dist/check/tenancy/knex-unscoped.js +12 -2
  165. package/dist/check/tenancy/knex-unscoped.js.map +1 -1
  166. package/dist/check/tenancy/prisma-unscoped.d.ts.map +1 -1
  167. package/dist/check/tenancy/prisma-unscoped.js +15 -10
  168. package/dist/check/tenancy/prisma-unscoped.js.map +1 -1
  169. package/dist/check/tenancy/spreads-at-top.d.ts +9 -0
  170. package/dist/check/tenancy/spreads-at-top.d.ts.map +1 -0
  171. package/dist/check/tenancy/spreads-at-top.js +49 -0
  172. package/dist/check/tenancy/spreads-at-top.js.map +1 -0
  173. package/dist/check/tenancy/top-level-parts.d.ts +3 -0
  174. package/dist/check/tenancy/top-level-parts.d.ts.map +1 -0
  175. package/dist/check/tenancy/top-level-parts.js +13 -0
  176. package/dist/check/tenancy/top-level-parts.js.map +1 -0
  177. package/dist/check/tenancy/typeorm-unscoped.d.ts.map +1 -1
  178. package/dist/check/tenancy/typeorm-unscoped.js +30 -16
  179. package/dist/check/tenancy/typeorm-unscoped.js.map +1 -1
  180. package/dist/check/tenancy/unconfined-where.d.ts +11 -0
  181. package/dist/check/tenancy/unconfined-where.d.ts.map +1 -0
  182. package/dist/check/tenancy/unconfined-where.js +18 -0
  183. package/dist/check/tenancy/unconfined-where.js.map +1 -0
  184. package/dist/check/text/closing-bracket.d.ts +6 -0
  185. package/dist/check/text/closing-bracket.d.ts.map +1 -0
  186. package/dist/check/text/closing-bracket.js +24 -0
  187. package/dist/check/text/closing-bracket.js.map +1 -0
  188. package/dist/commands/depcruise-config.d.ts.map +1 -1
  189. package/dist/commands/depcruise-config.js +4 -0
  190. package/dist/commands/depcruise-config.js.map +1 -1
  191. package/dist/commands/drizzle-generate.d.ts +3 -2
  192. package/dist/commands/drizzle-generate.d.ts.map +1 -1
  193. package/dist/commands/drizzle-generate.js +14 -6
  194. package/dist/commands/drizzle-generate.js.map +1 -1
  195. package/dist/commands/generate.d.ts.map +1 -1
  196. package/dist/commands/generate.js +3 -2
  197. package/dist/commands/generate.js.map +1 -1
  198. package/dist/commands/knex-generate.d.ts +10 -0
  199. package/dist/commands/knex-generate.d.ts.map +1 -0
  200. package/dist/commands/knex-generate.js +74 -0
  201. package/dist/commands/knex-generate.js.map +1 -0
  202. package/dist/commands/lint.js +15 -0
  203. package/dist/commands/lint.js.map +1 -1
  204. package/dist/commands/move-to-module.d.ts.map +1 -1
  205. package/dist/commands/move-to-module.js +3 -0
  206. package/dist/commands/move-to-module.js.map +1 -1
  207. package/dist/commands/mutation.js +1 -1
  208. package/dist/commands/mutation.js.map +1 -1
  209. package/dist/commands/parse-migration-arguments.d.ts +11 -0
  210. package/dist/commands/parse-migration-arguments.d.ts.map +1 -0
  211. package/dist/commands/parse-migration-arguments.js +17 -0
  212. package/dist/commands/parse-migration-arguments.js.map +1 -0
  213. package/dist/commands/prisma-generate.d.ts.map +1 -1
  214. package/dist/commands/prisma-generate.js +5 -11
  215. package/dist/commands/prisma-generate.js.map +1 -1
  216. package/dist/commands/typeorm-generate.d.ts +2 -1
  217. package/dist/commands/typeorm-generate.d.ts.map +1 -1
  218. package/dist/commands/typeorm-generate.js +5 -2
  219. package/dist/commands/typeorm-generate.js.map +1 -1
  220. package/dist/config/read-config.d.ts.map +1 -1
  221. package/dist/config/read-config.js +20 -0
  222. package/dist/config/read-config.js.map +1 -1
  223. package/dist/declared/render-declarations.js +1 -3
  224. package/dist/declared/render-declarations.js.map +1 -1
  225. package/dist/describe/read-controllers.d.ts.map +1 -1
  226. package/dist/describe/read-controllers.js +18 -2
  227. package/dist/describe/read-controllers.js.map +1 -1
  228. package/dist/describe/schema-class-of.js +8 -1
  229. package/dist/describe/schema-class-of.js.map +1 -1
  230. package/dist/digest/tree-at.d.ts.map +1 -1
  231. package/dist/digest/tree-at.js +2 -0
  232. package/dist/digest/tree-at.js.map +1 -1
  233. package/dist/docs/context-sections.js +3 -7
  234. package/dist/docs/context-sections.js.map +1 -1
  235. package/dist/docs/personal-event-lines.d.ts +7 -0
  236. package/dist/docs/personal-event-lines.d.ts.map +1 -0
  237. package/dist/docs/personal-event-lines.js +34 -0
  238. package/dist/docs/personal-event-lines.js.map +1 -0
  239. package/dist/docs/write-docs.d.ts.map +1 -1
  240. package/dist/docs/write-docs.js +2 -0
  241. package/dist/docs/write-docs.js.map +1 -1
  242. package/dist/docs/write-personal-events.d.ts +11 -0
  243. package/dist/docs/write-personal-events.d.ts.map +1 -0
  244. package/dist/docs/write-personal-events.js +28 -0
  245. package/dist/docs/write-personal-events.js.map +1 -0
  246. package/dist/doctor/permission-findings.d.ts.map +1 -1
  247. package/dist/doctor/permission-findings.js +68 -4
  248. package/dist/doctor/permission-findings.js.map +1 -1
  249. package/dist/generate/concept-role.d.ts +10 -0
  250. package/dist/generate/concept-role.d.ts.map +1 -1
  251. package/dist/generate/concept.d.ts.map +1 -1
  252. package/dist/generate/concept.js +5 -1
  253. package/dist/generate/concept.js.map +1 -1
  254. package/dist/generate/emit.d.ts +5 -2
  255. package/dist/generate/emit.d.ts.map +1 -1
  256. package/dist/generate/emit.js +5 -4
  257. package/dist/generate/emit.js.map +1 -1
  258. package/dist/generate/event-names.d.ts.map +1 -1
  259. package/dist/generate/event-names.js.map +1 -1
  260. package/dist/generate/files-without-modules.d.ts +8 -0
  261. package/dist/generate/files-without-modules.d.ts.map +1 -0
  262. package/dist/generate/files-without-modules.js +12 -0
  263. package/dist/generate/files-without-modules.js.map +1 -0
  264. package/dist/generate/grant-permission.js +2 -2
  265. package/dist/generate/grant-permission.js.map +1 -1
  266. package/dist/generate/kinds/aggregate-kind.js +4 -4
  267. package/dist/generate/kinds/aggregate-kind.js.map +1 -1
  268. package/dist/generate/kinds/assert-event-store.d.ts +5 -1
  269. package/dist/generate/kinds/assert-event-store.d.ts.map +1 -1
  270. package/dist/generate/kinds/assert-event-store.js +11 -5
  271. package/dist/generate/kinds/assert-event-store.js.map +1 -1
  272. package/dist/generate/kinds/background/background-job-vars.js +4 -2
  273. package/dist/generate/kinds/background/background-job-vars.js.map +1 -1
  274. package/dist/generate/kinds/command-kind.d.ts.map +1 -1
  275. package/dist/generate/kinds/command-kind.js +6 -1
  276. package/dist/generate/kinds/command-kind.js.map +1 -1
  277. package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
  278. package/dist/generate/kinds/declare-storage.js +4 -10
  279. package/dist/generate/kinds/declare-storage.js.map +1 -1
  280. package/dist/generate/kinds/domain-event-kind.d.ts.map +1 -1
  281. package/dist/generate/kinds/domain-event-kind.js +3 -1
  282. package/dist/generate/kinds/domain-event-kind.js.map +1 -1
  283. package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
  284. package/dist/generate/kinds/e2e-kind.js +8 -1
  285. package/dist/generate/kinds/e2e-kind.js.map +1 -1
  286. package/dist/generate/kinds/ensure-domain-event.d.ts.map +1 -1
  287. package/dist/generate/kinds/ensure-domain-event.js +2 -0
  288. package/dist/generate/kinds/ensure-domain-event.js.map +1 -1
  289. package/dist/generate/kinds/extraction/add-compose-service.js +1 -1
  290. package/dist/generate/kinds/extraction/add-compose-service.js.map +1 -1
  291. package/dist/generate/kinds/extraction/compose-service-of.d.ts +5 -0
  292. package/dist/generate/kinds/extraction/compose-service-of.d.ts.map +1 -0
  293. package/dist/generate/kinds/extraction/compose-service-of.js +8 -0
  294. package/dist/generate/kinds/extraction/compose-service-of.js.map +1 -0
  295. package/dist/generate/kinds/gateway-kind.js +9 -0
  296. package/dist/generate/kinds/gateway-kind.js.map +1 -1
  297. package/dist/generate/kinds/generate-context.d.ts.map +1 -1
  298. package/dist/generate/kinds/generate-context.js +36 -0
  299. package/dist/generate/kinds/generate-context.js.map +1 -1
  300. package/dist/generate/kinds/generate-event-sourced-repository.js +8 -1
  301. package/dist/generate/kinds/generate-event-sourced-repository.js.map +1 -1
  302. package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
  303. package/dist/generate/kinds/generate-repository.js +13 -0
  304. package/dist/generate/kinds/generate-repository.js.map +1 -1
  305. package/dist/generate/kinds/query-kind.d.ts.map +1 -1
  306. package/dist/generate/kinds/query-kind.js +24 -2
  307. package/dist/generate/kinds/query-kind.js.map +1 -1
  308. package/dist/generate/kinds/route/controller-vars.js +1 -1
  309. package/dist/generate/kinds/route/controller-vars.js.map +1 -1
  310. package/dist/generate/kinds/route/find-use-case.js +1 -1
  311. package/dist/generate/kinds/route/find-use-case.js.map +1 -1
  312. package/dist/generate/kinds/route/message-call.d.ts +6 -2
  313. package/dist/generate/kinds/route/message-call.d.ts.map +1 -1
  314. package/dist/generate/kinds/route/message-call.js +2 -1
  315. package/dist/generate/kinds/route/message-call.js.map +1 -1
  316. package/dist/generate/kinds/route/standard-schema-of.d.ts +2 -1
  317. package/dist/generate/kinds/route/standard-schema-of.d.ts.map +1 -1
  318. package/dist/generate/kinds/route/standard-schema-of.js +2 -4
  319. package/dist/generate/kinds/route/standard-schema-of.js.map +1 -1
  320. package/dist/generate/kinds/service-kind.d.ts.map +1 -1
  321. package/dist/generate/kinds/service-kind.js +4 -3
  322. package/dist/generate/kinds/service-kind.js.map +1 -1
  323. package/dist/generate/kinds/tables-files.d.ts +3 -0
  324. package/dist/generate/kinds/tables-files.d.ts.map +1 -0
  325. package/dist/generate/kinds/tables-files.js +7 -0
  326. package/dist/generate/kinds/tables-files.js.map +1 -0
  327. package/dist/generate/kinds/worker-kind.d.ts.map +1 -1
  328. package/dist/generate/kinds/worker-kind.js +12 -0
  329. package/dist/generate/kinds/worker-kind.js.map +1 -1
  330. package/dist/generate/kinds/write-birth.d.ts +8 -0
  331. package/dist/generate/kinds/write-birth.d.ts.map +1 -0
  332. package/dist/generate/kinds/write-birth.js +13 -0
  333. package/dist/generate/kinds/write-birth.js.map +1 -0
  334. package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
  335. package/dist/generate/kinds/write-event-sourced-aggregate.js +8 -1
  336. package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
  337. package/dist/generate/mark-policy-questions.js +2 -2
  338. package/dist/generate/mark-policy-questions.js.map +1 -1
  339. package/dist/generate/permission-name.d.ts +3 -0
  340. package/dist/generate/permission-name.d.ts.map +1 -0
  341. package/dist/generate/permission-name.js +3 -0
  342. package/dist/generate/permission-name.js.map +1 -0
  343. package/dist/generate/permission-named.d.ts.map +1 -1
  344. package/dist/generate/permission-named.js +1 -1
  345. package/dist/generate/permission-named.js.map +1 -1
  346. package/dist/generate/permission-words.d.ts +7 -0
  347. package/dist/generate/permission-words.d.ts.map +1 -0
  348. package/dist/generate/permission-words.js +11 -0
  349. package/dist/generate/permission-words.js.map +1 -0
  350. package/dist/generate/refined-by-policy.js +2 -2
  351. package/dist/generate/refined-by-policy.js.map +1 -1
  352. package/dist/generate/refuse-stuttering-event.d.ts +8 -0
  353. package/dist/generate/refuse-stuttering-event.d.ts.map +1 -0
  354. package/dist/generate/refuse-stuttering-event.js +14 -0
  355. package/dist/generate/refuse-stuttering-event.js.map +1 -0
  356. package/dist/generate/shared-writes.d.ts.map +1 -1
  357. package/dist/generate/shared-writes.js +1 -0
  358. package/dist/generate/shared-writes.js.map +1 -1
  359. package/dist/generate/spoken-in-language.d.ts +11 -2
  360. package/dist/generate/spoken-in-language.d.ts.map +1 -1
  361. package/dist/generate/spoken-in-language.js +27 -12
  362. package/dist/generate/spoken-in-language.js.map +1 -1
  363. package/dist/generator-lock/unreadable-lock-refusal.d.ts +4 -0
  364. package/dist/generator-lock/unreadable-lock-refusal.d.ts.map +1 -0
  365. package/dist/generator-lock/unreadable-lock-refusal.js +7 -0
  366. package/dist/generator-lock/unreadable-lock-refusal.js.map +1 -0
  367. package/dist/generator-lock/with-generator-lock.d.ts.map +1 -1
  368. package/dist/generator-lock/with-generator-lock.js +8 -7
  369. package/dist/generator-lock/with-generator-lock.js.map +1 -1
  370. package/dist/help/flag-notes.d.ts.map +1 -1
  371. package/dist/help/flag-notes.js +5 -1
  372. package/dist/help/flag-notes.js.map +1 -1
  373. package/dist/help/tool-notes.d.ts.map +1 -1
  374. package/dist/help/tool-notes.js +16 -0
  375. package/dist/help/tool-notes.js.map +1 -1
  376. package/dist/help/usage.d.ts.map +1 -1
  377. package/dist/help/usage.js +1 -0
  378. package/dist/help/usage.js.map +1 -1
  379. package/dist/init/agent-permissions.d.ts.map +1 -1
  380. package/dist/init/agent-permissions.js +18 -3
  381. package/dist/init/agent-permissions.js.map +1 -1
  382. package/dist/init/files/audit-files.d.ts.map +1 -1
  383. package/dist/init/files/audit-files.js +1 -0
  384. package/dist/init/files/audit-files.js.map +1 -1
  385. package/dist/init/files/persistence-files.d.ts.map +1 -1
  386. package/dist/init/files/persistence-files.js +2 -1
  387. package/dist/init/files/persistence-files.js.map +1 -1
  388. package/dist/init/files/platform-files.d.ts.map +1 -1
  389. package/dist/init/files/platform-files.js +14 -0
  390. package/dist/init/files/platform-files.js.map +1 -1
  391. package/dist/init/files/privacy-files.d.ts +2 -2
  392. package/dist/init/files/privacy-files.d.ts.map +1 -1
  393. package/dist/init/files/privacy-files.js +3 -2
  394. package/dist/init/files/privacy-files.js.map +1 -1
  395. package/dist/init/files/script-files.d.ts +4 -1
  396. package/dist/init/files/script-files.d.ts.map +1 -1
  397. package/dist/init/files/script-files.js +6 -1
  398. package/dist/init/files/script-files.js.map +1 -1
  399. package/dist/init/is-team-file.d.ts +2 -2
  400. package/dist/init/is-team-file.d.ts.map +1 -1
  401. package/dist/init/is-team-file.js +5 -3
  402. package/dist/init/is-team-file.js.map +1 -1
  403. package/dist/init/keep-regions.d.ts +21 -0
  404. package/dist/init/keep-regions.d.ts.map +1 -0
  405. package/dist/init/keep-regions.js +63 -0
  406. package/dist/init/keep-regions.js.map +1 -0
  407. package/dist/init/kept-combination-notes.d.ts.map +1 -1
  408. package/dist/init/kept-combination-notes.js +6 -2
  409. package/dist/init/kept-combination-notes.js.map +1 -1
  410. package/dist/init/kept-compose-services.d.ts +6 -0
  411. package/dist/init/kept-compose-services.d.ts.map +1 -0
  412. package/dist/init/kept-compose-services.js +42 -0
  413. package/dist/init/kept-compose-services.js.map +1 -0
  414. package/dist/init/kept-role-vocabulary.d.ts +3 -0
  415. package/dist/init/kept-role-vocabulary.d.ts.map +1 -0
  416. package/dist/init/kept-role-vocabulary.js +7 -0
  417. package/dist/init/kept-role-vocabulary.js.map +1 -0
  418. package/dist/init/kept-roles.d.ts +12 -0
  419. package/dist/init/kept-roles.d.ts.map +1 -0
  420. package/dist/init/kept-roles.js +29 -0
  421. package/dist/init/kept-roles.js.map +1 -0
  422. package/dist/init/kept-wiring.d.ts +22 -0
  423. package/dist/init/kept-wiring.d.ts.map +1 -0
  424. package/dist/init/kept-wiring.js +91 -0
  425. package/dist/init/kept-wiring.js.map +1 -0
  426. package/dist/init/knip-vars.d.ts.map +1 -1
  427. package/dist/init/knip-vars.js +5 -1
  428. package/dist/init/knip-vars.js.map +1 -1
  429. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  430. package/dist/init/manifest/database-scripts.js +5 -3
  431. package/dist/init/manifest/database-scripts.js.map +1 -1
  432. package/dist/init/manifest/scripts-for.d.ts.map +1 -1
  433. package/dist/init/manifest/scripts-for.js +8 -0
  434. package/dist/init/manifest/scripts-for.js.map +1 -1
  435. package/dist/init/manifest/versions.js +24 -24
  436. package/dist/init/orphaned-wiring-notes.d.ts +13 -0
  437. package/dist/init/orphaned-wiring-notes.d.ts.map +1 -0
  438. package/dist/init/orphaned-wiring-notes.js +42 -0
  439. package/dist/init/orphaned-wiring-notes.js.map +1 -0
  440. package/dist/init/profile-hooks.js +1 -1
  441. package/dist/init/profile-hooks.js.map +1 -1
  442. package/dist/init/repositories-left-behind.d.ts +12 -0
  443. package/dist/init/repositories-left-behind.d.ts.map +1 -0
  444. package/dist/init/repositories-left-behind.js +26 -0
  445. package/dist/init/repositories-left-behind.js.map +1 -0
  446. package/dist/init/rewire-audited-events.d.ts +10 -0
  447. package/dist/init/rewire-audited-events.d.ts.map +1 -0
  448. package/dist/init/rewire-audited-events.js +32 -0
  449. package/dist/init/rewire-audited-events.js.map +1 -0
  450. package/dist/init/rewire-contexts.d.ts +15 -0
  451. package/dist/init/rewire-contexts.d.ts.map +1 -0
  452. package/dist/init/rewire-contexts.js +41 -0
  453. package/dist/init/rewire-contexts.js.map +1 -0
  454. package/dist/init/rewire-preset.d.ts +9 -0
  455. package/dist/init/rewire-preset.d.ts.map +1 -0
  456. package/dist/init/rewire-preset.js +29 -0
  457. package/dist/init/rewire-preset.js.map +1 -0
  458. package/dist/init/rewire-tables.d.ts +10 -0
  459. package/dist/init/rewire-tables.d.ts.map +1 -0
  460. package/dist/init/rewire-tables.js +54 -0
  461. package/dist/init/rewire-tables.js.map +1 -0
  462. package/dist/init/run-init.d.ts.map +1 -1
  463. package/dist/init/run-init.js +28 -28
  464. package/dist/init/run-init.js.map +1 -1
  465. package/dist/init/stack/kept-flag-notes.d.ts +7 -0
  466. package/dist/init/stack/kept-flag-notes.d.ts.map +1 -0
  467. package/dist/init/stack/kept-flag-notes.js +24 -0
  468. package/dist/init/stack/kept-flag-notes.js.map +1 -0
  469. package/dist/init/stack/refuse-unused-no-outbox.d.ts +4 -0
  470. package/dist/init/stack/refuse-unused-no-outbox.d.ts.map +1 -0
  471. package/dist/init/stack/refuse-unused-no-outbox.js +9 -0
  472. package/dist/init/stack/refuse-unused-no-outbox.js.map +1 -0
  473. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  474. package/dist/init/stack/resolve-stack.js +10 -0
  475. package/dist/init/stack/resolve-stack.js.map +1 -1
  476. package/dist/init/stack-before.d.ts +4 -0
  477. package/dist/init/stack-before.d.ts.map +1 -0
  478. package/dist/init/stack-before.js +11 -0
  479. package/dist/init/stack-before.js.map +1 -0
  480. package/dist/init/wiring-notes.d.ts +9 -0
  481. package/dist/init/wiring-notes.d.ts.map +1 -0
  482. package/dist/init/wiring-notes.js +22 -0
  483. package/dist/init/wiring-notes.js.map +1 -0
  484. package/dist/init/with-named-imports.d.ts +8 -0
  485. package/dist/init/with-named-imports.d.ts.map +1 -0
  486. package/dist/init/with-named-imports.js +69 -0
  487. package/dist/init/with-named-imports.js.map +1 -0
  488. package/dist/init/with-system-grants.d.ts +7 -0
  489. package/dist/init/with-system-grants.d.ts.map +1 -0
  490. package/dist/init/with-system-grants.js +26 -0
  491. package/dist/init/with-system-grants.js.map +1 -0
  492. package/dist/init/write-local-environment.d.ts +8 -0
  493. package/dist/init/write-local-environment.d.ts.map +1 -0
  494. package/dist/init/write-local-environment.js +18 -0
  495. package/dist/init/write-local-environment.js.map +1 -0
  496. package/dist/lint/eslint-in-project.d.ts +1 -1
  497. package/dist/lint/eslint-in-project.d.ts.map +1 -1
  498. package/dist/lint/eslint-in-project.js +11 -2
  499. package/dist/lint/eslint-in-project.js.map +1 -1
  500. package/dist/markers/index.d.ts +3 -0
  501. package/dist/markers/index.d.ts.map +1 -1
  502. package/dist/markers/index.js +3 -0
  503. package/dist/markers/index.js.map +1 -1
  504. package/dist/markers/region-marker.d.ts +3 -0
  505. package/dist/markers/region-marker.d.ts.map +1 -0
  506. package/dist/markers/region-marker.js +3 -0
  507. package/dist/markers/region-marker.js.map +1 -0
  508. package/dist/markers/regions-of.d.ts +9 -0
  509. package/dist/markers/regions-of.d.ts.map +1 -0
  510. package/dist/markers/regions-of.js +20 -0
  511. package/dist/markers/regions-of.js.map +1 -0
  512. package/dist/markers/unpaired-markers.d.ts +3 -0
  513. package/dist/markers/unpaired-markers.d.ts.map +1 -0
  514. package/dist/markers/unpaired-markers.js +13 -0
  515. package/dist/markers/unpaired-markers.js.map +1 -0
  516. package/dist/measures/timeline-of.js +1 -0
  517. package/dist/measures/timeline-of.js.map +1 -1
  518. package/dist/merge/apply-resolutions.d.ts.map +1 -1
  519. package/dist/merge/apply-resolutions.js +6 -4
  520. package/dist/merge/apply-resolutions.js.map +1 -1
  521. package/dist/merge/continue-merge.d.ts.map +1 -1
  522. package/dist/merge/continue-merge.js +1 -0
  523. package/dist/merge/continue-merge.js.map +1 -1
  524. package/dist/merge/ensure-mergeable.js +1 -1
  525. package/dist/merge/ensure-mergeable.js.map +1 -1
  526. package/dist/merge/lost/verify-merges.d.ts.map +1 -1
  527. package/dist/merge/lost/verify-merges.js +4 -0
  528. package/dist/merge/lost/verify-merges.js.map +1 -1
  529. package/dist/merge/merge-state.d.ts.map +1 -1
  530. package/dist/merge/merge-state.js +2 -2
  531. package/dist/merge/merge-state.js.map +1 -1
  532. package/dist/merge/merge-trunk.d.ts.map +1 -1
  533. package/dist/merge/merge-trunk.js +4 -0
  534. package/dist/merge/merge-trunk.js.map +1 -1
  535. package/dist/merge/refuse-shallow-history.d.ts +10 -0
  536. package/dist/merge/refuse-shallow-history.d.ts.map +1 -0
  537. package/dist/merge/refuse-shallow-history.js +15 -0
  538. package/dist/merge/refuse-shallow-history.js.map +1 -0
  539. package/dist/merge/resume-merge.js +2 -2
  540. package/dist/merge/resume-merge.js.map +1 -1
  541. package/dist/merge/settle-regions.d.ts.map +1 -1
  542. package/dist/merge/settle-regions.js +3 -4
  543. package/dist/merge/settle-regions.js.map +1 -1
  544. package/dist/migration/audit-guard/append-audit-guard.d.ts +4 -2
  545. package/dist/migration/audit-guard/append-audit-guard.d.ts.map +1 -1
  546. package/dist/migration/audit-guard/append-audit-guard.js +18 -3
  547. package/dist/migration/audit-guard/append-audit-guard.js.map +1 -1
  548. package/dist/migration/declared-tables.d.ts +8 -0
  549. package/dist/migration/declared-tables.d.ts.map +1 -0
  550. package/dist/migration/declared-tables.js +13 -0
  551. package/dist/migration/declared-tables.js.map +1 -0
  552. package/dist/migration/find-project-formatter.d.ts.map +1 -1
  553. package/dist/migration/find-project-formatter.js +2 -1
  554. package/dist/migration/find-project-formatter.js.map +1 -1
  555. package/dist/migration/index.d.ts +8 -0
  556. package/dist/migration/index.d.ts.map +1 -1
  557. package/dist/migration/index.js +8 -0
  558. package/dist/migration/index.js.map +1 -1
  559. package/dist/migration/knex-migration-text.d.ts +4 -0
  560. package/dist/migration/knex-migration-text.d.ts.map +1 -0
  561. package/dist/migration/knex-migration-text.js +24 -0
  562. package/dist/migration/knex-migration-text.js.map +1 -0
  563. package/dist/migration/knex-schema-difference.d.ts +12 -0
  564. package/dist/migration/knex-schema-difference.d.ts.map +1 -0
  565. package/dist/migration/knex-schema-difference.js +165 -0
  566. package/dist/migration/knex-schema-difference.js.map +1 -0
  567. package/dist/migration/listed-in-index.d.ts +6 -0
  568. package/dist/migration/listed-in-index.d.ts.map +1 -0
  569. package/dist/migration/listed-in-index.js +8 -0
  570. package/dist/migration/listed-in-index.js.map +1 -0
  571. package/dist/migration/refuse-other-orm.d.ts +8 -0
  572. package/dist/migration/refuse-other-orm.d.ts.map +1 -0
  573. package/dist/migration/refuse-other-orm.js +34 -0
  574. package/dist/migration/refuse-other-orm.js.map +1 -0
  575. package/dist/migration/required-migration-name.d.ts +3 -0
  576. package/dist/migration/required-migration-name.d.ts.map +1 -0
  577. package/dist/migration/required-migration-name.js +11 -0
  578. package/dist/migration/required-migration-name.js.map +1 -0
  579. package/dist/migration/warn-dropped-context-tables.d.ts +12 -0
  580. package/dist/migration/warn-dropped-context-tables.d.ts.map +1 -0
  581. package/dist/migration/warn-dropped-context-tables.js +88 -0
  582. package/dist/migration/warn-dropped-context-tables.js.map +1 -0
  583. package/dist/package-manager/dialects.js +1 -1
  584. package/dist/package-manager/dialects.js.map +1 -1
  585. package/dist/package-manager/in-project-dialect.d.ts +8 -0
  586. package/dist/package-manager/in-project-dialect.d.ts.map +1 -0
  587. package/dist/package-manager/in-project-dialect.js +22 -0
  588. package/dist/package-manager/in-project-dialect.js.map +1 -0
  589. package/dist/presets/adapter-of.d.ts +5 -0
  590. package/dist/presets/adapter-of.d.ts.map +1 -0
  591. package/dist/presets/adapter-of.js +6 -0
  592. package/dist/presets/adapter-of.js.map +1 -0
  593. package/dist/presets/apply-preset.d.ts.map +1 -1
  594. package/dist/presets/apply-preset.js +1 -5
  595. package/dist/presets/apply-preset.js.map +1 -1
  596. package/dist/presets/grant-to-signed-in.d.ts.map +1 -1
  597. package/dist/presets/grant-to-signed-in.js +1 -24
  598. package/dist/presets/grant-to-signed-in.js.map +1 -1
  599. package/dist/presets/identity-terms.d.ts.map +1 -1
  600. package/dist/presets/identity-terms.js +4 -0
  601. package/dist/presets/identity-terms.js.map +1 -1
  602. package/dist/presets/lay-out-prisma-models.js +1 -19
  603. package/dist/presets/lay-out-prisma-models.js.map +1 -1
  604. package/dist/presets/organisations-as-tenants.d.ts +2 -2
  605. package/dist/presets/organisations-as-tenants.d.ts.map +1 -1
  606. package/dist/presets/organisations-as-tenants.js +46 -2
  607. package/dist/presets/organisations-as-tenants.js.map +1 -1
  608. package/dist/presets/preset-named.d.ts +2 -0
  609. package/dist/presets/preset-named.d.ts.map +1 -1
  610. package/dist/presets/preset-named.js +1 -1
  611. package/dist/presets/preset-named.js.map +1 -1
  612. package/dist/presets/wrap-authorizer.d.ts +4 -0
  613. package/dist/presets/wrap-authorizer.d.ts.map +1 -0
  614. package/dist/presets/wrap-authorizer.js +25 -0
  615. package/dist/presets/wrap-authorizer.js.map +1 -0
  616. package/dist/prisma-schema/datasource-schemas.d.ts +3 -0
  617. package/dist/prisma-schema/datasource-schemas.d.ts.map +1 -0
  618. package/dist/prisma-schema/datasource-schemas.js +5 -0
  619. package/dist/prisma-schema/datasource-schemas.js.map +1 -0
  620. package/dist/prisma-schema/index.d.ts +4 -0
  621. package/dist/prisma-schema/index.d.ts.map +1 -1
  622. package/dist/prisma-schema/index.js +4 -0
  623. package/dist/prisma-schema/index.js.map +1 -1
  624. package/dist/prisma-schema/preview-features-of.d.ts +3 -0
  625. package/dist/prisma-schema/preview-features-of.d.ts.map +1 -0
  626. package/dist/prisma-schema/preview-features-of.js +7 -0
  627. package/dist/prisma-schema/preview-features-of.js.map +1 -0
  628. package/dist/prisma-schema/with-datasource-schema.d.ts +3 -0
  629. package/dist/prisma-schema/with-datasource-schema.d.ts.map +1 -0
  630. package/dist/prisma-schema/with-datasource-schema.js +9 -0
  631. package/dist/prisma-schema/with-datasource-schema.js.map +1 -0
  632. package/dist/prisma-schema/with-preview-feature.d.ts +3 -0
  633. package/dist/prisma-schema/with-preview-feature.d.ts.map +1 -0
  634. package/dist/prisma-schema/with-preview-feature.js +19 -0
  635. package/dist/prisma-schema/with-preview-feature.js.map +1 -0
  636. package/dist/progress/format-progress.js +1 -0
  637. package/dist/progress/format-progress.js.map +1 -1
  638. package/dist/run.d.ts.map +1 -1
  639. package/dist/run.js +10 -1
  640. package/dist/run.js.map +1 -1
  641. package/dist/sdk/planned-clients.d.ts +2 -2
  642. package/dist/sdk/planned-clients.d.ts.map +1 -1
  643. package/dist/sdk/planned-clients.js +2 -6
  644. package/dist/sdk/planned-clients.js.map +1 -1
  645. package/dist/sdk/render-client.js +1 -1
  646. package/dist/sdk/render-client.js.map +1 -1
  647. package/dist/sdk/set-up-sdk.d.ts.map +1 -1
  648. package/dist/sdk/set-up-sdk.js +3 -2
  649. package/dist/sdk/set-up-sdk.js.map +1 -1
  650. package/dist/slice/record-verification.d.ts.map +1 -1
  651. package/dist/slice/record-verification.js +2 -5
  652. package/dist/slice/record-verification.js.map +1 -1
  653. package/dist/stack/stack-vars.js +16 -3
  654. package/dist/stack/stack-vars.js.map +1 -1
  655. package/dist/stories/forecast-merge.js +1 -0
  656. package/dist/stories/forecast-merge.js.map +1 -1
  657. package/dist/stories/open-story-scope.d.ts.map +1 -1
  658. package/dist/stories/open-story-scope.js +2 -4
  659. package/dist/stories/open-story-scope.js.map +1 -1
  660. package/dist/story/change-gated.d.ts +3 -3
  661. package/dist/story/change-gated.d.ts.map +1 -1
  662. package/dist/story/change-gated.js +13 -7
  663. package/dist/story/change-gated.js.map +1 -1
  664. package/dist/version.d.ts +1 -1
  665. package/dist/version.js +1 -1
  666. package/dist/worker/format-resume.d.ts.map +1 -1
  667. package/dist/worker/format-resume.js +5 -0
  668. package/dist/worker/format-resume.js.map +1 -1
  669. package/dist/worker/format-workers.js +5 -0
  670. package/dist/worker/format-workers.js.map +1 -1
  671. package/dist/worker/open-worker-scope.d.ts.map +1 -1
  672. package/dist/worker/open-worker-scope.js +2 -3
  673. package/dist/worker/open-worker-scope.js.map +1 -1
  674. package/dist/worker/progress-of.d.ts +8 -3
  675. package/dist/worker/progress-of.d.ts.map +1 -1
  676. package/dist/worker/progress-of.js +2 -16
  677. package/dist/worker/progress-of.js.map +1 -1
  678. package/dist/worker/read-agent-record.d.ts.map +1 -1
  679. package/dist/worker/read-agent-record.js +15 -3
  680. package/dist/worker/read-agent-record.js.map +1 -1
  681. package/dist/worker/read-workers.js +2 -2
  682. package/dist/worker/read-workers.js.map +1 -1
  683. package/dist/worker/readable-progress.d.ts +5 -0
  684. package/dist/worker/readable-progress.d.ts.map +1 -0
  685. package/dist/worker/readable-progress.js +16 -0
  686. package/dist/worker/readable-progress.js.map +1 -0
  687. package/dist/worker/resume-worker.d.ts.map +1 -1
  688. package/dist/worker/resume-worker.js +4 -5
  689. package/dist/worker/resume-worker.js.map +1 -1
  690. package/dist/worker/worker-progress.d.ts +2 -1
  691. package/dist/worker/worker-progress.d.ts.map +1 -1
  692. package/dist/workspace/real-path-of.d.ts +2 -2
  693. package/dist/workspace/real-path-of.d.ts.map +1 -1
  694. package/dist/workspace/real-path-of.js +15 -10
  695. package/dist/workspace/real-path-of.js.map +1 -1
  696. package/dist/workspace/write-inside-project.d.ts +8 -0
  697. package/dist/workspace/write-inside-project.d.ts.map +1 -0
  698. package/dist/workspace/write-inside-project.js +17 -0
  699. package/dist/workspace/write-inside-project.js.map +1 -0
  700. package/package.json +5 -5
  701. package/templates/aggregate/event-sourced.events.mapper.ts.tpl +5 -1
  702. package/templates/command/handler.declared.ts.tpl +4 -12
  703. package/templates/command/handler.ts.tpl +4 -12
  704. package/templates/docs/privacy-register.md.tpl +2 -0
  705. package/templates/e2e/e2e.spec.ts.tpl +2 -2
  706. package/templates/init/README.md.tpl +42 -9
  707. package/templates/init/docker/docker-compose.yml.tpl +5 -2
  708. package/templates/init/docker/dockerignore.tpl +1 -0
  709. package/templates/init/docker/env.example.tpl +16 -1
  710. package/templates/init/gitignore.tpl +1 -0
  711. package/templates/init/hooks/change-reference.mjs +96 -17
  712. package/templates/init/hooks/production-gate.mjs +65 -11
  713. package/templates/init/jest.config.js.tpl +4 -1
  714. package/templates/init/main.ts.tpl +3 -0
  715. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +25 -8
  716. package/templates/init/platform/audit/create-audit-trail.ts.tpl +59 -0
  717. package/templates/init/platform/audit/create-audit.ts.tpl +13 -52
  718. package/templates/init/platform/auth/authentication/development-header-authenticator.ts.tpl +7 -3
  719. package/templates/init/platform/auth/relationships/relationship-schema.ts.tpl +5 -0
  720. package/templates/init/platform/composition/compose-application.manual.ts.tpl +58 -7
  721. package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +9 -4
  722. package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +1 -1
  723. package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +1 -1
  724. package/templates/init/platform/composition/platform-options.manual.ts.tpl +7 -0
  725. package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
  726. package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +7 -0
  727. package/templates/init/platform/config/app-config.ts.tpl +16 -0
  728. package/templates/init/platform/config/load-config.ts.tpl +46 -0
  729. package/templates/init/platform/database/data-source.typeorm.ts.tpl +6 -0
  730. package/templates/init/platform/database/gitkeep +0 -0
  731. package/templates/init/platform/database/knexfile.js.tpl +10 -3
  732. package/templates/init/platform/database/open-persistence.prisma.ts.tpl +5 -2
  733. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +11 -3
  734. package/templates/init/platform/database/persistence.contract.spec.ts.tpl +14 -3
  735. package/templates/init/platform/database/prisma.config.ts.tpl +6 -0
  736. package/templates/init/platform/database/schema.knex.ts.tpl +4 -3
  737. package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +5 -1
  738. package/templates/init/platform/http/start-http-server.express.ts.tpl +9 -6
  739. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +5 -2
  740. package/templates/init/platform/http/start-http-server.hono.ts.tpl +5 -2
  741. package/templates/init/platform/jobs/create-background-work.ts.tpl +12 -0
  742. package/templates/init/platform/jobs/days-before.ts.tpl +8 -0
  743. package/templates/init/platform/jobs/housekeeping.module.tsyringe.ts.tpl +46 -0
  744. package/templates/init/platform/jobs/housekeeping.ts.tpl +24 -0
  745. package/templates/init/platform/jobs/job-settings.ts.tpl +9 -0
  746. package/templates/init/platform/privacy/personal-events.ts.tpl +11 -0
  747. package/templates/init/platform/privacy/run-erasure.manual.ts.tpl +69 -19
  748. package/templates/init/platform/privacy/run-erasure.tsyringe.ts.tpl +69 -8
  749. package/templates/init/platform/privacy/run-export.manual.ts.tpl +26 -4
  750. package/templates/init/platform/privacy/run-export.tsyringe.ts.tpl +34 -3
  751. package/templates/init/platform/privacy/run-purge.manual.ts.tpl +3 -2
  752. package/templates/init/platform/privacy/run-purge.tsyringe.ts.tpl +4 -2
  753. package/templates/init/rules/infrastructure.md.tpl +1 -1
  754. package/templates/init/scripts/audit-verify.ts.tpl +35 -0
  755. package/templates/init/scripts/privacy-erase.manual.ts.tpl +52 -7
  756. package/templates/init/scripts/privacy-erase.tsyringe.ts.tpl +52 -7
  757. package/templates/init/scripts/privacy-export.manual.ts.tpl +5 -7
  758. package/templates/init/scripts/privacy-export.tsyringe.ts.tpl +5 -7
  759. package/templates/init/scripts/privacy-purge.manual.ts.tpl +4 -0
  760. package/templates/init/scripts/privacy-purge.tsyringe.ts.tpl +4 -0
  761. package/templates/pipeline/github/dependabot.yml +6 -0
  762. package/templates/pipeline/github/workflows/ci.yml.tpl +26 -1
  763. package/templates/pipeline/github/workflows/claude-review.yml +3 -2
  764. package/templates/pipeline/github/workflows/claude-triage.yml +1 -1
  765. package/templates/pipeline/github/workflows/codeql.yml +2 -0
  766. package/templates/pipeline/github/workflows/copilot-setup-steps.yml +2 -0
  767. package/templates/pipeline/github/workflows/intent-to-spec.yml +12 -4
  768. package/templates/pipeline/github/workflows/pr-title.yml +2 -0
  769. package/templates/pipeline/gitlab/claude-review.gitlab-ci.yml.tpl +1 -1
  770. package/templates/pipeline/knip.json.tpl +1 -4
  771. package/templates/pipeline/package-scripts.json +2 -2
  772. package/templates/pipeline/renovate.json +11 -0
  773. package/templates/pipeline/stryker.config.mjs.tpl +4 -0
  774. package/templates/pipeline/vitest.config.ts.tpl +3 -2
  775. package/templates/presets/identity/context/__context__.codes.named.ts.tpl +1 -0
  776. package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +1 -1
  777. package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +28 -1
  778. package/templates/presets/identity/context/domain/aggregates/invitation.aggregate.ts.tpl +13 -1
  779. package/templates/presets/identity/context/domain/aggregates/member.aggregate.ts.tpl +6 -1
  780. package/templates/presets/identity/context/domain/errors/invitation-withdrawn.error.named.ts.tpl +13 -0
  781. package/templates/presets/identity/context/domain/errors/invitation.error.factories.ts.tpl +8 -0
  782. package/templates/presets/identity/context/domain/services/role-rights.service.ts.tpl +23 -1
  783. package/templates/presets/identity/context/infrastructure/persistence/__context__.schema.drizzle.ts.tpl +1 -0
  784. package/templates/presets/identity/context/infrastructure/persistence/create-__context__-tables.schema.knex.ts.tpl +1 -0
  785. package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +6 -2
  786. package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +6 -2
  787. package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +6 -2
  788. package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +6 -2
  789. package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +6 -2
  790. package/templates/presets/identity/context/infrastructure/persistence/invitation-row.schema.knex.ts.tpl +1 -0
  791. package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.drizzle.ts.tpl +2 -0
  792. package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.knex.ts.tpl +2 -0
  793. package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.prisma.ts.tpl +2 -0
  794. package/templates/presets/identity/context/infrastructure/persistence/prisma-account.repository.prisma.ts.tpl +8 -5
  795. package/templates/presets/identity/context/infrastructure/persistence/prisma-delegation.repository.prisma.ts.tpl +8 -5
  796. package/templates/presets/identity/context/infrastructure/persistence/prisma-invitation.repository.prisma.ts.tpl +8 -5
  797. package/templates/presets/identity/context/infrastructure/persistence/prisma-member.repository.prisma.ts.tpl +8 -5
  798. package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation.repository.prisma.ts.tpl +8 -5
  799. package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.kit-routes.ts.tpl +1 -0
  800. package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.nest-routes.ts.tpl +1 -0
  801. package/templates/presets/identity/context/test/builders/invitation.builder.ts.tpl +15 -2
  802. package/templates/presets/identity/context/test/integration/invitation.repository.contract.spec.ts.tpl +10 -0
  803. package/templates/presets/identity/context/test/unit/accept-invitation.handler.spec.ts.tpl +114 -4
  804. package/templates/presets/identity/context/test/worlds/__context__.world.explicit.ts.tpl +1 -1
  805. package/templates/presets/identity/design.md.tpl +3 -1
  806. package/templates/presets/identity/prisma/models.prisma.tpl +1 -0
  807. package/templates/query/reader.fake.ts.tpl +4 -6
  808. package/templates/query/reader.in-memory.ts.tpl +1 -1
  809. package/templates/repository/drizzle/repository.ts.tpl +4 -3
  810. package/templates/repository/knex/table.tpl +1 -1
  811. package/templates/repository/prisma/repository.ts.tpl +24 -18
  812. package/templates/state-machine/state-machine.spec.ts.tpl +5 -0
  813. package/templates/worker/main.ts.tpl +3 -0
  814. package/templates/init/platform/database/migration.knex.js.tpl +0 -8
package/CHANGELOG.md CHANGED
@@ -4,6 +4,326 @@ What each version changes for someone who uses the kit. The packages of `package
4
4
  together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
5
5
  list the pull requests behind it.
6
6
 
7
+ ## 0.103.0
8
+
9
+ **A `merge-trunk` stopped half way can be continued with `merge-trunk --continue`.** The state of the merge is written as soon as the merge starts and after each step, not only at the first stop for a person, so a merge killed on the automatic path no longer needs a plain `git commit`, which skips the steps merge-trunk runs (regenerate, the migrations replay). A merge in progress that holds no state is now refused with `npx ddd-ts-kit merge-trunk --abort` named first.
10
+
11
+ **`merge-trunk` and `verify-merge` say when a shallow clone is why they cannot compare two sides.** Where the clone holds no commit shared by the branch and the trunk, `merge-trunk` no longer blames git (`could not lookup commit ''`) and `verify-merge --since` no longer answers nothing at exit 0: both refuse with exit 2, name the shallow clone and give `git fetch --unshallow` (or a deeper `--depth`) as the fix.
12
+
13
+ **Two `generate` or two `drizzle-generate` started at once no longer lose each other's work.** Every `generate` that is not a dry run now holds the lock of the project, not only the kinds that write outside their context: two `generate entity --term` at once used to leave glossary rows out of `CONTEXT.md` at exit 0. `drizzle-generate` holds it too, so two of them no longer leave a migration out of the journal. A second command waits up to five seconds, then exits 2 naming the command that holds the lock.
14
+
15
+ **The end-to-end sweeps over every stack remove each project once its case has ended.** A case of `first-minute-*` kept its project, with a copy of every package of the kit, until the whole file had run, so the disk of a runner grew with the number of stacks and the shard ended on `ENOSPC`. This changes the tests of the kit only.
16
+
17
+ **`drizzle-generate` and `typeorm-generate` say before they run that the migration will drop the tables of a context the schema index no longer lists.** The warning gives the tables and the fix, and the exit code does not change. It reads what the tables files of the context export, under whatever file name, and a comment in the index lists nothing; a table removed from those files on purpose is not concerned.
18
+
19
+ **`generate worker` and `generate service` leave what `init` writes for a project with a worker or a service.** `.env.example` says that `RUN_JOBS` defaults to false, a service joins the compose file with one blank line before `volumes:`, and the entry of `apps/` comes last in `knip.json`, where the generators add it.
20
+
21
+ **`init --force` keeps what the generators wired: at the same version `git diff` is empty.** It rewrote the files `init` owns from templates whose regions are empty, so the tables of a context left the schema index (on Drizzle the next `db:generate` wrote `DROP TABLE`), its events the audit trail, and the grants, the job settings, the values of the gateways and the policies went with them. Each rewritten file now takes the template of the new version with what its `ddd-ts-kit:*` regions held; the grants of `roles.ts`, the role vocabulary, the schemas and preview features of the Prisma datasource and the services of `docker-compose.yml` stay too, with the imports they name. The tables and the audited events a region does not hold, as after an earlier `--force`, are listed again from the tree, what a preset changed in the authorizer and the authenticator is applied again, and the journal of drizzle-kit is no longer emptied. What it cannot keep is named in a note, file by file, with the command that writes it again, and the note says that nothing is lost only when that is so: a region the new version no longer holds, a marker without its partner, a `roles` object it cannot read to its end, left out whole, and the repositories left on the ORM a flag changed. A flag that changes the ORM or the wiring leaves out the lines of the old stack. A file with Windows line ends is written with the line ends of the template, and a `roles.ts` of an older template gets its `system-grants` region back.
22
+
23
+ **`generate e2e` writes `tenantId: 'acme'` in the actors of its spec where the project has a tenancy.** Under `--tenancy shared-table` the spec was red from the start (a 500, `NoCurrentTenantError` raised by the tenant-scoped repository); it now passes until a business decision changes it, as it does without tenancy. A context declared the control plane keeps the actors without a tenant.
24
+
25
+ **`generate query` writes a fake that extends the in-memory reader, so the handler spec runs the `read` it generated.** The coverage gate of the infrastructure layer no longer fails right after a plain query: before, the fake implemented the port and nothing ran the adapter, as only `--search` had it run. The adapter keeps its canned `answer` as a protected field, the fake sets it.
26
+
27
+ **The generated README and `docker-compose.yml` give the command that starts a compose profile: `docker compose --profile observability up -d --wait`.** They said `pnpm run infra:up --profile observability`, which fails with "unknown flag: --profile" because the flag goes before `up`. The same for the `identity` and `errors` profiles.
28
+
29
+ **The generated Vitest config keeps the reporters Vitest picks itself, and the Jest config asks for `summary` under a coding agent.** The explicit `reporters: ['default', ...]` replaced the terse reporter Vitest chooses when `AI_AGENT` or `CLAUDECODE` is set; the budget reporter is now added after `configDefaults.reporters`. A person sees no change.
30
+
31
+ To move: in `vitest.config.ts` write `reporters: [...configDefaults.reporters, '@ddd-ts-kit/testing/budget/vitest']` and import `configDefaults` from `vitest/config`; in `jest.config.js` use `'summary'` in place of `'default'` when `process.env.AI_AGENT` is set.
32
+
33
+ **A new project gives `vitest` and `@vitest/coverage-v8` the same range (`^5.0.3`).** Every test run printed "Running mixed versions is not supported" because the coverage package was pinned exactly while `vitest` resolved to a later patch.
34
+
35
+ To move: in a project already created, write `"@vitest/coverage-v8": "^5.0.3"` in `package.json` and install again.
36
+
37
+ **`db:migrate` finds `DATABASE_URL` in `.env` on the four ORM.** The README copies `.env.example` to `.env` and runs `db:migrate`, but the CLI of knex, Prisma and TypeORM reads no `.env`: only drizzle-kit reached the database, and the three others failed on the connection unless the shell exported the variable. `knexfile.js`, `prisma.config.ts` and the data source of TypeORM load the file when it exists, and what the shell sets wins.
38
+
39
+ To move: add to the top of `knexfile.js`, `prisma.config.ts` or `src/platform/database/data-source.ts` the lines `if (existsSync('.env')) { process.loadEnvFile('.env'); }`, with `import { existsSync } from 'node:fs';`.
40
+
41
+ **On Knex, `db:generate` writes the migration, and a table generated after the first one reaches the database, existing or fresh.** Knex has no schema diff: `generate repository` added a table to `createTables` only, `db:generate` gave an empty stub, and `migrations/00000000000000_initial.js` called the compiled `createTables` of today, so that a table written by hand in a migration failed on a fresh database with `relation already exists`. A project on Knex now has the steps of the three other ORM: `init` writes no migration, `npm run db:generate initial` writes the first, `npm run db:generate add-invoices` the next, `npm run db:migrate` applies them, and a file holds its SQL and calls nothing of the application. `db:generate` is `npm run build && ddd-ts-kit knex-generate --name`: it compares `createTables` with the migrations replayed, both on PostgreSQL in process, with no server, and writes the new tables, columns and indexes; a column changed or dropped and a table dropped are listed as a `TODO(domain)` of the migration; with nothing different it writes nothing; `--custom` writes the empty migration of knex. `db:migrate` no longer builds. The difference with the three others is in the persistence skill.
42
+
43
+ To move: on a project with no shared database, delete `migrations/00000000000000_initial.js`, set `db:generate` to `npm run build && ddd-ts-kit knex-generate --name` and `db:migrate` to `knex migrate:latest`, add `migrations/.gitkeep`, run `npm run db:generate initial` and migrate again from an empty database. With a deployed database, keep `migrations/00000000000000_initial.js` under its name, since knex refuses a recorded migration that is missing, and replace its `up` by the SQL of the tables that database got from it. To get that SQL, in a copy of the project at that commit, never in the project itself, delete the file, set the two scripts, run `npm run db:generate initial`, and copy the `up` of the migration it writes into the kept file, whose name and `down` stay as they are; knex never runs a recorded file again. Set the two scripts in the project too. Then `npm run db:generate <what-it-does>` writes what the database lacks, and the history replays on a fresh one.
44
+
45
+ **On TypeORM, `db:migrate` builds first, and runs what `db:generate` just wrote.** The data source reads `dist/migrations`, and a migration is written after the build: the README ended on `No migrations are pending` with one table, `migrations`, and `npm run dev` then logged failures of the outbox relay. `db:migrate` is now `npm run build && typeorm migration:run -d ...`.
46
+
47
+ To move: add `npm run build && ` at the start of the `db:migrate` script of `package.json`.
48
+
49
+ **The `TODO(domain)` of a command handler asks only what its flags left open.** A handler generated with `--creates` says to keep `create` and pass the facts of the command as value objects, instead of offering the other option too; the handler that changes an aggregate no longer describes `--creates`.
50
+
51
+ A handler generated by an earlier version is not rewritten when a policy comes later: it gets a `TODO(domain)` marker where it asks, as before.
52
+
53
+ **`generate domain-event` refuses a fact that starts with its aggregate.** `generate domain-event ordering Order "Order Confirmed"` used to write `OrderOrderConfirmed`; it now stops and names the form to use, `Confirmed`. The refusal applies where the event would be created: `generate domain-event`, and `event-handler` or `integration-event` when the event file is absent; a handler for an event that exists is never refused. `--allow-name` lets a name through that is right as typed.
54
+
55
+ To move: a project that already holds a stuttering event renames it by hand; nothing else changes.
56
+
57
+ **`generate aggregate --birth` on an aggregate that already exists no longer writes an event the aggregate does not record.** The aggregate is kept, the birth event and its spec are not written, and a `note:` says that `--birth` applies to a new aggregate: add the event with `generate domain-event`, or replace the aggregate with `--force`. `--event-sourced` is the same: on a kept aggregate nothing event-sourced is written (no mapper, builder or spec), and the note says it applies when the aggregate is created.
58
+
59
+ **`generate context` and `init --context` refuse a name no other kind can write into.** `shared-kernel` (every kind reads it as the shared kernel), the name of a layer or of a folder of a context (`domain`, `test`...) and a technical grouping alone (`shared`, `common`, `core`, `utils`, `platform`...) used to create a context that `generate aggregate` and the other kinds then refused. They are refused up front, with the reason. Only the whole name is judged: `core-banking` or `platform-fees` are accepted.
60
+
61
+ To move: a project that already has a context named by one of these whole names renames it, or keeps it and writes into it by hand.
62
+
63
+ **The glossary refusal of `generate query` and `generate command` lists the missing words of the use case and of its permission together.** `GetOrder --permission order.read` used to refuse `get`, then, one run later, `read`; one message now lists both with their `--term` flags. The permission is named as a permission, and its technical words are judged in the same pass.
64
+
65
+ **`generate policy` and `generate command|query` ask a policy in the use cases of a module of the model too.** A policy that refines the permission of `PayInvoice` made the handler ask it only when the use case sat outside a module; inside one, the handler never called `access.authorize` and `authz/policy-asked` reported it. Both orders now work, with or without `--module`.
66
+
67
+ To move: a handler generated inside a module before a policy existed gets its `access.authorize` call by hand.
68
+
69
+ **`generate query` refuses a name that starts with `List` and names the `Search<Things>` form.** `generate query billing ListInvoices` used to ask for a `List` term in the glossary and, once given, wrote files that `naming/search-not-list` reported. It now stops first: `SearchInvoices`, with `--term "Search=..."` when the glossary lacks the word. The use-case skill says the same.
70
+
71
+ **The fix of `test/spec-required` names `test/unit/<module>/` for a file of a module of the model.** It used to name `test/unit/`, and the spec created there was reported by `module/complete` as a file outside every module.
72
+
73
+ **The `TODO(domain)` of a generated state machine spec names the refusal the style produces.** Under `"stack.refusals": "named"` it no longer sends to an `<Aggregate>Error` class the project does not have, and says to use `generate error <context> <Refusal> <factory>`.
74
+
75
+ **`ddd-ts-kit drizzle-generate`, `prisma-generate` and `typeorm-generate` refuse a project of another ORM before they write anything.** The refusal names the ORM of the project and the script that fits it (`pnpm run db:generate <what-it-does>`, with `ddd-ts-kit <orm>-generate` for Drizzle, Prisma and TypeORM; Knex has no generate command of the kit). Before, `prisma-generate` on a Drizzle project said to run `npm install` and left a `prisma/` folder behind. No project has to act.
76
+
77
+ **`ddd-ts-kit init` run again on a project checks every flag and says which one it did not apply.** The project keeps the stack recorded in its config, as documented, but a flag with a value no choice accepts (`--http nope`) is now refused with exit 2, as in an empty directory, and a flag that names another choice than the recorded one (`--http fastify` on an Express project) is said in a note, with the `init --force` command that changes it. No project has to act.
78
+
79
+ **`ddd-ts-kit init` no longer accepts in silence two choices that do nothing.** `--orm none --event-sourcing on` is kept and now says in a note that the events of an event-sourced aggregate, their only record, live in memory and are lost when the process stops. `--allow-no-outbox "<reason>"` on a stack that keeps the outbox (no `--events in-memory`, or no ORM) is refused with exit 2, since no deviation exists to record there and the reason would be lost.
80
+
81
+ To move: drop `--allow-no-outbox` from a command that does not also ask for `--events in-memory` with an ORM.
82
+
83
+ **The fix of a refusal of the CLI is written for the package manager of the project.** `ddd-ts-kit lint` without ESLint on a pnpm project says `pnpm install --frozen-lockfile` instead of `npm ci`, and the generators and the other refusals that said `npm install` or `npm run` say `pnpm install`, `pnpm run`, as the project does. The manager is read from the config, the notes of the formatter and of the locked files go through the same place, and a project with no config keeps npm. No project has to act.
84
+
85
+ **Seven small refusals of the CLI now give a next step that is right and runnable.** `mutation` says its report covers the domain and application layers; `generate route` for a use case that does not exist gives the whole `generate command` line (`--permission` or `--public`); `generate gateway` to a context that already depends on this one is refused as a cycle instead of telling to declare it; `move-to-module` with no module says so; `build-aliases --project` says when the file does not exist; `lint` reports a pattern that matches no file and a formatter ESLint cannot load as a refusal with a fix, not a Node stack; `depcruise-config --check --write` is refused with exit 2 instead of writing the file. No project has to act.
86
+
87
+ **The Claude jobs of the generated pipeline install their agent with npm at a pinned version, and the headless design pass loads the plugin at the tag of the kit version the project uses.** On pnpm, the default, the install of Claude Code no longer asks for a global bin directory the runner does not have, so `intent-to-spec` and the GitLab Claude jobs run. A global `npm install` is no longer translated for pnpm, and `renovate.json` keeps the pinned version of the agent up to date.
88
+
89
+ **The Dependabot file `init` writes waits seven days for a release of each ecosystem, and the Renovate preset pins the digest of every container image.** Security updates are not delayed.
90
+
91
+ To move: add `cooldown: { default-days: 7 }` to each ecosystem of your `.github/dependabot.yml` and `docker:pinDigests` to `extends` of `renovate.json`, or take the new files.
92
+
93
+ **An edit of the composite actions, the pipeline scripts, the GitLab includes, the hooks of the gates, the dependency bots, the Stryker config and `pnpm-workspace.yaml` is asked, with the workflows.** The permissions that `init` writes and the editor hook of the plugin both name them, and the hook also asks about `REVIEW.md`.
94
+
95
+ To move: run `npx ddd-ts-kit init` again to merge the new rules into `.claude/settings.json`.
96
+
97
+ **The generated GitHub workflows keep no token in the checkout, read the base branch of a pull request through the environment, and the two Claude jobs hold no identity token.** `persist-credentials: false` is on every checkout but the one of `intent-to-spec`, which pushes its branch. `claude-review` and `claude-triage` no longer declare `id-token: write`; a project that reaches the model through a cloud provider with an identity token adds it back to the job.
98
+
99
+ To move: run `init --force` to take the new workflows, or add `persist-credentials: false` to your checkouts.
100
+
101
+ **The base branch of a pull request reaches a script of the generated and of the kit's own workflows through the environment, never through the text of the script.** The mutation job of `ci.yml` and `intent-to-spec` read it as `$BASE_REF`.
102
+
103
+ **The production gate reads a release named with a dash, an underscore or a dot.** `deploy-production`, `deploy_production` and `db:migrate-production` are held for approval as `deploy:production` is, and `non-production` and `pre-production` are not read as production.
104
+
105
+ To move: a project that wrote its production gate before keeps the old reading until it takes the new `.claude/hooks/production-gate.mjs` (`init --force` after saving the lists it edited).
106
+
107
+ **The job of the release workflow that publishes to npm installs and builds nothing.** A first job installs, builds and packs each package; the job that holds the publishing identity downloads those tarballs and publishes them.
108
+
109
+ **A path no route serves is answered 404 `NOT_FOUND` as a problem on Express, Fastify and Hono, as on Nest.** Express answered the HTML page `Cannot GET /path`, Fastify `{ message, error, statusCode }` and Hono the text `404 Not Found`, so a client that reads every error of the service as a problem failed on this one. `problemNotFoundHandler` of `@ddd-ts-kit/http/express`, `@ddd-ts-kit/http/fastify` and `@ddd-ts-kit/http/hono` answers it with the identifiers of the request and logs it at `info`, as `ProblemExceptionFilter` now does on Nest (a scanner probes paths by the thousand: no warning per probe), and the generated `start-http-server.ts` installs it.
110
+
111
+ To move: in `src/platform/http/start-http-server.ts`, import `problemNotFoundHandler` beside `problemErrorHandler` and install it with the logger of the application: on Express `app.use(problemNotFoundHandler({ logger: served.logger }))` after the routes and before `problemErrorHandler`, on Fastify `app.setNotFoundHandler(...)`, on Hono `app.notFound(...)`.
112
+
113
+ **A save that takes a value a unique constraint keeps (an email) is refused as `CONFLICT` on the four ORM, not as a lost update or a 500.** The first save of an aggregate ignored any conflict on Drizzle, Prisma and TypeORM, so a new aggregate with a taken email wrote nothing and `optimisticUpdate` raised `ConcurrencyError`, a 409 `CONCURRENCY_CONFLICT` that a client retries for nothing; on Knex the driver error went through as a 500. Now the first save ignores a conflict on the id alone (`onConflictDoNothing({ target: primaryKeyOf(table) })` on Drizzle, the primary key as the table declares it, `insertIgnoringConflict` of `@ddd-ts-kit/typeorm` on the primary key, as on Knex), Prisma, whose `skipDuplicates` names no target, tells a taken id from another value with `rowsCreated` of `@ddd-ts-kit/prisma`, and `optimisticUpdate` raises the new `UniqueViolationError` of the kernel, a `ConflictError` (code `CONFLICT`, 409) whose `cause` is the error of the driver (`23505`, `ER_DUP_ENTRY`, `SQLITE_CONSTRAINT_UNIQUE`, `SQLITE_CONSTRAINT_PRIMARYKEY`, a raw `SQLITE_CONSTRAINT` of libsql that names a unique key, `P2002`), on an insert and on an update alike. `repositoryContract` of `@ddd-ts-kit/testing` takes `createAggregateTaking` to prove it on an adapter over a table with a unique column. On MySQL, whose `INSERT IGNORE` names no conflict target, `insertIgnoringConflict` of Knex and of TypeORM asks whether a row holds the key when nothing was written, as `rowsCreated` does.
114
+
115
+ To move: a client that retried the 409 `CONCURRENCY_CONFLICT` of a taken value now gets a 409 `CONFLICT`; a handler that has its own refusal for it catches `UniqueViolationError`. A generated repository changes its first save: on Drizzle `.onConflictDoNothing({ target: primaryKeyOf(<table>) })`, `primaryKeyOf` imported from `@ddd-ts-kit/drizzle/postgres`; on Prisma `insert` answers `rowsCreated(created, { id, holders: () => <table>.count({ where: { id } }) })` (with `...tenantWhere(this.scope)` on a tenant table); Knex and TypeORM need no change. `insertIgnoringConflict` of `@ddd-ts-kit/typeorm` ignores a conflict on the primary key only: a call that relied on it to skip a row for another unique constraint writes that statement with `.orIgnore()`.
116
+
117
+ **A project generated on Prisma sets how long a unit of work waits for its transaction and how long it may run, and answers 503 beyond, not 500.** The generated `persistence-over.ts` passed no options to `createPrismaUnitOfWork`, so Prisma gave up a transaction after 2 seconds of waiting for a connection or 5 seconds of work: a burst of 400 commands on a pool of 10 lost half of them, and every one was a 500. The generated config now reads `DATABASE_TRANSACTION_WAIT_MS` and `DATABASE_TRANSACTION_TIMEOUT_MS` (10 and 30 seconds by default: not more, since a caller gives up near 30 seconds, and a connection held for an answer nobody reads sheds no load) and hands them over as `maxWait` and `timeout`. A transaction Prisma could not start or ended (`P2028`, `P2024`), or a connection the pool of Knex did not give in time (`KnexTimeoutError`), rejects the unit of work with the new `TransactionTimeoutError` of the kernel, code `SERVICE_UNAVAILABLE`, which the default error mapping of `@ddd-ts-kit/http` answers 503. It is a fault of the infrastructure, not a business refusal: `retry` tries again, a circuit breaker counts it, the error reporting sees it, and the problem says nothing of the driver. Drizzle and TypeORM wait for a connection of their pool and bound no transaction in time: they need no such setting.
118
+
119
+ To move: a project on Prisma adds `readonly databaseTransaction: { readonly waitMs: number; readonly timeoutMs: number }` to `AppConfig`, reads it in `load-config.ts` (`env.integer('DATABASE_TRANSACTION_WAIT_MS', { fallback: 10_000, min: 1, max: 3_600_000 })`, and `DATABASE_TRANSACTION_TIMEOUT_MS` with `fallback: 30_000`), passes `config.databaseTransaction` from `openPersistence` to `persistenceOver(client, transaction)`, and there to `createPrismaUnitOfWork(client, { maxWait: transaction.waitMs, timeout: transaction.timeoutMs })`; `ddd-ts-kit init --force` rewrites these files while git holds them.
120
+
121
+ **A project generated on Express fails at start when its port cannot be bound.** Express 5 hands the error of `listen` to its callback, which the generated `start-http-server.ts` ignored: on a port already in use the process logged `listening` on port 0, served nothing and stayed up until its signal. The start now rejects with the error of `listen` (`EADDRINUSE`), as on Fastify, Hono and Nest, and the process exits before it logs `listening`.
122
+
123
+ To move: in `src/platform/http/start-http-server.ts`, `listen` takes `(resolve, reject)` and calls `app.listen(port, (error) => (error === undefined ? resolve(server) : reject(error)))`.
124
+
125
+ **`assertTopology` of `@ddd-ts-kit/kafka` fails with `BROKER_UNAVAILABLE` when the cluster cannot be reached, even with no topic to create.** It reached the cluster only to create a missing topic, so a service that subscribed to nothing yet, or whose topics all existed, or that may not create topics, started and logged `listening` with no broker. It now asks the cluster for its topics first, as the NATS, RabbitMQ and Redis buses reach their server, and gives up after `connectTimeoutMs` (10 seconds by default): a generated service with `--broker kafka` fails at startup, never at its first record.
126
+
127
+ To move: a start without a reachable cluster, which used to pass, now rejects with `BROKER_UNAVAILABLE` after `connectTimeoutMs`: start Kafka before the service (or a test that starts it), or point `KAFKA_BROKERS` at a cluster that answers.
128
+
129
+ **Every file the guard reads is a regular file read within its bound.** The config, the plan, a scope file, the state of a worker, a file counted for the size of a commit and a file compared after a worker's command are read through one descriptor that never waits and never past their limit: a link to a device or a FIFO is read as no text at once, and a file of state or a plan larger than 16 MiB is not read.
130
+
131
+ **A folder another user may write holds no project for the guard.** The guard looks for the config of a project and for the top of its repository up to a folder owned by neither the user nor the system, or writable by others, the shared temp directory above all: a config, a `.git` or a CLI planted there is never read nor run.
132
+
133
+ **A project under the temp directory keeps the rules of its shell.** The temp directory is a free place for a redirection outside every project only: in a project cloned or checked out there, a redirection, `sed -i` or `tee` is judged as anywhere else.
134
+
135
+ **What the guard counts as a reader runs no program, and a sub-agent gives git no setting that runs one.** A program named like a reader but by its path, git given a setting for the command (`-c`, `--config-env`, a variable before it) or an option that hands the files to a program (`grep -O`, `--ext-diff`), and inline code whose arguments name the kit are no longer pure readers: the state outside a worker's scope is noted before them. The kit is launched by the program word, or by the first operand of `node` or of a package runner, never by a word among the arguments of another program. To a sub-agent, the git settings that run a program now include `diff.external`, the textconv and merge drivers, `include.path` and `includeIf`, the credential helpers, `core.attributesFile`, `core.gitProxy`, `core.askPass`, `sequence.editor`, `interactive.diffFilter`, `pager.*`, `mergetool.*`, `difftool.*`, every `gpg` program and `protocol.*`, given by `-c` or `--config-env`; and the variables `GIT_EXTERNAL_DIFF`, `GIT_PAGER`, `GIT_EDITOR`, `GIT_SEQUENCE_EDITOR`, `GIT_SSH*`, `GIT_ASKPASS`, `GIT_PROXY_COMMAND`, `GIT_EXEC_PATH` and `GIT_CONFIG*`, set for a command or exported, are refused to it.
136
+
137
+ **A file a worker writes is judged where it lands.** A link of its scope, or a folder of the path that is one, is the place it reaches, a link that points nowhere yet included; a link of the temp directory into a project is that place; and a file of its scope that has another name elsewhere (a hard link) is refused, by the editor tools and by the shell.
138
+
139
+ **A worker's git keeps to its own branch.** The branch is the one `.ddd-ts-kit/worker.json` records (`branch`), else the one its worktree has checked out. In its worktree a worker pushes that branch alone: `git push`, `git push -u origin <branch>`, `git push origin <branch>` and `HEAD:<branch>` stay free, while a push to another branch, a deletion (`:<ref>`, `--delete`, `-d`), `--force`, `-f`, `--force-with-lease`, a `+` refspec, `--all`, `--tags` and `--mirror` are refused. A `git fetch` into a ref (`src:dst`) is refused from any checkout, and so are a new tag, and a `checkout` or `switch` to another branch, a new one (`-b`, `-c`, `--orphan`) or none (`--detach`). Checking out files (`git checkout -- <path>`, `git checkout <ref> <path>`, `--ours`, `--theirs`, `--patch`) is unchanged.
140
+
141
+ To move: a worker that pushed elsewhere, tagged or changed branch reports it to the conductor, who lands its branch.
142
+
143
+ **A worker sets no variable that moves where the shell or git find their places, and a `cd` that CDPATH sends elsewhere is uncertain.** `TMPDIR`, `CDPATH`, `HOME`, `GIT_DIR`, `GIT_WORK_TREE` and `PATH`, set for a command, on their own or exported, are refused to a worker: the guard reads the places of a command by their values when the session started. A relative `cd` that a folder of `CDPATH` holds lands where only the shell knows, so what follows it is judged as a place only the shell knows.
144
+
145
+ To move: a worker that set one of these variables in a command runs it without, from its worktree.
146
+
147
+ **A worker only reads outside its worktree, whatever the program and wherever its session stands.** From the checkout of the conductor, a builder's command that is not made of readers (`cat`, `ls`, `grep`, git that reads, `git add` and `git commit` in its own worktree, the kit asked to list, describe, report or read a briefing, and its checks that write nothing: `check` without `--baseline`, `lint` without `--fix`, `rules`, `docs --check` without `--stored-events`, `verify-merge`, `cited`, `affected` without `--run`) is refused with the instruction to run it as `cd <worktree> && ...`: `sort -o`, `mkdir`, `chmod`, `git -C <worktree> merge`, `reset`, `rebase` and `pull` included. A session opened above the project holds its worker to the project its command names, and a builder whose session stands in its worktree stays pinned to it when a command starts in another project.
148
+
149
+ To move: a worker that ran a writing command from the checkout of the conductor with `git -C <worktree>` or a path under its worktree runs it as `cd <worktree> && ...`.
150
+
151
+ **Every Codex patch of a command line is judged, and one the command does not hold is refused.** Each `*** Begin Patch` of a line run through the shell, in a here-document or an argument, is judged as the editor tools judge a write; `apply_patch` fed from a file or a pipe is refused, with the here-document to use. A file a patch deletes, or leaves by a move, is held as `rm` holds it: the baseline is refused, and so is a file outside the scope of a worker.
152
+
153
+ To move: a Codex session that applied a patch from a file passes it as a here-document.
154
+
155
+ **The guard's own git runs no program a repository plants.** The git the runs of a builder start reads no `core.fsmonitor` of the config, as the git of the guard already did, and neither runs a hook planted in the repository: both run with no hooks and `--no-optional-locks`, so that a `git status` of the guard writes no index.
156
+
157
+ **The hooks of the project and the steps of the conductor are read on the words of a command, as the shell gives them.** A quote inside a word (`g''it`, `--to-la'nd'`) no longer hides a git command that skips the hooks, nor a landing, a lock or the place of a worker asked by a sub-agent. A git command that skips the hooks now also covers `core.hooksPath` set by `--config-env` with a space or by `GIT_CONFIG_*` in the environment, `LEFTHOOK_EXCLUDE` and `LEFTHOOK_SKIP`, `git am`, `cherry-pick` and `revert --no-verify`, and `git commit-tree`. Taking one side of a merge is refused to a sub-agent in `rebase`, `cherry-pick` and `revert` too, and in every spelling of `-X` and `--strategy-option`.
158
+
159
+ **The lock of an acceptance and its verdicts are held however a command reaches them, and the judge runs the kit only to read.** A folder that holds them (`test/acceptance`, `test`) counts as them, and so does a place only the shell knows on a line that names the acceptance (`cd test/acceptance; cp ...`); `git log`, `show` and `diff --output` write the file they name, `rg --pre` and a git given a setting run a program, and `git commit -a` is no read. The acceptance judge reads git without adding or committing, and runs the kit only to read (`acceptance` without `--lock`, `list`, `describe`, `explain`, `status`, `story`, `stories`, `story-check`).
160
+
161
+ **The mode of the guard is pinned with the scope of a worker, and a branch it merges back is its own work.** A config of the worktree that turns the guard off, or grows past what the guard reads, after a worker's first call no longer lifts that worker: its change is compared as any other change outside the scope, and stops the worker until it is put back. What a merge brings into a worker's branch is left out of the comparison only when the trunk holds it; a branch of the worker merged back is compared as its commits are. The guide states that the state the guard keeps between two calls lies in the project.
162
+
163
+ **The reviewer, the explorer and the verifier of the plugin change no file of a project by the shell.** A redirection, a writer or a git command that changes the work tree (`checkout`, `switch`, `stash`, `reset`...) is refused to `architecture-reviewer`, `domain-explorer` and `story-verifier`; they read a branch with `git show` and `git diff`, may stage with `git add`, run tests, and write to the temp directory.
164
+
165
+ **The guard walks no glob outside the project and reads at most 32 wrappers before a program.** A pattern a command writes that starts outside the project (`/**/.cache`) stays as written instead of being walked from the root of the disk, and a command with more than 32 wrappers and assignments before its program names a program only the shell knows, refused to a worker: every answer stays within the time of the hook.
166
+
167
+ **The record of the trial of `dependenciesBeforeWrite` follows no link, and a sanctioned script run in another folder is no tool of the project.** `.git/ddd-ts-kit/before-write.jsonl` is appended through no link put under its name. A `format`, `lint:fix` or `regenerate` script run with `--prefix`, `-C`, `--dir`, `--filter` or `--workspace` runs another folder's script: what it changes outside a worker's scope is held, as any other code's, rather than said.
168
+
169
+ **The scope file of a story or of a worker is the conductor's.** `.ddd-ts-kit/story.json` and `.ddd-ts-kit/worker.json`, and the `.ddd-ts-kit` folder that holds them, are refused to every change, by the editor tools and by the shell (a removal of a folder above them included: `rm -r`, a `find -delete` or `-exec rm` whose `-name` tests can find them, `git clean -x` or `-X`, `git stash --all`, and `git clean -d` or `git stash --include-untracked` when git does not ignore them), to the session that stands in the worktree that holds them and to every sub-agent: removing the scope file of a story no longer opens its build gate. The conductor writes them from its checkout, with `story-scope` and `worker-scope`.
170
+
171
+ **The documentation of the guard says that its stop checks a tree with uncommitted changes.** The `Stop` hook refuses to finish while architecture errors remain in a tree with uncommitted changes; a clean tree is left to the pre-commit hook and the pipeline, as it always was. The description of the hooks, the guide of the coding agents and the guide of commit discipline now say so.
172
+
173
+ **The stop of a worker reads its branch since its base.** At the stop of a context builder, the guard compares with its scope what its branch holds since the `baseCommit` of its scope file: the files its commits changed since then, what a merge of the trunk brought in left out, and the files left uncommitted. A file outside the scope keeps the worker going once to take it out of its branch, and what stays reaches the conductor with the stop. A scope file that records no base leaves the commits uncompared: the guard fails open there.
174
+
175
+ **A contract title that holds `*/` stays inside the comment of the generated client.** The title and the version were written into the comment of `Client` as they came; they now go through the same escape as the summaries and descriptions of the operations, and a title on several lines is a multi-line comment.
176
+
177
+ **A handler that answers a success with no question on its permission allowed is refused, at run time and by `authz/policy-asked`.** When a policy refines the permission of a use case, the authorization module now refuses a handler that answers with a success (an `ok` Result, or a value that is no Result) when no question on that permission was allowed (every answer denied or failed), with `PolicyDenialIgnoredError` (exported by `@ddd-ts-kit/auth`), inside the unit of work, so that its change is rolled back. A handler that stops on the denial with a failed Result (`err(...)`) or a throw answers its own refusal, unchanged; a handler that skips the elements it was denied and applies those it was allowed on passes, whatever the order of the answers. `authz/policy-asked` reports a `decide` or `decideOn` on that permission written as a statement of its own, its decision dropped, with a fix that names `authorize`.
178
+
179
+ To move: a handler that answers a success with no question allowed, after `access.decide(...)`, calls `access.authorize(...)`, which refuses a denial, or keeps the decision and stops when `decision.allowed` is false, with a failed Result or a throw.
180
+
181
+ **With the identity preset and tenants, a request names the organisation it works in.** The preset gives the HTTP boundary of the project (`http-boundary.ts`) `resolveTenant: firstTenantOf(tenantFromHeader(), tenantFromClaim())`: a person of several organisations names one with `x-tenant-id` on each request to the data of a tenant, a person of one works in it as before, and a header naming an organisation the person does not belong to is refused with 403 at the edge. A boundary that resolves its tenant already is left alone; one the team rewrote gets a step saying what to add. The header is read on every route, so a client sends none for an organisation the person is not a member of yet: the routes of the identity context that come before a membership (provisioning the account, answering an invitation, opening an organisation) are called without it, as [the identity page](docs/tools/identity.md) says, rather than exempted route by route, which the pipeline has no setting for.
182
+
183
+ To move: a project bootstrapped with `--preset identity` and tenants before this version adds `resolveTenant: firstTenantOf(tenantFromHeader(), tenantFromClaim())` to the object `httpBoundary` returns, and `readonly resolveTenant: TenantResolver` to `HttpBoundary`, the three functions and the type imported from `@ddd-ts-kit/http`.
184
+
185
+ **With tenants, the documentation of ReBAC says that a tuple names no tenant, and how to decide per tenant.** A tuple on an element reaches that element alone, its id shared by no other tenant; one on the context of a use case (`context:ordering operator user:olivia`) holds in every tenant the person works in. [Choosing access control](docs/guides/choosing-access-control.md), [Multitenancy](docs/concepts/multitenancy.md) and the schema `init --authz rebac --tenancy ...` writes now say so, and decide what a use case on no element allows tenant by tenant: by roles with the tenant check, or on an object that names the tenant, the relationships kept for the elements.
186
+
187
+ To move: a project with tenants that grants the operator of a context by a tuple, to a person who belongs to several tenants, decides those permissions per tenant instead.
188
+
189
+ **`drizzle-generate`, `prisma-generate` and `typeorm-generate` say so when the migration that creates the audit trail lacks the append-only guard.** A run stopped after the tool of the ORM wrote its migration and before the guard was added left the audit entries open to UPDATE and DELETE, and the next run found nothing to write. The next run now prints one notice that names the migration and the way to add the guard in a new migration. It never rewrites a migration of an earlier run, which may be applied already and whose checksum the ORM checks; the run that wrote a migration still completes it in the same run.
190
+
191
+ **An archive row that no file proves is the break of its chain.** The guard of the trail lets through the `DELETE` of an entry a row of `audit_archives` covers, so a role that may both insert such a row and delete entries can let entries go behind a row of its own. `verifyTrail(trail, { files })` now reads back the file of every archive of each chain, oldest first, and proves it with `verifyArchive` against the one before it, before it verifies the entries left from the anchor of the last: a row without its file answers `missing-entry`, a file that does not prove its row `altered-content`, at the first sequence the row names, and a storage that fails to give a file back `unreadable-archive`, a new kind of `ChainBreakKind`, for that chain alone. Whatever the storage, the rows follow each other with no gap and the head goes on from the last one: a head behind it, or at its end with another hash, is a break. `VerifyAuditTrail(trail, files)` passes the storage on; without `files` the archives are not read back, and an anchor is what its row says. A generated project that archives (a trail in a database and a storage of files) gives the storage to the nightly `audit.verify` and to `npm run audit:verify`: the module of tsyringe resolves `FileStorage`, the composition by hand passes `platform.files.storage`, both only when the archive is on. A project with `--storage none` archives nothing and verifies its chains from their genesis. The documentation of the guard says which two privileges open that path, and that they belong to the role that archives.
192
+
193
+ To move: `init --force` rewrites `src/platform/audit/audit.module.ts` (or the composition by hand) and `scripts/audit-verify.ts`. A verification of your own passes `files` to `verifyTrail`.
194
+
195
+ **`known(...attributes)` lets an attribute rule demand the facts it reads, and the guide writes its ABAC preset with it.** `known('amount', 'approvals')`, a condition of `@ddd-ts-kit/auth`, holds when the `ResourceAttributes` port answered every attribute named. An element a projection does not hold yet answers none: the preset of [Choosing access control](docs/guides/choosing-access-control.md) now refuses voiding such an invoice (`forbid(..., not(known('amount', 'approvals')))`), its `permit` on the department requires the attribute, and its comparison with the department of the actor demands that the actor has one, where the rules it showed before let an unknown invoice through.
196
+
197
+ To move: a project whose attribute rules were copied from the guide writes them the same way: each `forbid` that reads an attribute of the resource is joined by one that refuses when the attribute is not `known`, each `permit` that reads one requires it with `allOf(known(...), ...)`, and a comparison with an attribute of the actor checks that the actor has it.
198
+
199
+ **A personal value read as a date or a value object keeps the aggregate readable once its subject is erased.** `StoredEventData` gains `personalText(field)`, `personalInstant(field)` and `personal(field, read)`, which answer `undefined` when the field is absent or its subject was erased, and never hand `ERASED_PERSONAL_DATA` to `read`; `isErased(field)` says whether it was, from what the cipher opens such a value into: `PersonalDataCipher.open` now gives an `ErasedValue`, `{ $erased: { key } }`, in place of the text `[erased]`, so a text that reads `[erased]` is never taken for an erased value; `text` and `texts` read it as `ERASED_PERSONAL_DATA`. `optionalInstant` reads an erased date as absent. A sealed date read with `data.instant`, or an address parsed by a value object in `decode`, used to refuse `[erased]` with an `UnreadableEventError`, so the aggregate no longer loaded after the erasure of its subject.
200
+
201
+ To move: an upcaster that reads a personal value of the raw data finds `{ $erased: { key } }` once its subject is erased. A `decode` that reads a personal value with `data.text`, `data.instant` or a value object reads it with `data.personalText`, `data.personalInstant` or `data.personal(field, ValueObject.of)`, and the field of its event admits `undefined`.
202
+
203
+ **An invitation of the identity preset holds while its issuer may still invite in its role.** `AcceptInvitationHandler` reads where the account that issued the invitation stands when the invitation is answered: removed from the organisation, deactivated, demoted below the role of the invitation, or, for an invitation issued under a delegation, that delegation ended or revoked (another one lending the right does not count), its pending invitations are withdrawn and let nobody in (`INVITATION_WITHDRAWN`, a new refusal of the context, and the term `Withdrawn` of its glossary). `RoleRightsService.mayStillIssue` decides it, from the same table of rights as every other use case of the context. An invitation now keeps the delegation it was issued under (`delegationId`, the column `delegation_id` of `invitations`).
204
+
205
+ To move: a project bootstrapped with `--preset identity` before this version keeps its handler. To hold the same rule, add the nullable column `delegation_id` to the table `invitations` (a migration; existing rows keep `null`, read as issued in a role), keep `delegationId` in `InvitationState` and its mappers, give `AcceptInvitationHandler` the `DelegationRepository`, and before saving the accepted invitation refuse it when `new RoleRightsService().mayStillIssue(invitation, { member, lent, now })` is false, `member` and `lent` read for `invitation.invitedBy` in its organisation (`findOf`, `findUnendedTo`). Once the rule holds, the pending invitations of an issuer already removed, deactivated or demoted are withdrawn at once, and so is an invitation whose issuer has no current membership in the organisation (one written by a seed or a script under an account that is no member): issue those again from a member who may invite.
206
+
207
+ **`doctor` reports a regulated sandbox whose lists no longer hold what the profile writes.** A `sandbox.network.allowedDomains` that lets every host through (`*`), and a `sandbox.credentials.files` or `envVars` that denies other paths or variables than the ones of the profile, were passed because the lists were only checked for being non-empty. Each entry of the profile must now be there; a project may list more.
208
+
209
+ `doctor` also refuses, under the regulated profile, a `permissions.defaultMode` of `bypassPermissions` and an allow rule `Bash(*)` or `Bash`: with either, the sandbox has no gate left.
210
+
211
+ **The state and scope files a command writes are written inside the project only.** `story-scope`, `worker-scope`, `check --baseline write`, `verify-slice` and `merge-trunk` now refuse, with the path named and before anything is written, a file or a folder that is a symbolic link leading out of the project, as `generate` and `docs` already did. Each file is written whole or not at all.
212
+
213
+ **The grants the README of `@ddd-ts-kit/audit` gives run the verification and the archive.** The application role reads `audit_archives`, which the verification of each chain from its last archive needs, and the archive runs as a role of its own, `audit_archiver`, which alone may record an archive and remove the entries it covers: the application can then neither rewrite nor remove an entry. The README of a generated project with its trail in a database says that it runs its migrations and the application with one role, and points to these grants for production.
214
+
215
+ **The audit trail of a generated project is verified every night.** `verifyTrail(trail)` of `@ddd-ts-kit/audit` verifies every chain, each from the anchor of its last archive to its head, so a chain cut at its tail does not verify, and answers the first break of each chain with the number of entries examined; `VerifyAuditTrail` is the scheduled job that runs it and fails with `AuditTrailBrokenError` (`breaks`, code `AUDIT_TRAIL_BROKEN`) on a break. `ArchivableAuditTrail` gains `chainHeads()`, the sequence and the hash of the last entry of every chain, in one order on every store: once in `PostgresAuditTrail`, which the four ORM stores share through their `SqlSession`, and on `InMemoryAuditTrail`. `archivableAuditTrailContract` of `@ddd-ts-kit/audit/testing` holds a store to `chainHeads`, `archiveBefore` and `archivesOf`; the four ORM stores and the one in memory pass it. With the trail in a database, `init` registers the platform job `audit.verify` every night at 04:30 UTC, in the three families of dependency injection, switched off with `JOB_AUDIT_VERIFY_ENABLED=false`, and writes `scripts/audit-verify.ts`, run by `npm run audit:verify`, exit code 1 on a break. A trail kept in the memory of the process (`audit: on` without an ORM) gets neither, and the README of the project says so. The factory of the store moves to `src/platform/audit/create-audit-trail.ts`, which the script shares with the platform.
216
+
217
+ To move: `init --force` rewrites `src/platform/audit/create-audit.ts`, writes `create-audit-trail.ts` and `scripts/audit-verify.ts`, and rewrites the composition and `jobs/job-settings.ts`. On tsyringe, `auditModule(audit, { jobs })` takes `jobs` whenever the trail is in a database. A store of your own that implements `ArchivableAuditTrail` adds `chainHeads()` and passes `archivableAuditTrailContract`.
218
+
219
+ **`init --authn none`: the development header is believed where `NODE_ENV` says `development` or `test`, never by default.** `loadConfig` refuses to start a project on the development header when `NODE_ENV` is left out or empty (`NODE_ENV must be development or test`), and `DevelopmentHeaderAuthenticator` is built in `development` and `test` only, where it refused `production` alone. `init` now writes the `.env` a new project starts from, a copy of `.env.example` with `NODE_ENV=development`, so that `npm run dev` runs at once; a `.env` that exists is kept, `--force` included. The Dockerfile sets `production`, the test runners `test`, as before.
220
+
221
+ To move: a project on `--authn none` adds `NODE_ENV=development` to its `.env` (the line of `.env.example`), and every other place it starts from (a script, a service) sets `NODE_ENV`. A project generated before keeps its files; to hold the same rule, add the check after the line that reads `NODE_ENV` in `src/platform/config/load-config.ts` (`if (env.optional('NODE_ENV') === undefined) env.problem(...)`), and refuse in the constructor of `DevelopmentHeaderAuthenticator` every environment but `development` and `test`.
222
+
223
+ **The export of a person holds what the event store keeps of them.** `EventStorePersonalDataExport` of `@ddd-ts-kit/kernel` is the `PersonalDataExport` of the event store: one record per event that holds a value sealed with a key of the subject, under `<name>.<event type>`, naming its `event` (stream, aggregate id, version, instant), each value opened and named by its path in the data of the event (`note`, `contacts[0]`); a value that does not decipher is named in `unreadable` and the export goes on. `PersonalDataRecord` gains the optional `event` and `unreadable`. A stream is named after its aggregate, so it reads the whole store in rounds, in the order of the positions, which a store commits its appends in; given a scope, only the events of the tenant of the work, as an export runs once in each tenant. A value whose key an erasure destroyed answers nothing. `PersonalDataCipher` gains `valuesOf(subject, data)`, the values of one subject opened by their path and those that do not decipher. With `--event-sourcing on`, `runExport` hands it to `exportDataSubject` beside the exports of the contexts, as `platform.event-store`, audited like them when the trail is on, in the three families of dependency injection.
224
+
225
+ To move: `init --force` rewrites `src/platform/privacy/run-export.ts`; a project that keeps its file adds `new EventStorePersonalDataExport({ name: 'platform.event-store', events, keys: subjectKeys, scope })` to its exports.
226
+
227
+ **The hook of this repository on the two registries of asymmetries asks before any shell command that names one, unless every command of its pipeline only reads.** It asked for a short list of ways to write (`sed -i`, a redirection, `mv`); `sed -E -i`, `sed --in-place`, `rm`, `awk -i inplace`, `dd of=`, a `sed` that writes with a `w` flag, `git diff --output=` and a write later in a pipeline went through. The readers (`cat`, `grep`, `git diff`, `git log`, `node --check`, `biome check`, `sed` without a writing flag...) are the list that is spelled out; quoted text is no operator.
228
+
229
+ **The two hooks of the regulated profile wait for an input that arrives late, and `change-reference` watches every `Dockerfile`, `docker-compose*.yml` and `docker/` folder of the checkout and its worktrees.** `production-gate.mjs` no longer lets a command through when its input cannot be read: it refuses it with exit 2 and says so, and `change-reference.mjs` asks. `change-reference.mjs` also answers `MultiEdit`, reads a path from the checkout that holds the file (a worktree of the project, a session started in a subdirectory), and `story-check` reads the same places.
230
+
231
+ To move: the hooks are the team's files once `init` wrote them. Copy the reader and the `GATED` list of `packages/cli/templates/init/hooks/` into yours, and register `change-reference.mjs` on `Edit|Write|MultiEdit` in `.claude/settings.json`.
232
+
233
+ An input that is JSON but no object (`null`, a string, a number) is treated like an unreadable one, and the refusal says which error it was.
234
+
235
+ **`init` denies the `Read` of `.env.staging`, `.env.stage`, `.env.prod`, `.env.preview`, `.env.ci` and `.envrc`, and keeps `.envrc` out of git and out of the image.** They join the five environment files already denied; the example file stays readable. `init` adds the rules to the settings of a project that already has some, and `doctor` reports a missing one.
236
+
237
+ ## 0.102.0
238
+
239
+ **A subscription removed while its consumer was starting no longer leaves a consumer without handler, on RabbitMQ and on NATS.** The consumer stayed registered with nothing to handle a message: each one came back at once, in a loop with no delay, until a handler took it or the bus closed. The consumer now leaves as soon as it is registered, and the messages wait in the queue or the stream for the next handler.
240
+
241
+ **A dangling link at `.ddd-ts-kit/lock` no longer hangs a command that takes the generator lock.** The command waited forever, with no message. It now waits as long as for a lock another command holds, then refuses, says what stands there and writes nothing.
242
+
243
+ **`test:mutation` of a project generated on pnpm runs its mutants.** Stryker looks for its plugins beside its own real path, where pnpm's strict layout keeps `core` alone, so the run died in two seconds on `Cannot find TestRunner plugin "vitest"` (and `"jest"`) before any mutant. The generated `stryker.config.mjs` now names the runner of the stack in `plugins`, `@stryker-mutator/vitest-runner` or `@stryker-mutator/jest-runner`; the ignorer of the kit is still appended by `governedMutation()`. An end-to-end spec installs a project with pnpm (Vitest and Jest) and with npm, and runs `test:mutation` on one aggregate.
244
+
245
+ To move: a project already generated on pnpm adds `plugins: ['@stryker-mutator/vitest-runner']` (or `'@stryker-mutator/jest-runner'`) to its `stryker.config.mjs`.
246
+
247
+ **`runCheck` of the `ddd-ts-kit` package takes a `catalogue` option: the rules it judges with, the rules of the kit unless it is given.** It replaces those rules for the run. The commands do not pass it.
248
+
249
+ **The contracts of `@ddd-ts-kit/testing` hold more of what an adapter answers at the edges.** `outboxStoreContract` takes an empty batch, an empty publication and an empty revival as nothing to do, and expects `markFailed` to leave a published record published and to ignore an unknown id. The job store contract expects `false` for the heartbeat of a job the store does not hold. The event store contract loads a consignment again after a refused append and reads the winner's weight. A project that runs these contracts on an adapter of its own may see a new case fail: the case says what the port promises.
250
+
251
+ `controllerRoutes` of `@ddd-ts-kit/http` types the result of a tuple of one controller as a tuple of one route.
252
+
253
+ **The personal data erasure contract also runs a declaration that names no file column: `personalDataErasureContract` of `@ddd-ts-kit/testing` takes a `createWithoutFiles()` option beside `create()`.** Most tables of a context hold no file: the contract now proves that an adapter given such a declaration needs no file storage and still reaches the rows of the subject as the declaration says (erased with `row`, or their personal columns set to null). The four ORM adapters and the in-memory fake pass it.
254
+
255
+ To move: a project that runs `personalDataErasureContract` on an adapter of its own gives it `createWithoutFiles()`, a fresh subject over an empty table whose declaration names no file column, with no file storage handed to the adapter; it is called before each test, as `create()` is.
256
+
257
+ **`StdoutLogger` takes a `stream` option.** The lines go to that stream instead of the standard output, and `flush()` waits for it. A `write` of the project still receives each line and wins over `stream`.
258
+
259
+ **A form refuses a body property whose name holds a dot, when the routes are built.** A field of a form is named by its path, whose segments a dot separates, so `address.line1` read as a nested field: the form lost its constraints and changed its key.
260
+
261
+ To move: rename the property, or keep it out of the body of the form.
262
+
263
+ **A controller whose schema is written inline no longer crashes `describe`, `docs` and `digest`.** `body: z.object({ amount: z.number(), currency: z.string() })` ended in a raw `SyntaxError`. The schema is now reported whole, over several lines included, and a part that closes the options with no comma after it is read too.
264
+
265
+ **A `ddd-ts-kit.config.json` nested more than 32 levels deep is refused with a message.** The command died on a raw `RangeError` when it tried to print such a value, and `digest` did on any commit that held one.
266
+
267
+ **A stored background job keeps who acts, never the profile a credential gave.** `StoredJobQueue` writes the id, the type, the tenant, the roles and the `tenants` attribute of the actor into `enqueued_by`; the email, the username and every other attribute stay with the request, so a job row holds nothing of the person who asked for it. `actorAttributes` of `StoredJobQueue` names an attribute a run needs.
268
+
269
+ To move: a job that reads `execution.actor.attributes` other than `tenants` receives it in its payload, reads the actor again by its id, or names it in `actorAttributes` (`new StoredJobQueue({ ..., actorAttributes: ['department'] })`, in `create-background-work.ts` or the `jobQueue` option of `kernelModule`). Jobs already waiting keep the attributes they were stored with.
270
+
271
+ **A tenant refusal below the edge answers what it means, on every HTTP adapter and RPC procedure, instead of a 500.** `NoCurrentTenantError`, `InvalidTenantIdError` and `EventStreamTenantError` are now `DomainError`s: a caller who names no tenant is answered 403 `FORBIDDEN`, a credential that names an id outside the grammar 404 `NOT_FOUND`, an append to a stream of another tenant 404 `NOT_FOUND`, with no word of the stream or of the id named. Each is logged as a warning and sent to no error tracker.
272
+
273
+ To move: code that told these errors from a refusal by `instanceof DomainError` now sees a refusal. A scheduled or background job refused this way fails its run with `errorCode` `FORBIDDEN` or `NOT_FOUND` instead of `UNEXPECTED_ERROR`, and is no longer sent to the error tracker: an alert on those runs reads the code.
274
+
275
+ **An erasure reaches what the outbox and the job store keep of the person.** `eraseDataSubject` takes `shared`, the copies no tenant confines, run once. `runErasure` gives it `personalEventsInOutbox(store, personalEvents)` of `@ddd-ts-kit/events`, which erases the fields the `personal` option of an event lists in every record that names the person, pending, published or dead, and `jobsOfSubject(store)` of `@ddd-ts-kit/scheduling`, which drops every job enqueued with the person as `subject`, whatever its status: a waiting job does not run, a running one stops at its next heartbeat. Each writes its entry to the audit trail, and the report names them `platform.outbox` and `platform.background-jobs`. `ddd-ts-kit docs` writes `src/platform/privacy/personal-events.ts` from the `personal` options, and `docs --check` holds it to them. `OutboxStore` gains `erasePersonalFields(subject, events)` and `JobStore` gains `eraseSubject(subject)`, on the four ORM, in memory and on Redis, under their contract suites. A pending record goes out with `[erased]` in place of the field: a consumer whose schema refuses that text refuses the event, and nothing of the person leaves. What stays out of reach is a message already delivered, a field no `personal` option lists, and a job that holds a person without naming them as `subject`.
276
+
277
+ To move: `init --force` rewrites `src/platform/privacy/run-erasure.ts`, then run `ddd-ts-kit docs`. A job about a person is enqueued with `{ subject: personId }`. A store of your own implements `erasePersonalFields` (with `erasedPayloadOf` of `@ddd-ts-kit/events`) or `eraseSubject`, and passes `outboxStoreContract` or `jobStoreContract`. With `--di manual`, `Platform` gains `jobStore`, which `create-background-work.ts` hands on.
278
+
279
+ **An erasure that reached nothing announces nobody.** `runErasure` asks `eraseDataSubject` to refuse a subject no copy knows, so `privacy.data-subject.erased` goes out only once something was erased. `privacy:erase` then prints why and exits with code 1: a mistyped id, a tenant the directory does not list, or an erasure already complete. `--rerun` (`rerun: true` of `runErasure`) says this person was erased before: reaching nothing is expected, the exit code is 0 and the erasure is announced again, which completes one that failed before its announcement.
280
+
281
+ To move: a script that runs `privacy:erase` twice for one person passes `--rerun` the second time. `init --force` rewrites `src/platform/privacy/run-erasure.ts` and `scripts/privacy-erase.ts`.
282
+
283
+ **A chain that does not verify stops its own archive, no other.** `archiveBefore` tries every chain, on the four SQL stores and on `InMemoryAuditTrail`, then throws `AuditArchiveRefusedError` once they all ran, with `refusals` (each with its `chain` and its `chainBreak`) and `archives` (what the other chains archived). A failure of the storage still ends the run where it is.
284
+
285
+ To move: `AuditArchiveRefusedError` holds `refusals` in place of `chain` and `chainBreak`, and its constructor takes them. Code that reads `error.chain` reads `error.refusals`.
286
+
287
+ **A chain cut at its tail does not verify against a later checkpoint.** `verifyChain` used to compare a checkpoint with the entry at its position only, so a checkpoint past the last entry was never read. A chain that stops before the last checkpoint given, inside `to` when there is one, is now reported `missing-entry` at the first position gone. Given entries without `chain`, a chain a checkpoint names and no entry holds is reported too. `auditTrailContract` takes `cut`, which removes the end of a chain behind the back of the trail.
288
+
289
+ `verifyChain` still stops at its first break, by decision: past it the chain proves nothing of what comes next. Whoever has looked at a break walks on with `from`, which the documentation now shows.
290
+
291
+ **An audit entry is hashed as the store keeps it, so a chain nobody touched always verifies, whatever text a record held.** A surrogate without its pair has no UTF-8 encoding and PostgreSQL refuses NUL: the entry used to be hashed with the text as it came and stored with something else, or not stored at all. `seal` now puts U+FFFD in their place in every text of the entry, the keys of `changes` and `extensions` and the name of the chain included, before it hashes, on the four SQL stores and on `InMemoryAuditTrail`. A text in `changes` or `extensions` no longer fails the command, and two tenants whose names differ only there share one chain, without a fork. `wellFormed` gives that form to a store of your own, and `auditTrailContract` holds every store to it.
292
+
293
+ A chain that already holds such an entry stays as it is: the text the entry was hashed over is gone, so `verifyChain` keeps reporting `altered-content` at that entry, and a trail is append-only, so nothing repairs it. That chain is not archived from there on; the other chains are. The entries after it verify with `from` set to the position after the break, which trusts that entry.
294
+
295
+ To move: a store of your own, held to `auditTrailContract`, passes every record through `wellFormed` before it hashes.
296
+
297
+ **`verifyChain(trail, { chain, after })` starts after the anchor it is given, so the verification of a chain that has archives holds.** It used to look for sequence 1 all the same and report a `missing-entry` on a chain that was fine, unless `from` said the position again. `from` now defaults to the position after `after`. The plain `verifyChain(trail, { chain })` keeps answering `missing-entry` at sequence 1 on a chain that has archives: the walk does not read the archives on its own, an anchor being what a row says until `verifyArchive` has proved it, so the caller names the one it trusts.
298
+
299
+ **Every erasure leaves its audit entry with its operator, with or without event sourcing.** `auditedPersonalDataErasure(copy, trail, { scope, clock, ids })` of `@ddd-ts-kit/audit` wraps a `PersonalDataCopy`: each run writes `data-access`, `personal-data:erase`, the subject, the name of the copy as `context` and `changes: { rows }`, `0` included, under the actor of the work. `runErasure` wraps every copy when the trail is on, in the three families of dependency injection, beside `auditedSubjectKeys` for the key.
300
+
301
+ To move: `init --force` rewrites `src/platform/privacy/run-erasure.ts`; a project that keeps its file wraps each copy of `copies` with `auditedPersonalDataErasure`.
302
+
303
+ **A failure whose audit entry could not be written is told to the log.** `logLostRecords(logger)` of `@ddd-ts-kit/audit` is an `onLostRecord` that writes one `audit entry lost` line, at level `error`: the category, the action and the reason of the entry, the type and the code of the failure, never its message. A generated project with the trail on passes it to `auditMiddleware`, `auditedSubjectKeys`, `auditedPersonalDataErasure`, `auditedPersonalDataExport` and `auditedPersonalDataRetention`, and the scripts of `--privacy on` now log errors.
304
+
305
+ To move: a generated project calls `createAudit(persistence, source, logger)`, and its `Audit` gains `onLostRecord`. `init --force` writes them; by hand, pass `logLostRecords(logger)` as `onLostRecord` to the sources above.
306
+
307
+ **`tenancy/scoped-statement` holds that the tenant condition is a conjunct of the statement, on the four ORM, and `tenantTable`, `ownTenantTable` and `whereTenant` hold it when the statement is built.** SQL binds `and` before `or`, so an alternative beside the condition is outside it. On Knex the rule reports `.orWhere*`, `.or`, `clearWhere()` and `clear('where')` on a statement of the helpers, on the chain, on a local, on what a function of the file answers and in a `modify`, and the three helpers throw `UngroupedOrError` or `ClearedTenantConditionError` when such a statement is built, whatever the rule can read; the text of a `whereRaw`, and a `knex.raw` given to a where, is kept in parentheses as one conjunct with its bindings; an `orHaving` applies after the where, and is free; their type does not change. On Drizzle the condition is a direct argument of `where` or of `and`, never under `or`, `not` or a `sql` template, and a local of the condition may now be given to `and`. On Prisma the helper is spread at the top of the `where` or of its `AND`, never under `OR`, `NOT` or a relation. On TypeORM the same, a where array spreads it in each entry, a query builder has no `orWhere` at its top, and the condition stands in its last `where` or an `andWhere` after it, since a `where` resets what comes before it. An `or` in a group and-ed with the condition stays correct: the callback of a Knex `where`, `and(tenantCondition(...), or(a, b))`, an `OR` beside the Prisma spread, `new Brackets(...)` in a TypeORM `andWhere`.
308
+
309
+ To move: where `ddd-ts-kit check` now reports a statement, put the alternatives in a group beside the condition, as `ddd-ts-kit explain tenancy/scoped-statement` shows. On Knex, do the same for a statement that throws `UngroupedOrError`, and start a new statement from the helper where one throws `ClearedTenantConditionError`: the helpers refuse at run time what the rule cannot read, such as a builder handed to another function.
310
+
311
+ **The guard holds a worker and the other sessions wherever a file stands, and says what it could not read.** A builder's editor tools are refused outside its worktree from its first call, in the checkout of the conductor, in another worktree and outside every project but the temp directory, with the instruction to name the file under its worktree. A worker's git only reads from any checkout but its own: the conductor alone lands a branch or moves its checkout, and no worker removes a worktree or writes a ref. The shell rules of the test writer, the story gate, the generated files and the baseline judge a place in the project that owns it; the test writer is refused a place only the shell knows, and its `test/` is the root one or the one of a context; what a redirection, `sed -i` or `tee` types in the code of a context on the trunk, or in a new file of a generated role, is refused as the editor tools refuse it. `check --baseline write` is read on the words of the command, through every launcher of the kit and the package scripts of the project.
312
+
313
+ A folder that holds a locked regression spec counts as the spec, and so does a write whose place only the shell knows; `find -exec` is judged by the folders it starts from, and reads through `find` and `xargs` stay free. What a worker's last command and its background commands change outside its scope is compared: a read keeps the note of the worktree, and at the stop the worker goes on once to put a file back, what stays reaching the conductor in `lastStop.outside` of `agent.json`, in its report, in `status --workers` and in `worker-scope --resume`.
314
+
315
+ A line that ends inside a quote, with a here-document that never closes, or that the reader breaks on is refused to a worker. The reader follows a here-document inside `$(...)`, `$'...'` and `$((...))`. The answers of the processes the guard starts are read up to 64 MiB: a `check` past it lets the session finish and says so, and a `git status` past it compares nothing and says so. A generated file put back or deleted (`git checkout`, `git restore`, `git rm`, `rm`) is no longer refused to a session, and `touch -t` no longer reads its date as a target.
316
+
317
+ To move: a worker that ran `git add`, `git commit` or `git merge` without `cd <worktree> &&`, or after `cd <worktree>;`, runs it as `cd <worktree> && ...`. A session that wrote the code of a context on the trunk by the shell opens a worktree, as the editor tools already asked.
318
+
319
+ **The platform purges what it is done with, every night.** `init` schedules `events.purge-published` at 03:30 UTC with an outbox and `jobs.purge-finished` at 03:45 UTC with a stored queue, both in the whole application: a published record and a job that succeeded or was cancelled keep their payload until then. `OUTBOX_RETENTION_DAYS` and `BACKGROUND_JOBS_RETENTION_DAYS` say how long, thirty days by default, `JOB_EVENTS_PURGE_PUBLISHED_ENABLED=false` and `JOB_JOBS_PURGE_FINISHED_ENABLED=false` switch one off in one environment. A dead event and a dead job stay until an operator decides.
320
+
321
+ To move: `init --force` writes `jobs/housekeeping.ts`, `jobs/days-before.ts`, on tsyringe `jobs/housekeeping.module.ts`, and their wiring. A project that purges by a job of its own removes that job, or gives the platform job its retention. A service of its own database schedules the two purges itself: `platformJobs: false` leaves them to the whole application.
322
+
323
+ **In a multi-tenant project, work that names no tenant is refused before it reads or appends to an event stream, and before it finds or cancels a stored job.** An event store given the execution scope now means a project whose streams belong to tenants: `readStream` and `append` refuse work that names no tenant with `NoCurrentTenantError` before any statement, on a stream that exists or not, so no stream is created in no tenant. A stream of another tenant is refused from whatever version it is read, and `EventSourcedRepository.findById` answers it as an id nobody saved. `readAll` and `head` stay open: a subscription applies each event in its tenant. `StoredJobQueue` takes `tenant: true`, which `kernelModule` sets when it is given `tenants`: `find` and `cancel` then refuse work that names no tenant before the store is read. `init --tenancy shared-table` writes both on the four ORM and every wiring, and the tenant suite of `eventStoreContract` proves the rule on every store. A project without tenancy hands neither and is unchanged. `generate aggregate --event-sourced` refuses a context declared `control-plane`, whose data belongs to no tenant.
324
+
325
+ To move: in a multi-tenant project, a global job that reads streams or finds jobs opens `acrossTenants`, and one that appends runs `per-tenant`. Where the platform is wired by hand or on Nest, add `tenant: true` to the `StoredJobQueue` of `src/platform/jobs/create-background-work.ts`. In `src/platform/database/persistence.contract.spec.ts`, `createStore` and `createCompanions` hand `eventSourcing` a `FixedExecutionScope` that names a tenant. A stream stored in no tenant is refused to everyone: give it its tenant in a migration (`addEventStoreTenantColumn(knex, { schema, tenantOfExistingStreams })` on Knex, an `update` of `tenant_id` otherwise). A project without tenancy that hands `scope` to its event store removes it. A custom `EventStore` held to `eventStoreContract` with `createTenantStore` refuses work that names no tenant, and answers its `createStore` in one tenant. An event-sourced aggregate of a `control-plane` context moves to a table.
326
+
7
327
  ## 0.101.0
8
328
 
9
329
  **A class the kit writes for class-validator refuses an input that lacks one of its fields, and `classSchema` refuses a class that gives a field an initial value.** A field was written with an initial value (`calendarId = ''`, `refundAmount = 0`, `notifyCustomer = false`), which class-transformer keeps for a field the input lacks: a request without `calendarId` passed `@IsString()` as if it carried an empty one, and a consumer read an integration event without it the same way. Each field is now `declare`d with no initial value (`declare calendarId: string;`), and an optional one is `@IsOptional()` with `declare note?: string;`. This covers the body, path parameter, `Accepted` and `Line` classes `generate route` writes (functions, controllers and Nest routes), the body fields it reads from the constructor of the command, the payload of `generate integration-event`, the optional fields of the payload of `generate background-job` (its required ones already were), and the DTOs and payloads of `init --preset identity`. The spec `generate route` writes for a route that reads its body from the command now sends that body without its first field and expects 422 `VALIDATION_FAILED` with an issue at `body.<field>` among the others (a constraint added to the field keeps it green), whatever the validation library. The `TODO(domain)` of an empty class-validator class says to `declare` its fields, and a nested one is marked `@IsDefined()` when it is required, since `@ValidateNested()` lets a missing object through. `privacy/event-payload-declared` reads a `declare`d member of a payload class and a member written with `public`, `private` or `protected`, which it skipped. `classSchema` of `@ddd-ts-kit/validation/class-validator` throws a `DeclarationError` when a fresh instance of the class holds a value (`reason = ''`, `amount = 0`), naming the class, the fields and the fix; a field written `note?: string` holds none and is let through.
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:30c337f1260e6a9d -->
2
+ <!-- translation-of: README.md sha256:68d7243caa5c60a6 -->
3
3
 
4
4
  # ddd-ts-kit
5
5
 
@@ -110,7 +110,7 @@ les notes. La première fois, les notes nomment aussi chaque dépendance que la
110
110
  point d'être écrite contredit, et l'option qui la garde (`package.json depends on fastify, and the
111
111
  project is written for --http express: pass --http fastify to keep it.`), en *dry run* compris :
112
112
  lancez d'abord `init --dry-run` sur un projet existant. Relancé plus tard, `init` garde la
113
- *stack* enregistrée dans la configuration.
113
+ *stack* enregistrée dans la configuration : une valeur de drapeau qu'aucun choix n'accepte est refusée, et un drapeau qui diffère de l'enregistré est gardé tel quel, avec une note qui nomme `init --force`. `drizzle-generate`, `prisma-generate` et `typeorm-generate` refusent un projet d'un autre ORM et nomment son `db:generate`.
114
114
 
115
115
  Chaque fichier qu'écrivent `init` et `generate` reste dans le projet : un chemin qui en sort par
116
116
  un lien symbolique, à sa place ou au-dessus (un `docs/adr` ou un `.claude/settings.json` liés à un
@@ -122,9 +122,8 @@ le répertoire du projet.
122
122
  Chaque fichier est écrit en entier ou pas du tout : dans `<name>.<random>.tmp` à côté de lui, puis
123
123
  renommé à sa place. Une commande arrêtée à mi-chemin ne laisse que des fichiers complets (un
124
124
  processus tué à ce moment peut laisser son fichier `.tmp`, qu'on peut supprimer), et la même
125
- commande relancée écrit ceux qui manquent. `init` sur un projet déjà initialisé, et chaque
126
- `generate` d'un genre qui écrit des fichiers partagés (`writesShared` dans `generate --help
127
- --json`), tiennent le verrou du projet, `.ddd-ts-kit/lock`, que git ignore : une deuxième commande
125
+ commande relancée écrit ceux qui manquent. `init` sur un projet déjà initialisé, chaque
126
+ `generate` qui n'est pas un essai à blanc et `drizzle-generate` tiennent le verrou du projet, `.ddd-ts-kit/lock`, que git ignore : une deuxième commande
128
127
  attend jusqu'à cinq secondes, puis sort avec le code 2 en nommant la commande qui le tient et le
129
128
  correctif, lancer les générateurs l'un après l'autre :
130
129
  ``Another generator holds the lock of this project: `ddd-ts-kit generate context billing` (pid 1234, started 12 seconds ago).``
@@ -612,7 +611,7 @@ export class IssueInvoiceHandler implements CommandHandler<IssueInvoiceCommand>
612
611
 
613
612
  `--events in-memory` avec un ORM est refusé sauf si `--allow-no-outbox "<reason>"` est donné :
614
613
  il enregistre une entrée `deviations` (`stack.events`) et écrit l'enregistrement de décision vers
615
- lequel elle pointe. La persistance générée des quatre ORM est écrite pour PostgreSQL ; `custom`
614
+ lequel elle pointe ; `--allow-no-outbox` est refusé quand la *stack* garde l'*outbox* ou n'a pas d'ORM. La persistance générée des quatre ORM est écrite pour PostgreSQL ; `custom`
616
615
  démarre sur des adaptateurs en mémoire tenus aux suites de contrat, à vous de les remplacer. Les
617
616
  choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `logger` compris.
618
617
 
@@ -632,7 +631,7 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
632
631
  | `--representations negotiated`, `--forms on` | `src/platform/http/presentation-of.ts` (`Representations.standard()` avec `negotiated`, et `fieldDeciderOf` sur l'`Access` de l'application), décomposé dans la frontière HTTP et donné au script du contrat ; avec `--forms on`, `src/platform/http/with-forms.ts` ajoute `formRoutes` aux routes et `scripts/openapi.ts` écrit `openapi/forms/<operationId>.json`. Les deux sont la valeur par défaut avec une *stack* HTTP ; `json` et `off` les laissent de côté ([docs/CONFIG.fr.md](../../docs/CONFIG.fr.md)) |
633
632
  | `--audit on` | `src/platform/audit/` : `create-audit.ts` (le journal, le `onDecision` de l'autorisation, les refus des gardes à la frontière remis à la frontière HTTP comme `onGuardRefusal`, le *middleware* avant l'unité de travail, les événements d'intégration abonnés sous le nom de consommateur `audit`), `audited-events.ts` (le registre auquel `generate integration-event` ajoute), `audit.module.ts`, et avec une *stack* HTTP le côté lecture : `audit.permissions.ts` (`audit:trail.read`), puis dans `search-audit-entries/` : `search-audit-entries.query.ts`, son gestionnaire, `search-audit-entries.route.ts` ou `.controller.ts` (`GET /audit/entries` : pages par curseur, filtres `actorId`, `action`, `outcome`, `correlationId`), qui commence par le point d'entrée et prend ce qu'il reçoit et répond dans `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` et `audit-outcomes.ts`. C'est une capacité de la plateforme, pas un contexte délimité : pas de modèle, une requête protégée sur le port `AuditReader`, bornée par le *tenant* de l'acteur (avec `--tenancy shared-table`, par le *tenant* du travail au moyen de `TenantAuditReader` : le personnel de la plateforme ne lit à travers les *tenants* qu'à l'intérieur de `acrossTenants`). Les refus d'un appelant sans identifiant de connexion ne sont pas enregistrés. Un *job* planifié est audité comme une requête HTTP : origine `schedule`, acteur `system:<context>.<job>`. Avec knex, les deux tables et leurs déclencheurs en ajout seul sont créés par la première migration ; avec drizzle, les tables sont dans `schema.ts` et `npm run db:generate` ajoute les instructions des déclencheurs à la migration qui crée les tables (`npm run db:audit-guard` les affiche pour une migration écrite à la main) ; avec prisma et typeorm, les tables sont des modèles de `prisma/schema/schema.prisma` ou des entités de `schema.ts` (`auditPrismaModels`, `auditEntities` de `@ddd-ts-kit/audit`), écrites par `PrismaAuditTrail` et `TypeOrmAuditTrail`, et `npm run db:generate` (par `ddd-ts-kit prisma-generate` ou `typeorm-generate`) ajoute les instructions des déclencheurs à la migration qui crée les tables, `npm run db:audit-guard` les affichant pour une migration écrite à la main ; les bases de test installent ce garde ; avec `custom` ou sans ORM, le journal est un `InMemoryAuditTrail` derrière un `TODO(platform)`. Les bases de test laissent le schéma d'audit hors de `reset()`. Avec le journal en base et `--storage local` ou `s3`, `audit.module.ts` (ou la composition câblée à la main) enregistre `audit.archive` le premier jour de chaque mois à 04:00 UTC : les entrées de plus de douze mois entiers partent dans le stockage sous `audit-archives/`, vérifiées, relues et ancrées (`ArchiveAuditEntries`) ; avec `s3` il tourne sauf `JOB_AUDIT_ARCHIVE_ENABLED=false`, avec `local` seulement avec `JOB_AUDIT_ARCHIVE_ENABLED=true`, puisque l'archive supprime les entrées de la base et que le disque du serveur peut ne pas durer |
634
633
  | `--event-sourcing on` | enregistré comme `stack.eventSourcing`, `off` sauf demande : `Persistence` gagne `eventSourcing` (`create<Orm>EventSourcing` dans le schéma `event_store`, dont le fichier de schéma déclare les cinq tables ; les stores en mémoire avec `--orm none`), et `src/platform/event-sourcing/` : `create-event-sourcing.ts` (`EventSourcing` : les stores, le `SubjectKeyStore` enveloppé par `auditedSubjectKeys` avec `--audit on`, et le `PersonalDataCipher` par-dessus) et, avec tsyringe, `event-sourcing.module.ts` (lie `EventStore`, `SnapshotStore`, `CheckpointStore`, `SubjectKeyStore` et `PersonalDataCipher`, pour qu'un adaptateur de *repository* *event-sourced* les nomme dans son constructeur ; la `Platform` câblée à la main les porte comme `platform.eventSourcing`) ; `platform-test.module.ts` lie les stores en mémoire, pour qu'une *spec* de gestionnaire d'un agrégat *event-sourced* n'ait besoin d'aucun *fake*. `generate aggregate --event-sourced` est refusé sans lui, avec le `init --force --event-sourcing on` à lancer. Refusé avec `--orm custom` : l'event store du kit tourne sur PostgreSQL par les quatre paquets d'ORM |
635
- | `--privacy on` | enregistré comme `stack.privacy`, `on` quand il y a un ORM : `src/platform/privacy/`, avec `data-subject-copies.ts` et `data-subject-exports.ts` (les ports, ou les adaptateurs à la main, des contextes qui étendent `PersonalDataErasure` et `PersonalDataExport`, entre marqueurs ; `generate repository --personal` y liste l'effacement et l'export d'un contexte), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, tenants? })` : un contexte d'exécution d'origine `cli` avec l'opérateur pour acteur, la clé de la personne quand le projet a un event store, puis `eraseDataSubject` du kernel sur les copies, `inEachTenant` avec `--tenancy shared-table`, puis `privacy.data-subject.erased` publié par l'outbox, une fois par *tenant*) et `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })` : `exportDataSubject` du kernel sur les exports, chacun enveloppé par `auditedPersonalDataExport` avec `--audit on`, `recordsInEachTenant` avec `--tenancy shared-table`, un `PersonalDataExportDocument` daté), et les deux scripts ci-dessous. `docs/privacy/register.md`, le registre des données personnelles que `ddd-ts-kit docs` tient (voir `docs` plus bas). Un projet sans donnée personnelle prend `--privacy off` et ne paie rien. Aucune commande HTTP n'efface encore : les deux scripts sont les points d'entrée |
634
+ | `--privacy on` | enregistré comme `stack.privacy`, `on` quand il y a un ORM : `src/platform/privacy/`, avec `data-subject-copies.ts` et `data-subject-exports.ts` (les ports, ou les adaptateurs à la main, des contextes qui étendent `PersonalDataErasure` et `PersonalDataExport`, entre marqueurs ; `generate repository --personal` y liste l'effacement et l'export d'un contexte), `personal-events.ts` (les événements qui portent des données personnelles, écrits par `docs` depuis leur option `personal`), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, rerun?, tenants? })` : un contexte d'exécution d'origine `cli` avec l'opérateur pour acteur, la clé de la personne quand le projet a un event store, puis `eraseDataSubject` du kernel sur les copies, chacune enveloppée par `auditedPersonalDataErasure` avec `--audit on`, `inEachTenant` avec `--tenancy shared-table`, puis une fois les enregistrements de l'outbox et les *jobs* de la personne, puis `privacy.data-subject.erased` publié par l'outbox, une fois par *tenant*, sauf si rien n'a été atteint) et `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })` : `exportDataSubject` du kernel sur les exports, chacun enveloppé par `auditedPersonalDataExport` avec `--audit on`, `recordsInEachTenant` avec `--tenancy shared-table`, un `PersonalDataExportDocument` daté), et les deux scripts ci-dessous. `docs/privacy/register.md`, le registre des données personnelles que `ddd-ts-kit docs` tient (voir `docs` plus bas). Un projet sans donnée personnelle prend `--privacy off` et ne paie rien. Aucune commande HTTP n'efface encore : les deux scripts sont les points d'entrée |
636
635
  | `--tenancy shared-table` | enregistré comme `stack.tenancy` ; les quatre ORM. Chaque `generate repository` est cloisonné par *tenant* (comme `--tenant-scoped`), au moyen de `tenantTable` et `ownTenantTable` (Knex), de `tenantCondition` et `ownTenantCondition` (Drizzle), de `tenantWhere` et `ownTenantWhere` (Prisma, TypeORM) ; l'outbox garde le *tenant* de chaque événement (`createOutboxTables(knex, { tenant: true })` et le `tenant: true` de `KnexOutboxStore`, `tenantOutboxTable`, le champ `tenantId` du modèle Prisma et le `tenant: true` de `PrismaOutboxStore`, `outboxEntity({ tenant: true })`), si bien que les consommateurs s'exécutent dans ce *tenant* ; `tenancy/scoped-statement` juge les adaptateurs. La sécurité au niveau des lignes, un schéma par *tenant* et une base par *tenant* sont refusés, avec ce qu'il faut câbler à la main ([Multitenance](../../docs/concepts/multitenancy.fr.md)) |
637
636
  | `--queue database\|redis\|memory` | enregistré comme `stack.queue`. `database` (par défaut sur Knex, Drizzle, Prisma et TypeORM, quel que soit le conteneur) : les tables du *package* de l'ORM (`createJobTable` et `createProcessTable`, `jobsTable` et `processesTable`, les modèles `BackgroundJob` et `ProcessInstance`, `jobEntity` et `processEntity`) dans le schéma `messaging`, `Persistence` gagne `jobs` et `processes`, et la plateforme relie `JobStore` et `ProcessStore` à eux (le module de la plateforme sur tsyringe, `jobs/create-background-work.ts` là où la plateforme est câblée à la main ou sous Nest), si bien qu'un *job* mis en file par une commande est écrit dans sa transaction ; `redis` (avec `--cache redis`) : `RedisJobStore` sur la connexion du cache, les processus dans la base de données ; `memory` (par défaut avec une persistance sur mesure ou sans persistance) : rien n'est écrit, les deux restent dans le processus. Refusé : `database` avec un autre ORM, `redis` sans le cache |
638
637
  | `--cache redis` | `src/platform/redis/open-redis.ts` (`RedisServices` : le cache lié au `Cache` du kernel, le limiteur à `RateLimiter`, le verrou à `Lock`, qui réserve un *job* planifié à une seule instance, le signal du relais comme `wakeOn` du relais de l'outbox avec `relayWakeUpMiddleware` sur le bus de commandes), `http/too-many-requests-for.ts` (une fenêtre glissante par adresse d'appelant, 429 `application/problem+json` avec `retry-after` ; `RATE_LIMIT_MAX`, `RATE_LIMIT_WINDOW_MS` ; l'adresse est celle du socket sauf si `TRUST_PROXY` nomme les proxys placés devant, par sauts ou par adresse, par sauts seulement sur Hono), `GET /health/ready` sur le serveur HTTP, `REDIS_URL` validée, un service compose `cache` qui exécute Dragonfly avec un contrôle de santé. Sans serveur (outils, tests sans `REDIS_URL`), les mêmes ports restent dans la mémoire du processus |
@@ -642,9 +641,9 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
642
641
  | `--storage local\|s3` | enregistré comme `stack.storage` : où vit le contenu des fichiers, jamais dans la base de données. `src/platform/config/read-files.ts` et `src/platform/files/open-files.ts`, un par choix : `local`, un répertoire en développement (`FILES_DIRECTORY`, `.data/files`) et les liens signés servis par l'application sous `/files` (`FILES_PUBLIC_URL` et `FILES_SIGNING_SECRET` requises en production) ; `s3`, un bucket de n'importe quel fournisseur du protocole S3 au moyen de `@ddd-ts-kit/s3` (les variables `S3_*`, MinIO dans la stack compose) ; la mémoire du processus dans les tests et les outils, dans les deux cas. Avec `--di tsyringe` : `files/bind-files.ts`, `files/files.module.ts` et `files/staging-uploads.ts` ; en câblage manuel, `files/create-files.ts` ; avec une *stack* HTTP, `files/file-routes.ts`. Ils lient `FileStorage`, `FileKeys`, `FileScanner` et `FileStaging`, enregistrent la purge horaire des fichiers en attente et mettent en attente le fichier que porte une commande avant sa transaction ; `generate file-upload` en a besoin. `--storage none` n'écrit rien de tout cela ([Stockage de fichiers](../../docs/concepts/file-storage.fr.md)) |
643
642
  | `src/platform/events/` | `event-provider.ts` (`bus`, `forConsumer(name)`, `start()`, `close()`), `in-process-events.ts`, et pour `--broker` `create-event-provider.ts` : `RabbitMqEventBus` (`AMQP_URL`), `KafkaEventBus` (`KAFKA_BROKERS`, avec `aggregate-key-of.ts` pour l'ordre par agrégat), `NatsEventBus` (`NATS_URL`) ou `RedisStreamsEventBus` de `@ddd-ts-kit/redis/event-bus` (`REDIS_URL` : Redis, Dragonfly ou Valkey), chacun avec un abonné par contexte consommateur (`forConsumer`), `assertTopology` au démarrage, son adresse validée et un service compose avec un contrôle de santé ; ou `custom-event-bus.ts` avec sa *spec* `eventBusContract`. `start-outbox-relay.ts` avec l'outbox. `--broker redis` avec `--cache redis` fait un seul serveur et un seul service compose, `cache` ; seul, le service s'appelle `streams` |
644
643
  | `src/platform/database/` | `persistence.ts` (`interface Persistence` : unité de travail, magasins de l'outbox et des événements traités du *package* de l'ORM, la poignée de stockage), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, la connexion (`connect-to-database.ts`, `create-client.ts` ou `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, le schéma de ce que le kit stocke pour l'application), `open-test-database.ts` (PostgreSQL dans le processus, ou le serveur nommé par une URL ; avec Vitest chaque *spec* ouvre une copie du cluster que `test/support/test-database-template.ts`, la mise en place globale de l'exécution, initialise une fois, et y crée ses tables ; avec drizzle depuis `table-statements.ts`, le SQL des tables de `schema.ts`, puisque drizzle-kit écrit des migrations, pas des tables, ses index uniques compris), `persistence.contract.spec.ts` (les stores de l'outbox, des événements traités, des *jobs* et des processus tels que la plateforme les branche, tenus aux contrats de `@ddd-ts-kit/testing` avec ce que la pile active : le *tenant* sous `--tenancy`, l'unité de travail). La classe de stockage qu'un adaptateur de *repository* nomme dans sa liste de dépendances : `database.ts` avec drizzle et prisma (`abstract class Database extends` le type de contexte du *package* de l'ORM), `KnexContext` de `@ddd-ts-kit/knex`, `TypeOrmContext` de `@ddd-ts-kit/typeorm` |
645
- | outillage des migrations | `drizzle.config.ts`, `knexfile.js` et `migrations/00000000000000_initial.js`, `prisma/schema/schema.prisma` (le client, la datasource et les tables de la plateforme ; `generate repository` ajoute le fichier de chaque contexte, `prisma/schema/<context>.prisma`) et `prisma.config.ts`, ou `data-source.ts`. Un projet qui garde le seul `prisma/schema.prisma` des versions antérieures à 0.95 le garde avec son `prisma.config.ts` et son `db:client`, même sous `--force` : `init` n'écrit rien sous `prisma/schema/`, ses notes donnent les étapes du déplacement en nommant les contextes du projet, et `generate repository` refuse jusqu'au déplacement |
644
+ | outillage des migrations | `drizzle.config.ts`, `knexfile.js` et le dossier `migrations/`, `prisma/schema/schema.prisma` (le client, la datasource et les tables de la plateforme ; `generate repository` ajoute le fichier de chaque contexte, `prisma/schema/<context>.prisma`) et `prisma.config.ts`, ou `data-source.ts`. Un projet qui garde le seul `prisma/schema.prisma` des versions antérieures à 0.95 le garde avec son `prisma.config.ts` et son `db:client`, même sous `--force` : `init` n'écrit rien sous `prisma/schema/`, ses notes donnent les étapes du déplacement en nommant les contextes du projet, et `generate repository` refuse jusqu'au déplacement |
646
645
  | `scripts/openapi.ts`, `scripts/events.ts` | écrivent `openapi/openapi.yaml` (un fichier par document de `openapi.documents`), `docs/integration/asyncapi.yaml` et `docs/integration/event-catalog.md`, en JSON sous `openapi.format: json` ; `--check` échoue sur une différence |
647
- | `scripts/privacy-erase.ts`, `scripts/privacy-export.ts` | avec `--privacy on`, les deux demandes d'une personne concernée, traitées en ligne de commande sur les sources avec les variables de `.env` (`npm run privacy:erase -- <subject-id> [--operator <qui-demande>]`, `npm run privacy:export -- <subject-id> > export.json`) : l'effacement détruit d'abord la clé de la personne quand le projet a un event store (`--event-sourcing on` : ses événements stockés se lisent effacés ; audité avec `--audit on`), puis efface chaque copie listée dans `src/platform/privacy/data-subject-copies.ts` ; `privacy:purge` lance à la main ce que le *job* `privacy.purge-expired` lance chaque nuit à 03:00 UTC, la purge de ce qui a dépassé sa durée de conservation (`JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false` coupe le *job*) ; l'export rassemble chaque enregistrement listé dans `data-subject-exports.ts` en un document JSON daté (`format`, `subject`, `exportedAt`, `records`), l'export de chaque contexte audité avec `--audit on`, jamais les valeurs (chaque exécution laisse son entrée, un essai compris : essayez-le sur une personne de test). Avec `--tenancy shared-table`, `TENANTS` nomme les tenants, séparés par des virgules : une écriture de données de tenant n'est jamais élargie. Ni l'un ni l'autre n'atteint les sauvegardes, les journaux ou une copie qu'aucun contexte n'a déclarée |
646
+ | `scripts/privacy-erase.ts`, `scripts/privacy-export.ts` | avec `--privacy on`, les deux demandes d'une personne concernée, traitées en ligne de commande sur les sources avec les variables de `.env` (`npm run privacy:erase -- <subject-id> [--operator <qui-demande>] [--rerun]`, `npm run privacy:export -- <subject-id> > export.json`) : l'effacement détruit d'abord la clé de la personne quand le projet a un event store (`--event-sourcing on` : ses événements stockés se lisent effacés ; audité avec `--audit on`), puis efface chaque copie listée dans `src/platform/privacy/data-subject-copies.ts`, chacune laissant son entrée avec `--audit on`, et ce que l'outbox et le stockage des *jobs* gardent de la personne ; un id qui n'a rien atteint est refusé, code de sortie 1, et annoncé à personne, sauf si `--rerun` dit que cette personne a déjà été effacée ; `privacy:purge` lance à la main ce que le *job* `privacy.purge-expired` lance chaque nuit à 03:00 UTC, la purge de ce qui a dépassé sa durée de conservation (`JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false` coupe le *job*) ; l'export rassemble chaque enregistrement listé dans `data-subject-exports.ts` en un document JSON daté (`format`, `subject`, `exportedAt`, `records`), l'export de chaque contexte audité avec `--audit on`, jamais les valeurs (chaque exécution laisse son entrée, un essai compris : essayez-le sur une personne de test). Avec `--tenancy shared-table`, `TENANTS` nomme les tenants, séparés par des virgules : une écriture de données de tenant n'est jamais élargie. Ni l'un ni l'autre n'atteint les sauvegardes, les journaux, une copie qu'aucun contexte n'a déclarée, un message déjà livré ou un *job* qui ne nomme aucun `subject` |
648
647
  | `docker-compose.yml`, `.env.example`, `Dockerfile`, `.dockerignore` | la base de données avec un contrôle de santé et un volume nommé, `jaegertracing/jaeger:2.22.0` derrière le profil `observability`, chaque port publié sur 127.0.0.1 seulement (une adresse plus large s'écrit dans l'entrée à dessein, le README du projet dit comment), les ports depuis `.env` ; une image multi-étapes, sans root, avec les seules dépendances de production |
649
648
  | `vitest.e2e.config.ts`, `test/e2e/support/` | `start-application.ts` (l'application entière sur un port libre, sur une base de données dans le processus sauf si `DATABASE_URL` est définie, aucun *job* lancé par le temps ; `settled()` se résout quand l'outbox a relayé ce que les requêtes HTTP ont enregistré ; `publish(events)` remet des événements d'intégration de l'amont à ses gestionnaires, comme le ferait le relais de cet amont), `create-credentials.ts`, `auth-environment.ts`, `test-environment.ts`, `story-of.ts` (`storyOf(trace)` : une trace sans les appels qu'un adaptateur fait sur lui-même, la forme que vérifie `expectSpanTree`) |
650
649
  | `docs/context-map.md`, `docs/integration/README.md` | voir `docs` |
@@ -719,8 +718,8 @@ toute la base : typecheck, lint, `format:check`, `test:coverage`, tests de bout
719
718
 
720
719
  `db:generate` prend ce que fait la migration, en lettres, chiffres, tirets et tirets bas,
721
720
  commençant par une lettre ou un chiffre (`npm run db:generate add-invoices`, sous TypeORM
722
- `migrations/add-invoices`) : `drizzle-generate`, `prisma-generate` et `typeorm-generate` refusent
723
- tout autre nom avant que l'ORM ne le lise, puisqu'une valeur qui commence par un tiret serait l'une
721
+ `migrations/add-invoices`) : `drizzle-generate`, `knex-generate`, `prisma-generate` et
722
+ `typeorm-generate` refusent tout autre nom avant que l'ORM ne le lise, puisqu'une valeur qui commence par un tiret serait l'une
724
723
  de ses options ; `typeorm-generate` refuse aussi un dossier hors du projet.
725
724
 
726
725
  `package.json` porte deux compilateurs : `typescript ~6.0.3`, que les outils chargent comme une
@@ -2491,7 +2490,7 @@ règle.
2491
2490
  | `tracing/platform-only` | un import de `@ddd-ts-kit/tracing` ou d'un *package* `@opentelemetry/*` hors du répertoire de la plateforme, de `main.ts` et de `apps/`, tests compris |
2492
2491
  | `nest/no-parallel-pipeline` | dans `presentation/`, `infrastructure/` ou le fichier de module d'un contexte, tests à part : un import d'un contrôleur que Nest sert (ses décorateurs de route et de paramètres, sauf si le fichier importe `KitRoute` ou `KitRoutes` de `@ddd-ts-kit/http/nest`), de la requête ou de la réponse brutes, d'un *guard*, d'un *pipe*, d'un filtre d'exceptions ou d'une `HttpException`, d'un intercepteur ou du `Logger` de `@nestjs/common`, un import sans nom de celui-ci, ou un import d'un *package* de Nest dont le kit fait le travail (`@nestjs/core`, `@nestjs/swagger`, `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/config`, `@nestjs/schedule` et les autres de la section 3 d'ARCHITECTURE.md) ; le message dit ce que le kit fait à sa place ; sous la racine des sources hors des contextes, tests à part : un fichier qui importe `Controller` de `@nestjs/common`, ni `KitRoute` ni `KitRoutes`, et nomme `CommandBus` ou `QueryBus` ou importe un fichier d'un contexte |
2493
2492
  | `nest/controllers-current` | avec `"stack.routes": "nest"` : un `<context>.controllers.ts` qui diffère de ce que donnent les contrôleurs Nest du contexte et les signatures de leurs méthodes, ou absent ; une partie de la requête prise entière par aucune classe DTO et que `request` de `@KitRoute` ne donne pas ; une méthode de route qui ne répond ni une classe DTO, ni `Accepted`, ni `void`, et ne déclare pas de `response` dans `@KitRoute` |
2494
- | `tenancy/scoped-statement` | avec `stack.tenancy` autre que `none`, dans `infrastructure/` d'un contexte, tests et contexte dont `tenancy` vaut `control-plane` mis à part : sur Knex, l'exécuteur utilisé autrement que comme argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) et tout `.raw(` ; sur Drizzle, instruction par instruction, une lecture, une mise à jour ou une suppression sur l'exécuteur dont le where n'a ni `tenantCondition(` ni `ownTenantCondition(` (en ligne ou dans la variable locale qu'il reçoit), une insertion dont la ligne n'a pas de `tenantScopeOf(`, une requête relationnelle (`executor().query`), un `execute(` brut, ou l'exécuteur gardé dans une variable ; sur Prisma, instruction par instruction sur le client, une lecture (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) dont le where ne décompose pas `tenantWhere(`, une mise à jour ou une suppression dont le where ne décompose pas `ownTenantWhere(`, une création dont les données ne décomposent pas `tenantScopeOf(` (en ligne ou dans une variable locale que les arguments nomment), `findUnique(`, `upsert(`, une requête brute (`$queryRaw`, `$executeRaw`), ou le client gardé dans une variable ; sur TypeORM, la même chose sur le *manager* (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, la ligne confiée à `insertIgnoringConflict(`, un *query builder* dont le where ne porte aucune condition, `save(`, `upsert(`, `query(`) ; sur les quatre, un magasin de modèle de lecture construit sans son option `tenant`. Un where construit par une autre fonction n'est pas suivi |
2493
+ | `tenancy/scoped-statement` | avec `stack.tenancy` autre que `none`, dans `infrastructure/` d'un contexte, tests et contexte dont `tenancy` vaut `control-plane` mis à part : sur Knex, l'exécuteur utilisé autrement que comme argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) et tout `.raw(` ; sur Drizzle, instruction par instruction, une lecture, une mise à jour ou une suppression sur l'exécuteur dont le where n'a ni `tenantCondition(` ni `ownTenantCondition(` (en ligne ou dans la variable locale qu'il reçoit), une insertion dont la ligne n'a pas de `tenantScopeOf(`, une requête relationnelle (`executor().query`), un `execute(` brut, ou l'exécuteur gardé dans une variable ; sur Prisma, instruction par instruction sur le client, une lecture (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) dont le where ne décompose pas `tenantWhere(`, une mise à jour ou une suppression dont le where ne décompose pas `ownTenantWhere(`, une création dont les données ne décomposent pas `tenantScopeOf(` (en ligne ou dans une variable locale que les arguments nomment), `findUnique(`, `upsert(`, une requête brute (`$queryRaw`, `$executeRaw`), ou le client gardé dans une variable ; sur TypeORM, la même chose sur le *manager* (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, la ligne confiée à `insertIgnoringConflict(`, un *query builder* dont le where ne porte aucune condition, `save(`, `upsert(`, `query(`) ; sur les quatre, un magasin de modèle de lecture construit sans son option `tenant`, et une condition du *tenant* qui ne reste pas en `and` avec son instruction : sur Knex `.orWhere*` ou `.or` au sommet d'une instruction de `tenantTable`, `ownTenantTable` ou `whereTenant`, `clearWhere()` ou `clear('where')` sur elle, sur Drizzle la condition sous `or`, `not` ou un gabarit `sql`, sur Prisma l'étalement sous `OR`, `NOT` ou une relation, sur TypeORM de même, un tableau where dont une entrée ne l'étale pas, un `orWhere` au sommet d'un *query builder*, un `where` après celui qui porte la condition. Un where construit par une autre fonction n'est pas suivi |
2495
2494
  | `standard/no-parallel-interface` | une classe, une interface ou un alias de type déclaré comme `ILogger`, `AppLogger`, `LoggerService`, `LoggerInterface`, `IMetrics`, `MetricsService`, `ICache`, `CacheService`, `UserContext`, `CurrentUser`, `AuthContext`, `RequestContext` (hors de `presentation/` et de la plateforme), `UserSession`, `AuthSession`, `SessionData`, `PaginatedResult`, `PageResult`, `PaginatedResponse`, `Paginated`, `PaginationParams`, `PageParams`, `AuditLog`, `AuditLogEntry`, `AuditRecord`, `IJobScheduler`, `JobSchedulerService`, `CronScheduler`, `TaskScheduler`, `IScheduledJob`, `CronJob`, `ScheduledTask`, `BackgroundJob`, `IErrorReporter`, `ErrorReporterService`, `ErrorTracker`, `ExceptionReporter`, `CrashReporter`, `CacheInvalidator`, `CacheInvalidationService`, `CachePurgeService`, `CdnPurger`, `I` suivi d'un nom standard (`IClock`, `IIdGenerator`, `IUnitOfWork`, `ISession`, ...) ou un nom de `standardInterfaces` ; une classe qui implémente ou étend l'interface standard est un adaptateur et n'est pas signalée |
2496
2495
  | `events/outbox-required` | `stack.events` autre que `outbox` avec un ORM et sans dérogation `stack.events` ; dans `domain/` et `application/`, l'import d'un client de *broker* ou d'une implémentation de bus ou de relais ; un *publisher* qui dépend de plus que `IntegrationEventPublisher` ; un module de la plateforme qui distribue un *publisher* et ne nomme jamais `OutboxPublisher` |
2497
2496
  | `events/consumer-idempotent` | une classe de gestionnaire d'événement d'intégration (`application/integration/handlers/*.integration-handler.ts`) qui ne porte pas `@IntegrationEventHandler` et n'est pas non plus enregistrée dans son fichier de module sous un nom de consommateur ; un `@IntegrationEventHandler` dont le `consumer` n'est pas une chaîne littérale non vide ; un `on(` ou un `consume(` libre sans `processed` ; un nom de consommateur utilisé deux fois, dans les déclarations comme dans les enregistrements |