Building Blocks
Cohesive. Machines
Cohesive.Machines is the forthcoming block for defining finite state machines as a semantic intermediate representation.
A Cohesive machine defines which lifecycle states exist and which movements between them are legal. Other Cohesive blocks define what those movements do, how they execute, how users interact with them, and how they participate in larger workflows.
State Evolution
Most software systems contain state machines even when they are not named: status fields, approval flows, task lifecycles, order lifecycles, UI wizards, integration stages, and runtime orchestration states.
When those lifecycles live only in switch statements, status strings, or scattered validation checks, they become difficult to verify and evolve.
Machine Model
A machine is a labeled transition system. It can define:
- States, labels, descriptions, and semantic roles.
- Initial states and terminal states.
- Legal transitions between states.
- Guards, invariants, and transition metadata.
- Perspectives over the same lifecycle for users, operators, APIs, or processes.
- Coherence rules that make invalid lifecycle definitions detectable.
Execution Independence
Machines define legality, not execution. A machine can say that Draft may move to Submitted, but transitions, processes, APIs, and storage decide how that movement is requested, validated, persisted, audited, and surfaced.
That separation keeps the lifecycle analyzable without collapsing it into handler code.
Integration
| Block | How it uses machines | Value |
|---|---|---|
| Transitions | Attach state-machine movement to semantic state changes. | Legal lifecycle movement and field updates stay aligned. |
| Presentation | Render actions, task states, wizards, and lifecycle timelines. | Users see valid actions derived from the lifecycle model. |
| Processes | Coordinate waits, approvals, retries, and terminal outcomes. | Long-running workflows can reason about state movement. |
| Relations | Project lifecycle state into queries, dashboards, and materialized views. | Operational views stay consistent with lifecycle semantics. |
Coherence
Machine definitions should be checkable: every non-terminal state should have expected outgoing paths, terminal states should be explicit, guards should reference known fields, and perspectives should not invent impossible movement.
Cohesive.Machines makes state evolution a model that can be inspected, verified, projected, and refined.
