@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
@@ -15,47 +15,44 @@ HTTP and never sees this package.
15
15
 
16
16
  | Pitfall | Why it bites |
17
17
  | --- | --- |
18
- | Naming a reactor method after the handler's purpose | Dispatch is by the camelCase event class name; a mismatch is silently never called |
18
+ | Naming a reactor method after the handler's purpose | Use the camelCase event class name or explicit `@handles(EventType)` |
19
19
  | `instanceof` on the event inside a handler | It is a `JSON.parse`d plain object, not your class |
20
- | Event class with no default constructor values under `tsx` | No decorator metadata is emitted, so the schema comes out empty |
20
+ | Event fields with no `@field` types under `tsx` | No type metadata is emitted; unresolved members make registration fail |
21
21
  | Two `@eventType()` classes sharing a class name | The id defaults to the class name and they collide |
22
- | Deploying compiled `dist/*.js` with default discovery | The default glob matches `**/*.ts`; nothing is discovered |
22
+ | Deploying compiled `dist/*.js` with default discovery | Compiled-JS entries do not scan; import artifact modules explicitly |
23
23
  | Omitting a side-effect import of an artifact module | Its decorator never runs, so it is never registered |
24
24
  | Forgetting `import 'reflect-metadata'` at the entry point | Decorators do not work at runtime |
25
25
  | Forgetting to install `@cratis/fundamentals` | It is a peer dependency and is not installed for you |
26
26
  | Importing `ChronicleConnectionString` | There is no `./connection` export; pass a string |
27
- | Expecting single `append()` to set a stream or subject | Those fields are hardcoded; use the `EventForEventSourceId[]` overload |
27
+ | Carrying a pre-6.0 stream forward | Pass all three route dimensions explicitly; omitted routes now resolve to `Default`/`All`/`Default` |
28
28
  | A connection string with no credentials | Silently falls back to the development client credentials |
29
29
  | Shipping the default TLS behavior | `skipTlsValidation` defaults to `true` |
30
- | Constructor-injecting a dependency into a reactor | There is no DI; the client constructs it |
31
- | Carrying a `3.x` example forward | Tags, the reducer context parameter, and two RPC names changed in `4.0.0` |
30
+ | Constructor-injecting without an `artifactActivator` | By default the client constructs the artifact itself |
31
+ | Side-effect reactor without `@onceOnly()` | Reactors run again on kernel replay by default since 6.9.0 |
32
32
  | Reading `result.sequenceNumber` as a number | It is a `bigint` behind `.value` |
33
33
  | A `@globalFor` mapping targeting a property one variant lacks | `GlobalHandlerPropertyNotOnVariant` when the group is built, not a silently skipped mapping |
34
34
  | Expecting a `@globalFor`-only class to appear as a projection | It is never registered on its own; it is merged into its variants |
35
35
 
36
36
  ## Verified product sources
37
37
 
38
- This skill was written against `Cratis/Chronicle.TypeScript` at tag `v4.0.0`
39
- (commit `bed0b86`) and re-verified at **`v5.1.0`** (published on npm as
40
- `5.1.0`): every class, function and option this skill names exists there. The
41
- `4→5` major is the Chronicle 17/18 wire migration (internal gRPC shapes; it adds
42
- `ensureCommandResponse` for server-side command results). The `file:line`
43
- citations below were taken at `v4.0.0` and may have shifted.
38
+ Verified against `Cratis/Chronicle.TypeScript` tag **`v6.51.0`**, reading
39
+ `Source/**` and `Documentation/getting-started.md`, `testing.md`,
40
+ `migrate-append-routing.md` and `reactors.md`. Source paths below refer to that tag.
44
41
 
45
42
  | Package | Version | Where |
46
43
  | --- | --- | --- |
47
- | `@cratis/chronicle` | `5.1.0` | npm; `Source/package.json` carries a `1.0.0` placeholder |
48
- | `@cratis/chronicle.contracts` | `18.2.0` | `Source/package.json` dependency at `v5.1.0` |
49
- | `@cratis/fundamentals` | `^7.14.0` | **peer dependency** — you install it |
44
+ | `@cratis/chronicle` | `6.51.0` | npm; `Source/package.json` carries a `1.0.0` placeholder |
45
+ | `@cratis/chronicle.contracts` | `19.31.10` | Client's pinned dependency, not the latest contracts package |
46
+ | `@cratis/fundamentals` | `^7.22.4` | **peer dependency** — you install it |
50
47
 
51
48
  > **Do not read the version out of the repository.** `Source/package.json` says
52
49
  > `1.0.0`; `publish-version.js` overwrites it at publish time. Take the version
53
50
  > from npm.
54
51
 
55
- **`v4.0.0` is a major bump and it changed real API.** Guidance written against
56
- `3.x` is wrong in at least three places — event tags did not exist, reducers took
57
- two arguments, and two event-store RPCs were renamed. Do not carry `3.x` examples
58
- forward.
52
+ **Upgrade the kernel first.** The 5.x→6.0.0 migration changes omitted append
53
+ routes and requires compatibility checks (kernel 18.4.1+); registered event
54
+ sources introduced in 6.49.0 require kernel 19.30+. Reactors replay by default
55
+ since 6.9.0, so review side-effect handlers when upgrading.
59
56
 
60
57
  ## Project setup
61
58
 
@@ -64,27 +61,31 @@ yarn add @cratis/chronicle @cratis/fundamentals reflect-metadata
64
61
  ```
65
62
 
66
63
  `@cratis/fundamentals` is a peer dependency, so it does not arrive on its own.
67
- `reflect-metadata` must be imported **once, at the entry point**, before any
68
- decorated class is loaded (`Documentation/getting-started.md:16-27`):
64
+ `reflect-metadata` is now a regular dependency. Import it **once, at the entry
65
+ point**, before any decorated class is loaded:
69
66
 
70
67
  ```typescript
71
68
  import 'reflect-metadata';
72
69
  ```
73
70
 
74
- The package is **ESM-only** (`"type": "module"`, `Source/package.json:34`) and
75
- requires decorator support:
71
+ The package is **ESM-only** and needs Node.js **22.19+** for its `undici`
72
+ dependency (the client itself has no `engines` field). Standard TC39 decorators
73
+ are supported (TypeScript 5.2+) and are the documentation default:
76
74
 
77
75
  ```jsonc
78
- // tsconfig.json
76
+ // tsconfig.json — standard decorator mode
79
77
  {
80
78
  "compilerOptions": {
81
- "experimentalDecorators": true,
82
- "emitDecoratorMetadata": true
79
+ "target": "ES2022",
80
+ "lib": ["ES2022", "ESNext.Decorators"]
83
81
  }
84
82
  }
85
83
  ```
86
84
 
87
- Both are set in the shipped sample (`Samples/Console/tsconfig.json:12-13`).
85
+ Legacy mode with `experimentalDecorators: true` and
86
+ `emitDecoratorMetadata: true` still works. Standard decorators and esbuild/tsx
87
+ emit no type metadata: declare every serialized property with `@field(Type)`
88
+ from `@cratis/fundamentals`; default values are only an inference fallback.
88
89
 
89
90
  ## Connecting
90
91
 
@@ -101,41 +102,35 @@ try {
101
102
  }
102
103
  ```
103
104
 
104
- `IChronicleClient` is four members — `Source/IChronicleClient.ts:16-39`:
105
-
106
- | Member | Line |
107
- | --- | --- |
108
- | `readonly options: ChronicleOptions` | `:18` |
109
- | `getEventStore(name, namespace?): Promise<IEventStore>` | `:27` |
110
- | `getEventStores(): Promise<EventStoreName[]>` | `:33` |
111
- | `dispose(): void` | `:38` |
105
+ `IChronicleClient` (`Source/IChronicleClient.ts`) exposes `readonly options`,
106
+ `getEventStore(name, namespace?): Promise<IEventStore>`,
107
+ `getEventStores(): Promise<EventStoreName[]>`, and `dispose(): void`.
112
108
 
113
109
  `ChronicleClient`'s constructor takes exactly one argument —
114
- `constructor(readonly options: ChronicleOptions)`, `Source/ChronicleClient.ts:58`.
110
+ `constructor(readonly options: ChronicleOptions)` (`Source/ChronicleClient.ts`).
115
111
 
116
112
  **Connecting is implicit and lazy.** There is no `connect()`. The constructor
117
113
  starts a health-check watchdog and kicks off artifact discovery; the actual
118
114
  connect happens on the first `getEventStore`/`getEventStores` through an internal
119
115
  `ensureConnected()`. `getEventStore` also *creates* the store if it does not
120
- exist — it calls `ensureEventStore` (`Source/ChronicleClient.ts:135`).
116
+ exist — it calls `ensureEventStore`.
121
117
 
122
- `dispose()` is **synchronous** (`Source/ChronicleClient.ts:193`), not
118
+ `dispose()` is **synchronous**, not
123
119
  `Symbol.dispose` or `Symbol.asyncDispose`. After disposal every call throws.
124
120
 
125
121
  ### Options
126
122
 
127
- `ChronicleOptions` has a **private constructor**
128
- (`Source/ChronicleOptions.ts:67`); use a static factory:
129
-
130
- - `ChronicleOptions.fromConnectionString(connectionString, options?)` — `:92`
131
- - `ChronicleOptions.development(options?)` — `:116`
123
+ `ChronicleOptions` has a **private constructor** (`Source/ChronicleOptions.ts`);
124
+ use `ChronicleOptions.fromConnectionString(connectionString, options?)` or
125
+ `ChronicleOptions.development(options?)`.
132
126
 
133
- The optional bag accepts `clientArtifactsProvider`, `discoveryPatterns`, and
134
- `defaultSinkTypeId`. `defaultSinkTypeId` defaults to `WellKnownSinks.MongoDB`
135
- (`:84`).
127
+ The optional bag accepts `telemetry`, `logger`, `clientArtifactsProvider`,
128
+ `discoveryPatterns`, `defaultSinkTypeId`, `reactorResultHandler`,
129
+ `artifactActivator`, and `readModelNamingPolicy`. `defaultSinkTypeId` defaults
130
+ to `WellKnownSinks.MongoDB`.
136
131
 
137
132
  > `programIdentifier`, `softwareVersion`, and `softwareCommit` exist on the type
138
- > (`:69-71`) but **neither public factory forwards them**, so they cannot be set.
133
+ > but **neither public factory forwards them**, so they cannot be set.
139
134
  > Do not write guidance that configures them.
140
135
 
141
136
  ### The connection string
@@ -151,7 +146,7 @@ Two facts to carry into production guidance:
151
146
  is not validated, because a development kernel serves a self-signed
152
147
  certificate. Set `?skipTlsValidation=false` against a real server.
153
148
  - **A connection string with no credentials silently falls back to the
154
- development client credentials** (`Source/connection/ChronicleConnection.ts:319-326`; the constants live in `ChronicleConnectionString.ts:453-454`).
149
+ development client credentials** (`Source/connection/ChronicleConnection.ts`).
155
150
  An anonymous-looking connection string is not anonymous; it is
156
151
  `chronicle-dev-client`.
157
152
 
@@ -167,55 +162,51 @@ The subpath exports that do exist: `.`, `./events`, `./eventSequences`,
167
162
  `./seeding`, `./readModels`, `./projections`, `./jobs`, `./webhooks`,
168
163
  `./externalServices`, `./identities`, `./observation`, `./sinks`, `./schemas`,
169
164
  `./types`, `./artifacts`, `./identity`, `./auditing`, `./correlation`,
170
- `./transactions`.
165
+ `./transactions`, `./confidentiality`, `./patterns`, `./testing`, and
166
+ `./package.json`. Event-source APIs are root exports; there is no
167
+ `./eventSources` subpath. `IncompatibleChronicleServer` and
168
+ `RejectedChronicleCredentials` are also root exports.
171
169
 
172
170
  ## Event types
173
171
 
174
172
  ```typescript
173
+ // Excerpt: replace the domain placeholders with your event and value types.
174
+ import { field } from '@cratis/fundamentals';
175
175
  import { eventType } from '@cratis/chronicle';
176
176
 
177
177
  @eventType()
178
178
  export class <EventName> {
179
- constructor(readonly <property>: <Type> = <default>) {}
179
+ @field(<RuntimeType>) <property>: <Type>;
180
+ constructor(<property>: <Type>) { this.<property> = <property>; }
180
181
  }
181
182
  ```
182
183
 
183
- Seven overloads — `Source/events/eventTypeDecorator.ts:54-60`:
184
-
185
- ```typescript
186
- export function eventType(): ClassDecorator;
187
- export function eventType(id: string): ClassDecorator;
188
- export function eventType(id: string, generation: number): ClassDecorator;
189
- export function eventType(id: string, generation: number, tombstone: boolean): ClassDecorator;
190
- export function eventType(generation: number): ClassDecorator;
191
- export function eventType(generation: number, tombstone: boolean): ClassDecorator;
192
- export function eventType(tombstone: boolean): ClassDecorator;
193
- ```
184
+ `eventType` supports no args, `id`, `id/generation`, `id/generation/tombstone`,
185
+ `generation`, `generation/tombstone`, or `tombstone`
186
+ (`Source/events/eventTypeDecorator.ts`); both decorator modes work.
194
187
 
195
188
  **The event type id defaults to the class name** — `new EventTypeId(id || constructor.name)`
196
- at `:91`. Two classes with the same name in different modules collide on the wire.
189
+ in the decorator. Two classes with the same name in different modules collide
190
+ on the wire.
197
191
 
198
- **Give constructor parameters default values.** Member discovery walks explicit
199
- `@field` declarations from `@cratis/fundamentals` first, then tracked properties,
200
- then the properties present on a *default-constructed* instance, then
201
- `design:paramtypes` — `Source/types/TypeIntrospector.ts:52-60`, with the reason
202
- spelled out at `:40-48`: **esbuild and tsx do not emit `design:type` or
203
- `design:paramtypes`**. Under `tsx`, a class whose constructor parameters have no
204
- defaults and no `@field` decorators produces no members and an empty schema. Every
205
- sample event carries defaults for exactly this reason.
192
+ **Use explicit `@field` declarations.** `Source/types/TypeIntrospector.ts` checks
193
+ field metadata before inference from tracked properties, default-constructed
194
+ instances and legacy metadata. Use `@field(Array, { genericArguments: [Item] })`
195
+ for typed arrays; concepts need `static readonly valueType`. A property the
196
+ client cannot type makes registration fail — do not rely on constructor-only
197
+ properties under standard decorators or tsx.
206
198
 
207
- Tag an event type at declaration with `@tag(...)` / `@tags(...)` —
208
- `Source/events/tagDecorator.ts:30`, `:42`.
199
+ Tag an event type at declaration with `@tag(...)` / `@tags(...)`.
209
200
 
210
201
  ## Appending
211
202
 
212
203
  `IEventLog` is an empty extension of `IEventSequence`
213
- (`Source/eventSequences/IEventLog.ts:10`); the surface is on `IEventSequence`:
204
+ (`Source/eventSequences/IEventLog.ts`); the surface is on `IEventSequence`:
214
205
 
215
206
  ```typescript
216
- append(eventSourceId: string, event: object, options?: AppendOptions): Promise<AppendResult>; // :44
217
- appendMany(eventSourceId: string, events: object[], options?: AppendOptions): Promise<AppendResult[]>; // :53
218
- appendMany(events: EventForEventSourceId[], options?: AppendOptions): Promise<AppendResult[]>; // :61
207
+ append(eventSourceId: string, event: object, options?: AppendOptions): Promise<AppendResult>;
208
+ appendMany(eventSourceId: string, events: object[], options?: AppendOptions): Promise<AppendResult[]>;
209
+ appendMany(events: EventForEventSourceId[], options?: AppendOptions): Promise<AppendResult[]>;
219
210
  ```
220
211
 
221
212
  ```typescript
@@ -227,22 +218,25 @@ if (!result.isSuccess) {
227
218
 
228
219
  - **The event source id is a plain `string`.** There is no `EventSourceId` value
229
220
  type at this boundary.
230
- - `AppendResult` — `Source/eventSequences/AppendResult.ts:15-38`: `sequenceNumber`,
231
- `constraintViolations`, `concurrencyViolation?`, `errors`, `isSuccess`, and
232
- `waitForCompletion(timeoutMs?)` which defaults to 5000 ms.
221
+ - `AppendResult` (`Source/eventSequences/AppendResult.ts`): `sequenceNumber`,
222
+ `constraintViolations` (including the constraint name), `concurrencyViolation?`,
223
+ `errors`, `isSuccess`, and `waitForCompletion({ timeoutMs, signal }?)`
224
+ (timeout defaults to 5000 ms).
233
225
  - **`sequenceNumber` wraps a `bigint`.** Read it as `result.sequenceNumber.value`.
234
226
  `EventContext.sequenceNumber` is a `bigint` too.
235
- - `AppendOptions` — `Source/eventSequences/AppendOptions.ts`: `correlationId?`,
236
- `eventSourceId?`, `concurrencyScope?`, `concurrencyScopes?`, and **`tags?`**
237
- (`:22-29`, since `4.0.0`; unchanged at `5.1.0`).
238
-
239
- > **Single `append()` cannot target a stream or a subject.** It hardcodes
240
- > `EventSourceType: 'Default'`, `EventStreamType: 'Default'`,
241
- > `EventStreamId: eventSourceId`, and `Subject: eventSourceId`
242
- > (`Source/eventSequences/EventSequence.ts:100-120`). Only `tags` became a real
243
- > option in `4.0.0` (`:118`). To target a different stream or subject, use the
244
- > `EventForEventSourceId[]` overload, whose entries carry `eventStreamType`,
245
- > `eventStreamId`, `eventSourceType`, `subject`, and `tags`.
227
+ - `AppendOptions` (`Source/eventSequences/AppendOptions.ts`): `correlationId`,
228
+ `sourceType`, `streamType`, `streamId`, `subject`, `occurred`, `tags`, `namedTags`,
229
+ `concurrencyScope`, `concurrencyScopes`, `eventSource`, and `eventStream`.
230
+ The reserved legacy `eventSourceId` option does not override the method's id.
231
+
232
+ **Single `append()` supports routing and subject options.** Since 6.0.0 an
233
+ unspecified route is omitted on the wire; the kernel resolves source `Default`,
234
+ stream type `All`, stream id `Default`. Subject precedence is the explicit option,
235
+ then the event's `@subject()` property, then its event source id.
236
+
237
+ To continue a pre-6.0 stream, pass **all three** dimensions explicitly:
238
+ `{ sourceType: 'Default', streamType: 'Default', streamId: id }`.
239
+ See `Documentation/migrate-append-routing.md` at the verified tag.
246
240
 
247
241
  Correlation id, identity, and the causation chain are picked up from the ambient
248
242
  module-level managers (`identityProvider`, `causationManager`,
@@ -257,37 +251,32 @@ await unitOfWork.commit();
257
251
  ```
258
252
 
259
253
  `ITransactionalEventSequence` returns `Promise<void>`, not an `AppendResult`;
260
- results are on the unit of work.
254
+ results are on the unit of work. Since 6.51.0 transactional appends retain
255
+ routing, subject, occurrence, tags and concurrency scopes in enrollment order;
256
+ conflicting scopes for one source throw `ConflictingConcurrencyScopesInUnitOfWork`
257
+ before enrollment.
261
258
 
262
259
  ## Observing
263
260
 
264
- ### Handlers are found by camelCase method name
265
-
266
- This is the defining convention of this client, and it is **not** the parameter
267
- type. `Source/reactors/Reactors.ts:378-381` computes the method name from the
268
- event class name and looks it up on the prototype:
261
+ ### Handlers use camelCase names or `@handles(EventType)`
269
262
 
270
- ```typescript
271
- const className = (eventTypeClass as Function).name;
272
- const methodName = className.charAt(0).toLowerCase() + className.slice(1);
273
-
274
- if (typeof proto[methodName] === 'function') { /* it is a handler */ }
275
- ```
263
+ The default is the camelCase event class name, **not** parameter-type dispatch.
264
+ An unmatched name is simply never called. Reactors and reducers also support
265
+ `@handles(EventType)` on a public instance method: one handler per event;
266
+ a reactor handler cannot combine it with `@replay`.
276
267
 
277
- Reducers do the same (`Source/reducers/Reducers.ts:454-460`). A handler whose
278
- method name does not match is simply never called — **there is no error**.
279
-
280
- > The docstring at `Source/reactors/reactor.ts:28-29` claims dispatch is by the
281
- > first parameter's type. **It is wrong**, and it is still wrong at `5.1.0`. The
282
- > code is the authority; so are the client snippets under `Documentation/`, which
283
- > state the name rule explicitly.
268
+ **Reactors replay by default since 6.9.0.** Use class `@onceOnly()` (not inherited)
269
+ or method `@onceOnly()` for effects that must not run on replay; `@replay(EventType)`
270
+ provides a separate replay handler. This never prevents failed-partition
271
+ redelivery or proves exactly-once effects.
284
272
 
285
273
  ```typescript
286
- import { reactor } from '@cratis/chronicle/reactors';
274
+ import { onceOnly, reactor } from '@cratis/chronicle/reactors';
287
275
  import { EventContext, EventForEventSourceId } from '@cratis/chronicle';
288
276
 
289
277
  @reactor()
290
278
  export class <ReactorName> {
279
+ @onceOnly()
291
280
  async <eventName>(event: <EventName>, context: EventContext): Promise<EventForEventSourceId> {
292
281
  return {
293
282
  eventSourceId: '<other-event-source-id>',
@@ -300,24 +289,25 @@ export class <ReactorName> {
300
289
  A returned event, array, or `EventForEventSourceId` is appended as a side effect;
301
290
  a failed side-effect append fails the partition.
302
291
 
303
- > **The handler receives `JSON.parse(event.Content)` — a plain object, not an
304
- > instance of your event class** (`Source/reactors/Reactors.ts:297`, `:320`;
305
- > `Source/reducers/Reducers.ts:377`). `instanceof` checks and methods on the event
306
- > class do not work. Read properties only.
292
+ Reactor arguments are `(event, context, services, delivery)`
293
+ (`Source/reactors/ReactorDispatcher.ts`). `ReactorServices` exposes
294
+ `{ eventStore, readModels, signal }` for the observation's owning store/namespace.
295
+ `ReactorDelivery` supplies an idempotency identity, not an exactly-once guarantee.
296
+
297
+ > **Event content is parsed JSON, not an instance of your event class.**
298
+ > `instanceof` checks and event methods do not work. Read properties only.
307
299
 
308
- `@reducer(id?, eventSequenceId?, readModel?, isActive?)` —
309
- `Source/reducers/reducer.ts:58`. Passing `readModel` also registers that type as a
310
- read model. **The reducer handler takes three arguments (`4.0.0` through `5.1.0`)** —
311
- `reducerInstance[methodName](content, currentState, context)`
312
- (`Source/reducers/Reducers.ts:400`). The third is optional by arity, and a handler
313
- may be sync or async.
300
+ `@reducer(id?, eventSequenceId?, readModel?, isActive?)` also registers the supplied
301
+ read model type. Reducers receive `(content, currentState, context)` and may be
302
+ sync or async.
314
303
 
315
- Restrict an observer to tagged events with `@filterEventsByTag(value)` —
316
- `Source/events/filterEventsByTagDecorator.ts:36`.
304
+ Filter with `@filterEventsByTag(value)`, `@eventSourceType(...)`, or
305
+ `@eventStreamType(...)`. `reactorResultHandler` handles application-owned returns.
317
306
 
318
307
  ### Read models and projections
319
308
 
320
- Read models are read through `store.readModels`; projections are model-bound (decorators) or declarative (`@projection`), and constraints are class-plus-builder only.
309
+ Read through `store.readModels`; projections are model-bound (decorators) or
310
+ fluent (`@projection`). Constraints use `@unique`/`@removeConstraint` or a builder.
321
311
 
322
312
  Read [references/read-models-and-projections.md](references/read-models-and-projections.md) when reading a read model instance, choosing a projection style, or declaring a constraint.
323
313
 
@@ -327,23 +317,18 @@ One entity with mutually exclusive lifecycle shapes is modeled as variants, with
327
317
 
328
318
  Read [references/variants.md](references/variants.md) when a read model for one entity changes shape over its lifecycle, or when you meet `VariantMustDeclareEntersOnEvent` or `GlobalHandlerPropertyNotOnVariant`.
329
319
 
330
- ## Discovery is a runtime file glob — this is the biggest difference
331
-
332
- `ChronicleOptions.discoveryPatterns` defaults to
333
- `['**/*.ts', '!**/*.d.ts', '!**/node_modules', '!**/dist', '!**/build', '!**/.git', '!**/.vscode', '!**/*.spec.ts', '!**/*.test.ts']`
334
- (`Source/ChronicleOptions.ts:73-83`), and the client `import()`s every matching
335
- file at construction time so that the decorators run. Registration is into a
336
- process-wide static map.
320
+ ## Artifact discovery
337
321
 
338
- Two consequences that decide whether an application works at all:
322
+ `ChronicleOptions.discoveryPatterns` defaults to `**/*.ts` and `**/*.tsx` only
323
+ for TypeScript entries (`.ts/.tsx/.mts/.cts`), Vitest, or tsx/ts-node/type-stripping
324
+ loader arguments. It excludes declaration files, `node_modules`, `dist`, `build`,
325
+ `.git`, `.vscode`, and `*.spec/test.ts(x)` (`Source/ChronicleOptions.ts`).
339
326
 
340
- 1. **The default pattern matches `.ts`, not `.js`.** It works under a
341
- TypeScript-capable runtime — the sample runs `tsx index.ts` — and a compiled
342
- `dist/*.js` deployment discovers **nothing** unless `discoveryPatterns` is
343
- overridden.
344
- 2. **Decorators only register when their module is imported.** Side-effect imports
345
- of event, reactor, reducer, and projection modules are load-bearing; the sample
346
- does exactly this with a comment saying why.
327
+ **A compiled-JS entry defaults to `[]`.** Decorators register when their module is
328
+ imported, so side-effect imports of artifacts remain load-bearing in production.
329
+ Explicit patterns always win; `[]` disables scanning. The client imports matching
330
+ files at construction; failed imports name the file. Registration uses a
331
+ process-wide static map.
347
332
 
348
333
  `EventStore.registerArtifacts()` registers event types first, then everything else
349
334
  in parallel, and re-runs for every cached event store on reconnect.
@@ -359,32 +344,56 @@ in parallel, and re-runs for every cached event store on reconnect.
359
344
  - Failed operations are retried once after reconnecting, keyed on gRPC status
360
345
  codes 4/13/14 plus a substring match over the error text.
361
346
 
362
- > **The client version reported to the kernel is a hardcoded `'1.0.0'`** with a
363
- > TODO — `Source/ChronicleClient.ts:429`, alongside `ClientType: 'TypeScript'`
364
- > (`:434`). The Chronicle 17 server-side compatibility check therefore sees a
365
- > placeholder from this client, and grepping `Source/` for `CheckCompatibility`,
366
- > `ProtocolVersion`, or descriptor-set handling finds nothing. **Do not tell
367
- > developers this client negotiates protocol compatibility** — it does not.
347
+ The client reports its **installed package version**, read from
348
+ `@cratis/chronicle/package.json`, and performs `CheckCompatibility` with
349
+ `ProtocolVersion` and the contracts descriptor set before a connection is usable
350
+ and before event-sequence calls. `IncompatibleChronicleServer` is a permanent
351
+ verdict, not retried (`Source/connection/CompatibilityPreflight.ts`).
352
+ Three consecutive credential rejections cause `RejectedChronicleCredentials`.
353
+ A failed token request is logged and the call proceeds without a token (allowing
354
+ an auth-less kernel); tokens come from the selected server, not the first host.
355
+
356
+ Since 6.43.0 built-in spans use `cratis.chronicle.client.*` and scope
357
+ `Cratis.Chronicle.Client`; metrics use seconds. Legacy millisecond metrics and
358
+ `chronicle.*` attributes are retired except the retained exact-string
359
+ `chronicle.sequence_number`. Historical constants, `ChronicleMetrics`, and
360
+ `telemetry.spanNames` are deprecated; migrate dashboards.
368
361
 
369
- ## No dependency injection
362
+ ## Artifact activation
370
363
 
371
- There is none, and none is planned in the source: no container integration, no
372
- `addChronicle`-style registration. Reactors, reducers, projections, constraints,
373
- and seeders are instantiated by the client itself, so **constructor injection does
374
- not work**. Use module-scope collaborators, as the shipped sample does.
364
+ There is no built-in container. By default the client constructs artifacts.
365
+ For reactor/reducer constructor dependencies supply `artifactActivator` in
366
+ `ChronicleOptions`: activation is per delivered batch and can implement
367
+ `ActivatedArtifact.run/complete/dispose` around handlers and returned effects.
368
+
369
+ ## Testing without a kernel
370
+
371
+ Read [references/testing.md](references/testing.md) when specifying appends,
372
+ reactors or read models with `EventScenario`, `ReactorScenario`, or
373
+ `ReadModelScenario`. Unsupported shapes fail explicitly; they need kernel tests.
374
+
375
+ ## More surface
376
+
377
+ | Need | Public surface and boundary |
378
+ | --- | --- |
379
+ | Registered sources/streams | Root `@eventSource`, repeatable `@eventStream`, `ConcurrencyDimensions`, `store.eventSources`; append `eventSource/eventStream`. Kernel 19.30+; see `Source/eventSources/` |
380
+ | Named tags | `namedTags` on appends; batches cannot combine them with registered event sources |
381
+ | Personal data and retained secrets | `@pii`, `@subject`, `store.pii`; `@encrypted` with `EncryptionScope` from `./confidentiality`; release through `readModels.release*`. Never combine PII/encrypted or put either on `eventSourceId` |
382
+ | Subject migration | Subject uses `@subject()` since 6.41.1; earlier appended events used the source id for protection keys |
383
+ | Operational catalogs | `store.observers` (list/remove), `store.patterns`; mutations need authority |
384
+ | Diagnostics/privacy | `ChronicleOptions.telemetry` and per-client `logger`; source ids are omitted by default, raw/HMAC recording is opt-in |
375
385
 
376
386
  ## Verify
377
387
 
378
388
  - The installed version is the one you intended, taken from npm, and
379
389
  `@cratis/fundamentals` is installed alongside it.
380
390
  - `reflect-metadata` is imported exactly once, at the entry point.
381
- - `experimentalDecorators` and `emitDecoratorMetadata` are both on.
382
- - Every event class either has `@field` declarations or default constructor
383
- values, and its schema is non-empty at runtime.
384
- - `discoveryPatterns` matches the files that actually ship in the deployed
385
- artifact.
386
- - Every reactor and reducer handler is named as the exact camelCase of its event
387
- class, and an appended event demonstrably reaches it.
391
+ - Decorator mode is consistent: standard mode uses explicit `@field` types;
392
+ legacy mode uses `experimentalDecorators` with `emitDecoratorMetadata`.
393
+ - Every serialized property has a runtime type and a non-empty schema.
394
+ - Compiled-JS deployments import artifacts, or configure explicit discovery.
395
+ - Every handler uses exact camelCase naming or `@handles(EventType)`, and an
396
+ appended event demonstrably reaches it; side-effect replay policy is explicit.
388
397
  - A production connection string carries credentials and `skipTlsValidation=false`.
389
398
  - `client.dispose()` runs on shutdown.
390
399
  - Every variant group has at least one `@entersOn`/`entersOn(...)` per variant,
@@ -1,14 +1,30 @@
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
+
1
4
  ## Read models and projections
2
5
 
3
- `store.readModels` — `Source/readModels/IReadModels.ts`: `getInstanceById(type, key, sessionId?)`
4
- (`:38`), `getInstances(type, eventCount?)` (`:46`), `getSnapshotsById` (`:54`),
5
- `watch(type): AsyncIterable<ReadModelChangeset<T>>` (`:61`), plus `materialized`
6
- for paged access.
6
+ Verified at `Cratis/Chronicle.TypeScript` **v6.51.0**:
7
+ `Source/readModels/IReadModels.ts`, `indexDecorator.ts`,
8
+ `Source/projections/modelBound/**`, `declarative/**`, and
9
+ `Source/events/constraints/**`.
10
+
11
+ `store.readModels` exposes:
7
12
 
8
- Two projection styles:
13
+ | API | Meaning |
14
+ | --- | --- |
15
+ | `getInstanceById(type, key, sessionId?)` | Canonical, not deprecated. An empty missing document yields a prototype-only instance; JSON null may construct default fields |
16
+ | `findInstanceById(type, key, sessionId?)` | Returns **null when absent**; use for existence decisions |
17
+ | `getInstances(type, eventCount?)`, `getSnapshotsById(type, key)` | Instances and snapshots; `materialized` offers paged sink access |
18
+ | `watch(type)` | Async iterable, opens on first `next()`; no empty initial changeset |
19
+ | `createWatcher(type, options?)` | Starts immediately, exposes readiness and disposal, opt-in resume and overflow-failure limit. Resumption does not replay outage gaps |
20
+ | `register()` / `register(type)` | Register discovered models or one type |
21
+ | `release`, `releaseMany`, `releaseDocument` | Release protected values through Chronicle |
22
+ | `dehydrateSession` | Dehydrate a read-model session |
23
+
24
+ ### Projection styles
9
25
 
10
26
  - **Model-bound** — decorators on the read model, from
11
- `@cratis/chronicle/projections`: `fromEvent`, `fromEvery`, `fromAll`, `setFrom`,
27
+ `@cratis/chronicle/projections`: `fromEvent`, `fromEvery`, `setFrom`,
12
28
  `setFromContext`, `setValue`, `join`, `addFrom`, `subtractFrom`, `increment`,
13
29
  `decrement`, `count`, `childrenFrom`, `nested`, `clearWith`, `removedWith`,
14
30
  `removedWithJoin`, `noAutoMap`, `notRewindable`, `passive`.
@@ -16,8 +32,35 @@ Two projection styles:
16
32
  implementing `IProjectionFor<TReadModel>` with
17
33
  `define(builder: IProjectionBuilderFor<TReadModel>): void`.
18
34
 
19
- Constraints are `@constraint()` on a class implementing `IConstraint` with a
20
- `define(builder)`; the builder gives `unique(...)`, `uniqueFor(...)`,
21
- `perEventSourceType`, `perEventStreamType`, `perEventStreamId`. **There are no
22
- model-bound constraint decorators in this client** — the class-plus-builder form
23
- is the only one.
35
+ Chronicle's `@readModel()` is deprecated since 6.7.0: infer the read model from
36
+ mappings or the type supplied to projection/reducer registration. A custom id
37
+ uses `static readonly readModelId = 'custom-id'`. This does **not** deprecate
38
+ Arc's separate `@readModel()` query marker.
39
+
40
+ - `@index()` from `@cratis/chronicle/readModels` declares an ascending, non-unique
41
+ property index, including dotted nested/typed-collection paths.
42
+ - `@childrenFrom(Event, { childType, key, identifiedBy, parentKey })` supplies
43
+ typed children and their keys. Use `@noAutoMap` on children/nested properties
44
+ when explicit mappings should replace AutoMap.
45
+ - `@fromAllEvents` / fluent `fromAll()` subscribe to every event type.
46
+ `@fromEvery` maps only already-subscribed events; `@fromAll` is its deprecated
47
+ restricted-mapping alias, **not** all-event subscription.
48
+ - Composite key parts can use `set(target).toEventContextProperty(...)`,
49
+ `.toEventSourceId()`, or `.toValue(...)`; `usingKeyFromContext(...)` selects a
50
+ context key.
51
+ - `ChronicleOptions.readModelNamingPolicy` changes the storage container name,
52
+ not the model id. Align it with Arc MongoDB's naming policy when integrating;
53
+ Arc's `withMongoDB` + Arc-owned `withChronicle` do this by default.
54
+
55
+ ### Append-time constraints
56
+
57
+ `@unique()` and repeatable `@removeConstraint(name)` are exported from
58
+ `@cratis/chronicle` and `@cratis/chronicle/events` since 6.8.0.
59
+ `@unique(name?, message?)` or `@unique({ name, message, eventSequences })`
60
+ marks a property unique across sources, or a class unique per source.
61
+ Same-named declarations merge; conflicting scopes throw.
62
+
63
+ Use `@constraint()` plus `IConstraint.define(builder)` for composite, scoped,
64
+ case-insensitive or multi-type rules. The builder offers `unique(...)`,
65
+ `uniqueFor(...)`, `perEventSourceType`, `perEventStreamType`, and
66
+ `perEventStreamId`. These protect appends, not command pre-validation.