Madness Driven Design: Don Quixote, Sancho Panza, and Your AI Copilot

TL;DR: An LLM is like Don Quijote—you can’t cure his madness, it’s stochastic by nature. The solution isn’t to fix the madman but to assign him a deterministic Sancho Panza as a sidekick. MDD consists of two layers: first, you study the errors it makes to design tools that absorb those mistakes, and then you let it loose with those tools to verify you’ve closed any gaps. Design for madness, not against it. ...

March 26, 2026 · Fernando

Adversarial Programming: When Your AI Copilot Invents APIs

TL;DR: Your AI will invent API fields that sound perfect but don’t exist. The solution isn’t hoping it gets it right: download the real schema before writing code, capture real responses as fixtures, and separate fetch from processing so you can test without the network. Adversarial programming: code assuming your copilot lies. Have you ever written code against an API where everything compiled, tests passed, the logic made sense… and when you connected to the real API, nothing worked? ...

March 26, 2026 · Fernando

5 Defenses Against Code Hallucinations (and Why Only 3 Work)

Last week I wrote about how my AI invented a complete JSON structure and wrapped it in DTOs, fixtures, and passing tests. 90 green tests. All fiction. That post was the diagnosis. This is the treatment. After discovering the disaster, I did what any engineer with wounded pride does: obsessively research for days to prevent it from happening again. I read papers, tried tools, analyzed real data from my APIs, and built a defense system for my app. ...

February 16, 2026 · Fernando