Migrate Off Delphi Without Losing a Single Business Rule
Delphi migrations rarely fail on syntax. They fail on a rule nobody wrote down. How to recover every rule, get sign-off and verify the new code.
September 24, 2026 · 7 min read
Somewhere in your policy administration system, a Delphi procedure decides how much a 26-year-old driver with four claim-free years pays for car insurance. It has been right for decades. Nobody still around remembers every condition in it, and you are about to rewrite it as a web application.
This is a field guide for that situation. It assumes the technical side of the migration (syntax, VCL forms, database access, deployment) is in capable hands, because it usually is. The hard part is the rules.
Before the first line is translated
Most Delphi conversations start in the same place. The system works. It prices policies, renews them, and the numbers come out right. The people who built it have moved on, and the logic is spread across forms, units and event handlers. Every change takes weeks, and nobody wants to be the person who breaks premium calculation in the middle of renewal season.
The pressure to move keeps growing. In an October 2025 study of 1,000 executives at Global 2000 companies, Cognizant found that the share of IT budget spent on modernizing legacy systems is expected to rise from 26% to 43% by 2030, and that 85% of those executives worry about their systems’ ability to integrate AI.
Migrations rarely fail on the translation itself. They fail when a rule that lived in one Delphi event handler, added years ago for one product line and never documented, quietly disappears. The new system compiles. The test suite passes, because nobody wrote a test for a rule nobody knew existed. Six months later a customer calls about a renewal quote that jumped for no visible reason.
Line-by-line translation does not protect you from this. A converter or an LLM will carry everything across, the rules that matter and the workarounds nobody needs, with no way to tell them apart. Ask an LLM to document the program instead and you get dozens of readable pages that nobody can check against the code.
Developers are well aware of it. In Sonar’s State of Code Developer Survey (January 2026, more than 1,100 developers), 96% said they don’t fully trust AI-generated code, and only 48% always check it before committing. On the system that prices your policies, that gap is hard to live with.
1. Inventory rules, not units
Start by changing the unit of work. You are not migrating 400 units and forms. You are migrating a set of business rules that happen to be written in Delphi.
For premium calculation, the list might include:
- the base rate by vehicle class and region;
- age bands, with a surcharge for young drivers and another for older ones;
- the no-claims bonus, which grows with each claim-free year up to a cap;
- what happens to that bonus after one claim, and after two;
- rounding, and the minimum premium below which no quote is ever issued.
Each of these is a rule a pricing actuary can read and argue with. That is the whole point. A unit name means nothing to the business. “The no-claims bonus is capped at 50%” means a great deal.
Expect the list to be longer than anyone guesses. Long-lived pricing code tends to collect exceptions for particular regions, distribution channels or policy vintages, and each exception is a rule in its own right, with its own conditions and its own history.
Lyriks produces this list as a reverse specification, covering features, user journeys, business rules, objects and attributes, invariants and testable requirements. The same spec also covers the technical side: modules, units, forms, dependencies, data model, flows, integrations. Each rule stays linked to the exact lines that implement it, in a graph database rather than a RAG pipeline, so you can follow it from the old system to the new one.
2. Put every source on the same table
The code is rarely the only place a rule lives. The pricing guide on Confluence describes the no-claims bonus. A Jira ticket from a few years back changed it. The code has its own opinion.
Take an illustrative case. Confluence says the bonus is capped at 50%. A Jira ticket raised the cap to 60% for a premium product. The Delphi code caps it at 55%, except for policies issued before a certain date, where an old patch left it at 50%. Three sources, four behaviors.
A translator would faithfully carry the 55% and the date exception into the new stack. Pulling code, Jira and Confluence into one knowledge base turns the disagreement into a named inconsistency, with each source attached.
So is the code right? Not necessarily. Code is where the implementation lives. The reference is what the business meant to charge, and only the business can say what that was.
3. Get sign-off before anyone writes new code
This is the step teams skip most often, and the one that pays back the most. Put the extracted rules in front of the people who own pricing. They confirm each one, correct it, or drop it.
Some rules turn out to be dead, like a surcharge for a product line you stopped selling years ago that is still computed on every quote and then multiplied by zero. Others turn out to be wrong, and the migration is the cheapest moment you will ever get to fix them. Either way the decision belongs to the business, which is where it should sit.
Put together, the round trip has four legs. Legacy code becomes a spec. The business revalidates that spec. New code is produced from it, by your developers or by a coding agent connected over MCP. Then the new code is verified against the same spec it came from.
4. Verify rule by rule, not run by run
Parallel runs help. Compare old and new premiums on a sample of policies and you will catch a lot. You will not catch the rule that only applies to drivers over 75 with a claim in the past year if your sample didn’t happen to include one. Keep the parallel runs as a final reassurance. Just don’t let them be your only evidence.
So verify against the rules themselves. Lyriks checks the new code rule by rule with a deterministic engine based on graph rewriting: same code, same spec, same verdict. Every gap goes back to whoever is writing the code, a person or an agent, until every rule holds. Each rule then lands in one of four buckets.
- Compliant. The rule is implemented as specified.
- Addition. Behavior appeared that nobody asked for.
- Omission. The rule was planned and never implemented.
- Regression. Something that worked before is now broken.
An age-band surcharge that went missing shows up as an omission in that report, long before it shows up as a confused customer at renewal.
5. Choose a pilot that teaches you something
Nobody approves a Delphi migration from a slide deck. Pick one or two modules that are rich enough to hold real rules and small enough to finish quickly. Premium calculation for a single product line is a good candidate. Report printing is not.
A good pilot answers a handful of questions before any larger commitment.
- How much of the module’s behavior was ever written down?
- How many inconsistencies appear once code, tickets and wiki pages sit side by side?
- Can the pricing team read the extracted rules and sign them off without a developer translating?
- How long does it take to get from an extracted rule to verified new code?
Those answers come from your own code, which makes them worth more than any estimate a vendor can give you.
Where all of this runs
Insurance systems hold personal data and decades of pricing know-how, so sovereignty comes up in the first meeting. The platform is open source under the AGPL license, installs with a single command, and runs on premises or air-gapped with no outbound connections. You bring your own LLM and your own tokens, including a local or sovereign model. The Refactor and migrate page walks through the whole round trip.
If you would rather see it on a case close to yours, book a demo and bring along the unit everyone is afraid to open.