In the era of AI-driven development, it has become incredibly easy to build rapid prototypes, but scaling them to reliable, production-ready systems remains a significant challenge. This talk explores the transition from unstructured, AI-generated “slop” code to highly deterministic systems using explicit software models like state machines.
The Rise of “Slop” Code
Slop code is defined as code built without a reliable, explicit model. While it may appear to work initially, it lacks clear domain boundaries, makes tracking state changes difficult, and is highly prone to compounding errors. LLMs are trained on existing human codebases, meaning they often repeat bad practices, resulting in messy architectures when left unconstrained by structured engineering processes.
Deterministic Core, Agentic Shell
The solution is to invert the typical AI workflow. Instead of building unconstrained AI agents that call programs, developers should write deterministic programs that strategically call LLMs at the edges. This design pattern—often termed “deterministic core, agentic shell”—places non-determinism at the boundaries (e.g., parsing fuzzy user input or generating text) while keeping the control flow and state management completely deterministic.
The Power of Explicit Modeling
Explicit modeling (e.g., state machines and statecharts) represents system behavior clearly through states, events, and transitions. It separates noisy execution code from behavioral intent, helping both human developers and AI agents understand system rules. By modeling complex logic explicitly, teams can easily iterate and integrate AI features without compromising code stability or security.
Mentoring question
Looking at your current project, which complex or non-deterministic workflow could you extract and refactor into an explicit, deterministic model like a state machine?
Source: https://youtube.com/watch?v=uMvTAF280so&is=ekbY35kBI2c3PGVG