@cratis/pi 8.0.2 → 8.2.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 (490) hide show
  1. package/package/corpus/harnesses/copilot/instructions/ai-distribution.instructions.md +9 -102
  2. package/package/corpus/harnesses/copilot/instructions/authoring-skills.instructions.md +3 -5
  3. package/package/corpus/harnesses/copilot/instructions/browser.instructions.md +8 -49
  4. package/package/corpus/harnesses/copilot/instructions/code-health.instructions.md +1 -1
  5. package/package/corpus/harnesses/copilot/instructions/code-quality.csharp.instructions.md +3 -84
  6. package/package/corpus/harnesses/copilot/instructions/code-quality.instructions.md +6 -51
  7. package/package/corpus/harnesses/copilot/instructions/code-quality.typescript.instructions.md +4 -81
  8. package/package/corpus/harnesses/copilot/instructions/codescene.instructions.md +5 -54
  9. package/package/corpus/harnesses/copilot/instructions/components.instructions.md +1 -1
  10. package/package/corpus/harnesses/copilot/instructions/cratis-folder-is-configuration.instructions.md +5 -22
  11. package/package/corpus/harnesses/copilot/instructions/csharp.instructions.md +7 -315
  12. package/package/corpus/harnesses/copilot/instructions/dialogs.instructions.md +1 -1
  13. package/package/corpus/harnesses/copilot/instructions/discoverability.instructions.md +3 -25
  14. package/package/corpus/harnesses/copilot/instructions/documentation-structure-and-formatting.instructions.md +5 -151
  15. package/package/corpus/harnesses/copilot/instructions/documentation.instructions.md +5 -104
  16. package/package/corpus/harnesses/copilot/instructions/editing-cratis-docs.instructions.md +5 -63
  17. package/package/corpus/harnesses/copilot/instructions/efcore.instructions.md +8 -55
  18. package/package/corpus/harnesses/copilot/instructions/efcore.specs.instructions.md +3 -33
  19. package/package/corpus/harnesses/copilot/instructions/elixir.instructions.md +6 -79
  20. package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +4 -27
  21. package/package/corpus/harnesses/copilot/instructions/framework-dotnet.instructions.md +4 -6
  22. package/package/corpus/harnesses/copilot/instructions/framework.instructions.md +0 -2
  23. package/package/corpus/harnesses/copilot/instructions/frontend-quality.instructions.md +0 -1
  24. package/package/corpus/harnesses/copilot/instructions/frontend-testing.instructions.md +1 -1
  25. package/package/corpus/harnesses/copilot/instructions/github-actions.instructions.md +7 -138
  26. package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +19 -19
  27. package/package/corpus/harnesses/copilot/instructions/go-engineering.instructions.md +1 -4
  28. package/package/corpus/harnesses/copilot/instructions/go.instructions.md +2 -7
  29. package/package/corpus/harnesses/copilot/instructions/guards-and-fuses.instructions.md +5 -6
  30. package/package/corpus/harnesses/copilot/instructions/java.instructions.md +7 -129
  31. package/package/corpus/harnesses/copilot/instructions/kotlin.instructions.md +8 -165
  32. package/package/corpus/harnesses/copilot/instructions/local-work-artifacts.instructions.md +4 -1
  33. package/package/corpus/harnesses/copilot/instructions/orleans.instructions.md +5 -98
  34. package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +9 -63
  35. package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +1 -1
  36. package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +8 -148
  37. package/package/corpus/harnesses/copilot/instructions/specs.elixir.instructions.md +4 -37
  38. package/package/corpus/harnesses/copilot/instructions/specs.typescript.instructions.md +3 -1
  39. package/package/corpus/harnesses/copilot/instructions/storybook.instructions.md +7 -70
  40. package/package/corpus/harnesses/copilot/instructions/typescript.instructions.md +8 -98
  41. package/package/corpus/harnesses/copilot/instructions/writing-correct-examples.instructions.md +3 -47
  42. package/package/corpus/harnesses/copilot/instructions/writing-cratis-docs.instructions.md +3 -65
  43. package/package/corpus/hooks/README.md +16 -8
  44. package/package/corpus/hooks/scripts/cratis-cleanup-worktrees.sh +109 -6
  45. package/package/corpus/hooks/scripts/cratis-guard-shell-writes.sh +1 -1
  46. package/package/corpus/hooks/scripts/quality-gates.json +3 -5
  47. package/package/corpus/rules/ai-distribution.md +9 -102
  48. package/package/corpus/rules/authoring-skills.md +3 -5
  49. package/package/corpus/rules/browser.md +8 -49
  50. package/package/corpus/rules/code-health-policy.txt +4 -24
  51. package/package/corpus/rules/code-health.md +1 -1
  52. package/package/corpus/rules/code-quality.csharp.md +3 -84
  53. package/package/corpus/rules/code-quality.md +6 -51
  54. package/package/corpus/rules/code-quality.typescript.md +4 -81
  55. package/package/corpus/rules/codescene.md +5 -54
  56. package/package/corpus/rules/components.md +1 -1
  57. package/package/corpus/rules/cratis-folder-is-configuration.md +5 -22
  58. package/package/corpus/rules/csharp.md +7 -315
  59. package/package/corpus/rules/dialogs.md +1 -1
  60. package/package/corpus/rules/discoverability.md +3 -25
  61. package/package/corpus/rules/documentation-structure-and-formatting.md +5 -151
  62. package/package/corpus/rules/documentation.md +5 -104
  63. package/package/corpus/rules/editing-cratis-docs.md +5 -63
  64. package/package/corpus/rules/efcore.md +8 -55
  65. package/package/corpus/rules/efcore.specs.md +3 -33
  66. package/package/corpus/rules/elixir.md +6 -79
  67. package/package/corpus/rules/exit-codes-and-wrappers.md +4 -27
  68. package/package/corpus/rules/framework-dotnet.md +4 -6
  69. package/package/corpus/rules/framework.md +0 -2
  70. package/package/corpus/rules/frontend-quality.md +0 -1
  71. package/package/corpus/rules/frontend-testing.md +1 -1
  72. package/package/corpus/rules/general.md +2 -2
  73. package/package/corpus/rules/github-actions.md +7 -138
  74. package/package/corpus/rules/glossary.md +19 -19
  75. package/package/corpus/rules/go-engineering.md +1 -4
  76. package/package/corpus/rules/go.md +2 -7
  77. package/package/corpus/rules/guards-and-fuses.md +5 -6
  78. package/package/corpus/rules/java.md +7 -129
  79. package/package/corpus/rules/kotlin.md +8 -165
  80. package/package/corpus/rules/local-work-artifacts.md +4 -1
  81. package/package/corpus/rules/orleans.md +5 -98
  82. package/package/corpus/rules/profiles.md +9 -63
  83. package/package/corpus/rules/scripting.md +1 -1
  84. package/package/corpus/rules/specs.csharp.md +8 -148
  85. package/package/corpus/rules/specs.elixir.md +4 -37
  86. package/package/corpus/rules/specs.typescript.md +3 -1
  87. package/package/corpus/rules/storybook.md +7 -70
  88. package/package/corpus/rules/typescript.md +8 -98
  89. package/package/corpus/rules/writing-correct-examples.md +3 -47
  90. package/package/corpus/rules/writing-cratis-docs.md +3 -65
  91. package/package/corpus/skills/cratis-application-growth/SKILL.md +7 -54
  92. package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +49 -0
  93. package/package/corpus/skills/cratis-application-growth/references/rename-window.md +12 -14
  94. package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
  95. package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +2 -2
  96. package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +3 -3
  97. package/package/corpus/skills/cratis-arc-authorize-request/references/kotlin.md +2 -2
  98. package/package/corpus/skills/cratis-arc-code-analysis-typescript/SKILL.md +10 -43
  99. package/package/corpus/skills/cratis-arc-code-analysis-typescript/references/rule-fixes.md +40 -0
  100. package/package/corpus/skills/cratis-arc-connect-storage/SKILL.md +1 -1
  101. package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -1
  102. package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +4 -4
  103. package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
  104. package/package/corpus/skills/cratis-arc-declare-command/references/kotlin.md +6 -7
  105. package/package/corpus/skills/cratis-arc-declare-operation/SKILL.md +2 -8
  106. package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +1 -1
  107. package/package/corpus/skills/cratis-arc-diagnose-live-query/SKILL.md +1 -1
  108. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +1 -1
  109. package/package/corpus/skills/cratis-arc-expose-mcp-operation/SKILL.md +6 -12
  110. package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/custom-exposure-and-audit.md +4 -0
  111. package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +2 -2
  112. package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +11 -4
  113. package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +1 -1
  114. package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +2 -2
  115. package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +1 -1
  116. package/package/corpus/skills/cratis-arc-generate-proxies/references/go.md +19 -2
  117. package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +1 -1
  118. package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
  119. package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +1 -2
  120. package/package/corpus/skills/cratis-arc-host-application/references/elixir.md +2 -2
  121. package/package/corpus/skills/cratis-arc-host-application/references/go.md +5 -1
  122. package/package/corpus/skills/cratis-arc-host-application/references/java.md +1 -1
  123. package/package/corpus/skills/cratis-arc-host-application/references/kotlin.md +1 -1
  124. package/package/corpus/skills/cratis-arc-host-application/references/typescript.md +1 -1
  125. package/package/corpus/skills/cratis-arc-identity-and-tenancy-kotlin/SKILL.md +4 -7
  126. package/package/corpus/skills/cratis-arc-invoke-command/SKILL.md +1 -1
  127. package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +4 -4
  128. package/package/corpus/skills/cratis-arc-invoke-command/references/typescript.md +1 -1
  129. package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +2 -2
  130. package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +2 -2
  131. package/package/corpus/skills/cratis-arc-isolate-tenant/references/elixir.md +1 -1
  132. package/package/corpus/skills/cratis-arc-isolate-tenant/references/java.md +1 -1
  133. package/package/corpus/skills/cratis-arc-isolate-tenant/references/kotlin.md +1 -1
  134. package/package/corpus/skills/cratis-arc-isolate-tenant/references/typescript.md +4 -2
  135. package/package/corpus/skills/cratis-arc-migrate-relational-schema/SKILL.md +6 -6
  136. package/package/corpus/skills/cratis-arc-page-query/SKILL.md +3 -3
  137. package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +10 -6
  138. package/package/corpus/skills/cratis-arc-page-query/references/elixir.md +2 -2
  139. package/package/corpus/skills/cratis-arc-page-query/references/java.md +1 -1
  140. package/package/corpus/skills/cratis-arc-page-query/references/kotlin.md +1 -1
  141. package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +2 -2
  142. package/package/corpus/skills/cratis-arc-react-bind-slice/references/csharp.md +1 -1
  143. package/package/corpus/skills/cratis-arc-react-bind-slice/references/kotlin.md +1 -1
  144. package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +7 -3
  145. package/package/corpus/skills/cratis-arc-react-separate-view-model/references/react-routing-and-messaging.md +1 -1
  146. package/package/corpus/skills/cratis-arc-select-backend-sdk/SKILL.md +2 -2
  147. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/elixir.md +2 -4
  148. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/go.md +2 -2
  149. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/java.md +1 -1
  150. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/kotlin.md +2 -2
  151. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/typescript.md +1 -3
  152. package/package/corpus/skills/cratis-arc-spring-data-kotlin/SKILL.md +13 -51
  153. package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/read-model-naming.md +9 -1
  154. package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/storage-boundaries.md +40 -0
  155. package/package/corpus/skills/cratis-arc-storage-typescript/SKILL.md +19 -64
  156. package/package/corpus/skills/cratis-arc-storage-typescript/references/drizzle.md +62 -0
  157. package/package/corpus/skills/cratis-arc-tenancy-typescript/SKILL.md +24 -55
  158. package/package/corpus/skills/cratis-arc-tenancy-typescript/references/tenant-selection.md +49 -0
  159. package/package/corpus/skills/cratis-arc-testing-kotlin/SKILL.md +13 -31
  160. package/package/corpus/skills/cratis-arc-testing-kotlin/references/jvm-scenario-variants.md +25 -0
  161. package/package/corpus/skills/cratis-arc-testing-typescript/SKILL.md +24 -62
  162. package/package/corpus/skills/cratis-arc-testing-typescript/references/hosts-and-runners.md +51 -0
  163. package/package/corpus/skills/cratis-arc-validate-command/SKILL.md +4 -4
  164. package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +10 -12
  165. package/package/corpus/skills/cratis-arc-validate-command/references/elixir.md +16 -3
  166. package/package/corpus/skills/cratis-arc-validate-command/references/go.md +19 -2
  167. package/package/corpus/skills/cratis-arc-validate-command/references/java.md +20 -7
  168. package/package/corpus/skills/cratis-arc-validate-command/references/kotlin.md +22 -2
  169. package/package/corpus/skills/cratis-arc-validate-command/references/python.md +8 -2
  170. package/package/corpus/skills/cratis-arc-validate-command/references/typescript.md +22 -2
  171. package/package/corpus/skills/cratis-arc-validation-kotlin/SKILL.md +22 -248
  172. package/package/corpus/skills/cratis-arc-validation-kotlin/references/feature-filters.md +55 -0
  173. package/package/corpus/skills/cratis-arc-validation-kotlin/references/model-validation.md +72 -0
  174. package/package/corpus/skills/cratis-arc-validation-kotlin/references/server-validators.md +86 -0
  175. package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +27 -275
  176. package/package/corpus/skills/cratis-arc-validation-typescript/references/models-and-queries.md +63 -0
  177. package/package/corpus/skills/cratis-arc-validation-typescript/references/rules-and-checks.md +46 -0
  178. package/package/corpus/skills/cratis-arc-validation-typescript/references/server-decisions.md +114 -0
  179. package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +15 -255
  180. package/package/corpus/skills/cratis-chronicle-cli-operations/references/command-effects.md +13 -6
  181. package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +75 -0
  182. package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +78 -13
  183. package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +16 -14
  184. package/package/corpus/skills/cratis-chronicle-connect-application/SKILL.md +1 -1
  185. package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +10 -6
  186. package/package/corpus/skills/cratis-chronicle-connect-application/references/elixir.md +1 -1
  187. package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +2 -2
  188. package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +8 -8
  189. package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +10 -8
  190. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +8 -4
  191. package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +4 -4
  192. package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
  193. package/package/corpus/skills/cratis-chronicle-evolve-event/references/deployed-readers.md +21 -8
  194. package/package/corpus/skills/cratis-chronicle-evolve-event/references/elixir.md +1 -1
  195. package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +1 -1
  196. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +5 -7
  197. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/elixir.md +3 -3
  198. package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +10 -80
  199. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/blocked-tools.md +2 -2
  200. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +9 -24
  201. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/observational-tools.md +10 -0
  202. package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +2 -2
  203. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +7 -6
  204. package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +2 -2
  205. package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +6 -0
  206. package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +6 -0
  207. package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +6 -0
  208. package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +11 -5
  209. package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +2 -2
  210. package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +4 -4
  211. package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +2 -2
  212. package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +3 -1
  213. package/package/corpus/skills/cratis-chronicle-protect-personal-data/SKILL.md +1 -1
  214. package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +1 -1
  215. package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +1 -1
  216. package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +51 -40
  217. package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir.md +1 -1
  218. package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +1 -1
  219. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/{occurrences.md → csharp-occurrences.md} +2 -2
  220. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +5 -6
  221. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/go.md +1 -1
  222. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +1 -1
  223. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -1
  224. package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +1 -1
  225. package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +21 -19
  226. package/package/corpus/skills/cratis-chronicle-record-event/references/elixir.md +3 -3
  227. package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
  228. package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +3 -4
  229. package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -4
  230. package/package/corpus/skills/cratis-chronicle-record-event/references/typescript.md +2 -2
  231. package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +1 -1
  232. package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +7 -2
  233. package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +1 -1
  234. package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +4 -4
  235. package/package/corpus/skills/cratis-chronicle-select-client/references/csharp.md +3 -3
  236. package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +2 -6
  237. package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +2 -2
  238. package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +1 -1
  239. package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +1 -5
  240. package/package/corpus/skills/cratis-chronicle-select-client/references/python.md +3 -3
  241. package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +2 -2
  242. package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +12 -201
  243. package/package/corpus/skills/cratis-chronicle-web-workbench/references/hosting.md +67 -0
  244. package/package/corpus/skills/cratis-chronicle-web-workbench/references/operations.md +88 -0
  245. package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +8 -4
  246. package/package/corpus/skills/cratis-ci-pipeline-performance/references/build-once-and-shard.md +13 -11
  247. package/package/corpus/skills/cratis-ci-pipeline-performance/references/caching.md +2 -2
  248. package/package/corpus/skills/cratis-ci-pipeline-performance/references/flaky-and-hung-jobs.md +6 -4
  249. package/package/corpus/skills/cratis-ci-pipeline-performance/references/required-checks-and-path-filters.md +20 -61
  250. package/package/corpus/skills/cratis-ci-pipeline-performance/references/security-and-pinning.md +1 -1
  251. package/package/corpus/skills/cratis-cli-terminal-workbench/SKILL.md +15 -26
  252. package/package/corpus/skills/cratis-code-review/SKILL.md +7 -6
  253. package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +1 -1
  254. package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +1 -1
  255. package/package/corpus/skills/cratis-components-accessibility/SKILL.md +14 -206
  256. package/package/corpus/skills/cratis-components-accessibility/references/control-labels.md +29 -0
  257. package/package/corpus/skills/cratis-components-accessibility/references/focus-and-announcements.md +8 -0
  258. package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +7 -7
  259. package/package/corpus/skills/cratis-components-build-canvas/references/pixi-items.md +1 -1
  260. package/package/corpus/skills/cratis-components-choose-control/SKILL.md +7 -8
  261. package/package/corpus/skills/cratis-components-choose-control/references/collections.md +2 -2
  262. package/package/corpus/skills/cratis-components-choose-control/references/inputs.md +1 -1
  263. package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +22 -27
  264. package/package/corpus/skills/cratis-components-compose-toolbar/references/contributed-tools.md +5 -0
  265. package/package/corpus/skills/cratis-components-coordinate-feedback/SKILL.md +19 -25
  266. package/package/corpus/skills/cratis-components-display-list/SKILL.md +26 -19
  267. package/package/corpus/skills/cratis-components-display-list/references/server-query.md +3 -3
  268. package/package/corpus/skills/cratis-components-edit-schema-data/SKILL.md +15 -12
  269. package/package/corpus/skills/cratis-components-edit-schema-data/references/controlled-editor.md +3 -3
  270. package/package/corpus/skills/cratis-components-explore-data/SKILL.md +7 -7
  271. package/package/corpus/skills/cratis-components-host-chat/SKILL.md +7 -7
  272. package/package/corpus/skills/cratis-components-submit-form/SKILL.md +9 -15
  273. package/package/corpus/skills/cratis-components-submit-form/references/confirmation.md +5 -5
  274. package/package/corpus/skills/cratis-components-submit-form/references/wizard.md +3 -3
  275. package/package/corpus/skills/cratis-components-theme-application/SKILL.md +7 -51
  276. package/package/corpus/skills/cratis-components-theme-application/references/palette.md +49 -0
  277. package/package/corpus/skills/cratis-components-theme-application/references/renderer-adapters.md +4 -2
  278. package/package/corpus/skills/cratis-content-length/SKILL.md +34 -46
  279. package/package/corpus/skills/cratis-content-length/references/length-evidence.md +26 -127
  280. package/package/corpus/skills/cratis-developer-marketing/SKILL.md +15 -27
  281. package/package/corpus/skills/cratis-developer-marketing/references/measurement.md +3 -19
  282. package/package/corpus/skills/cratis-developer-marketing/references/playbook-evidence.md +29 -224
  283. package/package/corpus/skills/cratis-discoverability/SKILL.md +11 -4
  284. package/package/corpus/skills/cratis-discoverability/references/package-metadata.md +2 -2
  285. package/package/corpus/skills/cratis-documentation-writing/SKILL.md +4 -3
  286. package/package/corpus/skills/cratis-engineering-ci-gates/SKILL.md +13 -129
  287. package/package/corpus/skills/cratis-engineering-ci-gates/references/gate-operation.md +132 -0
  288. package/package/corpus/skills/cratis-engineering-consolidation-guard/SKILL.md +11 -100
  289. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/ci-required-check.md +55 -40
  290. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/source-verification.md +68 -0
  291. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/verification-details.md +38 -0
  292. package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +14 -65
  293. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +40 -174
  294. package/package/corpus/skills/cratis-engineering-decision-record/SKILL.md +8 -52
  295. package/package/corpus/skills/cratis-engineering-decision-record/references/decision-pitfalls.md +29 -0
  296. package/package/corpus/skills/cratis-engineering-decision-record/references/decision-scope.md +20 -0
  297. package/package/corpus/skills/cratis-engineering-decision-record/references/record-format.md +3 -4
  298. package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +7 -12
  299. package/package/corpus/skills/cratis-engineering-docs-authoring/references/site-format.md +5 -4
  300. package/package/corpus/skills/cratis-engineering-effect-boundaries/SKILL.md +6 -40
  301. package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +18 -151
  302. package/package/corpus/skills/cratis-engineering-inherited-work/SKILL.md +5 -21
  303. package/package/corpus/skills/cratis-engineering-inherited-work/references/continue-inherited-work.md +19 -0
  304. package/package/corpus/skills/cratis-engineering-issue-design-note/SKILL.md +3 -66
  305. package/package/corpus/skills/cratis-engineering-issue-design-note/references/design-note-format.md +68 -0
  306. package/package/corpus/skills/cratis-engineering-issue-hygiene/SKILL.md +2 -84
  307. package/package/corpus/skills/cratis-engineering-issue-hygiene/references/issue-disposition.md +87 -0
  308. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/SKILL.md +15 -263
  309. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dependency-map.md +3 -3
  310. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/docker-images.md +28 -6
  311. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dotnet-nuget.md +18 -14
  312. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/helper-runbook.md +231 -0
  313. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/other-environments.md +2 -3
  314. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/worked-examples.md +62 -77
  315. package/package/corpus/skills/cratis-engineering-post-mortem/SKILL.md +6 -39
  316. package/package/corpus/skills/cratis-engineering-post-mortem/references/proportionate-follow-up.md +36 -0
  317. package/package/corpus/skills/cratis-engineering-regression-cluster/SKILL.md +4 -4
  318. package/package/corpus/skills/cratis-engineering-release-trains/SKILL.md +8 -134
  319. package/package/corpus/skills/cratis-engineering-release-trains/references/candidate-assembly.md +139 -0
  320. package/package/corpus/skills/cratis-engineering-review-rounds/SKILL.md +3 -100
  321. package/package/corpus/skills/cratis-engineering-review-rounds/references/round-handoffs.md +109 -0
  322. package/package/corpus/skills/cratis-environments-and-secrets/SKILL.md +1 -5
  323. package/package/corpus/skills/cratis-environments-and-secrets/references/environment-file.md +1 -3
  324. package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +11 -116
  325. package/package/corpus/skills/cratis-event-model-diagram/references/frame-patterns.md +93 -0
  326. package/package/corpus/skills/cratis-fundamentals-concept-go/SKILL.md +4 -15
  327. package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -8
  328. package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +4 -4
  329. package/package/corpus/skills/cratis-fundamentals-name-value/references/elixir.md +1 -1
  330. package/package/corpus/skills/cratis-fundamentals-name-value/references/go.md +1 -1
  331. package/package/corpus/skills/cratis-fundamentals-name-value/references/java.md +5 -5
  332. package/package/corpus/skills/cratis-fundamentals-name-value/references/kotlin.md +15 -2
  333. package/package/corpus/skills/cratis-fundamentals-name-value/references/python.md +1 -1
  334. package/package/corpus/skills/cratis-fundamentals-name-value/references/typescript.md +1 -1
  335. package/package/corpus/skills/cratis-fundamentals-telemetry/SKILL.md +10 -27
  336. package/package/corpus/skills/cratis-fundamentals-telemetry/references/otlp-export.md +16 -0
  337. package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +26 -188
  338. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/diagnostics.md +14 -0
  339. package/package/corpus/skills/cratis-governed-release-methodology/SKILL.md +7 -5
  340. package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +23 -157
  341. package/package/corpus/skills/cratis-lens-browser-extension/references/troubleshooting.md +139 -0
  342. package/package/corpus/skills/cratis-llm-friendly-documentation/SKILL.md +7 -5
  343. package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +2 -4
  344. package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +7 -0
  345. package/package/corpus/skills/cratis-modeling-discover-timeline/SKILL.md +2 -2
  346. package/package/corpus/skills/cratis-modeling-discover-timeline/references/group-and-document-intake.md +1 -1
  347. package/package/corpus/skills/cratis-modeling-review-event-model/SKILL.md +2 -2
  348. package/package/corpus/skills/cratis-modeling-review-event-model/references/implementation-findings.md +2 -2
  349. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/SKILL.md +5 -23
  350. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/compare-evidence.md +20 -0
  351. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/recovery-inputs.md +3 -3
  352. package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +8 -63
  353. package/package/corpus/skills/cratis-multi-service-local-orchestration/references/aspire.md +52 -0
  354. package/package/corpus/skills/cratis-observability/SKILL.md +1 -1
  355. package/package/corpus/skills/cratis-observability/references/arc-and-chronicle-signals.md +9 -23
  356. package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +3 -14
  357. package/package/corpus/skills/cratis-observability/references/csharp.md +4 -6
  358. package/package/corpus/skills/cratis-observability/references/elixir.md +1 -1
  359. package/package/corpus/skills/cratis-observability/references/troubleshooting.md +4 -5
  360. package/package/corpus/skills/cratis-onboarding-runtime/SKILL.md +1 -4
  361. package/package/corpus/skills/cratis-onboarding-runtime/references/default-offering.md +0 -3
  362. package/package/corpus/skills/cratis-onboarding-runtime/references/sign-up-review.md +0 -4
  363. package/package/corpus/skills/cratis-orchestration-lanes/SKILL.md +7 -49
  364. package/package/corpus/skills/cratis-orchestration-lanes/references/escalation.md +22 -0
  365. package/package/corpus/skills/cratis-orchestration-lanes/references/inbox-and-handover.md +4 -4
  366. package/package/corpus/skills/cratis-orchestration-lanes/references/placeholders.md +1 -1
  367. package/package/corpus/skills/cratis-orchestration-lanes/references/roles.md +12 -0
  368. package/package/corpus/skills/cratis-orchestration-lanes/references/roll-call.md +12 -0
  369. package/package/corpus/skills/cratis-orchestration-lanes/references/worktrees.md +11 -0
  370. package/package/corpus/skills/cratis-orchestration-merge-gates/SKILL.md +14 -13
  371. package/package/corpus/skills/cratis-orchestration-merge-gates/references/merge-queue.md +51 -26
  372. package/package/corpus/skills/cratis-orchestration-merge-gates/references/unattended-guards.md +8 -14
  373. package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +9 -65
  374. package/package/corpus/skills/cratis-orleans-jobs/references/activation-callbacks.md +5 -0
  375. package/package/corpus/skills/cratis-orleans-jobs/references/lifecycle-and-placement.md +11 -7
  376. package/package/corpus/skills/cratis-orleans-jobs/references/state-machines.md +1 -1
  377. package/package/corpus/skills/cratis-orleans-jobs/references/step-planning.md +27 -0
  378. package/package/corpus/skills/cratis-orleans-jobs/references/storage-and-options.md +35 -0
  379. package/package/corpus/skills/cratis-performance-review/SKILL.md +6 -76
  380. package/package/corpus/skills/cratis-performance-review/references/review-checklist.md +79 -0
  381. package/package/corpus/skills/cratis-platform-configure-environment/SKILL.md +19 -16
  382. package/package/corpus/skills/cratis-platform-contribute-change/SKILL.md +2 -2
  383. package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +5 -5
  384. package/package/corpus/skills/cratis-platform-deliver-slice/references/coordinate-slices.md +1 -1
  385. package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +2 -3
  386. package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +2 -2
  387. package/package/corpus/skills/cratis-platform-start-application/SKILL.md +10 -8
  388. package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +6 -6
  389. package/package/corpus/skills/cratis-platform-start-application/references/java.md +4 -4
  390. package/package/corpus/skills/cratis-platform-start-application/references/kotlin.md +4 -4
  391. package/package/corpus/skills/cratis-platform-verify-service-handoff/SKILL.md +3 -3
  392. package/package/corpus/skills/cratis-release-notes/SKILL.md +9 -133
  393. package/package/corpus/skills/cratis-release-notes/references/channel-guidance.md +59 -0
  394. package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +64 -0
  395. package/package/corpus/skills/cratis-rtk/SKILL.md +12 -18
  396. package/package/corpus/skills/cratis-screenplay-accept-model/SKILL.md +3 -3
  397. package/package/corpus/skills/cratis-screenplay-accept-model/references/capability-consumption.md +1 -1
  398. package/package/corpus/skills/cratis-screenplay-accept-model/references/coverage-obligations.md +1 -1
  399. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/SKILL.md +25 -59
  400. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/references/onboarding-directives.md +11 -10
  401. package/package/corpus/skills/cratis-screenplay-author-extension/SKILL.md +9 -6
  402. package/package/corpus/skills/cratis-screenplay-author-extension/references/consume.md +3 -3
  403. package/package/corpus/skills/cratis-screenplay-author-extension/references/stage-candidate.md +8 -0
  404. package/package/corpus/skills/cratis-screenplay-availability/SKILL.md +20 -167
  405. package/package/corpus/skills/cratis-screenplay-availability/references/complete-example.md +23 -47
  406. package/package/corpus/skills/cratis-screenplay-availability/references/review-checks.md +9 -10
  407. package/package/corpus/skills/cratis-screenplay-availability/references/runtime-ownership.md +26 -23
  408. package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +6 -14
  409. package/package/corpus/skills/cratis-screenplay-declare-slice/references/projection-replay.md +2 -2
  410. package/package/corpus/skills/cratis-screenplay-declare-slice/references/read-identity.md +1 -1
  411. package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +7 -9
  412. package/package/corpus/skills/cratis-screenplay-edit-workspace/references/model-notes.md +1 -1
  413. package/package/corpus/skills/cratis-screenplay-handoff-slice/SKILL.md +10 -14
  414. package/package/corpus/skills/cratis-screenplay-model-automation/SKILL.md +1 -1
  415. package/package/corpus/skills/cratis-screenplay-model-automation/references/reaction-boundaries.md +1 -1
  416. package/package/corpus/skills/cratis-screenplay-model-interaction/SKILL.md +6 -31
  417. package/package/corpus/skills/cratis-screenplay-model-interaction/references/shell-and-data.md +22 -0
  418. package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +5 -5
  419. package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +5 -5
  420. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/version-migration.md +4 -4
  421. package/package/corpus/skills/cratis-screenplay-recover-intent/SKILL.md +2 -2
  422. package/package/corpus/skills/cratis-screenplay-recover-intent/references/csharp.md +2 -2
  423. package/package/corpus/skills/cratis-screenplay-recover-intent/references/ground-truth-benchmark.md +1 -1
  424. package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +4 -75
  425. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/host-body-execution.md +0 -2
  426. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/observable-result.md +85 -1
  427. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/query-rejections.md +1 -1
  428. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +15 -133
  429. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +5 -5
  430. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +4 -12
  431. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +28 -57
  432. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +4 -5
  433. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +13 -20
  434. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +1 -1
  435. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/neighbouring-skills.md +1 -1
  436. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/read-model-keys.md +3 -5
  437. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-id-rules.md +2 -0
  438. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +5 -5
  439. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +82 -71
  440. package/package/corpus/skills/cratis-security-review/SKILL.md +4 -73
  441. package/package/corpus/skills/cratis-security-review/references/arc-boundaries.md +24 -13
  442. package/package/corpus/skills/cratis-security-review/references/review-checklist.md +74 -0
  443. package/package/corpus/skills/cratis-session-handoff/SKILL.md +7 -32
  444. package/package/corpus/skills/cratis-session-handoff/references/handoff-template.md +2 -2
  445. package/package/corpus/skills/cratis-session-handoff/references/session-hygiene.md +20 -0
  446. package/package/corpus/skills/cratis-showrunner-herald/SKILL.md +9 -17
  447. package/package/corpus/skills/cratis-showrunner-herald/references/options.md +2 -2
  448. package/package/corpus/skills/cratis-showrunner-herald/references/templates-and-images.md +16 -10
  449. package/package/corpus/skills/cratis-social-feed-post/SKILL.md +9 -162
  450. package/package/corpus/skills/cratis-social-feed-post/references/asset-and-formatting.md +37 -0
  451. package/package/corpus/skills/cratis-social-feed-post/references/editorial-checks.md +40 -0
  452. package/package/corpus/skills/cratis-social-feed-post/references/engagement-evidence.md +39 -150
  453. package/package/corpus/skills/cratis-social-feed-post/references/linkedin-media.md +24 -0
  454. package/package/corpus/skills/cratis-social-feed-post/references/other-channels.md +23 -0
  455. package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +5 -5
  456. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +2 -2
  457. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-query-scenario.md +13 -5
  458. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +7 -4
  459. package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +1 -1
  460. package/package/corpus/skills/cratis-specifications-exercise-backend/references/go.md +20 -4
  461. package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +1 -1
  462. package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +2 -2
  463. package/package/corpus/skills/cratis-specifications-observe-ui/SKILL.md +5 -5
  464. package/package/corpus/skills/cratis-specifications-test-application-ui/SKILL.md +2 -2
  465. package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript-command-results.md +2 -2
  466. package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -2
  467. package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +10 -9
  468. package/package/corpus/skills/cratis-stage-run-sandbox/SKILL.md +3 -3
  469. package/package/corpus/skills/cratis-stage-run-sandbox/references/semantic-spec-runner.md +7 -6
  470. package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +4 -6
  471. package/package/corpus/skills/cratis-technical-examples/SKILL.md +10 -106
  472. package/package/corpus/skills/cratis-technical-examples/references/csharp-package-checks.md +1 -1
  473. package/package/corpus/skills/cratis-technical-examples/references/source-and-format.md +42 -0
  474. package/package/corpus/skills/cratis-technical-examples/references/typescript-package-checks.md +2 -2
  475. package/package/corpus/skills/cratis-technical-examples/references/verification-scope.md +37 -0
  476. package/package/corpus/skills/cratis-ux-review/SKILL.md +8 -40
  477. package/package/corpus/skills/cratis-ux-review/references/capture-contract.md +24 -0
  478. package/package/corpus/skills/cratis-ux-review/references/checklist.md +1 -1
  479. package/package/corpus/skills/cratis-ux-review/references/report-template.md +2 -1
  480. package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +19 -132
  481. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/ai-tells.md +24 -97
  482. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/author-and-batch.md +23 -0
  483. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/documentation-evidence.md +25 -0
  484. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/interpretation.md +17 -0
  485. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/stock-constructions.md +23 -0
  486. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/voice-guidance.md +8 -29
  487. package/package.json +1 -1
  488. /package/package/corpus/skills/cratis-chronicle-protect-decision/references/{standalone.md → csharp-standalone.md} +0 -0
  489. /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/silent-backup-failure.md → silent-backup-failure.md} +0 -0
  490. /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/unintended-release-regression.md → unintended-release-regression.md} +0 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-arc-spring-data-kotlin
3
- description: Use when wiring Spring Data JPA or MongoDB persistence, current-state injection or storage-backed observations in an Arc Kotlin application (Kotlin only). Not for Chronicle projections, C# EF Core or query transport alone.
3
+ description: Use when wiring Spring Data JPA or MongoDB persistence, current-state injection or storage-backed observations in an Arc Kotlin application (Kotlin only). Not for building a Chronicle projection (use cratis-chronicle-project-view).
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -9,18 +9,15 @@ license: MIT
9
9
 
10
10
  # Use Spring Data with Arc in Kotlin
11
11
 
12
- This is a Kotlin-only recipe.
13
-
14
- For Java MongoDB observations, subscribe to the `Flow.Publisher` returned by `MongoObservations.observe(queries, TaskView.class, criteria)` instead of using Kotlin flow extensions.
15
-
16
12
  Keep Spring Data responsible for persistence and Arc responsible for the
17
13
  model-bound command/query pipeline. Repository injection alone does not isolate
18
14
  tenants or turn a repository into an observable source.
19
15
 
20
16
  ## Install
21
17
 
22
- Add `io.cratis:arc-spring-data-jpa:<version>` or
23
- `io.cratis:arc-spring-data-mongodb:<version>`; both include the Arc Spring Boot
18
+ Start with the application’s existing store. Add `io.cratis:arc-spring-data-jpa`
19
+ for a relational store or `io.cratis:arc-spring-data-mongodb` for documents.
20
+ Both include the Arc Spring Boot
24
21
  starter and corresponding Spring Data starter. Spring owns repository discovery,
25
22
  datasource/entity manager, Mongo client and their standard configuration.
26
23
 
@@ -50,15 +47,15 @@ data class TaskView(@Id val id: String = "", val title: String = "") {
50
47
  interface TaskViewRepository : JpaRepository<TaskView, String>
51
48
  ```
52
49
 
53
- The same injection pattern works with `MongoRepository`, fragments or an
54
- application query service.
50
+ Choose `MongoRepository` when the model is a MongoDB document. The same
51
+ `@FromServices` pattern works with repository fragments or application query services.
55
52
  Protect the query with the application's authorization policy; mapping does
56
53
  not make it safe to expose anonymously.
57
54
 
58
55
  A query can declare exact non-null Spring Data Commons `Pageable` and `Sort`.
59
56
  KSP binds them from the captured `QueryRequest`, not thread-local request scope.
60
57
  Such queries must return exact `org.springframework.data.domain.Page<T>`;
61
- Arc normalizes it into `QueryPage<T>` before renderers, preserving pre-page
58
+ Arc normalizes it into `QueryPage<T>` before rendering, preserving pre-page
62
59
  total count. Page size zero means unpaged; blank sort field means unsorted.
63
60
  Do not confuse Spring Data `Page<T>` with a nonexistent Arc `Page<T>`.
64
61
 
@@ -102,46 +99,11 @@ MongoDB change streams require a replica set or sharded cluster; invalidations
102
99
  cause a fresh filtered snapshot so rows that stop matching disappear. JPA
103
100
  observations are **in-process only**: publish committed changes through
104
101
  `DatabaseChangePublisher`. There is no silent polling or cross-process JPA
105
- notification. A tenant label on a JPA notification is not storage isolation.
106
-
107
- ## Tenant-bound storage and concepts
108
-
109
- Resolve/authenticate the tenant using `cratis-arc-identity-and-tenancy-kotlin`
110
- first. Then select certified isolated stores:
111
-
112
- - JPA: an application `JpaPersistenceUnitResolver` returns a `JpaPersistenceUnit`
113
- certified for the requested tenant/namespace and mapped type.
114
- - Mongo: a `TenantAwareMongoOperationsResolver` returns `TenantMongoOperations`
115
- for the exact tenant. Unknown tenants throw; mismatched certificates fail,
116
- never fall back to a default database.
117
- - `TenantContextMongoAccess.operations()` resolves the ambient tenant on **each
118
- call**, not at construction. Establish `withTenant` explicitly; the command
119
- pipeline does not create this ambient scope for you. The auto-configured access has no fallback tenant.
120
-
121
- Plain injected repositories are not automatically routed by tenant. Native
122
- collection access uses Arc's `NamingPolicy`, while Spring Data operations respect
123
- `@Document`; choose deliberately. When changing a Chronicle projection’s collection name, verify that the projection writes to the same collection the Spring Data query reads.
124
-
125
- Concept persistence needs store-specific converters: JPA attribute converters
126
- (or embedded ids for composite identity), Mongo concrete scalar read/write pairs.
127
- Do not persist a generic `ConceptAs` wrapper as an arbitrary object or assume a
128
- JSON converter also handles BSON/JPA. Read the tagged `concepts-jpa.mdx` and
129
- `concepts-mongodb.mdx` guides for the actual identifier type and converter registration.
130
-
131
- ## Transactions are explicit, thread-bound opt-ins
132
-
133
- `cratis.arc.spring-data.jpa.command-transactions-enabled` and
134
- `cratis.arc.spring-data.mongodb.command-transactions-enabled` default to false.
135
- Enable only for a verified fixed store and identity-aligned transaction manager.
136
- Dynamic tenant stores are not auto-enrolled. Even enabled, command persistence
137
- must not suspend or switch threads: imperative Spring transactions are not
138
- coroutine-safe. They commit only a successful final `CommandResult` and roll
139
- back failures when completing on the opening thread.
140
-
141
- There is **no distributed transaction** across JPA, MongoDB and Chronicle.
142
- Chronicle completion follows local scopes, but a local store may already commit
143
- before another store or Chronicle fails. Define reconciliation for partial or
144
- indeterminate outcomes rather than claiming atomic cross-store success.
102
+ notification. In Java, subscribe to the `Flow.Publisher` from
103
+ `MongoObservations.observe(queries, TaskView.class, criteria)` for the same MongoDB snapshot pattern.
104
+ A tenant label on a JPA notification is not storage isolation.
105
+
106
+ Read [storage boundaries](references/storage-boundaries.md) when selecting a tenant’s store, persisting concepts, or enabling command transactions.
145
107
 
146
108
  ## Verify
147
109
 
@@ -153,6 +115,6 @@ indeterminate outcomes rather than claiming atomic cross-store success.
153
115
  - For JPA, verify committed notifications, rollback suppression and the intended
154
116
  in-process boundary; test thread affinity before enabling transactions.
155
117
 
156
- Query transport: [cratis-arc-expose-query](../cratis-arc-expose-query/references/kotlin.md). For the Chronicle JVM client, use the `cratis-chronicle-select-client` skill (in `cratis/chronicle`); this skill covers Spring Data observation.
118
+ For query transport, use `cratis-arc-expose-query`. For the Chronicle JVM client, use the `cratis-chronicle-select-client` skill (in `cratis/chronicle`); this skill covers Spring Data observation.
157
119
 
158
120
  For an existing projection, read [how to change collection names safely](references/read-model-naming.md).
@@ -1,3 +1,11 @@
1
1
  # Switch collections without stranding existing projections
2
2
 
3
- Check the writer's naming policy and the collection selected by the Spring Data `@Document` mapping. After a rename, replay into the new collection and compare a known tenant's reads before switching the repository and retiring the old collection. Do not test only a fresh empty database: a mapping change does not rename persisted collections.
3
+ Check the writer’s naming policy and compare it with the collection selected by
4
+ Spring Data `@Document`. A native tenant-bound collection uses the kernel-aligned
5
+ naming policy; the mapped Spring Data access uses the document mapping. For
6
+ example, the native policy pluralizes `Person` as `People`.
7
+
8
+ When renaming a live projection collection, rebuild or replay into the new
9
+ collection. Compare a known tenant’s existing reads before switching the reader
10
+ or retiring the old collection. A mapping change does not move stored data; an
11
+ empty test database cannot prove continuity for an existing projection.
@@ -0,0 +1,40 @@
1
+ # Choose isolated stores or opt into command transactions
2
+
3
+ ## Tenant-bound storage and concepts
4
+
5
+ Resolve/authenticate the tenant using `cratis-arc-identity-and-tenancy-kotlin`
6
+ first. Then select certified isolated stores:
7
+
8
+ - JPA: an application `JpaPersistenceUnitResolver` returns a `JpaPersistenceUnit`
9
+ certified for the requested tenant/namespace and mapped type.
10
+ - Mongo: a `TenantAwareMongoOperationsResolver` returns `TenantMongoOperations`
11
+ for the exact tenant. Unknown tenants throw; mismatched certificates fail,
12
+ never fall back to a default database.
13
+ - `TenantContextMongoAccess.operations()` resolves the ambient tenant on **each
14
+ call**, not at construction. Establish `withTenant` explicitly; the command
15
+ pipeline does not create this ambient scope for you. The auto-configured access has no fallback tenant.
16
+
17
+ Plain injected repositories are not automatically routed by tenant. Native
18
+ collection access uses Arc's `NamingPolicy`, while Spring Data operations respect
19
+ `@Document`; choose deliberately. When changing a Chronicle projection’s collection name, verify that the projection writes to the same collection the Spring Data query reads.
20
+
21
+ Concept persistence needs store-specific converters: JPA attribute converters
22
+ (or embedded ids for composite identity), Mongo concrete scalar read/write pairs.
23
+ Do not persist a generic `ConceptAs` wrapper as an arbitrary object or assume a
24
+ JSON converter also handles BSON/JPA. Use the Arc Kotlin guides “Map JPA concepts” and “Map MongoDB concepts”
25
+ for identifier mapping and converter registration.
26
+
27
+ ## Transactions are explicit, thread-bound opt-ins
28
+
29
+ `cratis.arc.spring-data.jpa.command-transactions-enabled` and
30
+ `cratis.arc.spring-data.mongodb.command-transactions-enabled` default to false.
31
+ Enable only for a verified fixed store and identity-aligned transaction manager.
32
+ Dynamic tenant stores are not auto-enrolled. Even enabled, command persistence
33
+ must not suspend or switch threads: imperative Spring transactions are not
34
+ coroutine-safe. They commit only a successful final `CommandResult` and roll
35
+ back failures when completing on the opening thread.
36
+
37
+ There is **no distributed transaction** across JPA, MongoDB and Chronicle.
38
+ Chronicle completion follows local scopes, but a local store may already commit
39
+ before another store or Chronicle fails. Define reconciliation for partial or
40
+ indeterminate outcomes rather than claiming atomic cross-store success.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-arc-storage-typescript
3
- description: Use when an Arc Node.js server must read or observe read models in MongoDB or a SQL database through Drizzle. Not for Chronicle projections, query method design or the C# EF Core and MongoDB integrations.
3
+ description: Use when an Arc Node.js server must read or observe read models in MongoDB or a SQL database through Drizzle. Not for defining a query (use cratis-arc-expose-query).
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -16,17 +16,22 @@ need the model's `@field` declarations.
16
16
  | `@cratis/arc.mongodb` | `withMongoDB` | `mongodb@^6.21.0` | documents, change-stream observation |
17
17
  | `@cratis/arc.drizzle` | `withDrizzle` | `drizzle-orm` `^0.45.0`, `rxjs` | PostgreSQL, MySQL, SQLite tables |
18
18
 
19
- For query methods and argument binding, use [cratis-arc-expose-query](../cratis-arc-expose-query/references/typescript.md); this skill covers storage.
19
+ For query methods and argument binding, use `cratis-arc-expose-query`.
20
20
 
21
- ## MongoDB
21
+ ## Query the existing store
22
+
23
+ Use MongoDB for a document read model. Choose [SQL with Drizzle](references/drizzle.md) when the model lives in a SQL table.
24
+
25
+ This excerpt assumes an Arc application `builder`, a MongoDB `client`, and
26
+ a tenancy setup that supplies a tenant. Use `default` for the base database.
22
27
 
23
28
  ```typescript
24
29
  import { field, Guid } from '@cratis/fundamentals';
25
- import { key, query, queryOptions, readModel, service, type QueryOptions } from '@cratis/arc.core';
30
+ import { query, queryOptions, readModel, service, type QueryOptions } from '@cratis/arc.core';
26
31
  import { mongoCollection, type MongoCollection } from '@cratis/arc.mongodb';
27
32
 
28
33
  export class TaskRecord {
29
- @field(Guid) @key() id!: Guid;
34
+ @field(Guid) id!: Guid;
30
35
  @field(String) title!: string;
31
36
  }
32
37
  const tasks = mongoCollection(TaskRecord);
@@ -38,12 +43,13 @@ export class TaskQueries {
38
43
  return items.queryPage({}, options);
39
44
  }
40
45
  }
41
- // builder.add(TaskQueries).withMongoDB({ client, database: 'tasks', readModels: [TaskRecord] });
46
+ builder.add(TaskQueries).withMongoDB({ client, database: 'tasks', readModels: [TaskRecord] });
42
47
  ```
43
48
 
44
49
  - `@key()` marks the field stored as `_id`; without it a field named `id` is
45
- used; a model with neither, or with several keys, is rejected. Only `@field`
46
- properties are read and written.
50
+ used (or `_id`). Multiple explicit keys are rejected. With conventions
51
+ enabled a key is required and only `@field` properties are mapped.
52
+ Use `ignoreConventions` only when deliberately opting out of BSON mapping.
47
53
  - List every injected model in `readModels`. `mongoCollection(Type)` resolves to
48
54
  the collection in the current tenant's database.
49
55
  - Options: `client` or `server` (URI), `database` (default; other tenants use
@@ -80,59 +86,6 @@ export class TaskQueries {
80
86
  because the watcher never silently skips an interval. It is not a durable
81
87
  event consumer.
82
88
 
83
- ## SQL with Drizzle
84
-
85
- ```typescript
86
- import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
87
- import { DrizzleDialect, drizzleReadModel, guidCodec, sqliteColumn, type DrizzleReadModels } from '@cratis/arc.drizzle';
88
-
89
- export const tasks = sqliteTable('tasks', {
90
- id: sqliteColumn(guidCodec(DrizzleDialect.SQLite))('id').primaryKey(),
91
- title: text('title').notNull()
92
- });
93
- export class TaskRecord {
94
- @field(Guid) @key() id!: Guid;
95
- @field(String) title!: string;
96
- }
97
- @readModel()
98
- export class TaskQueries {
99
- @query(service(drizzleReadModel(TaskRecord)), queryOptions())
100
- static page(rows: DrizzleReadModels<TaskRecord>, options: QueryOptions) {
101
- return rows.queryPage(undefined, options);
102
- }
103
- }
104
- // builder.add(TaskQueries).withDrizzle({ dialect: DrizzleDialect.SQLite, database,
105
- // readModels: [{ type: TaskRecord, table: tasks }] });
106
- ```
107
-
108
- - Each `@field` needs a column under the **same property key** of the Drizzle
109
- table object (the SQL column name is yours); the table needs a primary key.
110
- Registration fails otherwise. Columns not on the model are never selected.
111
- - Options: `dialect` (`DrizzleDialect.PostgreSQL | MySQL | SQLite`), `database`
112
- (default tenant only), `databaseFactory(tenant, context)` (sync or async; the
113
- application caches and disposes), `readModels`, `maxPageSize`, `observation`.
114
- With neither a factory nor a matching `database`, access fails with
115
- `A tenant is required for Drizzle access`.
116
- - **Codecs** map Arc types to columns: `guidCodec(dialect)` (`uuid`, `char(36)`,
117
- `text`), `conceptCodec(Concept, ConceptCodecKind.String | Number, dialect)`,
118
- `dateOnlyCodec`, `timeOnlyCodec`, `timeSpanCodec`, `jsonCodec(dialect,
119
- validate)`, wrapped by `pgColumn`, `mysqlColumn` or `sqliteColumn`. A concept
120
- class declares `static readonly valueType` because generics are erased.
121
- - **Schema.** Arc checks table against model at startup and never creates,
122
- alters or migrates the database. Add the column to the table, the model and a
123
- migration together (for example a drizzle-kit migration you own).
124
- - **Writes** go through `drizzleDatabase<TDatabase>()` injected into `handle()`;
125
- `database.native` is the Drizzle database. `queryPage` pushes count, sort,
126
- limit and offset into SQL.
127
- - **Observation is opt-in.** `DrizzleObservation.InProcess` sees only writes
128
- announced with `database.notifyChanged(table)` in this process.
129
- `DrizzleObservation.PostgreSQLNotify` sees committed changes from any process:
130
- install the trigger SQL from `postgresqlChangeTrigger(table, { schema })` in an
131
- application migration and pass a listener factory returning a **new, dedicated**
132
- `pg.Client` through `nodePostgresListener` (`pg` `^8`). Arc does not create
133
- database objects at runtime. NOTIFY is not a durable log: states during a
134
- disconnect are not replayed.
135
-
136
89
  ## Pitfalls
137
90
 
138
91
  - A singleton holding a collection or connection keeps the first tenant; keep
@@ -143,6 +96,8 @@ export class TaskQueries {
143
96
 
144
97
  ## Verify
145
98
 
146
- Run the package's specs against the real engine where you can (MongoDB needs a
147
- replica set for `observe`). `cratis-arc-testing-typescript` covers
148
- `QueryScenario` for query shape; it does not prove database behavior.
99
+ Run a query against the real store with records in two tenants. Verify the
100
+ result contains only the selected tenant’s rows and reports the total before
101
+ paging. For an observation, write a matching row and check the replacement
102
+ snapshot; MongoDB needs a replica set or sharded cluster. Use
103
+ `cratis-arc-testing-typescript` for query shape, not as proof of isolation.
@@ -0,0 +1,62 @@
1
+ # Query and observe a SQL read model
2
+
3
+ ## SQL with Drizzle
4
+
5
+ This excerpt assumes an Arc application `builder` and your initialized Drizzle SQLite `database` for the default tenant.
6
+
7
+ ```typescript
8
+ import { field, Guid } from '@cratis/fundamentals';
9
+ import { query, queryOptions, readModel, service, type QueryOptions } from '@cratis/arc.core';
10
+ import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
11
+ import { DrizzleDialect, drizzleReadModel, guidCodec, sqliteColumn, type DrizzleReadModels } from '@cratis/arc.drizzle';
12
+
13
+ export const tasks = sqliteTable('tasks', {
14
+ id: sqliteColumn(guidCodec(DrizzleDialect.SQLite))('id').primaryKey(),
15
+ title: text('title').notNull()
16
+ });
17
+ export class TaskRecord {
18
+ @field(Guid) id!: Guid;
19
+ @field(String) title!: string;
20
+ }
21
+ @readModel()
22
+ export class TaskQueries {
23
+ @query(service(drizzleReadModel(TaskRecord)), queryOptions())
24
+ static page(rows: DrizzleReadModels<TaskRecord>, options: QueryOptions) {
25
+ return rows.queryPage(undefined, options);
26
+ }
27
+ }
28
+ builder.add(TaskQueries).withDrizzle({ dialect: DrizzleDialect.SQLite, database,
29
+ readModels: [{ type: TaskRecord, table: tasks }] });
30
+ ```
31
+
32
+ - Each `@field` needs a column under the **same property key** of the Drizzle
33
+ table object (the SQL column name is yours); the table needs a primary key.
34
+ Registration fails otherwise. The selection includes declared model fields
35
+ and primary-key columns; only declared fields materialize on the model.
36
+ - Options: `dialect` (`DrizzleDialect.PostgreSQL | MySQL | SQLite`), `database`
37
+ (default tenant only), `databaseFactory(tenant, context)` (sync or async; the
38
+ application caches and disposes), `readModels`, `maxPageSize`, `observation`.
39
+ Supply exactly one of `database` or `databaseFactory`. Access without a
40
+ tenant, or to a named tenant with only `database`, fails.
41
+ - **Codecs** map Arc types to columns: `guidCodec(dialect)` (`uuid`, `char(36)`,
42
+ `text`), `conceptCodec(Concept, ConceptCodecKind.String | Number, dialect)`,
43
+ `dateOnlyCodec`, `timeOnlyCodec`, `timeSpanCodec`, `jsonCodec(dialect,
44
+ validate)`, wrapped by `pgColumn`, `mysqlColumn` or `sqliteColumn`. A concept
45
+ class declares `static readonly valueType` because generics are erased.
46
+ - **Schema.** Arc checks table against model at startup and never creates,
47
+ alters or migrates the database. Add the column to the table, the model and a
48
+ migration together (for example a drizzle-kit migration you own).
49
+ - **Writes** go through `drizzleDatabase<TDatabase>()` injected into `handle()`;
50
+ `database.native` is the Drizzle database. `queryPage` pushes count, sort,
51
+ limit and offset into SQL.
52
+ - **Observation is opt-in.** `DrizzleObservation.InProcess` sees only writes
53
+ announced with `database.notifyChanged(table)` in this process.
54
+ `{ mode: DrizzleObservation.PostgreSQLNotify, listener }` sees committed changes
55
+ from any process. Install the trigger SQL in an application migration. For a
56
+ plain `pgTable`, call `postgresqlChangeTrigger(table, { schema: 'public' })`
57
+ if the table is in `public`; otherwise pass its actual schema. For a table
58
+ declared with `pgSchema`, call `postgresqlChangeTrigger(table)`.
59
+ Use `nodePostgresListener` (`pg` `^8`) with a **new, unconnected, dedicated**
60
+ `pg.Client` per listener. Route the listener and reader to the same tenant
61
+ database. Arc does not install the trigger at runtime, and NOTIFY does not
62
+ replay changes that happened during a disconnect.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-arc-tenancy-typescript
3
- description: Use when an Arc Node.js server must pick the tenant for each request, prove the caller belongs to it or send data to per-tenant storage. Not for caller authentication, Chronicle namespaces alone or the C# Arc resolver.
3
+ description: Use when tuning tenant selection or storage routing for an Arc Node.js server, including claim-based or custom resolution and long-lived execution. Not for the basic tenant membership check (use cratis-arc-isolate-tenant).
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -20,67 +20,37 @@ None replaces another. A database per tenant does not stop a caller from naming
20
20
  someone else's tenant in a header. The package is `@cratis/arc.core`
21
21
  (`ArcApplication`, `TenantResolverType`).
22
22
 
23
- ## Choose how the tenant is selected
23
+ ## Resolve a verified tenant
24
24
 
25
- | Configure | Behavior |
26
- | --- | --- |
27
- | nothing | Reads the `x-cratis-tenant-id` header unchanged; missing means `tenantId` is `undefined` |
28
- | `tenancy: { resolve(request, principal) }` | Your resolver alone decides (may be `async`); `undefined` means no tenant; no fallback; Arc does not apply `sources`, `required`, `membershipClaim` or lowercasing to it |
29
- | `tenancy: { sources: [...] }` | Ordered built-in sources, first nonempty answer wins |
30
- | `tenancy: { resolverType }` | One .NET-compatible source (defaults to `header` once `tenancy` is present); never combine with `sources` |
31
-
32
- Built-in sources (`TenantResolverType`):
33
-
34
- | Source | Option (default) | Reads |
35
- | --- | --- | --- |
36
- | `header` | `httpHeader` (`x-cratis-tenant-id`) | request header |
37
- | `query` | `queryParameter` (`tenantId`) | query string |
38
- | `claim` | `claimType` (`tenant_id`) | own string claim of an authenticated principal |
39
- | `fixed` | `fixedTenantId` (`development`) | configured deployment value |
40
- | `development` | `fixedTenantId` (`development`) | same fixed source; does **not** check the environment |
41
- | `subdomain` | `baseDomain` (required) | the adapter's verified `native.authority`, never raw `Host`/`X-Forwarded-Host` |
42
-
43
- Shared options: `required` (unresolved tenant answers 400) and
44
- `membershipClaim` (a comma-separated own claim of an authenticated principal
45
- must include the selected tenant, else 403). Tenant IDs are lowercased and must
46
- be DNS labels (letters, digits, hyphens, at most 63 characters); an invalid
47
- selected ID answers 400. A single-tenant app uses
48
- `{ resolverType: TenantResolverType.Fixed, fixedTenantId: 'default' }`.
25
+ When the identity provider assigns one active tenant and callers cannot switch
26
+ it, select a tenant claim from verified authentication. If callers switch
27
+ tenants, keep Arc’s default header selector and use the membership check in
28
+ the `cratis-arc-isolate-tenant` skill (installed with `cratis/arc/server-typescript`).
29
+ In either tenant-only host, require a selection and verify membership. In this excerpt, `verifiedHandlers` holds the app’s authentication handlers:
49
30
 
50
31
  ```typescript
32
+ import { ArcApplication, TenantResolverType } from '@cratis/arc.core';
33
+
51
34
  const builder = ArcApplication.createBuilder({
52
- authentication: [/* verified handlers */],
53
- tenancy: {
54
- sources: [TenantResolverType.Claim, TenantResolverType.Header],
55
- claimType: 'tenant', membershipClaim: 'tenants', required: true
56
- }
35
+ authentication: verifiedHandlers,
36
+ tenancy: { resolverType: TenantResolverType.Claim, membershipClaim: 'tenants', required: true }
57
37
  });
58
38
  ```
59
39
 
60
- This tries an own `tenant` claim first, then the header; a missing tenant is
61
- 400 and a tenant absent from the `tenants` claim is 403. `resolverType`,
62
- `httpHeader`, `baseDomain`, `queryParameter`, `claimType`, `fixedTenantId`,
63
- `required` and `membershipClaim` also bind from `Cratis:Arc:Tenancy` in
64
- `appsettings.json`; `sources` and `resolve` are code-only.
65
-
66
- ## Prove membership
40
+ With `tenant_id: 'acme'` and `tenants: 'acme, other'`, the execution receives
41
+ `acme`. No tenant is 400; a selected tenant absent from `tenants` is 403. The
42
+ built-in resolver normalizes case and rejects malformed IDs. Without tenancy
43
+ options, Arc only reads the header; that is not membership enforcement.
67
44
 
68
- - A header, query string or subdomain value is a request, not proof. When
69
- tenants separate customers, use the `claim` source with `membershipClaim`, or
70
- derive the tenant from the principal in `tenancy.resolve` and check
71
- membership there; return lowercase IDs.
72
- - Enforce membership in tenancy options or authorization, never in validators:
73
- a trusted direct caller can lower the blocking severity.
74
- - Never use `development` or `fixed` to accept a browser-supplied tenant.
75
- - Treat tenant IDs as internal metadata; keep them out of public URLs and
76
- error text when a customer name would reveal who else uses the system.
45
+ Read [tenant selection](references/tenant-selection.md) when selecting a tenant
46
+ through deployment configuration, ordered built-in sources, or a custom resolver.
77
47
 
78
48
  ## Storage follows the tenant
79
49
 
80
50
  | Integration | Tenant `acme` | Tenant `default` | No tenant |
81
51
  | --- | --- | --- | --- |
82
52
  | MongoDB, `database: 'tasks'` | database `tasks+acme` (or `databaseNameResolver`) | `tasks` | request fails |
83
- | Drizzle | the connection `databaseFactory('acme', context)` returns | `databaseFactory('default', context)` or the `database` option | request fails |
53
+ | Drizzle | the connection `databaseFactory('acme', context)` returns | `databaseFactory('default', context)` or, when configured instead, `database` | request fails |
84
54
  | Chronicle | namespace `acme` | namespace `default` | namespace `Default` |
85
55
 
86
56
  MongoDB and Drizzle lowercase the tenant; Chronicle passes it unchanged, so
@@ -103,15 +73,15 @@ Callbacks receive the execution context (`tenantId`, `principal`,
103
73
  | Direct call (job) | `tenantId` in the context you pass | that call |
104
74
 
105
75
  Keep tenant-scoped handles (collections, connections, caches) in scoped
106
- services: a singleton keeps the first tenant that created it. Background work
107
- that calls the server directly must pass a tenant on purpose. Put the tenant in
108
- cache keys and logs.
76
+ services: a singleton can retain another request’s tenant. Background calls must supply
77
+ a tenant explicitly. Include it in cache keys; never log membership claims or
78
+ credentials.
109
79
 
110
80
  ## Specify and verify
111
81
 
112
82
  `CommandScenario.for(...).withContext({ tenantId: 'acme', principal })` proves
113
83
  your code uses the tenant it is given; it does not prove the resolver or storage
114
- configuration. Cover four tenant states (none, `default`, two named tenants),
84
+ configuration. Cover a missing tenant, `default`, two named tenants,
115
85
  a denied selection (403, nothing read or written), concurrent requests for two
116
86
  tenants, long-lived work (observable queries, reactors) and direct calls.
117
87
  `cratis-arc-testing-typescript` has the scenario setup; use `ArcScenario` with
@@ -119,7 +89,6 @@ HTTP requests to test the resolver itself.
119
89
 
120
90
  ## Route near misses
121
91
 
122
- - Node host setup: [cratis-arc-select-backend-sdk](../cratis-arc-select-backend-sdk/SKILL.md).
92
+ - Node host setup: `cratis-arc-select-backend-sdk`.
123
93
  - Chronicle namespaces in .NET: the `cratis-chronicle-connect-application` skill (in `cratis/chronicle/client-dotnet`).
124
- - Request authorization: [cratis-arc-authorize-request](../cratis-arc-authorize-request/references/typescript.md).
125
- - C# Arc tenant resolution: the C# Arc skills.
94
+ - Request authorization: `cratis-arc-authorize-request`.
@@ -0,0 +1,49 @@
1
+ # Choose an alternate tenant source
2
+
3
+ ## Choose how the tenant is selected
4
+
5
+ | Configure | Behavior |
6
+ | --- | --- |
7
+ | nothing | Reads the `x-cratis-tenant-id` header unchanged; missing means `tenantId` is `undefined` |
8
+ | `tenancy: { resolve(request, principal) }` | Your resolver alone decides (may be `async`); `undefined` means no tenant; no fallback; Arc does not apply `sources`, `required`, `membershipClaim` or lowercasing to it |
9
+ | `tenancy: { sources: [...] }` | Ordered built-in sources, first nonempty answer wins |
10
+ | `tenancy: { resolverType }` | One built-in strategy (defaults to `header` once `tenancy` is present); `subdomain` falls back to the header. Never combine with `sources` |
11
+
12
+ Built-in sources (`TenantResolverType`):
13
+
14
+ | Source | Option (default) | Reads |
15
+ | --- | --- | --- |
16
+ | `header` | `httpHeader` (`x-cratis-tenant-id`) | request header |
17
+ | `query` | `queryParameter` (`tenantId`) | query string |
18
+ | `claim` | `claimType` (`tenant_id`) | own string claim of an authenticated principal |
19
+ | `fixed` | `fixedTenantId` (`development`) | configured deployment value |
20
+ | `development` | `fixedTenantId` (`development`) | same fixed source; does **not** check the environment |
21
+ | `subdomain` | `baseDomain` (required) | the adapter's verified `native.authority`, never raw `Host`/`X-Forwarded-Host` |
22
+
23
+ Shared options: `required` (unresolved tenant answers 400) and
24
+ `membershipClaim` (a comma-separated own claim of an authenticated principal
25
+ must include the selected tenant, else 403). Tenant IDs are lowercased and must
26
+ be DNS labels (letters, digits, hyphens, at most 63 characters); an invalid
27
+ selected ID answers 400. A single-tenant app uses
28
+ `{ resolverType: TenantResolverType.Fixed, fixedTenantId: 'default' }`.
29
+
30
+ Choose ordered `sources` when more than one verified selection workflow is
31
+ required. For example, use `[TenantResolverType.Claim, TenantResolverType.Header]`
32
+ with `membershipClaim` when the header is a supported fallback. A malformed
33
+ selected ID is rejected; selection does not continue to a later source.
34
+
35
+ `resolverType`, `httpHeader`, `baseDomain`, `queryParameter`, `claimType`, `fixedTenantId`,
36
+ `required` and `membershipClaim` also bind from `Cratis:Arc:Tenancy` in
37
+ `appsettings.json`; `sources` and `resolve` are code-only.
38
+
39
+ ## Prove membership
40
+
41
+ - A header, query string or subdomain value is a request, not proof. When
42
+ tenants separate customers, verify membership independently. For a custom
43
+ `tenancy.resolve`, derive or validate the selection against verified caller
44
+ membership there; return lowercase IDs.
45
+ - Enforce membership in tenancy options or authorization, never in validators:
46
+ a trusted direct caller can lower the blocking severity.
47
+ - Never use `development` or `fixed` to accept a browser-supplied tenant.
48
+ - Treat tenant IDs as internal metadata; keep them out of public URLs and
49
+ error text when a customer name would reveal who else uses the system.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-arc-testing-kotlin
3
- description: Use when writing or diagnosing Kotlin or Java Arc pipeline specifications without Spring Boot or a kernel. Not for standalone Chronicle client tests, C# scenarios or defining production commands and queries.
3
+ description: Use when writing or diagnosing Kotlin or Java Arc pipeline specifications without Spring Boot or a kernel. Not for choosing a standalone Chronicle client (use cratis-chronicle-select-client).
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -13,8 +13,9 @@ Use generated artifacts through the real pipelines, not hand-written handlers
13
13
  that bypass KSP wiring. `arc-testing` needs neither Spring Boot nor Docker.
14
14
  This is test support, not an alternative production host.
15
15
 
16
- Add `testImplementation("io.cratis:arc-testing:<version>")`; align it with the runtime,
17
- plugin and KSP version.
16
+ Add `io.cratis:arc-testing` as a Gradle test dependency. Start with
17
+ `CommandScenario` for command execution or validation; select a query scenario
18
+ only when the behavior depends on the query pipeline.
18
19
 
19
20
  ## Choose the pipeline
20
21
 
@@ -29,8 +30,8 @@ Application specs select a generated `ArcArtifactModule`. Manual
29
30
  Arrange services, validators, authorization policies, filters, principal,
30
31
  tenant and correlation id on the scenario before executing it.
31
32
 
32
- Illustrative excerpt: `module` is the generated module; `CreateTask` and its
33
- `TaskRepository`/`TaskCreated` types are supplied by the application.
33
+ This excerpt assumes the generated `module`, the slice’s command and response
34
+ types, and a fake `repository` implementing `TaskRepository`.
34
35
 
35
36
  ```kotlin
36
37
  // Copyright (c) Cratis. All rights reserved.
@@ -90,35 +91,16 @@ empty or early. Chain `shouldHaveEmissionCount(expected)` when count matters.
90
91
  `addEmissionGuard` supplies per-emission checks; assert opening rejection with
91
92
  `shouldFail()` and terminal guard denial with `shouldTerminateUnauthorized()`.
92
93
 
93
- ## Chronicle integration without a kernel
94
-
95
- Add the Chronicle starter (or `io.cratis:cratis`) alongside `arc-testing`.
96
- Its `CommandScenarioExtender` is found through `ServiceLoader` and supplies
97
- an in-memory event log automatically. `givenChronicle().events(id, event)`
98
- establishes prior history; `chronicle().shouldHaveAppendedEvent(id, Event::class.java)`
99
- checks the new append. Given events are excluded from `appendedEvents`.
100
- Arrange `constraintViolation(...)` or `concurrencyViolation(...)` to reject an
101
- append deterministically and assert `shouldHaveConstraintViolation(...)` or
102
- `shouldHaveConcurrencyViolation(...)`. Rejected appends are not appended events.
103
- This does not verify a real kernel constraint or storage integration.
104
-
105
- ## Java and verification
106
-
107
- Use the closeable `BlockingCommandScenario` over a configured scenario for
108
- ordinary Java tests; configure pins, tenant resolution and Chronicle before
109
- constructing the bridge. `ChronicleCommandScenarios` exposes Kotlin extensions
110
- as Java statics. For asynchronous tests use `AsyncCommandScenario`,
111
- `AsyncQueryScenario`, `AsyncObservableQueryScenario` and a `JavaAsyncScope`.
112
- `usingExecutor` borrows an executor; `owningExecutorService` owns shutdown.
113
- Scenarios borrow the scope; close the owner after the test.
114
- `collectAsync` returns a `CompletionStage` with bounded collection. Timeout
115
- cancels the stage; callback-based `collect` does not deliver timeout callbacks.
116
-
117
- - Follow the `for_`/`when_` naming conventions in `kotlin.md`/`java.md`.
94
+ Read [JVM scenario variants](references/jvm-scenario-variants.md) when asserting Chronicle appends without a kernel or using Java scenario bridges.
95
+
96
+ ## Verify
97
+
98
+ - Follow the `for_`/`when_` naming convention.
118
99
  - Run `./gradlew build` with warnings treated as errors and all affected specs.
119
100
  - Verify authorization, rejection, absence and failure paths that apply, not
120
101
  only a successful response.
121
102
  - Run real-store integration checks separately when the behavior depends on
122
103
  kernel constraints, persistence, transactions or change streams.
123
104
 
124
- For definition rather than tests, use [declare the command](../cratis-arc-declare-command/references/kotlin.md) for commands, [cratis-arc-expose-query](../cratis-arc-expose-query/references/kotlin.md) for queries and [cratis-arc-validation-kotlin](../cratis-arc-validation-kotlin/SKILL.md) for validation.
105
+ For definitions rather than tests, use `cratis-arc-declare-command`,
106
+ `cratis-arc-expose-query`, or `cratis-arc-validation-kotlin`.
@@ -0,0 +1,25 @@
1
+ # Configure Chronicle and Java scenarios
2
+
3
+ ## Chronicle integration without a kernel
4
+
5
+ Add the Chronicle starter (or `io.cratis:cratis`) alongside `arc-testing`.
6
+ Its `CommandScenarioExtender` is found through `ServiceLoader` and supplies
7
+ an in-memory event log automatically. `givenChronicle().events(id, event)`
8
+ establishes prior history; `chronicle().shouldHaveAppendedEvent(id, Event::class.java)`
9
+ checks the new append. Given events are excluded from `appendedEvents`.
10
+ Arrange `constraintViolation(...)` or `concurrencyViolation(...)` to reject an
11
+ append deterministically and assert `shouldHaveConstraintViolation(...)` or
12
+ `shouldHaveConcurrencyViolation(...)`. Rejected appends are not appended events.
13
+ This does not verify a real kernel constraint or storage integration.
14
+
15
+ ## Java scenario bridges
16
+
17
+ Use the closeable `BlockingCommandScenario` over a configured scenario for
18
+ ordinary Java tests; configure pins, tenant resolution and Chronicle before
19
+ constructing the bridge. `ChronicleCommandScenarios` exposes Kotlin extensions
20
+ as Java statics. For asynchronous tests use `AsyncCommandScenario`,
21
+ `AsyncQueryScenario`, `AsyncObservableQueryScenario` and a `JavaAsyncScope`.
22
+ `usingExecutor` borrows an executor; `owningExecutorService` owns shutdown.
23
+ Scenarios borrow the scope; close the owner after the test.
24
+ `collectAsync` returns a `CompletionStage` with bounded collection. Timeout
25
+ cancels the stage; callback-based `collect` does not deliver timeout callbacks.