Implementation
Implementation Notes for Enforcing Workflow Transition Legality
Transition rules only protect the workflow when the runtime rejects illegal moves, not when they exist as diagrams the agents never consult.
Every workflow has a diagram somewhere showing the legal paths. The only question is whether the runtime enforces the diagram or politely ignores it.
Enforcement mechanics
- Validate the from-state atomically with the transition write.
- Return distinct errors for illegal moves versus stale state.
- Log rejected transitions with enough context to find the buggy caller.
Use the architecture guide, blackboard schema, and examples to make illegal transitions rejectable at the moment they are attempted.