@cratis/pi 7.34.1 → 7.35.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 (227) hide show
  1. package/package/corpus/agents/security-reviewer.md +1 -0
  2. package/package/corpus/agents/spec-writer.md +1 -1
  3. package/package/corpus/harnesses/pi/extensions/shared/rules.ts +3 -1
  4. package/package/corpus/hooks/scripts/cratis-nuget-pins.txt +7 -6
  5. package/package/corpus/hooks/scripts/cratis-release-notes-reviewed.cjs +7 -6
  6. package/package/corpus/hooks/scripts/cratis-store-mutations.json +7 -3
  7. package/package/corpus/product-sync.json +896 -0
  8. package/package/corpus/prompts/add-business-rule.prompt.md +1 -1
  9. package/package/corpus/prompts/ship-changes.prompt.md +2 -2
  10. package/package/corpus/rules/ai-distribution.md +31 -3
  11. package/package/corpus/rules/application-profile.md +2 -1
  12. package/package/corpus/rules/components.md +66 -7
  13. package/package/corpus/rules/concepts.md +11 -3
  14. package/package/corpus/rules/csharp.md +3 -1
  15. package/package/corpus/rules/dialogs.md +9 -0
  16. package/package/corpus/rules/efcore.md +1 -1
  17. package/package/corpus/rules/elixir.md +49 -0
  18. package/package/corpus/rules/framework.md +5 -3
  19. package/package/corpus/rules/general.md +1 -0
  20. package/package/corpus/rules/glossary.md +4 -4
  21. package/package/corpus/rules/go-engineering.md +60 -0
  22. package/package/corpus/rules/go.md +115 -0
  23. package/package/corpus/rules/java.md +5 -2
  24. package/package/corpus/rules/kotlin.md +7 -5
  25. package/package/corpus/rules/orleans.md +65 -9
  26. package/package/corpus/rules/profiles.md +43 -6
  27. package/package/corpus/rules/pull-requests.md +3 -3
  28. package/package/corpus/rules/react.md +8 -1
  29. package/package/corpus/rules/reactors.md +27 -3
  30. package/package/corpus/rules/specs.csharp.md +11 -4
  31. package/package/corpus/rules/specs.scenarios.csharp.md +35 -4
  32. package/package/corpus/rules/specs.typescript.md +2 -1
  33. package/package/corpus/rules/storybook.md +1 -1
  34. package/package/corpus/rules/typescript.md +1 -1
  35. package/package/corpus/rules/vertical-slices.md +37 -5
  36. package/package/corpus/skills/cratis-application-react-specifications/SKILL.md +4 -2
  37. package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +18 -8
  38. package/package/corpus/skills/cratis-application-slice-specifications/references/query-and-decision-scenarios.md +65 -0
  39. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/SKILL.md +53 -57
  40. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authentication.md +38 -42
  41. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authorization.md +18 -7
  42. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authproxy.md +30 -0
  43. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/frontend.md +12 -9
  44. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/local-development.md +9 -9
  45. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/observable-emission-guards.md +8 -5
  46. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/tenancy.md +20 -4
  47. package/package/corpus/skills/cratis-arc-command/SKILL.md +32 -10
  48. package/package/corpus/skills/cratis-arc-command/references/command-result.md +12 -5
  49. package/package/corpus/skills/cratis-arc-command/references/decisions-and-routing.md +95 -0
  50. package/package/corpus/skills/cratis-arc-command/references/generated-values.md +3 -2
  51. package/package/corpus/skills/cratis-arc-command/references/handler-shapes.md +8 -8
  52. package/package/corpus/skills/cratis-arc-command/references/proxy-generation.md +22 -3
  53. package/package/corpus/skills/cratis-arc-command/references/read-model-injection.md +13 -1
  54. package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +19 -9
  55. package/package/corpus/skills/cratis-arc-command-kotlin/SKILL.md +44 -18
  56. package/package/corpus/skills/cratis-arc-command-kotlin/references/read-model-naming.md +29 -0
  57. package/package/corpus/skills/cratis-arc-command-operation/SKILL.md +10 -9
  58. package/package/corpus/skills/cratis-arc-command-operation/references/execution-and-recovery.md +2 -2
  59. package/package/corpus/skills/cratis-arc-command-operation/references/testing.md +4 -3
  60. package/package/corpus/skills/cratis-arc-command-typescript/SKILL.md +42 -22
  61. package/package/corpus/skills/cratis-arc-command-typescript/references/chronicle-events.md +36 -5
  62. package/package/corpus/skills/cratis-arc-command-typescript/references/command-operations.md +114 -0
  63. package/package/corpus/skills/cratis-arc-command-typescript/references/hosting-and-storage.md +37 -16
  64. package/package/corpus/skills/cratis-arc-command-typescript/references/identity-and-introspection.md +88 -0
  65. package/package/corpus/skills/cratis-arc-command-typescript/references/observability-and-host-scopes.md +25 -0
  66. package/package/corpus/skills/cratis-arc-command-typescript/references/proxy-generation.md +35 -4
  67. package/package/corpus/skills/cratis-arc-command-typescript/references/slice-layout.md +11 -0
  68. package/package/corpus/skills/cratis-arc-command-typescript/verification.json +8 -1
  69. package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +49 -19
  70. package/package/corpus/skills/cratis-arc-ef-core-migration/SKILL.md +12 -6
  71. package/package/corpus/skills/cratis-arc-go/SKILL.md +148 -0
  72. package/package/corpus/skills/cratis-arc-go/references/queries.md +80 -0
  73. package/package/corpus/skills/cratis-arc-hosting/SKILL.md +96 -0
  74. package/package/corpus/skills/cratis-arc-hosting/references/integrations-and-publish.md +80 -0
  75. package/package/corpus/skills/cratis-arc-identity-and-tenancy-kotlin/SKILL.md +137 -0
  76. package/package/corpus/skills/cratis-arc-observable-query-http/SKILL.md +20 -2
  77. package/package/corpus/skills/cratis-arc-query-kotlin/SKILL.md +26 -6
  78. package/package/corpus/skills/cratis-arc-query-paging/SKILL.md +25 -20
  79. package/package/corpus/skills/cratis-arc-query-typescript/SKILL.md +32 -6
  80. package/package/corpus/skills/cratis-arc-query-typescript/references/storage-observation-and-compliance.md +66 -0
  81. package/package/corpus/skills/cratis-arc-query-typescript/verification.json +5 -1
  82. package/package/corpus/skills/cratis-arc-react-page/SKILL.md +24 -13
  83. package/package/corpus/skills/cratis-arc-react-page/references/data-page.md +20 -10
  84. package/package/corpus/skills/cratis-arc-react-page/references/data-tables.md +17 -3
  85. package/package/corpus/skills/cratis-arc-react-page/references/dialogs.md +14 -3
  86. package/package/corpus/skills/cratis-arc-react-page/references/from-screenplay.md +6 -1
  87. package/package/corpus/skills/cratis-arc-react-page/references/provenance.md +1 -1
  88. package/package/corpus/skills/cratis-arc-react-page/references/queries-and-commands.md +11 -1
  89. package/package/corpus/skills/cratis-arc-react-page/verification.json +6 -1
  90. package/package/corpus/skills/cratis-arc-spring-data-kotlin/SKILL.md +163 -0
  91. package/package/corpus/skills/cratis-arc-testing-kotlin/SKILL.md +131 -0
  92. package/package/corpus/skills/cratis-arc-validation-kotlin/SKILL.md +44 -11
  93. package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +5 -3
  94. package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +79 -25
  95. package/package/corpus/skills/cratis-chronicle-cli-operations/references/command-effects.md +57 -0
  96. package/package/corpus/skills/cratis-chronicle-client-dotnet/SKILL.md +87 -99
  97. package/package/corpus/skills/cratis-chronicle-client-dotnet/references/additional-surfaces.md +65 -0
  98. package/package/corpus/skills/cratis-chronicle-client-dotnet/references/client-construction.md +42 -0
  99. package/package/corpus/skills/cratis-chronicle-client-dotnet/references/compatibility-check.md +12 -0
  100. package/package/corpus/skills/cratis-chronicle-client-dotnet/references/discovery.md +43 -19
  101. package/package/corpus/skills/cratis-chronicle-client-dotnet/references/hosting.md +29 -1
  102. package/package/corpus/skills/cratis-chronicle-client-elixir/SKILL.md +158 -162
  103. package/package/corpus/skills/cratis-chronicle-client-elixir/references/append-api.md +36 -15
  104. package/package/corpus/skills/cratis-chronicle-client-elixir/references/compliance.md +32 -0
  105. package/package/corpus/skills/cratis-chronicle-client-elixir/references/connections.md +56 -0
  106. package/package/corpus/skills/cratis-chronicle-client-elixir/references/event-sources.md +64 -0
  107. package/package/corpus/skills/cratis-chronicle-client-elixir/references/pitfalls.md +25 -0
  108. package/package/corpus/skills/cratis-chronicle-client-elixir/references/projections.md +48 -0
  109. package/package/corpus/skills/cratis-chronicle-client-elixir/references/upgrading.md +34 -0
  110. package/package/corpus/skills/cratis-chronicle-client-elixir/references/variants.md +13 -5
  111. package/package/corpus/skills/cratis-chronicle-client-elixir/verification.json +23 -0
  112. package/package/corpus/skills/cratis-chronicle-client-go/SKILL.md +162 -0
  113. package/package/corpus/skills/cratis-chronicle-client-go/references/projections.md +73 -0
  114. package/package/corpus/skills/cratis-chronicle-client-kotlin/SKILL.md +87 -88
  115. package/package/corpus/skills/cratis-chronicle-client-kotlin/references/connection-lifecycle.md +13 -0
  116. package/package/corpus/skills/cratis-chronicle-client-kotlin/references/discovery-and-registration.md +14 -4
  117. package/package/corpus/skills/cratis-chronicle-client-kotlin/references/event-sources.md +65 -0
  118. package/package/corpus/skills/cratis-chronicle-client-kotlin/references/options.md +29 -0
  119. package/package/corpus/skills/cratis-chronicle-client-kotlin/references/spring-boot.md +13 -0
  120. package/package/corpus/skills/cratis-chronicle-client-kotlin/references/variants.md +5 -4
  121. package/package/corpus/skills/cratis-chronicle-client-typescript/SKILL.md +165 -156
  122. package/package/corpus/skills/cratis-chronicle-client-typescript/references/read-models-and-projections.md +54 -11
  123. package/package/corpus/skills/cratis-chronicle-client-typescript/references/testing.md +126 -0
  124. package/package/corpus/skills/cratis-chronicle-client-typescript/references/variants.md +3 -5
  125. package/package/corpus/skills/cratis-chronicle-client-typescript/verification.json +19 -0
  126. package/package/corpus/skills/cratis-chronicle-compliance/SKILL.md +36 -13
  127. package/package/corpus/skills/cratis-chronicle-decision-reads/SKILL.md +110 -0
  128. package/package/corpus/skills/cratis-chronicle-decision-reads/references/admission-and-ownership.md +57 -0
  129. package/package/corpus/skills/cratis-chronicle-decision-reads/verification.json +12 -0
  130. package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +58 -19
  131. package/package/corpus/skills/cratis-chronicle-event-constraints/references/closing-streams.md +73 -0
  132. package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +32 -3
  133. package/package/corpus/skills/cratis-chronicle-event-specifications/SKILL.md +18 -5
  134. package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +32 -2
  135. package/package/corpus/skills/cratis-chronicle-hosting/SKILL.md +134 -0
  136. package/package/corpus/skills/cratis-chronicle-hosting/references/operations.md +89 -0
  137. package/package/corpus/skills/cratis-chronicle-hosting/verification.json +14 -0
  138. package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +93 -66
  139. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/blocked-tools.md +21 -7
  140. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +77 -0
  141. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/observational-tools.md +46 -4
  142. package/package/corpus/skills/cratis-chronicle-multi-tenancy/SKILL.md +15 -1
  143. package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +44 -10
  144. package/package/corpus/skills/cratis-chronicle-projection/references/fluent-builder.md +7 -1
  145. package/package/corpus/skills/cratis-chronicle-projection/references/model-bound-attributes.md +8 -0
  146. package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +85 -105
  147. package/package/corpus/skills/cratis-chronicle-reactor/references/specifications.md +20 -1
  148. package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +2 -2
  149. package/package/corpus/skills/cratis-chronicle-read-model/references/queries.md +35 -16
  150. package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +15 -3
  151. package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +23 -4
  152. package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +40 -15
  153. package/package/corpus/skills/cratis-cli-terminal-workbench/SKILL.md +20 -6
  154. package/package/corpus/skills/cratis-code-review/SKILL.md +25 -3
  155. package/package/corpus/skills/cratis-components-accessibility/SKILL.md +20 -4
  156. package/package/corpus/skills/cratis-components-schema-editor/SKILL.md +40 -28
  157. package/package/corpus/skills/cratis-components-schema-editor/references/tree-layout.md +62 -0
  158. package/package/corpus/skills/cratis-components-schema-editor/verification.json +14 -0
  159. package/package/corpus/skills/cratis-components-stepper-command-dialog/SKILL.md +16 -8
  160. package/package/corpus/skills/cratis-components-styling/SKILL.md +57 -20
  161. package/package/corpus/skills/cratis-components-styling/verification.json +13 -0
  162. package/package/corpus/skills/cratis-components-toolbar/SKILL.md +37 -7
  163. package/package/corpus/skills/cratis-components-toolbar/verification.json +12 -0
  164. package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +6 -0
  165. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +5 -3
  166. package/package/corpus/skills/cratis-fundamentals-concept/SKILL.md +19 -6
  167. package/package/corpus/skills/cratis-fundamentals-concept/references/typescript-concepts.md +97 -0
  168. package/package/corpus/skills/cratis-fundamentals-concept/verification.json +4 -1
  169. package/package/corpus/skills/cratis-fundamentals-concept-go/SKILL.md +112 -0
  170. package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +54 -17
  171. package/package/corpus/skills/cratis-fundamentals-type-discovery/verification.json +14 -0
  172. package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +55 -28
  173. package/package/corpus/skills/cratis-performance-review/SKILL.md +5 -2
  174. package/package/corpus/skills/cratis-release-notes/SKILL.md +3 -1
  175. package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +5 -4
  176. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +5 -6
  177. package/package/corpus/skills/cratis-screenplay-command-surface/references/compliance.md +24 -6
  178. package/package/corpus/skills/cratis-screenplay-command-surface/references/enum-numbers.md +4 -2
  179. package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +4 -1
  180. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +3 -2
  181. package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +2 -2
  182. package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +1 -0
  183. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +34 -4
  184. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +5 -3
  185. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +1 -1
  186. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +4 -2
  187. package/package/corpus/skills/cratis-screenplay-model-authoring/references/property-links.md +42 -3
  188. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +3 -1
  189. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +3 -1
  190. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +3 -1
  191. package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +48 -0
  192. package/package/corpus/skills/cratis-screenplay-specifications/verification.json +3 -1
  193. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +4 -2
  194. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +5 -4
  195. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +8 -6
  196. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +2 -2
  197. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +4 -2
  198. package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +1 -1
  199. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +16 -11
  200. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +5 -2
  201. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +1329 -32
  202. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
  203. package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +2 -2
  204. package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +23 -7
  205. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +1 -1
  206. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +2 -0
  207. package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +27 -9
  208. package/package/corpus/skills/cratis-security-review/SKILL.md +9 -3
  209. package/package/corpus/skills/cratis-security-review/references/arc-boundaries.md +59 -0
  210. package/package/corpus/skills/cratis-specification-by-example/SKILL.md +7 -0
  211. package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +43 -11
  212. package/package/corpus/skills/cratis-specifications-csharp/references/application-scenarios.md +16 -4
  213. package/package/corpus/skills/cratis-specifications-csharp/references/csharp-patterns.md +18 -5
  214. package/package/corpus/skills/cratis-specifications-csharp/references/integration-specs.md +21 -0
  215. package/package/corpus/skills/cratis-specifications-csharp/references/shared-lifecycle.md +34 -0
  216. package/package/corpus/skills/cratis-specifications-csharp/verification.json +13 -0
  217. package/package/corpus/skills/cratis-specifications-typescript/SKILL.md +14 -5
  218. package/package/corpus/skills/cratis-specifications-typescript/verification.json +12 -0
  219. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +8 -2
  220. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +6 -3
  221. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +10 -1
  222. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/scene-runtime.md +75 -0
  223. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +5 -0
  224. package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +14 -1
  225. package/package/profile-catalog.json +68 -1
  226. package/package.json +1 -1
  227. package/src/index.ts +3 -1
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: cratis-arc-go
3
+ description: Build a Go HTTP CQRS application with Arc.Go commands, read-model queries, validation, identity and explicit hosting lifecycle. Use for the tagged root module and handwritten typed adapters. Do not use for Chronicle-only clients, C# or JVM Arc, or unpublished Go integration and generator modules.
4
+ license: MIT
5
+ compatibility: Go 1.26 or later for Arc.Go v0.1.1; root module only.
6
+ ---
7
+
8
+ <!-- Copyright (c) Cratis. All rights reserved. -->
9
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
10
+
11
+ # Arc HTTP CQRS in Go
12
+
13
+ > **Experimental v0:** Arc.Go **v0.1.1**. Companion guidance targets
14
+ > Chronicle.Go **v0.9.1** and Fundamentals.Go **v0.3.2**. Minor releases may break APIs.
15
+
16
+ **Only `github.com/cratis/arc.go`, the root module, is tagged.** Chronicle and
17
+ MongoDB integrations, `arc-gen`, `arc-vet` and framework-host recipes are separate
18
+ **source previews**, not installable released modules at v0.1.1. Do not prescribe
19
+ those tools, promise generated proxies, or claim returned events append to
20
+ Chronicle in this root-module setup. Arc commands can return ordinary responses
21
+ without an event store.
22
+
23
+ ## Verified product sources
24
+
25
+ | Product | Tag | Source checked |
26
+ | --- | --- | --- |
27
+ | Arc.Go (`github.com/cratis/arc.go`) | `v0.1.1` | `builder.go`, `application.go`, `server.go`, `lifecycle.go`, `commands/registration.go`, `commands/result.go`, `queries/registration.go`, `queries/example_test.go`, `authentication/microsoft_identity.go`, `example_test.go`, `arctest/example_test.go` |
28
+
29
+ [Source at v0.1.1](https://github.com/Cratis/Arc.Go/tree/v0.1.1)
30
+ is authoritative. The README's “no tagged Go release yet” wording is stale.
31
+ The [parity ledger](https://github.com/Cratis/Arc.Go/blob/v0.1.1/Documentation/parity.md)
32
+ reports bounded **Partial** conformance; a paired snapshot HTTP checkpoint with
33
+ 34/36 strict matches does not establish command, authentication, HEAD or whole-product parity.
34
+
35
+ ## Declare, register and host a command
36
+
37
+ Install `github.com/cratis/arc.go@v0.1.1` in a consumer module. This complete
38
+ package exposes a greeting with explicit handwritten registration:
39
+
40
+ ```go
41
+ // Copyright (c) Cratis. All rights reserved.
42
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
43
+
44
+ package greeting
45
+
46
+ import (
47
+ "context"
48
+
49
+ arc "github.com/cratis/arc.go"
50
+ "github.com/cratis/arc.go/commands"
51
+ )
52
+
53
+ // Greet requests a greeting for a name.
54
+ type Greet struct {
55
+ Name string `json:"name" validate:"required"`
56
+ }
57
+
58
+ // Handle produces the response without transport concerns.
59
+ func (c Greet) Handle(_ context.Context) (string, error) {
60
+ return "Hello, " + c.Name, nil
61
+ }
62
+
63
+ // Build registers Greet and seals application composition without starting it.
64
+ func Build() (*arc.Application, error) {
65
+ builder, err := arc.NewBuilder(arc.Options{})
66
+ if err != nil {
67
+ return nil, err
68
+ }
69
+ if err := commands.Register[Greet](builder, commands.Handle(Greet.Handle)); err != nil {
70
+ return nil, err
71
+ }
72
+ return builder.Build()
73
+ }
74
+
75
+ // Run serves loopback HTTP until the caller cancels its context.
76
+ func Run(ctx context.Context) error {
77
+ app, err := Build()
78
+ if err != nil {
79
+ return err
80
+ }
81
+ return app.Run(ctx, "127.0.0.1:8080")
82
+ }
83
+ ```
84
+
85
+ The caller owns signals and error reporting. After calling `Run`, post
86
+ `{"name":"Ada"}` as JSON to `/api/greet`; the Arc envelope contains
87
+ `"response":"Hello, Ada"`. An empty name returns 400. `/api/greet/validate`
88
+ runs authorization/validation without the handler. This sample is public, not
89
+ an authorization baseline for private business operations.
90
+
91
+ `NewBuilder` and `Build` perform no listener or business-callback activation.
92
+ Build seals composition; do not mutate registries afterward or independently
93
+ build registries borrowed from the root builder. For an externally owned HTTP
94
+ server, explicitly `Start(ctx)` before `ServeHTTP` and `Shutdown(ctx)` with a
95
+ bounded cleanup context. `Run` owns the server path instead.
96
+
97
+ Use explicit `json` names and named concepts. A typed `commands.Handle` adapter
98
+ supports the result above; do not assume reflective C# discovery. `Provide`
99
+ preparation uses an explicit typed adapter, not an automatically found method.
100
+ Ordinary `(value, error)` results become Arc outcomes. Inspect the returned error
101
+ **and** `IsSuccess`/authorization/validation/exception flags. `Response()` carries
102
+ presence separately from legitimate zero values; `StatusCode()` preserves Arc's
103
+ 200/403/400/500 precedence. Failed outcomes discard responses.
104
+
105
+ ## Query a read model
106
+
107
+ Read [typed query registration](references/queries.md) when defining snapshot
108
+ queries, paging or observable sources. A value-receiver namespace method can
109
+ represent a static-equivalent query, but must still be explicitly registered.
110
+ A comment directive alone does not activate discovery or publish an endpoint.
111
+
112
+ Root-module observable queries support SSE and WebSocket with emission guards.
113
+ Use a lifecycle-bearing `observable.Source` with `queries.RegisterObservable`,
114
+ not an arbitrary channel returned from a snapshot registration. Preserve query
115
+ identity, authorization/validation on emissions, backpressure and joined cleanup;
116
+ SSE and WebSocket framing are not interchangeable. Consult the tagged
117
+ [observable query guide](https://github.com/Cratis/Arc.Go/blob/v0.1.1/Documentation/backend/go/queries/observable-queries.md)
118
+ before choosing transport or delta behavior. Do not generalize its supported
119
+ profile to an unpublished MongoDB/Chronicle provider.
120
+
121
+ ## Identity and tenancy are security boundaries
122
+
123
+ `authentication.MicrosoftIdentityPlatform` is an explicitly registered,
124
+ borrowed handler, not a JWT validator. With zero options it ignores forwarded
125
+ identity headers. Enable `MicrosoftIdentityOptions.TrustForwardedIdentityHeaders`
126
+ only behind a credential-validating ingress that strips caller-supplied
127
+ `x-ms-client-principal*` headers, writes verified replacements and prevents direct
128
+ backend access. Base64 and headers are not authentication proof.
129
+
130
+ Keep identity enrichment (`/.cratis/me`), endpoint authorization and tenant
131
+ membership distinct. Resolve the tenant from trusted request context; never
132
+ interpret a caller's tenant selection as permission to access it. Wire explicit
133
+ policies for private operations and verify both denial and cross-tenant isolation
134
+ before exposing the server. Do not copy .NET identity-provider or attribute APIs
135
+ into Go code.
136
+
137
+ ## Verify and route
138
+
139
+ - Use `arctest.NewScenario`, `NewCommand` and `NewQuery` for in-process pipeline
140
+ contracts; close the scenario with a bounded cleanup context. Validation-only
141
+ assertions must prove no handler invocation/response.
142
+ - Test HTTP routes/envelopes, invalid input, authorization, presence/zero/null,
143
+ observable cancellation and lifecycle ownership in addition to compilation.
144
+ - Inline operations have commit-aware recovery, not a generic rollback promise;
145
+ consult tagged operation sources before implementing effects or compensation.
146
+ - A Chronicle-only client belongs in `cratis-chronicle-client-go`, not this skill.
147
+ - Arc.Go v0.1.1 requires Fundamentals.Go v0.1.0; the separate concepts skill's
148
+ v0.3.2 pin is not a required dependency upgrade.
@@ -0,0 +1,80 @@
1
+ <!-- Copyright (c) Cratis. All rights reserved. -->
2
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
3
+
4
+ # Explicit Go query adapters
5
+
6
+ Verified at Arc.Go **v0.1.1**, `queries/registration.go`, `queries/example_test.go`
7
+ and `queries/paging.go`. This complete package builds and executes a snapshot
8
+ pipeline; it does not start an HTTP host:
9
+
10
+ ```go
11
+ // Copyright (c) Cratis. All rights reserved.
12
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
13
+
14
+ package authors
15
+
16
+ import (
17
+ "context"
18
+ "fmt"
19
+
20
+ "github.com/cratis/arc.go/metadata"
21
+ "github.com/cratis/arc.go/queries"
22
+ )
23
+
24
+ // Author is the owning read model.
25
+ //arc:readmodel
26
+ type Author struct {
27
+ Name string `json:"name"`
28
+ }
29
+
30
+ // All is a static-equivalent query; it uses no receiver state.
31
+ func (Author) All(context.Context, queries.NoArguments) ([]Author, error) {
32
+ return []Author{{Name: "Ada"}}, nil
33
+ }
34
+
35
+ // ReadAuthors explicitly authorizes a public example query and checks its outcome.
36
+ func ReadAuthors(ctx context.Context) ([]Author, error) {
37
+ var registry queries.Registry
38
+ if err := queries.Register[Author](&registry, "All",
39
+ queries.Function(Author{}.All),
40
+ queries.WithAuthorization[queries.NoArguments](
41
+ metadata.Authorization{AllowAnonymous: true})); err != nil {
42
+ return nil, err
43
+ }
44
+ pipeline, err := registry.Build(queries.PipelineOptions{})
45
+ if err != nil {
46
+ return nil, err
47
+ }
48
+ result, err := queries.Perform[[]Author](ctx, pipeline,
49
+ "Author.All", queries.Request{})
50
+ if err != nil {
51
+ return nil, err
52
+ }
53
+ if !result.IsSuccess() {
54
+ return nil, fmt.Errorf("author query failed with status %d", result.StatusCode())
55
+ }
56
+ data, present := result.Data()
57
+ if !present {
58
+ return nil, fmt.Errorf("author query returned no data")
59
+ }
60
+ return data, nil
61
+ }
62
+ ```
63
+
64
+ The expected result is one `Author{Name: "Ada"}`. This public example opts into
65
+ anonymous access deliberately; use an explicit authorization policy for private
66
+ queries. `//arc:readmodel` documents the model, but handwritten registration is
67
+ what activates this package. The same `queries.Register` accepts a root builder
68
+ when composing HTTP endpoints.
69
+
70
+ For server-side paging, adapt with `queries.WithParameters` and return a
71
+ `queries.Page[Author]` containing items plus total count; do not fetch an unbounded
72
+ collection just to slice it in memory. The tagged `queries/example_test.go`
73
+ demonstrates parameter binding and paged results.
74
+
75
+ For observables, `queries.RegisterObservable` records the emission type separately
76
+ from `observable.Source` ownership and rendered client data. Preserve authorization
77
+ and validation guards on every emission, cancellation, terminal errors and cleanup.
78
+ Read the [source and examples](https://github.com/Cratis/Arc.Go/tree/v0.1.1/queries)
79
+ for the exact source/renderer profile instead of assuming channels, providers or
80
+ unpublished generators share one registration contract.
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: cratis-arc-hosting
3
+ description: Bootstrap and configure a Cratis Arc .NET host — choose AddCratis versus AddCratisArc or ArcApplication, activate Chronicle and storage integrations, disable controllers for trimming/NativeAOT, supply JSON metadata, and check identity/discovery and embedded viewer exposure. Use when creating a host, diagnosing missing endpoints, or preparing a trimmed publish. Do not use for command/query design, running a Chronicle server, or Kotlin/TypeScript hosting.
4
+ license: MIT
5
+ ---
6
+
7
+ <!-- Copyright (c) Cratis. All rights reserved. -->
8
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
9
+
10
+ # Host Arc for .NET
11
+
12
+ Choose the host and integrations before copying a bootstrap. Arc is standalone
13
+ CQRS; Chronicle is optional and its client connects to a separate event store.
14
+ Nothing in `AddCratis()` runs the Chronicle engine in your application.
15
+
16
+ ## Verified product sources
17
+
18
+ | Package | Version | Purpose |
19
+ | --- | --- | --- |
20
+ | `Cratis`, `Cratis.Arc`, `Cratis.Arc.Core` | `22.75.0` | Composition, ASP.NET hosting and standalone host |
21
+ | `Cratis.Arc.Chronicle`, `Cratis.Arc.MongoDB`, `Cratis.Arc.EntityFrameworkCore` | `22.75.0` | Optional client/storage integrations |
22
+ | `Cratis.Arc.Screenplay.Embedded` | `22.75.0` | Optional embedded event-model explorer |
23
+
24
+ Source verification at [Arc v22.75.0](https://github.com/Cratis/Arc/tree/v22.75.0/Source/DotNET).
25
+ Reverify signatures at the consumer's tag before claiming another version.
26
+
27
+ ## Choose one bootstrap
28
+
29
+ | Setup | Configure before Build | Activate after Build |
30
+ | --- | --- | --- |
31
+ | ASP.NET, full event-sourced stack (`Cratis`) | `builder.AddCratis(...)` | `app.UseCratis()` |
32
+ | ASP.NET, Arc only (`Cratis.Arc`) | `builder.AddCratisArc(...)` | `app.UseCratisArc()` |
33
+ | Standalone HTTP host (`Cratis.Arc.Core`) | `ArcApplication.CreateBuilder(args)`, then `builder.AddCratisArc(...)` | `app.UseCratisArc()` |
34
+
35
+ Full-stack ASP.NET bootstrap (requires the `Cratis` package and configured
36
+ Chronicle connection; it deliberately does not opt into unsigned headers):
37
+
38
+ ```csharp
39
+ // Copyright (c) Cratis. All rights reserved.
40
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
41
+
42
+ using Microsoft.AspNetCore.Builder;
43
+
44
+ var builder = WebApplication.CreateBuilder(args);
45
+ builder.AddCratis();
46
+ var app = builder.Build();
47
+ app.UseCratis();
48
+ app.Run();
49
+ ```
50
+
51
+ `AddCratis` composes Arc, `WithChronicle` and the Microsoft Identity Platform
52
+ header scheme. For your own authentication use `AddCratisArc` plus
53
+ `WithChronicle`, not `AddCratis`. For Arc without event sourcing use
54
+ `AddCratisArc` and your storage/services. On the standalone host the listen URL
55
+ comes from `ArcOptions.Hosting.ApplicationUrl`, not an argument to `UseCratisArc`.
56
+ Read [integrations and publish boundaries](references/integrations-and-publish.md)
57
+ when selecting storage, disabling MVC, adding generated JSON contracts, or
58
+ configuring the explorer.
59
+
60
+ ## Keep trust and discovery explicit
61
+
62
+ - Forwarded identity headers are ignored by default. Set
63
+ `Cratis:Arc:TrustForwardedIdentityHeaders=true` only behind an authenticating,
64
+ header-stripping ingress that prevents direct backend access. `AddCratis`
65
+ registering a scheme does not make the headers trusted.
66
+ - Discovery is anonymous only in Development by default. Elsewhere it requires
67
+ authentication, or is unmapped (404) if the host cannot authenticate.
68
+ `Introspection.RequireAuthentication` unset chooses that default; assigning
69
+ false deliberately exposes it everywhere. `Roles` implies authentication and
70
+ cannot combine with false. Disable both `Introspection.Enabled` and
71
+ `Introspection.IdentityDiscovery` to remove all discovery; `/.cratis/me` remains.
72
+ - `/.cratis/me` uses the authenticated principal, not a readable identity cookie.
73
+ Configure a real authentication mechanism before treating protected endpoints
74
+ as usable. See `cratis-arc-authentication-authorization-and-identity` for the
75
+ full ingress, identity and authorization contract.
76
+
77
+ Source: [secure defaults at v22.75.0](https://github.com/Cratis/Arc/blob/v22.75.0/Documentation/upgrading/secure-defaults.mdx).
78
+
79
+ ## Verify the host, not just the compilation
80
+
81
+ 1. Build in the actual shipping configuration and publish mode, zero warnings.
82
+ 2. Start against the intended Chronicle/storage services. Confirm activation
83
+ maps one intended command and query; a successful Build alone proves neither.
84
+ 3. Exercise anonymous and authenticated requests in Development and Production.
85
+ Check discovery switches and protected invocation independently.
86
+ 4. For trimmed/NativeAOT output, run that published binary and exercise JSON
87
+ responses (including each `CommandResult<TResponse>`), not only an untrimmed
88
+ Debug host. Missing metadata or service support is a failed publish check.
89
+ 5. Confirm MVC and the embedded explorer are absent wherever they are not intended.
90
+
91
+ ## Route near misses
92
+
93
+ - Define the command and its proxy: `cratis-arc-command`.
94
+ - EF schema/migrations: `cratis-arc-ef-core-migration`.
95
+ - Authentication and identity: `cratis-arc-authentication-authorization-and-identity`.
96
+ - A standalone Chronicle client or running store: the Chronicle client/CLI skills.
@@ -0,0 +1,80 @@
1
+ # Integrations and publish boundaries
2
+
3
+ <!-- Copyright (c) Cratis. All rights reserved. -->
4
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
5
+
6
+ Verified at **Arc v22.75.0**. These are host configuration fragments, not a claim
7
+ that any arbitrary application is NativeAOT-compatible.
8
+
9
+ ## Storage and Chronicle
10
+
11
+ `AddCratisArc(configureOptions: ..., configureBuilder: ...)` separates
12
+ `ArcOptions` from the `IArcBuilder`. With the corresponding packages referenced,
13
+ the builder supports `WithChronicle`, `WithMongoDB` and `WithEntityFrameworkCore`.
14
+ `AddCratis` instead names these arguments `configureArcOptions` and
15
+ `configureArcBuilder` and composes Chronicle for you. Do not activate/register the
16
+ same stack twice.
17
+
18
+ - `WithChronicle` installs the Chronicle client integration, including tenant
19
+ namespace resolution, command returned-event handling and read-model access.
20
+ The server and its credentials/connection belong to deployment configuration.
21
+ - `WithMongoDB` configures Arc's MongoDB storage/query integration.
22
+ - `WithEntityFrameworkCore` registers the application's EF integration; use the
23
+ EF migration skill for the actual context/provider/migration setup.
24
+
25
+ Source signatures under `Source/DotNET`:
26
+ [Cratis composition](https://github.com/Cratis/Arc/blob/v22.75.0/Source/DotNET/Cratis/WebApplicationBuilderExtensions.cs),
27
+ [ASP.NET builder](https://github.com/Cratis/Arc/blob/v22.75.0/Source/DotNET/Arc/WebApplicationBuilderExtensions.cs),
28
+ [Core builder](https://github.com/Cratis/Arc/blob/v22.75.0/Source/DotNET/Arc.Core/ArcApplicationBuilderExtensions.cs),
29
+ [Chronicle integration](https://github.com/Cratis/Arc/blob/v22.75.0/Source/DotNET/Chronicle/ArcBuilderExtensions.cs),
30
+ [MongoDB integration](https://github.com/Cratis/Arc/blob/v22.75.0/Source/DotNET/MongoDB/ArcBuilderExtensions.cs).
31
+
32
+ ## MVC and NativeAOT
33
+
34
+ For runtime-only removal of MVC, use this ASP.NET configuration excerpt:
35
+
36
+ ```csharp
37
+ builder.AddCratisArc(configureBuilder: arc => arc.WithoutControllers());
38
+ ```
39
+
40
+ Model-bound command/query endpoints still work. Controller commands/queries and
41
+ `MapControllers` do not. Runtime removal alone cannot tell the trimmer to remove
42
+ MVC. For trimming/NativeAOT set the application MSBuild feature switch:
43
+
44
+ ```xml
45
+ <PropertyGroup>
46
+ <CratisArcControllersSupport>false</CratisArcControllersSupport>
47
+ </PropertyGroup>
48
+ ```
49
+
50
+ The switch also turns controllers off without `WithoutControllers()`. Arc
51
+ registers the ASP.NET services it previously got through MVC (including CORS,
52
+ endpoint API exploration and authorization). Do not infer that every provider,
53
+ serializer or dependency is trim-safe just because MVC is off.
54
+ [Controller boundary](https://github.com/Cratis/Arc/blob/v22.75.0/Source/DotNET/Arc/ControllersArcBuilderExtensions.cs).
55
+
56
+ ## Application JSON metadata
57
+
58
+ `ArcOptions.AddJsonTypeInfoResolver(IJsonTypeInfoResolver)` puts application
59
+ contracts ahead of Arc's defaults. Supply your source-generated
60
+ `JsonSerializerContext.Default` during configuration, before serialization makes
61
+ options read-only. Include the read models, query arguments and responses the
62
+ application serializes, and **each** `CommandResult<TResponse>` used for typed
63
+ command responses. Arc's own context cannot enumerate your generic responses.
64
+ Reflection fallback only exists when reflection-based serialization is enabled.
65
+ [Resolver contract](https://github.com/Cratis/Arc/blob/v22.75.0/Source/DotNET/Arc.Core/ArcOptions.cs).
66
+
67
+ ## Optional event-model viewer
68
+
69
+ `Cratis.Arc.Screenplay.Embedded` supplies
70
+ `services.AddCratisEventModelViewer(...)` and
71
+ `endpoints.MapCratisEventModel(params Assembly[] assemblies)` (a
72
+ `RouteGroupBuilder`, allowing explicit host authorization). It exposes
73
+ `/.cratis/event-model`. Automatic exposure defaults to an unoptimized Debug entry
74
+ assembly **and** Development; explicit `Enabled=true` overrides that default.
75
+ Do not enable the explorer in a deployed environment accidentally. Mapping it
76
+ manually needs an intentional host policy, not an assumption of automatic gating.
77
+ The Screenplay family owns generated-model content and compiler capability.
78
+ Sources: [viewer registration](https://github.com/Cratis/Arc/blob/v22.75.0/Source/DotNET/Screenplay.Embedded/Hosting/EventModelViewerServiceCollectionExtensions.cs),
79
+ [mapping](https://github.com/Cratis/Arc/blob/v22.75.0/Source/DotNET/Screenplay.Embedded/Hosting/EventModelEndpoints.cs),
80
+ [automatic exposure](https://github.com/Cratis/Arc/blob/v22.75.0/Source/DotNET/Screenplay.Embedded/Hosting/EventModelViewerExposure.cs).
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: cratis-arc-identity-and-tenancy-kotlin
3
+ description: Wire Kotlin or Java Arc authentication, application identity details and tenant resolution — AuthenticationHandler, IdentityDetailsProvider, tenancy.required, resolver precedence, ambient coroutine tenancy and the opt-in trusted platform-header bridge. Use for JVM Arc identity endpoints, tenant isolation or security ingress setup. Do not use for C# Arc identity, command input validation, or standalone Chronicle namespace resolution.
4
+ license: MIT
5
+ ---
6
+
7
+ <!-- Copyright (c) Cratis. All rights reserved. -->
8
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
9
+
10
+ # Resolve identity and tenancy in JVM Arc
11
+
12
+ Authentication identifies the caller; authorization decides whether they may
13
+ execute an operation; tenant resolution selects their data boundary. Configure
14
+ and verify all three separately. A tenant header alone proves no membership.
15
+
16
+ ## Verified product sources
17
+
18
+ Verified at `Arc.Kotlin v7.7.0`: `Source` authentication/identity/tenancy contracts,
19
+ `Integrations/SpringBoot/ArcTenancyProperties.java`, platform security classes,
20
+ `Documentation/guides/security.mdx`, `ambient-tenancy.mdx` and
21
+ `reference/configuration.mdx`. Use `io.cratis:arc-spring-boot-starter:7.7.0`
22
+ (or `io.cratis:cratis:7.7.0` for Chronicle integration), with matching plugin/KSP.
23
+ These are JVM contracts; do not infer the same switches exist in Arc .NET.
24
+
25
+ ## Authenticate and expose identity details
26
+
27
+ Register ordered `AuthenticationHandler` beans. A handler gets immutable
28
+ `AuthenticationRequestContext`: case-insensitive headers, cookies, captured
29
+ principal and selected tenant. Return:
30
+
31
+ - `AuthenticationResult.ANONYMOUS` when credentials are not recognized, so the
32
+ next handler can try.
33
+ - `AuthenticationResult.failed(...)` for recognized but rejected credentials.
34
+ - `AuthenticationResult.succeeded(...)` with an `ArcPrincipal` on success.
35
+
36
+ Success and failure are terminal; a later handler cannot override a rejection.
37
+ Spring interleaves Kotlin handlers and Java `AsyncAuthenticationHandler` beans
38
+ in global `@Order`. Java handlers return `CompletionStage`, which Arc adapts.
39
+ Do not block while verifying credentials. Public authentication errors are
40
+ generic 401 responses, not the handler's private reason.
41
+
42
+ With Spring Security present, Arc captures its principal before suspending
43
+ work. `ROLE_` authorities become unprefixed Arc roles. Without it, Arc captures
44
+ the servlet principal. Never read thread-local security state after suspension.
45
+
46
+ Register exactly one `IdentityDetailsProvider<T>` to serve `GET /.cratis/me`.
47
+ Supply `detailsType: Class<T>` and return `IdentityDetails<T>` from
48
+ `provide(IdentityProviderContext)`, including `isUserAuthorized` and the
49
+ application payload. Use a concrete DTO KSP can describe; an unsupported
50
+ identity shape fails `ARCKSP0307`. Java uses `AsyncIdentityDetailsProvider<T>`.
51
+ Multiple providers fail startup. The client-readable identity cache cookie is
52
+ excluded from authentication input and cannot authenticate a later request.
53
+
54
+ `@Authorize`, `@Roles`, `@AllowAnonymous` declare authorization. An operation's
55
+ own metadata replaces its class default wholesale; contradictions on the same
56
+ declaration fail `ARCKSP0108`. See `cratis-arc-command-kotlin` for precedence.
57
+
58
+ ## Configure inbound tenant resolution
59
+
60
+ Keys below are under `cratis.arc`:
61
+
62
+ | Key | Default / contract |
63
+ | --- | --- |
64
+ | `tenancy.resolvers` | `header`; ordered `fixed`, `header`, `query`, `claim`, `subdomain`, `development` |
65
+ | `tenancy.required` | `false`; true rejects unresolved command, query, observable and identity requests with 400 |
66
+ | `tenancy.header-name` | unset uses `tenant-header` (default `x-cratis-tenant-id`); case-insensitive |
67
+ | `tenancy.query-parameter-name` | `tenantId`; case-sensitive |
68
+ | `tenancy.claim-type` | `tenant_id` |
69
+ | `tenancy.base-domain` | empty; subdomain resolution needs a valid multi-label DNS base domain |
70
+ | `tenancy.fixed-tenant-id` | `development` |
71
+ | `tenancy.constrain-to-authenticated-claims` | `true`; when membership claims exist, selection must match one |
72
+
73
+ Keep claim constraints on. Absence of membership claims is not proof the caller
74
+ belongs to every tenant; add the application authorization policy required by
75
+ your domain. Do not expose development/fixed selection as production isolation.
76
+ `TenantsProvider` lists development tenants for tools; it does not resolve a request.
77
+
78
+ Resolution is not storage routing. Plain repository injection is ordinary
79
+ Spring DI, not automatic tenant isolation. Use certified tenant-aware store
80
+ resolvers and test two-tenant isolation; `cratis-arc-spring-data-kotlin` covers
81
+ the storage boundary. Chronicle namespace mapping is a separate integration concern.
82
+
83
+ ## Carry an already resolved tenant
84
+
85
+ `withTenant(TenantId(...))` installs a `TenantCoroutineContext` that survives
86
+ suspension and dispatcher switches. `currentTenant()` returns the nearest
87
+ tenant or `null`; `currentTenantOrNotSet()` returns `TenantId.NOT_SET` when absent.
88
+ Nested scopes shadow the outer tenant for their duration. These functions do
89
+ not resolve HTTP requests or authorize a tenant.
90
+
91
+ Java on a plain thread uses `TenantContextBridge.withTenant` and
92
+ `TenantContextBridge.currentTenant()`. The bridge blocks through `runBlocking`;
93
+ do not call it inside an active coroutine. Kotlin coroutine code uses the
94
+ suspending APIs, not a `ThreadLocal`. Establish scopes explicitly for background
95
+ work; do not assume an inbound request or command establishes every ambient seam.
96
+
97
+ ## Opt into trusted platform headers only behind secure ingress
98
+
99
+ `cratis.arc.platform-identity.enabled` defaults to `false`. Base64 is unsigned
100
+ input, not authentication. Enable the bridge only behind authenticated ingress
101
+ that strips caller-supplied `x-ms-client-principal`,
102
+ `x-ms-client-principal-id`, `x-ms-client-principal-name` and rewrites them from
103
+ verified identity. Block direct backend access.
104
+
105
+ Supply an `ArcPlatformIdentityTrust` bean checking the actual deployment
106
+ boundary on every submission; the default denies all. Do not trust forwarded
107
+ headers or an address a request wrapper rewrote without verified proxy handling.
108
+ Header parsing cannot install firewall, TLS or ingress guarantees.
109
+
110
+ With Spring Security absent or the bridge disabled, Arc registers no platform
111
+ filter/chain. With no application chain, enabling it creates a conservative
112
+ chain: all routes need authentication and CSRF remains enabled. Arc does not
113
+ rewrite an application `SecurityFilterChain`; add `ArcPlatformAuthenticationFilter`
114
+ after existing authentication and before `AnonymousAuthenticationFilter` only
115
+ in chains intended to accept platform identity. Keep servlet registration
116
+ disabled to prevent double execution outside Spring Security.
117
+
118
+ Valid submissions never replace an already authenticated non-anonymous identity.
119
+ Invalid/partial/repeated submissions fail generically with 401 (earlier filters
120
+ may reject first). The bridge retains identity in request attributes, not the
121
+ HTTP session. Never log identity headers, raw claims or the cache cookie.
122
+ Consult the tagged security guide for the bounded header schema and limits
123
+ before changing an ingress adapter; do not hand-roll permissive parsing.
124
+
125
+ ## Verify and route
126
+
127
+ - Test the resolver order, missing tenant, membership mismatch and valid selection
128
+ with `withTenantResolution` in `cratis-arc-testing-kotlin`.
129
+ - Exercise anonymous, accepted and rejected credentials plus identity-details
130
+ authorization; do not mistake a successful details response for authentication.
131
+ - Verify tenant propagation across a dispatcher switch and two isolated stores.
132
+ - If enabling platform identity, test spoofed/direct submissions fail, legitimate
133
+ ingress succeeds, CSRF remains enforced, and the filter runs once.
134
+ - Run the application's `./gradlew build` and real storage/ingress checks.
135
+
136
+ Command rules: `cratis-arc-validation-kotlin`. Standalone Chronicle namespaces:
137
+ `cratis-chronicle-client-kotlin`, not this resolver configuration.
@@ -13,7 +13,7 @@ request is made. Choose the transport first, then the command.
13
13
 
14
14
  | Package | Version | Purpose |
15
15
  | --- | --- | --- |
16
- | `Cratis.Arc.Core` | `22.16.0` | `ObservableQueryHttp`, `ObservableQueryHandler`, the demultiplexer routes |
16
+ | `Cratis.Arc.Core` | `22.75.0` | `ObservableQueryHttp`, `ObservableQueryHandler`, the demultiplexer routes |
17
17
 
18
18
  > Re-verified at the versions above by **symbol and signature**: every type, attribute and member this skill names exists at that tag, and the public surface it describes is unchanged since the previous verification (Chronicle 16.45.x / Arc 22.10.4 — the Chronicle 16→18 client diff is converters, options and doc comments; no type was removed or renamed). Behavior claims were verified at the earlier tag unless a section says otherwise.
19
19
 
@@ -119,6 +119,23 @@ inconvenient — a proxy that buffers, a client with no streaming support.
119
119
  authorization and the `Count()` a paged query performs. Long polling a hot query
120
120
  is not free.
121
121
 
122
+ ## Diagnosis and emission protection (Arc v22.75.0)
123
+
124
+ Plain HTTP snapshots/waits/long polls run read-model interceptors and
125
+ `IGuardObservableQueryEmission`: denied data returns unauthorized; suppressed
126
+ emissions remain 202 until an allowed value (or the wait deadline). Failures
127
+ respect `ExposeExceptionDetails`. `IAsyncEnumerable` plain-query requests still
128
+ return 400; do not assume every streaming return shape works on snapshot HTTP.
129
+
130
+ For a MongoDB-backed query stuck at Loading with no first result, check database
131
+ connectivity, replica-set change-stream support and permissions first (Arc#2916).
132
+ The collection watch logs failure then completes without `OnError`; frontend
133
+ error UI is not reliable evidence the watch is healthy. A waiting HTTP request
134
+ still has its timeout/completion contract; do not describe it as an infinite wait.
135
+ Sources at v22.75.0: `Arc.Core/Queries/ObservableQueryHttp.cs`,
136
+ `ObservableQueryHandler.cs` and
137
+ [MongoDB observations](https://github.com/Cratis/Arc/blob/v22.75.0/Documentation/backend/csharp/mongodb/observing-collections.md).
138
+
122
139
  ## What comes back
123
140
 
124
141
  Every transport carries the same `QueryResult` shape:
@@ -130,7 +147,8 @@ paging { page, size, totalItems, totalPages }, changeSet?
130
147
  ```
131
148
 
132
149
  `data` is the full snapshot. `changeSet` may also be present for collection
133
- updates, carrying `added`, `replaced` and `removed`.
150
+ updates, carrying `added`, `replaced` and `removed`. Items without `Id` use
151
+ full snapshots; `IHaveKnownChanges` supports known-change collection results.
134
152
 
135
153
  Paging and sorting keys work here too: `page`, `pageSize`, `sortby`,
136
154
  `sortDirection`. `pageSize` is what enables paging at all, and `page` is
@@ -12,14 +12,13 @@ static (Java) methods are queries. KSP generates a reflection-free
12
12
 
13
13
  ## Verified product sources
14
14
 
15
- Verified against `Arc.Kotlin` at tag **`v7.3.0`**, re-verified at commit
16
- `d0aa6a4` (14 commits past the tag), documented consumer setup: JDK 17,
17
- Kotlin 2.4.20, KSP 2.3.12, Spring Boot 4.1.x. `io.cratis:arc` supplies
15
+ Verified against `Arc.Kotlin` at tag **`v7.7.0`**: JDK 17, Gradle 8.14.4,
16
+ Kotlin 2.4.20, KSP 2.3.12, Spring Boot 4.1.1, JUnit Jupiter 6.1.3. `io.cratis:arc` supplies
18
17
  `io.cratis.arc.artifacts.ReadModel`, `io.cratis.arc.queries.Path`,
19
18
  `@QueryHttpMethod`, `@QueryTransport`, `ObservableState<T>`. The optional
20
19
  `arc-rxjava3` artifact adds RxJava 3 `Observable` support at runtime. The
21
- re-verification added `ObservableState<T>` (new since the tag) and the
22
- `observable-queries.allowed-origins` WebSocket setting — both covered below.
20
+ `queries/QueryPage.kt`, `QueryRendererFor.kt` and the observable pipeline
21
+ verify the paging and transport contracts below.
23
22
 
24
23
  ## Declare a one-shot query
25
24
 
@@ -115,7 +114,16 @@ needed for these:
115
114
  - RxJava 3 `Observable<T>` / `ObservableSource<T>` / `Subject<T>` — requires
116
115
  the optional `arc-rxjava3` artifact at runtime
117
116
 
118
- A one-shot return (`T`, `List<T>`, `Page<T>`) stays request-response.
117
+ A one-shot return (`T`, `List<T>`, `io.cratis.arc.queries.QueryPage<T>`) stays
118
+ request-response. `QueryPage(items, page, pageSize, totalItems)` carries a
119
+ provider-owned page, with zero-based page and `totalItems: Long`.
120
+
121
+ A matching application `QueryRendererFor<T>` chain owns data and paging:
122
+ Arc does not append implicit in-memory sorting/paging after it. Return
123
+ `QueryPage<T>` or include `QueryableQueryRenderer()` explicitly in that chain.
124
+ `QueryPaging.UNPAGED` and `QuerySorting.UNSORTED` represent no paging/sorting;
125
+ `InterceptReadModel<T>` is the read-model interception seam. The default
126
+ in-memory sorter reads public properties only; sorting is not authorization.
119
127
 
120
128
  ```kotlin
121
129
  @ReadModel
@@ -201,10 +209,20 @@ Leave it empty in a real deployment — the WebSocket handshake is not subject
201
209
  to the same-origin policy `fetch` obeys, so this setting is what stops another
202
210
  site from opening a socket carrying your visitor's cookies.
203
211
 
212
+ ## Storage-backed queries
213
+
214
+ For repository-backed paging, concept converters, tenant-aware storage and
215
+ Mongo/JPA observable snapshots, use `cratis-arc-spring-data-kotlin`.
216
+ Arc `7.7.0` also aligns Chronicle projection collection names with Arc MongoDB;
217
+ read [../cratis-arc-command-kotlin/references/read-model-naming.md](../cratis-arc-command-kotlin/references/read-model-naming.md)
218
+ when upgrading or customizing collection names.
219
+
204
220
  ## Route near misses
205
221
 
206
222
  - Defining or changing a `@Command`: `cratis-arc-command-kotlin`.
207
223
  - Adding a query-argument rejection rule: `cratis-arc-validation-kotlin`.
224
+ - In-process query specifications: `cratis-arc-testing-kotlin`.
225
+ - Identity or tenant resolution: `cratis-arc-identity-and-tenancy-kotlin`.
208
226
  - How events populate the read model in the first place (Chronicle projections
209
227
  and reducers): `cratis-chronicle-client-kotlin`, `cratis-chronicle-projection`,
210
228
  `cratis-chronicle-reducer`.
@@ -223,3 +241,5 @@ site from opening a socket carrying your visitor's cookies.
223
241
  - A `delta`-mode observable query has a stable item identity, not incidental
224
242
  reliance on serialized-JSON fallback identity.
225
243
  - `./gradlew build` is clean with zero warnings and zero errors.
244
+ - Use `QueryScenario` or bounded `ObservableQueryScenario.collect` from
245
+ `cratis-arc-testing-kotlin`; assert emission count, not only success.