
About this project. A standalone, generalized extraction of an architecture pattern from Ventute — a production AI-driven business-simulation platform — distilled into self-contained, runnable form. Published as a portfolio piece demonstrating production-grade LLM guardrails and typed structured-output validation. Author: @m4xkushnir.
```json, buries it in prose, truncates mid-field Parse exception → dropped turn, or worse, a partial write Missing Omits a required field KeyError deep in your business logic Invalid enum Invents an action ("self_destruct") that isn't in your set Dispatch to a code path that doesn't exist Out of range Emits confidence: 1.7, priority: 99 Silent logic corruption downstream Exaggerated Proposes multiplying a value by 1,000,000 in one step Runaway, un-auditable state Injected keys Adds __proto__ / unexpected fields Prototype pollution, un-vetted data persistedtry/except here, a .get() with a default there — scatters trust decisions across your codebase and guarantees that one of them is missing. The result is intermittent, hard-to-reproduce state corruption that only shows up under the exact model output nobody tested.action, a status, and numeric resource_deltas against a shared State. Replace AgentDirective, CLAMP_RANGES, and MAX_GROWTH_FACTOR with your own; the parser, wrapper, and retry/fallback machinery are unchanged.LLMClient protocol (complete(system_prompt, user_prompt) -> str). Drop in any OpenAI / Anthropic / OpenRouter client that satisfies it. The bundled ScriptedLLM replays canned responses so the whole suite runs with no API key and no network.Posted Jul 31, 2026
Implemented a deterministic boundary for LLM proposals to prevent state corruption.