← All articles

From Invention to Deduction: Reclaiming Engineering in the GenAI Era

17 min readsoftware-architecturetype-systemssoftware-engineeringfunctional-programmingsoftware-design

Machine-translated from Spanish. Read the original

ByFederico Sawady O'ConnorRagnagrok Academy

Two beliefs dominate software development today, and both are half-truths. The first is “code is cheap,” which we already covered in a previous article. And a second one, quieter but more dangerous, is “we already understand the problem well.”

The first is only half true, because it has never been easier to generate lines of code, and they usually work, too, but what's cheap is generating them, not maintaining them. The second, on the other hand, is almost never true. And when you put them together, you get the trap of the moment, machines producing solutions at industrial speed for problems we still haven't fully understood. Take a holistic, longer-term view and it's clear the bottleneck was never writing; it was knowing what to write, and why.

Correction (November 25, 2026). The first version said the first belief "is simply true", right after calling both of them half-truths. It also contradicted “Code Is Cheap”: The Modern Fallacy That Could Cost a Fortune, which calls it a half-truth because bad code is more expensive than ever. I found it in a review of the series. The article's argument doesn't change.

What I propose in this article is that, to keep our bearings, we'd do well to go back to two old ideas, older than this whole hype cycle, which are development as discovery and programming as deduction. One invites us to understand the problem better. The other, to build the solution without it falling apart in our hands.

1. Development as a process of discovery

Dave Farley — one of the authors of the book that defined Continuous Delivery — has an uncomfortable thesis for the enthusiasts of total automation, according to which the bottleneck in engineering was never writing code.

His argument is that software engineering isn't about transcribing requirements into a programming language. It's about learning about the domain while we try to solve it. The requirement you were handed at the start of the project is almost never the real problem; it's a first approximation that gets corrected as you build, show, and discover what people actually needed.

And there's an asymmetry here that rarely gets noticed. The real problem is almost never written down anywhere. It lives scattered across what the business thinks it needs, what the user actually does, and the constraints nobody mentioned because they're “obvious.” Building software is, to a large extent, the work of discovering that problem — not receiving it.

That doesn't mean AI can't help with genuine parts of this, such as exploring someone else's codebase, summarizing documentation for you or explaining what a module you've never seen does. But all of that is help for navigating what already exists. The leap it won't make for you is the other one, deciding which problem is worth solving. It speeds up building the solution — and sometimes even understanding the terrain — , but the question of what to build and why is still yours.

In other words, AI speeds up the generating part, and generating was always the easy part — even when it's long and time-consuming — . The hard part is still judging whether what was generated solves the problem in its full context (security, scalability, maintainability, the real human needs behind the ticket). And that judgment is still ours.

The concrete risk is misapplied speed. Without a discipline of small, reversible steps — without real Continuous Delivery — GenAI doesn't get you to the solution faster. It gets you to disaster faster. It's a complexity bomb with the fuse already lit, because every generated commit without real validation is debt you'll pay with interest, and the interest on complexity compounds fast. I wrote about this trap in detail in “Code Is Cheap”: The Modern Fallacy That Could Cost a Fortune — how AI, without a solid design framework, doesn't slow down software entropy but accelerates it.

2. Discovery vs. invention, according to Philip Wadler

If Farley talks about discovering the problem, Philip Wadler forces us to think about discovering the solution.

In his talk “Propositions as Types”, Wadler defends an idea that sounds almost mystical at first but has solid mathematical grounding. The good structures in our solutions — when they're correct — aren't invented. They're discovered.

The heart of his argument is the Curry-Howard isomorphism. Put without jargon, there's an exact correspondence between logic and type systems. A logical proposition corresponds to a type. A proof of that proposition corresponds to a program of that type. It's not a pretty analogy; it's the same mathematical structure seen from two disciplines that found it separately — logicians and computer scientists — without knowing they were looking at the same thing.

Why does this matter in an article about AI? Because it changes the status of what we do. If a language is based on the lambda calculus — like Haskell and several others — , we're not using an arbitrary tool some human invented for convenience. We're using logical laws that were already there, waiting to be put to use. As Wadler says, an alien intelligence that has never seen a keyboard would discover the same structures. That's not a whim but the opposite, a finding.

And if correct structures are discovered, then the engineer's question stops being “what do I invent?” and becomes “what laws govern this, and how do I build in accordance with them?” That's the gateway to deduction — and to an idea we'll develop in section 4, the idea of building in such a way that correctness follows from the structure.

3. The tension — and why it's productive

This is where the big difference between the two worlds shows up, and it's precisely what makes putting them together interesting.

Farley tells us the problem is an external entity, messy, partially unknown. It's discovered from the outside, through experimentation and constant feedback. It's empirical.

Wadler tells us the model of the solution — the types, the logic — should be a deductive system. Not rule-free creativity, but a construction that stands on foundations. It's formal.

They don't contradict each other; they complement each other. The good engineer lives in both registers at once. They explore the problem like a scientist — hypothesis, experiment, correction — and build the solution like a mathematician — from the foundation up, with no unjustified steps.

GenAI, left to its own devices, does neither. And that's the point of this article.

4. From verification to construction

The default mode of a generative model is stochastic invention. It produces code that looks like correct code, because it's made of probabilistic patterns extracted from millions of examples. Sometimes it gets it right. Sometimes it produces something that compiles, passes a superficial test, and fails on case ninety-seven that nobody looked at.

For example, you ask a model for a function that parses dates. It gives you back something that works perfectly with 2024-03-15. It works in the demo, it works on the happy path. What you don't see is that it breaks on leap years, on time zones, or on the exact format used by the vendor you depend on. The code looked correct. That's exactly the trap.

Real engineering leans toward deduction, where instead of generating and then verifying, it's about building in such a way that correctness follows from the structure. It's the difference between proving that something works and making it unable not to work. This has an old name, correct by construction.

There's a whole range of tools that push in that direction, with varying degrees of rigor — and it's worth seeing them as a spectrum, not as a single silver bullet.

Property-based testing is one of the most accessible. Instead of testing isolated, hand-picked cases — which is exactly where bugs hide — , you define the laws the function must always satisfy. For example, “for any list, reversing it twice returns the original list,” or “serializing a date and parsing it back returns the same date.” The tool then generates hundreds of cases, including the weird ones that would never have occurred to you, and tries to break the law.

This doesn't mean unit tests, integration tests, or QA — automated or manual — are unnecessary. They're valuable, because they prevent known regressions and catch what you already know can break. But they all share a ceiling, because they're example-based checks. Given this input, I expect this output. And an example, by definition, only covers the cases you thought of or managed to discover somehow. A property, by contrast, says something about the entire space of possible inputs, and the tool puts it to the test with cases no human would have thought to write, although hundreds of cases aren't a proof. An example verifies a point; a property puts a law to the test.

Correction (November 25, 2026). The first version gave as an example that parsing a date and serializing it back gives the original string, and said a property covers the entire space of inputs. The law was backwards, because a parser that accepts 2024-03-15 10:00 serializes it as 2024-03-15T10:00:00, and the one that holds is serializing and parsing back. And property-based testing tries samples, so it doesn't prove the property. The section's conclusion doesn't change, and I found this in a review of the series.

I developed this in detail in QuickCheck vs. Traditional Testing as a Deterministic Harness in the GenAI Era, with a concrete case in which an agent that implements discounts for a shopping cart writes code that passes the obvious unit tests and yet violates a basic property of the domain — a poorly bounded discount that ends up paying the customer to buy. An example-based test only catches it if someone thinks of exactly that case. The property catches it without naming it, as long as its generator covers everything the parameter accepts, because it defines the contract the code must always fulfill.

Correction (November 25, 2026). The first version said the property catches the bug with no further condition. It only catches it if the generator covers everything the parameter accepts, and in the QuickCheck article the first generator didn’t, as its own correction explains. I found it in a review of the series.

But — and this is the point — property-based testing is still, at bottom, verification, because it acts after generation. It's an excellent harness, but not the final destination.

The denotational view, the deeper step

The final destination is building in such a way that the error can't be expressed. And for that, you need to change the question.

The denotational view consists of thinking about a program in terms of what it means — its mathematical denotation — rather than what it does step by step. When you reason denotationally, the question isn't “what does this code do?” but “what is this function, mathematically, and what laws govern it?” And if the structure is well chosen, entire classes of errors simply can't be expressed. The type doesn't allow the invalid state. Composition doesn't allow the incoherent combination. You don't hunt bugs; you make them inexpressible.

The idea has precedents. John Hughes doesn't talk about denotations in “Why Functional Programming Matters” (1990), an essay that has aged surprisingly well, but he argues for something close to it. His thesis is that, as software becomes more and more complex, structuring it well becomes more important, not less — because well-structured software is easier to write, to debug, and to understand, and it provides reusable modules that make future work cheaper. And the claim that crowns it is that modularity is the key to successful programming (always thinking long term).

Hughes didn't stop at the slogan. He showed concrete mechanisms for achieving that modularity — higher-order functions and lazy evaluation — , that is, pieces that combine according to sensible laws, not by coincidence. That composability is precisely what makes a system tractable, because it lets you reason about the parts and trust that the whole holds together.

Thirty-six years later, with machines churning out code by the truckload, his point becomes urgent. If structure is what keeps software tractable, and you delegate generation without taking care of the structure, you're automating the easy part while eroding the hard one. Hughes's modularity and Wadler's isomorphism point to the same place. If you're going to delegate the how to a machine, you'd better have a rigorous way to reason about the what. The denotational point of view is exactly that way — and it stops being an academic preference and becomes critical infrastructure.

Correction (November 25, 2026). The first version said Hughes put forward the denotational view, but his essay doesn't mention it, and it argues for modularity through higher-order functions and lazy evaluation. It also counted thirty-five years from 1990, and in 2026 it's thirty-six. The argument doesn't change, and I found this in a review of the series.

It's worth noticing the parallel with section 1, because just as the problem is discovered rather than invented, the correct properties of a function aren't invented either — they're discovered by interrogating the domain. “What has to always be true?” is a question of exploration, not of whim. The difference in mindset is total, in that vibe coding, with automated or manual review, asks “does this work?” Deduction asks “what has to be true for this to be correct?” — and builds from that answer.

5. Deterministic guardrails in a non-deterministic world

Producing software with AI is, by nature, non-deterministic. And a lot of people forget that the same prompt can give you two different answers. For that to be safe in production, you need to wrap that unpredictable process in a layer of controls that actually are predictable. Deterministic guardrails that guide and correct the generation.

There are three that have decades of research behind them and therefore have a solid foundation we can take advantage of.

Strong type systems. A good type system works like a mathematical proof built into the code, because there are entire classes of errors that simply can't be expressed. If the model generates something incoherent, it doesn't compile. The type is the first line of defense, and it's free in the sense that it requires no human discipline to run — it's just there. It's the denotational view from the previous section, turned into an everyday tool.

Rigorous CD pipelines. The value of Continuous Delivery here isn't deploy speed; it's that every change gets validated in minutes, not days. When AI can generate twenty changes in an afternoon, you need twenty automated validations that same afternoon. A slow pipeline turns GenAI's speed into a pile-up of unverified changes — the worst of both worlds.

Lightweight formal methods. There's no need to formally prove the whole system; we know that's extremely costly and impractical in most cases. But reasoning explicitly about the key properties — invariants, preconditions, what must always hold — gives the generation process a structure to lean on. The property-based testing from the previous section is the practical, accessible version of this idea, although there are others that are also feasible nowadays, given that AI writes much of the required text (and we'll look at this in upcoming articles).

What all three have in common is that they're automatic and they're inflexible. They don't depend on a tired human reviewing carefully at six in the evening. That's precisely the property that makes them trustworthy.

6. The human “on the loop”

Kief Morris recently introduced a distinction that puts everything above in order, the one between the human in the loop and the human on the loop.

In the loop is the human as gatekeeper, reviewing line by line what the AI produces. It's exhausting, it doesn't scale, and it's deeply error-prone, because reviewing generated code all day is one of the most draining tasks there is, and that ends up letting bugs through. You become a human patch over a process that outstrips you in volume.

On the loop is something else. The human designs and manages the engineering harness. Instead of micromanaging every code artifact, they build the system that controls the agents (the specifications, the tests, the feedback mechanisms, the guardrails from the previous section).

This, it's worth clarifying, doesn't mean stuffing the model with rules. A specification isn't a prison of constraints. Every extra constraint trims the solution space the model can explore, and you often end up forcing it to optimize for your rules instead of for your problem. The human on the loop doesn't dictate unbreakable laws; they surface conscious tensions — the conflicting forces the model must resolve — and leave the reasoning where it belongs. I explored that distinction between specifying more and specifying better in Tension in Software Design: Why Specifying More Isn’t Specifying Better.

But as Morris puts it, the human's place is to build the work loop — not to be a cog in its machinery. We define the what and the why. The AI explores the how on those foundations, but inside an enclosure whose walls we put up.

And this reconnects with everything before it, because the harness is Farley's discovery and Wadler's deduction turned into infrastructure. The tests encode what we learned about the problem. The types encode the logic of the solution. The human on the loop isn't someone who stopped doing engineering — they're someone doing it at a higher layer of abstraction.

Conclusion

Software engineering isn't dying. It's shedding its skin.

We're ceasing to be artisans of syntax — that part, honestly, AI does well — and becoming architects of systems of discovery and deduction. The value is no longer in writing every function. It's in knowing which functions are needed (discovery), in defining what properties they must satisfy and building the system so that correctness derives from its own structure (deduction), and in putting up the harness that keeps the whole process honest (or trustworthy) (the guardrails).

Farley and Wadler, read together, draw the map. The future belongs to those who can navigate the ambiguity of the real world with the empirical discipline of discovery, and who also have the knowledge needed to build solutions on the immutable laws of logic and mathematics. Always on the loop. Always with a firm hand on the guardrails.

Code got cheap. Judgment has never been more expensive.

References and further reading

Correction (November 25, 2026). The first version gave “Harness Engineering” as the origin of the in the loop / on the loop distinction. That article is by Birgitta Böckeler and doesn't mention it, and the distinction is Kief Morris's, as section 6 says. I found this in a review of the series.

From this same series:

Support the blog

If this article was useful to you, you can sponsor the blog on GitHub. It helps me keep writing.