@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
@@ -0,0 +1,117 @@
1
+ # Where frontend files go in an Arc React application
2
+
3
+ ## Contents
4
+
5
+ - Placement
6
+ - Screen names
7
+ - Export the screen
8
+ - Composition page
9
+ - Add a feature
10
+ - Slice without a screen
11
+ - Growing a screen
12
+ - Avoid
13
+
14
+ This is the structure guide for a frontend that lives beside the backend slices it serves, as in an application created from the Cratis template: one project holds the backend files and the React files of a slice in the same folder, and the proxy generator writes each slice's proxies into that folder. Feature, slice and file names below are illustrative.
15
+
16
+ ## Placement
17
+
18
+ | Where | What goes there |
19
+ | --- | --- |
20
+ | Slice folder | The slice's generated proxies, its screen, the screen's styles and helpers, and their specs. |
21
+ | Feature folder | The feature's composition page, named after the feature; a screen that spans several of the feature's slices; the feature's `index.ts`. |
22
+ | Project root | `App.tsx` (providers below the entry module, and the routes) and the start page. |
23
+ | `.frontend/` | The entry module, the HTML page, global CSS, and the Vite and TypeScript configuration. Nothing else. |
24
+ | `Layout/` | The shell around the pages: top bar, menu, layout components. |
25
+ | `Components/<Group>/` | Components used by more than one feature. |
26
+
27
+ - A file belongs to the smallest scope that uses it: slice first, then feature, then `Components/`.
28
+ - No folder is named for a technical layer (`pages`, `hooks`, `services`, `models`, `api`).
29
+ - The feature folder sits wherever the backend puts it; when the backend groups features into modules, the frontend follows the same path.
30
+ - **Smallest applications:** a feature may start with its files directly in the feature folder. Create slice folders when the feature gets its second behaviour.
31
+
32
+ ```text
33
+ Fleet/
34
+ Vehicles/ feature
35
+ Vehicles.tsx composition page
36
+ index.ts exports the page
37
+ Listing/ state-view slice
38
+ Listing.ts generated proxies
39
+ ListingPage.tsx screen
40
+ index.ts
41
+ Registration/ state-change slice
42
+ Registration.ts generated proxies
43
+ RegisterDialog.tsx screen
44
+ index.ts
45
+ ```
46
+
47
+ ## Screen names
48
+
49
+ - A screen that shows data: `<Slice>Page.tsx`, such as `ListingPage.tsx`.
50
+ - A screen that performs an action: `<Verb>Dialog.tsx` or the verb phrase, such as `RegisterDialog.tsx` or `AddVehicle.tsx`.
51
+ - Never give a screen the base name of a generated file in the same folder. `Listing.tsx` beside a generated `Listing.ts` makes `./Listing` ambiguous.
52
+
53
+ The component has the same name as its file and is a named export.
54
+
55
+ ## Export the screen
56
+
57
+ Add the screen to the slice's `index.ts`:
58
+
59
+ ```ts
60
+ export * from './ListingPage';
61
+ ```
62
+
63
+ - The generator maintains the same `index.ts`: it adds an export for each proxy file and keeps your export lines for as long as the file they name exists. It never adds an export for a hand-written file; that line is yours to write. Keep the file to `export * from '...'` lines.
64
+ - Import a slice by its folder (`from './Listing'`), not by a file inside it.
65
+
66
+ ## Composition page
67
+
68
+ One per feature. It is the only place that knows which slices make up the screen the user sees:
69
+
70
+ ```tsx
71
+ import { useDialog } from '@cratis/arc.react/dialogs';
72
+ import { ListingPage } from './Listing';
73
+ import { RegisterDialog } from './Registration';
74
+
75
+ export const Vehicles = () => {
76
+ const [RegistrationDialog, showRegistrationDialog] = useDialog(RegisterDialog);
77
+
78
+ return (
79
+ <>
80
+ <ListingPage onRegister={() => { void showRegistrationDialog(); }} />
81
+ <RegistrationDialog />
82
+ </>
83
+ );
84
+ };
85
+ ```
86
+
87
+ - It imports each slice's screen from the slice folder, calls `useDialog` once per dialog and renders each returned dialog component once.
88
+ - A slice screen never imports another slice's screen. It takes what it needs from outside as callback props (`onRegister`), and the composition page connects them. Importing the command proxy of a slice that has no screen is allowed (see Slice without a screen).
89
+ - A screen binds the proxies of its own slice. For the screens themselves, see `cratis-components-display-list` (lists) and `cratis-components-submit-form` (forms and command dialogs).
90
+
91
+ ## Add a feature
92
+
93
+ 1. Create the feature folder with its slices; each slice gets its screen and the export line.
94
+ 2. Add the composition page and a feature `index.ts` with `export * from './Vehicles';`.
95
+ 3. Add one route in `App.tsx`: `<Route path="/vehicles" element={<Vehicles />} />`.
96
+ 4. Add one menu entry. See [Routes, layout and menu](typescript-navigation.md).
97
+
98
+ ## Slice without a screen
99
+
100
+ A slice whose command is issued from another screen, and an automation or translation slice, keeps only its proxies and `index.ts`. The screen that issues the command imports the proxy from the slice folder.
101
+
102
+ ## Growing a screen
103
+
104
+ Take the first step that is enough:
105
+
106
+ 1. **A decision the screen makes** (which rows to show, which notice applies, whether an action is enabled): move it into a plain function in its own module beside the screen and specify the function. This is the default.
107
+ 2. **Behaviour that needs the component lifecycle** (effects, subscriptions, state shared by two screens of the slice): a `use<Thing>.ts` hook module beside the screen.
108
+ 3. **Behaviour that needs injected collaborators, or that is specified without rendering:** a view model; see `cratis-arc-react-separate-view-model`.
109
+
110
+ For the specs, see `cratis-specifications-test-typescript-behavior`.
111
+
112
+ ## Avoid
113
+
114
+ - A top-level `pages/`, `components/` or `hooks/` tree that mirrors the features.
115
+ - A slice screen that opens another slice's dialog itself.
116
+ - Importing from a file inside another slice's folder.
117
+ - Moving or editing a generated proxy to make an import shorter.
@@ -6,10 +6,14 @@ Arc React (`@cratis/arc.react`, on top of `@cratis/arc`) is the only frontend bi
6
6
 
7
7
  Read the one that matches the task:
8
8
 
9
- - [Host setup](typescript-host.md): packages, compiler settings, the entry point, provider order, request configuration and headers per transport, observable transport, startup globals (Polling timing, the snapshot-query HTTP method), slice and application context.
10
- - [Query hooks](typescript-queries.md): the result-state order, arguments and refresh, `when`, sorting, paging, raw hooks with a deadline, refreshing after a write, Suspense, change streams and one busy flag for several queries.
9
+ - [Where frontend files go](typescript-structure.md): read when adding a screen, slice or feature, or when a screen grows: placement, screen names, exports, the composition page.
10
+ - [Routes, layout and menu](typescript-navigation.md): read when adding a route, the shell, a menu entry or a record screen addressed by URL.
11
+ - [Host setup](typescript-host.md): packages, compiler settings, the entry point, provider order, the development proxy, build and lint, request configuration and headers per transport, observable transport, startup globals (Polling timing, the snapshot-query HTTP method), slice and application context.
12
+ - [Query hooks](typescript-queries.md): the result-state order, arguments and refresh, `when`, changing arguments and debounced filters, sorting, paging, raw hooks with a deadline, refreshing after a write, Suspense, change streams, one busy flag for several queries and what happens when the live connection drops.
11
13
  - [Commands](typescript-commands.md): executing an action, classifying a refusal (including guarded reads), editing against a baseline, the "save anyway" severity flow, validating without executing, `CommandScope` and commands outside React.
12
- - [Identity and availability](typescript-identity.md): the current user, typed identity details, role gates, sign-in, sign-out and account switch, and availability gates.
14
+ - [Identity and availability](typescript-identity.md): the current user, typed identity details, role gates, sign-in, sign-out and account switch, sign-out and tenant switching behind Cratis AuthProxy, identity outside React, and availability gates.
15
+ - [UI language](typescript-localization.md): read when the screens need more than one language, a language selector, or translated validation text.
16
+ - [Instant feedback](typescript-instant-feedback.md): edge case; read only when a gesture (drag, paste, canvas) must show its result before the read model has it.
13
17
 
14
18
  ## Generated metadata
15
19
 
@@ -39,7 +43,7 @@ Where proxies carry `part`, pass the proxy (class or instance) to an availabilit
39
43
  | `@cratis/arc.react/availability` | `AvailabilityProvider`, `RequireAvailable`, `useIsAvailable`, `useAvailableItems`, `useAvailability`. |
40
44
  | `@cratis/arc.react/messaging` | `MessengerScope`, `useMessenger`, `useOnMessage`, `useSendMessage`. |
41
45
  | `@cratis/arc.react/slices` | `useSliceContext`, `Slice`, `withSliceLocation`, `useRegisterSliceLocation`, `SliceLocation`. |
42
- | `@cratis/arc.react/applicationContext` | `useApplicationContext`, `useContributeApplicationContext`, `ApplicationContextContributor`, `useApplicationContextStore`, `useRegisterScope`. |
46
+ | `@cratis/arc.react/applicationContext` | `useApplicationContext`, `useContributeApplicationContext`, `ApplicationContextContributor`, `useApplicationContextStore`, `useRegisterScope`, `ApplicationContext` (store for use outside React), `sliceMarkerAttributes`, `SliceMarker`. |
43
47
  | `@cratis/arc.vite/slices` | `SliceLocationPlugin` (build time). |
44
48
  | `@cratis/arc` | `Globals`, `ObservableQueryTransferMode`. |
45
49
  | `@cratis/arc/queries` | `QueryTransportMethod`, `QueryHttpMethod`, `lengthBasedQueryHttpMethod`, `resetQueryHttpMethodResolution`, `PollingOptions`. |
@@ -135,8 +135,8 @@ Per view unless marked shared.
135
135
 
136
136
  ### Lint
137
137
 
138
- - `@cratis/eslint-plugin-arc`, recommended config, composed after the project's base config; it skips generated proxy files and enables:
139
- - `@cratis/arc/no-hooks-in-view-model` flags bare `use*` calls in classes named `*ViewModel` (member calls such as a generated query's static hook are not flagged); options `classSuffix`, `hookPattern`, `additionalHooks`.
138
+ - `@cratis/eslint-plugin-arc`, recommended config, composed after the project's base config; it skips recognized generated `.ts` proxies and, for `.ts` and `.tsx`, enables:
139
+ - `@cratis/arc/no-hooks-in-view-model` by default flags bare calls named `^use[A-Z]` whose nearest named class ends in `ViewModel`; bare `use()` and member calls such as `AllRooms.use()` pass, so review them; options `classSuffix`, `hookPattern`, `additionalHooks`.
140
140
  - `@cratis/arc/no-direct-mobx-react-import` flags imports from the MobX React packages.
141
141
 
142
142
  ## Pitfalls
@@ -153,7 +153,7 @@ Per view unless marked shared.
153
153
  - **Messages are not state.** Delivery matches the exact class (a subclass does not reach a base-class subscription) and nothing is replayed to a later subscriber. Define each message class once.
154
154
  - **Two root messengers.** A shared singleton service gets an application-level messenger that view models and the messaging hooks do not share. Publish from a view model, or pass the view's messenger to the service.
155
155
  - **Navigation is coarse.** `onUrlChanged` fires on page changes while the URL differs from the one at startup, so it repeats and reports that startup URL as previous; it cannot navigate or unsubscribe. Prefer route parameters and `handleParams`.
156
- - **Hooks, markup or browser globals in the class.** Inject the collaborator instead; the lint rule enforces the hook part.
156
+ - **Hooks, markup or browser globals in the class.** Inject the collaborator instead; lint catches only some hooks (see Lint).
157
157
 
158
158
  ## Related skills
159
159
 
@@ -607,17 +607,38 @@ import arc from '@cratis/eslint-plugin-arc';
607
607
  export default [...cratis.configs.consumer, ...arc.configs.recommended];
608
608
  ```
609
609
 
610
- The recommended config skips generated proxy files and enables both rules as errors. To forbid more call names in view models, or change which classes count as view models (`classSuffix`) or which names count as hooks (`hookPattern`, a regular expression string):
610
+ The recommended config skips recognized generated `.ts` proxy files and enables both rules as errors for `.ts` and `.tsx` files. A proxy is recognized by the generated marker in its first four lines; one whose marker sits further down, or a generated `.tsx` file, is linted like hand-written code. Keep `no-hooks-in-view-model` at its defaults; they flag a bare call whose name matches `^use[A-Z]` inside a class whose name ends with `ViewModel`. The rule goes by name only, so a member call such as `React.useState()` is missed.
611
+
612
+ The rule reports a call when all of these hold:
613
+
614
+ - The call is a bare name, such as `useState(...)`. A member call, such as `this.useDefaults()` or `AllRooms.use()`, is never reported, so keep generated query hooks in the view by review.
615
+ - The name matches `hookPattern` or is listed in `additionalHooks`.
616
+ - The nearest enclosing class is a view model: a named class whose name ends with `classSuffix`. Calls nested in callbacks inside that class count. When the nearest class has no name of its own, or its name does not end with `classSuffix`, the call is not checked, even inside a view model; a nested class whose name does end with `classSuffix` is checked.
617
+
618
+ | Option | Default | Set it when |
619
+ | --- | --- | --- |
620
+ | `additionalHooks` | none | A view model must also not call some functions whose names do not look like hooks, for example a project helper that wraps one. Exact names, forbidden in addition to the pattern. |
621
+ | `classSuffix` | `ViewModel` | The project names its view models with another suffix. Case-sensitive; one suffix per rule entry. |
622
+ | `hookPattern` | `^use[A-Z]` | The project's hooks follow another naming scheme. A regular expression as a string, matched against the called name; a nonempty string replaces the default; an empty string leaves the default in place. |
623
+
624
+ A custom `hookPattern` is not anchored for you. To keep the default match and add to it, keep the `^` anchor, for example `^(?:use[A-Z]|projectHook$)`; without the anchor, `use[A-Z]` also matches unrelated names such as `reuseCache`.
625
+
626
+ Options not given keep their defaults. Add the entry after the recommended config, with the same `files`:
611
627
 
612
628
  ```js
613
- {
614
- rules: {
615
- '@cratis/arc/no-hooks-in-view-model': ['error', { additionalHooks: ['injectQuery'] }]
629
+ export default [
630
+ ...cratis.configs.consumer,
631
+ ...arc.configs.recommended,
632
+ {
633
+ files: ['**/*.ts', '**/*.tsx'],
634
+ rules: {
635
+ '@cratis/arc/no-hooks-in-view-model': ['error', { additionalHooks: ['injectQuery'] }]
636
+ }
616
637
  }
617
- }
638
+ ];
618
639
  ```
619
640
 
620
- Only bare calls such as `useState(...)` are flagged; a member call such as `AllRooms.use()` inside a view model is not, so keep generated query hooks in the view by review.
641
+ Do not switch the rule off for a file to let a hook through; inject the collaborator or call the hook in the bound view.
621
642
 
622
643
  Specify a view model as a plain class: construct it with fakes for its constructor parameters, call its methods and assert its fields and getters. No React, container or MobX setup is needed; see `cratis-specifications-test-typescript-behavior` for the spec style.
623
644
 
@@ -215,7 +215,7 @@ Register the event types, registered event sources, and the observers relevant t
215
215
 
216
216
  `given.events` has no batch append-options argument. `correlationId`, `causedBy`, `generation` and `sourceSequenceNumber` on entry objects are import metadata, not seed-append overrides. Seed routing uses Chronicle's batch append rules; distinct declared concurrency guards for one source key may require separate batches.
217
217
 
218
- The helper waits through the sequence number of the last append result, not through new events appended later by downstream reactors. Register the observers whose state you intend to assert: a wait can succeed without any matching observer. Distinguish constraint or concurrency rejection (`constraintViolation` or `concurrencyViolation`, no append for the rejected write) from a failed observer wait, which can return a failed command result after commitment. Caller cancellation can stop the command wait without undoing the append. Setup, log reads and disposal can reject separately from a returned command result.
218
+ The helper waits through the sequence number of the last append result, not through new events appended later by downstream reactors. Register the observers whose state you intend to assert: a wait can succeed without any matching observer. When Chronicle rejects every append with only constraint or concurrency violations, nothing is appended and the command fails with validation results. A concurrency violation has `reason` `'concurrencyViolation'`, and its `state` holds `eventSourceId`, `expectedEventSequenceNumber` and `actualEventSequenceNumber`. A constraint violation has `reason` `'constraintViolation'`, and the constraint ID is in `reasonDetail`. Assert the reason you expect, for example `result.shouldNotBeSuccessful().shouldHaveValidationErrorBecauseOf('constraintViolation')`. Any append error, such as an unavailable constraint index, makes the command report an exception instead of a validation result. A failed observer wait is different: it can fail the command after the events were committed, so also assert what was appended. Caller cancellation can stop the command wait without undoing the append. Setup, log reads and disposal can reject separately from a returned command result.
219
219
 
220
220
  ```typescript
221
221
  import { ChronicleKernelScenario } from '@cratis/arc.chronicle/testing';
@@ -233,7 +233,7 @@ try {
233
233
 
234
234
  ## Kernel-backed queries
235
235
 
236
- Use `withChronicle({ eventStore, connectionString })` for an Arc-owned connection, or supply `client` instead of `connectionString` for a caller-owned client you initialize and dispose. Set `completionTimeoutMs` to wait for observers after successful appends; without it, a successful command is not a barrier for read-model assertions. Match the application's `readModelNamingPolicy` if it customizes storage names (configure it on a caller-owned client). Use `activateArtifactsInScopes` only when testing that integration: it scopes reactor and reducer delivery; prefer the Arc-owned connection so Arc installs its activator and reactor result handler.
236
+ Use `withChronicle({ eventStore, connectionString })` for an Arc-owned connection, or supply `client` instead of `connectionString` for a caller-owned client you initialize and dispose. Set `completionTimeoutMs` to wait for observers after successful appends; without it, a successful command is not a barrier for read-model assertions. The TypeScript SDK does not send per-event-type tails, so an observer that does not handle the appended types can still block completion while it is behind the append's tail. Chronicle leaves out some observers, such as internal kernel reactors not subscribed in the namespace. If an awaited observer is still behind when the timeout elapses, the command reports an exception although its events are stored. Keep the real observers the test needs, and set `completionTimeoutMs` only where every observer included in the wait can reach each tested append's tail. Match the application's `readModelNamingPolicy` if it customizes storage names (configure it on a caller-owned client). Use `activateArtifactsInScopes` only when testing that integration: it scopes reactor and reducer delivery; prefer the Arc-owned connection so Arc installs its activator and reactor result handler.
237
237
 
238
238
  Not supported by `ChronicleKernelScenario`: query or subscription entry points. Build an Arc application attached to a fresh kernel store with the real query and Chronicle artifacts. Act through the built server, not a second in-memory query scenario. Import `@cratis/arc.chronicle` for the builder integration; register the slice's generated metadata if it binds parameters that way. For example, with a decorated `CreateDispatchSlot` using explicit bindings, its registered `SlotCreated` event, the `DispatchSlot` read model with snapshot query `available`, and its observer `DispatchSlotProjection`:
239
239
 
@@ -1,5 +1,14 @@
1
1
  # C#: declaring server validation rules
2
2
 
3
+ ## Contents
4
+
5
+ - Field rules
6
+ - Data annotations
7
+ - Shared rules and conditions
8
+ - Request-scoped checks
9
+
10
+ ## Field rules
11
+
3
12
  Use one `CommandValidator<T>` for operation-specific checks. Import `Cratis.Arc.Commands`, `Cratis.Arc.Validation` and `FluentValidation`. Names below are illustrative. The table cells are alternative suffixes for a compatible `RuleFor(x => x.Member)`; do not combine contradictory requirements.
4
13
 
5
14
  | Requirement | Rule suffix examples |
@@ -14,14 +23,26 @@ Use one `CommandValidator<T>` for operation-specific checks. Import `Cratis.Arc.
14
23
  | Decimal digits | `.PrecisionScale(7, 2, true)` allows up to five integer and two fractional digits, ignoring trailing fractional zeros. |
15
24
  | Cross-field | `RuleFor(x => x.End).Must((x, end) => end > x.Start)` attaches the refusal to `end`. |
16
25
 
26
+ ## Data annotations
27
+
17
28
  For declarative metadata use `System.ComponentModel.DataAnnotations`. On positional records target the generated property, e.g. `[property: Required, StringLength(40, MinimumLength = 2)] string Destination`. Other independent property examples: `[MinLength(2)]`, `[MaxLength(40)]`, `[Range(1, 99)]`, `[RegularExpression("[A-Z]{2}")]`, `[EmailAddress]`, `[Phone]`, `[Url]`, `[CreditCard]`. A custom `ValidationAttribute` runs server-side. On a command implementing `IValidatableObject`, `Validate` runs after successful member and type attribute checks. Do not assume all server rules project: simple unconditional literal rules and recognized annotations can generate proxy metadata, not arbitrary server logic. See `cratis-arc-generate-proxies` for extractable families.
18
29
 
30
+ On a model-bound command, annotations behave as follows:
31
+
32
+ - A failed annotation always reports `Error` with reason `rule`. For a warning or information result use a validator rule.
33
+ - They apply to the command's own members. For a nested input type use a `DiscoverableValidator<T>`.
34
+ - On a concept member, `[Required]`, `[Range]`, `[StringLength]`, `[MinLength]`, `[MaxLength]` and `[RegularExpression]` check the underlying value, provided Arc generated validation metadata for the command type. Without that metadata, such as for a type from an assembly that lacks it, the attribute receives the concept object and `[StringLength]` on a non-null concept throws; use a validator rule for that member.
35
+ - A nullable concept passes annotations that tolerate absence. Add `[Required]` when absence must fail.
36
+ - Use one mechanism per member: when a rule moves to the validator, remove the matching annotation. Annotations run before validators, and a blocking annotation error refuses the command before any validator runs, so the caller sees the validator's findings only after correcting the annotated members.
37
+
19
38
  ## Shared rules and conditions
20
39
 
21
40
  - A `DiscoverableValidator<Parcel>` checks a `Parcel` encountered in the command graph, including collection elements. The automatic walk carries the collection path without adding an index. Where indexed feedback matters, define `RuleForEach(x => x.Parcels).ChildRules(parcel => parcel.RuleFor(p => p.Weight).GreaterThan(0))`. For a reusable explicit child validator use `RuleFor(x => x.Parcel).SetValidator(new ParcelRules())`; don't also auto-discover the same checks.
22
41
  - Put a `ConceptValidator<DestinationCode>` beside the concept for global checks. In command rules select the concept itself: `RuleFor(x => x.DestinationCode).Length(3)` applies to the underlying string and reports the owner. Do not dereference a potentially absent concept. For an exception to its global rule use `RuleFor(x => x.DestinationCode).IgnoreConceptRules().MaximumLength(8)`; other members remain validated.
23
42
  - For opt-in only, derive `DomesticCodeRules : ExplicitConceptValidator<DestinationCode>` and declare concept rules there. To attach it to the concept object rather than its unwrapped string, use the FluentValidation selector in the command validator constructor: `((AbstractValidator<ScheduleDelivery>)this).RuleFor(x => x.DestinationCode).SetValidator(new DomesticCodeRules())`.
24
- - `RuleFor(x => x.Gate).NotEmpty().When(x => x.IsPickup)` and `.Unless(x => x.IsVirtual)` condition the preceding chain. Pass `ApplyConditionTo.CurrentValidator` as the second argument to condition only the last check. For shared inputs use `.WhenCommand()` or `.WhenQuery()` after a rule (same optional scope); group rules with `WhenCommand(() => { ... })` or `WhenQuery(() => { ... })`.
43
+ - `RuleFor(x => x.Gate).NotEmpty().When(x => x.IsPickup)` and `.Unless(x => x.IsVirtual)` condition the preceding chain. Pass `ApplyConditionTo.CurrentValidator` as the second argument to condition only the last check. For shared inputs use `.WhenCommand()` or `.WhenQuery()` after a rule (same optional scope); group rules with `WhenCommand(() => { ... })` or `WhenQuery(() => { ... })`. Inside a predicate, `context.IsCommand()` and `context.IsQuery()` give the same distinction. `ShouldAccept` / `ShouldReject` always validate as a command; spec a query-only rule with an explicit context marked `SetQuery()`.
44
+ - A discovered concept or model validator does not run for a member that is null, and null collection elements are skipped. A `NotEmpty()` inside `ConceptValidator<DestinationCode>` therefore does not reject a missing `DestinationCode?`. A concept rule on the owner sees a missing concept as the default of its underlying type, so `NotNull()` catches it only when that type is a reference type such as `string`. When absence is invalid and so is the empty or default value, add `RuleFor(x => x.DestinationCode).NotEmpty()` on the owner. When the default is a valid value, such as a quantity of `0`, `NotEmpty()` would reject it too; test the concept object itself instead: `RuleFor(x => x.Quantity).Must((command, _) => command.Quantity is not null)`.
45
+ - Edge case: to report a rule against a different field name, call `.OverridePropertyName("field")` directly after `RuleFor(...)`.
25
46
 
26
47
  ## Request-scoped checks
27
48
 
@@ -35,4 +56,4 @@ RuleFor(x => x.Slot).MustAsync(async (_, slot, context, cancellation) =>
35
56
  .WithSeverity(ValidationResultSeverity.Error);
36
57
  ```
37
58
 
38
- Use `context.GetCausedBy()` for the operation's causing identity and `context.IsSystem()` for the trusted system actor. These accessors, including `GetTenant()`, need a live Arc operation snapshot. For request-provided values use `context.ValuesAs<RoutingInputs>()`, `context.Values().region`, or `context.ProvidedValues()` for the typed values container. Outside the pipeline provided values are absent. A service outage is not evidence that a slot is taken: don't catch dependency faults and turn them into a failed predicate. A successful availability check alone does not reserve anything.
59
+ Use `context.GetCausedBy()` for the operation's causing identity and `context.IsSystem()` for the trusted system actor. These accessors, including `GetTenant()`, need a live Arc operation snapshot. Calling one outside Arc's command or query pipeline, such as from a validator that MVC model validation runs for a controller body type, refuses the request as unauthorized, whatever severity the caller allows. For request-provided values use `context.ValuesAs<RoutingInputs>()`, `context.Values().region`, or `context.ProvidedValues()` for the typed values container. Outside the pipeline provided values are absent. A service outage is not evidence that a slot is taken: don't catch dependency faults and turn them into a failed predicate. A successful availability check alone does not reserve anything.
@@ -5,6 +5,7 @@
5
5
  - The default: a field rule
6
6
  - Specify the rule
7
7
  - Avoid
8
+ - When a rule throws
8
9
  - Reuse a value rule
9
10
  - Where each kind of check belongs
10
11
  - Severity
@@ -41,7 +42,7 @@ For a relationship rule, take the related model as a typed validator constructor
41
42
 
42
43
  ## Specify the rule
43
44
 
44
- Give every rule a direct spec: construct the validator, passing any read-model state its constructor takes, and assert with `ShouldAccept` / `ShouldReject` from `Cratis.Arc.Testing.Validation` (`ShouldAcceptAsync` / `ShouldRejectAsync` when the validator has `MustAsync` rules). No pipeline, discovery or dependency resolution runs, so a failure points at the rule; see `cratis-specifications-isolate-behavior`. Add a `CommandScenario<TCommand>` pipeline spec only where wiring matters, such as discovery, authorization, read-model resolution, read protection or append constraints; see `cratis-specifications-exercise-backend`. There, assert the refusal with `ShouldHaveValidationErrors()` or `ShouldHaveValidationErrorBecauseOf(reason)`, not `ShouldNotBeSuccessful()` alone: that also passes for an exception, or for a validator never built because the spec did not seed the read model its constructor takes.
45
+ Give every rule a direct spec: construct the validator, passing any read-model state its constructor takes, and assert with `ShouldAccept` / `ShouldReject` from `Cratis.Arc.Testing.Validation` (`ShouldAcceptAsync` / `ShouldRejectAsync` when the validator has `MustAsync` rules). These helpers always validate as a command, so they cannot reach a `WhenQuery` or `IsQuery()` branch: for that, build a `ValidationContext<T>`, call `SetQuery()` on it (from `Cratis.Arc.Validation`) and pass it to `Validate` or `ValidateAsync`. No pipeline, discovery or dependency resolution runs, so a failure points at the rule; see `cratis-specifications-isolate-behavior`. Add a `CommandScenario<TCommand>` pipeline spec only where wiring matters, such as discovery, authorization, read-model resolution, read protection or append constraints; see `cratis-specifications-exercise-backend`. There, assert the refusal with `ShouldHaveValidationErrors()` or `ShouldHaveValidationErrorBecauseOf(reason)`, not `ShouldNotBeSuccessful()` alone: that also passes for an exception, or for a validator never built because the spec did not seed the read model its constructor takes.
45
46
 
46
47
  ## Avoid
47
48
 
@@ -49,6 +50,20 @@ Give every rule a direct spec: construct the validator, passing any read-model s
49
50
  - Do not register a validator per rule. Add operation-specific rules to the existing validator.
50
51
  - Do not invent command members: `CommandContext` has `AuthorizedPrincipal`, not `User`. Read host identity from `ICurrentPrincipalAccessor`, and use `IHttpContextAccessor` only for ASP.NET data. Express a refusal as `ValidationResult.Error` or a typed event, not `CommandResult.Forbidden()` or a `CommandResult` returned from `Handle`.
51
52
  - Do not substitute a database lookup for a protected model parameter. For uniqueness across writers use an append constraint.
53
+ - Declare exactly one discovered validator per command, concept or model type, and put all rules for that type in it. A second one for the same type makes validator discovery throw, which stops an ASP.NET Core host at start-up, and it fails proxy generation.
54
+ - A plain `AbstractValidator<T>` for a command is worse than unused. When the command has no discovered validator the proxy generator still reads the plain one, so the generated client can enforce any of its rules the generator supports, while the server runs none of them.
55
+ - Give a validator exactly one public constructor. With several, Arc constructs the validator through the public constructor with the most parameters, under read protection `On` as well; outside `On` your own registration supplies the instance instead. Do not depend on that choice: stricter protected activation outside `On` refuses a validator that has more than one public constructor.
56
+
57
+ ## When a rule throws
58
+
59
+ When a rule throws while Arc's command or query pipeline runs the validator, everything that validator would have reported is replaced by one `Error` with the message "The value could not be validated.", reason `validatorFailed` and no member. The exception is written to the server log only. The usual cause is a rule that reads through a member the request left out.
60
+
61
+ - In a command validator select the concept itself, `RuleFor(c => c.Code)`, never `RuleFor(c => c.Code.Value)`.
62
+ - In `Must`, handle a missing member explicitly, as a failed or a skipped check, instead of reading through it.
63
+ - Do not catch the exception inside the predicate and return `false`: that reports a fault as a business refusal.
64
+ - On the client, recognize the case by the reason, never by the message text.
65
+
66
+ Cancellation, a decision read that could not be acquired, an unavailable context value and an unavailable operation snapshot keep their own outcome; they are not turned into `validatorFailed`. Neither is a tenant-membership denial when strict membership is on or the operation's own membership read was denied: it stays an authorization refusal. A validator that MVC model validation runs for a controller body type gets no `validatorFailed` conversion: an ordinary exception propagates as a fault. A tenant-membership denial or an unavailable operation snapshot is still an authorization refusal there, answered with HTTP 403.
52
67
 
53
68
  ## Reuse a value rule
54
69
 
@@ -112,12 +127,18 @@ RuleFor(command => command.Quantity)
112
127
 
113
128
  Confirmation takes two requests with the unchanged command. The first allows only `Information` (`allowedSeverity: ValidationResultSeverity.Information`, or header value `1`), so the warning blocks and comes back in `ValidationResults` with nothing written. After the caller confirms, the second allows `Warning` (header value `2`); the rules run again, errors still block, and the handler runs. The default threshold already allows warnings, so a first request without the lower threshold executes straight away. The confirmation is a caller convention, not server-enforced consent.
114
129
 
115
- For example, `await pipeline.Validate(command, allowedSeverity: ValidationResultSeverity.Information)` retains warnings and errors but never invokes the handler. Use `pipeline.Execute(command, allowedSeverity: ...)` for the actual decision. Model-bound HTTP exposes `POST <command-route>/validate`; both routes honor the integer header (`0` Unknown, `1` Information, `2` Warning, `3` Error). `[AllowCallerValidationSeverity(ValidationResultSeverity.Error)]` replaces the host `Command.MaximumCallerAllowedSeverity` cap for that command; `Command.IgnoreCallerAllowedSeverity = true` ignores the header even there. The floor on the command (including inherited policy) precedes the assembly floor; any floor also blocks Unknown. MVC `[TreatWarningsAsErrors]` is a controller/action filter policy, not a model-bound command floor.
130
+ For example, `await pipeline.Validate(command, allowedSeverity: ValidationResultSeverity.Information)` retains warnings and errors but never invokes the handler. Use `pipeline.Execute(command, allowedSeverity: ...)` for the actual decision. Model-bound HTTP exposes `POST <command-route>/validate`; both routes honor the integer header (`0` Unknown, `1` Information, `2` Warning, `3` Error). `[AllowCallerValidationSeverity(ValidationResultSeverity.Error)]` replaces the host `Command.MaximumCallerAllowedSeverity` cap for that command; `Command.IgnoreCallerAllowedSeverity = true` ignores the header even there. The floor on the command (including inherited policy) precedes the assembly floor; any floor also blocks Unknown. An undefined enum value in `[BlockOnValidationSeverity]` fails the command, and one in `[AllowCallerValidationSeverity]` fails any request whose `X-Allowed-Severity` header the host honors; neither loosens the policy. The model-bound HTTP endpoint applies the caller cap before it dispatches, so the cap holds for a replacement `ICommandPipeline` too. The blocking floor is enforced by Arc's own command pipeline; a replacement must enforce it itself.
131
+
132
+ MVC `[TreatWarningsAsErrors]` is a controller/action filter policy, not a model-bound command floor, and not a floor at all: a caller waives it by sending `X-Ignore-Warnings: true`. When a warning must never be waived, use a model-bound command with `[BlockOnValidationSeverity]`. Controller severity handling is in the `cratis-arc-declare-command` skill, `references/csharp-controller.md`.
116
133
 
117
134
  ## Read models as validator inputs
118
135
 
119
136
  `[ReadModel]` marks a type; it does not load it. The provider that owns the type does: Chronicle, an EF Core `ReadOnlyDbContext` or MongoDB. Work out which one before debugging a missing instance, and tell apart no instance for a valid key, no provider for the type, and an invalid key. Declare the parameter non-nullable when the rule needs the state, so absence refuses; use a nullable parameter only when the rule handles absence. A missing or removed materialized projection or reducer (including a passive reducer) returns null. A never-created `[Passive]` projection instead returns a default-valued instance, so neither nullability path detects it. Project an explicit existence flag, such as `[SetValue<ShipmentCreated>(true)] bool Exists`, with one assignment per creation event, and check `Exists`. Renumbering an enum does not establish existence. `CommandScenario` returns null for unseeded IDs; also seed a default-valued instance and assert that the decision refuses it.
120
137
 
138
+ Attach a state rule to the member the user chose, usually the key: `RuleFor(c => c.LedgerId).Must(_ => balance.Balance > 0)` reports `ledgerId` although it checks the model.
139
+
140
+ Let Arc construct the validator: discovery registers it as transient. Do not add your own scoped, singleton, factory or instance registration for it; under read protection `On` such a validator is refused and the command fails.
141
+
121
142
  For explicitly protected validators outside `On`, use the "Validators outside On" guidance in `cratis-chronicle-protect-decision` (in `cratis/chronicle`).
122
143
 
123
144
  ## Dates and malformed input
@@ -130,6 +151,11 @@ Authorization takes precedence in the response, so a caller refused by authoriza
130
151
 
131
152
  FluentValidation failures normally carry `ValidationResultReason.Rule`. Where an operation explicitly returns an Arc result, for example `ValidationResult.Error("Choose an available slot", ["slot"], state: new { retryable = true }, reason: ValidationResultReason.Rule, reasonDetail: "slotTaken")`, `Information` and `Warning` take the same arguments. Do not use a handler result to implement a pre-handler rule. Handle `malformedRequest`, `validatorFailed`, `dependencyUnavailable`, `frameworkFailure`, `concurrencyViolation` and `constraintViolation` separately from authored rules; retain a fallback for unknown reasons. Do not expose sensitive state or branch on message text.
132
153
 
154
+ - An append constraint refusal arrives as an `Error` with reason `constraintViolation` and the constraint's name in `reasonDetail`; declaring and naming constraints is in the `cratis-chronicle-constrain-append` skill, `references/csharp.md`.
155
+ - A missing required read model is reported with reason `dependencyUnavailable`. Under effective read protection `On`, a missing protected one is reported with reason `rule` instead, like an authored rule. Do not rely on the reason to recognize a missing instance: when the caller must be told, take the parameter as nullable and write the existence rule yourself.
156
+ - FluentValidation's `WithErrorCode` does not reach the caller. Use `WithState` for a machine-readable code on a validator rule, and `reasonDetail` on a `ValidationResult` you return yourself.
157
+ - `Handle()` refuses by returning a `ValidationResult` value. Do not return an array or sequence of them: each returned value is recognized on its own, so separate `ValidationResult` values in a tuple are each reported and merged, while a collection is not recognized as a refusal and may instead end up as ordinary response data or clash with another returned value. Put several findings in the validator. Return types are in the `cratis-arc-declare-command` skill, `references/csharp.md`, "What `Handle` may return".
158
+
133
159
  ## Not supported in this SDK
134
160
 
135
161
  - No model-bound command switch for disabling the graph or arbitrary per-property traversal exclusion. Use a purpose-built input type; `IgnoreConceptRules()` skips only that immediate concept validator. `[IgnoreValidation]` on an MVC action/controller restores ASP.NET Core handling; it is not a graph exclusion.
@@ -105,6 +105,7 @@ Options and conditions need a preceding rule on the chain.
105
105
  - `withState` — attach JSON-serializable data, fixed or derived from the model, to the last rule's finding.
106
106
  - Generated proxies — a statement is copied only when it selects one declared member (a concept validator's rule is copied onto each command or arguments-model field of that concept) and uses only `notNull`, `notEmpty`, `minLength`, `maxLength`, `length`, `emailAddress`, `phone`, `url`, `matches` (flagless pattern, no message argument), `greaterThan`, `greaterThanOrEqual`, `lessThan` or `lessThanOrEqual` with literal finite arguments, plus a literal `withMessage`. Any other call in the statement (`when`, `unless`, `withSeverity`, `withState`, `must`, `mustAsync`, a computed message or argument) keeps the whole statement server-only and produces a generator diagnostic. Commands and queries with an explicit arguments model are covered.
107
107
  - `treatWarningsAsErrors` — operation option that only sets the same-named flag on the generated proxy; it changes no server filtering.
108
+ - Browser-side checks — the allowed-severity rules in this skill are the server's. In the browser, any finding from a query's client validator blocks the query, whatever its severity; only a command's client checks are filtered by allowed severity. See `cratis-arc-react-bind-slice` for client behaviour.
108
109
 
109
110
  ## State, rejection and severity
110
111
 
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: cratis-authproxy-configure
3
+ description: "Use when putting Cratis AuthProxy in front of an application or changing its configuration: sign-in providers, who is admitted, tenant resolution and switching, sessions and sign-out, routing to services, running it in production or under Aspire. Not for authorizing a command or query (`cratis-arc-authorize-request`) or reading identity in the backend (`cratis-arc-host-application`)."
4
+ ---
5
+
6
+ # Configure Cratis AuthProxy: the ingress that signs people in
7
+
8
+ ## Contents
9
+
10
+ - What AuthProxy owns
11
+ - Default path
12
+ - What the backend must do
13
+ - What a caller gets
14
+ - Decide by situation
15
+ - Reference index
16
+ - Anti-patterns
17
+ - Verify
18
+
19
+ ## What AuthProxy owns
20
+
21
+ Cratis AuthProxy is the default ingress for a Cratis application. It runs as its own container in front of the frontend and the backend. Nothing in the application references it.
22
+
23
+ | AuthProxy owns | The application owns |
24
+ |---|---|
25
+ | Sign-in at the identity provider, the session cookie, sign-out | No login page, no password or token handling |
26
+ | Who is admitted at all | Authorization of each command and query (`cratis-arc-authorize-request`) |
27
+ | Which tenant a request belongs to | What the tenant may see and do (`cratis-arc-isolate-tenant`) |
28
+ | Routing to the frontend and the backend | The answer on `/.cratis/me` for the signed-in person |
29
+
30
+ All configuration lives under `Cratis:AuthProxy`, in `appsettings.json` or as environment variables with `__` between segments (`Cratis__AuthProxy__Session__Lifetime`). Under Aspire the same settings are written by AppHost methods: see [references/aspire.md](references/aspire.md).
31
+
32
+ ## Default path
33
+
34
+ One application, one sign-in provider, one tenant. Run the `cratis/authproxy` image with:
35
+
36
+ ```json
37
+ {
38
+ "Cratis": {
39
+ "AuthProxy": {
40
+ "Authentication": {
41
+ "OidcProviders": [
42
+ {
43
+ "Name": "Microsoft",
44
+ "Type": "Microsoft",
45
+ "Authority": "https://login.microsoftonline.com/<tenant-id>/v2.0",
46
+ "ClientId": "<client-id>",
47
+ "ClientSecret": "<client-secret>"
48
+ }
49
+ ]
50
+ },
51
+ "TenantResolutions": [
52
+ { "Strategy": "Specified", "Options": { "TenantId": "acme" } }
53
+ ],
54
+ "Services": {
55
+ "main": {
56
+ "Backend": { "BaseUrl": "http://backend:8080/" },
57
+ "Frontend": { "BaseUrl": "http://frontend:3000/" }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ 1. **Provider.** One entry signs people in. Register `https://<proxy-host>/signin-microsoft` as the redirect URI and `https://<proxy-host>/.cratis/logout/callback` as the post-logout redirect URI at the provider. Supply `ClientSecret` from a secret store.
66
+ 2. **Tenant.** At least one tenant resolution is required: the proxy refuses to start without one while a service uses the default identity verification. `Specified` fixes one tenant for the deployment.
67
+ 3. **Service.** `/api/...` goes to the backend, everything else to the frontend.
68
+ 4. **Admission.** Add a required claim when the provider signs in more people than should get in. See [references/admission.md](references/admission.md).
69
+
70
+ ## What the backend must do
71
+
72
+ 1. **Trust the forwarded identity.** Arc ignores identity headers until it is told to trust them. Enable that, and sign the hop so the backend can tell the proxy from any other caller. `cratis-arc-host-application` (identity reference) teaches the backend settings; under Aspire one AppHost call sets both sides.
73
+ 2. **Answer `/.cratis/me`.** After sign-in the proxy calls `GET /.cratis/me` on the backend. With the default `Required` verification only a positive answer admits the person; a refusal, an error or no answer in time keeps everyone out. Arc serves the endpoint. An identity details provider that returns `IsUserAuthorized: false` refuses the person.
74
+ 3. **Be reachable only through the proxy.** The proxy removes identity and tenant headers a caller sent and writes its own. A route around the proxy does neither.
75
+ 4. **Keep the default tenant header.** The proxy writes the tenant to `x-cratis-tenant-id`, which Arc reads by default.
76
+
77
+ ## What a caller gets
78
+
79
+ | Caller | Response |
80
+ |---|---|
81
+ | A browser navigating to a page, not signed in | Redirect to the provider, or the provider-selection page when several are configured |
82
+ | A `fetch`, command, query or API client without a session | `401`. Never a login page. |
83
+ | A signed-in person who is not admitted | `403` by default. When the application refuses a person who signed in through an OIDC provider set to `DenialResponse: FailedSignIn`, the session ends instead: a navigation is redirected to sign-in with a failed-sign-in notice, anything else gets `401`. |
84
+ | A signed-in person when a `Required` service cannot be asked | `503`. The session is kept; it is an outage, not a refusal. |
85
+ | A signed-in, admitted person | The request is forwarded with identity and tenant headers |
86
+
87
+ ## Decide by situation
88
+
89
+ | Situation | Do | Read |
90
+ |---|---|---|
91
+ | Add Microsoft, Google, GitHub or another provider | Declare it under `Authentication` | [sign-in-providers.md](references/sign-in-providers.md) |
92
+ | Only some people at the provider may enter | Require a claim | [admission.md](references/admission.md) |
93
+ | The application decides who may enter | Answer `/.cratis/me`; keep `Required` | [admission.md](references/admission.md) |
94
+ | Several tenants | Choose a resolution strategy | [tenant-resolution.md](references/tenant-resolution.md) |
95
+ | A person switches between tenants | `Selection` strategy and `/.cratis/select-tenant` | [tenant-resolution.md](references/tenant-resolution.md) |
96
+ | Add a sign-out link | Navigate to `/.cratis/logout` | [sessions-and-logout.md](references/sessions-and-logout.md) |
97
+ | A sensitive page needs a recent sign-in | `FreshAuthentication` on the path | [sessions-and-logout.md](references/sessions-and-logout.md) |
98
+ | Several applications behind one sign-in | Route by host, path prefix or header | [services-and-routing.md](references/services-and-routing.md) |
99
+ | A webhook or public page without sign-in | `AnonymousPaths` on the service | `cratis-arc-authorize-request` |
100
+ | A CLI, agent or other program calls the API | A bearer route | `cratis-arc-authorize-request` |
101
+ | The backend calls another API as the user | `AccessToken` on the service | [services-and-routing.md](references/services-and-routing.md) |
102
+ | A live query drops after minutes of silence | Raise `ActivityTimeout` | [services-and-routing.md](references/services-and-routing.md) |
103
+ | More than one replica, or people are signed out at restart | Share the data protection key ring | [operations.md](references/operations.md) |
104
+ | TLS ends at an ingress in front of the proxy | Declare trusted proxies | [operations.md](references/operations.md) |
105
+ | Health probes | Enable the management listener | [operations.md](references/operations.md) |
106
+ | The AppHost is Aspire | Use the AppHost methods | [aspire.md](references/aspire.md) |
107
+
108
+ ## Reference index
109
+
110
+ | Reference | Read when |
111
+ |---|---|
112
+ | [references/sign-in-providers.md](references/sign-in-providers.md) | Adding or changing a sign-in provider, registering callbacks, or offering sign-in by e-mail code. |
113
+ | [references/admission.md](references/admission.md) | Deciding who gets past the proxy: required claims, GitHub organizations and teams, the `/.cratis/me` verdict. |
114
+ | [references/tenant-resolution.md](references/tenant-resolution.md) | Choosing how the tenant is resolved, verifying it exists, or building a tenant switcher. |
115
+ | [references/sessions-and-logout.md](references/sessions-and-logout.md) | Setting session lifetime, adding sign-out, requiring a recent sign-in, or handling a `401` in the frontend. |
116
+ | [references/services-and-routing.md](references/services-and-routing.md) | Routing several services, limiting forwarded paths, reading the forwarded headers, or keeping long-lived connections open. |
117
+ | [references/operations.md](references/operations.md) | Deploying: key ring, ingress, health probes, TLS to the backend, custom pages, telemetry. |
118
+ | [references/aspire.md](references/aspire.md) | Wiring the proxy in an Aspire AppHost. |
119
+
120
+ ## Anti-patterns
121
+
122
+ - Building sign-in, session handling or token validation in the application.
123
+ - A backend that trusts forwarded identity while it is reachable around the proxy.
124
+ - A public host with a social provider and no admission requirement.
125
+ - Treating admission at the proxy as authorization of commands and queries.
126
+ - Sending `x-cratis-tenant-id` from the frontend to choose a tenant.
127
+ - Changing a service to `BestEffort` verification because `/.cratis/me` fails.
128
+ - Deploying several replicas without a shared key ring.
129
+
130
+ ## Verify
131
+
132
+ 1. Open the application in a private browser window: the provider's sign-in appears.
133
+ 2. After sign-in the application loads and shows the signed-in person.
134
+ 3. Call an API path without the session cookie: the answer is `401`, not a page.
135
+ 4. Sign in with an account that should not be admitted: the answer is `403`.
136
+ 5. Navigate to `/.cratis/logout`, then call an API path: the answer is `401`.