David Khourshid: implicit state machines are how AI agents inherit your bugs

DavidKPiano · x · 2026-11-09

XState creator David Khourshid explains that apps are full of state machines — logic defining "when we're in this state and this event happens, we move to that state." Explicit ones (switch statements, reducers, libraries like XState) have enumerable transitions, but ad-hoc logic scattered across the codebase forms implicit state machines. Developers code this way, and agents vibe-code the same way — because they learned from humans.

The problem: it's unclear which transitions are possible, so impossible "allowed" states sneak in. All tests can pass and review agents can say "LGTM" while serious bugs remain — he cites the Apple FaceTime bug as an example. Takeaway: make your app logic explicit.

Original post →

More from coding & agent

coding & agent channel →