COBOL and RPG modernization as an orchestration problem

Most COBOL and RPG modernization projects fail for the same reason: they are run as translation projects. A tool — increasingly a language model — reads a program, emits Java or C#, and a human is asked to believe the result. On a 40-year-old core banking system with millions of lines and no complete specification, belief is not a migration strategy.

daitai treats it differently. Modernization is not a translation problem. It is an orchestration problem with an evidence requirement.

Why translation alone fails

A COBOL or RPG estate is rarely just code. It is code plus decades of undocumented business rules, plus copybooks, plus JCL, plus batch windows, plus the operational habits of people who have since retired. Three properties make naive translation unsafe:

  1. The specification is the program. There is no separate document that says what the system must do. The observable behaviour is the requirement.
  2. The tolerances are financial or regulatory. A rounding difference in the fourth decimal is not a cosmetic diff. It is a reportable incident.
  3. The verification budget dominates. Emitting new code is cheap. Proving that the new code behaves identically is where the cost and the risk live.

A tool that guesses well 95% of the time produces a system nobody can sign off on, because nobody can tell you which 5%.

Modernization as orchestration

Reframed, the work is a pipeline of small, individually verifiable transformations, each of which leaves a record:

legacy source ─► parse ─► normalise ─► algebraic IR ─► transform ─► emit ─► compare
      │            │          │             │             │          │        │
      └────────────┴──────────┴─────────────┴─────────────┴──────────┴────────┘
                          every step emits a signed artefact

Three properties make that pipeline auditable rather than merely automated:

  • Determinism by default. The same input produces byte-identical output on every run. daitai's replay harness records model calls as cassettes, so even AI-assisted steps are inside the determinism guarantee rather than an exception to it. Two independent passes of 500 iterations produced a byte-identical event stream, with zero divergences.
  • Algebraic invariants that block. Each transformation must preserve stated laws — value semantics, no hidden mutable state, explicit error handling. In our own runs, 20 of 20 invariants pass as a blocking CI gate. A broken law fails the build; it does not file a warning.
  • Reference comparison, not eyeballing. Output is compared byte-for-byte against a reference implementation. On the Java parity suite, our compiler's stdout is byte-identical to JDK 17 across all four cases. "Close enough" has never been accepted as a passing result.

See Proof for the artefacts these numbers come from.

What an auditor actually receives

Not screenshots, and not a consultant's assurance. A CGF evidence bundle: a first-class, diffable data structure recording which transformation ran, on which input, under which rule set, with which digest, producing which output. That bundle is the deliverable that makes the migration defensible to a regulator — and it is the reason a bank can point this tooling at a core system at all.

Where RPG differs from COBOL

RPG estates on IBM i add two wrinkles worth naming explicitly:

  • Fixed-format and free-format code coexist, often within one program, so the parse stage must normalise across dialects before any transformation is legal.
  • The database is not incidental. DDS-defined physical and logical files, record-level access, and embedded SQL mean data-access semantics have to be modelled in the intermediate representation rather than deferred to the emitted code.

Both are handled the same way: normalise into the algebraic IR first, transform second, and compare against the running legacy behaviour last.

Why this matters in Japan

Japanese enterprises hold a large share of the world's remaining mission-critical COBOL, in banking, insurance, and public infrastructure, frequently on systems whose original engineers have retired. The constraint there is not appetite for modernization. It is that no responsible organisation will replace a settlement system on the strength of a tool's confidence.

Orchestration with evidence changes the question being asked. Instead of "do you trust the translation?" it becomes "here is the record of every transformation, reproducible on demand — verify it yourself." That is a question a risk committee can actually answer.

Next