# Tasks: enterprise-fsm ## 1. Scaffold - [x] 1.1 `universal/control-flow/fsm/`; 100/100/100/100; guard tests; CLAUDE/README/FOLDERS. ## 2. Errors + schemas - [x] 2.1 `src/fsm-utils.ts` — `createFsmError`, validation helpers. - [x] 2.2 Zod schemas for `MachineConfig`, `StateConfig`, `TransitionDefinition`. ## 3. Core FSM - [x] 3.1 `src/fsm.types.ts` — full type surface. - [x] 3.2 `src/fsm.ts` — `createMachine`, `StateMachine` with listener API, sync/async guards + actions, snapshot/restore. - [x] 3.3 `src/fsm-hooks.ts` — hook map + handler signatures. - [x] 3.4 OTel histogram + counter. ## 4. Hierarchical - [x] 4.1 `src/hierarchy/hierarchical-fsm.ts`. ## 5. Parallel regions - [x] 5.1 `src/parallel/parallel-fsm.ts` with sync points. ## 6. History states - [x] 6.1 `src/history/history-state.ts` — shallow + deep history. ## 7. Deferred events - [x] 7.1 `src/deferred/deferred-queue.ts` — bounded queue with drop-oldest/drop-newest policy. ## 8. Visualisation - [x] 8.1 `src/visualization/fsm-visualizer.ts` — DOT + Mermaid. ## 9. Docs / barrel / subpath exports / README ## 10. Benchmarks - [x] 10.1 `transition.bench.ts` at 10 / 100 / 1 000 state configurations. ## 11. Ship gate - [x] 11.1 Verification sequence; fold + archive.