Repository navigation
Tags: open-ships/statemachine
Tags
Add the statemachine package, tests, docs, and CI The library is a transition table compiled once and applied to state the caller owns: Compile/MustCompile, Fire, Permitted, and ErrNotPermitted. The machine holds no current state, which is what removes the need for an internal mutex, observer registry, or deferred-transition protocol. Requires Go 1.26, which keeps Permitted allocation-free: through 1.25 the iter.Seq2 it returns escaped to the heap at 88 B and 3 allocations per call, and escape analysis in 1.26 keeps it on the stack. CI matches the pattern in teleop and n2k: a three-OS matrix on 1.26.x, with the source-property checks on Linux only, and a release workflow that tags from VERSION after a successful CI run on main.