@cratis/pi 7.165.1 → 7.165.2

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.
@@ -37,7 +37,7 @@ Each framework repo is organized by what it builds, not by feature slices:
37
37
 
38
38
  - **Fundamentals** — the base library. `ConceptAs<T>`, type discovery (`IInstancesOf<T>` / `IImplementationsOf<T>`), serialization, common primitives. `Source/DotNET` includes `Fundamentals.TypeDiscovery.Generator`, `Metrics.Roslyn` (`Cratis.Metrics.Roslyn`) and `OpenTelemetry` (`Cratis.OpenTelemetry`); `Source/JavaScript` publishes `@cratis/fundamentals`, and `Source/ESLintConfig` publishes `@cratis/eslint-config` (verified at v7.23.0).
39
39
  - **Specifications** — BDD lifecycle, assertions and analyzers. `Source/Specifications` supplies common helpers, `Source/XUnit` and `Source/NUnit` supply runner-specific bases/assertions, and `Source/CodeAnalysis` supplies the bundled analyzers (v4.1.1).
40
- - **Orleans** — shared silo hosting, grain serializers, jobs and jobs storage (MongoDB/SQL/in-memory), in `Cratis.Orleans*` packages (v1.16.3). The core does not require Chronicle; the optional `.Chronicle` adapter does.
40
+ - **Choreography** — shared silo hosting, grain serializers, jobs and jobs storage (MongoDB/SQL/in-memory), in `Cratis.Choreography*` packages (2.0.0 or newer). The core does not require Chronicle; the optional `.Chronicle` adapter does.
41
41
  - **Arc** — the CQRS + model-binding + proxy-generation engine. `Source/DotNET` (the command/query pipeline, validation, authorization, identity, the Roslyn **proxy generator**) + `Source/JavaScript` (`@cratis/arc`, `@cratis/arc.react`, `@cratis/arc.react.mvvm`). Arc.Core does **not** depend on Chronicle.
42
42
  - **Chronicle** — the event-sourcing engine. `Source/Kernel` (the engine: **Orleans grains**, event sequences, observers/projections/reducers, storage providers — MongoDB and others), `Source/Clients` (the client SDKs incl. `DotNET` and `Testing`), `Infrastructure`, `Tools`, `Workbench`. The kernel is the deep, performance- and consistency-critical core. Its shared job engine, jobs storage, serializers and reusable silo hosting now come from the separate **Orleans** repo, not Chronicle-owned jobs code (Chronicle v19.50.0).
43
43
  - **Components** — the React component library (Components-owned markup and styling contract; React Aria internally; optional PrimeReact/MUI presentation adapters under `Adapters/`). `Source/<Component>/` folder per component (`CommandDialog`, `DataPage`, `DataTables`, …) with Storybook stories; published as `@cratis/components`. (Application rules *consume* these components; here you *build* them.)
@@ -11,7 +11,7 @@ paths:
11
11
  > **⚠️ APPLIES ONLY TO PROJECTS USING MICROSOFT ORLEANS**
12
12
  > If your project does not reference `Microsoft.Orleans` or any Orleans packages, **ignore this entire file**. These rules are irrelevant outside of Orleans contexts.
13
13
 
14
- In the Cratis organization, Orleans is the Chronicle kernel's actor runtime (`Source/Kernel/`). The kernel conventions below are verified against `Cratis/Chronicle` **v19.50.0**. Shared hosting and jobs come from `Cratis/Orleans` **v1.30.0**; use its setup for other services that co-host a silo.
14
+ In the Cratis organization, Orleans is the Chronicle kernel's actor runtime (`Source/Kernel/`). The kernel conventions below are verified against `Cratis/Chronicle` **v19.50.0**. Shared hosting and jobs come from `Cratis/Choreography`; use `Cratis.Choreography` 2.0.0 or newer (renamed from `Cratis.Orleans`); use its setup for other services that co-host a silo.
15
15
 
16
16
  ## General
17
17
 
@@ -37,35 +37,35 @@ services.AddKeyedSingleton(WellKnownGrainStorageProviders.EventSequences, Create
37
37
  ```
38
38
 
39
39
  Jobs are the exception to the kernel's `IStorage` shape: `JobGrainStorageProvider`
40
- and `JobStepGrainStorageProvider` live in `Cratis.Orleans.Jobs` and take
41
- `Cratis.Orleans.Storage.IJobsStorage`. Chronicle registers them under
42
- `Cratis.Orleans.WellKnownGrainStorageProviders.Jobs` and `.JobSteps`, still wrapped
40
+ and `JobStepGrainStorageProvider` live in `Cratis.Choreography.Jobs` and take
41
+ `Cratis.Choreography.Storage.IJobsStorage`. Chronicle registers them under
42
+ `Cratis.Choreography.WellKnownGrainStorageProviders.Jobs` and `.JobSteps`, still wrapped
43
43
  in its resilient storage pipeline.
44
44
 
45
- ## Co-host a silo with Cratis.Orleans
45
+ ## Co-host a silo with Cratis.Choreography
46
46
 
47
47
  For job/step authoring, stage barriers, recovery, storage scopes and state-machine
48
48
  APIs, load **cratis-orleans-jobs** from `cratis/engineering/csharp`. These APIs are
49
49
  framework/service guidance; they do not impose application slice architecture.
50
50
 
51
- For service authors, `Cratis.Orleans` supplies hosting, grain serializers, and the
52
- shared job system without requiring Chronicle. With `Cratis.Orleans` and
53
- `Cratis.Orleans.Storage.MongoDB` 1.30.0, this host uses durable MongoDB membership
51
+ For service authors, `Cratis.Choreography` supplies hosting, grain serializers, and the
52
+ shared job system without requiring Chronicle. With `Cratis.Choreography` and
53
+ `Cratis.Choreography.Storage.MongoDB` 2.0.0 or newer, this host uses durable MongoDB membership
54
54
  and jobs storage (a local MongoDB server is required):
55
55
 
56
56
  ```csharp
57
57
  // Copyright (c) Cratis. All rights reserved.
58
58
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
59
59
 
60
- using Cratis.Orleans.Hosting;
61
- using Cratis.Orleans.Setup;
60
+ using Cratis.Choreography.Hosting;
61
+ using Cratis.Choreography.Setup;
62
62
  using Microsoft.AspNetCore.Builder;
63
63
  using MongoDB.Driver;
64
64
 
65
65
  var builder = WebApplication.CreateBuilder(args);
66
66
  var connectionString = builder.Configuration.GetConnectionString("Mongo")
67
67
  ?? throw new InvalidOperationException("Configure the Mongo connection string.");
68
- builder.AddCratisOrleans(new CratisOrleansOptions
68
+ builder.AddCratisChoreography(new CratisChoreographyOptions
69
69
  {
70
70
  ClusterId = "my-service",
71
71
  ServiceId = "my-service",
@@ -73,15 +73,15 @@ builder.AddCratisOrleans(new CratisOrleansOptions
73
73
  DatabaseName = "my-service-orleans",
74
74
  ConnectionString = connectionString
75
75
  });
76
- builder.Services.AddCratisOrleansMongoDBJobsStorage(new MongoClient(connectionString));
76
+ builder.Services.AddCratisChoreographyMongoDBJobsStorage(new MongoClient(connectionString));
77
77
 
78
78
  var app = builder.Build();
79
79
  app.Run();
80
80
  ```
81
81
 
82
- - Register jobs storage separately: `AddCratisOrleansMongoDBJobsStorage`,
83
- `AddCratisOrleansSqlJobsStorage` (`Cratis.Orleans.Setup`), or
84
- `AddCratisOrleansInMemoryJobsStorage` (`Cratis.Orleans.Storage`).
82
+ - Register jobs storage separately: `AddCratisChoreographyMongoDBJobsStorage`,
83
+ `AddCratisChoreographySqlJobsStorage` (`Cratis.Choreography.Setup`), or
84
+ `AddCratisChoreographyInMemoryJobsStorage` (`Cratis.Choreography.Storage`).
85
85
  - Use the local `IJobs` service to start/stop/delete typed jobs during rolling
86
86
  upgrades; generic manager calls can land on a release that does not know the
87
87
  type. Provide singleton `IJobsManagerKeys` on every silo for all host-owned
@@ -93,7 +93,7 @@ app.Run();
93
93
  - Give grain implementations a unique `[GrainType("unique-name")]`. Orleans'
94
94
  default type name derives from the class name alone; a collision across
95
95
  assemblies prevents silo startup.
96
- - Silos configured by `AddCratisOrleans` deliberately use Orleans' in-memory
96
+ - Silos configured by `AddCratisChoreography` deliberately use Orleans' in-memory
97
97
  reminder service in both clustering modes; their reminders do not survive a
98
98
  full restart. Jobs rehydrate from durable jobs storage and do not use
99
99
  reminders. Do not point such a silo at the MongoDB reminder table merely
@@ -101,10 +101,10 @@ app.Run();
101
101
  10.x runtime it made the reminder service stop responding in these hosts. Hosts that build their own silo choose separately; the
102
102
  Chronicle kernel uses MongoDB reminders with MongoDB storage and in-memory
103
103
  reminders with in-memory storage.
104
- - `AddCratisOrleans` enables activity propagation itself. If a host keeps an
104
+ - `AddCratisChoreography` enables activity propagation itself. If a host keeps an
105
105
  explicit `AddActivityPropagation()` call, it must be **before**, never after,
106
- `AddCratisOrleans`, to avoid duplicate Orleans propagation filters/spans.
106
+ `AddCratisChoreography`, to avoid duplicate Orleans propagation filters/spans.
107
107
  - Keep Orleans package versions aligned: the Release-build guard rejects a
108
108
  `Microsoft.Orleans.Reminders`/`Microsoft.Orleans.Server` version mismatch.
109
- - `Enabled = false` makes `AddCratisOrleans` a no-op for specification hosts;
109
+ - `Enabled = false` makes `AddCratisChoreography` a no-op for specification hosts;
110
110
  it does not register the silo or its collaborators.
@@ -10,9 +10,9 @@ Cratis.Chronicle.CodeAnalysis 19.50.1
10
10
  Cratis.Fundamentals 7.23.0
11
11
  Cratis.Metrics.Roslyn 7.23.0
12
12
  Cratis.OpenTelemetry 7.23.0
13
- Cratis.Orleans 1.16.3
14
- Cratis.Orleans.Chronicle 1.16.3
15
- Cratis.Orleans.Storage.MongoDB 1.16.3
16
- Cratis.Orleans.Storage.Sql 1.16.3
13
+ Cratis.Choreography 2.0.0
14
+ Cratis.Choreography.Chronicle 2.0.0
15
+ Cratis.Choreography.Storage.MongoDB 2.0.0
16
+ Cratis.Choreography.Storage.Sql 2.0.0
17
17
  Cratis.Specifications 4.1.1
18
18
  Cratis.Specifications.XUnit 4.1.1
@@ -36,7 +36,7 @@ Each framework repo is organized by what it builds, not by feature slices:
36
36
 
37
37
  - **Fundamentals** — the base library. `ConceptAs<T>`, type discovery (`IInstancesOf<T>` / `IImplementationsOf<T>`), serialization, common primitives. `Source/DotNET` includes `Fundamentals.TypeDiscovery.Generator`, `Metrics.Roslyn` (`Cratis.Metrics.Roslyn`) and `OpenTelemetry` (`Cratis.OpenTelemetry`); `Source/JavaScript` publishes `@cratis/fundamentals`, and `Source/ESLintConfig` publishes `@cratis/eslint-config` (verified at v7.23.0).
38
38
  - **Specifications** — BDD lifecycle, assertions and analyzers. `Source/Specifications` supplies common helpers, `Source/XUnit` and `Source/NUnit` supply runner-specific bases/assertions, and `Source/CodeAnalysis` supplies the bundled analyzers (v4.1.1).
39
- - **Orleans** — shared silo hosting, grain serializers, jobs and jobs storage (MongoDB/SQL/in-memory), in `Cratis.Orleans*` packages (v1.16.3). The core does not require Chronicle; the optional `.Chronicle` adapter does.
39
+ - **Choreography** — shared silo hosting, grain serializers, jobs and jobs storage (MongoDB/SQL/in-memory), in `Cratis.Choreography*` packages (2.0.0 or newer). The core does not require Chronicle; the optional `.Chronicle` adapter does.
40
40
  - **Arc** — the CQRS + model-binding + proxy-generation engine. `Source/DotNET` (the command/query pipeline, validation, authorization, identity, the Roslyn **proxy generator**) + `Source/JavaScript` (`@cratis/arc`, `@cratis/arc.react`, `@cratis/arc.react.mvvm`). Arc.Core does **not** depend on Chronicle.
41
41
  - **Chronicle** — the event-sourcing engine. `Source/Kernel` (the engine: **Orleans grains**, event sequences, observers/projections/reducers, storage providers — MongoDB and others), `Source/Clients` (the client SDKs incl. `DotNET` and `Testing`), `Infrastructure`, `Tools`, `Workbench`. The kernel is the deep, performance- and consistency-critical core. Its shared job engine, jobs storage, serializers and reusable silo hosting now come from the separate **Orleans** repo, not Chronicle-owned jobs code (Chronicle v19.50.0).
42
42
  - **Components** — the React component library (Components-owned markup and styling contract; React Aria internally; optional PrimeReact/MUI presentation adapters under `Adapters/`). `Source/<Component>/` folder per component (`CommandDialog`, `DataPage`, `DataTables`, …) with Storybook stories; published as `@cratis/components`. (Application rules *consume* these components; here you *build* them.)
@@ -10,7 +10,7 @@ paths:
10
10
  > **⚠️ APPLIES ONLY TO PROJECTS USING MICROSOFT ORLEANS**
11
11
  > If your project does not reference `Microsoft.Orleans` or any Orleans packages, **ignore this entire file**. These rules are irrelevant outside of Orleans contexts.
12
12
 
13
- In the Cratis organization, Orleans is the Chronicle kernel's actor runtime (`Source/Kernel/`). The kernel conventions below are verified against `Cratis/Chronicle` **v19.50.0**. Shared hosting and jobs come from `Cratis/Orleans` **v1.30.0**; use its setup for other services that co-host a silo.
13
+ In the Cratis organization, Orleans is the Chronicle kernel's actor runtime (`Source/Kernel/`). The kernel conventions below are verified against `Cratis/Chronicle` **v19.50.0**. Shared hosting and jobs come from `Cratis/Choreography`; use `Cratis.Choreography` 2.0.0 or newer (renamed from `Cratis.Orleans`); use its setup for other services that co-host a silo.
14
14
 
15
15
  ## General
16
16
 
@@ -36,35 +36,35 @@ services.AddKeyedSingleton(WellKnownGrainStorageProviders.EventSequences, Create
36
36
  ```
37
37
 
38
38
  Jobs are the exception to the kernel's `IStorage` shape: `JobGrainStorageProvider`
39
- and `JobStepGrainStorageProvider` live in `Cratis.Orleans.Jobs` and take
40
- `Cratis.Orleans.Storage.IJobsStorage`. Chronicle registers them under
41
- `Cratis.Orleans.WellKnownGrainStorageProviders.Jobs` and `.JobSteps`, still wrapped
39
+ and `JobStepGrainStorageProvider` live in `Cratis.Choreography.Jobs` and take
40
+ `Cratis.Choreography.Storage.IJobsStorage`. Chronicle registers them under
41
+ `Cratis.Choreography.WellKnownGrainStorageProviders.Jobs` and `.JobSteps`, still wrapped
42
42
  in its resilient storage pipeline.
43
43
 
44
- ## Co-host a silo with Cratis.Orleans
44
+ ## Co-host a silo with Cratis.Choreography
45
45
 
46
46
  For job/step authoring, stage barriers, recovery, storage scopes and state-machine
47
47
  APIs, load **cratis-orleans-jobs** from `cratis/engineering/csharp`. These APIs are
48
48
  framework/service guidance; they do not impose application slice architecture.
49
49
 
50
- For service authors, `Cratis.Orleans` supplies hosting, grain serializers, and the
51
- shared job system without requiring Chronicle. With `Cratis.Orleans` and
52
- `Cratis.Orleans.Storage.MongoDB` 1.30.0, this host uses durable MongoDB membership
50
+ For service authors, `Cratis.Choreography` supplies hosting, grain serializers, and the
51
+ shared job system without requiring Chronicle. With `Cratis.Choreography` and
52
+ `Cratis.Choreography.Storage.MongoDB` 2.0.0 or newer, this host uses durable MongoDB membership
53
53
  and jobs storage (a local MongoDB server is required):
54
54
 
55
55
  ```csharp
56
56
  // Copyright (c) Cratis. All rights reserved.
57
57
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
58
58
 
59
- using Cratis.Orleans.Hosting;
60
- using Cratis.Orleans.Setup;
59
+ using Cratis.Choreography.Hosting;
60
+ using Cratis.Choreography.Setup;
61
61
  using Microsoft.AspNetCore.Builder;
62
62
  using MongoDB.Driver;
63
63
 
64
64
  var builder = WebApplication.CreateBuilder(args);
65
65
  var connectionString = builder.Configuration.GetConnectionString("Mongo")
66
66
  ?? throw new InvalidOperationException("Configure the Mongo connection string.");
67
- builder.AddCratisOrleans(new CratisOrleansOptions
67
+ builder.AddCratisChoreography(new CratisChoreographyOptions
68
68
  {
69
69
  ClusterId = "my-service",
70
70
  ServiceId = "my-service",
@@ -72,15 +72,15 @@ builder.AddCratisOrleans(new CratisOrleansOptions
72
72
  DatabaseName = "my-service-orleans",
73
73
  ConnectionString = connectionString
74
74
  });
75
- builder.Services.AddCratisOrleansMongoDBJobsStorage(new MongoClient(connectionString));
75
+ builder.Services.AddCratisChoreographyMongoDBJobsStorage(new MongoClient(connectionString));
76
76
 
77
77
  var app = builder.Build();
78
78
  app.Run();
79
79
  ```
80
80
 
81
- - Register jobs storage separately: `AddCratisOrleansMongoDBJobsStorage`,
82
- `AddCratisOrleansSqlJobsStorage` (`Cratis.Orleans.Setup`), or
83
- `AddCratisOrleansInMemoryJobsStorage` (`Cratis.Orleans.Storage`).
81
+ - Register jobs storage separately: `AddCratisChoreographyMongoDBJobsStorage`,
82
+ `AddCratisChoreographySqlJobsStorage` (`Cratis.Choreography.Setup`), or
83
+ `AddCratisChoreographyInMemoryJobsStorage` (`Cratis.Choreography.Storage`).
84
84
  - Use the local `IJobs` service to start/stop/delete typed jobs during rolling
85
85
  upgrades; generic manager calls can land on a release that does not know the
86
86
  type. Provide singleton `IJobsManagerKeys` on every silo for all host-owned
@@ -92,7 +92,7 @@ app.Run();
92
92
  - Give grain implementations a unique `[GrainType("unique-name")]`. Orleans'
93
93
  default type name derives from the class name alone; a collision across
94
94
  assemblies prevents silo startup.
95
- - Silos configured by `AddCratisOrleans` deliberately use Orleans' in-memory
95
+ - Silos configured by `AddCratisChoreography` deliberately use Orleans' in-memory
96
96
  reminder service in both clustering modes; their reminders do not survive a
97
97
  full restart. Jobs rehydrate from durable jobs storage and do not use
98
98
  reminders. Do not point such a silo at the MongoDB reminder table merely
@@ -100,10 +100,10 @@ app.Run();
100
100
  10.x runtime it made the reminder service stop responding in these hosts. Hosts that build their own silo choose separately; the
101
101
  Chronicle kernel uses MongoDB reminders with MongoDB storage and in-memory
102
102
  reminders with in-memory storage.
103
- - `AddCratisOrleans` enables activity propagation itself. If a host keeps an
103
+ - `AddCratisChoreography` enables activity propagation itself. If a host keeps an
104
104
  explicit `AddActivityPropagation()` call, it must be **before**, never after,
105
- `AddCratisOrleans`, to avoid duplicate Orleans propagation filters/spans.
105
+ `AddCratisChoreography`, to avoid duplicate Orleans propagation filters/spans.
106
106
  - Keep Orleans package versions aligned: the Release-build guard rejects a
107
107
  `Microsoft.Orleans.Reminders`/`Microsoft.Orleans.Server` version mismatch.
108
- - `Enabled = false` makes `AddCratisOrleans` a no-op for specification hosts;
108
+ - `Enabled = false` makes `AddCratisChoreography` a no-op for specification hosts;
109
109
  it does not register the silo or its collaborators.
@@ -40,7 +40,7 @@ after the process that noticed it is gone. These are not facts:
40
40
 
41
41
  Pick the mechanism that owns the progress, so progress is state of that mechanism, not events:
42
42
 
43
- - a **durable job** (Cratis.Orleans jobs, see **cratis-orleans-jobs**) for work with steps, retries and pacing;
43
+ - a **durable job** (Cratis.Choreography jobs, see **cratis-orleans-jobs**) for work with steps, retries and pacing;
44
44
  - an **event-sourced state machine** when the lifecycle is itself a domain fact sequence;
45
45
  - an **Orleans reminder** to wake up later;
46
46
  - a **command operation** (**cratis-arc-command-operation**) for inline work with compensation;
@@ -1,16 +1,22 @@
1
1
  ---
2
2
  name: cratis-orleans-jobs
3
- description: Use when authoring or recovering Cratis.Orleans jobs, configuring their storage or changing job-step lifecycle transitions. Not for operating live Chronicle jobs or validating application commands.
3
+ description: Use when authoring or recovering Cratis.Choreography jobs, configuring their storage or changing job-step lifecycle transitions. Not for operating live Chronicle jobs or validating application commands.
4
4
  license: MIT
5
5
  ---
6
6
 
7
7
  <!-- Copyright (c) Cratis. All rights reserved. -->
8
8
  <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
9
9
 
10
- # Recoverable Orleans jobs
10
+ # Recoverable Choreography jobs
11
11
 
12
12
  For services and kernel contributors using Orleans. This is library-consumer guidance, not the application vertical-slice architecture. For live Chronicle operations use **cratis-chronicle-cli-operations** instead. Co-hosting conventions are in [orleans.md](../../rules/orleans.md).
13
13
 
14
+ Use `Cratis.Choreography` 2.0.0 or newer. When upgrading from `Cratis.Orleans`, replace the package/namespace prefix and `AddCratisOrleans` registration prefix with `Cratis.Choreography` and `AddCratisChoreography`, including `CratisChoreographyOptions`. The 1.x prerequisites below and in the references describe the pre-rename compatibility baseline; Choreography 2.0.0 includes them.
15
+
16
+ ## Verified product sources
17
+
18
+ Packages are pinned to 2.0.0, the `Cratis.Choreography` rename baseline. Names are verified against `Cratis/Orleans` origin/main: `Source/Choreography/Hosting/CratisChoreographySiloBuilderExtensions.cs`, `CratisChoreographyOptions.cs`, and the jobs-storage extensions in `Source/Choreography.Storage.MongoDB/Setup/`, `Source/Choreography.Storage.Sql/Setup/` and `Source/Choreography.Storage/InMemory/`.
19
+
14
20
  ## 1. Choose a job, not a detached task
15
21
 
16
22
  A job plans recoverable work; each step is a grain and does the work. Use it for work that must outlive a request. It is **at-least-once**, not exactly-once: a step interrupted before a durable checkpoint can perform the same work again. Protect external effects with receiver-owned idempotency/deduplication; a checkpoint does not atomically commit an external write.
@@ -22,7 +28,7 @@ A job plans recoverable work; each step is a grain and does the work. Use it for
22
28
 
23
29
  `PerformStep` runs **outside the activation context** with a deep-copied state snapshot. Mutating that snapshot does not persist it; do not access/write grain `State` directly from background work. A specification host such as Orleans.TestKit must register `DeepCopier<TState>`.
24
30
 
25
- Requires Cratis.Orleans 1.19.0 for `TryInvokeOnActivation` to coordinate state/checkpoints on the current activation, including during deactivation. Call it only from the run's background work. Keep callbacks local: capture copied inputs, call remote systems outside the callback, then commit in a second callback. Never call another grain, nest and await another callback, or start unawaited work inside it. Inspect `ActivationCallbackRejected` (`NoRun`, `StaleRun`, `Closed`, `Cancelled`); exceptions propagate. The optional `queueCancellationToken` cancels waiting callbacks only; started callbacks finish. Stop/deactivation waits for started callbacks and work to settle; `JobsOptions.StepStopTimeout` defaults to 10 seconds and `JobStepError.StopTimedOut` is not proof of quiescence. Requires 1.16.2 for framework-owned stop reporting: do not report cancellation again from a `PerformWork` override.
31
+ Requires 1.19.0 for `TryInvokeOnActivation` to coordinate state/checkpoints on the current activation, including during deactivation. Call it only from the run's background work. Keep callbacks local: capture copied inputs, call remote systems outside the callback, then commit in a second callback. Never call another grain, nest and await another callback, or start unawaited work inside it. Inspect `ActivationCallbackRejected` (`NoRun`, `StaleRun`, `Closed`, `Cancelled`); exceptions propagate. The optional `queueCancellationToken` cancels waiting callbacks only; started callbacks finish. Stop/deactivation waits for started callbacks and work to settle; `JobsOptions.StepStopTimeout` defaults to 10 seconds and `JobStepError.StopTimedOut` is not proof of quiescence. Requires 1.16.2 for framework-owned stop reporting: do not report cancellation again from a `PerformWork` override.
26
32
 
27
33
  ## 2. Plan dependencies as stages
28
34
 
@@ -42,23 +48,23 @@ protected override Task<IImmutableList<JobStepDetails>> PrepareSteps(RecoveryReq
42
48
  ]);
43
49
  ```
44
50
 
45
- Import `System.Collections.Immutable` and `Cratis.Orleans.Jobs` in that job file. `CreateStep<TStep>` takes the **grain interface**, not the implementation. Its stage overload accepts `JobStepStage`, with implicit integer conversion.
51
+ Import `System.Collections.Immutable` and `Cratis.Choreography.Jobs` in that job file. `CreateStep<TStep>` takes the **grain interface**, not the implementation. Its stage overload accepts `JobStepStage`, with implicit integer conversion.
46
52
 
47
53
  Every step in a stage reaches an outcome before later stages start; steps within a stage run in parallel. All steps are prepared up front, so later-stage preparation cannot read the effects of earlier-stage execution. Read such dependencies in `PerformStep`.
48
54
 
49
- A failed stage stops the pipeline by default: later steps become `Unreachable`, and the job completes with failures. A best-effort stage may override `GetFailureBehaviorFor(JobStepStage)` to return `JobStageFailureBehavior.ContinueWithNextStage` (namespace `Cratis.Orleans.Jobs.Stages`). Do not silently continue when a later stage relies on the failed output.
55
+ A failed stage stops the pipeline by default: later steps become `Unreachable`, and the job completes with failures. A best-effort stage may override `GetFailureBehaviorFor(JobStepStage)` to return `JobStageFailureBehavior.ContinueWithNextStage` (namespace `Cratis.Choreography.Jobs.Stages`). Do not silently continue when a later stage relies on the failed output.
50
56
 
51
57
  Requires 1.25.0 for durable step plans: preparation requests must round-trip through the host's JSON options. Invalid plans return `StartJobError.InvalidStepPlan`. Recovery reuses identities and requests, prepares only unsaved steps, and never calls `PrepareSteps` again. Put retry-safe initialization needed before start **and** resume in `OnBeforeDispatchingJobSteps(JobStepDispatchContext)`, after the respective start/resume hook. `InitializationMayBeIncomplete` flags recovery from preparing/starting, not exactly-once initialization. A failed hook dispatches nothing; recovery never replays the start hook. A legacy preparing/starting job without a saved plan returns `CannotResumeJobError.MissingStepPlan` rather than inventing identities.
52
58
 
53
59
  ## 3. Start locally and recover every scope
54
60
 
55
- Requires 1.18.0 for the singleton local service `Cratis.Orleans.Jobs.IJobs`, registered by `AddCratisOrleans`. Prefer `Start<TJob,TRequest>(new JobKey(scope, namespace), request)` (or its explicit job-id overload), `Stop(key, jobId)` and `Delete(key, jobId)` during rolling upgrades. Generic `IJobsManager.Start`/`GetJobsOfType` send types through a manager that may run an older release and cannot decode them.
61
+ Requires 1.18.0 for the singleton local service `Cratis.Choreography.Jobs.IJobs`, registered by `AddCratisChoreography`. Prefer `Start<TJob,TRequest>(new JobKey(scope, namespace), request)` (or its explicit job-id overload), `Stop(key, jobId)` and `Delete(key, jobId)` during rolling upgrades. Generic `IJobsManager.Start`/`GetJobsOfType` send types through a manager that may run an older release and cannot decode them.
56
62
 
57
63
  Inspect `Result<JobId, StartJobError>` before telling a caller that work started. `FailedStartingSomeJobSteps` means remaining work is still running, not that nothing started; `AllJobStepsFailedStarting` means no step started. Start success is not completion. Match `StopJobResult`/`DeleteJobResult`: accepted, `NotFound`, `UnknownJobType`, or `Refused` with the job's error. Unknown types require a release that knows the type; exceptions propagate. Deletion acceptance is not completed removal. Third-party storage should override `IJobStorage.GetJobType` with a metadata-only read; its fallback reads the request too.
58
64
 
59
65
  `IGrainFactory.GetJobsManager(scope, namespace)` remains available. `IJobsManager.Resume(JobId)` returns **`Task<bool>`**; false means nothing took the job: do not wait for a completion callback as though resumption succeeded. True may also mean already running or finalized. `IJobsManager.Stop` returns `Result<StopJobError>`; preserve a persistence refusal. `Rehydrate()` returns after loading/preparing interrupted jobs, before its bounded background drain resumes them all. `StartStepsInBackground = true` moves step preparation/start to the next turn after durability; later failures belong to the job, not Start.
60
66
 
61
- Requires 1.17.0 for automatic recovery on silo activation/member death. Provide singleton `IJobsManagerKeys` implementations on **every silo**, enumerating all host-owned scope/namespace pairs through `GetKeys(CancellationToken)`. The default remembers only keys used in this process: it is not a durable catalog. Providers run outside request scope; never inject a current tenant/user or scoped database. Requires 1.23.3 (1.24.2 for provider construction failures) for automatic recovery retries of failed providers/managers, from 1 second doubling to 60 seconds until success or silo shutdown. There is no periodic sweep by default. `AddCratisOrleans` registers recovery; separately configured silos need `AddCratisOrleansJobsRecovery()` (`Cratis.Orleans.Hosting`).
67
+ Requires 1.17.0 for automatic recovery on silo activation/member death. Provide singleton `IJobsManagerKeys` implementations on **every silo**, enumerating all host-owned scope/namespace pairs through `GetKeys(CancellationToken)`. The default remembers only keys used in this process: it is not a durable catalog. Providers run outside request scope; never inject a current tenant/user or scoped database. Requires 1.23.3 (1.24.2 for provider construction failures) for automatic recovery retries of failed providers/managers, from 1 second doubling to 60 seconds until success or silo shutdown. There is no periodic sweep by default. `AddCratisChoreography` registers recovery; separately configured silos need `AddCratisChoreographyJobsRecovery()` (`Cratis.Choreography.Hosting`).
62
68
 
63
69
  Read [lifecycle and placement](references/lifecycle-and-placement.md) for drain/admission, bounded attempts, placement, custom storage compatibility and step test runs.
64
70
 
@@ -70,13 +76,13 @@ Keeping a job does not keep successful step state: successful **steps delete the
70
76
 
71
77
  ## 5. Register storage and budget concurrency
72
78
 
73
- `IJobsStorage.GetFor(scope, namespace)` returns `JobsStorage`. Scope and namespace are opaque host-owned storage coordinates, not authorization checks. Choose one storage registration alongside `AddCratisOrleans`:
79
+ `IJobsStorage.GetFor(scope, namespace)` returns `JobsStorage`. Scope and namespace are opaque host-owned storage coordinates, not authorization checks. Choose one storage registration alongside `AddCratisChoreography`:
74
80
 
75
81
  | Registration | Package / namespace | Use |
76
82
  | --- | --- | --- |
77
- | `AddCratisOrleansMongoDBJobsStorage` | `.Storage.MongoDB` / `Cratis.Orleans.Setup` | Durable MongoDB; default database `{scope}+jobs[+{namespace}]`, overridable |
78
- | `AddCratisOrleansSqlJobsStorage` | `.Storage.Sql` / `Cratis.Orleans.Setup` | Durable EF Core; `OptionsResolver(scope, namespace)` selects `DbContextOptions<JobsDbContext>` |
79
- | `AddCratisOrleansInMemoryJobsStorage` | `.Storage` / `Cratis.Orleans.Storage` | Specs/development; restart loses state |
83
+ | `AddCratisChoreographyMongoDBJobsStorage` | `.Storage.MongoDB` / `Cratis.Choreography.Setup` | Durable MongoDB; default database `{scope}+jobs[+{namespace}]`, overridable |
84
+ | `AddCratisChoreographySqlJobsStorage` | `.Storage.Sql` / `Cratis.Choreography.Setup` | Durable EF Core; `OptionsResolver(scope, namespace)` selects `DbContextOptions<JobsDbContext>` |
85
+ | `AddCratisChoreographyInMemoryJobsStorage` | `.Storage` / `Cratis.Choreography.Storage` | Specs/development; restart loses state |
80
86
 
81
87
  The SQL provider calls `dbContext.Database.Migrate()` automatically before constructing storage. Do not substitute `EnsureCreated` or hand-create tables; grant migration permissions and choose scope-to-database mapping deliberately. `IJobsStorage.Reset()` clears the cache; the next resolution migrates again. There is no MySQL/MariaDB jobs provider.
82
88
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## Stop, drain and admission
7
7
 
8
- Requires Cratis.Orleans 1.20.0 for `IJobs.StopAndDrain(key, jobId, timeout)` and the grain protocols `IJobDrain` / `IJobStepDrain`. Unlike ordinary stop acceptance, `Drained` means no step code can run, final outcomes/checkpoints are durable and completion/stop hooks finished. Other outcomes are `TimedOut` (call again), `Completed`, `NotFound` and `UnknownJobType`. `TimeSpan.Zero` polls. Add the method to hand-written `IJobs` implementations. Enable only after every silo supports it. A pending drain survives reactivation and refuses resume; a timeout is not proof of quiescence. Hooks can repeat or be missed after a crash, so keep them idempotent rather than collecting results only there.
8
+ Requires 1.20.0 for `IJobs.StopAndDrain(key, jobId, timeout)` and the grain protocols `IJobDrain` / `IJobStepDrain`. Unlike ordinary stop acceptance, `Drained` means no step code can run, final outcomes/checkpoints are durable and completion/stop hooks finished. Other outcomes are `TimedOut` (call again), `Completed`, `NotFound` and `UnknownJobType`. `TimeSpan.Zero` polls. Add the method to hand-written `IJobs` implementations. Enable only after every silo supports it. A pending drain survives reactivation and refuses resume; a timeout is not proof of quiescence. Hooks can repeat or be missed after a crash, so keep them idempotent rather than collecting results only there.
9
9
 
10
10
  Requires 1.21.0 for owner admission: implement `IJobAdmission.MayRun(JobAdmissionRequest, CancellationToken)` and register with `siloBuilder.AddJobAdmission<T>()` on every silo that hosts those job types. Every admission must allow; none means allow. It runs before start, every resume and each later stage. Refusals return `StartJobError.NotAdmitted` / `CannotResumeJobError.NotAdmitted`; manager resume returns false. A refused running job is stopped/drained, and a refused later stage stops the job. Exceptions/timeouts are failures, not refusals; a later stage retries an unanswered admission on a timer.
11
11
 
@@ -41,7 +41,7 @@ A completed stop sets `StopFinalized` after all required notifications have succ
41
41
 
42
42
  ## Independent controller and worker placement
43
43
 
44
- Requires 1.30.0 for `Cratis.Orleans.Hosting` extensions on `ISiloBuilder`:
44
+ Requires 1.30.0 for `Cratis.Choreography.Hosting` extensions on `ISiloBuilder`:
45
45
 
46
46
  - `AddJobPlacement()` or `AddJobPlacement<TDirector>()` opts controllers into `JobsPlacementStrategy`.
47
47
  - `AddJobStepPlacement()` or `AddJobStepPlacement<TDirector>()` opts workers into `JobStepsPlacementStrategy`, including recovered steps.
@@ -3,11 +3,11 @@
3
3
 
4
4
  # Grain lifecycle state machines
5
5
 
6
- Source: `Cratis/Orleans`. Use explicit states when entering/leaving a status has behavior; an enum is enough for a status with no behavior. Do not put long-running work on a grain turn just because `OnEnter` is available.
6
+ Source: `Cratis/Choreography`. Use explicit states when entering/leaving a status has behavior; an enum is enough for a status with no behavior. Do not put long-running work on a grain turn just because `OnEnter` is available.
7
7
 
8
8
  ## Stored lifecycle
9
9
 
10
- `StateMachine<TStoredState>` derives from a stateful grain. Override `InitialState` and `CreateStates()`; states derive `State<TStoredState>`. `AllowedTransitions` is an immutable list of target types, or override `CanTransitionTo<TTargetState>(storedState)` for a guard (`Source/Orleans/StateMachines/StateMachine.cs`; `State.cs`).
10
+ `StateMachine<TStoredState>` derives from a stateful grain. Override `InitialState` and `CreateStates()`; states derive `State<TStoredState>`. `AllowedTransitions` is an immutable list of target types, or override `CanTransitionTo<TTargetState>(storedState)` for a guard (`Source/Choreography/StateMachines/StateMachine.cs`; `State.cs`).
11
11
 
12
12
  Declaration excerpt for an existing grain file with `ProcessState : StateMachineState`, the existing `IProcess` grain interface, and a registered `processes` grain storage provider:
13
13
 
@@ -18,7 +18,7 @@ Declaration excerpt for an existing grain file with `ProcessState : StateMachine
18
18
  using System;
19
19
  using System.Collections.Immutable;
20
20
  using System.Threading.Tasks;
21
- using Cratis.Orleans.StateMachines;
21
+ using Cratis.Choreography.StateMachines;
22
22
  using Orleans;
23
23
  using Orleans.Providers;
24
24
 
@@ -54,13 +54,13 @@ For externally owned storage, the protected constructor accepts `Orleans.Core.IS
54
54
 
55
55
  ## Lifecycle following Chronicle facts
56
56
 
57
- `EventSourcedStateMachine<TModel>` from `Cratis.Orleans.Chronicle.StateMachines` uses a Chronicle read model as authoritative state. Its interface derives `IEventSourcedStateMachine` (string-keyed). There is **no grain storage provider** to configure and writes are no-ops: `ReadModelStorage<TModel>` reads Chronicle; `ResolveState(TModel?)` derives activation state (`Source/Orleans.Chronicle/StateMachines/EventSourcedStateMachine.cs`; `ReadModelStorage.cs`).
57
+ `EventSourcedStateMachine<TModel>` from `Cratis.Choreography.Chronicle.StateMachines` uses a Chronicle read model as authoritative state. Its interface derives `IEventSourcedStateMachine` (string-keyed). There is **no grain storage provider** to configure and writes are no-ops: `ReadModelStorage<TModel>` reads Chronicle; `ResolveState(TModel?)` derives activation state (`Source/Choreography.Chronicle/StateMachines/EventSourcedStateMachine.cs`; `ReadModelStorage.cs`).
58
58
 
59
59
  - Define states with `CreateStates()` as above, over `TModel`.
60
60
  - Define event transitions in `DefineTransitions(IStateMachineTransitions<TModel>)`, using `.On<TEvent>().When(model => predicate).TransitionTo<TState>()`. First applicable allowed transition wins. Make `ResolveState` agree with these transitions after restart (`EventSourcedStateMachine.cs`, `StateMachineTransitions.cs`).
61
61
  - Use model-bound projection attributes, an already-discovered projection, or `DefineProjection(IProjectionBuilderFor<TModel>)`, not competing projections. `DefineProjection` and `DefineTransitions` run at startup **without a constructor**: use only the builder, never injected services or fields (`EventSourcedStateMachine.cs`).
62
- - Register `AddEventSourcedStateMachines()` on `ISiloBuilder` or `IServiceCollection`, beside the application's Chronicle client registration; namespace `Cratis.Orleans.Chronicle.Hosting` (`Hosting/EventSourcedStateMachinesServiceCollectionExtensions.cs`).
63
- - Grain keys include event store, namespace and event-source ID. Use `IGrainFactory.GetEventSourcedStateMachine<TInterface>(eventStore, eventSourceId)` from `Cratis.Orleans.Chronicle.StateMachines` so tenant coordinates come from the supplied event store (`StateMachines/EventSourcedStateMachineGrainFactoryExtensions.cs`).
62
+ - Register `AddEventSourcedStateMachines()` on `ISiloBuilder` or `IServiceCollection`, beside the application's Chronicle client registration; namespace `Cratis.Choreography.Chronicle.Hosting` (`Hosting/EventSourcedStateMachinesServiceCollectionExtensions.cs`).
63
+ - Grain keys include event store, namespace and event-source ID. Use `IGrainFactory.GetEventSourcedStateMachine<TInterface>(eventStore, eventSourceId)` from `Cratis.Choreography.Chronicle.StateMachines` so tenant coordinates come from the supplied event store (`StateMachines/EventSourcedStateMachineGrainFactoryExtensions.cs`).
64
64
  - Prefer passive models. For events consumed by a materialized projection, the reactor waits for its sequence position before refreshing; `ModelCatchUpTimeout` defaults to 30 seconds and expiry fails with `ModelDidNotCatchUp` (`EventSourcedStateMachineReactor.cs`; `EventSourcedStateMachinesOptions.cs`).
65
65
 
66
66
  This machine **follows facts**, it does not arbitrate whether a command may append one. Keep command rejection and append-time invariants at their owning boundary. Enter/model-change effects may repeat on activation, redelivery or replay: design them idempotently (`Documentation/concepts/event-sourced-state-machines.md`). Test guards, no-op refusals, reactivation and persistence failures separately from job recovery.
@@ -171,5 +171,5 @@ duration resumes at once.
171
171
  without exactly two outlets PLAY0848, an undeclared reference PLAY0851); PLAY0839 and
172
172
  PLAY0841 are shared.
173
173
  - Stage refuses ESM v36 models with `STAGE-ESM-016`; every other model renders as
174
- before. The durable engine is Cratis.Orleans; its hosting and adapters are outside this
174
+ before. The durable engine is Cratis.Choreography; its hosting and adapters are outside this
175
175
  reference.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: orleans
3
- description: Use when an Orleans task requires choosing state ownership, communication, scheduling or hosting guarantees against failure. Not for other actor stacks, relational-only CRUD or Cratis.Orleans job implementation.
3
+ description: Use when an Orleans task requires choosing state ownership, communication, scheduling or hosting guarantees against failure. Not for other actor stacks, relational-only CRUD or Cratis.Choreography job implementation.
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -8,7 +8,7 @@ license: MIT
8
8
 
9
9
  # Microsoft Orleans
10
10
 
11
- Use only within this skill's stated task; general workflow advice does not apply to unrelated tasks. Cratis rules in `.cratis/ai/rules/` (including `csharp.md`, `specs.csharp.md`, and `orleans.md`) and the `cratis-*` skills win where they differ. `.cratis/ai/rules/orleans.md` forbids `[Alias]` on grain interfaces and grain methods (it is used only on `[GenerateSerializer]` state and definition records that must survive a rename) and forbids `ConfigureAwait(false)` in grain code; **cratis-orleans-jobs** owns recoverable jobs. DurableJobs/Journaling are experimental and are not interchangeable with Cratis.Orleans jobs.
11
+ Use only within this skill's stated task; general workflow advice does not apply to unrelated tasks. Cratis rules in `.cratis/ai/rules/` (including `csharp.md`, `specs.csharp.md`, and `orleans.md`) and the `cratis-*` skills win where they differ. `.cratis/ai/rules/orleans.md` forbids `[Alias]` on grain interfaces and grain methods (it is used only on `[GenerateSerializer]` state and definition records that must survive a rename) and forbids `ConfigureAwait(false)` in grain code; **cratis-orleans-jobs** owns recoverable jobs. DurableJobs/Journaling are experimental and are not interchangeable with Cratis.Choreography jobs.
12
12
 
13
13
  ## Diagnostic Output Budget
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.165.1",
3
+ "version": "7.165.2",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [