Commoditizing Determinism
By Leo GorodinskiPublished Jul 1, 2026Updated Nov 19, 2026
Language models have pushed neural, nondeterministic computation further than most of us expected. A model drafts a service, translates a schema, or proposes a refactor in minutes, and each year the same work costs less.
Joel Spolsky's old advice to "commoditize your complement" applies here. A product becomes more valuable when the things it's used with get cheap. For anyone building on cheap generation, the complement is whatever lets us accept what was generated: the invariants, contracts, allowed transitions, and checks that tell us a change is correct. Those have stayed expensive. They're expensive to work out, more expensive to write down, and they rarely carry over from one system to the next.
By commoditizing determinism I mean making those guarantees cheap to state, reusable across systems, and enforced without anyone remembering to check them. We should not have to infer what we've already established, and stating it formally shows us what we never established at all.
Neural Proposes, Deterministic Commits
Coding agents already depend on this division of labor. The model proposes an edit, and a compiler, a type checker, a test suite, or a linter decides whether it stands. An agent that can run the tests is far more useful than one that can't, because the tests answer the same way every time and the agent can act on the answer.
Those tools check the language and the framework, though. The compiler knows that a field holds a string. It has no idea that an order can't ship before payment clears, because nobody told it. That rule belongs to the system, and in most codebases it lives only as a pattern repeated across a few handlers.
The Patchwork Problem in LLM-Generated Code measured what happens at that gap. Models produced changes that were valid locally and inconsistent with the rest of the system, and the authors found that the large majority of those structural failures got past type checking, testing, and static analysis. The deterministic layer we have is good at the questions it was built for, and the system's own decisions aren't among them.
The Cost of Re-inference
Most of what a system has decided is written down nowhere in particular. Some of it is in code, spread across the handlers that happen to enforce it. Some is in tests, which show that a rule held for the cases someone thought to try. Some is in a design document that was accurate the week it was written, and the rest is in people's heads.
Every newcomer reconstructs those decisions, and teams have long accepted that cost because it's paid once per hire. Agents pay it on every task. A new session starts without the context the last one built up, reads the code, infers what the rules seem to be, and acts on its inference.
Take a rule most commerce systems have: an order can't ship before payment clears. In a typical codebase the rule is enforced in the standard checkout handler and again in the admin tool that releases held orders. An agent asked to add an express checkout path finds the nearest handler that creates orders, follows its pattern, and writes a path that moves an order to shipped without checking payment. The change compiles, its tests pass, and it ships unpaid orders. Nothing told the agent the rule existed, so it had to infer the rule from two call sites, and it inferred wrong.
The example is hypothetical, but the Patchwork study found the same failure in generated code: a new route that skips the authentication guard every sibling endpoint applies. Each change was valid on its own, and the codebase as a whole stopped enforcing a rule it used to enforce everywhere.
The obvious reply is that the agent should have read more carefully, since the rule is right there in the code. Reading code tells you what the system does, though, and what it's meant to do can differ. A check that appears in two handlers and is missing from a third might be a rule with a bug in the third handler, or a special case that the third handler deliberately skips. The code looks the same either way. A careful reader can usually tell, and an agent sometimes can, but both are guessing at something the team already knows.
A decision can be made explicit to different degrees, and each degree leaves a different amount for the reader to infer.
Implicit in code
- What the reader still has to infer
- That the rule exists, where it applies, and whether a missing check is a bug
Documented
- What the reader still has to infer
- Whether the document is still accurate
Tested
- What the reader still has to infer
- Whether the untested cases follow the same rule
Declared and enforced
- What the reader still has to infer
- Nothing about the rule itself, only how to satisfy it
Documentation drifts because nothing checks it against the code. Tests sample the rule at the points someone chose. A declaration that the system enforces on every change holds wherever the system runs, including in code written after the rule was declared.
Prose Underdetermines
Suppose we write the rule down in a design document or an AGENTS.md file. That
helps until a reader meets a case the sentence doesn't settle, and a better
model can't settle it either.
A model's output varies for two different reasons. The first is stochastic: given the same input, the model produces different outputs on different runs. That variance lives in the model, and better models and better sampling shrink it. The second is underdetermination: the input is consistent with many valid readings because the information that would choose among them isn't there. That variance lives in the specification, and no improvement to the model fixes it. A better model guesses better, but it's still guessing.
The choice a specification leaves open gets made anyway. Whoever fills the gap, a person or a model, falls back on defaults, so you get the average system instead of yours, and the average system looks right. The study Can LLMs Learn and Apply Multi-Level Modelling Semantics? found this pattern in generated models. The models reproduced what the task text stated and rarely produced the structure and constraints the text implied without stating them.
The writer can't easily see the gaps either. What's obvious to you is exactly what you leave unsaid, so a sentence that reads as complete to its author can be full of decisions its reader has to make. Here's the shipping rule as a sentence:
An order can't ship before payment clears.
A real order's payment can be Pending, Authorized, PartiallyCaptured,
Captured, AuthorizationExpired, or Refunded.
To enforce the rule you have to say which of these states count as cleared, and the sentence doesn't. Many merchants capture card payments only when the goods ship, so for them an authorization is what permits shipping and capture happens on the way out the door. Others want the money captured first. A partial capture might allow a partial shipment, or it might hold the whole order. An authorization can expire while the order waits in the warehouse, and a refund can arrive after the order has already gone. Each of these has a reasonable answer, and the sentence gives none of them. A team might have settled every one in a meeting and still written only the sentence.
This is why code is often the clearest way to convey an idea. A definition written in code can leave things out, but the omission shows. In a language with exhaustive pattern matching, such as Rust or F#, the compiler flags a match over the payment states that leaves one out. If a state has no transition out of it, anyone reading the definition can see that. Prose has no equivalent check, so an omission in prose looks the same as a decision that didn't need saying.
Declared Once
Cohesive treats a system's decisions as source. Teams declare entities, their transitions, and the invariants that every valid state must satisfy. A deterministic compiler builds a system graph from those declarations, and generated code, infrastructure, and the context an agent receives are all derived from it. The decision lives in one place, and everything that depends on it reads it from there.
Here's the shipping rule after the team has decided what "cleared" means. In this case they chose to capture payment before shipping:
public sealed class Order : Entity<Order>
{
public Order()
{
Status = Field(nameof(Status), OrderStatus.Placed);
Payment = Field(nameof(Payment), PaymentStatus.Pending);
Invariant(
"ShippedOrdersHaveCapturedPayment",
order => order.Status != OrderStatus.Shipped ||
order.Payment == PaymentStatus.Captured);
}
public Field<OrderStatus> Status { get; }
public Field<PaymentStatus> Payment { get; }
}The invariant belongs to the order itself. A test for the agent's express
checkout path can start with an order whose payment is pending, run checkout,
and call ValidateState on the resulting order state. If checkout marked the
order shipped while payment was still pending, the validator raises
InvariantViolationException and names the rule that failed,
ShippedOrdersHaveCapturedPayment. A test for the admin tool can validate
its result against the same rule.
The agent also doesn't have to find the rule by reading handlers. It's part of the order's definition, which is part of what the agent is given when it works on orders. The team's decision reaches the agent directly instead of through the agent's reconstruction of it.
The same approach extends past single entities. Where a rule spans several entities or services, it raises questions about what has to commit together, and those belong to the system's commit boundaries. An Order Is Not an Actor works through that case with the same order.
Objections and Limits
Formalizing is expensive and makes systems rigid. Formalizing everything would be. The proposal here is narrower: formalize what you've already decided. Those decisions are already constraining the system, and the cost of leaving them implicit is paid again by every person and every agent session that has to infer them. Writing one down costs about as much as one careful inference, and it's paid once.
Models will keep getting better. They will, and they'll make fewer random mistakes. That addresses stochastic variance. When a specification is missing the information that decides a question, a better model still has to guess, only more plausibly, which makes a wrong guess harder to catch.
Some vagueness is useful. Early in a project, leaving questions open gives the team room to explore, and pinning them down too soon closes off options nobody has considered yet. The goal is to make vagueness visible and deliberate. A decision that's been deferred on purpose can be marked as open or assumed, so readers know to ask instead of guessing.
Declarations can be wrong too. They can, and a wrong invariant enforced everywhere does more damage than a wrong guess in one handler. The difference is that a declaration is wrong in one reviewable place, where a fix applies to every path at once. Checking that an implementation still agrees with its declarations is a separate problem, and Verify to Trust covers it in detail.
What We've Established
Cheap generation makes it tempting to accept a plausible change and move on. Every system already carries a set of decisions about what is and isn't allowed, and each time a person or an agent has to rediscover them, we pay again for something we already own. Some of those decisions turn out never to have been made, and the first person to notice is usually someone writing them down.
Making determinism cheap means giving those decisions a home where they're stated once, checked on every change, and handed to every reader that needs them. We should not have to infer what we've already established.
Sources
- Joel Spolsky (2002). Strategy Letter V
- Mothukuri and Parizi (2026). The Patchwork Problem in LLM-Generated Code
- Fu et al. (2026). Can LLMs Learn and Apply Multi-Level Modelling Semantics? A First Empirical Study
Links checked Nov 19, 2026.