@cratis/pi 8.0.2 → 8.1.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 (486) 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/orleans.instructions.md +5 -98
  33. package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +9 -63
  34. package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +1 -1
  35. package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +8 -148
  36. package/package/corpus/harnesses/copilot/instructions/specs.elixir.instructions.md +4 -37
  37. package/package/corpus/harnesses/copilot/instructions/specs.typescript.instructions.md +3 -1
  38. package/package/corpus/harnesses/copilot/instructions/storybook.instructions.md +7 -70
  39. package/package/corpus/harnesses/copilot/instructions/typescript.instructions.md +8 -98
  40. package/package/corpus/harnesses/copilot/instructions/writing-correct-examples.instructions.md +3 -47
  41. package/package/corpus/harnesses/copilot/instructions/writing-cratis-docs.instructions.md +3 -65
  42. package/package/corpus/hooks/README.md +4 -7
  43. package/package/corpus/hooks/scripts/quality-gates.json +3 -5
  44. package/package/corpus/rules/ai-distribution.md +9 -102
  45. package/package/corpus/rules/authoring-skills.md +3 -5
  46. package/package/corpus/rules/browser.md +8 -49
  47. package/package/corpus/rules/code-health-policy.txt +4 -24
  48. package/package/corpus/rules/code-health.md +1 -1
  49. package/package/corpus/rules/code-quality.csharp.md +3 -84
  50. package/package/corpus/rules/code-quality.md +6 -51
  51. package/package/corpus/rules/code-quality.typescript.md +4 -81
  52. package/package/corpus/rules/codescene.md +5 -54
  53. package/package/corpus/rules/components.md +1 -1
  54. package/package/corpus/rules/cratis-folder-is-configuration.md +5 -22
  55. package/package/corpus/rules/csharp.md +7 -315
  56. package/package/corpus/rules/dialogs.md +1 -1
  57. package/package/corpus/rules/discoverability.md +3 -25
  58. package/package/corpus/rules/documentation-structure-and-formatting.md +5 -151
  59. package/package/corpus/rules/documentation.md +5 -104
  60. package/package/corpus/rules/editing-cratis-docs.md +5 -63
  61. package/package/corpus/rules/efcore.md +8 -55
  62. package/package/corpus/rules/efcore.specs.md +3 -33
  63. package/package/corpus/rules/elixir.md +6 -79
  64. package/package/corpus/rules/exit-codes-and-wrappers.md +4 -27
  65. package/package/corpus/rules/framework-dotnet.md +4 -6
  66. package/package/corpus/rules/framework.md +0 -2
  67. package/package/corpus/rules/frontend-quality.md +0 -1
  68. package/package/corpus/rules/frontend-testing.md +1 -1
  69. package/package/corpus/rules/general.md +2 -2
  70. package/package/corpus/rules/github-actions.md +7 -138
  71. package/package/corpus/rules/glossary.md +19 -19
  72. package/package/corpus/rules/go-engineering.md +1 -4
  73. package/package/corpus/rules/go.md +2 -7
  74. package/package/corpus/rules/guards-and-fuses.md +5 -6
  75. package/package/corpus/rules/java.md +7 -129
  76. package/package/corpus/rules/kotlin.md +8 -165
  77. package/package/corpus/rules/orleans.md +5 -98
  78. package/package/corpus/rules/profiles.md +9 -63
  79. package/package/corpus/rules/scripting.md +1 -1
  80. package/package/corpus/rules/specs.csharp.md +8 -148
  81. package/package/corpus/rules/specs.elixir.md +4 -37
  82. package/package/corpus/rules/specs.typescript.md +3 -1
  83. package/package/corpus/rules/storybook.md +7 -70
  84. package/package/corpus/rules/typescript.md +8 -98
  85. package/package/corpus/rules/writing-correct-examples.md +3 -47
  86. package/package/corpus/rules/writing-cratis-docs.md +3 -65
  87. package/package/corpus/skills/cratis-application-growth/SKILL.md +7 -54
  88. package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +49 -0
  89. package/package/corpus/skills/cratis-application-growth/references/rename-window.md +12 -14
  90. package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
  91. package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +2 -2
  92. package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +3 -3
  93. package/package/corpus/skills/cratis-arc-authorize-request/references/kotlin.md +2 -2
  94. package/package/corpus/skills/cratis-arc-code-analysis-typescript/SKILL.md +10 -43
  95. package/package/corpus/skills/cratis-arc-code-analysis-typescript/references/rule-fixes.md +40 -0
  96. package/package/corpus/skills/cratis-arc-connect-storage/SKILL.md +1 -1
  97. package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -1
  98. package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +4 -4
  99. package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
  100. package/package/corpus/skills/cratis-arc-declare-command/references/kotlin.md +6 -7
  101. package/package/corpus/skills/cratis-arc-declare-operation/SKILL.md +2 -8
  102. package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +1 -1
  103. package/package/corpus/skills/cratis-arc-diagnose-live-query/SKILL.md +1 -1
  104. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +1 -1
  105. package/package/corpus/skills/cratis-arc-expose-mcp-operation/SKILL.md +6 -12
  106. package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/custom-exposure-and-audit.md +4 -0
  107. package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +2 -2
  108. package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +11 -4
  109. package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +1 -1
  110. package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +2 -2
  111. package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +1 -1
  112. package/package/corpus/skills/cratis-arc-generate-proxies/references/go.md +19 -2
  113. package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +1 -1
  114. package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
  115. package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +1 -2
  116. package/package/corpus/skills/cratis-arc-host-application/references/elixir.md +2 -2
  117. package/package/corpus/skills/cratis-arc-host-application/references/go.md +5 -1
  118. package/package/corpus/skills/cratis-arc-host-application/references/java.md +1 -1
  119. package/package/corpus/skills/cratis-arc-host-application/references/kotlin.md +1 -1
  120. package/package/corpus/skills/cratis-arc-host-application/references/typescript.md +1 -1
  121. package/package/corpus/skills/cratis-arc-identity-and-tenancy-kotlin/SKILL.md +4 -7
  122. package/package/corpus/skills/cratis-arc-invoke-command/SKILL.md +1 -1
  123. package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +4 -4
  124. package/package/corpus/skills/cratis-arc-invoke-command/references/typescript.md +1 -1
  125. package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +2 -2
  126. package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +2 -2
  127. package/package/corpus/skills/cratis-arc-isolate-tenant/references/elixir.md +1 -1
  128. package/package/corpus/skills/cratis-arc-isolate-tenant/references/java.md +1 -1
  129. package/package/corpus/skills/cratis-arc-isolate-tenant/references/kotlin.md +1 -1
  130. package/package/corpus/skills/cratis-arc-isolate-tenant/references/typescript.md +4 -2
  131. package/package/corpus/skills/cratis-arc-migrate-relational-schema/SKILL.md +6 -6
  132. package/package/corpus/skills/cratis-arc-page-query/SKILL.md +3 -3
  133. package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +10 -6
  134. package/package/corpus/skills/cratis-arc-page-query/references/elixir.md +2 -2
  135. package/package/corpus/skills/cratis-arc-page-query/references/java.md +1 -1
  136. package/package/corpus/skills/cratis-arc-page-query/references/kotlin.md +1 -1
  137. package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +2 -2
  138. package/package/corpus/skills/cratis-arc-react-bind-slice/references/csharp.md +1 -1
  139. package/package/corpus/skills/cratis-arc-react-bind-slice/references/kotlin.md +1 -1
  140. package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +7 -3
  141. package/package/corpus/skills/cratis-arc-react-separate-view-model/references/react-routing-and-messaging.md +1 -1
  142. package/package/corpus/skills/cratis-arc-select-backend-sdk/SKILL.md +2 -2
  143. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/elixir.md +2 -4
  144. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/go.md +2 -2
  145. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/java.md +1 -1
  146. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/kotlin.md +2 -2
  147. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/typescript.md +1 -3
  148. package/package/corpus/skills/cratis-arc-spring-data-kotlin/SKILL.md +13 -51
  149. package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/read-model-naming.md +9 -1
  150. package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/storage-boundaries.md +40 -0
  151. package/package/corpus/skills/cratis-arc-storage-typescript/SKILL.md +19 -64
  152. package/package/corpus/skills/cratis-arc-storage-typescript/references/drizzle.md +62 -0
  153. package/package/corpus/skills/cratis-arc-tenancy-typescript/SKILL.md +24 -55
  154. package/package/corpus/skills/cratis-arc-tenancy-typescript/references/tenant-selection.md +49 -0
  155. package/package/corpus/skills/cratis-arc-testing-kotlin/SKILL.md +13 -31
  156. package/package/corpus/skills/cratis-arc-testing-kotlin/references/jvm-scenario-variants.md +25 -0
  157. package/package/corpus/skills/cratis-arc-testing-typescript/SKILL.md +24 -62
  158. package/package/corpus/skills/cratis-arc-testing-typescript/references/hosts-and-runners.md +51 -0
  159. package/package/corpus/skills/cratis-arc-validate-command/SKILL.md +4 -4
  160. package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +10 -12
  161. package/package/corpus/skills/cratis-arc-validate-command/references/elixir.md +16 -3
  162. package/package/corpus/skills/cratis-arc-validate-command/references/go.md +19 -2
  163. package/package/corpus/skills/cratis-arc-validate-command/references/java.md +20 -7
  164. package/package/corpus/skills/cratis-arc-validate-command/references/kotlin.md +22 -2
  165. package/package/corpus/skills/cratis-arc-validate-command/references/python.md +8 -2
  166. package/package/corpus/skills/cratis-arc-validate-command/references/typescript.md +22 -2
  167. package/package/corpus/skills/cratis-arc-validation-kotlin/SKILL.md +22 -248
  168. package/package/corpus/skills/cratis-arc-validation-kotlin/references/feature-filters.md +55 -0
  169. package/package/corpus/skills/cratis-arc-validation-kotlin/references/model-validation.md +72 -0
  170. package/package/corpus/skills/cratis-arc-validation-kotlin/references/server-validators.md +86 -0
  171. package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +27 -275
  172. package/package/corpus/skills/cratis-arc-validation-typescript/references/models-and-queries.md +63 -0
  173. package/package/corpus/skills/cratis-arc-validation-typescript/references/rules-and-checks.md +46 -0
  174. package/package/corpus/skills/cratis-arc-validation-typescript/references/server-decisions.md +114 -0
  175. package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +15 -255
  176. package/package/corpus/skills/cratis-chronicle-cli-operations/references/command-effects.md +13 -6
  177. package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +75 -0
  178. package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +78 -13
  179. package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +16 -14
  180. package/package/corpus/skills/cratis-chronicle-connect-application/SKILL.md +1 -1
  181. package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +10 -6
  182. package/package/corpus/skills/cratis-chronicle-connect-application/references/elixir.md +1 -1
  183. package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +2 -2
  184. package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +8 -8
  185. package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +10 -8
  186. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +8 -4
  187. package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +4 -4
  188. package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
  189. package/package/corpus/skills/cratis-chronicle-evolve-event/references/deployed-readers.md +21 -8
  190. package/package/corpus/skills/cratis-chronicle-evolve-event/references/elixir.md +1 -1
  191. package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +1 -1
  192. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +5 -7
  193. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/elixir.md +3 -3
  194. package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +10 -80
  195. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/blocked-tools.md +2 -2
  196. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +9 -24
  197. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/observational-tools.md +10 -0
  198. package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +2 -2
  199. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +7 -6
  200. package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +2 -2
  201. package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +6 -0
  202. package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +6 -0
  203. package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +6 -0
  204. package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +11 -5
  205. package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +2 -2
  206. package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +4 -4
  207. package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +2 -2
  208. package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +3 -1
  209. package/package/corpus/skills/cratis-chronicle-protect-personal-data/SKILL.md +1 -1
  210. package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +1 -1
  211. package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +1 -1
  212. package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +51 -40
  213. package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir.md +1 -1
  214. package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +1 -1
  215. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/{occurrences.md → csharp-occurrences.md} +2 -2
  216. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +5 -6
  217. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/go.md +1 -1
  218. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +1 -1
  219. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -1
  220. package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +1 -1
  221. package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +21 -19
  222. package/package/corpus/skills/cratis-chronicle-record-event/references/elixir.md +3 -3
  223. package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
  224. package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +3 -4
  225. package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -4
  226. package/package/corpus/skills/cratis-chronicle-record-event/references/typescript.md +2 -2
  227. package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +1 -1
  228. package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +7 -2
  229. package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +1 -1
  230. package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +4 -4
  231. package/package/corpus/skills/cratis-chronicle-select-client/references/csharp.md +3 -3
  232. package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +2 -6
  233. package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +2 -2
  234. package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +1 -1
  235. package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +1 -5
  236. package/package/corpus/skills/cratis-chronicle-select-client/references/python.md +3 -3
  237. package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +2 -2
  238. package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +12 -201
  239. package/package/corpus/skills/cratis-chronicle-web-workbench/references/hosting.md +67 -0
  240. package/package/corpus/skills/cratis-chronicle-web-workbench/references/operations.md +88 -0
  241. package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +8 -4
  242. package/package/corpus/skills/cratis-ci-pipeline-performance/references/build-once-and-shard.md +13 -11
  243. package/package/corpus/skills/cratis-ci-pipeline-performance/references/caching.md +2 -2
  244. package/package/corpus/skills/cratis-ci-pipeline-performance/references/flaky-and-hung-jobs.md +6 -4
  245. package/package/corpus/skills/cratis-ci-pipeline-performance/references/required-checks-and-path-filters.md +20 -61
  246. package/package/corpus/skills/cratis-ci-pipeline-performance/references/security-and-pinning.md +1 -1
  247. package/package/corpus/skills/cratis-cli-terminal-workbench/SKILL.md +15 -26
  248. package/package/corpus/skills/cratis-code-review/SKILL.md +7 -6
  249. package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +1 -1
  250. package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +1 -1
  251. package/package/corpus/skills/cratis-components-accessibility/SKILL.md +14 -206
  252. package/package/corpus/skills/cratis-components-accessibility/references/control-labels.md +29 -0
  253. package/package/corpus/skills/cratis-components-accessibility/references/focus-and-announcements.md +8 -0
  254. package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +7 -7
  255. package/package/corpus/skills/cratis-components-build-canvas/references/pixi-items.md +1 -1
  256. package/package/corpus/skills/cratis-components-choose-control/SKILL.md +7 -8
  257. package/package/corpus/skills/cratis-components-choose-control/references/collections.md +2 -2
  258. package/package/corpus/skills/cratis-components-choose-control/references/inputs.md +1 -1
  259. package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +22 -27
  260. package/package/corpus/skills/cratis-components-compose-toolbar/references/contributed-tools.md +5 -0
  261. package/package/corpus/skills/cratis-components-coordinate-feedback/SKILL.md +19 -25
  262. package/package/corpus/skills/cratis-components-display-list/SKILL.md +26 -19
  263. package/package/corpus/skills/cratis-components-display-list/references/server-query.md +3 -3
  264. package/package/corpus/skills/cratis-components-edit-schema-data/SKILL.md +15 -12
  265. package/package/corpus/skills/cratis-components-edit-schema-data/references/controlled-editor.md +3 -3
  266. package/package/corpus/skills/cratis-components-explore-data/SKILL.md +7 -7
  267. package/package/corpus/skills/cratis-components-host-chat/SKILL.md +7 -7
  268. package/package/corpus/skills/cratis-components-submit-form/SKILL.md +9 -15
  269. package/package/corpus/skills/cratis-components-submit-form/references/confirmation.md +5 -5
  270. package/package/corpus/skills/cratis-components-submit-form/references/wizard.md +3 -3
  271. package/package/corpus/skills/cratis-components-theme-application/SKILL.md +7 -51
  272. package/package/corpus/skills/cratis-components-theme-application/references/palette.md +49 -0
  273. package/package/corpus/skills/cratis-components-theme-application/references/renderer-adapters.md +4 -2
  274. package/package/corpus/skills/cratis-content-length/SKILL.md +34 -46
  275. package/package/corpus/skills/cratis-content-length/references/length-evidence.md +26 -127
  276. package/package/corpus/skills/cratis-developer-marketing/SKILL.md +15 -27
  277. package/package/corpus/skills/cratis-developer-marketing/references/measurement.md +3 -19
  278. package/package/corpus/skills/cratis-developer-marketing/references/playbook-evidence.md +29 -224
  279. package/package/corpus/skills/cratis-discoverability/SKILL.md +11 -4
  280. package/package/corpus/skills/cratis-discoverability/references/package-metadata.md +2 -2
  281. package/package/corpus/skills/cratis-documentation-writing/SKILL.md +4 -3
  282. package/package/corpus/skills/cratis-engineering-ci-gates/SKILL.md +13 -129
  283. package/package/corpus/skills/cratis-engineering-ci-gates/references/gate-operation.md +132 -0
  284. package/package/corpus/skills/cratis-engineering-consolidation-guard/SKILL.md +11 -100
  285. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/ci-required-check.md +55 -40
  286. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/source-verification.md +68 -0
  287. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/verification-details.md +38 -0
  288. package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +14 -65
  289. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +40 -174
  290. package/package/corpus/skills/cratis-engineering-decision-record/SKILL.md +8 -52
  291. package/package/corpus/skills/cratis-engineering-decision-record/references/decision-pitfalls.md +29 -0
  292. package/package/corpus/skills/cratis-engineering-decision-record/references/decision-scope.md +20 -0
  293. package/package/corpus/skills/cratis-engineering-decision-record/references/record-format.md +3 -4
  294. package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +7 -12
  295. package/package/corpus/skills/cratis-engineering-docs-authoring/references/site-format.md +5 -4
  296. package/package/corpus/skills/cratis-engineering-effect-boundaries/SKILL.md +6 -40
  297. package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +18 -151
  298. package/package/corpus/skills/cratis-engineering-inherited-work/SKILL.md +5 -21
  299. package/package/corpus/skills/cratis-engineering-inherited-work/references/continue-inherited-work.md +19 -0
  300. package/package/corpus/skills/cratis-engineering-issue-design-note/SKILL.md +3 -66
  301. package/package/corpus/skills/cratis-engineering-issue-design-note/references/design-note-format.md +68 -0
  302. package/package/corpus/skills/cratis-engineering-issue-hygiene/SKILL.md +2 -84
  303. package/package/corpus/skills/cratis-engineering-issue-hygiene/references/issue-disposition.md +87 -0
  304. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/SKILL.md +15 -263
  305. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dependency-map.md +3 -3
  306. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/docker-images.md +28 -6
  307. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dotnet-nuget.md +18 -14
  308. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/helper-runbook.md +231 -0
  309. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/other-environments.md +2 -3
  310. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/worked-examples.md +62 -77
  311. package/package/corpus/skills/cratis-engineering-post-mortem/SKILL.md +6 -39
  312. package/package/corpus/skills/cratis-engineering-post-mortem/references/proportionate-follow-up.md +36 -0
  313. package/package/corpus/skills/cratis-engineering-regression-cluster/SKILL.md +4 -4
  314. package/package/corpus/skills/cratis-engineering-release-trains/SKILL.md +8 -134
  315. package/package/corpus/skills/cratis-engineering-release-trains/references/candidate-assembly.md +139 -0
  316. package/package/corpus/skills/cratis-engineering-review-rounds/SKILL.md +3 -100
  317. package/package/corpus/skills/cratis-engineering-review-rounds/references/round-handoffs.md +109 -0
  318. package/package/corpus/skills/cratis-environments-and-secrets/SKILL.md +1 -5
  319. package/package/corpus/skills/cratis-environments-and-secrets/references/environment-file.md +1 -3
  320. package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +11 -116
  321. package/package/corpus/skills/cratis-event-model-diagram/references/frame-patterns.md +93 -0
  322. package/package/corpus/skills/cratis-fundamentals-concept-go/SKILL.md +4 -15
  323. package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -8
  324. package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +4 -4
  325. package/package/corpus/skills/cratis-fundamentals-name-value/references/elixir.md +1 -1
  326. package/package/corpus/skills/cratis-fundamentals-name-value/references/go.md +1 -1
  327. package/package/corpus/skills/cratis-fundamentals-name-value/references/java.md +5 -5
  328. package/package/corpus/skills/cratis-fundamentals-name-value/references/kotlin.md +15 -2
  329. package/package/corpus/skills/cratis-fundamentals-name-value/references/python.md +1 -1
  330. package/package/corpus/skills/cratis-fundamentals-name-value/references/typescript.md +1 -1
  331. package/package/corpus/skills/cratis-fundamentals-telemetry/SKILL.md +10 -27
  332. package/package/corpus/skills/cratis-fundamentals-telemetry/references/otlp-export.md +16 -0
  333. package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +26 -188
  334. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/diagnostics.md +14 -0
  335. package/package/corpus/skills/cratis-governed-release-methodology/SKILL.md +7 -5
  336. package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +23 -157
  337. package/package/corpus/skills/cratis-lens-browser-extension/references/troubleshooting.md +139 -0
  338. package/package/corpus/skills/cratis-llm-friendly-documentation/SKILL.md +7 -5
  339. package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +2 -4
  340. package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +7 -0
  341. package/package/corpus/skills/cratis-modeling-discover-timeline/SKILL.md +2 -2
  342. package/package/corpus/skills/cratis-modeling-discover-timeline/references/group-and-document-intake.md +1 -1
  343. package/package/corpus/skills/cratis-modeling-review-event-model/SKILL.md +2 -2
  344. package/package/corpus/skills/cratis-modeling-review-event-model/references/implementation-findings.md +2 -2
  345. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/SKILL.md +5 -23
  346. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/compare-evidence.md +20 -0
  347. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/recovery-inputs.md +3 -3
  348. package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +8 -63
  349. package/package/corpus/skills/cratis-multi-service-local-orchestration/references/aspire.md +52 -0
  350. package/package/corpus/skills/cratis-observability/SKILL.md +1 -1
  351. package/package/corpus/skills/cratis-observability/references/arc-and-chronicle-signals.md +9 -23
  352. package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +3 -14
  353. package/package/corpus/skills/cratis-observability/references/csharp.md +4 -6
  354. package/package/corpus/skills/cratis-observability/references/elixir.md +1 -1
  355. package/package/corpus/skills/cratis-observability/references/troubleshooting.md +4 -5
  356. package/package/corpus/skills/cratis-onboarding-runtime/SKILL.md +1 -4
  357. package/package/corpus/skills/cratis-onboarding-runtime/references/default-offering.md +0 -3
  358. package/package/corpus/skills/cratis-onboarding-runtime/references/sign-up-review.md +0 -4
  359. package/package/corpus/skills/cratis-orchestration-lanes/SKILL.md +7 -49
  360. package/package/corpus/skills/cratis-orchestration-lanes/references/escalation.md +22 -0
  361. package/package/corpus/skills/cratis-orchestration-lanes/references/inbox-and-handover.md +4 -4
  362. package/package/corpus/skills/cratis-orchestration-lanes/references/placeholders.md +1 -1
  363. package/package/corpus/skills/cratis-orchestration-lanes/references/roles.md +12 -0
  364. package/package/corpus/skills/cratis-orchestration-lanes/references/roll-call.md +12 -0
  365. package/package/corpus/skills/cratis-orchestration-lanes/references/worktrees.md +10 -0
  366. package/package/corpus/skills/cratis-orchestration-merge-gates/SKILL.md +14 -13
  367. package/package/corpus/skills/cratis-orchestration-merge-gates/references/merge-queue.md +51 -26
  368. package/package/corpus/skills/cratis-orchestration-merge-gates/references/unattended-guards.md +8 -14
  369. package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +9 -65
  370. package/package/corpus/skills/cratis-orleans-jobs/references/activation-callbacks.md +5 -0
  371. package/package/corpus/skills/cratis-orleans-jobs/references/lifecycle-and-placement.md +11 -7
  372. package/package/corpus/skills/cratis-orleans-jobs/references/state-machines.md +1 -1
  373. package/package/corpus/skills/cratis-orleans-jobs/references/step-planning.md +27 -0
  374. package/package/corpus/skills/cratis-orleans-jobs/references/storage-and-options.md +35 -0
  375. package/package/corpus/skills/cratis-performance-review/SKILL.md +6 -76
  376. package/package/corpus/skills/cratis-performance-review/references/review-checklist.md +79 -0
  377. package/package/corpus/skills/cratis-platform-configure-environment/SKILL.md +19 -16
  378. package/package/corpus/skills/cratis-platform-contribute-change/SKILL.md +2 -2
  379. package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +5 -5
  380. package/package/corpus/skills/cratis-platform-deliver-slice/references/coordinate-slices.md +1 -1
  381. package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +2 -3
  382. package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +2 -2
  383. package/package/corpus/skills/cratis-platform-start-application/SKILL.md +10 -8
  384. package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +6 -6
  385. package/package/corpus/skills/cratis-platform-start-application/references/java.md +4 -4
  386. package/package/corpus/skills/cratis-platform-start-application/references/kotlin.md +4 -4
  387. package/package/corpus/skills/cratis-platform-verify-service-handoff/SKILL.md +3 -3
  388. package/package/corpus/skills/cratis-release-notes/SKILL.md +9 -133
  389. package/package/corpus/skills/cratis-release-notes/references/channel-guidance.md +59 -0
  390. package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +64 -0
  391. package/package/corpus/skills/cratis-rtk/SKILL.md +12 -18
  392. package/package/corpus/skills/cratis-screenplay-accept-model/SKILL.md +3 -3
  393. package/package/corpus/skills/cratis-screenplay-accept-model/references/capability-consumption.md +1 -1
  394. package/package/corpus/skills/cratis-screenplay-accept-model/references/coverage-obligations.md +1 -1
  395. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/SKILL.md +25 -59
  396. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/references/onboarding-directives.md +11 -10
  397. package/package/corpus/skills/cratis-screenplay-author-extension/SKILL.md +9 -6
  398. package/package/corpus/skills/cratis-screenplay-author-extension/references/consume.md +3 -3
  399. package/package/corpus/skills/cratis-screenplay-author-extension/references/stage-candidate.md +8 -0
  400. package/package/corpus/skills/cratis-screenplay-availability/SKILL.md +20 -167
  401. package/package/corpus/skills/cratis-screenplay-availability/references/complete-example.md +23 -47
  402. package/package/corpus/skills/cratis-screenplay-availability/references/review-checks.md +9 -10
  403. package/package/corpus/skills/cratis-screenplay-availability/references/runtime-ownership.md +26 -23
  404. package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +6 -14
  405. package/package/corpus/skills/cratis-screenplay-declare-slice/references/projection-replay.md +2 -2
  406. package/package/corpus/skills/cratis-screenplay-declare-slice/references/read-identity.md +1 -1
  407. package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +7 -9
  408. package/package/corpus/skills/cratis-screenplay-edit-workspace/references/model-notes.md +1 -1
  409. package/package/corpus/skills/cratis-screenplay-handoff-slice/SKILL.md +10 -14
  410. package/package/corpus/skills/cratis-screenplay-model-automation/SKILL.md +1 -1
  411. package/package/corpus/skills/cratis-screenplay-model-automation/references/reaction-boundaries.md +1 -1
  412. package/package/corpus/skills/cratis-screenplay-model-interaction/SKILL.md +6 -31
  413. package/package/corpus/skills/cratis-screenplay-model-interaction/references/shell-and-data.md +22 -0
  414. package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +5 -5
  415. package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +5 -5
  416. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/version-migration.md +4 -4
  417. package/package/corpus/skills/cratis-screenplay-recover-intent/SKILL.md +2 -2
  418. package/package/corpus/skills/cratis-screenplay-recover-intent/references/csharp.md +2 -2
  419. package/package/corpus/skills/cratis-screenplay-recover-intent/references/ground-truth-benchmark.md +1 -1
  420. package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +4 -75
  421. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/host-body-execution.md +0 -2
  422. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/observable-result.md +85 -1
  423. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/query-rejections.md +1 -1
  424. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +15 -133
  425. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +5 -5
  426. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +4 -12
  427. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +28 -57
  428. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +4 -5
  429. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +13 -20
  430. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +1 -1
  431. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/neighbouring-skills.md +1 -1
  432. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/read-model-keys.md +3 -5
  433. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-id-rules.md +2 -0
  434. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +5 -5
  435. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +82 -71
  436. package/package/corpus/skills/cratis-security-review/SKILL.md +4 -73
  437. package/package/corpus/skills/cratis-security-review/references/arc-boundaries.md +24 -13
  438. package/package/corpus/skills/cratis-security-review/references/review-checklist.md +74 -0
  439. package/package/corpus/skills/cratis-session-handoff/SKILL.md +7 -32
  440. package/package/corpus/skills/cratis-session-handoff/references/handoff-template.md +2 -2
  441. package/package/corpus/skills/cratis-session-handoff/references/session-hygiene.md +20 -0
  442. package/package/corpus/skills/cratis-showrunner-herald/SKILL.md +9 -17
  443. package/package/corpus/skills/cratis-showrunner-herald/references/options.md +2 -2
  444. package/package/corpus/skills/cratis-showrunner-herald/references/templates-and-images.md +16 -10
  445. package/package/corpus/skills/cratis-social-feed-post/SKILL.md +9 -162
  446. package/package/corpus/skills/cratis-social-feed-post/references/asset-and-formatting.md +37 -0
  447. package/package/corpus/skills/cratis-social-feed-post/references/editorial-checks.md +40 -0
  448. package/package/corpus/skills/cratis-social-feed-post/references/engagement-evidence.md +39 -150
  449. package/package/corpus/skills/cratis-social-feed-post/references/linkedin-media.md +24 -0
  450. package/package/corpus/skills/cratis-social-feed-post/references/other-channels.md +23 -0
  451. package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +5 -5
  452. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +2 -2
  453. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-query-scenario.md +13 -5
  454. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +7 -4
  455. package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +1 -1
  456. package/package/corpus/skills/cratis-specifications-exercise-backend/references/go.md +20 -4
  457. package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +1 -1
  458. package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +2 -2
  459. package/package/corpus/skills/cratis-specifications-observe-ui/SKILL.md +5 -5
  460. package/package/corpus/skills/cratis-specifications-test-application-ui/SKILL.md +2 -2
  461. package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript-command-results.md +2 -2
  462. package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -2
  463. package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +10 -9
  464. package/package/corpus/skills/cratis-stage-run-sandbox/SKILL.md +3 -3
  465. package/package/corpus/skills/cratis-stage-run-sandbox/references/semantic-spec-runner.md +7 -6
  466. package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +4 -6
  467. package/package/corpus/skills/cratis-technical-examples/SKILL.md +10 -106
  468. package/package/corpus/skills/cratis-technical-examples/references/csharp-package-checks.md +1 -1
  469. package/package/corpus/skills/cratis-technical-examples/references/source-and-format.md +42 -0
  470. package/package/corpus/skills/cratis-technical-examples/references/typescript-package-checks.md +2 -2
  471. package/package/corpus/skills/cratis-technical-examples/references/verification-scope.md +37 -0
  472. package/package/corpus/skills/cratis-ux-review/SKILL.md +8 -40
  473. package/package/corpus/skills/cratis-ux-review/references/capture-contract.md +24 -0
  474. package/package/corpus/skills/cratis-ux-review/references/checklist.md +1 -1
  475. package/package/corpus/skills/cratis-ux-review/references/report-template.md +2 -1
  476. package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +19 -132
  477. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/ai-tells.md +24 -97
  478. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/author-and-batch.md +23 -0
  479. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/documentation-evidence.md +25 -0
  480. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/interpretation.md +17 -0
  481. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/stock-constructions.md +23 -0
  482. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/voice-guidance.md +8 -29
  483. package/package.json +1 -1
  484. /package/package/corpus/skills/cratis-chronicle-protect-decision/references/{standalone.md → csharp-standalone.md} +0 -0
  485. /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/silent-backup-failure.md → silent-backup-failure.md} +0 -0
  486. /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/unintended-release-regression.md → unintended-release-regression.md} +0 -0
@@ -1,5 +1,7 @@
1
1
  # Stream-id literals, composite ids and the reserved `All` name
2
2
 
3
+ When a caller needs to find the same stream after a lost reply, choose an explicit identifier before the first attempt. Choose a `generated identifier` only when a new identity per accepted operation is intended. For Stage, use its supported UUID or String strategies and check admission; unsupported generated types or result shapes remain gaps, not retry guarantees.
4
+
3
5
  Rules for stream-id literals, composite ids and the reserved `All` stream name.
4
6
 
5
7
  - Stream-id literals must be nonempty, well-formed NFC text (refused,
@@ -34,8 +34,8 @@ Start from the business instance, then choose its representation. A generated id
34
34
  real instance; a readable constant can hide a collection. Write one sentence per identity
35
35
  concept:
36
36
 
37
- > `EnrolmentId`: one stream per enrolment of one member in one course; it answers "what is
38
- > the state of this enrolment?"
37
+ > `EnrollmentId`: one stream per enrollment of one member in one course; it answers "what is
38
+ > the state of this enrollment?"
39
39
 
40
40
  For every affected identifier:
41
41
  1. Name the instance and its lifecycle.
@@ -59,8 +59,8 @@ capture that writes to the identifier and fill one row each:
59
59
 
60
60
  | Event | Written by (command, reaction, capture) | How it changes or records this instance's history | Belongs? |
61
61
  |---|---|---|---|
62
- | `MemberEnrolled` | `EnrolMember` | records the enrolment decision | yes |
63
- | `CourseSeatsAdjusted` | `AdjustSeats` (same identifier) | changes the course, not the enrolment | no: move to the course stream |
62
+ | `MemberEnrolled` | `EnrollMember` | records the enrollment decision | yes |
63
+ | `CourseSeatsAdjusted` | `AdjustSeats` (same identifier) | changes the course, not the enrollment | no: move to the course stream |
64
64
 
65
65
  Then decide per identity, with a reason and the invariant a split would affect:
66
66
  - **retain**: every event is a fact about this instance, however long the history;
@@ -142,7 +142,7 @@ test; they vary by business.
142
142
  | Marina | berth (as a managed resource) | Does the berth itself make decisions (closed for repair, re-priced) or must occupancy be decided atomically (one vessel at a time)? | none for reserve and release facts: they may belong on the berth when it is the authoritative decision point (`consistency-and-concurrency.md` section 3); carry the booking id as a reference and keep the booking's own history on the booking |
143
143
  | Memberships | membership | Is it one lifecycle (joined, renewed, lapsed, ended)? A thirty-year membership is still one stream | profile, preferences and login history bundled: three concerns with different decisions; split when they have independent lifecycles |
144
144
  | Memberships | "all members" | none: it is a collection | model as a view |
145
- | Course enrolment | enrolment | One member in one course, from enrolment to completion or withdrawal | a "course" stream that also carries every member's progress |
145
+ | Course enrollment | enrollment | One member in one course, from enrollment to completion or withdrawal | a "course" stream that also carries every member's progress |
146
146
  | Hire | hire agreement | From reservation to return, one customer and one item | an "active hires" stream beside a "completed hires" stream: lifecycle stages of one instance, not two identities |
147
147
 
148
148
  A composite can be one stream when parent and children are decided together under shared
@@ -1,8 +1,15 @@
1
1
  # Example: streams, constraints and a recorded rule
2
2
 
3
- This design-mode course-enrolment example shows separate stream identities, cross-stream payload references, uniqueness constraints and an active-state view. It records rather than enforces the capacity rule. The payload-key fan-in remains refused even with `command reads protected`; read [consistency and concurrency](consistency-and-concurrency.md) before choosing an enforcement boundary.
3
+ ## Contents
4
4
 
5
- The example is intentionally not binding-ready: `reads` and the legacy `concurrency` block are PLAY0271; a `require` over the view is PLAY0268. Keep the `pii` marker for the email concept. Compliance markers are not the reason this example refuses binding.
5
+ - Course enrollment model
6
+ - What this example proves
7
+
8
+ ## Course enrollment model
9
+
10
+ This design-mode course-enrollment example shows separate stream identities, cross-stream payload references, uniqueness constraints and an active-state view. It records rather than enforces the capacity rule. The payload-key fan-in remains refused even with `command reads protected`; read [consistency and concurrency](consistency-and-concurrency.md) before choosing an enforcement boundary.
11
+
12
+ The example is intentionally not binding-ready: `reads` and the `concurrency` block are PLAY0271; a `require` over the view is PLAY0268. Keep the `pii` marker for the email concept. Compliance markers are not the reason this example refuses binding.
6
13
 
7
14
  ```screenplay expect PLAY0516 test=unbound
8
15
  // The capacity rule is NOT enforced in the model (see the slice description).
@@ -11,7 +18,7 @@ domain Acme.Academy
11
18
 
12
19
  concept MemberId : Uuid // event source id of one member stream
13
20
  concept CourseId : Uuid // event source id of one course stream
14
- concept EnrolmentId : Uuid // event source id of one enrolment stream
21
+ concept EnrollmentId : Uuid // event source id of one enrollment stream
15
22
  concept Email : String pii
16
23
  pii reason "Identifies a person"
17
24
  validate
@@ -22,7 +29,7 @@ policy IsAuthenticated
22
29
  policy IsCoordinator
23
30
  require role "Coordinator"
24
31
  persona Coordinator
25
- description "Schedules courses and manages enrolments. Cannot: change member contact details"
32
+ description "Schedules courses and manages enrollments. Cannot: change member contact details"
26
33
  policy IsAuthenticated
27
34
  policy IsCoordinator
28
35
 
@@ -82,7 +89,7 @@ module Membership
82
89
  module Courses
83
90
  description "Courses and who attends them"
84
91
  authorize IsAuthenticated
85
- feature Enrolment
92
+ feature Enrollment
86
93
  authorize IsCoordinator
87
94
  slice StateChange OpenCourse
88
95
  command OpenCourse
@@ -111,7 +118,7 @@ module Courses
111
118
  then denied
112
119
 
113
120
  slice StateView CourseAvailability
114
- description "Open seats per course, built from enrolment and withdrawal facts. A lagging view: usable for display and as stated intent, not as a protected decision. It routes enrolment-stream facts to the course by a payload property (fan-in). A Chronicle protected decision read admits only a projection keyed directly by the event source id and refuses event-property routing, so this view cannot be guarded, and a concurrency scope on the course source would not see enrolment-stream appends. Consequence: two concurrent enrolments can both pass the capacity check and overbook the course. Redesign awaiting agreement (see consistency-and-concurrency.md section 3): record seat reservations as decisions on the course source (a seat-taken fact there, with enrolment reacting to it), or give each seat its own identity and claim it with a uniqueness constraint."
121
+ description "Open seats per course, built from enrollment and withdrawal facts. A lagging view: usable for display and as stated intent, not as a protected decision. It routes enrollment-stream facts to the course by a payload property (fan-in). A Chronicle protected decision read admits only a projection keyed directly by the event source id and refuses event-property routing, so this view cannot be guarded, and a concurrency scope on the course source would not see enrollment-stream appends. Consequence: two concurrent enrollments can both pass the capacity check and overbook the course. Redesign awaiting agreement (see consistency-and-concurrency.md section 3): record seat reservations as decisions on the course source (a seat-taken fact there, with enrollment reacting to it), or give each seat its own identity and claim it with a uniqueness constraint."
115
122
  readmodel CourseAvailability
116
123
  courseId CourseId
117
124
  openSeats Int
@@ -123,7 +130,7 @@ module Courses
123
130
  openSeats = seats
124
131
  from MemberEnrolled key courseId
125
132
  decrement openSeats
126
- from EnrolmentWithdrawn key courseId
133
+ from EnrollmentWithdrawn key courseId
127
134
  increment openSeats
128
135
  specification CountingOpenSeats
129
136
  given caller
@@ -149,10 +156,10 @@ module Courses
149
156
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
150
157
  then denied
151
158
 
152
- slice StateChange EnrolMember
153
- description "Atomic here: one active enrolment per member and course (composite unique constraint, released by withdrawal), and one MemberEnrolled per enrolment stream, so a retry with the same enrolment id after a lost reply cannot enrol twice (the composite constraint alone lets a source re-claim its own value). NOT enforced in the model today: 'enrolments never exceed the course capacity'. The rule depends on other streams' state: `reads` is PLAY0271 and `require` over a view is PLAY0268 at binding (Screenplay#129). The enrolment-to-course fan-in cannot be protected as modeled (see the CourseAvailability slice): concurrent enrolments can overbook. Target enforcement is an open decision (consistency-and-concurrency.md section 3); the model stays as stated intent, recorded in STATE.md."
154
- command EnrolMember
155
- enrolmentId EnrolmentId identifier
159
+ slice StateChange EnrollMember
160
+ description "Enforced at append: one active enrollment per member and course (composite unique constraint, released by withdrawal), and one MemberEnrolled per enrollment stream. A retry with the same enrollment ID after a lost reply cannot enroll twice; the composite constraint alone lets a source reclaim its own value. Constraint-index maintenance runs after commit; retry unchanged if Chronicle refuses the append while the index catches up. NOT enforced in the model today: 'enrollments never exceed the course capacity'. The rule depends on other streams' state: `reads` is PLAY0271 and `require` over a view is PLAY0268 at binding. The enrollment-to-course fan-in cannot be protected as modeled (see the CourseAvailability slice): concurrent enrollments can overbook. Target enforcement is an open decision (consistency-and-concurrency.md section 3); the model stays as stated intent, recorded in STATE.md."
161
+ command EnrollMember
162
+ enrollmentId EnrollmentId identifier
156
163
  courseId CourseId
157
164
  memberId MemberId
158
165
  concurrency
@@ -164,13 +171,13 @@ module Courses
164
171
  produces event MemberEnrolled
165
172
  courseId CourseId = courseId // cross-stream references are payload
166
173
  memberId MemberId = memberId
167
- constraint OneActiveEnrolmentPerMemberAndCourse
174
+ constraint OneActiveEnrollmentPerMemberAndCourse
168
175
  unique courseId, memberId on MemberEnrolled
169
- released by EnrolmentWithdrawn
176
+ released by EnrollmentWithdrawn
170
177
  constraint EnrolOnce
171
178
  unique event MemberEnrolled
172
- screen EnrolMember
173
- action EnrolMember for screen
179
+ screen EnrollMember
180
+ action EnrollMember for screen
174
181
  specification EnrollingAMember
175
182
  given caller
176
183
  authenticated
@@ -178,15 +185,15 @@ module Courses
178
185
  given CourseOpened
179
186
  for "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
180
187
  seats = 12
181
- when EnrolMember
182
- enrolmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
188
+ when EnrollMember
189
+ enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
183
190
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
184
191
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
185
192
  then MemberEnrolled
186
193
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
187
194
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
188
195
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
189
- specification RefusingARetriedEnrolment
196
+ specification RefusingARetriedEnrollment
190
197
  given caller
191
198
  authenticated
192
199
  role "Coordinator"
@@ -197,21 +204,21 @@ module Courses
197
204
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
198
205
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
199
206
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
200
- when EnrolMember
201
- enrolmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
207
+ when EnrollMember
208
+ enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
202
209
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
203
210
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
204
211
  then error "Constraint 'EnrolOnce' is violated: the event source already has the constrained event."
205
212
 
206
- specification RefusingAnEnrolmentWithoutTheCoordinatorRole
213
+ specification RefusingAnEnrollmentWithoutTheCoordinatorRole
207
214
  given caller
208
215
  authenticated
209
- when EnrolMember
210
- enrolmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
216
+ when EnrollMember
217
+ enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
211
218
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
212
219
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
213
220
  then denied
214
- specification RefusingASecondActiveEnrolmentUnderANewId
221
+ specification RefusingASecondActiveEnrollmentUnderANewId
215
222
  given caller
216
223
  authenticated
217
224
  role "Coordinator"
@@ -222,11 +229,11 @@ module Courses
222
229
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
223
230
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
224
231
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
225
- when EnrolMember
226
- enrolmentId = "1e4c0f3b-7d5a-4a2f-9c8b-6f3e2d4c5b12"
232
+ when EnrollMember
233
+ enrollmentId = "1e4c0f3b-7d5a-4a2f-9c8b-6f3e2d4c5b12"
227
234
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
228
235
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
229
- then error "Constraint 'OneActiveEnrolmentPerMemberAndCourse' is violated: another event source already holds the constrained value."
236
+ then error "Constraint 'OneActiveEnrollmentPerMemberAndCourse' is violated: another event source already holds the constrained value."
230
237
  specification ReEnrollingAfterWithdrawal
231
238
  given caller
232
239
  authenticated
@@ -238,11 +245,11 @@ module Courses
238
245
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
239
246
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
240
247
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
241
- given EnrolmentWithdrawn
248
+ given EnrollmentWithdrawn
242
249
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
243
250
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
244
- when EnrolMember
245
- enrolmentId = "1e4c0f3b-7d5a-4a2f-9c8b-6f3e2d4c5b12"
251
+ when EnrollMember
252
+ enrollmentId = "1e4c0f3b-7d5a-4a2f-9c8b-6f3e2d4c5b12"
246
253
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
247
254
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
248
255
  then MemberEnrolled
@@ -250,22 +257,22 @@ module Courses
250
257
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
251
258
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
252
259
 
253
- slice StateChange WithdrawEnrolment
254
- description "NOT enforced in the model today: a withdrawal must name an existing active enrolment of the same course. `courseId` is only a routing reference supplied by the caller, so without this check a wrong course would restore a seat elsewhere, and a withdrawal of an enrolment that does not exist would invent a free seat. Stated as `reads` + `require` over ActiveEnrolmentEntry (PLAY0271/PLAY0268 at binding). Target enforcement: a protected decision read of the enrolment (it is keyed directly by the enrolment source id, so it qualifies). Requirements to test in the target: withdrawing an unknown enrolment is rejected; withdrawing with another course is rejected; a correct withdrawal restores one seat."
255
- command WithdrawEnrolment
256
- enrolmentId EnrolmentId identifier
260
+ slice StateChange WithdrawEnrollment
261
+ description "NOT enforced in the model today: a withdrawal must name an existing active enrollment of the same course. `courseId` is only a routing reference supplied by the caller, so without this check a wrong course would restore a seat elsewhere, and a withdrawal of an enrollment that does not exist would invent a free seat. Stated as `reads` + `require` over ActiveEnrollmentEntry (PLAY0271/PLAY0268 at binding). Target enforcement: a protected decision read of the enrollment (it is keyed directly by the enrollment source id, so it qualifies). Requirements to test in the target: withdrawing an unknown enrollment is rejected; withdrawing with another course is rejected; a correct withdrawal restores one seat."
262
+ command WithdrawEnrollment
263
+ enrollmentId EnrollmentId identifier
257
264
  courseId CourseId
258
- reads ActiveEnrolmentEntry as enrolment by enrolmentId // stated intent, unprotected
265
+ reads ActiveEnrollmentEntry as enrollment by enrollmentId // stated intent, unprotected
259
266
  validate
260
- require enrolment.courseId == courseId
261
- message "The enrolment does not belong to that course" // NOT enforced today
262
- produces event EnrolmentWithdrawn
267
+ require enrollment.courseId == courseId
268
+ message "The enrollment does not belong to that course" // NOT enforced today
269
+ produces event EnrollmentWithdrawn
263
270
  courseId CourseId = courseId
264
271
  constraint WithdrawOnce
265
- unique event EnrolmentWithdrawn
266
- screen WithdrawEnrolment
267
- action WithdrawEnrolment for screen
268
- specification WithdrawingAnEnrolment
272
+ unique event EnrollmentWithdrawn
273
+ screen WithdrawEnrollment
274
+ action WithdrawEnrollment for screen
275
+ specification WithdrawingAnEnrollment
269
276
  given caller
270
277
  authenticated
271
278
  role "Coordinator"
@@ -273,17 +280,17 @@ module Courses
273
280
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
274
281
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
275
282
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
276
- when WithdrawEnrolment
277
- enrolmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
283
+ when WithdrawEnrollment
284
+ enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
278
285
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
279
- then EnrolmentWithdrawn
286
+ then EnrollmentWithdrawn
280
287
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
281
288
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
282
289
  specification RefusingAWithdrawalWithoutTheCoordinatorRole
283
290
  given caller
284
291
  authenticated
285
- when WithdrawEnrolment
286
- enrolmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
292
+ when WithdrawEnrollment
293
+ enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
287
294
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
288
295
  then denied
289
296
  specification RefusingASecondWithdrawal
@@ -294,41 +301,41 @@ module Courses
294
301
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
295
302
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
296
303
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
297
- given EnrolmentWithdrawn
304
+ given EnrollmentWithdrawn
298
305
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
299
306
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
300
- when WithdrawEnrolment
301
- enrolmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
307
+ when WithdrawEnrollment
308
+ enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
302
309
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
303
- then error "The enrolment does not belong to that course"
310
+ then error "The enrollment does not belong to that course"
304
311
  specification AppendingASecondWithdrawal
305
312
  given MemberEnrolled
306
313
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
307
314
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
308
315
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
309
- given EnrolmentWithdrawn
316
+ given EnrollmentWithdrawn
310
317
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
311
318
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
312
- when append EnrolmentWithdrawn
319
+ when append EnrollmentWithdrawn
313
320
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
314
321
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
315
322
  then error "Constraint 'WithdrawOnce' is violated: the event source already has the constrained event."
316
323
 
317
- slice StateView ActiveEnrolment
318
- description "An active enrolment is present until withdrawal; the facts stay in history."
319
- readmodel ActiveEnrolmentEntry
320
- enrolmentId EnrolmentId
324
+ slice StateView ActiveEnrollment
325
+ description "An active enrollment is present until withdrawal; the facts stay in history."
326
+ readmodel ActiveEnrollmentEntry
327
+ enrollmentId EnrollmentId
321
328
  courseId CourseId
322
329
  memberId MemberId
323
- query ActiveEnrolmentById => ActiveEnrolmentEntry optional
324
- by enrolmentId EnrolmentId
325
- projection ActiveEnrolments => ActiveEnrolmentEntry
330
+ query ActiveEnrollmentById => ActiveEnrollmentEntry optional
331
+ by enrollmentId EnrollmentId
332
+ projection ActiveEnrollments => ActiveEnrollmentEntry
326
333
  from MemberEnrolled
327
- enrolmentId = $eventSourceId
334
+ enrollmentId = $eventSourceId
328
335
  courseId = courseId
329
336
  memberId = memberId
330
- remove with EnrolmentWithdrawn
331
- specification ShowingAnActiveEnrolment
337
+ remove with EnrollmentWithdrawn
338
+ specification ShowingAnActiveEnrollment
332
339
  given caller
333
340
  authenticated
334
341
  role "Coordinator"
@@ -336,26 +343,30 @@ module Courses
336
343
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
337
344
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
338
345
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
339
- then query ActiveEnrolmentById
346
+ then query ActiveEnrollmentById
340
347
  arguments
341
- enrolmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
348
+ enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
342
349
  result
343
350
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
344
351
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
345
- specification RefusingEnrolmentDetailToAnOrdinaryMember
352
+ specification RefusingEnrollmentDetailToAnOrdinaryMember
346
353
  given caller
347
354
  authenticated
348
- then query ActiveEnrolmentById
355
+ then query ActiveEnrollmentById
349
356
  arguments
350
- enrolmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
357
+ enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
351
358
  then denied
352
- specification RemovingAWithdrawnEnrolment
359
+ specification RemovingAWithdrawnEnrollment
353
360
  given MemberEnrolled
354
361
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
355
362
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
356
363
  memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
357
- when append EnrolmentWithdrawn
364
+ when append EnrollmentWithdrawn
358
365
  for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
359
366
  courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
360
- then no readmodel ActiveEnrolmentEntry for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
367
+ then no readmodel ActiveEnrollmentEntry for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
361
368
  ```
369
+
370
+ ## What this example proves
371
+
372
+ The source documents the intended behavior. The recorded binding refusal means none of the included scenarios proves it. Verify the enforced claims and the capacity and withdrawal races against the target store.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-security-review
3
- description: Use when auditing a Cratis application change for security, especially permissions, untrusted input, secrets or permanent event-log exposure. Not for implementing authentication or general style review.
3
+ description: Use when auditing a Cratis application change for authorization, untrusted input, secrets or permanent event-log exposure. Not for a general correctness review (use cratis-code-review).
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -47,78 +47,9 @@ command's properties as well as grepping them.
47
47
  - Implementing personal-data protection or erasure: use
48
48
  `cratis-chronicle-protect-personal-data` from `cratis/application`.
49
49
 
50
- ## Step 1 — Event sourcing: the permanent-record checks
51
-
52
- - **Every `[Command]` property holding a secret or credential is marked `[NotAudited]`; a retained operational secret is also `[Encrypted]` on the event, and a credential reaches the event only as a hash or a reference.** A
53
- command's property values are written to the causation of every event it
54
- appends, and causation is as permanent as the events. Prefer the marking on
55
- the concept type so it travels everywhere the value appears. `[NotAudited]`
56
- alone leaves the secret in plaintext on events; `[Encrypted]` alone leaves the
57
- command input on the causation chain.
58
- `ARCCHR0009` catches properties whose *names* read as secrets — so read the
59
- properties whose names do not say what they hold, because the analyzer cannot.
60
- - Flag personal data that does not use subject protection; encryption alone
61
- does not enroll a value in erasure. Never combine
62
- `[PII]` with `[Encrypted]` (`CHR0053`), and neither goes on an event-source id
63
- (`CHR0034`, `CHR0052`).
64
- - Credentials used for authentication (passwords, bearer or session tokens) are never stored; keep a hash or a reference. An operational secret the system must retain and use (a third-party API key, a company's bank account number) is stored only as an `[Encrypted]` + `[NotAudited]` concept, and never in a read model returned to clients in plaintext.
65
- - Event-source ids are generated server-side, never accepted from an untrusted
66
- client where the id grants access to a stream.
67
- - Upcasting and event-type migration logic cannot introduce a property the
68
- original contract did not carry.
69
- - Uniqueness cannot be bypassed by concurrent writes — it is enforced by a
70
- Chronicle constraint, not by a read-model pre-check.
71
- - Cross-tenant writes cannot bypass a constraint that is scoped per namespace.
72
-
73
- ## Step 2 — Input validation and injection
74
-
75
- - Every command property is validated before use — null, empty, range, format.
76
- - No raw SQL concatenation; parameterized queries or EF Core only.
77
- - No user-supplied value reaches `Path.Combine`, a `File.*` call, a shell
78
- command, or process arguments.
79
- - No user-supplied value becomes an event-store key without sanitization.
80
-
81
- ## Step 3 — Authentication and authorization
82
-
83
- - Every exposed endpoint is either authorized or explicitly anonymous with a
84
- stated reason.
85
- - Authorization is expressed at the boundary — an attribute, a policy, a command
86
- filter — never as an `if` on roles inside `Handle()`.
87
- - Tenant isolation holds: no cross-namespace data is reachable without
88
- authorization.
89
- - Claims are verified before acting on identity-dependent command data. A client
90
- must not be able to assert who it is through a command property.
91
- - Note that an unauthorized command result maps to HTTP **403**, not 401 — a
92
- reviewer reading logs for 401s will miss authorization failures.
93
- - Review [Arc-specific security boundaries](references/arc-boundaries.md) when
94
- the diff touches hosting, identity, policies, discovery, streams or system actors.
95
- It ties the checks to Arc source; do not assume a clean analyzer run proves
96
- those deployment boundaries.
97
-
98
- ## Step 4 — Data exposure
99
-
100
- - No personal data is returned to a caller that did not supply it.
101
- - Query results are scoped to the requesting tenant and user. A query that can
102
- return all-tenant data is a finding even when no current caller reaches it.
103
- - Response payloads carry only fields the client uses. Over-fetching is an
104
- exposure surface, not only a performance one.
105
- - A managed read-model document holds one subject's personal data. Mixing
106
- several people's data in one document breaks erasure.
107
-
108
- ## Step 5 — Secrets and configuration
109
-
110
- - No secret in source, in a configuration file, or in a specification fixture.
111
- - Secrets come from environment variables or a secrets manager.
112
- - No hard-coded connection string outside test code.
113
-
114
- ## Step 6 — Frontend
115
-
116
- - No user-supplied value in `dangerouslySetInnerHTML`.
117
- - No token or secret in `localStorage` — use an `httpOnly` cookie or in-memory
118
- state.
119
- - Command payloads carry only the minimum required fields.
120
- - No client-side access control that is not also enforced server-side. A
121
- disabled button is a usability affordance, never a control.
50
+ ## Review the affected paths
51
+
52
+ Read [the review checklist](references/review-checklist.md) for event data, authorization, inputs, secrets and frontend exposure. Trace each affected request from its server-side authorization decision to any durable or externally visible copy of its data. For Arc endpoints, also read [Arc boundaries](references/arc-boundaries.md) to check each exposure surface.
122
53
 
123
54
  ## Step 7 — Report
124
55
 
@@ -3,10 +3,20 @@
3
3
  <!-- Copyright (c) Cratis. All rights reserved. -->
4
4
  <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
5
5
 
6
- - Enable `TrustForwardedIdentityHeaders` only behind an authenticating ingress
7
- that strips caller identity headers, replaces them and prevents direct backend
8
- access. Headers are unsigned, not proof of identity. Without the explicit
9
- host-wide opt-in Arc ignores them. Custom handlers must honor the same flag.
6
+ - Leave forwarded identity off unless an authenticated ingress supplies it. In
7
+ unsigned mode, `TrustForwardedIdentityHeaders` trusts the ingress, not the
8
+ headers as proof. Verify the ingress strips and replaces caller-supplied
9
+ identity headers and prevents direct backend access. Custom handlers must
10
+ honor the trust switch and must not bypass signed-mode verification.
11
+ - For signed forwarding, check both `TrustForwardedIdentityHeaders` and
12
+ `ForwardedIdentity.Enabled`. Verify the expected signer keys and audience and
13
+ confirm missing, invalid, expired or replayed envelopes establish no forwarded
14
+ identity, without falling back to unsigned headers. Replay protection is
15
+ process-local; do not assume fleet-wide protection. If
16
+ `ForwardedIdentity.ClientCertificate.Required` is configured, confirm every
17
+ relevant listener requests a client certificate and Arc validates the immediate
18
+ TLS peer against the configured CA and DNS allowlist. Missing or untrusted
19
+ peers must not establish forwarded identity; HTTP headers are not peer proof.
10
20
  - Application code must not read `.cratis-identity`. The backend derives identity
11
21
  from the authenticated principal; the JS client only falls back to the legacy
12
22
  cookie on 404, never on 401/403. Use `clearCache()` on logout. Browser identity
@@ -14,8 +24,8 @@
14
24
  - Test all discovery routes outside Development. Default access is authenticated
15
25
  there, or 404 when the host cannot authenticate. Explicit
16
26
  `RequireAuthentication=false` opens discovery in every environment;
17
- `Enabled=false` removes catalogs, not identity discovery. Disable both switches
18
- when neither is needed. `[ExcludeFromDiscovery]` hides documentation/catalogs,
27
+ `Enabled=false` removes catalogs, not identity discovery. Set `Enabled=false` and `IdentityDiscovery=false` when neither surface
28
+ is needed; `RequireAuthentication=false` is not a disable switch. `[ExcludeFromDiscovery]` hides documentation/catalogs,
19
29
  not invocation or authorization.
20
30
  - Check ARC0019/0020/0021: conflicting declarations, Microsoft attributes without
21
31
  the ASP.NET integration, and schemes on the standalone host. Microsoft
@@ -23,8 +33,8 @@
23
33
  on supported hosts. A method declaration **replaces** the type declaration.
24
34
  Guest access requires every policy in the declaration to opt in
25
35
  (`evaluatesAnonymous`), without roles/schemes.
26
- Requires Arc 22.44.2 for guest endpoints to be
27
- reachable through HTTP even with an authenticated fallback policy. Keep an
36
+ Verify guest endpoints remain reachable through HTTP with the authenticated
37
+ fallback policy enabled. Keep an
28
38
  intentional `IFallbackAuthorizationEvaluator` baseline; it is separate from
29
39
  ASP.NET's `FallbackPolicy`.
30
40
  - The embedded `/.cratis/event-model` viewer defaults to Debug **and** Development.
@@ -37,11 +47,12 @@
37
47
  widen it with sensitive payloads or mistake this for a promise of no ids.
38
48
  - Returned reactor commands marked `[ExecuteCommandsAsSystem]` use a narrow
39
49
  disposed system scope.
40
- Requires Arc 22.72.0 so the system scope never carries the caller principal (earlier versions leaked it);
41
- manually executing commands still needs explicit actor ownership.
50
+ Assert no caller principal carries into the system scope. Manually executing
51
+ commands still needs explicit actor ownership.
42
52
  - Revocable observable data needs `IGuardObservableQueryEmission`; it applies to
43
53
  plain HTTP snapshots/waits/long polls too. Suppression withholds data; denial
44
54
  terminates/returns unauthorized. Never read the producer's ambient principal.
45
- - Query health remains explicitly anonymous and returns connection health. Audit
46
- exposure of connection user IDs, not just catalogs:
47
- discovery restrictions are not blanket protection of `/.cratis/*`.
55
+ - Query health is anonymous by default in Development and authenticated
56
+ elsewhere. Audit its own authentication and role settings separately from
57
+ discovery settings, including access to cross-user identifiers and connection
58
+ metadata over direct HTTP and the hubs.
@@ -0,0 +1,74 @@
1
+ # Security review checklist
2
+
3
+ ## Step 1 — Event sourcing: the permanent-record checks
4
+
5
+ - **Every `[Command]` property holding a secret or credential is marked `[NotAudited]`; a retained operational secret is also `[Encrypted]` on the event, and a credential reaches the event only as a hash or a reference.** A
6
+ command's property values are written to the causation of every event it
7
+ appends, and causation is as permanent as the events. Prefer the marking on
8
+ the concept type so it travels everywhere the value appears. `[NotAudited]`
9
+ alone leaves the secret in plaintext on events; `[Encrypted]` alone leaves the
10
+ command input on the causation chain.
11
+ `ARCCHR0009` catches properties whose *names* read as secrets — so read the
12
+ properties whose names do not say what they hold, because the analyzer cannot.
13
+ - Flag personal data that does not use subject protection; encryption alone
14
+ does not enroll a value in erasure. Never combine
15
+ `[PII]` with `[Encrypted]` (`CHR0053`), and neither goes on an event-source id
16
+ (`CHR0034`, `CHR0052`).
17
+ - Credentials used for authentication (passwords, bearer or session tokens) are never stored; keep a hash or a reference. An operational secret the system must retain and use (a third-party API key, a company's bank account number) is stored only as an `[Encrypted]` + `[NotAudited]` concept, and never in a read model returned to clients in plaintext.
18
+ - Event-source ids are generated server-side, never accepted from an untrusted
19
+ client where the id grants access to a stream.
20
+ - Upcasting and event-type migration logic cannot introduce a property the
21
+ original contract did not carry.
22
+ - Uniqueness cannot be bypassed by concurrent writes — it is enforced by a
23
+ Chronicle constraint, not by a read-model pre-check.
24
+ - Cross-tenant writes cannot bypass a constraint that is scoped per namespace.
25
+
26
+ ## Step 2 — Input validation and injection
27
+
28
+ - Every command property is validated before use — null, empty, range, format.
29
+ - No raw SQL concatenation; parameterized queries or EF Core only.
30
+ - No user-supplied value reaches `Path.Combine`, a `File.*` call, a shell
31
+ command, or process arguments.
32
+ - No user-supplied value becomes an event-store key without sanitization.
33
+
34
+ ## Step 3 — Authentication and authorization
35
+
36
+ - Every exposed endpoint is either authorized or explicitly anonymous with a
37
+ stated reason.
38
+ - Authorization is expressed at the boundary — an attribute, a policy, a command
39
+ filter — never as an `if` on roles inside `Handle()`.
40
+ - Tenant isolation holds: no cross-namespace data is reachable without
41
+ authorization.
42
+ - Claims are verified before acting on identity-dependent command data. A client
43
+ must not be able to assert who it is through a command property.
44
+ - Note that an unauthorized command result maps to HTTP **403**, not 401 — a
45
+ reviewer reading logs for 401s will miss authorization failures.
46
+ - Review [Arc-specific security boundaries](arc-boundaries.md) when
47
+ the diff touches hosting, identity, policies, discovery, streams or system actors.
48
+ It ties the checks to Arc source; do not assume a clean analyzer run proves
49
+ those deployment boundaries.
50
+
51
+ ## Step 4 — Data exposure
52
+
53
+ - No personal data is returned to a caller that did not supply it.
54
+ - Query results are scoped to the requesting tenant and user. A query that can
55
+ return all-tenant data is a finding even when no current caller reaches it.
56
+ - Response payloads carry only fields the client uses. Over-fetching is an
57
+ exposure surface, not only a performance one.
58
+ - A managed read-model document holds one subject's personal data. Mixing
59
+ several people's data in one document breaks erasure.
60
+
61
+ ## Step 5 — Secrets and configuration
62
+
63
+ - No secret in source, in a configuration file, or in a specification fixture.
64
+ - Secrets come from environment variables or a secrets manager.
65
+ - No hard-coded connection string outside test code.
66
+
67
+ ## Step 6 — Frontend
68
+
69
+ - No user-supplied value in `dangerouslySetInnerHTML`.
70
+ - No token or secret in `localStorage` — use an `httpOnly` cookie or in-memory
71
+ state.
72
+ - Command payloads carry only the minimum required fields.
73
+ - No client-side access control that is not also enforced server-side. A
74
+ disabled button is a usability affordance, never a control.