COBOL Phoenix
Mainframe resurrection laboratory

From Mainframe to Modern.
Preserve the logic. Rebuild the future.

COBOL Phoenix turns COBOL business logic into Python APIs — and proves it. Every rule is backed by source evidence, every generated statement traces back to its COBOL line, and behaviour is verified against the original program running in GnuCOBOL.

RATEENG.cbl → app/programs/rateeng.py
      * PM-404: Base premium.
           COMPUTE RR-BASE-PREMIUM ROUNDED =
                   WS-BASE-RATE * RR-AGE-FACTOR
                 * WS-VEH-FACTOR * WS-COV-FACTOR
                 * WS-DED-FACTOR + WS-VALUE-LOAD
              ON SIZE ERROR
                 SET RR-INVALID TO TRUE
# cobol/RATEENG.cbl:198-206
_size_error = False
_v = (((self.ws_base_rate.value * ...)
     # Decimal, 64-digit context
if not self.rr_base_premium.store(
        _v, rounded=True, size_error=True):
    _size_error = True
# sample run: 127/127 cases identical to GnuCOBOL 3.2
ACT I

The dead system

Decades of insurance and banking rules live in COBOL nobody wants to touch. The logic is valuable; the documentation is gone.

ACT II

The discovery

A deterministic parser builds an intermediate representation, a dependency graph and business rules — every one cited to a real file and line range.

ACT III

The resurrection

Template-based generation turns a COBOL capability into a typed Python module and FastAPI endpoint, with Decimal arithmetic and line-level traceability.

ACT IV

The proof

The original program runs in a sandboxed GnuCOBOL container next to the generated Python. Identical inputs, field-by-field comparison, mutation analysis.

Understand first, generate second, prove always

COBOL source
Lexer + COPY
Parser
Normalized IR
Rules + graph
Python generator
FastAPI service
Differential tests

No AI guesswork in the core

Parsing, rule extraction and code generation are deterministic. Optional LLM explanations are labelled advisory and never alter evidence.

Differential verification

Boundary values derived from the IR, edge cases and seeded random records run through both runtimes. Mutation analysis measures how strong the suite is.

Sandboxed by design

Uploaded code is data. COBOL only runs in a network-less, resource-limited GnuCOBOL container; if it can’t run, results say NOT_VERIFIABLE.