@cratis/pi 7.148.0 → 7.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/package/corpus/hooks/scripts/cratis-guard-secrets.sh +30 -16
  2. package/package/corpus/product-sync.json +2 -0
  3. package/package/corpus/skills/cratis-arc-command/references/proxy-generation.md +28 -0
  4. package/package/corpus/skills/cratis-arc-configuration/SKILL.md +89 -0
  5. package/package/corpus/skills/cratis-arc-configuration/references/arc-options.md +93 -0
  6. package/package/corpus/skills/cratis-arc-configuration/references/data-and-protection-keys.md +52 -0
  7. package/package/corpus/skills/cratis-arc-configuration/references/frontend-and-routes.md +53 -0
  8. package/package/corpus/skills/cratis-arc-configuration/references/symptoms.md +23 -0
  9. package/package/corpus/skills/cratis-chronicle-client-dotnet/references/connection-options.md +29 -4
  10. package/package/corpus/skills/cratis-chronicle-configuration/SKILL.md +87 -0
  11. package/package/corpus/skills/cratis-chronicle-configuration/references/client-options.md +80 -0
  12. package/package/corpus/skills/cratis-chronicle-configuration/references/development-inner-loop.md +77 -0
  13. package/package/corpus/skills/cratis-chronicle-configuration/references/environment-variables.md +66 -0
  14. package/package/corpus/skills/cratis-chronicle-configuration/references/kernel-options.md +87 -0
  15. package/package/corpus/skills/cratis-chronicle-configuration/references/symptoms.md +53 -0
  16. package/package/corpus/skills/cratis-screenplay-reverse-engineering/SKILL.md +22 -4
  17. package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/behavior-catalog.md +5 -0
  18. package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/evidence-format.md +23 -0
  19. package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/executable-intake.md +13 -0
  20. package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/fidelity-check.md +13 -2
  21. package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/probing-and-naming.md +29 -4
  22. package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/process-drift.md +56 -0
  23. package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/provenance.md +1 -1
  24. package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/scoping.md +6 -0
  25. package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/synthesis-rules.md +38 -3
  26. package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/target-and-first-validation.md +3 -0
  27. package/package/corpus/skills/cratis-screenplay-reverse-engineering/scripts/drift-scope-self-test.mjs +87 -0
  28. package/package/corpus/skills/cratis-screenplay-reverse-engineering/scripts/drift-scope.mjs +155 -0
  29. package/package/corpus/skills/cratis-screenplay-reverse-engineering/scripts/fixtures/solocrm-drift/README.md +23 -0
  30. package/package/corpus/skills/cratis-screenplay-reverse-engineering/scripts/fixtures/solocrm-drift/change.diff +131 -0
  31. package/package/corpus/skills/cratis-screenplay-reverse-engineering/scripts/fixtures/solocrm-drift/evidence-map.json +39 -0
  32. package/package/corpus/skills/cratis-screenplay-reverse-engineering/scripts/fixtures/solocrm-drift/expected.json +52 -0
  33. package/package/corpus/skills/cratis-screenplay-reverse-engineering/verification.json +3 -1
  34. package/package/profile-catalog.json +2 -0
  35. package/package.json +1 -1
  36. package/src/index.ts +47 -35
@@ -0,0 +1,80 @@
1
+ # Client options
2
+
3
+ ## Contents
4
+
5
+ - Where client options come from
6
+ - ChronicleOptions
7
+ - ASP.NET Core options
8
+ - Connection-string switches
9
+ - Limits that must match the kernel
10
+
11
+ ## Where client options come from
12
+
13
+ Precedence, lowest to highest: built-in default, `Cratis:Chronicle`
14
+ configuration section, connection string, code in the options callback. The
15
+ event store name is required and has no default.
16
+
17
+ ## ChronicleOptions
18
+
19
+ | Setting | Default | Change it when |
20
+ | --- | --- | --- |
21
+ | `EventStore` (client options) | none, required | Always: name the event store the application writes to. |
22
+ | `ProgramIdentifier` | `[N/A]` | Several applications share a kernel and you need to tell them apart in logs and the Workbench. |
23
+ | `ConnectTimeout` | 5 seconds | The kernel starts slowly or the network is slow; raise it instead of retrying in application code. |
24
+ | `AutoDiscoverAndRegister` | `true` | Registering artifacts explicitly. Set `false` only together with an explicit artifact list. |
25
+ | `RegistrationMode` | `Inline` | Registration must not block startup; check the options type before choosing another mode. |
26
+ | `RegistrationRetry` | 5 attempts, 2 second initial delay, 30 second maximum delay | Startup races the kernel (compose, orchestrators). Raise attempts or delay rather than adding sleeps. |
27
+ | `SkipKeepAlive` | `false` | A short-lived client (a CLI command, a job) that should not hold keep-alive pings. |
28
+ | `SkipCompatibilityCheck` | `false` | Connecting deliberately to a kernel version the client does not declare compatible. Leave on otherwise. |
29
+ | `UnitOfWorkLifecyclePolicy` | `Compatibility` | `Strict` to fail on units of work that are never completed. |
30
+ | `EventGenerationDelivery` | `Compatibility` | Opting into the newer event generation delivery behavior. |
31
+ | `ArtifactIdentityDrift` | `Warn` | `Error` in CI to fail on renamed or drifted artifact identities. |
32
+ | `DefaultSinkTypeId` | MongoDB | Read models should default to another sink type. |
33
+ | `ClaimsBasedNamespaceResolverClaimType` | `tenant_id` | The identity provider carries the tenant in another claim. |
34
+ | `EnableEventTypeGenerationValidation` | `false` | Only a development kernel honors this; a production kernel always enforces migration-chain validation. |
35
+ | `MaxReceiveMessageSize` / `MaxSendMessageSize` | 100 MiB each | See [limits that must match the kernel](#limits-that-must-match-the-kernel). |
36
+ | `Tls.SkipCertificateValidation` | `true` | Any deployed client: set `false` against a certificate that can be verified. |
37
+ | `Tls.CaCertificatePath` | not set | The kernel certificate is issued by a private authority the client machine does not trust. |
38
+ | `Reactors.MaxConcurrentPartitions`, `Reducers.MaxConcurrentPartitions` | processor count, capped at 8 | Handler code is not thread-safe (set 1) or the machine has spare capacity for more partitions. One partition's batches stay ordered. Client-side only; the kernel `observers` section is separate. |
39
+
40
+ Telemetry options exist under the client's telemetry section; read the product
41
+ documentation for span naming and event-source id tracing before changing them.
42
+ The hash key used to pseudonymize event source ids must be at least 32
43
+ characters.
44
+
45
+ ## ASP.NET Core options
46
+
47
+ | Setting | Default | Change it when |
48
+ | --- | --- | --- |
49
+ | `NamespaceHttpHeader` | `x-cratis-tenant-id` | Your gateway sends the tenant in another header. |
50
+ | `UseAutomaticMiddleware` | `true` | You order the Chronicle middleware yourself. |
51
+ | Namespace resolver | HTTP header resolver | Tenant comes from a claim, subdomain or fixed value. The header and subdomain resolvers read caller-set values; set or strip the header at a trusted gateway, or use the claims resolver. |
52
+ | Unit-of-work `ReportFailuresBeforeResponseStarts` | `false` | The response should fail before it starts when a unit of work fails. |
53
+
54
+ ## Connection-string switches
55
+
56
+ Connection-string syntax and every query option are in
57
+ `cratis-chronicle-client-dotnet` (connection options). The switches that change
58
+ runtime behavior:
59
+
60
+ | Switch | Effect | Use when |
61
+ | --- | --- | --- |
62
+ | `skipTlsValidation=false` | Verify the kernel certificate | Every deployed client |
63
+ | `disableTls=true` | Cleartext HTTP/2 to the kernel | The kernel sits behind a private proxy or port-forward with `Tls:Enabled` false; never across an untrusted network |
64
+ | `auth=none` | No authentication | Together with `disableTls`, for a kernel with authentication off |
65
+ | `apiKey=<token>` | Bearer token from an external authority | The kernel uses an external identity provider |
66
+ | `skipKeepAlive=true`, `skipCompatibilityCheck=true` | Same as the options above | Same as the options above |
67
+ | `caCertificatePath=<file>` | Trust a private CA | Private certificate authority |
68
+
69
+ With `disableTls`, explicit client credentials are refused because they would
70
+ travel in the clear. The Elixir client has an extra `authPort` option; the .NET
71
+ client does not recognize it.
72
+
73
+ ## Limits that must match the kernel
74
+
75
+ gRPC message size is enforced on both ends. The client defaults and the kernel
76
+ `maxReceiveMessageSize` default are both 100 MiB. When a large event, batch or
77
+ read-model payload fails with `ResourceExhausted`, raise the limit on the
78
+ receiving side first, then on the sending side, and keep client and kernel
79
+ values aligned. A kernel `maxReceiveMessageSize` of `null` removes the kernel
80
+ limit.
@@ -0,0 +1,77 @@
1
+ # Development inner loop
2
+
3
+ ## Contents
4
+
5
+ - Start the development kernel
6
+ - Connect an application
7
+ - First Workbench sign-in
8
+ - TLS switches
9
+ - Leaving development
10
+
11
+ ## Start the development kernel
12
+
13
+ Use the development image, which bundles MongoDB and is built with the
14
+ `DEVELOPMENT` symbol:
15
+
16
+ ```yaml
17
+ services:
18
+ chronicle:
19
+ image: cratis/chronicle:latest-development
20
+ ports:
21
+ - "127.0.0.1:35000:35000"
22
+ - "127.0.0.1:27017:27017"
23
+ ```
24
+
25
+ `latest-development-slim` omits MongoDB; supply a replica-set MongoDB yourself
26
+ (appends use transactions, so a standalone server fails). Publish ports on
27
+ loopback only.
28
+
29
+ The development image generates a self-signed certificate on every start,
30
+ generates ephemeral keys, honors a default administrator password and creates a
31
+ development client application. None of this is available in the production
32
+ image, and environment variables cannot turn the production image into a
33
+ development kernel.
34
+
35
+ ## Connect an application
36
+
37
+ The kernel listens on port 35000 over HTTPS. The default and development
38
+ connection strings target `chronicle://localhost:35000`. With client
39
+ credentials unset the .NET client falls back to the development client
40
+ credentials, and certificate validation is skipped by default, so a development
41
+ pair connects with no setup. Do not copy that default to a deployed client.
42
+
43
+ The Workbench is served from the same port: `https://localhost:35000`. A browser
44
+ warns about the self-signed certificate; accept it for local work.
45
+
46
+ ## First Workbench sign-in
47
+
48
+ The Workbench requires sign-in before any view loads; unauthenticated requests
49
+ return 401 and the app redirects to `/login`. On the development image sign in
50
+ as `Admin` with the development default password, which the Chronicle
51
+ repository's local-development rule and the development documentation state.
52
+ These credentials are valid only on a developer machine. A production kernel
53
+ instead uses the setup token from its startup log, `initialAdminSetupToken`, or
54
+ the `adminUser` bootstrap (see [kernel options](kernel-options.md)).
55
+
56
+ ## TLS switches
57
+
58
+ | Need | Switch | Notes |
59
+ | --- | --- | --- |
60
+ | Local client against the self-signed development certificate | Nothing; validation is skipped by default | Set `skipTlsValidation=false` to test real verification. |
61
+ | Reach the kernel through a port-forward or private proxy that forwards h2c | Kernel `tls.enabled=false` and `authentication.enabled=false` (isolated development only); client `disableTls=true` | Example connection string: `chronicle://localhost:35001/?disableTls=true&auth=none`. With authentication on, TLS off refuses to start unless `authentication.authority` is an external HTTPS issuer. Explicit credentials are refused with `disableTls`. |
62
+ | Token from an external identity provider over a proxy | `disableTls=true` with `apiKey=<token>` | The token travels in the clear on that hop; keep it on a private link. |
63
+ | Private CA | `caCertificatePath=<file>` | Client trust only; the kernel still needs its own certificate. |
64
+
65
+ ## Leaving development
66
+
67
+ Before a shared or deployed environment:
68
+
69
+ - Switch to a production image, pinned to a tested release.
70
+ - Remove the persisted development client application and any configuration that
71
+ recreates it; switching storage to a production kernel does not remove it.
72
+ - Set `skipTlsValidation=false` and configure a real certificate.
73
+ - Replace development credentials and the default administrator password.
74
+ - Review `Webhooks` and `ExternalServices` `Validation`, which differ between
75
+ images.
76
+
77
+ Production topology and certificates are in `cratis-chronicle-hosting`.
@@ -0,0 +1,66 @@
1
+ # Environment variables
2
+
3
+ ## Contents
4
+
5
+ - Naming rule
6
+ - Common variables
7
+ - Secrets
8
+ - Container example
9
+
10
+ ## Naming rule
11
+
12
+ Every kernel option has an environment variable. Prefix `Cratis__Chronicle__`,
13
+ join section names with `__` (double underscore), keep the property name. The
14
+ JSON path `compliance.encryption.migrateFromDefaultStorage` becomes
15
+ `Cratis__Chronicle__Compliance__Encryption__MigrateFromDefaultStorage`. Names are
16
+ case-insensitive. List items take an index:
17
+ `Cratis__Chronicle__Webhooks__AllowedHosts__0`. Per-key dictionaries use the key
18
+ as a segment: `Cratis__Chronicle__Webhooks__EventStoreAllowedHosts__orders__0`.
19
+
20
+ An application's `Cratis:Chronicle` configuration section has the same
21
+ environment form (`Cratis__Chronicle__...`) but is read by the client in the
22
+ application process; set it on the application, not on the kernel container.
23
+
24
+ ## Common variables
25
+
26
+ | Variable | Sets |
27
+ | --- | --- |
28
+ | `Cratis__Chronicle__Port` | Listener port (35000) |
29
+ | `Cratis__Chronicle__Tls__Enabled` | TLS on the listener (default `true`) |
30
+ | `Cratis__Chronicle__Tls__CertificatePath`, `...CertificatePassword` | Listener certificate (PFX) |
31
+ | `Cratis__Chronicle__Storage__Type`, `...ConnectionDetails` | Storage backend and connection |
32
+ | `Cratis__Chronicle__Features__Workbench`, `...Api` | Workbench and REST API |
33
+ | `Cratis__Chronicle__Authentication__Authority` | External identity provider issuer URL |
34
+ | `Cratis__Chronicle__Observers__SubscriberTimeout` | Observer subscriber timeout, seconds |
35
+ | `Cratis__Chronicle__Observers__MaxRetryAttempts` | Observer retries |
36
+ | `Cratis__Chronicle__Clustering__Type` | `Localhost`, `MongoDB` or `Sql` |
37
+ | `Cratis__Chronicle__Clustering__GatewayEnabled` | Orleans client gateway |
38
+ | `Cratis__Chronicle__Webhooks__Validation`, `Cratis__Chronicle__ExternalServices__Validation` | Destination validation mode |
39
+ | `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_SERVICE_NAME` | Telemetry export |
40
+
41
+ The Chronicle hosting documentation's environment variables page holds the
42
+ full table; read it for anything not listed here.
43
+
44
+ ## Secrets
45
+
46
+ Several options have a `*File` form that reads the value from a file, for
47
+ example a mounted Kubernetes Secret: `Cratis__Chronicle__Storage__ConnectionDetailsFile`,
48
+ `...Sinks__Configurations__<name>__ConnectionDetailsFile`,
49
+ `...Neo4j__PasswordFile`. Set either the value or its file variant, not both.
50
+ Use these for connection strings, passwords and tokens; never commit the value.
51
+
52
+ ## Container example
53
+
54
+ ```yaml
55
+ services:
56
+ chronicle:
57
+ image: cratis/chronicle:<tested-release>
58
+ environment:
59
+ Cratis__Chronicle__Storage__ConnectionDetailsFile: /run/secrets/chronicle-storage
60
+ Cratis__Chronicle__Tls__CertificatePath: /certs/chronicle.pfx
61
+ Cratis__Chronicle__Tls__CertificatePassword: ${CHRONICLE_CERT_PASSWORD}
62
+ Cratis__Chronicle__Features__Workbench: "false"
63
+ ```
64
+
65
+ A pinned release tag, not `latest`, is for deployments. Topology, replica sets
66
+ and certificate provisioning are in `cratis-chronicle-hosting`.
@@ -0,0 +1,87 @@
1
+ # Kernel options
2
+
3
+ ## Contents
4
+
5
+ - How the kernel reads configuration
6
+ - Listener, TLS and features
7
+ - Observers, read models, jobs and events
8
+ - Authentication
9
+ - Clustering and storage
10
+ - Development image differences
11
+
12
+ ## How the kernel reads configuration
13
+
14
+ `chronicle.json` at `/app/chronicle.json` plus `Cratis__Chronicle__*`
15
+ environment variables; environment variables win. Keys below are the JSON path
16
+ under the root. Defaults describe the production image unless stated.
17
+
18
+ ## Listener, TLS and features
19
+
20
+ | Key | Default | Change it when |
21
+ | --- | --- | --- |
22
+ | `port` | 35000 | The port clashes or a proxy expects another. Clients must use the same port. |
23
+ | `bindTimeout` | 30 seconds | Startup binds slowly in constrained environments. |
24
+ | `healthCheckEndpoint` | `/health` | A probe expects another path. A dedicated health port is configured separately (`health`). |
25
+ | `maxReceiveMessageSize` | 100 MiB | Clients send payloads above the limit (`ResourceExhausted`). `null` removes the limit. Keep aligned with the client's send limit. |
26
+ | `shutdown.drainTimeout` | 8 seconds | Orchestrator termination grace is shorter or longer than the drain. |
27
+ | `tls.enabled` | `true` | Only behind a private HTTPS proxy: `false` serves HTTP/2 cleartext (h2c) and must never be reachable directly. With authentication on, it also needs an external HTTPS `authentication.authority`, or startup is refused. |
28
+ | `tls.certificatePath`, `tls.certificatePassword` | not set | The production image refuses to start with TLS on and no certificate. |
29
+ | `features.api` | `true` | Turn off the REST API when unused. |
30
+ | `features.workbench` | `true` | Turn off the Workbench on a hardened deployment. |
31
+ | `features.oauthAuthority` | `true` | Authentication uses an external authority; see below. |
32
+ | `features.changesetStorage` | `false` | You need stored changesets and accept the storage cost. |
33
+
34
+ ## Observers, read models, jobs and events
35
+
36
+ | Key | Default | Change it when |
37
+ | --- | --- | --- |
38
+ | `observers.subscriberTimeout` | 30 seconds in code | A subscriber is slow to answer. `0` waits indefinitely during catch-up and replay only. The development configuration file sets 5. |
39
+ | `observers.maxRetryAttempts` | 10 | Failing observers should quarantine sooner or later. |
40
+ | `observers.backoffDelay`, `observers.exponentialBackoffDelayFactor`, `observers.maximumBackoffDelay` | 1 second, factor 2, 600 seconds | Tune retry pacing for transient downstream failures. |
41
+ | `observers.definitionEvolution` | `Automatic` | `Manual` or `PartialOnly` when replays must be scheduled by hand. |
42
+ | `observers.replayOnDefinitionChange` | `false` in code; `true` in the development configuration file | Decide whether a changed definition replays by itself. |
43
+ | `readModels.maxBatchSize` | 500 | Replay batches overload a subscriber or sink; must be above zero. |
44
+ | `jobs.maxParallelSteps` | CPU count minus 1 | Cap or raise parallel job steps (replays, rebuilds). |
45
+ | `events.queues` | 2 | Event append throughput needs more queues. |
46
+
47
+ ## Authentication
48
+
49
+ | Key | Default | Change it when |
50
+ | --- | --- | --- |
51
+ | `authentication.enabled` | `true` | Almost never in production; read the authentication page before turning it off. |
52
+ | `authentication.authority` | empty | An external identity provider issues the tokens. Set its issuer URL; non-empty disables the built-in issuer. Never the kernel's own URL. |
53
+ | `authentication.initialAdminSetupToken` | not set | First administrator setup through a supplied token. Use secret management; remove after setup. |
54
+ | `authentication.adminUser.*` | not set | Bootstrap an administrator by username and password. The password is hashed on first start. |
55
+
56
+ First administrator on a production kernel: the setup token from the startup
57
+ log, a supplied `initialAdminSetupToken`, or the `adminUser` bootstrap. The
58
+ development image instead honors a default administrator password (see
59
+ [development inner loop](development-inner-loop.md)).
60
+
61
+ ## Clustering and storage
62
+
63
+ | Key | Default | Change it when |
64
+ | --- | --- | --- |
65
+ | `clustering.type` | `Localhost` | More than one node: `MongoDB` or `Sql`. Topology belongs to `cratis-chronicle-hosting`. |
66
+ | `clustering.siloPort`, `clustering.gatewayPort` | 11111, 30000 | Ports clash or the network policy fixes them. |
67
+ | `clustering.gatewayEnabled` | `true` | Applications use only HTTP and gRPC: set `false`. |
68
+ | `storage.type` | MongoDB | A different backend. |
69
+ | `storage.connectionDetails` | empty | Always in production; prefer `connectionDetailsFile` for secrets. |
70
+ | `storage.createIfMissing` | `true` | Databases and schemas must be created by an operator. |
71
+
72
+ Sinks, per-namespace storage and encryption certificates are covered by
73
+ `cratis-chronicle-hosting`.
74
+
75
+ ## Development image differences
76
+
77
+ - Compile-time `DEVELOPMENT`: self-signed certificate on every start,
78
+ ephemeral keys, built-in default administrator password honored.
79
+ - `Webhooks.Validation` and `ExternalServices.Validation` default to `Warn` in a
80
+ development image and `BlockLocalAddresses` in the production image (compile
81
+ time). `AllowInsecureHttp` and the loopback exemption follow the runtime
82
+ environment (`Development`), not the image.
83
+ - The development image uses MongoDB at `mongodb://localhost:27017` and a
84
+ `chronicle.json` with a 5 second subscriber timeout and replay on definition
85
+ change.
86
+ - The development client application created by a development kernel persists
87
+ in storage. Moving that storage to a production kernel does not remove it.
@@ -0,0 +1,53 @@
1
+ # Symptoms and the setting behind them
2
+
3
+ ## Contents
4
+
5
+ - Connection and security
6
+ - Limits and timeouts
7
+ - Observers and replay
8
+ - Startup and storage
9
+
10
+ Each row names the usual setting. Confirm the cause before changing it; a row
11
+ is a first hypothesis, not a diagnosis.
12
+
13
+ ## Connection and security
14
+
15
+ | Symptom | Setting to check |
16
+ | --- | --- |
17
+ | Client cannot connect to a local development kernel | Port 35000 published on loopback; connection string host and port; kernel running the development image |
18
+ | TLS or certificate error from a deployed client | `skipTlsValidation=false` with a certificate the client trusts; `caCertificatePath` for a private CA |
19
+ | Client works locally but fails behind a port-forward or proxy | Kernel `tls.enabled` and client `disableTls` must agree; with `disableTls`, use `auth=none` or `apiKey`, not client credentials |
20
+ | `ClientCredentialsRequireTls` or credentials refused | `disableTls=true` with explicit username and password; use `apiKey` from an external authority or restore TLS |
21
+ | 401 from the Workbench or REST API | Sign-in required; development default administrator on the development image only; production setup token or `adminUser` bootstrap |
22
+ | Production kernel refuses to start with TLS on | `tls.certificatePath` and `tls.certificatePassword` missing |
23
+ | External identity provider tokens rejected | `authentication.authority` must be the provider's issuer URL, never the kernel's own URL |
24
+ | Development application still exists after moving to production | Persisted development client application; remove it and any configuration that recreates it |
25
+
26
+ ## Limits and timeouts
27
+
28
+ | Symptom | Setting to check |
29
+ | --- | --- |
30
+ | `ResourceExhausted` or message too large | Raise the receiver's limit first, then the sender's: kernel `maxReceiveMessageSize`, client `MaxReceiveMessageSize` and `MaxSendMessageSize` |
31
+ | Client times out connecting at startup | `ConnectTimeout` (5 seconds), `RegistrationRetry`; kernel not yet ready |
32
+ | Short-lived client keeps a connection open or pings | `SkipKeepAlive` |
33
+ | Version incompatibility error on connect | `SkipCompatibilityCheck` only after confirming the versions are intended |
34
+
35
+ ## Observers and replay
36
+
37
+ | Symptom | Setting to check |
38
+ | --- | --- |
39
+ | Subscriber call times out on slow handlers | `observers.subscriberTimeout` (30 seconds in code); development file sets 5 |
40
+ | Observer quarantined after repeated failures | `observers.maxRetryAttempts`, backoff settings; fix the handler first |
41
+ | Replay did not start after a definition change | `observers.replayOnDefinitionChange`, `observers.definitionEvolution` |
42
+ | Reactor or reducer processes one partition at a time or races | Client `Reactors` / `Reducers` `MaxConcurrentPartitions` |
43
+ | Replay overloads a sink | `readModels.maxBatchSize`, `jobs.maxParallelSteps` |
44
+
45
+ ## Startup and storage
46
+
47
+ | Symptom | Setting to check |
48
+ | --- | --- |
49
+ | Appends fail on a local MongoDB | MongoDB must be a replica set; the bundled development image already is |
50
+ | Kernel starts with empty storage connection | `storage.connectionDetails` or `connectionDetailsFile` (empty by default in production) |
51
+ | Webhook or capture destination rejected locally | `Validation` mode differs per image; `AllowInsecureHttp` works only in the `Development` runtime environment |
52
+ | Several applications indistinguishable in logs | Client `ProgramIdentifier` |
53
+ | Tenant resolved wrongly behind a gateway | `NamespaceHttpHeader`, `ClaimsBasedNamespaceResolverClaimType`; never trust a caller-set header or `Host` alone |
@@ -28,6 +28,7 @@ it scores observable behavior, with names reported separately.
28
28
  | A running app from the system and its executable, no source required | this skill |
29
29
  | Faithful migration or documentation with the source, `file:line` evidence, loss report and expert verification | `cratis-screenplay-legacy-extraction` |
30
30
  | A new system from interviews, workshops or process documents | `cratis-screenplay-discovery` |
31
+ | An accepted model whose observed system has since changed | this skill, [references/process-drift.md](references/process-drift.md) |
31
32
 
32
33
  When source exists and the goal is migration, switch to legacy extraction. When both goals hold,
33
34
  run this skill for the walk and the run, and legacy extraction for the source-backed claims.
@@ -60,7 +61,8 @@ Work area: `.ai-work/screenplay/<slug>/re/` (`captures/`, `EVIDENCE.md`, optiona
60
61
 
61
62
  1. **Intake.** Reuse the brief; ask only what is missing, at most the two discovery questions of
62
63
  the UI walk (start URL and actor, then guidance), one per turn. Record the inputs, the
63
- environment, the approvals, the walk budget and the scope. Scope is the key areas wanted, in
64
+ environment, the approvals, the walk budget and the scope, and a watermark per source
65
+ (version, hash or capture date; `references/evidence-format.md`). Scope is the key areas wanted, in
64
66
  and explicitly out; with none given, inventory first, then propose one and ask once. Read
65
67
  [references/scoping.md](references/scoping.md) for a focused run. Unattended: assume read-only, no hosted
66
68
  model, no writes, no executable runs, and record each assumption. Order of sources: the
@@ -74,7 +76,9 @@ Work area: `.ai-work/screenplay/<slug>/re/` (`captures/`, `EVIDENCE.md`, optiona
74
76
  - **L0 feature inventory**: list what the system lets users do, before any modeling: features
75
77
  and their entry points (screens, navigation, forms, routes in the OpenAPI document or HAR,
76
78
  executable commands and menus, documented jobs and emails), each with the source that covers
77
- it, tagged in / out / boundary against the scope. Modeling starts only from this list; out of
79
+ it, tagged in / out / boundary against the scope. Break each in-scope feature into flows and take
80
+ them one at a time, each small enough to review in one sitting
81
+ (`references/scoping.md`). Modeling starts only from this list; out of
78
82
  scope features are listed, never walked or modeled.
79
83
  - **L1 static**: OpenAPI, product docs and the static inventory of the executable
80
84
  (`references/executable-intake.md`). Source code, if offered, is one more optional input
@@ -92,11 +96,14 @@ Work area: `.ai-work/screenplay/<slug>/re/` (`captures/`, `EVIDENCE.md`, optiona
92
96
  the UI, the time rule recipe, client versus server rules, naming fidelity, observed defects
93
97
  and opaque queries. An API probe batch counts as one walk state per command. **Probe
94
98
  coverage gate:** record every command and probe class in `re/PROBES.md` (accepted, rejected or
95
- `not probed: <reason>`); `not probed` counts as unknown, never as no rule.
99
+ `not probed: <reason>`) and close the file with a per-class coverage check (rule, rejection,
100
+ flow, time, authorization, query shape); `not probed` counts as unknown, never as no rule.
96
101
  3. **Synthesis.** Start only after the probe coverage gate. Write `event-model.md` first (readout before `.play`, see the synthesis rules), then turn evidence rows into candidate elements with the signal rules in
97
102
  [references/synthesis-rules.md](references/synthesis-rules.md). Every write goes through the
98
103
  Screenplay MCP loop of `cratis-screenplay-model-authoring`: propose, read the proposal, apply.
99
- Each step validates; never hand-edit around a diagnostic. Without the MCP server, first-pass
104
+ Before validating, cross-walk every finding to the construct that encodes it or a `GAP` with
105
+ its cause (`references/synthesis-rules.md`, Finding crosswalk). Each step validates; never
106
+ hand-edit around a diagnostic. Without the MCP server, first-pass
100
107
  traps and the run recipe are in
101
108
  [references/target-and-first-validation.md](references/target-and-first-validation.md). Follow the phase skills for craft
102
109
  (`cratis-screenplay-discovery`, `cratis-screenplay-slice-design`,
@@ -127,6 +134,10 @@ Work area: `.ai-work/screenplay/<slug>/re/` (`captures/`, `EVIDENCE.md`, optiona
127
134
  (pass signal: exit 0 and the score block; exit 2 means an invalid catalog). Run
128
135
  `scripts/score-fidelity.mjs --self-test` to check the arithmetic; it executes
129
136
  `scripts/score-fidelity-self-test.mjs` and prints the checked count.
137
+ For process-drift scoping, run `scripts/drift-scope.mjs --self-test`, which executes
138
+ `scripts/drift-scope-self-test.mjs`. The [SoloCrm case](scripts/fixtures/solocrm-drift/README.md)
139
+ uses `scripts/fixtures/solocrm-drift/change.diff`, `scripts/fixtures/solocrm-drift/evidence-map.json`
140
+ and `scripts/fixtures/solocrm-drift/expected.json`; see [process drift](references/process-drift.md).
130
141
 
131
142
  When the sources are only a website, user docs or a description document, or the run must feel
132
143
  like a product on Stage, read
@@ -166,6 +177,13 @@ The model may be offered for acceptance only when each item is a result or "not
166
177
 
167
178
  - The inventory lists every observable entry point with its source or "not covered".
168
179
  - Every slice cites evidence ids; every row has a classification; every unknown has a question.
180
+ - Every finding is encoded or carries a `GAP` cause; the probe coverage check has no empty class.
181
+ - `screenplay test` ran with executed equal to discovered and none failed; its summary line is
182
+ in the report. "Needs an occurrence supplied by the execution request" means the
183
+ specification lacks a `given clock` line.
184
+ - `cratis run` admitted the model: `GET /stage/status` reads `ready`, the admission list is
185
+ empty and the detailed admission lists no artifact as unsupported. One admission issue refuses
186
+ every route; one unsupported command answers 501, and so does every flow that needs it first.
169
187
  - V1 clean on the candidate (`cratis-screenplay-toolchain`), warnings as errors.
170
188
  - The independent review ran, and each slice has a keep, change or remove decision.
171
189
  - Safety: approvals named, captures scrubbed, captures untracked.
@@ -77,6 +77,11 @@ item weights default to 1, and 1.5 for `time` (hardest to infer). A scorer may o
77
77
  weight with a reason in `note`. Never change the split or the catalog after the first score is
78
78
  seen.
79
79
 
80
+ Score a `time` item as a pair: the positive probe and the negative probe of the same rule must
81
+ both hold; an unfiltered list passing only the positive half is a fail. Performer-held time
82
+ rules run only in the rendered app (`cratis run --engine eventmodel`, or render), because the
83
+ semantic sandbox leaves performer bodies out.
84
+
80
85
  ## Naming fidelity is separate
81
86
 
82
87
  Keep the inventory of names (commands, events, read models and queries, screens, constraints,
@@ -19,6 +19,23 @@ combines it with the legacy rows. For the richer table used with source code, se
19
19
  resource, and `RUN-<n>` for an approved run. A `binary` row from assembly reading is `Declared`.
20
20
  - A person or document row cites the section or the person and date.
21
21
 
22
+ ## Watermark
23
+
24
+ Record per feature and per source which state of the system the rows describe, in `STATE.md`
25
+ and, at acceptance, in the feature's `note`:
26
+
27
+ | Source | Watermark |
28
+ |---|---|
29
+ | source code, if offered | source identity (commit plus input digest, legacy extraction) |
30
+ | OpenAPI or docs | sha256 of the fetched file, its stated version and the fetch date |
31
+ | shipped binary or package | sha256, version string and build date |
32
+ | running app (walk, HAR) | version or build id the system shows, environment and capture date |
33
+
34
+ A source with no readable version gets its fetch date and the word `unversioned`. A later run
35
+ compares watermarks per feature before walking: unchanged means "unchanged since <watermark>"
36
+ and the feature is left alone; changed or `unversioned` means re-intake that feature only, with
37
+ stable ids (`process-drift.md`).
38
+
22
39
  ## Probe budget and table
23
40
 
24
41
  A batch of API probes against one command counts as one L2 walk state, not one per case, so
@@ -41,3 +58,9 @@ in `captures/` and cite its file from the rule rows:
41
58
  - Every candidate element cites at least one evidence id; a slice with none is removed or sent
42
59
  back to intake.
43
60
  - Cite ids in a slice `description` ("Evidence: RE-E1, RE-E2") and keep the detail in the table.
61
+ - Each candidate row carries a one-sentence `rationale`: why this evidence became this element
62
+ and name ("two writes in one POST and a 409 on the second: one command with a guard, not two
63
+ events"). At acceptance, promote the rationale with the evidence ids and the watermark into
64
+ the slice `documentation` and the feature `note`, as legacy extraction does
65
+ (`../../cratis-screenplay-legacy-extraction/references/re-entry-and-passes.md`); otherwise the
66
+ evidence is lost when `.ai-work` is discarded.
@@ -7,6 +7,7 @@
7
7
  - Techniques per kind
8
8
  - Managed assembly intake (own .NET app)
9
9
  - Trace one feature end to end
10
+ - Driving a live web app from scripts
10
11
  - Optional external tooling
11
12
  - Locators and evidence rows
12
13
  - Feature coverage
@@ -125,6 +126,18 @@ Write each hop as an evidence row with its locator. A static trace names candida
125
126
  node is not proven to take part. Confirm the path with one observed run before stating it as a
126
127
  rule. A feature with no observed effect stays a candidate.
127
128
 
129
+ ## Driving a live web app from scripts
130
+
131
+ For an owned or test-permitted web app, script the observation instead of clicking by hand:
132
+
133
+ - **Query subscriptions.** A read model the UI shows live is an event stream (SSE). Open the
134
+ query's stream with `curl -N` or a small Node script, run a command in another call, and
135
+ record the pushed rows: that is the observable effect of the command on that view.
136
+ - **Browser driver.** Drive a headless browser over the DevTools protocol (CDP) from a script
137
+ to fill forms, click and read page text; one script per flow, output as a probe table.
138
+ - Both run against the sandbox or approved target only, with fresh marker ids, and write their
139
+ output to `captures/`. Redact tokens from scripts and logs.
140
+
128
141
  ## Optional external tooling
129
142
 
130
143
  A dedicated reverse-engineering MCP server or CLI (for example REA, `https://github.com/morluto/rea`)
@@ -62,7 +62,13 @@ flows; rules and rejections are scored by the catalog probes
62
62
 
63
63
  Passing `screenplay test` does not show that Stage can run the model. After `cratis run`:
64
64
 
65
- 1. Read `GET /stage/status`; the state must not be `unsupported`.
65
+ 1. Read `GET /stage/status`; the state must be `ready`. A refused model serves
66
+ `/stage/semantic/admission` instead and answers every `/api` route with 501, so one issue
67
+ (for example a specification missing a `$context.occurred` field) blocks the whole walk.
68
+ Fix every admission issue before walking or scoring; a refused model scores zero. A `ready`
69
+ state can still list single artifacts as unsupported: that command answers 501, and every
70
+ flow that needs it first fails with it (one in round 3 lost 38 of 91 cases). Read the whole
71
+ admission output, not its first entries, and fix each unsupported artifact.
66
72
  2. Execute one command over HTTP. A refusal naming an unsupported model format version means the
67
73
  toolchain is out of range: update it before changing the model. Send date-time values in the
68
74
  full round-trip form with fractional seconds and offset.
@@ -144,5 +150,10 @@ knows the original product would. A script or HTTP harness does not replace this
144
150
  query filters). The model carries it in a query performer body, fixture-dated specifications
145
151
  and a platform gap row. The body runs only in a rendered app, never in the executable model.
146
152
  Walk it on the rendered app with backdated data, and on the sandbox mark the journey as
147
- not run.
153
+ not run. Time items are scored as pairs: the positive probe (the item appears) and the
154
+ negative probe (a non-matching item does not appear) must both hold. An unfiltered list
155
+ passes every positive half and fails every negative one, so a pass whose twin fails is not
156
+ evidence. Report time fidelity as the paired score. Performer-held rules are verified against
157
+ the rendered app (`cratis run --engine eventmodel`, or render), since the semantic sandbox
158
+ leaves performer bodies out.
148
159
  - A pass list is not a coverage claim: report what was not walked.
@@ -37,6 +37,17 @@ exact response and `validationResults[].message`). The eight probe classes:
37
37
  (at-least-one-of, mutually dependent fields) never shows in per-field probes. Probe all
38
38
  fields empty, each one empty alone, and all filled;
39
39
  - a duplicate is a second, distinct id with the same value, sent sequentially; read the body.
40
+ Do this for every name-like field of a create command: a uniqueness rule is confirmed or
41
+ refuted only by this probe, never by a UI success;
42
+ - **toggle commands** (complete and reopen, archive and restore, assign and unassign): probe
43
+ the inverse and read back the whole read-model row before and after, field by field, not only
44
+ the headline flag; a timestamp or reason the inverse should clear is a rule.
45
+
46
+ Budget: about ten probes per command, written as a script that sends the whole batch for one
47
+ command and prints one table (`evidence-format.md`, probe table); the batch counts as one walk
48
+ state. Classify each result of a free-form probe as **intent** (a consistent, deliberate
49
+ rejection or message), **defect** (coercion, crash, HTTP 500, silent wrap) or `unconfirmed`
50
+ (one observation) before it becomes a row; defects follow "Observed defects" below.
40
51
 
41
52
  Read the command schema as well as the form: concept names (`x-concept`), enums, required flags
42
53
  and formats show value types the screen hides. When the first call is unknown, request the
@@ -46,7 +57,11 @@ request envelope and auth shape; if none exists, record that and make one read c
46
57
  **Probe coverage gate.** Keep `re/PROBES.md`: one row per command and probe class, each
47
58
  accepted, rejected or `not probed: <reason>` (write scope not approved, destructive, no id
48
59
  available). Synthesis does not start until every in-scope command has all eight classes
49
- recorded or explicitly `not probed`. A `not probed` class counts as unknown in the report,
60
+ recorded or explicitly `not probed`. End the file with a coverage check by catalog class: rule,
61
+ rejection, flow (read-model effect of each command), time, authorization (each role or
62
+ anonymous, when approved) and query shape (every argument of every query). Each class lists at
63
+ least one probe row or an explicit reason it was skipped; an empty class blocks synthesis.
64
+ A command with two or more optional text fields always has a row for all fields empty together. A `not probed` class counts as unknown in the report,
50
65
  never as "no rule". Ask for the write approval once, with the matrix attached. Each rule the
51
66
  assemblies declare (`executable-intake.md`) gets a probe that tries to violate it; a mismatch
52
67
  between assembly and server is an observed defect or dead code, recorded either way.
@@ -67,7 +82,10 @@ becomes a row; until then it is `unconfirmed`. A wrong `Confirmed` row is worse
67
82
  The UI shows only the queries its screens use. On a system the team owns or is authorized to
68
83
  probe (the owned-only limit above holds), also enumerate the surface from your own traffic and
69
84
  the schema: by-id lookups, filters and argument variants of each query, and the routes seen in
70
- the capture. Read the error text for required arguments. A query that returns HTTP 202 or
85
+ the capture. Probe every argument of every list query as true, false and omitted, and record
86
+ each one that changes the result as an optional filter (`synthesis-rules.md`, Intent in the mapping);
87
+ an argument seen in traffic but not probed is a gap, not an absent argument. Read the error text
88
+ for required arguments. A query that returns HTTP 202 or
71
89
  `isReady: false` is warming up: retry after a few seconds before recording it empty.
72
90
 
73
91
  ## Time-based views
@@ -78,14 +96,21 @@ has a threshold that only data can reveal. Seed records through the commands' ow
78
96
  0, 1, N-1, N and N+1 days, today plus and minus one, near local midnight, done and not done.
79
97
  Diff the result sets to find the boundary and whether the edge is inclusive; where assemblies
80
98
  are available, confirm that the decompiled threshold and the observed one agree. If the server
81
- refuses backdated writes, record that as its own rule.
99
+ refuses backdated writes, record that as its own rule. Also probe an item whose reference is
100
+ undefined (a stage or status never created) to see whether it counts as open or is excluded.
82
101
  How to model the result, and what the Screenplay surface cannot run, is in
83
102
  `synthesis-rules.md` ("Time facts"). If a threshold could not be exercised, record the
84
103
  placeholder value as an `unknown` with a question; never ship a guessed number unrecorded.
104
+ When the server clock cannot be set, seed relative dates from the host clock (`today`,
105
+ `today±N`), run well away from local and UTC midnight, and record the zone assumption and run
106
+ time in PROBES.md. Probe each state filter (completed, archived, stage open, won, lost,
107
+ undefined) as its own row.
85
108
  The server's time zone and its "today" are standing unknowns: seed near midnight and with
86
109
  backdated dates, and look for a zone setting or response header. A today-relative rule the
87
110
  declarative dialect cannot express goes in a query performer body plus an `event-model.md` gap
88
- row (`synthesis-rules.md`, Time facts). Never use a comment or a guessed filter.
111
+ row (`synthesis-rules.md`, Time facts), with specs on fixed dates. Record the zone as an
112
+ explicit assumption and add a spec near midnight. A probed time rule is never left as a `GAP`
113
+ comment or prose, and never as a guessed filter.
89
114
 
90
115
  ## Client-side or server-side
91
116