Most rewrites of a legacy integration platform start with a document: a requirements pack, a design from the original project, a set of rulings someone senior made years ago. The new team builds to that document. Testing passes against that document. Then the new platform goes live, and the counterparties on the other end of the wire notice that something is different.

The document was never the specification. The specification is the code that runs in production today. It has been the specification since the day it went live, and every hotfix, every configuration change and every quietly disabled branch has amended it since. Nobody updated the document. Nobody had to. The system worked.

For any institution replacing an enterprise service bus, a message broker estate or a generation of point-to-point adapters, this is the single most underestimated risk in the programme. The remedy is not clever. It is a method, and a handful of decisions that only leadership can make. It is just rarely done.

Why rewrites fail

Rewrites rarely fail because the new technology is wrong. They fail because the new system faithfully implements what everyone believes the old system does. The gap between belief and behaviour is invisible until cut-over, and by then it is a production incident with an external party watching.

The gap comes from three places. Source control does not always match what is deployed. Design documents describe intent, not the compromises made under deadline. And the people who made those compromises have often moved on. The result is an estate whose real rules exist in exactly one place: the running code.

If the old system and the new one disagree on the day of cut-over, the old one is not wrong. It is the baseline your counterparties have been reconciling against for years.

Archaeology before architecture

The first step is not design. It is an inventory of the estate: every repository, integration flow, API definition, rules project, script and configuration set, classified by domain, technology and whether it still runs. In a mature institution this is typically hundreds of artefacts across more than one generation of platform. Some are dead. Some are alive but unowned. A few are the only surviving source for behaviour that matters.

The inventory is unglamorous and it pays for itself many times over. It tells the team where to dig. It reveals which flows touch the service being replaced, including the ones nobody listed. And it surfaces the uncomfortable cases early: a rules engine whose deployed ruleset is not the one in source control, or a component whose source is simply missing.

Then compare against what is actually deployed. Not the repository: the deployed artefacts, the exported production configuration, the rules as the production engine holds them. Where those differ from source control, the deployed version wins. That single discipline changes more conclusions than any design workshop.

Numbered rules, not prose

From the live code, extract every behaviour that a counterparty, a customer or an auditor could observe, and write each one down as a numbered business rule. One rule, one behaviour. Each rule points to the exact place in the legacy code where it lives, is grouped by service family, and is tagged with whether it was verified against the deployed artefact or only against source.

Numbering matters more than it sounds. A numbered rule can be tested, cited in a decision, tracked and closed. Prose cannot. Once a catalogue exists, the conversation shifts from “I think the old system does…” to “this rule says it does this, and here is the line.” Arguments get shorter, and they end with evidence rather than seniority.

The catalogue then becomes the backbone of a gap matrix. For each rule: does the new platform match, partially match, differ, or not yet implement it? Or is the rule a defect that should not be carried forward? Parity becomes a number a steering committee can read every week, and the remaining gaps become a list with owners.

Rule on every difference

The hardest part is not extraction. It is confronting earlier decisions. Over the years, business and architecture functions make rulings about how a service should behave. Some are never implemented. Some are implemented and later reversed in production. A few describe behaviour that never existed.

So every earlier ruling is set next to what the live code does, with rule numbers as evidence. For each difference, record the earlier ruling, the live behaviour, what the new platform currently does, and a recommendation. Then the accountable owner rules on each item, in writing.

The default policy should be simple: follow live, unless the live behaviour is a defect or an earlier ruling encodes a legal or regulatory obligation the institution must meet anyway. Live behaviour is what counterparties receive today. Changing it during a platform migration means changing two things at once, and when results differ after cut-over, nobody can tell whether the migration or the change caused it.

That policy does not mean copying every flaw. Where live behaviour is clearly broken, fix it and record the fix as a deliberate, signed deviation. Where a legal obligation is missing, build the capability and ship it switched off by configuration, to be enabled after legal sign-off and after cut-over has settled. Parity first, improvement second, each with its own approval.

What drift looks like

Every legacy estate drifts in its own way, but the categories repeat. These are the patterns a rule-recovery exercise tends to surface. Expect to find each of them somewhere.

Deployed rules that differ from source control. A rules engine or configuration store is updated directly in production, or a build is promoted from a branch that was never merged. The repository describes a system that no longer runs.

Fail-open on a dependency error. When a downstream check times out, the flow proceeds as if the check had passed. Sometimes this is a deliberate business choice; sometimes it is an accident in an exception handler. The rewrite must know which, because a “cleaner” fail-closed design changes what counterparties see during every outage.

Retries that re-mint identifiers. A retry loop generates a new message or correlation identifier on each attempt, and anything downstream that correlates on it silently loses track. The new platform should usually fix this, and the fix must be recorded as a deviation, because the counterparty will see different identifiers.

Logic disabled in production. A filter, validation or branch is switched off in every live build while the documentation still describes it as active. The data counterparties receive today reflects its absence.

Designed but never running. A path exists in the code and in the design, yet cannot execute because of a defect nobody noticed, since the path is rarely triggered. Reproducing it faithfully means reproducing nothing.

None of these surface in a requirements workshop. All of them surface in production after cut-over if nobody looks first.

Parity is the cut-over criterion

Go-live readiness should be measured against the rule catalogue, not against test cases written from the old document. The most reliable evidence is side-by-side: replay real, sanitised traffic through both platforms and compare outputs rule by rule. Every difference is either a gap to close or a deviation that someone has already signed. If the gap matrix is not green, or every remaining gap is not covered by a written ruling, the platform is not ready, however well it performs.

What leaders must decide

Rule recovery is engineering work. The decisions it forces are not. Four belong above the delivery team.

The default policy. “Follow live unless defect or legal obligation” is a leadership statement. Without it, every engineer applies their own taste, and the new platform becomes a blend of the old system and a dozen private opinions about how it should have been.

Who signs a deviation. Every intentional difference from live behaviour changes what an external party receives. That needs an owner, a reason and, where relevant, the counterparty’s agreement. A deviation without a signature is just a regression with a good story.

Parity as the gate. The steering committee should approve cut-over on the parity number and the list of signed deviations, not on a delivery date. Dates slip quietly; a red rule does not.

Funding the archaeology. The inventory and rule extraction take weeks of senior time before a single line of the new platform is written. They look like delay. They are the cheapest insurance in the programme. The alternative is to discover the same rules one production incident at a time.

A rewrite is a promise that the institution will keep doing what it does today, on a better foundation. That promise cannot be kept without first finding out, precisely, what it does today. The live code is the only honest witness. Interview it first.

Related reading in the Lab — a general design pattern for one of the most rule-dense integration problems, tracking holds and reservations against a balance, stock or quota, with a typed obligation ledger, a reconciled projection into the system of record, hash-chained event streams and certified connectors: The Obligation Ledger Pattern: Tracking Holds and Reservations Without Stacking Them in the System of Record.