Blog
Fix once, fixed everywhere
By Ted Ghose, Co-founder and CTO · Published · 9 minutes read
The short answer
Every conversion method makes mistakes; the difference is what a fix buys you. A rule that is wrong fails the same way on every object that uses it, so one correction repairs them all on the next run, and the fix is versioned and testable. A language model’s mistakes are one-offs: correcting one object does not correct the next. That is why rule-based conversion gets more reliable as a migration proceeds, and why Novuz uses a model only for the objects rules cannot settle.
No conversion method is right the first time on every object. Rules have bugs. Language models make mistakes. Engineers rewriting by hand make them too.
So “does it make mistakes?” is the wrong question for comparing methods. The useful one is: when you fix a mistake, what else gets fixed?
What a fix buys you, by method
Three methods, three answers.
| Method | When it is wrong | What one fix repairs |
|---|---|---|
| Fixed rules | The same way, on every object that matches the pattern | Every object that uses the rule, on the next run |
| Language model | Differently each time; it can also be right on one run and wrong on the next | That one object |
| Hand rewrite | Differently per engineer | That one object, and perhaps a habit |
What a rule is made of
A conversion rule is not a find-and-replace. It works on the parsed structure of the code, with types and lineage from the estate’s catalog, and it has four parts.
| Part | What it is | Example: a year difference in T-SQL |
|---|---|---|
| Pattern | The structure it matches in the parsed code | A DATEDIFF call whose first argument is year |
| Preconditions | What must be true for it to apply | Both date arguments have known date or timestamp types |
| Rewrite | The target structure it produces | The difference of the two years, which preserves boundary counting |
| Tests | Inputs and expected outputs that prove it | Same day, year end to new year, leap day, NULL on either side |
Each rule carries an identifier and a version. Every line of converted output can be traced to the rule and version that produced it, and two versions of the library can be compared to see exactly what changed.
An example
Suppose a rule converts a date-difference function and gets the boundary wrong: it counts whole days where the source counts day boundaries crossed. Reconciliation catches it, because every object using that function shows the same mismatch on the same kind of rows.
That pattern is the gift. Forty failures with one cause are one problem. We correct the rule, run again, and all forty reconcile. The corrected rule is versioned, so the fix is on record, and it applies to every estate that follows.
Now suppose a model made the same mistake. It may have made it on eleven of the forty objects and not the others, and a second run may move it to a different eleven. There is no rule to correct. Each failing object is its own investigation.
The example in code
The date-difference case, written out. It is illustrative of the form, and it shows why this kind of error survives review: the wrong version is the one that looks most like the original.
-- Source: T-SQL. DATEDIFF(year, ...) counts year boundaries crossed.
SELECT DATEDIFF(year, hire_date, GETDATE()) AS tenure_years
FROM dbo.employees;
-- hire_date 2025-12-31, run on 2026-01-01 -> 1
-- Looks right, is wrong: counts whole years elapsed.
SELECT timestampdiff(YEAR, hire_date, current_date()) AS tenure_years
FROM employees;
-- same row -> 0
-- Preserves the source behavior: boundaries crossed.
SELECT year(current_date()) - year(hire_date) AS tenure_years
FROM employees;
-- same row -> 1With a rule, this is decided once, tested against the boundary cases, and applied to every DATEDIFF in every estate. If the decision turns out to be wrong, every affected object fails reconciliation in the same way, and one change to the rule repairs them all.
Why a model cannot be patched the same way
The natural reply is that a model can be corrected too: add an instruction to the prompt. “Preserve SQL Server DATEDIFF boundary semantics.” This helps, and it differs from a rule fix in three ways that matter.
- It is a request, not a guarantee. The model follows the instruction most of the time. A rule applies every time its pattern matches.
- Its side effects are unknown. A prompt change alters the conditions for every object, so objects that had nothing to do with dates can come out differently. A rule change touches only the objects that match its pattern, and the difference between two runs shows exactly which.
- It forces a full recheck. Because any output may have changed, everything converted with the new prompt has to be reconciled again. After a rule change, unaffected objects are identical to the last run and their proof still stands.
Prompts also accumulate. After fifty such instructions, the prompt is an unversioned, untested rule library written in prose, and it is consulted by a reader that sometimes forgets.
Why this decides how the migration ends
With rules, the work converges. Each fix removes a whole class of failure, so the list of open problems gets shorter fast and stays shorter. The second domain goes more smoothly than the first, because it inherits every fix.
With scattered errors, the work does not converge in the same way. The hundredth fix is as much effort as the first, and nothing guarantees that a rerun leaves fixed objects alone.
It is also why we can commit to a fixed price and a reconciliation threshold in the contract. A method that converges can be planned. One that does not can only be estimated.
Where a model still belongs
Some objects match no rule, because the right conversion depends on intent the code does not state. For those, a model’s ability to read context and propose something sensible is exactly what is needed, and there is no class of failure to fix because each one is unique anyway.
So the split is not ideological. Use the method that converges wherever patterns exist, which is most of an estate. Use a model where every case is a one-off, have an engineer approve each proposal, and reconcile the result like everything else.
Key terms
- Versioned rule
- a conversion rule with a recorded version, so the output of any run can be traced to the rules that produced it.
- Convergence
- a migration converges when each fix removes a class of failures, so the number of open problems falls steadily.
- Reconciliation
- running the original and converted objects on the same inputs and comparing the results, object by object.
FAQ
Frequently asked questions
Do rule-based converters make mistakes?
Yes. The difference is that a wrong rule fails the same way on every object that uses it, so the failures are found together and one correction repairs them all on the next run.
Why are AI conversion errors harder to fix at scale?
Because they are one-offs. Correcting one object does not correct the next, and a rerun can change objects that were already right.
Does a fix on one estate help the next?
With rules, yes: a corrected rule is versioned and applies to every later run. That is one reason rule-based conversion gets more reliable over time.
Sources
- Deterministic code conversion: how the rules work (novuz.com/deterministic)
- The 5% problem: where to draw the line between rules and models (novuz.com/blog/deterministic-vs-llm-code-conversion)
- Research note: the review burden of AI-converted code (novuz.com/blog/research/ai-conversion-review-burden)
About the author
Ted Ghose is co-founder and CTO of Novuz Inc., the deterministic data warehouse modernization company based in Danville, California. He built the Novuz conversion engine and was previously a Cisco principal engineer.
Next step
Convert 10 converts ten of your hardest objects twice, free and under NDA, so you can compare the two runs yourself.
Last reviewed: