@cratis/pi 8.3.0 → 8.4.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/frontend-quality.instructions.md +1 -0
- package/package/corpus/harnesses/copilot/instructions/orleans.instructions.md +5 -0
- package/package/corpus/hooks/scripts/cratis-cleanup-worktrees.sh +5 -1
- package/package/corpus/rules/frontend-quality.md +1 -0
- package/package/corpus/rules/orleans.md +5 -0
- package/package/corpus/skills/cratis-arc-authorize-request/references/authproxy.md +4 -0
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +1 -0
- package/package/corpus/skills/cratis-arc-declare-operation/references/csharp-recovery.md +2 -2
- package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +2 -0
- package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp-services.md +14 -0
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/network-and-tls.md +28 -1
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/troubleshooting.md +3 -0
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-fluent.md +1 -1
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +9 -0
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +9 -0
- package/package/corpus/skills/cratis-observability/references/csharp.md +1 -1
- package/package.json +1 -1
|
@@ -13,4 +13,5 @@ paths:
|
|
|
13
13
|
- Show whether an action is offered from a read-model property or Arc availability, never a client copy of the business rule or threshold, which drifts from the server's decision.
|
|
14
14
|
- Keep a helper or component in its slice until a second slice needs it; promoting a one-off freezes it as shared API.
|
|
15
15
|
- Split a crowded component by behavior, not line count, so each part owns one concern, and keep keyboard reachability, visible focus and actionable errors in each part.
|
|
16
|
+
- Never use `dangerouslySetInnerHTML`; render values as React children, which escape them, since injected markup can run script in the user's session. If a feature needs stored HTML shown as markup, stop and ask.
|
|
16
17
|
- Give every interactive element, including icon-only buttons, an accessible name, since an unnamed control is announced only by its role, and walk a keyboard-only path through submit, refusal and dismissal. See `cratis-components-accessibility`.
|
|
@@ -25,6 +25,11 @@ profile: framework
|
|
|
25
25
|
- Reach storage through kernel `IStorage`, never through database driver calls from a grain or a storage provider; the storage backend is chosen behind it. Jobs are the exception: their providers belong to Choreography and take its `IJobsStorage`, registered under Choreography's own `WellKnownGrainStorageProviders.Jobs` and `.JobSteps`.
|
|
26
26
|
- Tune storage retries in the `Chronicle:ResilientStorage` configuration section, never with a retry loop in a grain.
|
|
27
27
|
|
|
28
|
+
## Kernel grain map
|
|
29
|
+
|
|
30
|
+
- Before adding a grain, extend the one that already owns the concern: `INamespaces`, `IProjectionsManager`, `IReducersManager`, `IReadModelsManager`, `IEventStoreSubscriptionsManager` and `IWebhooks` are one grain per event store, keyed by the event store name.
|
|
31
|
+
- Key a grain scoped more narrowly with its key record, never a hand-built string: `EventSequenceKey` for `IEventSequence`, `ObserverKey` for `IObserver`, `ProjectionKey` for `IProjection`, `ReadModelGrainKey` for `IReadModel` and `ReadModelReplayManagerGrainKey` for `IReadModelReplayManager`.
|
|
32
|
+
|
|
28
33
|
## Hosting, jobs and reminders
|
|
29
34
|
|
|
30
35
|
- Choose clustering in the host, never in grain code. Run more than one kernel replica only with `MongoDB` or `Sql` clustering (`Cratis__Chronicle__Clustering__Type`) and the same storage and cluster id on every replica, because a second `Localhost` replica on shared storage only waits for the first one's single-writer lease.
|
|
@@ -391,7 +391,7 @@ lsof_matches() {
|
|
|
391
391
|
/^f./ { kind = substr($0, 2); type = ""; next }
|
|
392
392
|
/^t./ { type = substr($0, 2); next }
|
|
393
393
|
/^n/ {
|
|
394
|
-
seen_name = 1; path = substr($0, 2)
|
|
394
|
+
seen_name = 1; path = substr($0, 2); name = path
|
|
395
395
|
if (ignored || path == "(revoked)") next
|
|
396
396
|
# A diagnostic suffix can follow the target directory itself, not just a child path.
|
|
397
397
|
sub(/ (\(stat:|\(FD info error:|FD info error:).*/, "", path)
|
|
@@ -414,6 +414,10 @@ lsof_matches() {
|
|
|
414
414
|
if (path ~ /^(anon_inode:)?\[[[:alnum:]_]+(:[0-9]+(,[0-9]+)*)?\]$/) next
|
|
415
415
|
# lsof truncates long names, leaving a digit/comma list ending in `...` with no closing bracket.
|
|
416
416
|
if (path ~ /^(anon_inode:)?\[[[:alnum:]_]+:[0-9,]*\.\.\.$/) next
|
|
417
|
+
# Some lsof builds keep the closing bracket after the ellipsis. Only an a_inode record qualifies,
|
|
418
|
+
# because a Unix socket can be bound to that literal file name, and the unstripped name must
|
|
419
|
+
# match, so no diagnostic suffix can hide behind it.
|
|
420
|
+
if (type == "a_inode" && name ~ /^(anon_inode:)?\[[[:alnum:]_]+:[0-9,]*\.\.\.\]$/) next
|
|
417
421
|
if (type == "a_inode" && path ~ /^(anon_inode:)?[[:alnum:]_]+$/) next
|
|
418
422
|
if (type == "unix" && path ~ /^type=[[:upper:]]+( \([[:upper:]]+\))?$/) next
|
|
419
423
|
if (type == "netlink" && path ~ /^[[:upper:]_]+$/) next
|
|
@@ -12,4 +12,5 @@ paths:
|
|
|
12
12
|
- Show whether an action is offered from a read-model property or Arc availability, never a client copy of the business rule or threshold, which drifts from the server's decision.
|
|
13
13
|
- Keep a helper or component in its slice until a second slice needs it; promoting a one-off freezes it as shared API.
|
|
14
14
|
- Split a crowded component by behavior, not line count, so each part owns one concern, and keep keyboard reachability, visible focus and actionable errors in each part.
|
|
15
|
+
- Never use `dangerouslySetInnerHTML`; render values as React children, which escape them, since injected markup can run script in the user's session. If a feature needs stored HTML shown as markup, stop and ask.
|
|
15
16
|
- Give every interactive element, including icon-only buttons, an accessible name, since an unnamed control is announced only by its role, and walk a keyboard-only path through submit, refusal and dismissal. See `cratis-components-accessibility`.
|
|
@@ -24,6 +24,11 @@ profile: framework
|
|
|
24
24
|
- Reach storage through kernel `IStorage`, never through database driver calls from a grain or a storage provider; the storage backend is chosen behind it. Jobs are the exception: their providers belong to Choreography and take its `IJobsStorage`, registered under Choreography's own `WellKnownGrainStorageProviders.Jobs` and `.JobSteps`.
|
|
25
25
|
- Tune storage retries in the `Chronicle:ResilientStorage` configuration section, never with a retry loop in a grain.
|
|
26
26
|
|
|
27
|
+
## Kernel grain map
|
|
28
|
+
|
|
29
|
+
- Before adding a grain, extend the one that already owns the concern: `INamespaces`, `IProjectionsManager`, `IReducersManager`, `IReadModelsManager`, `IEventStoreSubscriptionsManager` and `IWebhooks` are one grain per event store, keyed by the event store name.
|
|
30
|
+
- Key a grain scoped more narrowly with its key record, never a hand-built string: `EventSequenceKey` for `IEventSequence`, `ObserverKey` for `IObserver`, `ProjectionKey` for `IProjection`, `ReadModelGrainKey` for `IReadModel` and `ReadModelReplayManagerGrainKey` for `IReadModelReplayManager`.
|
|
31
|
+
|
|
27
32
|
## Hosting, jobs and reminders
|
|
28
33
|
|
|
29
34
|
- Choose clustering in the host, never in grain code. Run more than one kernel replica only with `MongoDB` or `Sql` clustering (`Cratis__Chronicle__Clustering__Type`) and the same storage and cluster id on every replica, because a second `Localhost` replica on shared storage only waits for the first one's single-writer lease.
|
|
@@ -77,6 +77,10 @@ A bearer route admits two kinds of credential and treats them differently. It do
|
|
|
77
77
|
- `PassCallerAuthorizationPaths` forwards the caller's `Authorization` header unchanged on a path that is also listed in `AnonymousPaths`; an entry missing from `AnonymousPaths` stops AuthProxy at startup. AuthProxy does not validate that header, so the application becomes the only check. Reserve it for a request that proves itself with its own scheme; prefer a bearer route for tokens.
|
|
78
78
|
- An entry that is not a rooted path of literal segments is discarded with a startup warning, and the path stays authenticated.
|
|
79
79
|
|
|
80
|
+
## Sign-in providers
|
|
81
|
+
|
|
82
|
+
Declare the identity providers in one place only. For a Screenplay deployment, list them as `Kind` and `Identity` pairs under `Cratis:AuthProxy:Application:Providers` and supply their values per environment (`cratis-environments-and-secrets` skill). Only a standalone AuthProxy without that list configures them directly under `Cratis:AuthProxy:Authentication` (`OidcProviders`, `OAuthProviders`). With both present AuthProxy exits with code 78 before it listens, reporting that `Cratis:AuthProxy:Application:Providers` cannot be combined with providers configured under `Cratis:AuthProxy:Authentication`. Remove one of the two; do not split the providers between them.
|
|
83
|
+
|
|
80
84
|
## Sessions across tenant hosts
|
|
81
85
|
|
|
82
86
|
`Session:CookieDomain` shares one sign-in across hosts under a parent domain. It cannot be combined with `SubHost` tenant resolution: AuthProxy refuses to start, because one session would then be valid on every tenant's host. With a tenant per sub-host, leave `CookieDomain` empty so each tenant host keeps its own session.
|
|
@@ -176,6 +176,7 @@ Failures when the state cannot be loaded. The first two are client-input failure
|
|
|
176
176
|
| `AmbiguousReadModelLookup` | Chronicle read model: several command properties have the model's key type. | Select one with `[LookUpBy(nameof(...))]`. |
|
|
177
177
|
| `InvalidLookUpBy` | `[LookUpBy]` names a missing property, sits on a non-read-model parameter, combines the property and provider forms, or `Provide` supplies a value for a caller-keyed parameter. | Use exactly one lookup form on a read-model parameter and let Arc load it. |
|
|
178
178
|
| `CommandReadModelKeysMissing` | Chronicle read model: the generated key metadata for the command or read model is absent while generated metadata is required. That is the default, and always the case where dynamic code is unavailable. | Enable the Arc source generator in the project that declares the type. Setting `ReadProtection:RequireGeneratedMetadata` to `false` instead falls back to reflection with a warning, only on a runtime that supports dynamic code. |
|
|
179
|
+
| `ReadCannotBeProtected` | Chronicle read protection `On`: the parameter's read model has a shape the decision guard cannot cover (a reducer with constructor dependencies or an event filter, joins or children, a key taken from an event property, a key whose read-model schema is neither a string without a format nor a `Guid` with format `guid` or `uuid` (the CLR type alone does not decide this), another event sequence, pinned generation delivery), or the parameter is an `IMongoCollection<T>` of a Chronicle read model. | Apply the fix the message names for that parameter: inject the read model itself, or read a source-keyed model without those features. Mark the parameter `[Unprotected("why")]` only if it cannot affect the decision. Under `Measure` or `On`, analyzer `ARCCHR0024` warns for the refused shapes visible in source; `ARCCHR0026` reports the `IMongoCollection<T>` parameter (a warning under `On`). |
|
|
179
180
|
| `ProtectedReadModelKeyAccessorMissing` | Chronicle read protection: a key is a custom record or class (not a scalar, concept or tuple) that the source generator could not describe, for example a partial or external type. | Before the host starts, call `ProtectedReadModelKeyAccessors.Register<WarehouseKey>(new(nameof(WarehouseKey.Warehouse), key => key.Warehouse), new(nameof(WarehouseKey.Section), key => key.Section))` (`Cratis.Arc.Chronicle.ReadModels`) with every public readable instance property, once per concrete type. Prefer a concept or scalar key. |
|
|
180
181
|
|
|
181
182
|
A spec that only asserts "the command was refused" also passes on `DependencyUnavailable`, where no rule ran. Assert the specific rule failure.
|
|
@@ -29,9 +29,9 @@ result.ShouldHaveCompensatedOperation<HoldSeat>();
|
|
|
29
29
|
|
|
30
30
|
Assert the provider released **that ID** and the original failure remains. For success, use `result.ShouldHaveExecutedOperation<HoldSeat>()` (completed, not merely entered). For rejected validation or failed preflight use `result.ShouldHaveNoOperationInvocations()`. Scenario methods with the same names assert on its last result; `scenario.Operations` exposes its outcomes. `Validate` alone does not execute operations.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
`result.Recovery` is a nullable `CommandRecoverySummary`. Inspect its `CommitDisposition` and `Status`: `NotNeeded`, `Completed` (callbacks returned), `Incomplete` (some did not), `Suppressed` (known commit), `Indeterminate` (unknown/mixed). Assert `StartedCount`, `CompletedCount`, `CompensatedCount`, `FailedCompensationCount`, `UncompensatedCount` to distinguish entry, acknowledgement and cleanup. In the lost-acknowledgement test expect one started, zero completed and one compensated. For an uncertain commit after entry, expect `CommandRecoveryStatus.Indeterminate` and no release.
|
|
33
33
|
|
|
34
|
-
Each `result.OperationOutcomes` entry
|
|
34
|
+
Each `result.OperationOutcomes` entry is a `CommandOperationOutcome` with `InvocationIndex`, `OperationType`, `ExecutionCompleted`, `Compensation` (`NotNeeded`, `Completed`, `Failed`, `NotAvailable`, `BudgetExpired`, `Suppressed`) and optional `CompensationFailure`. Test batch failure by recording provider calls: the throwing entry must be released before earlier ones, and unstarted entries never appear. Neither recovery property is an HTTP response field.
|
|
35
35
|
|
|
36
36
|
## Custom execution scope
|
|
37
37
|
|
|
@@ -356,6 +356,8 @@ Origins must be valid origins or `*`; queue capacity must be positive. Health `R
|
|
|
356
356
|
|
|
357
357
|
`transferMode: "full"` sends full snapshots; `"delta"` sends a snapshot first and then changes; omission retains snapshots alongside subsequent changes. This contract is for subject-backed collections on the hub. Delta delivery is chosen by the subscriber, not the server: the hub compares consecutive collection results by each item's `Id` property and sends added, replaced and removed items. Give list read models a stable `Id`; without one every emission is a full list.
|
|
358
358
|
|
|
359
|
+
Comparison costs time proportional to the list. A producer that already knows which items changed (one watching a change stream, for example) states the delta instead: emit `new ObservedCollection<ParkingPermit>(items, changes)` (`Cratis.Arc.Queries`) in place of the plain list, where `items` is still the whole current list and `changes` holds one `new CollectionChange(CollectionChangeKind.Replaced, permit.Id)` per changed item (`Added`, `Replaced` or `Removed`, with the item's `Id` value). Pass `null` for `changes` when the producer does not know the delta (the initial result, a re-read): the hub then falls back to comparing that emission with the previous one. A subscription's first emission is always delivered as the whole list, whatever `changes` says. `ObservedCollection<T>` implements `IHaveKnownChanges`; implement that interface on your own collection type only when you cannot use it. The hub skips a change whose `Id` is in neither the current nor the previous list, so never state a change the list does not reflect.
|
|
360
|
+
|
|
359
361
|
## Date-sensitive live queries
|
|
360
362
|
|
|
361
363
|
A live list such as "permits expiring today" must change at midnight even when no data changes. Re-evaluate the candidates at clock boundaries:
|
package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp-services.md
CHANGED
|
@@ -8,6 +8,7 @@ Names are illustrative.
|
|
|
8
8
|
- Everything on the event store
|
|
9
9
|
- Who and why: identity, correlation and causation
|
|
10
10
|
- Connection failures
|
|
11
|
+
- Artifact discovery and registration failures
|
|
11
12
|
- Federation management
|
|
12
13
|
|
|
13
14
|
## Services you can inject
|
|
@@ -67,6 +68,19 @@ The client reconnects by itself. Do not write a reconnect loop; decide only what
|
|
|
67
68
|
|
|
68
69
|
On first start the client waits for a kernel that is not up yet instead of failing, so a host can boot before its kernel; readiness belongs to the health check. All these exceptions are in `Cratis.Chronicle.Connections`.
|
|
69
70
|
|
|
71
|
+
## Artifact discovery and registration failures
|
|
72
|
+
|
|
73
|
+
These are mistakes in the application's own types, not connection problems: fix the code, never retry.
|
|
74
|
+
|
|
75
|
+
| Exception | Cause | Fix |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| `TypeImplementsMultipleProjectionInterfaces` | Discovery found a class implementing `IProjectionFor<>` for more than one read model; the message lists them | One projection class per read model |
|
|
78
|
+
| `TypeMustImplementOnlyOneReducer` | Discovery found a class implementing more than one `IReducerFor<>` | One reducer class per read model |
|
|
79
|
+
| `VariantReadModelsCannotBeRegisteredExplicitly` | `Projections.Register<T>()` was called for a model-bound variant or a global handler of one, or the callback of `Projections.Register<T>(define)` declares a variant | Let discovery register variants; they are wired together with their siblings |
|
|
80
|
+
| `TypeBasedArtifactRegistrationNotSupported` | A custom `IReactors` or `IReducers` implementation was called through a `Type` overload it does not implement: `Register`, `GetStateFor` or `Replay` on either, or `GetHandlerFor` on `IReactors` | Implement the `Type` overloads on the custom registry, or use the built-in one |
|
|
81
|
+
|
|
82
|
+
Analyzer CHR0057 warns about the first two at build time; treat it as an error.
|
|
83
|
+
|
|
70
84
|
## Federation management
|
|
71
85
|
|
|
72
86
|
Federation lets two independently operated kernels exchange public events. It is set up by operators, normally in the Workbench or CLI; `cratis-chronicle-deploy-kernel` owns the model and the kernel configuration. The same operations exist on the client for automation:
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- Ports
|
|
6
6
|
- TLS on the kernel port
|
|
7
|
+
- Certificate renewal
|
|
7
8
|
- Run behind an HTTPS proxy
|
|
8
9
|
- Trust forwarded headers
|
|
9
10
|
- Health probes
|
|
@@ -45,6 +46,31 @@ and REST, chosen per connection. Publish only 35000 from a single-node kernel.
|
|
|
45
46
|
trust the issuing certificate authority; connecting with TLS validation
|
|
46
47
|
switched off is for local development only.
|
|
47
48
|
|
|
49
|
+
## Certificate renewal
|
|
50
|
+
|
|
51
|
+
Renew the TLS certificate by replacing the file at `tls.certificatePath`; no
|
|
52
|
+
restart is needed. The kernel checks the file on a TLS handshake, at most once
|
|
53
|
+
every 30 seconds, and logs `TLS certificate reloaded from disk` with the
|
|
54
|
+
subject, thumbprint and expiry. New connections get the new certificate; open
|
|
55
|
+
connections keep the one they started with.
|
|
56
|
+
|
|
57
|
+
- Keep the same password. `tls.certificatePassword` is read only at startup,
|
|
58
|
+
so a new password needs a restart.
|
|
59
|
+
- Keep the `serverAuth` and `clientAuth` usages. A renewal that drops
|
|
60
|
+
`clientAuth` loads without complaint and then breaks cluster connections.
|
|
61
|
+
- A bad file never replaces a good one; the current certificate stays in use.
|
|
62
|
+
A file that cannot be read (missing, no permission) is retried silently. A
|
|
63
|
+
file that reads but is not a valid PFX for the password (half written, wrong
|
|
64
|
+
password) logs one error for that content; the next change is tried again.
|
|
65
|
+
- In Kubernetes, mount the whole Secret as a directory, or select keys with
|
|
66
|
+
`items`. A Secret mounted with `subPath` is never updated, so the renewal
|
|
67
|
+
never reaches the kernel. Allow about a minute for the kubelet to sync.
|
|
68
|
+
- Kernels before 19.172.11 do not detect a renewal delivered through a
|
|
69
|
+
symbolic link, which is how a Secret volume updates; Kubernetes updates the
|
|
70
|
+
volume, but those kernels need a restart to serve it.
|
|
71
|
+
- Only the TLS certificate reloads. The encryption certificate never does;
|
|
72
|
+
see Encryption certificate below.
|
|
73
|
+
|
|
48
74
|
## Run behind an HTTPS proxy
|
|
49
75
|
|
|
50
76
|
Use this only when a TLS-terminating proxy fronts a private kernel port. Set
|
|
@@ -127,7 +153,8 @@ development image works without one; a production image requires it while the
|
|
|
127
153
|
kernel issues its own tokens. A configured path that does not exist stops
|
|
128
154
|
startup. Every node needs
|
|
129
155
|
the same certificate ring (the active certificate and its `previous` list); the
|
|
130
|
-
ring loads at startup,
|
|
156
|
+
ring loads at startup and, unlike the TLS certificate, is never reloaded, so
|
|
157
|
+
any change to it needs a restart. Back every certificate up
|
|
131
158
|
with the data; losing one makes what it protected unreadable.
|
|
132
159
|
|
|
133
160
|
Overwriting the file at `certificatePath` with a new key pair is not a
|
|
@@ -9,10 +9,13 @@ changing it. Client-side connection problems belong to the
|
|
|
9
9
|
| Production container exits at start mentioning a certificate | No TLS or encryption certificate configured | `tls.certificatePath`, `encryptionCertificate.certificatePath` in [network and TLS](network-and-tls.md) |
|
|
10
10
|
| Container exits at start mentioning the authority | TLS is off and no external HTTPS authority is set | `authentication.authority` in [authentication](authentication.md) |
|
|
11
11
|
| `/health/live` is 200 but `/health/ready` stays 503 | Storage unreachable, startup still running, or another kernel holds the single-writer lease | Storage connection; [upgrade and recovery](upgrade-and-recovery.md) |
|
|
12
|
+
| A renewed TLS certificate is not served | The Secret is mounted with `subPath`, the password changed, the new file is unreadable (no log) or not a valid PFX (one error logged), or a kernel older than 19.172.11 missed a symlink-delivered renewal | Certificate renewal in [network and TLS](network-and-tls.md) |
|
|
12
13
|
| Probe fails with a TLS error | The probe cannot validate the kernel certificate | `health.port` with `health.tls: false` and `health.exclusive: true` |
|
|
13
14
|
| Probe fails behind a TLS-terminating proxy | The main port speaks only cleartext HTTP/2 when TLS is off | A dedicated `health.port` |
|
|
14
15
|
| Appends fail with a transaction error on MongoDB | MongoDB is a standalone server | Use a replica set; [storage](storage.md) |
|
|
15
16
|
| The kernel starts on an empty store | Wrong `storage.connectionDetails`, a different `databaseNamePrefix`, or container-local storage was lost | [Storage](storage.md) |
|
|
17
|
+
| Startup or the first use of a new event store or namespace fails with `DatabaseDoesNotExist` or `SchemaDoesNotExist` | `storage.createIfMissing` is `false` and the named database or schema was not provisioned | Provision what the message names before it is first used, or set `createIfMissing` to `true`; [storage](storage.md) |
|
|
18
|
+
| SQL Server fails with `DefaultSchemaMismatch` | The schema the kernel resolved for that database (`storage.schema`, or the one from `storage.connectionResolution`) differs from the default schema of the user it connects as, and SQL Server puts unqualified tables in the user's default schema | Run `ALTER USER [user] WITH DEFAULT_SCHEMA = [schema]` with the schema the message names, for every user the kernel connects as; [storage](storage.md) |
|
|
16
19
|
| `ResourceExhausted` on a large append or query | A gRPC message size limit | `maxReceiveMessageSize`, `maxSendMessageSize`, and the client's matching limit |
|
|
17
20
|
| The Workbench returns 404 | `features.workbench` or `features.api` is off, or the base path is wrong | [Configuration reference](configuration.md); `workbench.basePath` |
|
|
18
21
|
| The Workbench or API returns 401 for everything | No administrator set up yet, or a token from an authority the kernel does not trust | [Authentication](authentication.md) |
|
|
@@ -74,6 +74,8 @@ For this variant change the migration class header to `public class ParcelRoutin
|
|
|
74
74
|
- Registration starts add-only historical backfill in the default namespace's event log. Check an old stored event there, and inventory other namespaces and sequences separately. Reading a transiently derived representation does not prove it was persisted.
|
|
75
75
|
- Compatibility delivery (default) is not a pin. Set `options.EventGenerationDelivery = EventGenerationDelivery.Pinned` (`Cratis.Chronicle.Observation`) for pinned delivery. Declare exactly one generation per event ID for that observer: a pinned reactor, reducer, projection or subscription that names two generations of one ID is refused with `MultipleGenerationsOfEventTypeInObserver`. To consume two generations, use two observers. For explicit event-store subscriptions use `subscription.WithGenerationDelivery(EventGenerationDelivery.Pinned).WithEventType("parcel-routed", 1)`; webhook definition builders also accept `WithGenerationDelivery`. Verify the actual generation and business values on live and catch-up delivery.
|
|
76
76
|
- The client-wide option pins reactors, reducers and typed materialized projections; a projection pins the generation each `From`, join, child, key and removal clause names, one generation per event ID across all clauses. It does not pin subscriptions, webhooks, or immediate, passive or wildcard projections. In a handler, `EventContext.EventType.Generation` is the delivered generation and `EventContext.AppendedGeneration` the original one (null when unknown). A pin that is unregistered or unreachable by migration fails with `PinnedEventTypeGenerationUnavailable`. Changing a pin or delivery mode does not replay; request a replay to rebuild prior state.
|
|
77
|
+
- The kernel checks pins again when a client observer, subscription or webhook is registered, and refuses it with: `ObserverPinsMultipleGenerationsOfEventType` (two generations of one ID; use two observers), `EventTypeGenerationNotRegisteredForObserver` (the exact pinned generation is not registered; register the generation and its migration first) or `EventGenerationDeliveryNotSupported` (pinned delivery asked of an observer that cannot provide it, such as a projection over all events or a graph projection; use compatibility delivery there).
|
|
78
|
+
- A pinned event store subscription must name at least one pin, or it is refused with `EventStoreSubscriptionHasNoGenerationPins`, and each pinned generation must be registered in both the source and the target store. If a generation becomes unavailable during delivery, the failure is `EventStoreSubscriptionGenerationUnavailable` and the partition is parked: register the generation in both stores, then retry the partition.
|
|
77
79
|
- `ReactorScenario` and `ReadModelScenario` exercise the handler with the type you feed them; they do not emulate kernel generation selection, migration or protected-value release. Prove pinned delivery with a real client against a kernel.
|
|
78
80
|
|
|
79
81
|
## Not supported in this SDK
|
|
@@ -199,7 +199,7 @@ Without `UsingParentKey` the event source id selects the parent. Two child opera
|
|
|
199
199
|
| `RemovedWith<TEvent>(r => r.UsingKey(e => e.Id))` | Key from the event; also `UsingKeyFromContext`, `UsingCompositeKey`, `UsingConstantKey` and the parent-key methods. |
|
|
200
200
|
| `RemovedWithJoin<TEvent>()` in a child scope | Remove the matching child from every parent, for an event of the child's own source. Accepts the key methods. |
|
|
201
201
|
|
|
202
|
-
`RemovedWithJoin` at root removes nothing
|
|
202
|
+
`RemovedWithJoin` at root removes nothing: the client logs a warning and leaves it out of the definition it sends. To remove a root on an event of another source, use `RemovedWith<TEvent>` with `UsingKey` on the event property that holds the root's key.
|
|
203
203
|
|
|
204
204
|
## Every handled event and all events
|
|
205
205
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- Default path
|
|
6
6
|
- Common mistakes
|
|
7
|
+
- Definition diagnostics
|
|
7
8
|
- Projection-level options
|
|
8
9
|
- Registration and identity
|
|
9
10
|
- Indexes
|
|
@@ -46,6 +47,14 @@ Read it with `IReadModels` (`eventStore.ReadModels`): `GetInstanceById<Order>(or
|
|
|
46
47
|
- Put model-bound mappings on the read model; do not also register a separate builder for it.
|
|
47
48
|
- Use a materialized projection for joins across sources, not a passive projection.
|
|
48
49
|
|
|
50
|
+
## Definition diagnostics
|
|
51
|
+
|
|
52
|
+
| Signal | Cause | Fix |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `DuplicatePropertyInProjection` while a fluent definition is built | One `From`, `Join`, `FromEvery` or composite-key block defines the same read-model property or dictionary entry twice | One operation per property in each block |
|
|
55
|
+
| CHR0042 (warning) at build | A property is written both locally and by a join. The joined value is re-applied after local mappings and always wins, so the local write cannot reset it once a joined event exists | Give each fact its own property and derive the outcome from both. Suppress only when the join is meant to keep the property fresh |
|
|
56
|
+
| A client log warning that remove via join at the root is not supported; nothing is removed | `RemovedWithJoin` declared at the root. The client drops it from the definition it sends, so the kernel never sees it | `RemovedWith` at the root; `RemovedWithJoin` only in a child scope |
|
|
57
|
+
|
|
49
58
|
## Projection-level options
|
|
50
59
|
|
|
51
60
|
| Need | Attribute on the read model | Fluent builder |
|
|
@@ -63,6 +63,15 @@ public class PublishLane : IProjectionFor<ParcelCleared>
|
|
|
63
63
|
|
|
64
64
|
For a code-based fold use `class FoldLane : IReducerFor<ParcelCleared>` with `public ParcelCleared On(ParcelInspected inspection, ParcelCleared? current) => new(inspection.Lane);`. Neither requires a sink declaration. Only for output other than cross-store publication, put `[PublishTo("clearance-feed")]` on the **target** or configure `e.PublishTo("clearance-feed")`. It does not grant public eligibility. The default output is the outbox; the event log is not an allowed override.
|
|
65
65
|
|
|
66
|
+
The client validates an event target when it registers it. The kernel refuses a competing publisher at registration, and a compliance-bearing target later, when it first sets up publishing for it:
|
|
67
|
+
|
|
68
|
+
| Exception | Cause | Fix |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| `PrivateEventTypeCannotBePublishedToOutbox` (client) | The target goes to the outbox but is not public for the connected store | Put `[Public]` on the target, or declare it with `[EventStore("dispatch")]` on the type or its contracts assembly |
|
|
71
|
+
| `EventLogIsNotAPublicationTarget` (client) | The target's `PublishTo` names the event log | Remove the override to use the outbox, or name another sequence |
|
|
72
|
+
| `EventPublisherConflict` (kernel, at registration) | A second projection or reducer publishes the same event type ID to the same sequence; the generation makes no difference | Keep one publisher; give an independent fold its own target type or destination |
|
|
73
|
+
| `EventSequenceTargetCarriesCompliance` (kernel, after registration succeeded) | The target's schema carries compliance metadata such as `[PII]` | Publish a target without protected members; never strip the marker to get past the refusal |
|
|
74
|
+
|
|
66
75
|
## Manage a filtered route explicitly
|
|
67
76
|
|
|
68
77
|
Use this **instead of** implicit forwarding when independent identity, tag filtering or fixed generations are required. Put `[EventSequence("inbox-dispatch")]` on the consuming reactor, not `[EventStore]`. On producer append, surround the write with `using var audience = EventTags.Audience("tracking");` and `using var region = EventTags.Scope("region", "north");` (keep retry metadata identical). Alternatively a `[property: Audience]` string contract property supplies its audience value. To pass the tags on the call rather than ambiently, use `outbox.AppendWithNamedTags(parcelId, fact, [new NamedTag("region", "north")])`, or `AppendOnceWithNamedTags` with the idempotency key before the tags.
|
|
@@ -152,7 +152,7 @@ builder.AddCratis(configureChronicleBuilder: chronicle => chronicle.WithTelemetr
|
|
|
152
152
|
| `Legacy` (default) | `client.event_sequence.append`, `client.reactor.handle`, ... | Legacy keys only: `event_store_name`, `namespace_name`, `event_sequence_id`, `event_source_type`, `event_source_id`, `reactor_id`, `reducer_id`, `correlation_id` |
|
|
153
153
|
| `Convention` | `cratis.chronicle.client.*` (constants on `WellKnownClientSpanNames`, namespace `Cratis.Chronicle.Diagnostics`) | Legacy keys plus `cratis.event_store.name`, `cratis.event_store.namespace`, `cratis.event_sequence.id`, `cratis.event_source.type`, `cratis.event_source.id`, `cratis.observer.id`, `cratis.observer.type`, `cratis.correlation_id` (constants on `WellKnownTelemetryAttributes`) |
|
|
154
154
|
|
|
155
|
-
Choose `Convention` for new dashboards; it keeps the `Legacy` keys too, so existing queries keep matching. Configuration alternative: `Cratis:Chronicle:Telemetry:SpanNames`.
|
|
155
|
+
The callback receives `ChronicleTelemetryOptions`, the same object as `ChronicleOptions.Telemetry`. Choose `Convention` for new dashboards; it keeps the `Legacy` keys too, so existing queries keep matching. Configuration alternative: `Cratis:Chronicle:Telemetry:SpanNames`.
|
|
156
156
|
|
|
157
157
|
- Append spans carry `cratis.chronicle.append.outcome`: `success`, `error`, `concurrency_violation` or `constraint_violation`.
|
|
158
158
|
- Failures set Error status and `error.type` (exception type or a short code), never a message. Reactor and reducer spans cover one delivery.
|