Cohesive.Transitions
0.1.0-alpha.76
See the version list below for details.
dotnet add package Cohesive.Transitions --version 0.1.0-alpha.76
NuGet\Install-Package Cohesive.Transitions -Version 0.1.0-alpha.76
<PackageReference Include="Cohesive.Transitions" Version="0.1.0-alpha.76" />
<PackageVersion Include="Cohesive.Transitions" Version="0.1.0-alpha.76" />
<PackageReference Include="Cohesive.Transitions" />
paket add Cohesive.Transitions --version 0.1.0-alpha.76
#r "nuget: Cohesive.Transitions, 0.1.0-alpha.76"
#:package Cohesive.Transitions@0.1.0-alpha.76
#addin nuget:?package=Cohesive.Transitions&version=0.1.0-alpha.76&prerelease
#tool nuget:?package=Cohesive.Transitions&version=0.1.0-alpha.76&prerelease
Cohesive.Transitions
Cohesive.Transitions models one entity change as portable, inspectable semantics: admission rules, branching,
sparse updates, invariants, interactions, machine movements, and typed outcomes.
Install
dotnet add package Cohesive.Transitions
Start with an immutable record
Transition expressions can use ordinary POCO properties without inheriting from Entity<T>:
public sealed record RunControl(bool Eligible, string Status);
public sealed record ApproveRun(bool Approved);
At application startup, resolve the entity shape and author the transition:
var entity = ObjectEntityDefinition.For<RunControl>(new("run-control"));
var metadata = new TransitionAuthoringMetadata(
new("run-control/approve"), new("revision/1"), new("body"),
new(new(TransitionAuthoring.Producer), new("example/run-control"), DocumentOrigin.Generated));
var approve = TransitionAuthoring.Create<RunControl, ApproveRun, string>(
entity.Shape,
metadata,
transition => transition
.Invariant(new("valid-status"), state => state.Status != "invalid")
.Requires(new("eligible"), (state, input) => state.Eligible && input.Approved,
(state, input) => "rejected")
.Set(new("approve"), state => state.Status, "approved")
.Return(new("result"), TransitionOutcomeDisposition.Applied, "approved"));
The shape and the restricted expressions produce the same canonical Transition IR as explicit entities and direct IR authoring. Compile the document once and reuse its plan. Invocation expressions read the original observation; ordered patches produce a candidate observation, and invariants check that candidate. Neither authoring nor execution mutates the record. POCO authoring and execution covers materialization, names, value-object contracts, and the supported subset.
Explicit entity declarations
The C# entity surface discovers fields and produces the canonical observation shape. Ordinary field declarations do not require node IDs:
public enum LoadStatus { Draft, Assigned }
public sealed class Load : Entity<Load>
{
public Load()
{
Status = Field(nameof(Status), LoadStatus.Draft);
CarrierId = Field<string?>(
nameof(CarrierId),
initialValue: null,
configure: field => field.Optional());
Invariant(
"AssignedLoadsHaveACarrier",
load => load.Status != LoadStatus.Assigned ||
load.CarrierId != null);
}
public Field<LoadStatus> Status { get; }
public Field<string?> CarrierId { get; }
}
Transition authoring then uses restricted typed expressions over the current entity observation and a typed input. Those expressions lower immediately into canonical IR; arbitrary method calls, hidden I/O, captured runtime state, loops, and mutation are rejected.
What a Transition produces
- A canonical, persistable
ExecutionDefinitionDocument. - Exact input, entity-observation, and outcome contracts.
- Admission rules and deterministic branch structure.
- An algebraic sparse patch rather than in-place entity mutation.
- Interaction intents and machine movements when declared.
- Candidate-state invariant checks and typed outcome evidence.
- Structured source maps, validation diagnostics, and a semantic fingerprint.
The document is the semantic authority. The typed handle, static plan, reference interpreter decision, repository commit, and emitted interaction envelopes are projections or interpretations of that exact document.
Current authoring boundary
Entity shape discovery and common field defaults are convention-driven. The current Transition builder keeps stable identities explicit for durable rules, branches, updates, and outcomes; advanced examples and the canonical IR are therefore documented separately. Additional identity conventions should be added to the authoring API before they are presented as ordinary syntax.
Use it when
- Entity invariants and legal changes should be explicit and reusable across hosts.
- A decision must be testable without a database, message broker, or HTTP endpoint.
- Storage needs a sparse patch and exact concurrency evidence rather than an opaque callback.
- Processes, APIs, presentation actions, and tooling should reference the same domain behavior.
Continue
- Internals contains the complete explicit authoring example, canonical IR, persistence, compilation, reference interpretation, and expression-site details.
- Execution kernel guide explains Transition linking and execution boundaries.
Cohesive.Storageattaches repository and commit interpretations.Cohesive.Processescoordinates Transition invocations with other semantic work.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Cohesive (>= 0.1.0-alpha.76)
- Cohesive.Relations (>= 0.1.0-alpha.76)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Cohesive.Transitions:
| Package | Downloads |
|---|---|
|
Cohesive.Processes
Cohesive semantic system definition and orchestration building blocks. |
|
|
Cohesive.Api
Cohesive semantic system definition and orchestration building blocks. |
|
|
Cohesive.Storage
Cohesive semantic system definition and orchestration building blocks. |
|
|
Cohesive.Host
Cohesive semantic system definition and orchestration building blocks. |
|
|
Cohesive.Identity
Cohesive semantic system definition and orchestration building blocks. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.80 | 74 | 9/8/2026 |
| 0.1.0-alpha.79 | 109 | 9/7/2026 |
| 0.1.0-alpha.78 | 112 | 9/7/2026 |
| 0.1.0-alpha.77 | 93 | 9/7/2026 |
| 0.1.0-alpha.76 | 127 | 9/6/2026 |
| 0.1.0-alpha.75 | 139 | 9/6/2026 |
| 0.1.0-alpha.74 | 136 | 9/6/2026 |
| 0.1.0-alpha.73 | 191 | 9/5/2026 |
| 0.1.0-alpha.72 | 127 | 9/5/2026 |
| 0.1.0-alpha.71 | 131 | 9/4/2026 |
| 0.1.0-alpha.70 | 131 | 9/4/2026 |
| 0.1.0-alpha.69 | 125 | 9/2/2026 |
| 0.1.0-alpha.68 | 133 | 8/30/2026 |
| 0.1.0-alpha.67 | 240 | 8/26/2026 |
| 0.1.0-alpha.66.5 | 174 | 9/6/2026 |
| 0.1.0-alpha.66.4 | 215 | 8/30/2026 |
| 0.1.0-alpha.66.3 | 136 | 8/29/2026 |
| 0.1.0-alpha.66.2 | 133 | 8/27/2026 |
| 0.1.0-alpha.66.1 | 142 | 8/26/2026 |
| 0.1.0-alpha.66 | 182 | 8/25/2026 |