How to spend the most expensive intelligence on uncertainty—and move repetition into contracts, generators, and cheaper models.

Imagine a seemingly straightforward pivot.

A store that previously sold standard products starts offering annual digital licenses. Once payment is confirmed, the user should automatically receive access for 365 days. Reprocessing the same webhook must not create a second license.

You can hand a requirement like this to a coding agent.

It will read the repository. It will find checkout, products, orders, and payments. It will propose a data model. It will add a migration, a service, a few endpoints, and tests. With a good enough model, there is a strong chance that the result will work.

But “write the code” is the least interesting part of the problem.

First, we need to decide what a license actually is in this system.

Is it a separate checkout type?

A product behavior?

Should the entitlement be created directly inside the payment callback?

What happens after a failure?

How do we retry the operation?

Where do we guarantee idempotency?

Should an order reference the current product, or preserve a snapshot of what the customer actually bought?

Only after answering these questions can we determine what code makes sense.

And this is where I see the boundary of vibe coding.

The problem is no longer whether AI can write code. It can.

The problem is how many decisions we allow it to make again every time it touches the system.


“Plan with the best model, execute with a cheaper one” is not enough

A popular strategy for working with models sounds reasonable:

Plan with the best model. Execute with a cheaper model.

The powerful model designs. The cheaper one implements.

But there needs to be something more than a Markdown plan between those two stages.

If we hand the second model a document containing a dozen decisions, it still has to determine which of them are requirements, which are suggestions, how they map onto the existing codebase, and where its freedom ends.

Formally, it received a plan.

In practice, it is still doing part of the architectural work.

That is why it is useful to separate three kinds of tasks that we usually lump together under the word “coding.”

A decision problem occurs when we need to determine how the system should work.

A reasoning problem occurs when a solution exists, but finding it requires analyzing dependencies, alternatives, or failures.

An execution problem begins when the decision has already been made and we need to correctly implement its consequences.

All three may end in a pull request.

They do not all require the same level of intelligence.


A better model and a higher reasoning level solve different problems

It is worth separating two dimensions here.

One is model capability.

The other is reasoning effort—how much work we allow a particular model to do on the problem.

A larger reasoning budget can help a model explore more variants, test hypotheses, or verify its own solution. But there is no general rule that says a weaker model on max becomes equivalent to a stronger model on medium.

Current OpenAI evals illustrate this well.

On SWE-Bench Pro, GPT-5.6 Sol scores 64.6%, while Luna scores 62.7%. That is a small difference. On SEC-Bench Pro, however, the gap is 71.2% versus 48.9%. In internal Research Debugging, it is 68.3% versus 50.8%.

GPT-6 Astra shows the same effect from another angle: on Terminal-Bench 4.0, it scores 57.9%, compared with 37.3% for GPT-5.6 Sol.

This does not imply a simple hierarchy of “the best coding model.”

It implies something more useful:

the advantage of a stronger model depends on the class of problem we give it.

If the decisions have already been made and the task is tightly constrained, a cheaper model may be good enough.

If it has to discover the domain, uncover hidden assumptions, design the architecture, and anticipate side effects at the same time, we are buying capability.

That is why frontier intelligence is most valuable where uncertainty still exists.


The most expensive decision is the one we make twice

Suppose an application has pages, documentation, and a blog.

Each of these content types needs a title, slug, language, SEO description, body, owner, and the ability to be published at a specific time. The slug should be unique within a language.

We can encode these assumptions separately in multiple implementations.

Or we can write them down once.

In the actual GOAT model, the base content entity defines, among other things, title, slug, lang, publication_date, description, body, the owner relation, and a unique(lang, slug) constraint.

page, doc, and blog extend this base with their own SSR, SEO, and CRUD configuration.

In traditional software engineering, this is simply a sensible abstraction.

In an environment where AI agents also modify the codebase, there is an additional effect.

The next agent does not need to reconstruct the shared rules from three similar implementations.

The decision has been compressed into a single representation.

For the purposes of this article, let us call this decision compression:

A domain decision is written in a form that prevents later stages of the process from having to reinterpret it.

That form might be a schema, type, DSL, API contract, policy, or constraint.

Not every one of these mechanisms is an equally strong contract.

But the direction matters more than the specific technology.


Documentation tells an agent what we wanted to do. A contract should constrain what it is allowed to do

Today’s agentic systems are surrounded by increasing amounts of context.

We have AGENTS.md, architecture docs, system prompts, style guides, and code examples.

That helps.

But there is still a fundamental difference between this sentence:

a slug should be unique within a language

and this declaration:

unique(lang, slug)

The first has to be interpreted by the agent.

The second can be checked by the system.

This is not a new idea. Software engineering has been using DSLs, schemas, type systems, model-driven development, and generators for a long time.

What is new is the environment in which such a formal model can simultaneously become an interface between a human, an LLM, and a generator.

Unmesh Joshi described a very similar pattern in 2026 in *DSLs Enable Reliable Use of LLMs*. His argument is practical: a small, constrained DSL reduces the number of possible representations of the same intent, while a parser, type checker, or compiler can provide the agent with deterministic feedback.

That is far more interesting than simply writing a “better prompt.”

A prompt helps the agent guess correctly.

A contract should make some incorrect answers inadmissible.


Contract-Driven AI Development already exists—and it is worth saying so explicitly

The term itself is not ours.

In November 2025, Enrico Piovesana published the Contract-Driven AI Development (C-DAD) framework. Its starting point is very similar: most codebases store intent and constraints implicitly, forcing agents to reconstruct them. C-DAD proposes machine-verifiable contracts that include, among other things, preconditions, postconditions, and invariants.

What interests me here is a related, but more generator-first, version of that idea.

Not only:

how do we make an agent understand the contract?

But also:

how many consequences of that contract can we execute without using a model at all?

GOAT is a useful case study precisely because it combines a declarative model with generation of subsequent application layers.


Back to the license

Our business requirement is:

After payment for a digital_license product, the user should receive a 365-day license, and retries must not create a second entitlement.

The worst possible handoff looks like this:

Implement licenses in the store.

At that point, the agent is simultaneously a business analyst, architect, database designer, backend developer, and reviewer.

A better approach is to establish the domain model first.

In the actual GOAT model, a product has a product_type.

shop_order_item stores its own product_type, allowing the behavioral type to be preserved as a transaction snapshot.

shop_fulfillment contains status, product_type, an attempt count, available_at, locked_at, and last_error. A domain comment describes this entity as a durable, retryable task executed after payment.

shop_license stores the user entitlement and its relation to shop_order_item, together with status and validity period.

Once the architectural decision has been made, the flow can therefore look like this:

business intent

annual license after payment

↓

decision

digital_license is a product behavior fulfilled through a retryable fulfillment process

↓

contract

product type + order snapshot + fulfillment + license + relations + permissions + constraints

↓

generator

repeatable application structure

↓

cheap model

local fulfillment logic + test

The most important change happened before the first line of code was generated.

We reduced the decision space.


A cheaper model becomes useful when we stop asking it to be the architect

Once the contract has been established, the execution task can be much narrower:

Implement the digital_license handler according to the existing model. Do not change the schema or API. For the relevant order items, create the entitlement, set the validity dates, preserve retryability, and add a test.

The model no longer needs to decide:

where to store the license,

how to represent fulfillment,

whether a new entity is needed,

how to connect the entitlement to the order.

Those decisions were made earlier.

What remains is a constrained implementation problem.

That matters more than simply comparing model prices.

We are not trying to replace Astra with Luna.

We are trying to transform the problem so that it no longer requires Astra.


The generator should take over everything we do not want to renegotiate

LLMs and generators have opposite strengths.

A language model is good at uncertainty. It can analyze incomplete requirements, compare options, and adapt a solution.

A generator should be boring.

If we have established a single DTO pattern, we do not want a new interpretation for every entity.

If every field of a particular type should behave identically, creativity becomes a source of drift.

That is why one of the most important principles of this approach is:

Use AI to decide what. Use generators to repeat how.

GOAT introduces another interesting layer: AI can help create the generator templates themselves.

That changes the scale of the value.

If a powerful model implements one feature, we use its reasoning once.

If it helps us identify a repeatable pattern and move it into the generator, the same decision can be reused across dozens of future implementations.

This is where AI begins to help not only with building the system, but also with improving the machine that produces the system.


But a contract is only as valuable as what it actually enforces

Here, GOAT’s own model gives us a very good counterexample.

product_type, which may control executable product behavior, is currently defined as short_text.

From the schema’s perspective, all of these are equally valid:

digital_license

digital-licence

license365

If the set of possible behaviors is finite, an enum or an explicit handler registry would provide a stronger contract.

An even more interesting example appears in shop_fulfillment.

A comment describes the uniqueness of the order/type pair as the mechanism that guarantees idempotency.

But the model shown does not appear to contain a constraint that actually enforces that uniqueness.

That is not a weakness worth hiding.

It illustrates precisely the boundary between intent and contract.

A comment can tell an agent that an operation should be idempotent.

A constraint can make the system reject a state that violates that rule.

And that is why simply having a DSL is not enough.

Contract-driven development begins when important invariants are not merely described, but can actually be enforced.


Not everything should go into the DSL

There is an opposite risk as well.

At first, the DSL contains a few simple declarations.

Then we need exceptions.

We add conditions.

Hooks.

before.

after.

retry.

unless.

custom_handler.

Eventually, we discover that we have built a programming language—just a worse one.

Joshi points to exactly this tension: a DSL helps an LLM when it remains constrained and defines clear boundaries.

That leads to a simple practical rule:

Formalize what is repeatable. Code what is exceptional.

Data, relations, constraints, standard permissions, and CRUD operations are good candidates for formalization.

Unusual algorithms and one-off behaviors often still belong in code.

The boundary will shift as the system matures.

And that is fine.


The biggest source of AI drift may have nothing to do with hallucination

Imagine another requirement:

a user can edit their profile.

The implementation looks good.

Later, the requirement becomes more precise:

but they cannot change their email address.

Security introduces another rule:

changing an email address must go through a separate verification process.

The admin panel still uses the old CRUD.

One API uses the newer permission model, another uses the older one.

The agent does not need to invent anything to make a mistake.

It only needs to correctly solve a fragment of the problem.

As the codebase grows, the number of places from which intent must be reconstructed grows with it.

A larger context window helps the model read more code.

It does not guarantee that the agent can distinguish a business decision from an accidental implementation detail.

That is why an important part of scaling AI coding will not only be the ability of models to consume more context.

It will also be the organization’s ability to reduce the amount of context that requires interpretation in the first place.


DECIDE → FREEZE → EXPAND → VERIFY

The entire model can be reduced to four stages.

DECIDE — a powerful model or a human works on what is still unknown: the domain, architecture, security, migration strategy, a difficult bug, or business consequences.

FREEZE — once the decision is stable enough, it stops existing only in conversation. It moves into a schema, domain model, DSL, API contract, policy, test, or generator rule.

EXPAND — the generator executes the mechanical consequences. A cheaper model fills in small, clearly bounded gaps.

VERIFY — parsers, compilers, schemas, tests, static analysis, and review validate the result. A model may participate in this loop, but it should not be the sole judge of its own work.

This approach does not remove AI from implementation.

It changes where we use its intelligence.


The most interesting form of organizational memory may be code that no longer needs interpretation

Organizations have far more technical knowledge than what exists in their documentation.

How ownership works.

Which data is snapshot-based.

Which roles may modify which data.

What an order status means.

What a correct CRUD implementation looks like.

Which behaviors must be idempotent.

This knowledge lives in code, pull requests, tickets, documentation, and people’s heads.

An LLM can try to reconstruct it.

But reconstructing the same knowledge for every change is expensive.

If some of those decisions can be turned into a constraint, schema, or generator, they stop being merely team knowledge.

They become properties of the system.

That is why generators are worth seeing as more than a way to write boilerplate faster.

They can also become a way of preserving organizational decisions in a form that future models inherit automatically.


What comes after vibe coding?

Vibe coding asks:

Can AI build this?

Increasingly, the answer is yes.

But in a large system, there is a more interesting question:

Six months from now, will the next agent have to rediscover why we built it this way?

If so, we are paying for the same decision every time.

Models will get better.

Reasoning will get cheaper.

Agents will work for longer.

Context windows will grow.

But an agent that reads a million lines of code will still have to determine which of them represent intent and which are accidental implementation history.

Contract-driven AI development proposes a different direction.

Not trying to make AI better and better at guessing how our system works.

Making the system require less and less guessing from AI.

A powerful model should help make decisions where uncertainty exists.

A contract should preserve the decisions we do not want to renegotiate.

A generator should execute what we already know.

And a cheaper model should receive a bounded problem where flexibility is still genuinely useful.

The most expensive intelligence should not be spent where the largest amount of code is produced.

It should be spent where the decisions are made that will later be repeated thousands of times.