@cratis/pi 7.51.5 → 7.52.1
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/documentation.instructions.md +1 -0
- package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +2 -1
- package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +15 -0
- package/package/corpus/product-sync.json +26 -20
- package/package/corpus/rules/documentation.md +1 -0
- package/package/corpus/rules/glossary.md +2 -1
- package/package/corpus/rules/profiles.md +15 -0
- package/package/corpus/skills/cratis-application-slice-specifications/references/query-and-decision-scenarios.md +14 -3
- package/package/corpus/skills/cratis-arc-command/SKILL.md +4 -0
- package/package/corpus/skills/cratis-arc-command/references/decisions-and-routing.md +22 -3
- package/package/corpus/skills/cratis-arc-command/references/fresh-identifiers.md +52 -0
- package/package/corpus/skills/cratis-arc-command/references/generated-values.md +7 -7
- package/package/corpus/skills/cratis-arc-command/references/handler-shapes.md +9 -0
- package/package/corpus/skills/cratis-arc-command/references/proxy-generation.md +5 -0
- package/package/corpus/skills/cratis-arc-command/references/read-model-injection.md +11 -0
- package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +12 -1
- package/package/corpus/skills/cratis-arc-command-execution/references/command-refusals.md +65 -0
- package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +5 -0
- package/package/corpus/skills/cratis-arc-hosting/SKILL.md +1 -0
- package/package/corpus/skills/cratis-arc-observable-query-http/SKILL.md +6 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/additional-surfaces.md +18 -0
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/discovery.md +33 -1
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/lifecycle.md +7 -1
- package/package/corpus/skills/cratis-chronicle-compliance/SKILL.md +5 -0
- package/package/corpus/skills/cratis-chronicle-decision-reads/SKILL.md +17 -0
- package/package/corpus/skills/cratis-chronicle-decision-reads/references/choosing-how-a-rule-holds.md +3 -3
- package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +4 -0
- package/package/corpus/skills/cratis-chronicle-event-constraints/references/storage-uniqueness.md +28 -0
- package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +5 -3
- package/package/corpus/skills/cratis-chronicle-event-specifications/SKILL.md +7 -0
- package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +18 -0
- package/package/corpus/skills/cratis-chronicle-event-type-migration/references/explicit-migrations.md +46 -0
- package/package/corpus/skills/cratis-chronicle-hosting/SKILL.md +8 -0
- package/package/corpus/skills/cratis-chronicle-hosting/references/operations.md +42 -0
- package/package/corpus/skills/cratis-chronicle-multi-tenancy/SKILL.md +1 -0
- package/package/corpus/skills/cratis-chronicle-projection/references/model-bound-attributes.md +6 -0
- package/package/corpus/skills/cratis-chronicle-projection/references/variants.md +7 -0
- package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +13 -7
- package/package/corpus/skills/cratis-chronicle-reactor/references/cross-service-events.md +9 -2
- package/package/corpus/skills/cratis-chronicle-reactor/references/return-event-metadata.md +7 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/slice-delivery-checklist.md +3 -3
- package/package/corpus/skills/cratis-chronicle-reactor/references/specifications.md +11 -5
- package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +8 -4
- package/package/corpus/skills/cratis-chronicle-read-model/references/collection-observation.md +49 -0
- package/package/corpus/skills/cratis-chronicle-read-model/references/queries.md +13 -2
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +8 -0
- package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +15 -0
- package/package/corpus/skills/cratis-multi-service-architecture/SKILL.md +204 -0
- package/package/corpus/skills/cratis-multi-service-architecture/references/publish-and-consume.md +229 -0
- package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +172 -0
- package/package/corpus/skills/cratis-multi-service-local-orchestration/references/docker-compose.md +144 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +4 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +1 -1
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +24 -5
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +1 -1
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +11 -6
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/invocation-identity.md +3 -1
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/refusals-and-redelivery.md +97 -26
- package/package/corpus/skills/cratis-screenplay-command-surface/references/compliance.md +2 -1
- package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +45 -10
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +3 -1
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +1 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +10 -6
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +5 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +7 -3
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +28 -12
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +29 -6
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/screen-authoring-workflow.md +15 -3
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +4 -1
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +1 -1
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +4 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +5 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +1 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +1 -1
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +9 -1
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +12 -10
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +11 -6
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +1 -1
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +18 -10
- package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +14 -13
- package/package/corpus/skills/cratis-screenplay-specifications/references/query-rejections.md +44 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +2 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +188 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +6 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +12 -4
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +10 -6
- package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +28 -9
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +4658 -230
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +1 -1
- package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +5 -0
- package/package/corpus/skills/cratis-specifications-csharp/references/application-scenarios.md +1 -1
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +1 -1
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +63 -15
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +2 -2
- package/package/corpus/skills/cratis-technical-examples/SKILL.md +22 -0
- package/package/profile-catalog.json +3 -1
- package/package.json +1 -1
package/package/corpus/skills/cratis-chronicle-client-dotnet/references/additional-surfaces.md
CHANGED
|
@@ -46,6 +46,19 @@ unannotated added properties.
|
|
|
46
46
|
`ICanSeedEvents.Seed(IEventSeedingBuilder)` declares seeds sent on connection and
|
|
47
47
|
applied once per namespace. `ForNamespace` targets one namespace; global seeds
|
|
48
48
|
also apply to namespaces created later (not a retroactive replay of all history).
|
|
49
|
+
Opening a namespace starts their application asynchronously, without an ordering
|
|
50
|
+
promise before the first write; scope development/sample data with `ForNamespace`.
|
|
51
|
+
Requires Chronicle 19.64.0 client and kernel for authoritative discovered global
|
|
52
|
+
sets: each program replaces only its own declaration, including an empty set.
|
|
53
|
+
Removing a seeder stops future namespace application, never retracts appended
|
|
54
|
+
events. Set a stable, distinct `ChronicleOptions.ProgramIdentifier` per program;
|
|
55
|
+
the fallback is the entry assembly name. Manual globals and other programs' sets
|
|
56
|
+
remain; identical shared seeds are not multiplied across programs. The first
|
|
57
|
+
upgraded authoritative registration clears ownerless legacy globals. Failed
|
|
58
|
+
seeder activation/callback keeps the previous declaration, not a partial set.
|
|
59
|
+
Check both versions; old clients/kernels retain append-only globals. To clear
|
|
60
|
+
stale development declarations, upgrade both, remove or namespace-scope the
|
|
61
|
+
seeder, then start the application once.
|
|
49
62
|
`For` / `ForEventSource` route by source/stream metadata; `ForEvents` keeps each
|
|
50
63
|
wrapper's routing and tags. Routing participates in seed identity, so the same
|
|
51
64
|
payload on another stream is another seed. Seeding is a write, not a read-only
|
|
@@ -57,6 +70,11 @@ Calls while disconnected fail fast (`ConnectionTimedOut`, then
|
|
|
57
70
|
`ConnectionUnavailable` after backoff); ASP.NET hosts start while the kernel is
|
|
58
71
|
unreachable, log failure and expose the `chronicle` health check.
|
|
59
72
|
`AddChronicleHealthCheck(HealthStatus)` honors its configured failure status.
|
|
73
|
+
Requires Chronicle 19.59.6 for readiness to require successful artifact
|
|
74
|
+
registration as well as connection, and 19.65.0 to stay down during
|
|
75
|
+
re-registration (`IsRegistering`). With automatic registration off, an unrun
|
|
76
|
+
registration is connected-only; once manually run, its outcome is checked. Check the client package
|
|
77
|
+
version; a connected-only probe on older clients does not prove registration.
|
|
60
78
|
`IEventStore.Discovery` and startup reports expose discovered artifacts.
|
|
61
79
|
`IEventSources` is scoped in host wiring, not a singleton to retain across requests.
|
|
62
80
|
|
|
@@ -58,6 +58,34 @@ later options edits affect only subsequently created stores. For an existing sto
|
|
|
58
58
|
constraint, reducer and read-model registration APIs. Fluent reactors use typed
|
|
59
59
|
`On<TEvent>` handlers or catch-all `Subscribe`.
|
|
60
60
|
|
|
61
|
+
Requires Chronicle 19.52.0 for marker-free event types, reactors, reducers,
|
|
62
|
+
constraints, event sources and migrations. Check the client package version;
|
|
63
|
+
older versions require their attributes/interfaces. Both generic and `Type`
|
|
64
|
+
forms are available on `ExplicitArtifacts`: `RegisterEventType`, `RegisterReactor`,
|
|
65
|
+
`RegisterReducer`, `RegisterConstraint`, `RegisterEventSource`, `RegisterMigration`.
|
|
66
|
+
Use markers by default; nominate plain contracts at the composition root when
|
|
67
|
+
an assembly cannot reference Chronicle.
|
|
68
|
+
|
|
69
|
+
`RegisterEventType<T>(configure)` supports `WithId`, `Generation`, `Public`,
|
|
70
|
+
`Private`, `ForEventStore`, `PublishTo`. Omitted facets inherit declarations,
|
|
71
|
+
then defaults. Equal peers coalesce; contradictory ids, generations or facets
|
|
72
|
+
fail with `ConflictingArtifactDeclaration`, and contradictory artifact kinds
|
|
73
|
+
fail with `ConflictingArtifactKind`. Two types sharing an id and generation fail.
|
|
74
|
+
A plain constraint needs one public synchronous `void Define(IConstraintBuilder)`.
|
|
75
|
+
Plain migrations use typed public synchronous `Upcast` and `Downcast` methods;
|
|
76
|
+
read **cratis-chronicle-event-type-migration** before registering them.
|
|
77
|
+
Preparation failures prevent registration effects and are reported as registration
|
|
78
|
+
failures, not retried as connection failures.
|
|
79
|
+
|
|
80
|
+
Registration visibility and publication eligibility are separate. Owning-store
|
|
81
|
+
membership or `Public()`/`[Public]` can grant publication eligibility;
|
|
82
|
+
`Private()` does not subtract it. Foreign ownership alone does not grant it.
|
|
83
|
+
`PublishTo` chooses a destination (outbox by default), not eligibility; the event
|
|
84
|
+
log is not a publication destination. Type-based observer registration, state
|
|
85
|
+
and replay operations resolve store-local aliases; import the reactor/reducer
|
|
86
|
+
namespace for plain-class generic extensions. Custom old-only registries throw
|
|
87
|
+
`TypeBasedArtifactRegistrationNotSupported` for unsupported new operations.
|
|
88
|
+
|
|
61
89
|
## Plain-class reducer nomination
|
|
62
90
|
|
|
63
91
|
Only nominate a plain instance reducer when its assembly cannot reference
|
|
@@ -128,4 +156,8 @@ Read models are queried through `eventStore.ReadModels`
|
|
|
128
156
|
`GetInstanceById<TReadModel>(ReadModelKey, ReadModelSessionId?)`,
|
|
129
157
|
`GetInstances<TReadModel>(EventCount?)`,
|
|
130
158
|
`GetSnapshotsById<TReadModel>`,
|
|
131
|
-
`IObservable<ReadModelChangeset<TReadModel>> Watch<TReadModel>()
|
|
159
|
+
`IObservable<ReadModelChangeset<TReadModel>> Watch<TReadModel>()`, and
|
|
160
|
+
`ISubject<IEnumerable<TReadModel>> Observe<TReadModel>(filter)`.
|
|
161
|
+
Requires Chronicle 19.54.0. Read
|
|
162
|
+
[collection observation](../../cratis-chronicle-read-model/references/collection-observation.md)
|
|
163
|
+
when exposing a whole-list snapshot; its filter is client-side.
|
|
@@ -18,7 +18,13 @@ This reference holds registration wiring, the registration wait, keepalive and w
|
|
|
18
18
|
reactor/reducer subscription readiness (use `WaitTillSubscribed` / `WaitTillActive`).
|
|
19
19
|
Successful active projection registration includes observer subscription, not
|
|
20
20
|
read-your-writes: inspect the append's `WaitForCompletion` result or read a
|
|
21
|
-
passive model.
|
|
21
|
+
passive model.
|
|
22
|
+
Requires Chronicle 19.65.0 for `IsRegistering`: other members
|
|
23
|
+
retain the preceding run's outcome during re-registration, so readiness needs
|
|
24
|
+
`IsSuccess && !IsRegistering`. Disconnect with automatic registration marks
|
|
25
|
+
it in progress; `WaitForRegistration` waits for that new run rather than
|
|
26
|
+
returning stale success. Check the package version; older clients need
|
|
27
|
+
explicit reconnect-readiness coordination. Source: `Registrations/RegistrationOutcome.cs`.
|
|
22
28
|
- **Keepalive is a bidirectional stream plus a watchdog.** The watchdog monitors
|
|
23
29
|
every `MonitorIntervalMilliseconds = 1000`
|
|
24
30
|
(`Source/Clients/Connections/ConnectionWatchdog.cs`) and a keepalive that
|
|
@@ -76,6 +76,11 @@ that is also a command property takes both `[Encrypted]` and `[NotAudited]`.
|
|
|
76
76
|
live in `Cratis.Chronicle.Confidentiality` (`ICanProvideSecurityMetadataForType`
|
|
77
77
|
and `ICanProvideSecurityMetadataForProperty`).
|
|
78
78
|
|
|
79
|
+
Requires Chronicle 19.54.1 for encrypted non-string properties/concepts (such as
|
|
80
|
+
`int` and `bool`) to append and deserialize with their original types across
|
|
81
|
+
subject, namespace and global scopes. Check the kernel version; earlier kernels
|
|
82
|
+
can fail those appends. Verify a protected-value round trip, not only compilation.
|
|
83
|
+
|
|
79
84
|
Mark only genuinely personal values. Business metadata, identifiers of
|
|
80
85
|
non-persons, and amounts stay unmarked — every marked value costs an encryption
|
|
81
86
|
round trip and becomes unreadable the moment the subject is erased.
|
|
@@ -34,6 +34,19 @@ Requires Chronicle 19.9.0 for decision reads, and a Chronicle 19.39.0 kernel for
|
|
|
34
34
|
Reverify a client/kernel pair rather than disabling
|
|
35
35
|
compatibility checking to force a read through.
|
|
36
36
|
|
|
37
|
+
Requires Chronicle 19.62.0 for host enrollment contributors:
|
|
38
|
+
`IUnitOfWork.AddEnrollmentContributor(IUnitOfWorkEnrollmentContributor)` returns
|
|
39
|
+
a disposable removal handle. Contributors require scopes before staging through
|
|
40
|
+
`AddEvent`, `AddEvents`, named-tag and transactional append paths. Equal scopes
|
|
41
|
+
merge; a conflict throws `ConflictingEnrollmentScope` without staging that call.
|
|
42
|
+
Required scopes remain until completion even after handle disposal; contributed
|
|
43
|
+
units accept only one sequence. Reentrant mutation and failed `Enrolled`
|
|
44
|
+
notifications fail closed (`UnitOfWorkMutatedDuringEnrollment`,
|
|
45
|
+
`UnitOfWorkEnrollmentNotificationFailed`). This is a host integration extension,
|
|
46
|
+
not a command-side alternative to returned guarded events. Check the client
|
|
47
|
+
package version; older custom units throw
|
|
48
|
+
`UnitOfWorkEnrollmentContributorsNotSupported` when attached.
|
|
49
|
+
|
|
37
50
|
## Route the work
|
|
38
51
|
|
|
39
52
|
- For Arc `[ProtectedDecision]`, Arc command/handler shapes and Arc `IStreamReads`,
|
|
@@ -88,6 +101,10 @@ projection also needs an explicit stream id, not the default wildcard.
|
|
|
88
101
|
`AdmitForStream<T>()` checks this shape; unsupported readers/kernels refuse with
|
|
89
102
|
`StreamScopeNotSupported`. Do not fall back to an unguarded query on refusal.
|
|
90
103
|
|
|
104
|
+
Requires Arc 22.81.0 for these stream overloads inside Arc commands to use
|
|
105
|
+
command protection, caching and enrollment; older Arc refuses them. Check Arc
|
|
106
|
+
as well as the Chronicle client/kernel pair before choosing this path.
|
|
107
|
+
|
|
91
108
|
## Commit and inspect conflicts
|
|
92
109
|
|
|
93
110
|
Enroll the read **before** staging its decision's events through
|
|
@@ -22,9 +22,9 @@ validator, endpoint or handler that reads state and then appends.
|
|
|
22
22
|
|
|
23
23
|
Checked against the Chronicle and Arc sources. Published guides, which
|
|
24
24
|
this agrees with:
|
|
25
|
-
[Chronicle: choosing how a rule holds](/chronicle/dynamic-consistency-boundary/choosing/),
|
|
26
|
-
[decision reads](/chronicle/read-models/decision-reads/),
|
|
27
|
-
[Arc: choosing how a command's rule holds](/arc/backend/csharp/chronicle/consistency/).
|
|
25
|
+
[Chronicle: choosing how a rule holds](https://www.cratis.io/chronicle/dynamic-consistency-boundary/choosing/),
|
|
26
|
+
[decision reads](https://www.cratis.io/chronicle/read-models/decision-reads/),
|
|
27
|
+
[Arc: choosing how a command's rule holds](https://www.cratis.io/arc/backend/csharp/chronicle/consistency/).
|
|
28
28
|
|
|
29
29
|
## Route first
|
|
30
30
|
|
|
@@ -194,6 +194,10 @@ content to recompute the hashes, and skips subjects whose key has been erased so
|
|
|
194
194
|
they do not all collide on the hash of an empty value. The index therefore holds
|
|
195
195
|
plaintext-derived hashes, not the personal value itself.
|
|
196
196
|
|
|
197
|
+
Read references/storage-uniqueness.md when upgrading SQL/in-memory constraints
|
|
198
|
+
or reindexing duplicates: Requires Chronicle 19.59.7 for SQL atomic claim indexes,
|
|
199
|
+
19.59.3 for in-memory claim preservation and 19.59.1 for duplicate-tolerant reindex.
|
|
200
|
+
|
|
197
201
|
## Step 6 — Specify the violation
|
|
198
202
|
|
|
199
203
|
Specify the constraint with `EventScenario`: seed the conflicting state through
|
package/package/corpus/skills/cratis-chronicle-event-constraints/references/storage-uniqueness.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- Copyright (c) Cratis. All rights reserved. -->
|
|
2
|
+
<!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
|
|
3
|
+
|
|
4
|
+
# Unique claims across storage providers
|
|
5
|
+
|
|
6
|
+
Requires Chronicle 19.59.7 for SQL unique claims to be settled by database unique
|
|
7
|
+
indexes and for rejected moves to preserve the old claim.
|
|
8
|
+
Requires Chronicle 19.59.3 for cross-source claim enforcement, rejected-move preservation and release in memory.
|
|
9
|
+
Check the kernel image/storage package versions; earlier storage can allow a
|
|
10
|
+
racing second holder or lose the old claim on a rejected move.
|
|
11
|
+
|
|
12
|
+
On PostgreSQL, SQL Server and SQLite, per-event-source constraint tables have a
|
|
13
|
+
unique value index. SQL startup upgrades existing tables without dropping data.
|
|
14
|
+
Duplicate rows retain a non-unique index and produce a warning; remove duplicates
|
|
15
|
+
only with authorization, then restart to obtain the unique index. SQL Server
|
|
16
|
+
bounds the value column to 200 characters but skips that upgrade when long or
|
|
17
|
+
legacy unhashed values would be truncated. A warning is not a successful index
|
|
18
|
+
upgrade; inspect the table before relying on atomic claims.
|
|
19
|
+
|
|
20
|
+
Requires Chronicle 19.59.1 for reindexing histories containing duplicates to
|
|
21
|
+
complete: the first claimant in event-log order retains the value, later duplicate
|
|
22
|
+
claims are logged and skipped. Reindexing does not retract their stored events.
|
|
23
|
+
Older kernels can fail the reindex instead.
|
|
24
|
+
|
|
25
|
+
Run the affected specifications with `dotnet test`, asserting a second source's
|
|
26
|
+
rejection, unchanged original claim after a failed move, and successful reuse
|
|
27
|
+
after release. Real SQL integration must prove two competing claims cannot both
|
|
28
|
+
succeed; an in-memory pass does not prove the SQL index was upgraded.
|
|
@@ -116,9 +116,10 @@ manual scope completion, reopening and its crash/reindex limits. Closing refuses
|
|
|
116
116
|
new appends; it does not erase history or stop projection replay. Specify a
|
|
117
117
|
late append refusal and an unrelated scope remaining open.
|
|
118
118
|
|
|
119
|
-
`[Public]`
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
`[Public]` grants publication eligibility; `[PublishTo("sequence")]` selects the
|
|
120
|
+
projection/reducer event-output destination (outbox by default), not eligibility.
|
|
121
|
+
Owning-store membership can also grant eligibility, so private registration
|
|
122
|
+
visibility alone does not forbid publication. The event log is not a publication target. Translate inbox facts
|
|
122
123
|
into local facts at the boundary rather than treating external contracts as
|
|
123
124
|
local commands. Named tags are plaintext, indexed metadata: never personal data.
|
|
124
125
|
|
|
@@ -242,3 +243,4 @@ remain separately authorized; a ready model authorizes none of them.
|
|
|
242
243
|
same; the artifact is a file that compiles, and the four behavior types above
|
|
243
244
|
map onto its `StateChange`, `StateView`, `Automation` and `Translate` slices.
|
|
244
245
|
- Drawing a decided model as a diagram: `cratis-event-model-diagram`.
|
|
246
|
+
- A flow that crosses services, each owning its own event store: `cratis-multi-service-architecture`.
|
|
@@ -81,6 +81,13 @@ sequence serialize, so racing claims of the same unique value cannot both win.
|
|
|
81
81
|
Seeding can specify source/stream routing through the `ForEventSource`,
|
|
82
82
|
`For<TEvent>` and `ForEvents` overloads.
|
|
83
83
|
|
|
84
|
+
Requires Chronicle 19.59.0 for `scenario.ReadModels` to read and observe
|
|
85
|
+
projections (including children and joins) and reducers from the scenario's own
|
|
86
|
+
events, not a shared default store. Check the testing package version; on older
|
|
87
|
+
packages use a dedicated `ReadModelScenario` rather than assuming shared storage.
|
|
88
|
+
Requires Chronicle 19.52.0 for per-run `Defaults` to honor marker-free
|
|
89
|
+
`ExplicitArtifacts`; see the .NET client's discovery reference.
|
|
90
|
+
|
|
84
91
|
## Step 2 — Seed prior state through `Given`
|
|
85
92
|
|
|
86
93
|
```csharp
|
|
@@ -40,6 +40,11 @@ Sources:
|
|
|
40
40
|
|
|
41
41
|
Reverify product sources before claiming support for another version.
|
|
42
42
|
|
|
43
|
+
Requires Chronicle 19.52.0 for marker-free migration nomination through
|
|
44
|
+
`ExplicitArtifacts.RegisterMigration<T>()`. Read references/explicit-migrations.md
|
|
45
|
+
when event endpoints are plain/aliased or a migration cannot reference Chronicle;
|
|
46
|
+
check the client package version, since older clients need migration markers.
|
|
47
|
+
|
|
43
48
|
## Generations
|
|
44
49
|
|
|
45
50
|
`Cratis.Chronicle.Events.EventTypeAttribute` carries the identity and the
|
|
@@ -142,6 +147,11 @@ members:
|
|
|
142
147
|
| `Combine(targetProperty, separator, params sourceProperties)` | several old values become one |
|
|
143
148
|
| `MapValues(targetProperty, sourceProperty, map)` | one direction's value translation |
|
|
144
149
|
|
|
150
|
+
Requires Chronicle 19.51.1 for `DefaultValue` and `MapValues` on concept
|
|
151
|
+
properties to write the underlying primitive rather than a `{ Value: ... }`
|
|
152
|
+
object. Check the client package version; older definitions need an upgrade
|
|
153
|
+
before relying on concept-valued defaults/maps.
|
|
154
|
+
|
|
145
155
|
There is **no `Rename`** — the method is `RenamedFrom`. There is **no `Join`** —
|
|
146
156
|
concatenation is `Combine`.
|
|
147
157
|
|
|
@@ -262,6 +272,14 @@ syntax. `ReadModelScenario` and `ReactorScenario` do **not** emulate the kernel'
|
|
|
262
272
|
pinned-generation migration and release; prove delivery with real-client
|
|
263
273
|
integration, not a scenario-only assertion.
|
|
264
274
|
|
|
275
|
+
Requires Chronicle 19.60.0 for webhook generation pinning with
|
|
276
|
+
`WithGenerationDelivery(EventGenerationDelivery.Pinned)` on the .NET builder
|
|
277
|
+
(or direct registration's `GenerationDelivery`). Live delivery, catch-up, replay
|
|
278
|
+
and partition retries use the subscribed generation; unknown or duplicate
|
|
279
|
+
same-id generations fail registration before recording it. Migration/release
|
|
280
|
+
failure sends no request and fails the batch for retry. Check client/kernel
|
|
281
|
+
versions; older webhooks retain compatibility delivery, not this guarantee.
|
|
282
|
+
|
|
265
283
|
## Do not model absence with a nullable property
|
|
266
284
|
|
|
267
285
|
**CHR0012** (warning) flags a nullable property on an `[EventType]` record.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!-- Copyright (c) Cratis. All rights reserved. -->
|
|
2
|
+
<!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
|
|
3
|
+
|
|
4
|
+
# Explicit migration endpoints
|
|
5
|
+
|
|
6
|
+
Requires Chronicle 19.52.0. Check the client package version; older clients need
|
|
7
|
+
marked events and `EventTypeMigration<TUpgrade, TPrevious>` discovery.
|
|
8
|
+
|
|
9
|
+
Register plain or aliased event generations through
|
|
10
|
+
`ChronicleOptions.ExplicitArtifacts.RegisterEventType<T>(configure)` before
|
|
11
|
+
creating stores, then `RegisterMigration<TMigration>()` (or its `Type` form).
|
|
12
|
+
Migration nomination does not register missing endpoints. Both endpoints must
|
|
13
|
+
be registered, share one id and have adjacent generations.
|
|
14
|
+
|
|
15
|
+
A typed migration over unmarked or aliased endpoints uses the additive protected
|
|
16
|
+
`EventTypeMigration<TUpgrade, TPrevious>(IEventTypes)` constructor. Pass the
|
|
17
|
+
owning registry to `base(eventTypes)`; the client binds it to the store's finalized
|
|
18
|
+
catalog rather than another registry in ordinary DI. The parameterless base
|
|
19
|
+
keeps declaration-only semantics; listing it explicitly does not change those.
|
|
20
|
+
|
|
21
|
+
A nominated plain concrete closed class declares these public synchronous
|
|
22
|
+
instance methods (signature fragments):
|
|
23
|
+
|
|
24
|
+
```csharp
|
|
25
|
+
void Upcast(IEventMigrationBuilder<TUpgrade, TPrevious> builder)
|
|
26
|
+
void Downcast(IEventMigrationBuilder<TPrevious, TUpgrade> builder)
|
|
27
|
+
void MapValues(IEventValueMapBuilder<TUpgrade, TPrevious> builder)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`Upcast` and `Downcast` are required; `MapValues` is optional. Use the same
|
|
31
|
+
property/value builders as typed migrations. No static, generic, async-void,
|
|
32
|
+
overloaded or ambiguous roles; one ordinary parameter per role. Plain migration
|
|
33
|
+
definers must not implement disposal interfaces, because the provider does not
|
|
34
|
+
own disposal. Invalid recipes fail preparation even when no discovered upgrade
|
|
35
|
+
would otherwise select them. There is no new Native AOT/trimming guarantee.
|
|
36
|
+
|
|
37
|
+
For concurrency restricted to an aliased event, resolve
|
|
38
|
+
`store.EventTypes.GetEventTypeFor(typeof(TEvent))` and pass that `EventType` to
|
|
39
|
+
`WithEventType`, rather than a declaration-only generic helper that cannot know
|
|
40
|
+
the store-local alias. Custom schema generators resolving explicit compensation
|
|
41
|
+
targets need the registry-aware overloads or throw
|
|
42
|
+
`RegistryAwareEventTypeSchemasNotSupported`.
|
|
43
|
+
|
|
44
|
+
Run `dotnet build -c Debug` and migration specs with `dotnet test`; assert both
|
|
45
|
+
directions and real observer delivery where pinning or protected-value release
|
|
46
|
+
matters. A successful nomination alone does not prove a generation can be read.
|
|
@@ -97,6 +97,13 @@ The same file's "Trusted reverse proxies" section specifies:
|
|
|
97
97
|
Forward public HTTPS for HTTPS-sensitive middleware. Do not trust a public
|
|
98
98
|
HTTP scheme while fronting a TLS listener: cookie mutations fail antiforgery.
|
|
99
99
|
|
|
100
|
+
Requires Chronicle 19.55.0 for configurable kernel gRPC receive/send limits.
|
|
101
|
+
Receive defaults to 100 MiB; send is unlimited unless configured. Set
|
|
102
|
+
`Cratis__Chronicle__MaxReceiveMessageSize` / `__MaxSendMessageSize` in bytes.
|
|
103
|
+
Check the deployed kernel version; older kernels' 4 MiB receive limit can cause
|
|
104
|
+
`ResourceExhausted` even when the client permits 100 MiB. Bound batches rather
|
|
105
|
+
than increasing limits without accounting for memory.
|
|
106
|
+
|
|
100
107
|
## Probe without opening another API entrance
|
|
101
108
|
|
|
102
109
|
Set `health.port` for a dedicated HTTP/1.1 probe listener. `health.tls=false`
|
|
@@ -120,6 +127,7 @@ Read [recovery and upgrades](references/operations.md) when changing observer
|
|
|
120
127
|
retry/quarantine settings, definition evolution, retention, alerts, or restoring
|
|
121
128
|
and upgrading a cluster. See **cratis-chronicle-web-workbench** for browser
|
|
122
129
|
exposure and **cratis-chronicle-cli-operations** for authorized live operations.
|
|
130
|
+
Several services share one kernel with one event store each: see **cratis-multi-service-architecture**, and **cratis-multi-service-local-orchestration** for an AppHost or compose file.
|
|
123
131
|
|
|
124
132
|
## Verify
|
|
125
133
|
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
# Recovery, retention and upgrades
|
|
5
5
|
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
- Observer behavior
|
|
9
|
+
- Causation values and incidents
|
|
10
|
+
- SQL database ownership
|
|
11
|
+
- Upgrade and restore
|
|
12
|
+
|
|
6
13
|
Source: `Cratis/Chronicle`:
|
|
7
14
|
`Documentation/hosting/configuration/{observers,events,clustering}.md`,
|
|
8
15
|
`Documentation/hosting/production.md`,
|
|
@@ -34,6 +41,30 @@ Sources: `Documentation/concepts/observers.mdx`,
|
|
|
34
41
|
`Documentation/projections/registration-lifecycle.md`, and
|
|
35
42
|
`Source/Kernel/Core/Observation/Jobs/{CatchUpObserver,ReplayObserver}.cs`.
|
|
36
43
|
|
|
44
|
+
Requires Chronicle 19.56.0 for authorized `FastForward` on .NET `IReactors`,
|
|
45
|
+
`IReducers` and `IProjections` (by observer id or generic artifact), and the
|
|
46
|
+
Workbench action. It moves to the sequence tail, discards failed partitions and
|
|
47
|
+
keeps built state without invoking skipped events. Inspect `FastForwardResult`
|
|
48
|
+
and its outcome: replaying/unavailable is not success. Record the exact observer,
|
|
49
|
+
position and skipped scope before authorization; replay from the required history
|
|
50
|
+
is a recovery action, not automatic undo. Check the kernel/client version;
|
|
51
|
+
older deployments have no fast-forward operation.
|
|
52
|
+
|
|
53
|
+
Requires Chronicle 19.62.2 for suspected-skip diagnostics:
|
|
54
|
+
`chronicle-observer-events-suspected-skipped` and
|
|
55
|
+
`chronicle-appended-events-queue-events-possibly-undelivered`, with rate-limited
|
|
56
|
+
warnings identifying the affected observer/position/reason. Delivery behavior is
|
|
57
|
+
unchanged; absence of a warning does not prove complete historical processing.
|
|
58
|
+
|
|
59
|
+
Requires Chronicle 19.59.4 for `Shutdown:DrainTimeout`
|
|
60
|
+
(`Cratis__Chronicle__Shutdown__DrainTimeout`, default eight seconds), capped below
|
|
61
|
+
the host shutdown timeout. It bounds in-flight observer completion and MongoDB
|
|
62
|
+
buffer flushing; overdue work is logged and recorded as failed where time allows.
|
|
63
|
+
Requires 19.55.2 for catch-up/replay progress to wait for confirmed buffered writes
|
|
64
|
+
on every silo and resume from the last durable position after a failed window.
|
|
65
|
+
Check the kernel version and shutdown logs; neither guarantee makes an interrupted
|
|
66
|
+
external effect exactly once.
|
|
67
|
+
|
|
37
68
|
### Next-event lookup failures
|
|
38
69
|
|
|
39
70
|
Routing keeps the saved position and defers observation when
|
|
@@ -74,6 +105,17 @@ payloads. Inspect the configured metrics endpoint and incident queries; counters
|
|
|
74
105
|
are operational evidence, not proof that a failed partition recovered. Do not
|
|
75
106
|
reintroduce high-cardinality partition labels into exported failure metrics.
|
|
76
107
|
|
|
108
|
+
## SQL database ownership
|
|
109
|
+
|
|
110
|
+
Requires Chronicle 19.62.3 for recorded SQL database bindings in the cluster
|
|
111
|
+
`DatabaseNames` table and hashed names beyond PostgreSQL's 63-byte/SQL Server's
|
|
112
|
+
128-character limits. Existing bindings do not move automatically. An ambiguous
|
|
113
|
+
truncated legacy deployment fails with `DatabaseOwnershipUnresolved`; follow the
|
|
114
|
+
product's SQL database-name migration guide before restarting, never reset its
|
|
115
|
+
storage to bypass the failure. Overlong cluster names fail startup, and incomplete
|
|
116
|
+
migrations fail with `DatabaseMigrationIncomplete`. Check the kernel version and
|
|
117
|
+
inspect bindings before an authorized migration; older naming can share databases.
|
|
118
|
+
|
|
77
119
|
## Upgrade and restore
|
|
78
120
|
|
|
79
121
|
Upgrade every silo together before registering new event generations. Add-only
|
|
@@ -196,6 +196,7 @@ the tenant identifier in the resolver rather than relying on that.
|
|
|
196
196
|
| Comparing sequence numbers across namespaces | they are independent sequences |
|
|
197
197
|
| Erasing personal data in one namespace and calling it done | erasure is per namespace |
|
|
198
198
|
| Relying on namespace casing | lookup is case-insensitive, storage naming is not |
|
|
199
|
+
| Modeling each service as a namespace of one store, or naming a tenant's namespace differently per service | a namespace is a tenant inside one store; forwarding between services' stores keeps the namespace name (`cratis-multi-service-architecture`) |
|
|
199
200
|
|
|
200
201
|
## Verify
|
|
201
202
|
|
package/package/corpus/skills/cratis-chronicle-projection/references/model-bound-attributes.md
CHANGED
|
@@ -70,6 +70,12 @@ from AutoMap and CHR0024. Sources: `Projections/ModelBound/NotProjectedAttribute
|
|
|
70
70
|
| `[SubtractFrom<T>]` | `<T>` | `(string? eventPropertyName = default)` | property, parameter; repeatable |
|
|
71
71
|
| `[ClearWith<T>]` | `<T>` | **none** | class, property, parameter; repeatable |
|
|
72
72
|
|
|
73
|
+
Requires Chronicle 19.51.1 for dotted CLR member paths in model-bound attributes
|
|
74
|
+
and naming-policy conversion of every nested path segment. Check the client/kernel
|
|
75
|
+
versions; earlier nested mappings can remain empty. A corrected definition follows
|
|
76
|
+
`observers.definitionEvolution`: Automatic rebuilds it, while PartialOnly/Manual
|
|
77
|
+
can recommend replay. Do not assume upgrading repaired stored state.
|
|
78
|
+
|
|
73
79
|
## Counters
|
|
74
80
|
|
|
75
81
|
| Attribute | Arity | Parameters | Targets |
|
|
@@ -130,6 +130,13 @@ public class PullRequestItemProjection : IProjectionFor<PullRequestItem>
|
|
|
130
130
|
}
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
+
A non-entering event appended before creation is retained as an early join:
|
|
134
|
+
it cannot create the variant, but its value is applied when the entering event
|
|
135
|
+
creates it. Requires Chronicle 19.57.1 for `ReadModelScenario` to reproduce this
|
|
136
|
+
and fluent-variant removal of peers, and for CHR0024 to recognize entering/shared
|
|
137
|
+
mapping sources. Check the testing/analyzer versions; older scenarios can miss
|
|
138
|
+
these states. Specify both early-join admission and mutually exclusive variants.
|
|
139
|
+
|
|
133
140
|
**Why this matters:** without the reclassification, an out-of-order or
|
|
134
141
|
replayed `BuildCompleted` could resurrect a `PullRequestItem` for an entity
|
|
135
142
|
that has since moved to another variant — or one that was never a pull request
|
|
@@ -41,8 +41,8 @@ effects. If the answer is "populate a queryable model", it is not a reactor.
|
|
|
41
41
|
|
|
42
42
|
Scenario guards: see [specifications](references/specifications.md).
|
|
43
43
|
|
|
44
|
-
> **There is no `ReactorSideEffect`
|
|
45
|
-
> `
|
|
44
|
+
> **There is no `ReactorSideEffect` return-value wrapper.** Use the supported
|
|
45
|
+
> returns below; the `[ReactorSideEffect]` marker does not wrap an effect.
|
|
46
46
|
|
|
47
47
|
## Write the reactor
|
|
48
48
|
|
|
@@ -64,6 +64,9 @@ public class <ReactorName>(<IServiceType> <serviceName>) : IReactor
|
|
|
64
64
|
`Cratis.Chronicle.Reactors.IReactor` is a **marker interface with no members**.
|
|
65
65
|
Reactors are discovered by that interface — the `[Reactor]` attribute is optional
|
|
66
66
|
and is not what makes a class a reactor. Generic types are not discovered.
|
|
67
|
+
Requires Chronicle 19.52.0 for plain-class nomination; read
|
|
68
|
+
[discovery](../cratis-chronicle-client-dotnet/references/discovery.md) when a
|
|
69
|
+
contract assembly cannot reference Chronicle.
|
|
67
70
|
|
|
68
71
|
## Dispatch and parameters
|
|
69
72
|
|
|
@@ -84,7 +87,8 @@ A handler takes at least one parameter. Further parameters resolve by type:
|
|
|
84
87
|
An unresolvable parameter throws. CHR0004 warns against primitive, value-type
|
|
85
88
|
or string dependencies after the event: use context, a read model or a service.
|
|
86
89
|
|
|
87
|
-
The first parameter must
|
|
90
|
+
The first parameter must be a registered event type (CHR0005 error); explicit
|
|
91
|
+
registration evidence needs Chronicle 19.52.0 (see discovery above).
|
|
88
92
|
|
|
89
93
|
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.
|
|
90
94
|
|
|
@@ -107,7 +111,8 @@ synchronous returns. Custom `IReactorSideEffectHandler` implementations can
|
|
|
107
111
|
claim synchronous types through `CanHandleReturnType(Type)`; they are not
|
|
108
112
|
restricted to `Task<T>`. An unclaimed return value **fails the partition** with
|
|
109
113
|
`UnhandledReactorReturnValue`, naming its type. CHR0054 flags an unsupported
|
|
110
|
-
return type at build time.
|
|
114
|
+
return type at build time. Read references/return-event-metadata.md for custom returns (`[ReactorSideEffect]` requires Chronicle 19.63.0).
|
|
115
|
+
Source: `Reactors/EventHandlerMethods.cs`,
|
|
111
116
|
`Reactors/SideEffects/IReactorSideEffectHandler.cs`, `Reactors/UnhandledReactorReturnValue.cs`.
|
|
112
117
|
|
|
113
118
|
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.
|
|
@@ -194,8 +199,9 @@ An automation that turns another area's facts into intent runs a command
|
|
|
194
199
|
identity and imperative pipeline alternative, use **cratis-arc-command-execution**
|
|
195
200
|
and **cratis-arc-command** rather than reimplementing command dispatch here.
|
|
196
201
|
A reactor has no caller principal: choose the authorized identity explicitly.
|
|
197
|
-
Keep `[OnceOnly]` and idempotency
|
|
198
|
-
|
|
202
|
+
Keep `[OnceOnly]` and idempotency. Expected refusals use `Invoke.Command` branches
|
|
203
|
+
in **cratis-arc-command-execution**; handling stops remaining invocations.
|
|
204
|
+
Unhandled refusals and framework failures remain partition failures. Inline operations can run again on reactor retry and do not
|
|
199
205
|
replace durable delivery; see **cratis-arc-command-operation**.
|
|
200
206
|
Mixed event-and-command returns and their ordering are owned by the Arc skills.
|
|
201
207
|
|
|
@@ -260,7 +266,7 @@ including passive ones; nullable parameters still need explicit absence.
|
|
|
260
266
|
handler per event type.
|
|
261
267
|
- Every additional parameter resolves to the event context, `ReactorDelivery`, a
|
|
262
268
|
read model, or a service.
|
|
263
|
-
- No handler returns
|
|
269
|
+
- No handler returns an invented `ReactorSideEffect` wrapper.
|
|
264
270
|
- No `IEventLog` is injected; side-effect events are returned instead.
|
|
265
271
|
- Handlers returning events carry `[OnceOnly]`.
|
|
266
272
|
- Side effects are idempotent even with `[OnceOnly]`, because recovery
|
|
@@ -5,9 +5,16 @@ This reference holds the outbox and inbox routing for cross-service facts.
|
|
|
5
5
|
### Cross-service events
|
|
6
6
|
|
|
7
7
|
Cross-service facts route through the outbox and inbox rather than a shared log.
|
|
8
|
-
The producer
|
|
9
|
-
|
|
8
|
+
The producer can append its public contract event to the outbox sequence or
|
|
9
|
+
publish it there as eligible projection/reducer event output; `[Public]` alone
|
|
10
|
+
does not forward every event-log append. The consuming observer listens on the
|
|
11
|
+
implicit inbox sequence for the source store.
|
|
10
12
|
Chronicle creates or reuses that subscription from the observer's `[EventStore]`
|
|
11
13
|
metadata, or from `[EventStore]` on the event type or its assembly. Put
|
|
12
14
|
`[assembly: EventStore("<source-store>")]` in a contracts project when every
|
|
13
15
|
event there originates from one service.
|
|
16
|
+
|
|
17
|
+
Requires Chronicle 19.62.1 for forwarded outbox events to retain append tags as
|
|
18
|
+
well as event-source/stream routing. Check the deployed kernel version; older
|
|
19
|
+
forwarded events stay untagged and are not backfilled by an upgrade. Cover a
|
|
20
|
+
matching and excluded inbox event before relying on tag-filtered observers.
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This reference holds the returned-event examples, the cross-stream wrapper and where append metadata for a bare event comes from.
|
|
4
4
|
|
|
5
|
+
Requires Chronicle 19.63.0 for `[ReactorSideEffect]`
|
|
6
|
+
(`Cratis.Chronicle.Reactors.SideEffects`) to mark a custom synchronous return type
|
|
7
|
+
for CHR0054, including arrays and `IEnumerable<T>`. The marker informs the
|
|
8
|
+
analyzer only; a registered `IReactorSideEffectHandler` must still claim/process
|
|
9
|
+
the value. Check client/analyzer versions with `dotnet list package`; older
|
|
10
|
+
analyzers flag synchronous custom returns even when the runtime handler accepts them.
|
|
11
|
+
|
|
5
12
|
### Returning events instead of injecting `IEventLog`
|
|
6
13
|
|
|
7
14
|
Return events rather than inject `IEventLog`: **a convention, not an analyzer
|
package/package/corpus/skills/cratis-chronicle-reactor/references/slice-delivery-checklist.md
CHANGED
|
@@ -80,8 +80,8 @@ fails the partition. Decide from the contract, in this order:
|
|
|
80
80
|
type or treating every validation failure as a duplicate. Preserve the modeled system identity
|
|
81
81
|
when using the pipeline; a returned command's role handling is not implicit in an imperative call.
|
|
82
82
|
2. A refusal branch states the disposition: realize its exact selector and its acknowledgment
|
|
83
|
-
or produced fact. Screenplay refusal branches
|
|
84
|
-
|
|
83
|
+
or produced fact. Screenplay refusal branches reference-execute as v19 (Requires Screenplay 4.160.0);
|
|
84
|
+
render admission is a separate question per target, and hand-written delivery keeps the model as the contract.
|
|
85
85
|
3. The redelivery specification expects an error, or no redelivery disposition is stated: do not
|
|
86
86
|
acknowledge on your own, because that changes failure behavior. Report the possibility of a
|
|
87
87
|
paused partition on recovery as an edit request to the model owner.
|
|
@@ -107,7 +107,7 @@ fact, not handled (`references/domain-failures.md`).
|
|
|
107
107
|
- [ ] The slice contract was read first and every trigger, condition, command and field came from it
|
|
108
108
|
- [ ] The trigger event is an `[EventType]` from the owning contracts project
|
|
109
109
|
- [ ] The command (or events) it fires exists and has its own specifications
|
|
110
|
-
- [ ] One handler per trigger event; first parameter is the trigger; no `ReactorSideEffect
|
|
110
|
+
- [ ] One handler per trigger event; first parameter is the trigger; no invented `ReactorSideEffect` wrapper, no injected `IEventLog`
|
|
111
111
|
- [ ] Every command or event field is mapped from the trigger, an injected read model or a stated mapping; none invented or defaulted
|
|
112
112
|
- [ ] Every skip condition is the contract's, with a specification on each side of it
|
|
113
113
|
- [ ] Handlers that return events or commands carry `[OnceOnly]`; the effect is idempotent regardless
|
|
@@ -57,7 +57,7 @@ void Establish() => _scenario.Given.ForEventSourceId(_id).NoReadModel<Order>();
|
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
The builders live in `Cratis.Chronicle.Testing.Reactors`. Exact signatures on
|
|
60
|
-
`ReactorSourceGivenBuilder<TReactor>` (`where TReactor : class
|
|
60
|
+
`ReactorSourceGivenBuilder<TReactor>` (`where TReactor : class`; plain reactors require explicit nomination):
|
|
61
61
|
|
|
62
62
|
```csharp
|
|
63
63
|
public ReactorSourceGivenBuilder<TReactor> ReadModel<TReadModel>(TReadModel readModel)
|
|
@@ -128,10 +128,16 @@ Specify the contract, not only the happy path:
|
|
|
128
128
|
- **Repeated delivery.** Recovery re-delivers the same event even with
|
|
129
129
|
`[OnceOnly]`, so specify what the reactor does the second time (one effect, an
|
|
130
130
|
idempotent write, or a receipt keyed by `ReactorDelivery`). The scenario gives
|
|
131
|
-
every event
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
every event passed through `Given.Events` its own sequence number, so firing
|
|
132
|
+
the same event twice there is two occurrences, not redelivery. Requires
|
|
133
|
+
Chronicle 19.61.0 for `History` and `Redeliver`: record without invoking using
|
|
134
|
+
`var occurrence = await scenario.Given.ForEventSource(id).History(@event);`,
|
|
135
|
+
then `await scenario.Redeliver(occurrence);` twice. The original context,
|
|
136
|
+
stream routing and `ReactorDelivery` identity are preserved, with ordinary
|
|
137
|
+
filters, explicit read-model setup and produced-event recording. Both
|
|
138
|
+
class-based and fluent scenarios support it; `History` does not append to the
|
|
139
|
+
event store. Check the testing package version; on older packages call the
|
|
140
|
+
handler twice with the same context/delivery or test the receipt collaborator. Map a contract redelivery specification
|
|
135
141
|
one to one: deliver the same trigger with the same delivery identity, or call directly with the
|
|
136
142
|
command already applied, and assert its disposition (no new events, the named fact, or refusal
|
|
137
143
|
surfaced as failure). The refusing-command procedure is in `slice-delivery-checklist.md`.
|
|
@@ -179,7 +179,10 @@ The rules Arc's discovery actually enforces:
|
|
|
179
179
|
reach for ASP.NET's `[Route]`.
|
|
180
180
|
|
|
181
181
|
Read [references/queries.md](references/queries.md) for the `Observe` family and
|
|
182
|
-
the difference between snapshot and observable queries.
|
|
182
|
+
the difference between snapshot and observable queries. Read
|
|
183
|
+
references/collection-observation.md when exposing a Chronicle-maintained list:
|
|
184
|
+
Requires Chronicle 19.54.0 for storage-independent `IReadModels.Observe<T>()`,
|
|
185
|
+
with registered keys and protected-value release.
|
|
183
186
|
|
|
184
187
|
## Step 5 — Or read the instance directly
|
|
185
188
|
|
|
@@ -196,9 +199,10 @@ so an id can be passed directly. **The declared return type is not nullable even
|
|
|
196
199
|
though no instance may exist** — check the result before dereferencing it.
|
|
197
200
|
|
|
198
201
|
Neighbouring members include `GetInstances<T>`, `GetSnapshotsById<T>`,
|
|
199
|
-
`Watch<T>`, `Release<T>`, and `Register`. **There is no
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
`Watch<T>`, `Observe<T>(filter)`, `Release<T>`, and `Register`. **There is no
|
|
203
|
+
general predicate or `IQueryable` snapshot surface on `IReadModels`**.
|
|
204
|
+
The observation filter runs client-side after release; it does not narrow server
|
|
205
|
+
reads, transport, sorting or paging.
|
|
202
206
|
|
|
203
207
|
### `[Passive]` when the read must be current
|
|
204
208
|
|