@cratis/pi 8.4.1 → 8.6.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 (286) hide show
  1. package/package/corpus/harnesses/copilot/instructions/ai-distribution.instructions.md +2 -1
  2. package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +1 -1
  3. package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +5 -3
  4. package/package/corpus/harnesses/copilot/instructions/react.instructions.md +3 -1
  5. package/package/corpus/harnesses/copilot/instructions/reactors.instructions.md +3 -1
  6. package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +2 -1
  7. package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +6 -3
  8. package/package/corpus/harnesses/copilot/instructions/vertical-slices.instructions.md +5 -2
  9. package/package/corpus/hooks/scripts/cratis-guard-secrets.sh +131 -9
  10. package/package/corpus/rules/ai-distribution.md +2 -1
  11. package/package/corpus/rules/exit-codes-and-wrappers.md +1 -1
  12. package/package/corpus/rules/glossary.md +5 -3
  13. package/package/corpus/rules/react.md +3 -1
  14. package/package/corpus/rules/reactors.md +3 -1
  15. package/package/corpus/rules/scripting.md +2 -1
  16. package/package/corpus/rules/specs.csharp.md +6 -3
  17. package/package/corpus/rules/vertical-slices.md +5 -2
  18. package/package/corpus/skills/cratis-application-growth/SKILL.md +1 -2
  19. package/package/corpus/skills/cratis-application-growth/references/csharp.md +1 -3
  20. package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +1 -2
  21. package/package/corpus/skills/cratis-application-growth/references/rename-window.md +1 -3
  22. package/package/corpus/skills/cratis-application-growth/references/service-and-delivery.md +3 -2
  23. package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
  24. package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +3 -3
  25. package/package/corpus/skills/cratis-arc-authorize-request/references/authproxy.md +47 -3
  26. package/package/corpus/skills/cratis-arc-authorize-request/references/csharp-query-security.md +18 -3
  27. package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +12 -3
  28. package/package/corpus/skills/cratis-arc-authorize-request/references/typescript.md +2 -0
  29. package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -0
  30. package/package/corpus/skills/cratis-arc-connect-storage/references/elixir.md +9 -2
  31. package/package/corpus/skills/cratis-arc-declare-command/SKILL.md +2 -0
  32. package/package/corpus/skills/cratis-arc-declare-command/references/csharp-chronicle.md +47 -8
  33. package/package/corpus/skills/cratis-arc-declare-command/references/csharp-controller.md +3 -1
  34. package/package/corpus/skills/cratis-arc-declare-command/references/csharp-history.md +6 -3
  35. package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +38 -11
  36. package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
  37. package/package/corpus/skills/cratis-arc-declare-operation/references/csharp-abilities.md +2 -2
  38. package/package/corpus/skills/cratis-arc-declare-operation/references/csharp-recovery.md +6 -4
  39. package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +2 -2
  40. package/package/corpus/skills/cratis-arc-diagnose-live-query/SKILL.md +1 -1
  41. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +29 -7
  42. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/java.md +1 -1
  43. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/kotlin.md +1 -1
  44. package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/csharp-diagnose-tool-call.md +9 -7
  45. package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/csharp.md +52 -1
  46. package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +4 -2
  47. package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +36 -10
  48. package/package/corpus/skills/cratis-arc-expose-query/references/go.md +2 -2
  49. package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +6 -3
  50. package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +1 -0
  51. package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +55 -6
  52. package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +9 -0
  53. package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
  54. package/package/corpus/skills/cratis-arc-host-application/references/csharp-configuration.md +54 -0
  55. package/package/corpus/skills/cratis-arc-host-application/references/csharp-deployment.md +98 -0
  56. package/package/corpus/skills/cratis-arc-host-application/references/csharp-http.md +9 -1
  57. package/package/corpus/skills/cratis-arc-host-application/references/csharp-identity.md +87 -4
  58. package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +9 -0
  59. package/package/corpus/skills/cratis-arc-invoke-command/references/csharp-extensions.md +4 -0
  60. package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +2 -1
  61. package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +19 -2
  62. package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +4 -2
  63. package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +2 -0
  64. package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +33 -36
  65. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-commands.md +18 -3
  66. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-host.md +94 -19
  67. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-identity.md +29 -5
  68. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-instant-feedback.md +81 -0
  69. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-localization.md +80 -0
  70. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-navigation.md +103 -0
  71. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-queries.md +41 -2
  72. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-structure.md +117 -0
  73. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript.md +8 -4
  74. package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +3 -3
  75. package/package/corpus/skills/cratis-arc-react-separate-view-model/references/typescript.md +27 -6
  76. package/package/corpus/skills/cratis-arc-testing-typescript/references/typescript.md +2 -2
  77. package/package/corpus/skills/cratis-arc-validate-command/references/csharp-rules.md +23 -2
  78. package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +28 -2
  79. package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +1 -0
  80. package/package/corpus/skills/cratis-authproxy-configure/SKILL.md +136 -0
  81. package/package/corpus/skills/cratis-authproxy-configure/references/admission.md +125 -0
  82. package/package/corpus/skills/cratis-authproxy-configure/references/aspire.md +154 -0
  83. package/package/corpus/skills/cratis-authproxy-configure/references/operations.md +122 -0
  84. package/package/corpus/skills/cratis-authproxy-configure/references/services-and-routing.md +114 -0
  85. package/package/corpus/skills/cratis-authproxy-configure/references/sessions-and-logout.md +126 -0
  86. package/package/corpus/skills/cratis-authproxy-configure/references/sign-in-providers.md +116 -0
  87. package/package/corpus/skills/cratis-authproxy-configure/references/tenant-resolution.md +135 -0
  88. package/package/corpus/skills/cratis-choreography-run-workflow/SKILL.md +117 -0
  89. package/package/corpus/skills/cratis-choreography-run-workflow/references/csharp-chronicle.md +164 -0
  90. package/package/corpus/skills/cratis-choreography-run-workflow/references/csharp.md +354 -0
  91. package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +6 -6
  92. package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +11 -3
  93. package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +50 -0
  94. package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +17 -3
  95. package/package/corpus/skills/cratis-chronicle-cli-operations/references/setup-and-target.md +8 -2
  96. package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp-services.md +13 -2
  97. package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +12 -0
  98. package/package/corpus/skills/cratis-chronicle-connect-application/references/kotlin.md +2 -0
  99. package/package/corpus/skills/cratis-chronicle-connect-application/references/python.md +2 -2
  100. package/package/corpus/skills/cratis-chronicle-connect-application/references/typescript.md +10 -1
  101. package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +9 -2
  102. package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +35 -3
  103. package/package/corpus/skills/cratis-chronicle-constrain-append/references/go.md +1 -1
  104. package/package/corpus/skills/cratis-chronicle-constrain-append/references/operations.md +70 -0
  105. package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +6 -3
  106. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/configuration.md +113 -16
  107. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/container-and-kubernetes.md +293 -0
  108. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/kernel-options.md +16 -9
  109. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/network-and-tls.md +60 -7
  110. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +124 -2
  111. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/upgrade-and-recovery.md +36 -1
  112. package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +12 -0
  113. package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
  114. package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +15 -5
  115. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +9 -8
  116. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/go.md +2 -2
  117. package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +1 -1
  118. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +1 -1
  119. package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +2 -2
  120. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-fluent.md +15 -4
  121. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-model-bound.md +4 -1
  122. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-reading.md +5 -2
  123. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +23 -0
  124. package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +1 -0
  125. package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +2 -1
  126. package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +3 -1
  127. package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +4 -3
  128. package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +3 -1
  129. package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +3 -1
  130. package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp-scopes.md +41 -4
  131. package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +22 -4
  132. package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +7 -0
  133. package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +9 -1
  134. package/package/corpus/skills/cratis-chronicle-protect-decision/references/java.md +8 -0
  135. package/package/corpus/skills/cratis-chronicle-protect-decision/references/kotlin.md +9 -0
  136. package/package/corpus/skills/cratis-chronicle-protect-decision/references/typescript.md +7 -0
  137. package/package/corpus/skills/cratis-chronicle-protect-personal-data/SKILL.md +1 -1
  138. package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +28 -3
  139. package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +7 -6
  140. package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +41 -0
  141. package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir-integrations.md +3 -3
  142. package/package/corpus/skills/cratis-chronicle-publish-contract/references/webhook-signature-wire-format.md +82 -0
  143. package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +19 -1
  144. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp-outputs.md +3 -1
  145. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp-pages.md +1 -1
  146. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +37 -4
  147. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/elixir.md +11 -0
  148. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +2 -1
  149. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -0
  150. package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +3 -3
  151. package/package/corpus/skills/cratis-chronicle-record-event/references/csharp-coordination.md +31 -2
  152. package/package/corpus/skills/cratis-chronicle-record-event/references/csharp-history.md +21 -4
  153. package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +20 -2
  154. package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
  155. package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +1 -1
  156. package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -0
  157. package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +2 -1
  158. package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +3 -1
  159. package/package/corpus/skills/cratis-chronicle-reduce-state/references/java.md +10 -1
  160. package/package/corpus/skills/cratis-chronicle-reduce-state/references/kotlin.md +10 -1
  161. package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +27 -5
  162. package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +18 -0
  163. package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +21 -1
  164. package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +13 -0
  165. package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +15 -0
  166. package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +15 -0
  167. package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +16 -0
  168. package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +1 -1
  169. package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +4 -3
  170. package/package/corpus/skills/cratis-ci-pipeline-performance/references/publish-pipelines.md +19 -4
  171. package/package/corpus/skills/cratis-code-review/SKILL.md +6 -2
  172. package/package/corpus/skills/cratis-code-review/references/csharp-diagnostics.md +28 -2
  173. package/package/corpus/skills/cratis-code-review/references/csharp.md +4 -4
  174. package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +6 -38
  175. package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +2 -0
  176. package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-labels-and-release.md +5 -4
  177. package/package/corpus/skills/cratis-commits-and-pull-requests/references/workflow-inputs.md +39 -0
  178. package/package/corpus/skills/cratis-components-accessibility/SKILL.md +6 -8
  179. package/package/corpus/skills/cratis-components-accessibility/references/typescript.md +32 -14
  180. package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +4 -3
  181. package/package/corpus/skills/cratis-components-build-canvas/references/typescript-props.md +1 -1
  182. package/package/corpus/skills/cratis-components-build-canvas/references/typescript.md +4 -2
  183. package/package/corpus/skills/cratis-components-choose-control/SKILL.md +13 -7
  184. package/package/corpus/skills/cratis-components-choose-control/references/from-primereact.md +116 -0
  185. package/package/corpus/skills/cratis-components-choose-control/references/menu.md +90 -0
  186. package/package/corpus/skills/cratis-components-choose-control/references/typescript-composition.md +48 -0
  187. package/package/corpus/skills/cratis-components-choose-control/references/typescript.md +2 -2
  188. package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +2 -1
  189. package/package/corpus/skills/cratis-components-compose-toolbar/references/floating-toolbar.md +146 -0
  190. package/package/corpus/skills/cratis-components-diagnose-screen/SKILL.md +102 -0
  191. package/package/corpus/skills/cratis-components-display-list/SKILL.md +10 -10
  192. package/package/corpus/skills/cratis-components-display-list/references/typescript-custom-panel.md +74 -0
  193. package/package/corpus/skills/cratis-components-display-list/references/typescript-datatables.md +2 -7
  194. package/package/corpus/skills/cratis-components-display-list/references/typescript.md +3 -2
  195. package/package/corpus/skills/cratis-components-submit-form/SKILL.md +6 -6
  196. package/package/corpus/skills/cratis-components-submit-form/references/typescript-commanddialog.md +21 -1
  197. package/package/corpus/skills/cratis-components-submit-form/references/typescript-commandform.md +72 -2
  198. package/package/corpus/skills/cratis-components-submit-form/references/typescript.md +7 -5
  199. package/package/corpus/skills/cratis-components-theme-application/SKILL.md +17 -15
  200. package/package/corpus/skills/cratis-components-theme-application/references/localization.md +166 -0
  201. package/package/corpus/skills/cratis-components-theme-application/references/typescript.md +18 -14
  202. package/package/corpus/skills/cratis-components-theme-application/references/upgrade-from-previous-major.md +141 -0
  203. package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +2 -0
  204. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp-domain-philosophy.md +31 -3
  205. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp-fundamentals-helpers.md +119 -0
  206. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp.md +4 -0
  207. package/package/corpus/skills/cratis-fundamentals-concept/references/csharp-serialization.md +72 -1
  208. package/package/corpus/skills/cratis-fundamentals-concept/references/csharp.md +9 -0
  209. package/package/corpus/skills/cratis-fundamentals-concept/references/go.md +2 -1
  210. package/package/corpus/skills/cratis-fundamentals-concept/references/java-json.md +3 -2
  211. package/package/corpus/skills/cratis-fundamentals-concept/references/kotlin-json.md +3 -2
  212. package/package/corpus/skills/cratis-fundamentals-concept/references/typescript-serialization.md +41 -2
  213. package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -7
  214. package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +2 -1
  215. package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +3 -3
  216. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp-diagnostics.md +8 -0
  217. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp.md +2 -2
  218. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/go-dependency-injection.md +3 -0
  219. package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +6 -4
  220. package/package/corpus/skills/cratis-modeling-design-event-model/references/command-inventory.md +7 -1
  221. package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +13 -1
  222. package/package/corpus/skills/cratis-modeling-design-event-model/references/review-one-slice.md +6 -0
  223. package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +6 -6
  224. package/package/corpus/skills/cratis-multi-service-local-orchestration/references/csharp-aspire.md +116 -28
  225. package/package/corpus/skills/cratis-multi-service-local-orchestration/references/docker-compose.md +2 -2
  226. package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +46 -0
  227. package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +4 -2
  228. package/package/corpus/skills/cratis-platform-build-application/SKILL.md +8 -0
  229. package/package/corpus/skills/cratis-platform-build-application/references/cratis-identity.md +71 -0
  230. package/package/corpus/skills/cratis-platform-build-application/references/studio-repository.md +96 -0
  231. package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +14 -8
  232. package/package/corpus/skills/cratis-platform-deliver-slice/references/csharp.md +167 -3
  233. package/package/corpus/skills/cratis-platform-deliver-slice/references/eventual-consistency.md +150 -0
  234. package/package/corpus/skills/cratis-platform-deliver-slice/references/typescript.md +14 -1
  235. package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +1 -1
  236. package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +8 -8
  237. package/package/corpus/skills/cratis-platform-prepare-release-pr/references/product-release-checks.md +16 -2
  238. package/package/corpus/skills/cratis-platform-start-application/SKILL.md +21 -0
  239. package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +77 -3
  240. package/package/corpus/skills/cratis-platform-upgrade-application/SKILL.md +118 -0
  241. package/package/corpus/skills/cratis-platform-upgrade-application/references/csharp.md +117 -0
  242. package/package/corpus/skills/cratis-platform-upgrade-application/references/java.md +53 -0
  243. package/package/corpus/skills/cratis-platform-upgrade-application/references/kotlin.md +53 -0
  244. package/package/corpus/skills/cratis-platform-upgrade-application/references/typescript.md +71 -0
  245. package/package/corpus/skills/cratis-release-notes/SKILL.md +1 -1
  246. package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +6 -3
  247. package/package/corpus/skills/cratis-screenplay-accept-model/references/csharp.md +34 -3
  248. package/package/corpus/skills/cratis-screenplay-accept-model/references/read-the-evidence.md +84 -3
  249. package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +7 -11
  250. package/package/corpus/skills/cratis-screenplay-declare-slice/references/commands.md +8 -4
  251. package/package/corpus/skills/cratis-screenplay-declare-slice/references/projections.md +2 -0
  252. package/package/corpus/skills/cratis-screenplay-declare-slice/references/structure-and-imports.md +29 -1
  253. package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +2 -1
  254. package/package/corpus/skills/cratis-screenplay-edit-workspace/references/mcp-tools.md +1 -1
  255. package/package/corpus/skills/cratis-screenplay-handoff-slice/references/csharp.md +13 -1
  256. package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +1 -1
  257. package/package/corpus/skills/cratis-screenplay-model-translation/references/boundary-diagnostics.md +1 -1
  258. package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +30 -51
  259. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/cli.md +19 -2
  260. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/smallest-model.md +87 -0
  261. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/studio.md +5 -0
  262. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/typescript.md +13 -0
  263. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/workspace-mcp.md +5 -0
  264. package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +8 -12
  265. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/running-mcp.md +12 -0
  266. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/scenarios.md +2 -2
  267. package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +2 -0
  268. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-colocated.md +101 -0
  269. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +4 -2
  270. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-decision-reads.md +1 -0
  271. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-events.md +7 -0
  272. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-integration.md +7 -4
  273. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-reactors.md +18 -5
  274. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-read-models.md +4 -2
  275. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +35 -2
  276. package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +2 -0
  277. package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +4 -2
  278. package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +1 -1
  279. package/package/corpus/skills/cratis-specifications-isolate-behavior/references/csharp-running.md +10 -3
  280. package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript.md +22 -4
  281. package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -1
  282. package/package/corpus/skills/cratis-specifications-test-typescript-behavior/references/typescript.md +40 -0
  283. package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +6 -0
  284. package/package/corpus/skills/cratis-stage-render-slice/references/semantic-conformance.md +64 -0
  285. package/package/profile-catalog.json +15 -0
  286. package/package.json +1 -1
@@ -15,14 +15,12 @@ compatibility: Requires the Screenplay CLI (`screenplay`) or the Cratis CLI (`cr
15
15
  - Connect an MCP server
16
16
  - Create the first document through MCP
17
17
  - Migrate retired source forms
18
- - Exchange a model with Studio
19
18
  - Capability catalog
19
+ - References
20
20
 
21
21
  Names such as `Greenhouse` and `Watering` are illustrative.
22
22
 
23
- Read `references/<language>.md` for the project's SDK (`.csproj` → csharp, Node server `package.json` → typescript, `*.kt` → kotlin, `*.java` → java, `go.mod` → go, `mix.exs` → elixir); only the project's languages are installed.
24
-
25
- Workspace onboarding uses the same DSL and tools on every stack; the language reference covers embedding the compiler or a `.play` editor in your own code.
23
+ Onboarding uses the same DSL and tools on every stack; see References for embedding the compiler or a `.play` editor in your own code.
26
24
 
27
25
  ## How a workspace works
28
26
 
@@ -35,12 +33,15 @@ Workspace onboarding uses the same DSL and tools on every stack; the language re
35
33
 
36
34
  ## Choose the model root
37
35
 
38
- Reuse an existing root rather than starting a second application. Take the first that applies:
36
+ Reuse an existing root rather than starting a second application. Project registrations resolve the root in this order:
37
+
38
+ 1. `mcpServers.screenplay.root` in `.cratis/ai.json`: exactly that project-relative folder.
39
+ 2. `.cratis/screenplay`, when it holds `.play` files.
40
+ 3. The deepest folder holding every `.play` file that discovery finds. Discovery does not descend into folders whose names start with `.`, build and package output (`bin`, `obj`, `node_modules`, `dist`, `out`, `artifacts`, `packages`), linked folders or folders more than ten levels deep, and finds nothing after visiting more than 50,000 entries. These limits only choose the root. The server then compiles every `.play` file under that root as one application, skipping only `.git`, `.ai-work`, `.screenplay`, `bin`, `obj` and `node_modules`, so files in `dist` or `out` are loaded too and conflicting declarations are reported. It refuses any symbolic link under the root outside those folders, so replace linked `.play` files with real files. Configure `root` to serve one of several unrelated models.
41
+ 4. When discovery finds no `.play` files, a `Source` or `src` folder that already holds `.screenplay` state. An ordinary code folder is never picked.
42
+ 5. Otherwise a `Screenplay` folder at the project root, for a new model. The standalone server also falls back to this folder when it resolves a project.
39
43
 
40
- 1. `mcpServers.screenplay.root` in `.cratis/ai.json`, a project-relative path.
41
- 2. A folder holding `.screenplay/identities.json` or `.screenplay/pending.json`. Existing identity state keeps its root.
42
- 3. The common folder of the project's existing `.play` files, for example `.cratis/screenplay` when it holds them.
43
- 4. For a new model, a `Screenplay` folder at the project root. Both MCP servers pick this folder too. Never pick an ordinary code `src` folder.
44
+ When the bundled server resolves a project (`.cratis/ai.json` present or `--project-root`) without a configured `root`, it checks every folder from the project down to the folder chosen above, both included, for `.screenplay` state (identities or an interrupted write). Only the state folder nearest the project is served, even when it holds just an interrupted write. Startup reports identities in deeper folders and ignores them. To work with one of those folders, start a new `cratis screenplay mcp <folder>` server; `open-workspace` cannot switch a running fixed-root server to it. If any other of those folders holds an interrupted write (`pending.json`), startup fails until that write is recovered. Without `.cratis/ai.json` or `--project-root`, the root is bound at `open-workspace` (see Connect an MCP server).
44
45
 
45
46
  Done when exactly one root is named and no other `.play` files sit beneath it unintentionally.
46
47
 
@@ -48,7 +49,7 @@ Done when exactly one root is named and no other `.play` files sit beneath it un
48
49
 
49
50
  Use this when the root has no `.play` files. If it already has some, the application exists. Skip to the next task (`cratis-screenplay-declare-slice` for new behaviour).
50
51
 
51
- 1. Run `screenplay version`. If the command is missing, install it with `dotnet tool install --global Cratis.Screenplay.Tool`, which needs a .NET SDK compatible with the tool and the global .NET tool folder on `PATH`. Without .NET, use the Docker image or the Cratis CLI (see Connect an MCP server).
52
+ 1. Run `screenplay version`. If the command is missing, install it with `dotnet tool install --global Cratis.Screenplay.Tool`, which needs the .NET 11 SDK and the global .NET tool folder on `PATH`. Without .NET, use the Docker image or the Cratis CLI (see Connect an MCP server).
52
53
  2. Create `<root>/application.play` with this content:
53
54
 
54
55
  ```play
@@ -61,7 +62,7 @@ Use this when the root has no `.play` files. If it already has some, the applica
61
62
  4. Run `screenplay test <root>`. With no specifications yet, expect `passed: 0 discovered` and exit `0`. Exit `3` means the model did not bind (or execution was unsupported): read the diagnostics before going on. This only proves that the workspace loads. It says nothing about business behaviour.
62
63
 
63
64
  Without the .NET tool, run the same checks through Docker: `docker run --rm -v "<absolute root>:/work:ro" cratis/screenplay /work`, and `... cratis/screenplay test /work`.
64
- 5. Commit `application.play`. Next, declare the first slice from the agreed timeline (`cratis-screenplay-declare-slice`).
65
+ 5. Commit `application.play`. Next, declare the first slice from the agreed timeline (`cratis-screenplay-declare-slice`); see the [smallest complete model](references/smallest-model.md).
65
66
 
66
67
  If systems reference extensions, run `screenplay restore <root>` before standalone validation, tests or export. Those commands reject unpinned or unrestored contracts.
67
68
 
@@ -79,10 +80,10 @@ The server is the `screenplay` program speaking MCP over stdio. Choose one launc
79
80
  - **Native:** command `screenplay`, arguments `mcp` and the absolute model root.
80
81
  - **Cratis CLI:** command `cratis`, arguments `screenplay`, `mcp` and the absolute root. This uses the CLI's bundled compiler, so no second tool is needed. Use `--project-root <dir>` or `--project-root-env <variable>` to resolve the root as described in Choose the model root.
81
82
  - **Docker:** `docker run -i --rm -v "<absolute host root>:/model" cratis/screenplay mcp /model`. Run `docker pull cratis/screenplay` first so the first start does not time out. On Linux add `--user "$(id -u):$(id -g)"` before the image so that applied files stay writable. Docker silently creates a missing host folder, which shows up as an empty model, so check the host path first.
82
- - **Project registration:** `cratis ai install` registers the server when the selected profiles include `cratis/screenplay`. In Pi, call `cratis_enable_mcp` with `server: "screenplay"` to make tools available from the next step. Set `mcpServers.screenplay.eager: true` in `.cratis/ai.json` only to register them at session start.
83
+ - **Project registration:** `cratis ai install` registers the server when the selected profiles include `cratis/screenplay`. In Pi, call `cratis_enable_mcp` with `server: "screenplay"` to make tools available from the next step.
83
84
  - **Desktop apps:** `cratis screenplay desktop install --clients claude,chatgpt`. Always pass `--clients` when running noninteractively; only an interactive terminal may omit it to pick detected hosts. For ChatGPT, pass `--model-root <existing folder>`. For Claude, name the folder in the conversation. Finish host-owned removal in each host's own UI.
84
85
 
85
- A missing physical workspace folder whose parent exists is created on the first approved write. Standalone `--create-root <dir>` instead creates it at startup. Standalone startup with an existing root configures the editor resolver for that root and can update `screenplay.lock` and the extension cache when `SCREENPLAY_EXTENSION_SOURCE` names a package directory and the model references extensions. Do not assume that a later `open-workspace` restores extensions; restore explicitly if needed.
86
+ A path passed to `cratis screenplay mcp` overrides `.cratis/ai.json` and must exist; without a path, a configured `root` must exist before startup. Other launches (standalone `screenplay mcp <root>`, a root bound at `open-workspace`, or the bundled server's discovered root) admit a missing physical folder whose parent exists and create it on the first approved write. Standalone `--create-root <dir>` instead creates it at startup. Standalone startup with an existing root configures the editor resolver for that root and can update `screenplay.lock` and the extension cache when `SCREENPLAY_EXTENSION_SOURCE` names a package directory and the model references extensions. Do not assume that a later `open-workspace` restores extensions; restore explicitly if needed.
86
87
 
87
88
  Without a startup root, the server binds one at `open-workspace`:
88
89
 
@@ -92,6 +93,8 @@ Without a startup root, the server binds one at `open-workspace`:
92
93
 
93
94
  Verify the connection by listing the server's tools. Then ask the assistant to confirm the bound root (`/model` under Docker).
94
95
 
96
+ The `visualize-model` board is listed only when the server was built with the board and the client advertises the MCP Apps extension (`io.modelcontextprotocol/ui`) when it connects. Claude Desktop and GitHub Copilot in VS Code advertise it; Claude Code, a terminal client, does not, so it receives every authoring tool except the board. If the client lists `mimeTypes` for that extension, the list must include `text/html;profile=mcp-app`. Reinstalling the registration, `--force` or editing it cannot give a client that capability. In such a client, explore the model through text and view the board in an MCP Apps host or the Screenplay VS Code extension. If a client advertises the extension but the board is missing, first check that its `mimeTypes` include that type; only then suspect a server build without the board.
97
+
95
98
  ## Create the first document through MCP
96
99
 
97
100
  1. Call `open-workspace`. For a new model, pass `applicationName: "Greenhouse"`. The default name is the persisted name, or else the root folder's name, so a `Screenplay` root would be named `Screenplay`. Passing a name that differs from a persisted one is refused with `IdentityStateConflict`. Keep `revision` and `catalogRevision`. Check `readiness.state`:
@@ -131,30 +134,17 @@ Use this when a diagnostic names `screenplay migrate`, including `PLAY0890`–`P
131
134
 
132
135
  For an isolated saved file, VS Code **Screenplay: Migrate document** asks for the source major, replaces the editor text and reports changes and review items in **Screenplay migration** output. Review the edit before saving. Use the CLI for cross-file changes.
133
136
 
134
- ## Exchange a model with Studio
135
-
136
- - **Import:** In an open board choose Screenplay file, folder or ZIP. Check the preview's diagnostics and omissions before **Accept & Import**. Check the imported slices and any reported sketch, mockup, image or issue-link losses. Cancel rather than treating a lossy preview as a round trip.
137
- - **Export:** Choose Screenplay folder for a repository or to carry sketches, mockups, images and issue links. Extract the ZIP intact, read export warnings, and compile the exported model; re-import into an empty project and compare when continuity matters.
138
- - **Git sync:** Choose a dedicated branch/folder destination; Studio commits the board's files there, replacing whatever the folder holds. Studio never overwrites a repository change it has not seen: when the folder changed since its last commit, it stops committing and lists **Files that differ**. Then import the repository's version through import preview, or confirm committing the board's version on top (the repository's change stays in history). Enable the import offer if repository edits should come back. Reconcile elsewhere first if both changes must survive. **Stop syncing** (after confirmation) only stops future commits; nothing already committed is removed.
139
-
140
137
  ## Capability catalog
141
138
 
142
139
  Toolchain and hosting:
143
140
 
144
141
  - `screenplay version` (or `--version`), `screenplay help`: identify the installed compiler; show usage.
145
- - `dotnet tool install --global Cratis.Screenplay.Tool` / `dotnet tool update --global Cratis.Screenplay.Tool`: install or update the standalone tool (needs the latest .NET SDK).
142
+ - `dotnet tool install --global Cratis.Screenplay.Tool` / `dotnet tool update --global Cratis.Screenplay.Tool`: install or update the standalone tool (needs the .NET 11 SDK).
146
143
  - `cratis/screenplay` Docker image: the same program without a local .NET.
147
- - Compiler as a library and browser editor support: embed the compiler in your own tool, or host a `.play` editor in a web page (SDK-specific; see the language reference).
148
144
  - `cratis version`: the Cratis CLI's bundled compiler version.
149
- - `cratis screenplay validate [<path>]`: check with the CLI's bundled compiler before Stage delivery; exit `0` valid, `1` invalid input or scope, `5` validation failed. Options belong to `cratis-screenplay-accept-model`.
150
145
  - `code --install-extension cratis.screenplay`: VS Code board and diagnostics beside the source.
151
146
  - VS Code User settings `screenplay.repairs.enabled`, `.executable`, `.arguments`, `.modelRoot`: opt into typed repairs, choose the approved bridge executable and launch arguments, and bind one physical root. Workspace-level overrides are refused.
152
- - `screenplay <path>`: compile and gate the model. Gate options belong to `cratis-screenplay-accept-model`.
153
- - `screenplay test <path>`: run model specifications in process.
154
- - `screenplay restore <folder>`: pin referenced extensions in `screenplay.lock` and restore their contracts.
155
- - `screenplay migrate <path> --from <source-major>`: rewrite retired source forms forward.
156
- - `screenplay contract`: print the language and tool contract, for tooling.
157
- - See [command selection and flags](references/cli.md) for CLI options, desktop verbs and delivery commands.
147
+ - `screenplay <path>`, `test`, `restore`, `migrate`, `contract` and `cratis screenplay validate`: see References for options and exit codes.
158
148
 
159
149
  Server launch and registration:
160
150
 
@@ -162,29 +152,10 @@ Server launch and registration:
162
152
  - `cratis screenplay mcp [<path>] | --project-root <dir> | --project-root-env <variable>`: the server hosted by the CLI. With no argument and `.cratis/ai.json` present, it uses the configured root.
163
153
  - `cratis ai install`: project-local registration when the Screenplay profile is selected.
164
154
  - `mcpServers.screenplay.enabled: false`: opt out in `.cratis/ai.json`.
165
- - `mcpServers.screenplay.root`: override discovery with an existing project-relative directory without `..` or symlinks.
166
- - `mcpServers.screenplay.eager: true`: register Pi tools at session start instead of on demand.
167
- - `cratis screenplay desktop install`: prepare integration for selected desktop apps; complete setup in the host.
168
- - `cratis screenplay desktop update`: refresh the owned desktop integration.
169
- - `cratis screenplay desktop status`: inspect local registration and available updates, not whether a host enabled the integration.
170
- - `cratis screenplay desktop uninstall`: remove the CLI-owned integration; remove the host-owned plugin or extension in the app.
171
-
172
- MCP tools used while onboarding:
173
-
174
- - `open-workspace`: bind a disk root or open a portable snapshot; use returned revisions for later operations.
175
- - `syntax-schema`: discover the language contract before writing typed edits.
176
- - `workspace-state`: inspect identities, notes, baselines and interrupted writes; page exact identity state when needed.
177
- - `propose-source`: propose whole-document creates, replacements, moves, key changes or removals.
178
- - `read-proposal`: review paged changes, exact before/after bytes, diagnostics and identity or contract consequences.
179
- - `discard-proposal`: drop a reviewed but unwanted plan without writing.
180
- - `apply`: write an approved proposal against its original base.
181
- - `read-workspace`: page workspace inventory, diagnostics, identities or portable contracts.
182
- - `recover-workspace`: roll back the reported interrupted operation with explicit approval.
183
- - `export-workspace`: page a portable snapshot for transfer or backup; identity continuity on disk does not depend on exporting.
184
- - `migrate`: preview the migration report and request one document's migrated source without writing.
185
- - `recommend-layout`: ask for layout advice as the model grows.
186
- - `expand-layout`: propose a canonical single, module, feature or slice layout (`cratis-screenplay-edit-workspace`).
187
- - Every other MCP tool (reading, typed edits, renames, specifications, the `visualize-model` board): `cratis-screenplay-edit-workspace`.
155
+ - `mcpServers.screenplay.root`: override discovery with a slash-separated project-relative directory such as `models/billing`, without backslashes, `..`, host placeholders or symbolic links. `.` serves the whole project as one model with the bundled CLI server, but the Pi harness rejects it. Set it only here: generated client entries pass just the project folder, and the server reads the root from this file. For an enabled server with at least one supported client registration, a successful `cratis ai install`/`update` creates the folder but no `.play` files; `--dry-run` leaves the project unchanged. When no path is passed, a configured root that does not exist fails server startup, so after changing or moving it run `cratis ai update` or create the folder first.
156
+ - `cratis screenplay desktop install|update|status|uninstall`: manage desktop-app integration (see References).
157
+
158
+ MCP tools used while onboarding: `open-workspace`, `syntax-schema`, `workspace-state`, `propose-source`, `read-proposal`, `discard-proposal`, `apply`, `read-workspace`, `recover-workspace`, `export-workspace`, `migrate`, `recommend-layout` and `expand-layout` (see References). Every other MCP tool (reading, typed edits, renames, specifications, the `visualize-model` board): `cratis-screenplay-edit-workspace`.
188
159
 
189
160
  Application-root directives (declare each once, in the root document only; a repeat or a non-root placement is an error):
190
161
 
@@ -199,3 +170,11 @@ File directives:
199
170
  - `import "<path-or-glob>"`: compose documents when using a file entry point; place it in the intended module or feature to place the imported declarations there.
200
171
  - `import <Qualified.Contract>`: name an external contract, not a file.
201
172
  - `import <Qualified.Event> from "<origin>"`: record a public event contract's origin in source. This form does not bind for execution (`PLAY0268`).
173
+
174
+ ## References
175
+
176
+ - `references/<language>.md` for the project's SDK (`.csproj` → csharp, Node server `package.json` → typescript, `*.kt` → kotlin, `*.java` → java, `go.mod` → go, `mix.exs` → elixir; only the project's languages are installed): read it to embed the compiler in your own tool or host a `.play` editor in a web page.
177
+ - [Command selection and flags](references/cli.md): read it for standalone and Cratis CLI options, migration versions, delivery commands, desktop integration verbs and VS Code editor defaults.
178
+ - [Smallest complete model](references/smallest-model.md): read it for one slice that compiles and passes its specifications.
179
+ - [Workspace request catalog](references/workspace-mcp.md): read it for the arguments, views and paging of each workspace MCP tool.
180
+ - [Exchange a model with Studio](references/studio.md): read it before importing into, exporting from or Git-syncing a Studio board.
@@ -1,7 +1,15 @@
1
1
  # Screenplay command selection
2
2
 
3
+ ## Contents
4
+
5
+ - Commands
6
+ - Desktop integration
7
+ - VS Code extension
8
+
3
9
  Every command of the standalone `screenplay` tool, with the skill that teaches it. Where a path is optional, it defaults to the current folder. A folder compiles as one application. A file compiles with the documents it imports.
4
10
 
11
+ ## Commands
12
+
5
13
  Compile the root first, then run the specifications. A successful compile does not prove executable binding or target admission.
6
14
 
7
15
  - **Compile and gate the model:** `screenplay [<file.play|folder>]`. Exit `0` means clean, `1` means model defects, `2` means the check could not run. Taught by `cratis-screenplay-accept-model`.
@@ -23,8 +31,8 @@ Compile the root first, then run the specifications. A successful compile does n
23
31
  - `--source <directory>`: choose a package directory instead of `SCREENPLAY_EXTENSION_SOURCE`.
24
32
  - `--vendor`: copy restored extension contracts into the model's vendor cache for distribution.
25
33
  - **Move source forward across retired forms:** `screenplay migrate <file.play|folder>`.
26
- - `--from <source-major>`: required source dialect.
27
- - `--to <target-major>`: select the target explicitly only when required by the migration.
34
+ - `--from <source-major>`: required, because a file does not record the version it was written for. Only the major counts: `5`, `5.11` and `v5.11.0` all mean 5. No step starts before 5, so a model written for Screenplay 4 or earlier uses `--from 5`; `--from 4` is refused.
35
+ - `--to <target-major>`: defaults to the language major the installed compiler reads, which is not the tool's package version (`screenplay --version`); select the target explicitly only when required by the migration. Migrations only move forward: a `--to` below `--from` is refused.
28
36
  - `--dry-run`: compute changes without rewriting the model.
29
37
  - `--report <file>`: write the reviewable report, including during a dry run.
30
38
  - **Inspect the language and tool contract:** `screenplay contract`; `--output <path>` writes it to a file for tooling.
@@ -86,3 +94,12 @@ Use the `cratis screenplay desktop` branch for user-level integration; the match
86
94
  - `install` and `update`: `--clients claude,chatgpt` selects clients; `--model-root <dir>` registers an existing physical folder for ChatGPT; `--dry-run` previews the install or update. For Claude, name the folder in the conversation after approving the extension in the app.
87
95
  - `status`: `--clients` selects clients. Inspect registration or handoff and update availability; verify the integration is enabled in the host itself.
88
96
  - `uninstall`: `--clients` selects clients; `--dry-run` previews removal. Remove or disable the host-owned extension or plugin in the app as well.
97
+
98
+ ## VS Code extension
99
+
100
+ For `.play` files, the extension (`cratis.screenplay`) changes two editor defaults, so that suggestions come from the Screenplay language service:
101
+
102
+ - **GitHub Copilot inline suggestions are off.** To bring them back, add `"github.copilot.enable": { "screenplay": true }` to the VS Code settings.
103
+ - **Word-based suggestions are off.**
104
+
105
+ In Restricted Mode (an untrusted workspace), the board and local language assistance still work. Typed repairs never run: they need workspace trust and explicit User settings. Until the workspace is trusted, VS Code also ignores workspace overrides of `screenplay.sourceRoot`, the `screenplay.repairs.*` settings and `screenplay.verdicts.onSave`. A source-root override can point outside the workspace, so review it before granting trust.
@@ -0,0 +1,87 @@
1
+ # Smallest complete model
2
+
3
+ ## Contents
4
+
5
+ - When to use it
6
+ - The model
7
+ - Prove it
8
+ - What each part is for
9
+ - Avoid
10
+
11
+ ## When to use it
12
+
13
+ Use it as the shape of a first slice, or to prove that a new toolchain compiles, gates and runs specifications end to end. It is one module, one feature and one `StateChange` slice: a command with one rule, the event it produces, a screen that issues the command, and one accepted and one refused specification. Names are illustrative.
14
+
15
+ It is not a starting template for a real application. Real slices come from the agreed timeline (`cratis-screenplay-declare-slice`).
16
+
17
+ ## The model
18
+
19
+ Save it as `<root>/application.play` in a fresh, empty root: the expected output below holds only there. The first two lines are the root directives from the default path.
20
+
21
+ To adapt it into an existing application, keep that application's entry point and root directives, and move `concept PlotId` together with the module: the module does not compile without it. The file and specification counts then cover the whole loaded model, not these two specifications.
22
+
23
+ ```play
24
+ reaction batches atomic
25
+ command reads protected
26
+
27
+ concept PlotId : Uuid
28
+
29
+ module Greenhouse
30
+ feature Watering
31
+ slice StateChange ScheduleWatering
32
+ command ScheduleWatering
33
+ plotId PlotId identifier
34
+ minutes Int
35
+ validate
36
+ minutes > 0 message "Minutes must be positive"
37
+ produces WateringScheduled
38
+ for plotId
39
+ minutes = minutes
40
+
41
+ event WateringScheduled
42
+ minutes Int
43
+
44
+ screen WateringPlan
45
+ action ScheduleWatering for screen
46
+
47
+ specification SchedulingTenMinutes
48
+ when ScheduleWatering
49
+ plotId = "11111111-1111-4111-8111-111111111111"
50
+ minutes = 10
51
+ then WateringScheduled
52
+ for "11111111-1111-4111-8111-111111111111"
53
+ minutes = 10
54
+
55
+ specification RefusingZeroMinutes
56
+ when ScheduleWatering
57
+ plotId = "11111111-1111-4111-8111-111111111111"
58
+ minutes = 0
59
+ then error "Minutes must be positive"
60
+ ```
61
+
62
+ Indentation is the structure. Indent with spaces: a tab reports warning `PLAY0006`.
63
+
64
+ ## Prove it
65
+
66
+ Run both commands on the fresh root, in this order:
67
+
68
+ 1. `screenplay <root> --warnaserror --no-gate-file`. `--no-gate-file` keeps the run independent of a `screenplay.json` in a folder above the root: a fresh subfolder inherits the nearest one up to the repository boundary, and an inherited scope that this model lacks makes the check exit `2`. Expect `1 file(s) compiled - 0 error(s), 0 warning(s)` and exit `0`.
69
+ 2. `screenplay test <root>`. Expect a `passed:` line for each of the two specifications, the summary `2 discovered, 2 selected, 2 executed; 2 passed, 0 failed, 0 unsupported` and exit `0`.
70
+
71
+ The test run also prints information `PLAY0269` for the screen: screens are deferred from the backend executable model by default and enter it only when explicitly admitted (`screenplay export --format esm --screens`, or the `screens` argument of an MCP executable-model read). It is not a failure.
72
+
73
+ Without the .NET tool, run the same two commands, with the same flags, through the Docker image, as in the skill's default path.
74
+
75
+ ## What each part is for
76
+
77
+ - **`plotId PlotId identifier` and `for plotId`**: the identifier names the event source, and `for` appends the event there. The event does not repeat the identifier as a property.
78
+ - **`produces` mappings**: every event property is mapped explicitly (`minutes = minutes`); nothing is copied by name.
79
+ - **`validate` with `message`**: the rule the command promises. `RefusingZeroMinutes` expects exactly that message.
80
+ - **`screen` with `action … for screen`**: something that issues the command. Without it, the command reports warning `PLAY0533` and step 1 exits `1`.
81
+ - **Two specifications**: one accepted case that states the destination (`for`) and every event property, and one refusal for the rule. More shapes: `cratis-screenplay-specify-outcome`.
82
+
83
+ ## Avoid
84
+
85
+ - Removing the screen, or dropping `--warnaserror`, to get a clean run. Model how the command is issued (`cratis-screenplay-model-interaction`).
86
+ - Treating a passing run as an accepted model. It proves that the model compiles and that these two scenarios hold; the executable and target verdicts belong to `cratis-screenplay-accept-model`.
87
+ - Keeping the `Greenhouse` names in a real model.
@@ -0,0 +1,5 @@
1
+ # Exchange a model with Studio
2
+
3
+ - **Import:** In an open board choose Screenplay file, folder or ZIP. Check the preview's diagnostics and omissions before **Accept & Import**. Check the imported slices and any reported sketch, mockup, image or issue-link losses. Cancel rather than treating a lossy preview as a round trip.
4
+ - **Export:** Choose Screenplay folder for a repository or to carry sketches, mockups, images and issue links. Extract the ZIP intact, read export warnings, and compile the exported model; re-import into an empty project and compare when continuity matters.
5
+ - **Git sync:** Choose a dedicated branch/folder destination; Studio commits the board's files there, replacing whatever the folder holds. Studio never overwrites a repository change it has not seen: when the folder changed since its last commit, it stops committing and lists **Files that differ**. Then import the repository's version through import preview, or confirm committing the board's version on top (the repository's change stays in history). Enable the import offer if repository edits should come back. Reconcile elsewhere first if both changes must survive. **Stop syncing** (after confirmation) only stops future commits; nothing already committed is removed.
@@ -2,6 +2,13 @@
2
2
 
3
3
  Use `@cratis/screenplay-language` when a web page must host a Monaco editor for `.play` text. It gives highlighting, completions, hover and diagnostics in the browser, with no .NET process. For editing on a developer machine, install the VS Code extension instead (see the skill's catalog).
4
4
 
5
+ ## Contents
6
+
7
+ - Register the language
8
+ - What the editor checks
9
+ - Highlight a construct of your own (edge case)
10
+ - Read a model from TypeScript tooling
11
+
5
12
  ## Register the language
6
13
 
7
14
  ```typescript
@@ -43,3 +50,9 @@ registerSubLanguage('workflow', {
43
50
  - It can be called before or after `register(monaco)`.
44
51
 
45
52
  This is a reading aid only. It does not add the construct to the language: the compiler still reports an unknown construct keyword inside a slice as warning `PLAY0029` and skips its body, and rejects one anywhere else.
53
+
54
+ ## Read a model from TypeScript tooling
55
+
56
+ `@cratis/screenplay-language` is the only Screenplay package on npm. The Screenplay documentation also describes a TypeScript compiler, `@cratis/screenplay-compiler` (`parse`, `parseFolder`, visitors), and `@cratis/screenplay-event-models` (`toEventModelDocument`). Both are private packages inside the Screenplay repository: `npm install` cannot resolve them, so never add them to an application's dependencies.
57
+
58
+ To read a model from a Node script or build step, run the `screenplay` tool and parse its output: `screenplay <root> --format json` for diagnostics, `screenplay export <root> --format esm|openapi|ui` for the model's contracts (options in [command selection](cli.md)). The TypeScript compiler parses and reports part of the validation, but it cannot bind or execute a model. The `screenplay` check is the source-validation gate either way; `screenplay export <root> --format esm` proves that the model binds, and `screenplay test <root>` executes its specifications.
@@ -15,6 +15,9 @@
15
15
  Use `open-workspace` before reading or proposing. Reopening or switching the workspace discards outstanding proposals on that connection.
16
16
 
17
17
  - `path`: select an admitted physical model root; use it for a multi-root client or a registered Git worktree of the startup root.
18
+ - **Another checkout:** when the server started with a root, another checkout of that repository is admitted only as a registered Git worktree (or the main checkout, when the server started in a linked worktree). Pass the worktree's checkout folder or its model folder; the server opens the same relative model folder there. Any other folder returns `RootChangeRefused`, with one exception: the model folder beside a code folder described below, which is admitted by its location alone and is not checked for Git membership.
19
+ - **Checkouts that cannot be verified:** the switch to another checkout is refused for submodules and checkouts created with `--separate-git-dir`. Per-worktree configuration (`extensions.worktreeConfig` or a `config.worktree` file) refuses a switch to or from the main checkout; it is not checked when both the startup root and the requested root are registered linked worktrees. When a switch is refused, start a separate server connection rooted at that checkout's model instead.
20
+ - **A model folder beside a code folder:** when the startup root is a folder named `Source` or `src` that holds no model yet (no `.play` files at its top or one level down, no `.screenplay` state), `path` may name a folder beside it that is missing, empty, or already holds `.play` files or `.screenplay` state. This needs no Git worktree, so a server started on a project's `src` can open `Screenplay` next to it.
18
21
  - `applicationName`: name an uninitialized application instead of inheriting the folder name; must match the persisted name when identities already exist.
19
22
  - `workspaceJson`: reopen the canonical snapshot from `export-workspace` against matching disk documents. It cannot replace a different persisted catalog or document mapping.
20
23
  - `includeContent`: opt into inline snapshot and diagnostics when the workspace is small; page larger content instead.
@@ -79,6 +82,8 @@ If `InvalidIdentityMigration` returns `identityMigrationIssues`, use its typed a
79
82
  - `production-destination-identities`: review the identities newly enrolled by that repair.
80
83
  - `expectedRepairEvidenceRevision`: carry the evidence pin for a proposal tied to pinned repair evidence.
81
84
 
85
+ Host hints: `apply` and `recover-workspace` report `readOnlyHint: false` and `destructiveHint: true`; every other tool reports `readOnlyHint: true` and `destructiveHint: false`, and all tools report `openWorldHint: false`. The server adds no confirmation parameter, so the host must ask for approval before these two calls. A recovery journal makes a write recoverable, not non-destructive.
86
+
82
87
  Use `workspace-state` with the same `proposalId` to inspect identity-state changes separately from document bytes. Use `discard-proposal` with `proposalId` to drop the plan. `apply` needs approval, `proposalId`, `expectedRevision` and `expectedCatalogRevision` from the original base. Optionally send `expectedReleaseBaselineRevision` to pin the reviewed release baseline, `expectedRepairEvidenceRevision` for a pinned repair, or `includeContent` for inline snapshots of a small apply. The server verifies disk bytes and identities again; a stale plan must be rebuilt and reviewed. A journal enables recovery, not instant all-file visibility during a write.
83
88
 
84
89
  ## Read the current workspace
@@ -103,7 +103,7 @@ Every line belongs inside a `specification` unless it says otherwise. Value line
103
103
  ### Scenario structure
104
104
 
105
105
  - `specification <Name>`: in a slice, addressed `<Module>.<Feature>.<Slice>.<Name>`; in a `statemachine` or `workflow`, `<Declaration>.<Name>`; a slice's graph specification, `<Slice>.<Name>`.
106
- - `description "<text>"`, or a fenced `text` block: states the rule this scenario witnesses. It is report-only: an informational `PLAY0270` that does not affect execution.
106
+ - `description "<text>"`, or a fenced `text` block: states the rule this scenario witnesses. It is report-only (informational `PLAY0270`).
107
107
  - `file <path>`: the repository-relative file that realizes the specification.
108
108
  - `example <Name> : <Command | Event | ReadModel>`: a named, possibly partial fixture holding property values, an optional `for` and optional `generated` values. Declare it at slice, feature, module or document level.
109
109
  - Using an example: put its name where a type name would go in `given`, `given readmodel`, `when`, `when append`, `then` or `then readmodel`. One override can follow on the same line (`when Pottery seats = 0`); further overrides are indented. An override replaces the whole value. Examples cannot supply callers, clocks, query rows, responses, triggers or captures.
@@ -127,7 +127,7 @@ Every line belongs inside a `specification` unless it says otherwise. Value line
127
127
  - `given <System>.<Ability> returns` (with fields), `answers <Outcome>` or `fails "<reason>"`: what an ability call answers while a reaction runs.
128
128
  - `given capture <Capture>` with record fields: the record a non-event capture last saw for a key.
129
129
  - `given graph <Graph>` with `has node <Label> <key>` and `has edge <TYPE> from <source> to <target> [identified by <value>]`: graph state that exists before the action.
130
- - `given operation <Name> fails`, `then operation <Name>`, `then compensated <Name>`: operation intent for a command. They parse, but no executable model admits them (`PLAY0268`), so they cannot be part of acceptance.
130
+ - `given operation <Name> fails`, `then operation <Name>`, `then compensated <Name>`: parse, but no executable model admits them (`PLAY0268`); never use them for acceptance.
131
131
 
132
132
  ### Actions (at most one)
133
133
 
@@ -145,7 +145,7 @@ Every line belongs inside a `specification` unless it says otherwise. Value line
145
145
 
146
146
  ### Event outcomes
147
147
 
148
- - `then <Event | Example>` with `for` and required values: one expected new fact. State the complete count and order. After `when append`, assert only what follows that fact; omitting event assertions skips this comparison.
148
+ - `then <Event | Example>` with `for` and required values: one expected new fact. State the complete count and order. After `when append`, omitting them skips this comparison; which facts stated ones cover is in Comparing outcomes in [scenarios](references/scenarios.md).
149
149
  - `tag <value>` (repeatable) or `no tags` under a `then` event: the event's exact tags, or no tags at all. To set a payload property named `tag`, write `@tag`.
150
150
  - `stream <Source>.<Stream>`: the route of an occurrence on `given`, `when append`, `then`, an event example or a redelivery locator.
151
151
  - A keyed stream takes `streamId = <literal>`. A composite stream takes a bare `streamId` block of part assignments.
@@ -160,10 +160,10 @@ Every line belongs inside a `specification` unless it says otherwise. Value line
160
160
  ### State and query outcomes
161
161
 
162
162
  - `then readmodel <ReadModel | Example> [exactly]` with the key and values: projected state.
163
- - `then no readmodel <ReadModel> for <key>`: no instance exists for that scalar key.
163
+ - `then no readmodel <ReadModel> for <key>`: no instance exists for that scalar key in the final state. It passes even for a key that never existed, so to prove a removal, establish the instance in the givens, run the removing action, then assert absence. A `then readmodel` asserting `null` for optional properties (the only ones that accept `null`) asserts an instance that still exists, and an empty `then query` is a separate check. One specification cannot assert both presence and absence for the same read model and key, whether presence comes from `then readmodel` or a read-model `then query` `result` (`PLAY0273`).
164
164
  - `then no readmodel <ReadModel> for` with an indented block of `<part> = <value>` assignments: no instance exists for that composite key; state every named part.
165
165
  - `then query <Query> [exactly]` with an `arguments` block and repeated `result [exactly]` blocks: the rows a caller gets. Without a refusal expectation, no `result` means zero rows. Use one comparison mode for all rows.
166
- - `then query <GraphQuery> [exactly]`: assert rows against the graph snapshot, rather than running a read-model query action; collected properties take structured values.
166
+ - `then query <GraphQuery> [exactly]`: assert rows against the graph snapshot, not a read-model query; collected properties take structured values.
167
167
  - `then result [exactly]` (repeatable) or `then no result`: the rows of a `when query`.
168
168
  - `then graph <Graph>` with `has node`, `has edge`, `no node` and `no edge`: graph state. Properties go only under `has`.
169
169
 
@@ -202,13 +202,7 @@ Write these inside the `statemachine` or `workflow`. The full process semantics
202
202
  - `screenplay test [path] [--filter <address>] [--format json]`: a folder is one application; a file runs with its imports only.
203
203
  - `--filter` takes one exact, case-sensitive address or semantic id. A table address runs every case; `<Specification>_<Case>` one.
204
204
  - Exit codes: `0` all selected passed (possibly zero); `1` at least one failed; `2` invalid input or selection; `3` the model did not bind, or nothing failed but something was unsupported.
205
- - MCP `run-specifications`: use when working through a model workspace; with no selector it runs all executable specifications.
206
- - `specification`: select an exact address or semantic id, including a table or an individual case.
207
- - `scope`: select a module, feature or slice and its descendants; combined selectors intersect.
208
- - `proposalId`: run the outstanding proposal instead of the current model.
209
- - `limit`: bound the page size (1–200); totals and overall outcome cover the complete selection.
210
- - `offset`: for continuation, pass `page.nextOffset` with the same selectors and, if used, the same `proposalId`. Rows are sorted by address; oversize responses are refused, not truncated.
211
- - `expectedSourceRevision`: required at nonzero `offset`; echo the first response's `sourceRevision` (the candidate revision for a proposal). On `StaleSourceRevision`, restart from the first page. Check for the intended passing addresses across all pages.
205
+ - MCP `run-specifications`: use when working through a model workspace; with no selector it runs all executable specifications. Its selectors and paging are in [running through MCP](references/running-mcp.md).
212
206
 
213
207
  ## Off the default path
214
208
 
@@ -235,6 +229,8 @@ Read `references/<language>.md` for the project's SDK (`.csproj` → csharp, Nod
235
229
  ## Avoid
236
230
 
237
231
  - Writing `then no events` for a refusal. It asserts a successful action.
232
+ - Leaving a slice specification without graph steps and without any `then`. It does not bind. In an ordinary slice specification, write `then no events` to assert that a successful action produced no new facts; after `when append`, it asserts only that no facts followed the appended event.
233
+ - Leaving a graph specification without `then graph` or a graph `then query`, the only outcomes it checks. A `given graph` step (not owning a graph or appending its input event) makes one, and it binds without a `then` but checks nothing.
238
234
  - Inferring the destination from a payload field. Assert `for` on the expected event.
239
235
  - Asserting another slice's events. Move that assertion to the owning slice, and use `then invokes` here.
240
236
 
@@ -0,0 +1,12 @@
1
+ # Running specifications through MCP
2
+
3
+ Use the read-only MCP `run-specifications` tool when you work through a model workspace. With no selector, it runs all executable specifications.
4
+
5
+ - `specification`: select an exact address or semantic id, including a table or an individual case.
6
+ - `scope`: select a module, feature or slice and its descendants; combined selectors intersect.
7
+ - `proposalId`: run the outstanding proposal instead of the current model.
8
+ - `limit`: bound the page size (1–200); totals and overall outcome cover the complete selection.
9
+ - `offset`: for continuation, pass `page.nextOffset` with the same selectors and, if used, the same `proposalId`. Rows are sorted by address; oversize responses are refused, not truncated.
10
+ - `expectedSourceRevision`: required at nonzero `offset`; echo the first response's `sourceRevision` (the candidate revision for a proposal). On `StaleSourceRevision`, restart from the first page.
11
+
12
+ Check that every intended address passed, across all pages.
@@ -214,9 +214,9 @@ specification HarbourIsFull
214
214
 
215
215
  ## Comparing outcomes
216
216
 
217
- - **New facts.** `then <Event>` lines must match the complete count of new facts, in authored order. `then events in any order` relaxes only the order. With other actions, omitting event assertions expects no new facts, even beside state or response assertions. After `when append`, omitting events skips that comparison; stating them checks only the facts that followed the appended event. Use `then no events` when zero new facts is the promise.
217
+ - **New facts.** `then <Event>` lines must match the complete count of new facts, in authored order. `then events in any order` relaxes only the order. With other actions, omitting event assertions expects no new facts, even beside state or response assertions. After `when append`, omitting events skips that comparison. Stated events cover only the facts that followed the appended event when the model compiles to a semantic version that runs reactions, as any model with automation does; an earlier version compares them against the appended event itself. `then no events` always excludes the appended event. In an ordinary slice specification, use `then no events` when zero new facts is the promise. A slice specification without graph steps and with no outcome at all does not bind: omitting every `then` is not a no-event assertion. (A `given graph` step makes it a graph specification instead: it binds without a `then`, but then it checks nothing. A graph specification checks only `then graph` and graph `then query`.)
218
218
  - **Event content.** State every required property (`PLAY0524`). `for` checks the occurrence's source, not a payload field. Tags and routes are checked only when stated, including the `no tags` and `no stream` forms.
219
- - **Read models.** The key selects one instance. `then readmodel` compares stated properties; `exactly` also disallows additional properties. `then no readmodel` checks only the named key; other instances may survive.
219
+ - **Read models.** The key selects one instance. `then readmodel` compares stated properties; `exactly` also disallows additional properties. `then no readmodel` checks only the named key; other instances may survive, so assert a survivor with its own `then readmodel`. If computing the read model needs a reducer with opaque transitions that the runner cannot execute, the run is unsupported, not passed.
220
220
  - **Read-model query rows.** Count must be exact; order does not matter, and rows are matched by read model and key. State only relevant properties unless exact matching is part of the contract. A missing property is not an asserted `null`.
221
221
  - **Refusals.** State at most one and no success outcomes. `then error` covers contract, validation, constraint or generated-identity conflict; a query error must be Validation. A supplied message must match. `then denied` matches authorization denial only. Neither checks the rule's severity.
222
222
  - **Givens are history.** Establish and project them before the action; compare only facts that follow the action. A `given` event without `for` belongs to the source the action acts on. If its projection needs the event's identity and cannot resolve it, the scenario is unsupported. Set `for` when the location matters.
@@ -207,4 +207,6 @@ Where supported: append events and read the nodes and edges graph projections bu
207
207
 
208
208
  Read `references/<language>.md` for the project's SDK (`.csproj` → csharp, Node server `package.json` → typescript, `*.kt` → kotlin, `*.java` → java, `go.mod` → go, `mix.exs` → elixir); only the project's languages are installed.
209
209
 
210
+ - `references/csharp-colocated.md`: read when a C# application project compiles its specs beside its slices instead of in a separate spec project (project setup, Release exclusion, how to run them).
211
+
210
212
  Python has no Cratis application SDK or testing kit: write the spec in the service that owns the command, query or event, and reach that behavior from Python only through the service's HTTP API.
@@ -0,0 +1,101 @@
1
+ # Keep C# specs beside their slices
2
+
3
+ ## Contents
4
+
5
+ - When this applies
6
+ - Where the files go
7
+ - Project setup
8
+ - Run the specs
9
+ - Common mistakes
10
+
11
+ Names in the examples are illustrative; the application's own domain language replaces them.
12
+
13
+ ## When this applies
14
+
15
+ - **Default for a new application:** a separate spec project whose folders mirror the slice path. Nothing in this reference is needed there.
16
+ - **This reference:** the application project already compiles its specs beside its slices. Keep that layout and extend it; do not add a separate spec project for the in-process specs of such an application.
17
+ - **Running-kernel specs:** a separate project is the default in both layouts, so unit and filtered runs never start infrastructure. Where the application already keeps a co-located running-kernel tier, keep it isolated instead: its own namespaces, outside the in-process spec namespaces, and a runner filter that selects the in-process specs alone (see Run the specs).
18
+
19
+ Apart from that, do not mix the two layouts in one application.
20
+
21
+ ## Where the files go
22
+
23
+ - The spec folders sit inside the slice folder: `for_<Unit>/` holding `when_<behaviour>.cs` files (or `when_<behaviour>/` folders with one file per case), and `given/` for reusable contexts.
24
+ - The namespace is the slice's namespace plus the folder: `Library.Lending.Borrowing.for_BorrowBook` for specs of the `Borrowing` slice.
25
+ - Every spec source file lies under a `for_*`, `when_*` or `given` folder. The Release exclusion matches those folder names, not file names, so a `when_*.cs` file placed directly in the slice folder still compiles in Release and breaks that build.
26
+ - Spec support that is not a spec (collection definitions, a web application factory) goes in a folder the project also excludes in Release, such as a root `Specs/` folder. Place those files directly in that folder when its exclusion is `./Specs/*.cs`, which matches direct children only; nested support folders need `Specs/**/*.cs` instead.
27
+ - A `.http` file beside the slice is a convenience for manual calls. It is not a specification and proves nothing.
28
+
29
+ ## Project setup
30
+
31
+ An application with this layout already has the three parts below, which keep everything test-related out of a Release build. Keep them intact and extend them; do not introduce them into an application that has a separate spec project.
32
+
33
+ ```xml
34
+ <ItemGroup Condition="'$(Configuration)' == 'Release'">
35
+ <Compile Remove="**/when_*/**/*.cs" />
36
+ <Compile Remove="**/for_*/**/*.cs" />
37
+ <Compile Remove="**/given/**/*.cs" />
38
+ <Compile Remove="./Specs/*.cs" />
39
+ </ItemGroup>
40
+
41
+ <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
42
+ <XunitAutoGeneratedEntryPoint>false</XunitAutoGeneratedEntryPoint>
43
+ </PropertyGroup>
44
+
45
+ <ItemGroup Condition="'$(Configuration)' == 'Debug'">
46
+ <PackageReference Include="xunit.v3.mtp-off" />
47
+ <PackageReference Include="NSubstitute" />
48
+ <PackageReference Include="Cratis.Specifications" />
49
+ <PackageReference Include="Cratis.Specifications.XUnit.v3" />
50
+ <PackageReference Include="Cratis.Arc.Chronicle.Testing" />
51
+ <PackageReference Include="Cratis.Chronicle.Testing" />
52
+ </ItemGroup>
53
+ ```
54
+
55
+ 1. **Release removes the spec sources from compilation.** One `Compile Remove` per spec folder pattern, plus the spec-support folder when the project has one.
56
+ 2. **The runner, the specification packages, the testing packages and the substitute library are referenced only in Debug.** Add `Cratis.Chronicle.XUnit.Integration.v3` to the same group when the project holds running-kernel specs ([csharp-integration.md](csharp-integration.md)). Use the runner packages the project already has.
57
+ 3. **The runner's generated entry point is turned off** (`XunitAutoGeneratedEntryPoint` set to `false`), because the application is an executable that owns its entry point.
58
+
59
+ Global usings for spec namespaces go inside `#if DEBUG`, in the same file as the application's other global usings:
60
+
61
+ ```csharp
62
+ #if DEBUG
63
+ global using Cratis.Arc.Chronicle.Testing.Commands;
64
+ global using Cratis.Arc.Testing.Commands;
65
+ global using Cratis.Specifications;
66
+ global using NSubstitute;
67
+ global using Xunit;
68
+ #endif
69
+ ```
70
+
71
+ When the application host references the Chronicle testing package this way, the rules in "When the application host references the testing package" in [csharp.md](csharp.md) apply.
72
+
73
+ ## Run the specs
74
+
75
+ With the generated entry point off, the application's own entry point starts the runner. Use the invocation the application already defines. The usual form is a Debug-only branch at the top of `Program.cs` that hands the remaining arguments to the xUnit console runner:
76
+
77
+ ```csharp
78
+ #if DEBUG
79
+ if (args.FirstOrDefault() == "--specifications")
80
+ {
81
+ return await Xunit.Runner.InProc.SystemConsole.ConsoleRunner.Run(args[1..]);
82
+ }
83
+ #endif
84
+ ```
85
+
86
+ Because this branch returns a value, the entry point ends with `return 0;` after the host has run.
87
+
88
+ ```bash
89
+ dotnet build <App>.csproj --configuration Debug
90
+ dotnet run --project <App>.csproj --configuration Debug --no-build -- --specifications
91
+ ```
92
+
93
+ - Arguments after the switch go to the xUnit runner. For example, `-class "*.for_*"` runs only the classes whose full name contains `.for_`. When specs that need a running kernel live in other namespaces, that filter runs the in-process specs alone.
94
+ - Always build and run in Debug. A Release build contains no specs, so it cannot run any.
95
+ - After adding specs, also build once in Release to prove the application still compiles without them.
96
+
97
+ ## Common mistakes
98
+
99
+ - A separate spec project added to an application that already keeps specs beside its slices.
100
+ - A spec file outside the excluded folders, or application code that uses a type declared in a spec folder: the Release build fails.
101
+ - A testing namespace imported without `#if DEBUG`, or a test package referenced in every configuration: the Release build fails or ships test code.
@@ -19,7 +19,7 @@ Applies to `CommandScenario<TCommand>` with `Cratis.Arc.Testing.Commands` and, f
19
19
 
20
20
  Set everything here before the first `Execute` or `Validate`. The caller and pinned generated values cannot change after that call.
21
21
 
22
- - **History.** `_scenario.Given.ForEventSource(id).Events(first, second)` supplies the events the command's read models are built from. For a per-stream model, add `.OnRoute(route)` before `.Events(...)`, resolving the route from `_scenario.EventRoutes`.
22
+ - **History.** `_scenario.Given.ForEventSource(id).Events(first, second)` supplies the events the command's read models are built from. For a per-stream model, add `.OnRoute(route)` before `.Events(...)`, resolving the route from `_scenario.EventRoutes`. Routed seeds need decision mode, which a command declaring a per-stream or other protected decision dependency uses automatically; in ordinary mode `.OnRoute(...)` makes `.Events(...)` throw `RoutedEventSeedingRequiresDecisionReads`. In decision mode one shared log holds the seeds, reads and appends, so seed only through `Given`: `_scenario.EventScenario` throws there. In an ordinary scenario these seeds control the read models injected into the command and are separate from the event log: `_scenario.EventScenario.Given` fills only the log, which the handler's event-log reads and constraints see, and events the command appends never reach these seeds. When the command needs both, seed the same facts in both places. Observable queries combine both histories, so facts seeded in both places are processed twice when observed.
23
23
  - **A fixed read model.** `_scenario.Given.ForEventSource(id).ReadModel(instance)` pins the instance the command receives. A pin wins over seeded events for that model and key. It cannot back a `DecisionRead<T>` parameter (`PinnedReadModelCannotProvideDecisionToken`) or a per-stream model; seed events for those.
24
24
  - **The caller.** `.WithClaims(new Claim(ClaimTypes.Role, "Dispatcher"))` runs the command as an authenticated caller with those claims, `.WithPrincipal(principal)` uses an existing `ClaimsPrincipal`, and `.Unauthenticated()` runs it anonymously. These set the principal authorization reads; they do not exercise login or token validation.
25
25
  - **Server-generated values.** `_scenario.PinGeneratedValue("orderId", id)` fixes a generated parameter so the spec can assert it. When the exact value is irrelevant, call `.AllowGeneration()`. With neither, `Execute` returns a result carrying a `GeneratedValueNotPinned` exception instead of running the command.
@@ -111,7 +111,9 @@ result.ShouldBeAuthorized();
111
111
  | `CommandAuthorization.For<TCommand>(services, principal, command)` | Evaluate with a command instance, for policies that read it |
112
112
  | `CommandAuthorization.ForContext<TCommand>(services, principal, context)` | Evaluate with a prepared `CommandContext` |
113
113
  | `ShouldBeAuthorized()` / `ShouldBeDenied()` | The caller satisfies / fails the declaration |
114
- | `ShouldBeUnsupported()` | The boundary cannot be evaluated standalone, such as a named authentication scheme; prove it through the HTTP host. Unsupported is not a denial |
114
+ | `ShouldBeUnsupported()` | The boundary cannot be evaluated standalone; `ReasonCode` says why. Prove through `CommandScenario`: a command behind an availability gate (`availability-gate`), `[RequiresApproval]` (`approval-required`), a custom command filter (`custom-filter`), and a refusal raised while resolving a read-model key (`read-model-key-resolution`). Prove through the HTTP host: a named authentication scheme or an active request (`host-required`). An unregistered policy (`invalid-configuration`) is a defect: correct the declaration or the policy registration. Unsupported is not a denial |
115
+
116
+ The check does not evaluate tenant-membership verification: when the provider has tenant membership registered and no earlier check has already stopped the evaluation, the outcome is Unsupported with `tenant-membership`; prove that boundary through the HTTP host.
115
117
 
116
118
  The result also exposes `Outcome` (`Authorized`, `Denied`, `Unsupported`), `ReasonCode` (set when unsupported) and a `Message` safe to print. Use it for a matrix of roles and policies across commands; keep one pipeline scenario per command to prove authorization actually gates execution.
117
119
 
@@ -36,6 +36,7 @@ A command that declares read protection, `[ProtectedDecision]`, a `DecisionRead<
36
36
 
37
37
  - Seed with `_scenario.Given.ForEventSource(id).Events(...)`. `_scenario.EventScenario` throws in this mode.
38
38
  - Give the command state and assert the outcome. Do not invent sequence numbers or decision tokens, and do not simulate a concurrent writer: the guard itself is the framework's behavior, already covered there.
39
+ - Let Arc complete a protected command's unit of work: the command returns its events. Calling `Commit()` or `Rollback()` on that unit of work directly fails with `ProtectedUnitOfWorkRequiresOwner`. An aggregate root's own `Commit()` is narrower than it looks. Arc completes it as the owner only when read protection is on and the aggregate belongs to that command's own unit of work, not to a unit inherited from an outer command. Otherwise it is a direct completion, which fails the same way once protected reads have enrolled in the unit. A command executing as an occurrence effect refuses any early commit. Where the aggregate commit applies, read first and return that `Commit()` last; in every other case return the events.
39
40
  - `EnableDecisionReads()` exists only for an untyped `CommandScenario<object>` that executes protected commands; call it before seeding. A typed scenario needs no switch.
40
41
  - `AppendConcurrently(source, events)` (or `(source, route, events)`) queues competing events to append after the handler reads and before the commit. It is hidden from editor completion and exists to verify the framework's concurrency handling; use it only when the task explicitly asks to prove a guard against an interleaved writer, then assert `ShouldHaveValidationErrorBecauseOf(ValidationResultReason.ConcurrencyViolation)` and that nothing was appended. Queue it before the first `Execute`.
41
42