@cratis/pi 7.51.3 → 7.51.5
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.
- package/package/corpus/harnesses/copilot/instructions/authoring-skills.instructions.md +1 -1
- package/package/corpus/rules/authoring-skills.md +1 -1
- package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +4 -55
- package/package/corpus/skills/cratis-application-slice-specifications/references/command-result-assertions.md +36 -0
- package/package/corpus/skills/cratis-application-slice-specifications/references/reading-play-specifications.md +30 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/SKILL.md +4 -69
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authentication.md +8 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authorization.md +9 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/frontend.md +19 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/identity-endpoints.md +40 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/local-development.md +7 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/product-sources.md +11 -0
- package/package/corpus/skills/cratis-arc-command/SKILL.md +8 -99
- package/package/corpus/skills/cratis-arc-command/references/causation-details.md +26 -0
- package/package/corpus/skills/cratis-arc-command/references/client-contract.md +16 -0
- package/package/corpus/skills/cratis-arc-command/references/event-source-id-details.md +13 -0
- package/package/corpus/skills/cratis-arc-command/references/generation-boundaries.md +8 -0
- package/package/corpus/skills/cratis-arc-command/references/product-sources.md +16 -0
- package/package/corpus/skills/cratis-arc-command/references/provide-example.md +19 -0
- package/package/corpus/skills/cratis-arc-command/references/proxy-generation.md +8 -0
- package/package/corpus/skills/cratis-arc-command/references/return-shape-examples.md +24 -0
- package/package/corpus/skills/cratis-arc-command-kotlin/SKILL.md +3 -61
- package/package/corpus/skills/cratis-arc-command-kotlin/references/artifacts.md +16 -0
- package/package/corpus/skills/cratis-arc-command-kotlin/references/authorization-override-example.md +17 -0
- package/package/corpus/skills/cratis-arc-command-kotlin/references/project-setup.md +40 -0
- package/package/corpus/skills/cratis-arc-command-typescript/SKILL.md +4 -105
- package/package/corpus/skills/cratis-arc-command-typescript/references/parameter-binding.md +26 -0
- package/package/corpus/skills/cratis-arc-command-typescript/references/project-setup.md +89 -0
- package/package/corpus/skills/cratis-arc-query-typescript/SKILL.md +3 -74
- package/package/corpus/skills/cratis-arc-query-typescript/references/product-sources.md +11 -0
- package/package/corpus/skills/cratis-arc-query-typescript/references/scenario-example.md +23 -0
- package/package/corpus/skills/cratis-arc-query-typescript/references/storage-examples.md +52 -0
- package/package/corpus/skills/cratis-arc-react-page/SKILL.md +3 -63
- package/package/corpus/skills/cratis-arc-react-page/references/data-page.md +28 -0
- package/package/corpus/skills/cratis-arc-react-page/references/dialogs.md +47 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/SKILL.md +3 -80
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/connection-options.md +61 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/lifecycle.md +30 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/SKILL.md +8 -101
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/client-options.md +43 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/idioms-and-inspection.md +35 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/product-sources.md +10 -0
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/reactor-example.md +33 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/SKILL.md +7 -88
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/annotations-and-handlers.md +32 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/append-concurrency.md +9 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/connection-string.md +27 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/event-type-annotations.md +9 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/product-sources.md +13 -0
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/read-models-and-projections.md +29 -0
- package/package/corpus/skills/cratis-chronicle-client-typescript/SKILL.md +3 -103
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/connection-options.md +52 -0
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/lifecycle.md +31 -0
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/project-setup.md +36 -0
- package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +1 -21
- package/package/corpus/skills/cratis-chronicle-projection/references/definition-changes.md +27 -0
- package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +5 -110
- package/package/corpus/skills/cratis-chronicle-reactor/references/cross-service-events.md +13 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/filtering.md +34 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/read-model-injection.md +29 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/return-event-metadata.md +51 -0
- package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +7 -92
- package/package/corpus/skills/cratis-chronicle-reducer/references/filtering.md +36 -0
- package/package/corpus/skills/cratis-chronicle-reducer/references/instance-reducer-example.md +20 -0
- package/package/corpus/skills/cratis-chronicle-reducer/references/product-sources.md +8 -0
- package/package/corpus/skills/cratis-chronicle-reducer/references/replay-hooks-and-definition-changes.md +35 -0
- package/package/corpus/skills/cratis-chronicle-reducer/references/specification-example.md +15 -0
- package/package/corpus/skills/cratis-components-styling/SKILL.md +1 -15
- package/package/corpus/skills/cratis-components-styling/references/renderer-adapters.md +21 -0
- package/package/corpus/skills/cratis-governed-release-methodology/SKILL.md +1 -24
- package/package/corpus/skills/cratis-governed-release-methodology/references/lifecycle-phases.md +30 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +2 -15
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/neighbouring-skills.md +12 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/product-sources.md +11 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +3 -93
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/capture-map-and-example.md +37 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/trigger-declaration.md +48 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/trigger-reads-example.md +16 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +5 -97
- package/package/corpus/skills/cratis-screenplay-command-surface/references/compliance.md +9 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/constraints-produces-concurrency.md +89 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/routes-and-external-operations.md +21 -0
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +5 -38
- package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +14 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/neighbouring-skills.md +14 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +9 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/product-sources.md +16 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +6 -74
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/facilitation-stance.md +12 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/file-layout.md +19 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/modeling-reasoning.md +13 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/neighbouring-skills.md +16 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +33 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/provenance.md +6 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +2 -17
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +12 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/interview-findings.md +18 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/neighbouring-skills.md +12 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +5 -89
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +6 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/layout.md +30 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/repairs.md +42 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/state-and-recovery.md +30 -0
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +10 -42
- package/package/corpus/skills/cratis-screenplay-model-review/references/baseline-comparison.md +7 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +11 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/interview-batch.md +14 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/model-inventory-report.md +8 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/neighbouring-skills.md +12 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +21 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +15 -68
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/completeness-self-check.md +12 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +15 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/identity-and-edits.md +9 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/independent-review.md +10 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/neighbouring-skills.md +10 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/per-turn-protocol.md +5 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/product-sources.md +9 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/safety.md +12 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +25 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +8 -0
- package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +3 -67
- package/package/corpus/skills/cratis-screenplay-projections/references/joins.md +41 -0
- package/package/corpus/skills/cratis-screenplay-projections/references/variants.md +41 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +3 -31
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +9 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/neighbouring-skills.md +11 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/product-sources.md +23 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +11 -75
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/interview-batch.md +16 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/neighbouring-skills.md +10 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/public-event-coverage.md +12 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/quality-checklist.md +17 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/review-questions.md +9 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +28 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/version-skew.md +14 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +18 -94
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +25 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +9 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/identity-edits.md +14 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/model-reasoning.md +9 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/neighbouring-skills.md +10 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/product-sources.md +9 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/public-boundaries-and-keys.md +16 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +36 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +17 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +5 -63
- package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +6 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/outcome-comparison.md +33 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/vocabulary.md +40 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +11 -77
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +21 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +18 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/interview-batch.md +20 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/neighbouring-skills.md +12 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/product-sources.md +12 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/review-questions.md +13 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-id-rules.md +15 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +1 -8
- package/package/corpus/skills/cratis-screenplay-toolchain/references/neighbouring-skills.md +12 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +6 -99
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/file-references.md +38 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/layout-arrangement.md +31 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/localized-strings.md +15 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +6 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/ui-profile-and-theme.md +34 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +1 -10
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/neighbouring-skills.md +14 -0
- package/package.json +1 -1
|
@@ -86,31 +86,7 @@ or string dependencies after the event: use context, a read model or a service.
|
|
|
86
86
|
|
|
87
87
|
The first parameter must carry `[EventType]` (CHR0005 error).
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
A read-model parameter is materialized using the event context's event-source id
|
|
92
|
-
by default. When the model's key differs from the triggering event's source —
|
|
93
|
-
the event carries a related entity's id — implement `ICanResolveReadModelKey` on
|
|
94
|
-
the reactor:
|
|
95
|
-
|
|
96
|
-
```csharp
|
|
97
|
-
public class <ReactorName> : IReactor, ICanResolveReadModelKey
|
|
98
|
-
{
|
|
99
|
-
public ReadModelKey Resolve(object @event, EventContext context) =>
|
|
100
|
-
((<EventName>)@event).<RelatedIdProperty>;
|
|
101
|
-
|
|
102
|
-
public Task <MethodName>(<EventName> @event, <ReadModelName> <readModel>) =>
|
|
103
|
-
Task.CompletedTask;
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
The resolved key applies to every read-model parameter on the reactor.
|
|
108
|
-
|
|
109
|
-
Materialized models are as current as their observer. `[Passive]` computes
|
|
110
|
-
on demand without a sink when the reactor needs a current read.
|
|
111
|
-
|
|
112
|
-
Prefer the event's own data. CHR0032 warns against injected storage primitives such as `IMongoCollection<T>`;
|
|
113
|
-
read keyed state through read-model parameters or `IReadModels.GetInstanceById`.
|
|
89
|
+
A materialized read-model parameter is only as current as its observer; prefer the event's own data, and use `[Passive]` when the reactor needs a current read. Read [references/read-model-injection.md](references/read-model-injection.md) whenever a reactor injects a read model: how it is keyed (including a related entity's key through `ICanResolveReadModelKey`), when it is current, and which storage access CHR0032 flags.
|
|
114
90
|
|
|
115
91
|
## Return types
|
|
116
92
|
|
|
@@ -134,53 +110,7 @@ restricted to `Task<T>`. An unclaimed return value **fails the partition** with
|
|
|
134
110
|
return type at build time. Source: `Reactors/EventHandlerMethods.cs`,
|
|
135
111
|
`Reactors/SideEffects/IReactorSideEffectHandler.cs`, `Reactors/UnhandledReactorReturnValue.cs`.
|
|
136
112
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Return events rather than inject `IEventLog`: **a convention, not an analyzer
|
|
140
|
-
contract**. Returned appends stay inside Chronicle's transaction.
|
|
141
|
-
|
|
142
|
-
```csharp
|
|
143
|
-
// One event, on the triggering event's own event source.
|
|
144
|
-
public Task<<ResultEvent>> <MethodName>(<EventName> @event, EventContext context) =>
|
|
145
|
-
Task.FromResult(new <ResultEvent>(@event.<Property>));
|
|
146
|
-
|
|
147
|
-
// Several events on that same event source.
|
|
148
|
-
public Task<IEnumerable<object>> <MethodName>(<EventName> @event, EventContext context) =>
|
|
149
|
-
Task.FromResult<IEnumerable<object>>([new <ResultEvent>(), new <OtherEvent>()]);
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Targeting another event source
|
|
153
|
-
|
|
154
|
-
`Cratis.Chronicle.EventSequences.EventForEventSourceId(eventSourceId, @event,
|
|
155
|
-
causation)` is the cross-stream wrapper. Its init members include `Subject`,
|
|
156
|
-
`Occurred`, `Tags`, `EventSource` (`Type?`) and `EventStream` (`string?`). Routing
|
|
157
|
-
defaults are `EventStreamType.All`, `EventStreamId.Default` and
|
|
158
|
-
`EventSourceType.Default`. Source: `EventSequences/EventForEventSourceId.cs`.
|
|
159
|
-
|
|
160
|
-
```csharp
|
|
161
|
-
public Task<IEnumerable<EventForEventSourceId>> <MethodName>(<EventName> @event, EventContext context) =>
|
|
162
|
-
Task.FromResult<IEnumerable<EventForEventSourceId>>(
|
|
163
|
-
[
|
|
164
|
-
new(@event.<RelatedId>, new <ResultEvent>(@event.<Property>)),
|
|
165
|
-
new(@event.<OtherId>, new <OtherEvent>()) { EventStreamType = new("<stream-type>") },
|
|
166
|
-
]);
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
It also carries `IEnumerable<NamedTag> NamedTags` (snapshotted on assignment).
|
|
170
|
-
It does **not** carry an
|
|
171
|
-
event sequence id; side effects are appended to the event log.
|
|
172
|
-
|
|
173
|
-
### Where the metadata for a bare event comes from
|
|
174
|
-
|
|
175
|
-
For a **bare** event return, Chronicle resolves the append metadata from the
|
|
176
|
-
reactor itself: the `[EventSourceType]`, `[EventStreamType]`, and
|
|
177
|
-
`[EventStreamId]` attributes, and the `ICanProvideEventSourceId`,
|
|
178
|
-
`ICanProvideEventStreamId`, and `ICanProvideSubject` interfaces (all in
|
|
179
|
-
`Cratis.Chronicle.Events`, each with one method).
|
|
180
|
-
|
|
181
|
-
An `EventForEventSourceId` is **self-describing** — reactor-level metadata is not
|
|
182
|
-
applied to it. In a mixed collection, bare items get the reactor metadata and
|
|
183
|
-
wrapper items keep their own.
|
|
113
|
+
Read [references/return-event-metadata.md](references/return-event-metadata.md) when returning events instead of injecting `IEventLog`, targeting another event source with `EventForEventSourceId`, or controlling the append metadata of a returned event.
|
|
184
114
|
|
|
185
115
|
## Replay
|
|
186
116
|
|
|
@@ -251,46 +181,11 @@ event types, then the event log.
|
|
|
251
181
|
exception. All of a reactor's event types must come from one event store —
|
|
252
182
|
analyzer **CHR0008** (error).
|
|
253
183
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
Cross-service facts route through the outbox and inbox rather than a shared log.
|
|
257
|
-
The producer appends its public contract event to the outbox sequence; the
|
|
258
|
-
consuming observer listens on the implicit inbox sequence for the source store.
|
|
259
|
-
Chronicle creates or reuses that subscription from the observer's `[EventStore]`
|
|
260
|
-
metadata, or from `[EventStore]` on the event type or its assembly. Put
|
|
261
|
-
`[assembly: EventStore("<source-store>")]` in a contracts project when every
|
|
262
|
-
event there originates from one service.
|
|
184
|
+
Read [references/cross-service-events.md](references/cross-service-events.md) when consuming events from another service through the inbox and outbox.
|
|
263
185
|
|
|
264
|
-
## Filtering
|
|
265
|
-
|
|
266
|
-
| Attribute | Effect |
|
|
267
|
-
| --- | --- |
|
|
268
|
-
| `[FilterEventsByTag("<tag>")]` | **filters** by appended tag; repeatable, and any one match admits the event |
|
|
269
|
-
| `[EventSourceType("<value>")]` | **filters** by the appended event source type |
|
|
270
|
-
| `[EventStreamType("<value>")]` | **filters** by the appended event stream type |
|
|
271
|
-
| `[FromEventSource<TSource>("<stream>")]` | **filters** by a declared event source and stream (`Cratis.Chronicle.EventSources`) |
|
|
272
|
-
| `[EventStreamId("<value>")]` | **does not filter**; it is append metadata for side effects |
|
|
273
|
-
| `[Tag]`, `[Tags]` | **label** the reactor; they never filter |
|
|
274
|
-
|
|
275
|
-
Filter categories combine with AND; tags within the tag category combine with OR.
|
|
276
|
-
Typed source filters work on reactors and reducers, not projections (CHR0041).
|
|
277
|
-
CHR0055 flags unknown streams; CHR0056 flags routing that contradicts the filter.
|
|
278
|
-
Filters survive catch-up, replay and failed-partition recovery.
|
|
279
|
-
`WaitForCompletion` excludes nonmatching observers when the .NET client supplies
|
|
280
|
-
its first appended sequence number.
|
|
281
|
-
These correspond to metadata supplied at append time:
|
|
282
|
-
|
|
283
|
-
```csharp
|
|
284
|
-
await eventStore.EventLog.Append(
|
|
285
|
-
<eventSourceId>,
|
|
286
|
-
new <EventName>(<arguments>),
|
|
287
|
-
eventStreamType: "<stream-type>",
|
|
288
|
-
eventSourceType: "<source-type>",
|
|
289
|
-
tags: ["<tag>"]);
|
|
290
|
-
```
|
|
186
|
+
## Filtering
|
|
291
187
|
|
|
292
|
-
|
|
293
|
-
selection, a reactor or a reducer is where it happens.
|
|
188
|
+
Read [references/filtering.md](references/filtering.md) when restricting which events reach a reactor by tag, event source type, stream type or declared source; `[EventStreamId]` does not filter, and a projection cannot be filtered at all.
|
|
294
189
|
|
|
295
190
|
## Invoking a command from a reactor
|
|
296
191
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Cross-service events
|
|
2
|
+
|
|
3
|
+
This reference holds the outbox and inbox routing for cross-service facts.
|
|
4
|
+
|
|
5
|
+
### Cross-service events
|
|
6
|
+
|
|
7
|
+
Cross-service facts route through the outbox and inbox rather than a shared log.
|
|
8
|
+
The producer appends its public contract event to the outbox sequence; the
|
|
9
|
+
consuming observer listens on the implicit inbox sequence for the source store.
|
|
10
|
+
Chronicle creates or reuses that subscription from the observer's `[EventStore]`
|
|
11
|
+
metadata, or from `[EventStore]` on the event type or its assembly. Put
|
|
12
|
+
`[assembly: EventStore("<source-store>")]` in a contracts project when every
|
|
13
|
+
event there originates from one service.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Filtering which events reach the reactor
|
|
2
|
+
|
|
3
|
+
This reference holds the filter attributes, how they combine and the matching append metadata.
|
|
4
|
+
|
|
5
|
+
## Filtering which events reach the reactor
|
|
6
|
+
|
|
7
|
+
| Attribute | Effect |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `[FilterEventsByTag("<tag>")]` | **filters** by appended tag; repeatable, and any one match admits the event |
|
|
10
|
+
| `[EventSourceType("<value>")]` | **filters** by the appended event source type |
|
|
11
|
+
| `[EventStreamType("<value>")]` | **filters** by the appended event stream type |
|
|
12
|
+
| `[FromEventSource<TSource>("<stream>")]` | **filters** by a declared event source and stream (`Cratis.Chronicle.EventSources`) |
|
|
13
|
+
| `[EventStreamId("<value>")]` | **does not filter**; it is append metadata for side effects |
|
|
14
|
+
| `[Tag]`, `[Tags]` | **label** the reactor; they never filter |
|
|
15
|
+
|
|
16
|
+
Filter categories combine with AND; tags within the tag category combine with OR.
|
|
17
|
+
Typed source filters work on reactors and reducers, not projections (CHR0041).
|
|
18
|
+
CHR0055 flags unknown streams; CHR0056 flags routing that contradicts the filter.
|
|
19
|
+
Filters survive catch-up, replay and failed-partition recovery.
|
|
20
|
+
`WaitForCompletion` excludes nonmatching observers when the .NET client supplies
|
|
21
|
+
its first appended sequence number.
|
|
22
|
+
These correspond to metadata supplied at append time:
|
|
23
|
+
|
|
24
|
+
```csharp
|
|
25
|
+
await eventStore.EventLog.Append(
|
|
26
|
+
<eventSourceId>,
|
|
27
|
+
new <EventName>(<arguments>),
|
|
28
|
+
eventStreamType: "<stream-type>",
|
|
29
|
+
eventSourceType: "<source-type>",
|
|
30
|
+
tags: ["<tag>"]);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
A **projection cannot be filtered at all** — if you need metadata-based
|
|
34
|
+
selection, a reactor or a reducer is where it happens.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Injecting a read model
|
|
2
|
+
|
|
3
|
+
This reference holds how a reactor read-model parameter is keyed and when it is current.
|
|
4
|
+
|
|
5
|
+
### Injecting a read model
|
|
6
|
+
|
|
7
|
+
A read-model parameter is materialized using the event context's event-source id
|
|
8
|
+
by default. When the model's key differs from the triggering event's source —
|
|
9
|
+
the event carries a related entity's id — implement `ICanResolveReadModelKey` on
|
|
10
|
+
the reactor:
|
|
11
|
+
|
|
12
|
+
```csharp
|
|
13
|
+
public class <ReactorName> : IReactor, ICanResolveReadModelKey
|
|
14
|
+
{
|
|
15
|
+
public ReadModelKey Resolve(object @event, EventContext context) =>
|
|
16
|
+
((<EventName>)@event).<RelatedIdProperty>;
|
|
17
|
+
|
|
18
|
+
public Task <MethodName>(<EventName> @event, <ReadModelName> <readModel>) =>
|
|
19
|
+
Task.CompletedTask;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The resolved key applies to every read-model parameter on the reactor.
|
|
24
|
+
|
|
25
|
+
Materialized models are as current as their observer. `[Passive]` computes
|
|
26
|
+
on demand without a sink when the reactor needs a current read.
|
|
27
|
+
|
|
28
|
+
Prefer the event's own data. CHR0032 warns against injected storage primitives such as `IMongoCollection<T>`;
|
|
29
|
+
read keyed state through read-model parameters or `IReadModels.GetInstanceById`.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Returned events and their metadata
|
|
2
|
+
|
|
3
|
+
This reference holds the returned-event examples, the cross-stream wrapper and where append metadata for a bare event comes from.
|
|
4
|
+
|
|
5
|
+
### Returning events instead of injecting `IEventLog`
|
|
6
|
+
|
|
7
|
+
Return events rather than inject `IEventLog`: **a convention, not an analyzer
|
|
8
|
+
contract**. Returned appends stay inside Chronicle's transaction.
|
|
9
|
+
|
|
10
|
+
```csharp
|
|
11
|
+
// One event, on the triggering event's own event source.
|
|
12
|
+
public Task<<ResultEvent>> <MethodName>(<EventName> @event, EventContext context) =>
|
|
13
|
+
Task.FromResult(new <ResultEvent>(@event.<Property>));
|
|
14
|
+
|
|
15
|
+
// Several events on that same event source.
|
|
16
|
+
public Task<IEnumerable<object>> <MethodName>(<EventName> @event, EventContext context) =>
|
|
17
|
+
Task.FromResult<IEnumerable<object>>([new <ResultEvent>(), new <OtherEvent>()]);
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Targeting another event source
|
|
21
|
+
|
|
22
|
+
`Cratis.Chronicle.EventSequences.EventForEventSourceId(eventSourceId, @event,
|
|
23
|
+
causation)` is the cross-stream wrapper. Its init members include `Subject`,
|
|
24
|
+
`Occurred`, `Tags`, `EventSource` (`Type?`) and `EventStream` (`string?`). Routing
|
|
25
|
+
defaults are `EventStreamType.All`, `EventStreamId.Default` and
|
|
26
|
+
`EventSourceType.Default`. Source: `EventSequences/EventForEventSourceId.cs`.
|
|
27
|
+
|
|
28
|
+
```csharp
|
|
29
|
+
public Task<IEnumerable<EventForEventSourceId>> <MethodName>(<EventName> @event, EventContext context) =>
|
|
30
|
+
Task.FromResult<IEnumerable<EventForEventSourceId>>(
|
|
31
|
+
[
|
|
32
|
+
new(@event.<RelatedId>, new <ResultEvent>(@event.<Property>)),
|
|
33
|
+
new(@event.<OtherId>, new <OtherEvent>()) { EventStreamType = new("<stream-type>") },
|
|
34
|
+
]);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
It also carries `IEnumerable<NamedTag> NamedTags` (snapshotted on assignment).
|
|
38
|
+
It does **not** carry an
|
|
39
|
+
event sequence id; side effects are appended to the event log.
|
|
40
|
+
|
|
41
|
+
### Where the metadata for a bare event comes from
|
|
42
|
+
|
|
43
|
+
For a **bare** event return, Chronicle resolves the append metadata from the
|
|
44
|
+
reactor itself: the `[EventSourceType]`, `[EventStreamType]`, and
|
|
45
|
+
`[EventStreamId]` attributes, and the `ICanProvideEventSourceId`,
|
|
46
|
+
`ICanProvideEventStreamId`, and `ICanProvideSubject` interfaces (all in
|
|
47
|
+
`Cratis.Chronicle.Events`, each with one method).
|
|
48
|
+
|
|
49
|
+
An `EventForEventSourceId` is **self-describing** — reactor-level metadata is not
|
|
50
|
+
applied to it. In a mixed collection, bare items get the reactor metadata and
|
|
51
|
+
wrapper items keep their own.
|
|
@@ -26,10 +26,7 @@ their own contracts. This guidance does not claim Stage renders the self form.
|
|
|
26
26
|
|
|
27
27
|
Sources:
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
| --- | --- |
|
|
31
|
-
| `Cratis.Chronicle` | `Cratis.Chronicle.Reducers`, `Cratis.Chronicle.ReadModels`, `Cratis.Chronicle.Events`; self and instance forms, discovery and ownership (`Source/Clients/DotNET/Reducers/{SelfReducerMethods,SelfReducerInvoker,SelfReducerReplayHooks,RegisteredReducerReadModel,ReducerInvoker,ReducerCatalog}.cs`, `ReadModels/ReadModelBuilderOwnership.cs`, `DefaultClientArtifactsProvider.cs`) |
|
|
32
|
-
| `Cratis.Chronicle.Testing` | `Source/Clients/Testing/ReadModels/ReadModelScenario.cs`: static folds through scenarios |
|
|
29
|
+
Read [references/product-sources.md](references/product-sources.md) when you need the source files behind discovery and ownership.
|
|
33
30
|
|
|
34
31
|
Reverify product sources before claiming support for another version.
|
|
35
32
|
|
|
@@ -105,22 +102,7 @@ Check the consuming Arc version; Chronicle's discovery does not fix older Arc.
|
|
|
105
102
|
|
|
106
103
|
When the fold needs the separation described above, use the classic form:
|
|
107
104
|
|
|
108
|
-
|
|
109
|
-
using Cratis.Chronicle.Events;
|
|
110
|
-
using Cratis.Chronicle.Reducers;
|
|
111
|
-
|
|
112
|
-
// This fold lives separately because the model is a shared data contract.
|
|
113
|
-
public class <ReadModelName>Reducer : IReducerFor<<ReadModelName>>
|
|
114
|
-
{
|
|
115
|
-
public <ReadModelName> <Opened>(<OpenedEvent> @event, <ReadModelName>? current, EventContext context) =>
|
|
116
|
-
new(<initialValue>, context.Occurred);
|
|
117
|
-
|
|
118
|
-
public <ReadModelName> <Changed>(<ChangedEvent> @event, <ReadModelName>? current) =>
|
|
119
|
-
current is null
|
|
120
|
-
? new(<initialValue>, default)
|
|
121
|
-
: current with { <Property> = <computedFrom(current, @event)> };
|
|
122
|
-
}
|
|
123
|
-
```
|
|
105
|
+
Read [references/instance-reducer-example.md](references/instance-reducer-example.md) when you need a worked `IReducerFor<T>` instance reducer.
|
|
124
106
|
|
|
125
107
|
`IReducerFor<TReadModel>` is a marker with no members, constrained to
|
|
126
108
|
`where TReadModel : class`.
|
|
@@ -256,70 +238,13 @@ same store catalog: `AmbiguousReadModelBuilder` rejects it. `[Passive]`, sequenc
|
|
|
256
238
|
selection, filters and `[Reducer]` alone do not establish projection ownership.
|
|
257
239
|
Remove the old builder when switching; registration is not a data migration.
|
|
258
240
|
|
|
259
|
-
##
|
|
260
|
-
|
|
261
|
-
Independently optional public static non-generic hooks return exactly `Task`:
|
|
262
|
-
|
|
263
|
-
```csharp
|
|
264
|
-
public static Task BeginReplay() => Task.CompletedTask;
|
|
265
|
-
public static Task EndReplay() => Task.CompletedTask;
|
|
266
|
-
public static Task BeginReplayPartition(Partition partition) => Task.CompletedTask;
|
|
267
|
-
public static Task EndReplayPartition(Partition partition) => Task.CompletedTask;
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
Place these methods on the model and import `Cratis.Chronicle.Observation` for
|
|
271
|
-
`Partition`. Global hooks accept only trailing class/interface service arguments;
|
|
272
|
-
partition hooks require `Partition` first. Services resolve in the notification's
|
|
273
|
-
async DI scope; missing registrations fail. Events, the model, `EventContext`
|
|
274
|
-
and extra partition arguments are not hook services. Chronicle awaits hooks and
|
|
275
|
-
scope disposal; absent hooks create no scope. Do not assume full replay delivers
|
|
276
|
-
partition notifications, failures deliver an end hook, or delivery is exactly
|
|
277
|
-
once. Instance reducers retain replay notification interfaces.
|
|
278
|
-
|
|
279
|
-
## Filtering which events reach the reducer
|
|
280
|
-
|
|
281
|
-
Place filters on the self model or separate reducer class. These attributes
|
|
282
|
-
genuinely filter a reducer's input, matching append metadata:
|
|
283
|
-
|
|
284
|
-
| Attribute | Filters on |
|
|
285
|
-
| --- | --- |
|
|
286
|
-
| `[FilterEventsByTag("<tag>")]` | an appended tag; repeatable, and any one match admits the event |
|
|
287
|
-
| `[EventSourceType("<value>")]` | the appended event source type |
|
|
288
|
-
| `[EventStreamType("<value>")]` | the appended event stream type |
|
|
289
|
-
| `[FromEventSource<TSource>("<stream>")]` | the source definition and declared stream (`Cratis.Chronicle.EventSources`) |
|
|
290
|
-
|
|
291
|
-
`[Tag]` and `[Tags]` **label** the artifact; they do not filter. Note also that a
|
|
292
|
-
**projection cannot be filtered at all** — its definition has no field for it.
|
|
293
|
-
When you need metadata-based selection, a reducer or a reactor is where it can
|
|
294
|
-
happen.
|
|
241
|
+
## Replay
|
|
295
242
|
|
|
296
|
-
|
|
243
|
+
Read [references/replay-hooks-and-definition-changes.md](references/replay-hooks-and-definition-changes.md) when a self model needs `BeginReplay`/`EndReplay` hooks (they return exactly `Task`; do not assume delivery is exactly once) or when a code, key or filter change must replay (`observers.definitionEvolution`). Requires Chronicle 19.29.4 for method-fingerprint change detection; assembly versions are ignored.
|
|
297
244
|
|
|
298
|
-
|
|
299
|
-
await eventStore.EventLog.Append(
|
|
300
|
-
<eventSourceId>,
|
|
301
|
-
new <EventName>(<arguments>),
|
|
302
|
-
eventStreamType: "<stream-type>",
|
|
303
|
-
eventSourceType: "<source-type>",
|
|
304
|
-
tags: ["<tag>"]);
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
Mind the parameter order on `Append`: `eventStreamType` comes before
|
|
308
|
-
`eventStreamId`, which comes before `eventSourceType`.
|
|
309
|
-
CHR0055 flags an unknown typed stream and CHR0056 contradictory routing.
|
|
310
|
-
Filters remain effective during catch-up, replay and failed-partition recovery.
|
|
245
|
+
## Filtering
|
|
311
246
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
The kernel classifies new definitions under `observers.definitionEvolution`:
|
|
315
|
-
`Automatic` (default), `PartialOnly`, or `Manual`. Reducer method fingerprints
|
|
316
|
-
make code changes visible even without subscription changes; assembly versions
|
|
317
|
-
are ignored (Requires Chronicle 19.29.4). Changed
|
|
318
|
-
implementation, keys or filters require full replay; adding event types permits
|
|
319
|
-
partial replay only when history proves they follow all previously consumed
|
|
320
|
-
events per source. Interleaved history requires full replay. Manual policies
|
|
321
|
-
leave recommendations; they do not silently rebuild. Source:
|
|
322
|
-
`Documentation/hosting/configuration/observers.md`.
|
|
247
|
+
Read [references/filtering.md](references/filtering.md) when restricting which events reach a reducer (tag, event source type, stream type or declared source). `[Tag]` and `[Tags]` label and do not filter; a projection cannot be filtered at all.
|
|
323
248
|
|
|
324
249
|
## Specifications
|
|
325
250
|
|
|
@@ -329,17 +254,7 @@ Add `ReadModelScenario<TReadModel>` only where event dispatch, filtering,
|
|
|
329
254
|
metadata or read-model wiring contribute proof; drive the event sequence and
|
|
330
255
|
assert on the resulting instance there. For the self example:
|
|
331
256
|
|
|
332
|
-
|
|
333
|
-
var next = AccountBalance.Reduce(new FundsCredited(new Money(10m)), null);
|
|
334
|
-
next.Total.Value.ShouldEqual(10m);
|
|
335
|
-
|
|
336
|
-
using var scenario = new ReadModelScenario<AccountBalance>();
|
|
337
|
-
await scenario.Given.ForEventSource("account-42").Events(
|
|
338
|
-
new FundsCredited(new Money(10m)),
|
|
339
|
-
new BalanceCleared(),
|
|
340
|
-
new FundsCredited(new Money(3m)));
|
|
341
|
-
scenario.Instance!.Total.Value.ShouldEqual(3m);
|
|
342
|
-
```
|
|
257
|
+
Read [references/specification-example.md](references/specification-example.md) when you need a worked direct-call and `ReadModelScenario` spec.
|
|
343
258
|
|
|
344
259
|
Import `Cratis.Chronicle.Testing.ReadModels` for the scenario and the project's
|
|
345
260
|
specification assertions. Test deletion alone as absence, then recreation;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Filtering which events reach the reducer
|
|
2
|
+
|
|
3
|
+
This reference holds the filter attributes for a reducer and the matching append metadata.
|
|
4
|
+
|
|
5
|
+
## Filtering which events reach the reducer
|
|
6
|
+
|
|
7
|
+
Place filters on the self model or separate reducer class. These attributes
|
|
8
|
+
genuinely filter a reducer's input, matching append metadata:
|
|
9
|
+
|
|
10
|
+
| Attribute | Filters on |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| `[FilterEventsByTag("<tag>")]` | an appended tag; repeatable, and any one match admits the event |
|
|
13
|
+
| `[EventSourceType("<value>")]` | the appended event source type |
|
|
14
|
+
| `[EventStreamType("<value>")]` | the appended event stream type |
|
|
15
|
+
| `[FromEventSource<TSource>("<stream>")]` | the source definition and declared stream (`Cratis.Chronicle.EventSources`) |
|
|
16
|
+
|
|
17
|
+
`[Tag]` and `[Tags]` **label** the artifact; they do not filter. Note also that a
|
|
18
|
+
**projection cannot be filtered at all** — its definition has no field for it.
|
|
19
|
+
When you need metadata-based selection, a reducer or a reactor is where it can
|
|
20
|
+
happen.
|
|
21
|
+
|
|
22
|
+
The matching append supplies that metadata:
|
|
23
|
+
|
|
24
|
+
```csharp
|
|
25
|
+
await eventStore.EventLog.Append(
|
|
26
|
+
<eventSourceId>,
|
|
27
|
+
new <EventName>(<arguments>),
|
|
28
|
+
eventStreamType: "<stream-type>",
|
|
29
|
+
eventSourceType: "<source-type>",
|
|
30
|
+
tags: ["<tag>"]);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Mind the parameter order on `Append`: `eventStreamType` comes before
|
|
34
|
+
`eventStreamId`, which comes before `eventSourceType`.
|
|
35
|
+
CHR0055 flags an unknown typed stream and CHR0056 contradictory routing.
|
|
36
|
+
Filters remain effective during catch-up, replay and failed-partition recovery.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Instance reducer example
|
|
2
|
+
|
|
3
|
+
This reference holds a worked `IReducerFor<T>` instance reducer.
|
|
4
|
+
|
|
5
|
+
```csharp
|
|
6
|
+
using Cratis.Chronicle.Events;
|
|
7
|
+
using Cratis.Chronicle.Reducers;
|
|
8
|
+
|
|
9
|
+
// This fold lives separately because the model is a shared data contract.
|
|
10
|
+
public class <ReadModelName>Reducer : IReducerFor<<ReadModelName>>
|
|
11
|
+
{
|
|
12
|
+
public <ReadModelName> <Opened>(<OpenedEvent> @event, <ReadModelName>? current, EventContext context) =>
|
|
13
|
+
new(<initialValue>, context.Occurred);
|
|
14
|
+
|
|
15
|
+
public <ReadModelName> <Changed>(<ChangedEvent> @event, <ReadModelName>? current) =>
|
|
16
|
+
current is null
|
|
17
|
+
? new(<initialValue>, default)
|
|
18
|
+
: current with { <Property> = <computedFrom(current, @event)> };
|
|
19
|
+
}
|
|
20
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Product sources
|
|
2
|
+
|
|
3
|
+
This reference holds the packages and source files behind the reducer guidance.
|
|
4
|
+
|
|
5
|
+
| Package | Purpose |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `Cratis.Chronicle` | `Cratis.Chronicle.Reducers`, `Cratis.Chronicle.ReadModels`, `Cratis.Chronicle.Events`; self and instance forms, discovery and ownership (`Source/Clients/DotNET/Reducers/{SelfReducerMethods,SelfReducerInvoker,SelfReducerReplayHooks,RegisteredReducerReadModel,ReducerInvoker,ReducerCatalog}.cs`, `ReadModels/ReadModelBuilderOwnership.cs`, `DefaultClientArtifactsProvider.cs`) |
|
|
8
|
+
| `Cratis.Chronicle.Testing` | `Source/Clients/Testing/ReadModels/ReadModelScenario.cs`: static folds through scenarios |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Replay hooks and definition changes
|
|
2
|
+
|
|
3
|
+
This reference holds the optional self replay hooks and how definition changes classify into replay.
|
|
4
|
+
|
|
5
|
+
## Optional self replay hooks
|
|
6
|
+
|
|
7
|
+
Independently optional public static non-generic hooks return exactly `Task`:
|
|
8
|
+
|
|
9
|
+
```csharp
|
|
10
|
+
public static Task BeginReplay() => Task.CompletedTask;
|
|
11
|
+
public static Task EndReplay() => Task.CompletedTask;
|
|
12
|
+
public static Task BeginReplayPartition(Partition partition) => Task.CompletedTask;
|
|
13
|
+
public static Task EndReplayPartition(Partition partition) => Task.CompletedTask;
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Place these methods on the model and import `Cratis.Chronicle.Observation` for
|
|
17
|
+
`Partition`. Global hooks accept only trailing class/interface service arguments;
|
|
18
|
+
partition hooks require `Partition` first. Services resolve in the notification's
|
|
19
|
+
async DI scope; missing registrations fail. Events, the model, `EventContext`
|
|
20
|
+
and extra partition arguments are not hook services. Chronicle awaits hooks and
|
|
21
|
+
scope disposal; absent hooks create no scope. Do not assume full replay delivers
|
|
22
|
+
partition notifications, failures deliver an end hook, or delivery is exactly
|
|
23
|
+
once. Instance reducers retain replay notification interfaces.
|
|
24
|
+
|
|
25
|
+
## Definition changes replay
|
|
26
|
+
|
|
27
|
+
The kernel classifies new definitions under `observers.definitionEvolution`:
|
|
28
|
+
`Automatic` (default), `PartialOnly`, or `Manual`. Reducer method fingerprints
|
|
29
|
+
make code changes visible even without subscription changes; assembly versions
|
|
30
|
+
are ignored. Changed
|
|
31
|
+
implementation, keys or filters require full replay; adding event types permits
|
|
32
|
+
partial replay only when history proves they follow all previously consumed
|
|
33
|
+
events per source. Interleaved history requires full replay. Manual policies
|
|
34
|
+
leave recommendations; they do not silently rebuild. Source:
|
|
35
|
+
`Documentation/hosting/configuration/observers.md`.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Reducer specification example
|
|
2
|
+
|
|
3
|
+
This reference holds a worked direct-call and `ReadModelScenario` example for a self-reducing model.
|
|
4
|
+
|
|
5
|
+
```csharp
|
|
6
|
+
var next = AccountBalance.Reduce(new FundsCredited(new Money(10m)), null);
|
|
7
|
+
next.Total.Value.ShouldEqual(10m);
|
|
8
|
+
|
|
9
|
+
using var scenario = new ReadModelScenario<AccountBalance>();
|
|
10
|
+
await scenario.Given.ForEventSource("account-42").Events(
|
|
11
|
+
new FundsCredited(new Money(10m)),
|
|
12
|
+
new BalanceCleared(),
|
|
13
|
+
new FundsCredited(new Money(3m)));
|
|
14
|
+
scenario.Instance!.Total.Value.ShouldEqual(3m);
|
|
15
|
+
```
|
|
@@ -241,21 +241,7 @@ There is no global provider `pt`.
|
|
|
241
241
|
|
|
242
242
|
## Renderer adapters — when a vendor look is wanted
|
|
243
243
|
|
|
244
|
-
The default renderer is built in; omit `library` on the provider.
|
|
245
|
-
adapter packages exist — `@cratis/components.mui` (MUI 9),
|
|
246
|
-
`@cratis/components.primereact` (PrimeReact 11), `@cratis/components.primereact10`
|
|
247
|
-
— and each adapts exactly **nine primitive slots**: button, icon-button, text
|
|
248
|
-
input, text area, checkbox, radio, switch, progress bar (`common.progress`, not
|
|
249
|
-
`common.progressBar`), surface. Install and upgrade each adapter at **exactly
|
|
250
|
-
the same version** as `@cratis/components`; Node >=22 is required. The broader
|
|
251
|
-
renderer contract also has an atomic `common.tooltip` slot accepting any React
|
|
252
|
-
node, but it is not one of the nine stable presentation slots. Pass the
|
|
253
|
-
adapter's manifest to the provider's `library` prop. Dialogs, dropdowns, tables,
|
|
254
|
-
date pickers, tooltips, paginators, toasts and steppers stay Components-owned
|
|
255
|
-
regardless; an adapter never restores a vendor's public API, and the vendor's
|
|
256
|
-
own provider, theme and license remain the application's, outside Components.
|
|
257
|
-
Reach for an adapter only when the product genuinely wants that vendor's look on
|
|
258
|
-
those nine controls — mapping tokens is almost always the smaller change.
|
|
244
|
+
The default renderer is built in; omit `library` on the provider. Reach for an adapter only when the product wants a vendor look on nine primitive controls; mapping tokens is almost always the smaller change. The adapters cover nine primitive slots; the progress bar slot is `common.progress`, not `common.progressBar`. Read [references/renderer-adapters.md](references/renderer-adapters.md) when choosing or installing an adapter.
|
|
259
245
|
|
|
260
246
|
## Where Tailwind fits
|
|
261
247
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Renderer adapters
|
|
2
|
+
|
|
3
|
+
This reference holds the optional renderer adapter packages, their nine slots and version rules.
|
|
4
|
+
|
|
5
|
+
## Renderer adapters — when a vendor look is wanted
|
|
6
|
+
|
|
7
|
+
The default renderer is built in; omit `library` on the provider. Three optional
|
|
8
|
+
adapter packages exist — `@cratis/components.mui` (MUI 9),
|
|
9
|
+
`@cratis/components.primereact` (PrimeReact 11), `@cratis/components.primereact10`
|
|
10
|
+
— and each adapts exactly **nine primitive slots**: button, icon-button, text
|
|
11
|
+
input, text area, checkbox, radio, switch, progress bar (`common.progress`, not
|
|
12
|
+
`common.progressBar`), surface. Install and upgrade each adapter at **exactly
|
|
13
|
+
the same version** as `@cratis/components`; Node >=22 is required. The broader
|
|
14
|
+
renderer contract also has an atomic `common.tooltip` slot accepting any React
|
|
15
|
+
node, but it is not one of the nine stable presentation slots. Pass the
|
|
16
|
+
adapter's manifest to the provider's `library` prop. Dialogs, dropdowns, tables,
|
|
17
|
+
date pickers, tooltips, paginators, toasts and steppers stay Components-owned
|
|
18
|
+
regardless; an adapter never restores a vendor's public API, and the vendor's
|
|
19
|
+
own provider, theme and license remain the application's, outside Components.
|
|
20
|
+
Reach for an adapter only when the product genuinely wants that vendor's look on
|
|
21
|
+
those nine controls — mapping tokens is almost always the smaller change.
|
|
@@ -100,30 +100,7 @@ Two rules keep the ladder honest:
|
|
|
100
100
|
|
|
101
101
|
## The lifecycle phases a real install cycle must cover
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
phases that claim decomposes into. Run them against the exact artifact a
|
|
105
|
-
consumer would receive.
|
|
106
|
-
|
|
107
|
-
- **collision-negative** — with the artifact absent, nothing already present
|
|
108
|
-
answers to its name. This is the baseline that makes the positive result mean
|
|
109
|
-
something.
|
|
110
|
-
- **install** — it installs from the published location, not a local path.
|
|
111
|
-
- **discovery** — the host actually finds and lists it afterwards.
|
|
112
|
-
- **behavior-positive** — it does the thing it exists to do.
|
|
113
|
-
- **behavior-negative** — it declines the case it must decline. An artifact that
|
|
114
|
-
never says no has not been tested for judgment.
|
|
115
|
-
- **update** — moving from the previous version to this one succeeds.
|
|
116
|
-
- **rollback** — moving back to the previous exact version succeeds. This is the
|
|
117
|
-
phase teams skip and the one consumers need most.
|
|
118
|
-
- **uninstall** — it removes cleanly.
|
|
119
|
-
- **project-context-preservation** — consumer-owned files it never owned are
|
|
120
|
-
untouched by install, update, rollback, and uninstall. Destroying local
|
|
121
|
-
configuration during an upgrade is the most expensive failure in this list.
|
|
122
|
-
- **cleanup** — no residue in caches, registries, or host state.
|
|
123
|
-
|
|
124
|
-
Rollback and preservation are what convert "it works" into "it is safe to try."
|
|
125
|
-
A release path without a proven way back is not a release path; it is a
|
|
126
|
-
one-way door.
|
|
103
|
+
Run the phases against the exact artifact a consumer would receive; rollback to a prior exact version and preservation of consumer-owned files are the ones teams skip and consumers need most. Read [references/lifecycle-phases.md](references/lifecycle-phases.md) when claiming a consumer can install, update, roll back and uninstall the artifact.
|
|
127
104
|
|
|
128
105
|
## Supply-chain receipts and what each one proves
|
|
129
106
|
|
package/package/corpus/skills/cratis-governed-release-methodology/references/lifecycle-phases.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Install-cycle lifecycle phases
|
|
2
|
+
|
|
3
|
+
This reference holds the lifecycle phases an install-cycle claim decomposes into.
|
|
4
|
+
|
|
5
|
+
## The lifecycle phases a real install cycle must cover
|
|
6
|
+
|
|
7
|
+
When you claim a consumer can adopt and un-adopt your artifact, these are the
|
|
8
|
+
phases that claim decomposes into. Run them against the exact artifact a
|
|
9
|
+
consumer would receive.
|
|
10
|
+
|
|
11
|
+
- **collision-negative** — with the artifact absent, nothing already present
|
|
12
|
+
answers to its name. This is the baseline that makes the positive result mean
|
|
13
|
+
something.
|
|
14
|
+
- **install** — it installs from the published location, not a local path.
|
|
15
|
+
- **discovery** — the host actually finds and lists it afterwards.
|
|
16
|
+
- **behavior-positive** — it does the thing it exists to do.
|
|
17
|
+
- **behavior-negative** — it declines the case it must decline. An artifact that
|
|
18
|
+
never says no has not been tested for judgment.
|
|
19
|
+
- **update** — moving from the previous version to this one succeeds.
|
|
20
|
+
- **rollback** — moving back to the previous exact version succeeds. This is the
|
|
21
|
+
phase teams skip and the one consumers need most.
|
|
22
|
+
- **uninstall** — it removes cleanly.
|
|
23
|
+
- **project-context-preservation** — consumer-owned files it never owned are
|
|
24
|
+
untouched by install, update, rollback, and uninstall. Destroying local
|
|
25
|
+
configuration during an upgrade is the most expensive failure in this list.
|
|
26
|
+
- **cleanup** — no residue in caches, registries, or host state.
|
|
27
|
+
|
|
28
|
+
Rollback and preservation are what convert "it works" into "it is safe to try."
|
|
29
|
+
A release path without a proven way back is not a release path; it is a
|
|
30
|
+
one-way door.
|