Skip to content

Epic: COBOL→Java conversion -- configurable target, driven by the verified mainframe skeleton #3625

Closed

Description

@squid-protocol

The COBOL→Java path today generates a fixed Spring Boot scaffold, with Spring Boot 3.2.4, Java 17, Maven, PostgreSQL, Lombok, JPA and Batch all hardcoded, from the refactoring stage's schemas alone. The engine now extracts and verifies the whole CICS skeleton (#3445, #3489, #3575), but almost none of it reaches the Java side. This epic does two things:

  • makes the target configurable, via a YAML config;
  • makes the generator consume the verified skeleton, layer by layer.

It ends with proof that the generated code behaves like the COBOL.

Order:

  1. Java conversion: YAML target config (Java / Spring Boot versions, build tool, DTO style, database, features) #3613 YAML target config: the foundation every generator reads.
  2. CI: compile the generated Spring Boot output (no Java toolchain in CI today) #3121 Compile the generated output in CI, across a config matrix.
  3. Java conversion: hand the verified mainframe skeleton to the generator #3614 Hand the verified skeleton (with verification tiers) to the generator: the foundation for 4-11.
  4. Java conversion: CICS transactions + COMMAREA / channel contracts -> REST endpoints and request / response DTOs #3615 Transactions + COMMAREA / channels → REST endpoints and DTOs
  5. Java conversion: LINK / XCTL / CALL targets (incl. data-driven and remote SYSID) -> service-to-service calls #3616 LINK / XCTL / CALL (data-driven, remote) → service calls
  6. Java conversion: CICS FILE (VSAM) operations + FILE-CONTROL / IDCAMS -> Spring Data repositories #3617 CICS FILE (VSAM) → Spring Data repositories
  7. Java conversion: embedded DB2 (table access + DCLGEN) -> repositories, dialect per config #3618 Embedded DB2 → repositories
  8. Java conversion: BMS screens + symbolic maps -> view models and (per config) web views #3619 BMS screens + symbolic maps → view models / web views
  9. Java conversion: TS / TD queues, containers and MQ -> messaging adapters #3620 Queues + MQ → messaging adapters
  10. Java conversion: units of work and handlers -> @Transactional boundaries and exception mapping #3621 Units of work + handlers → @transactional + exceptions
  11. Java conversion: JCL job flow -> Spring Batch jobs #3622 JCL job flow → Spring Batch
  12. Java conversion: PL/I programs through the same pipeline #3623 PL/I through the same pipeline
  13. Java conversion: behavioural equivalence harness + CardDemo vertical slice #3624 Behavioural equivalence harness + CardDemo vertical slice

Principles:

  • Deterministic scaffolding; AI only for bounded business-logic tickets.
  • Every generated artifact traces to the fact it came from. Where a fact is unresolved or draft-tier, the generated code says so (a TODO naming the gap), and never guesses.
  • Every config combination compiles.

🤖 Generated with Claude Code

Activity

  1. added
    epic
    legacy-modernization
    on Sep 25, 2026
  2. squid-protocol commented on Sep 26, 2026

    @squid-protocol
    OwnerAuthor

    All 13 items are done: #3613, #3121, #3614-#3624. Closing.

    What the epic delivered. The generator no longer makes a fixed scaffold from COBOL schemas alone. It now turns the engine's verified model of a whole mainframe estate into a configurable Spring application:

    • CICS transactions and COMMAREAs → REST endpoints and DTOs;
    • LINK / XCTL / CALL → service calls;
    • VSAM → repositories, with record codecs;
    • DB2 → repositories;
    • BMS → views;
    • TS / TD queues and MQ → messaging;
    • units of work → @Transactional;
    • JCL → Spring Batch, including programs run through IKJEFT01 / DFSRRC00;
    • PL/I through the same path as COBOL.

    How it's held accountable:

    • every generated artifact traces to the fact it came from (traceability.json), and what is left to a person is sorted in migration_worklist;
    • the facts are checked against hand-verified, blind-censused answer keys;
    • all 6 pinned corpora compile in 17 target configurations in CI.

    Final validation (#3624, PR #3748): CardDemo's CBACT04C ran as COBOL under GnuCOBOL and as the Java on the same inputs:

    • 100/100 records equal, decimals exact, with the program's logic ported onto the generated skeleton; the generator alone scores 4/100;
    • the harness found a defect in the original: the last account's interest is never posted.

    Published: squid-protocol/cobol_to_java_examples#2 rebuilds the examples on the verified corpora, with provenance, licence notices, scan comparisons and the equivalence report.

    Open follow-ups:

    • the ticket stage feeding the new skeleton generators;
    • a bring-your-own-LLM porting loop graded by the harness;
    • CICS online programs in the harness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epiclegacy-modernization

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions