Technical paper · RECAST
Change the rule in the documentation, not the code: a pre-registered test of COBOL migrations built through FlowX Platform MCP.
A pre-registered test of COBOL migrations built by a coding agent through FlowX Platform MCP from agent-written documentation alone, run side by side with the legacy programs of AWS CardDemo and compared on every output record.
DOI 10.5281/zenodo.24223975 · Version 1.1 10.5281/zenodo.24305235
Version 1.0 · 3 November 2026 · Apache-2.0 (text and code), (c) 2026 FlowX.AI; AWS CardDemo keeps its own Apache-2.0 licence
- legacy modernisation
- mainframe migration
- COBOL
- behavioural equivalence
- coding agents
- FlowX Platform MCP
- AWS CardDemo
- pre-registration

One wiki, one rebuild, every record compared
One AI read the COBOL of AWS CardDemo and wrote documentation. A second, a coding agent working through FlowX Platform MCP, rebuilt the programs from that documentation alone, three times. Old and new ran on the same five data sets and every output record was compared, against answers frozen and timestamped before any build was scored. The records drawn are illustrative; the design, dates and block numbers are the paper’s.
The COBOL of AWS CardDemo’s four nightly batch programs (interest calculation, transaction posting, statements and the daily report, 649 to 1,154 lines each). One AI reads it and writes a wiki with record layouts, a contract and business rules. A coding agent (claude-opus-5-5, headless) working through FlowX Platform MCP and file tools only, with no shell and no web, rebuilds the programs from the wiki alone in a fresh project each build, three builds per condition. The reference is the same COBOL under GnuCOBOL 3.2 with a pinned clock, unmodified apart from one patch. Old and new run on the same five data sets, base and c01 to c04, and each step receives the reference’s upstream outputs. Every output record is compared by business key against golden outputs and a scorer frozen before any build was scored; equivalence is equal records over the union of legacy and candidate keys, and a divergence counts as flagged if it was stated in advance, silent otherwise. The protocol tape shows the freeze on 2026-10-24 and each amendment by date through 2 November, marked as stamped before its builds, in the package, or a git commit only; the earliest Bitcoin attestations are block 973059 for the package and blocks 973463 to 974238 for the amendments from 27 October. A block is an upper bound on a stamp’s time; where it falls after the first build, the order rests on the authors’ git commits and stamp submissions. Scale and limits: four programs, 50 accounts, five data sets, three builds per condition, GnuCOBOL rather than a mainframe, equivalence with legacy rather than correctness, and FlowX.AI testing its own platform. The paper reports one builder, FlowX Platform MCP; a second registered builder is summarised in its Appendix A, and nothing is pooled across the two.
Core thesis
Given only documentation that another agent wrote from the COBOL, a coding agent working through FlowX Platform MCP rebuilt mainframe batch programs that matched the legacy outputs on all but a handful of records when the documentation was detailed;a business rule changed only in the documentation reached the rebuild in every build of the two lead rules and in 16 of 18 builds of six more;rebuilt screens and the whole application did not yet match the original.
Change one rule in the documentation
Each change request edits one business rule in the wiki, stated as the rule with no change marker, and makes the same edit in the COBOL to get the reference answer. Three builds from the edited wiki are then compared with the edited legacy program on every record. Wiki and code lines are illustrative; the rules, scores and outcomes are the paper’s, and every build is shown.
Each change request edits one rule once in the wiki, stated as the rule with no change marker, and once in the COBOL; the edited COBOL, compiled with GnuCOBOL with the same flags, is the new reference on five data sets, and three builds from the edited wiki, made through FlowX Platform MCP, are scored against it on every record. For scale, the unedited legacy program is scored against each new reference. The lead rule in transaction posting (a purchase is over limit only beyond the credit limit plus 10%), scored 100 on every set in 3 of 3 builds: every record matched the edited legacy program; the unedited legacy program scores 91.1 to 92.3% against it. We know of no public source that proposes it, and no search log was kept for it. Rounding interest to the cent, in interest calculation, is the contrast: CardDemo’s public tracker already proposes it, so memory can supply it. It scored 99.00, 99.00, 98.99, 99.00 and 99.03% per set in 3 of 3 builds; the one differing record is a legacy defect the builds do not copy; the unedited legacy program scores 43.4 to 44.7%. Both rule changes were followed: no build followed the legacy rule, and all 6 builds completed with no retry. Six more rule changes across all four programs (18 builds, all completed with no retry): the ten-year account interest rule, at most four purchases per card per run, posting the smallest amounts first, a statement total of charges only, interest left out of the daily report, and the credit-score band on the statement. 16 builds followed the change and no build kept the legacy rule; on the statement total, two builds score 0, differing on an unrelated address line they had flagged in advance. That the six further rule changes are followed is not refuted for any of the six. None of the six was found proposed in CardDemo’s public tracker or on the web in 44 searches, and part of the third statement-total build’s match and of the credit-score match is recall of the public source, since the wiki gives no rule for address line 3. Scale and limits: four programs, 50 accounts, five data sets, three builds per rule, GnuCOBOL rather than a mainframe, equivalence with legacy rather than correctness, and FlowX.AI testing its own platform.
Disguise the code, then take the rules away
On a renamed copy of the interest program, with five values perturbed so that recall gives the legacy value, four arms differ only in the specification. Builds from the detailed wiki came within 1 point of builds given the disguised COBOL: 0.996 points on the pre-registered figure, and 0.01 over the limit on one set of five. Code tokens are illustrative; the scores are the paper’s.
Ablation under disguise, FlowX Platform MCP, interest calculation only. Every identifier in INTCALC is renamed and five values are perturbed, so that recall of the public CardDemo source gives the legacy values; the disguised COBOL under GnuCOBOL is the reference, and every record is compared against it. Four arms differ only in the specification, three builds each: detailed (the Sonnet-wiki bundle), summary (stops before the Business Rules section), no wiki (record layouts and contract only) and code (the disguised COBOL). 12 of 12 builds completed with no retry. Median of build means over five sets, the pre-registered figure: detailed 99.004, summary 99.004, no wiki 2.396, code 100.000. Build scores on base: detailed 99.00, 99.00, 99.00; summary 99.00, 99.00, 2.00, with strict scores of 49.00, 49.00 and 1.00; no wiki 1.00, 2.00, 2.00; code 100, 100, 100. Detailed within 1 point of code is supported at the margin: the gap is 0.996 points on the pre-registered figure, and per set it is 1.00, 1.00, 1.01, 1.00 and 0.97, so c02 alone is 0.01 over the limit; both readings are reported. Detailed more than 1 point above summary is not supported (0.00 points): the summary builds filled the gap from recall of CardDemo. The instrument check, no wiki more than 5 points below detailed, passes at 96.6 points; the no-wiki builds identified CardDemo and used recalled values. Scale and limits: INTCALC only, 50 accounts, five data sets, three builds per arm, GnuCOBOL rather than a mainframe, equivalence with legacy rather than correctness, and FlowX.AI testing its own platform.
Screens and the whole application, as registered
FlowX Platform MCP built four online screens three times, then the whole base application from one wiki, and each was scored against the original. On the screens, the payment’s file state matched and screen content, account-view data, browser behaviour and end to end did not; on the whole application, the money files were written as legacy wrote them and the other six did not hold. The screens differ from the original.
A ledger of the four-screens test and the whole base application, FlowX Platform MCP, as registered; a check does not hold if two or more of the three builds miss it. Four screens: sign-on, main menu, account view and bill payment, 17 online cases (16 scored) at workflow level, a browser subset of four cases and one end-to-end case, scored on a stand-in for the online system. The payment file, with zero silent units in all three builds, holds. Screen content does not hold, with 23, 171 and 113 silent units; account-view data, with 16, 12 and 12 of 29 fields equal; browser behaviour, with 24 of 25 steps in every build; end to end, with the payment differing in every build. The payment-file check covers the two registered payment cases; a third payment case, on a stand-in rule, differs in two builds. On browser behaviour every build stops at the same step on the same four date fields; the cause was not tested. End to end does not hold by construction for this builder (measured): its posting build stamps the wall clock, so the July 2022 report window drops every row. Build 2 was cut off by the account’s usage limit and is scored as it stands, with no flags, so every difference in it counts as silent. There is no reference CICS: the scores rest on a stand-in written from the authors’ reading of the vendor’s text, and the online cases were written after an unregistered pilot. The whole base application: 17 online programs, the date utility and 11 batch programs, built three times from one wiki of the whole application (234 pages), with 54 screen cases, 23 batch cases, 4 end-to-end pairs and 9 browser cases. The money files were written as legacy wrote them in 3 of 3 builds (0 silent units; build 3 has one unit resting on a field that decides nothing). Does not hold in 3 of 3 builds: every screen built and reachable (11, 14 and 13 of 17 as legacy); screens differing only where flagged (0, 1 and 1 of 17 clean); list paging (336 of 348 equal in each build); the browser showing what the workflow returns (5, 8 and 1 of 9 cases); a session carrying through the batch chain (absent in build 1, 2 of 4 carried in builds 2 and 3); the export and import round trip (differs in each build). The whole-application contract adds a store, a run date and date text on screens, so it is not a comparison with the four-screens test. The target claim, batch to working screens both checked against the original, is not stated, and the screens differ from the original. Scale and limits: three builds per test, a stand-in for the online system with no reference CICS, GnuCOBOL rather than a mainframe, equivalence with legacy rather than correctness, and FlowX.AI testing its own platform.
Version 1.1 · The development run and the confirmatory test
The whole base application, rebuilt and checked against legacy
After version 1.0, a coding agent working through FlowX Platform MCP rebuilt the whole base application of AWS CardDemo (17 online programs, the date utility and 11 batch programs) from the wiki together with a screen specification derived from the COBOL. This is the development run: one build on the final inputs, scored against the legacy programs run under GnuCOBOL.
| Online screens | 54 of 54 cases | equal to legacy on 7,771 of 7,774 units; the 3 others are instrument limits, described below |
|---|---|---|
| Online programs reached | 17 of 17 | |
| Browser | 60 of 60 steps | 9 of 9 cases |
| Batch | 23 of 23 cases | match legacy; the export–import round trip holds |
| End to end | 4 of 4 pairs | carried through |
| Unit equivalence | 99.99% | every unit counted; 100% without the 3 instrument-limit units |
| Agent time | about 2 h 11 min | one build |
The 3 remaining units are limits of the test instrument, not build errors: 2 come from a program the test tools cannot start the way legacy does, and 1 is a legacy runtime code inside an error message, which no input produces.
The development run is in-sample. Its inputs were developed against these same test cases, so it shows that the inputs work, not that equivalence generalises to fresh builds. The version 1.0 whole-application results above, built from the wiki alone, stand as published; the development run is a separate, newer result with richer inputs.
The confirmatory test
Confirmatory test, pre-registered: two of three fresh builds matched the legacy application on every scored unit; the third missed two units on one screen, so full equivalence is not claimed.
Three fresh builds on frozen inputs registered in advance, scored with the same instruments as the development run. A build passes only if every condition holds: all 54 online cases, all 17 programs reached, 60 of 60 browser steps and 9 of 9 cases, batch and the export–import round trip, and 4 of 4 end-to-end pairs.
| Build 1 | Build 2 | Build 3 | |
|---|---|---|---|
| Online, 54 cases | does not hold (2 units) | holds | holds |
| 17 programs reached | holds | holds | holds |
| Browser, 60 steps and 9 cases | holds | holds | holds |
| Batch and round trip | holds | holds | holds |
| End to end, 4 pairs | holds | holds | holds |
| Build passes | no | yes | yes |
| Units equal to legacy, excused units left out | 38,296 / 38,298 | 38,298 / 38,298 | 38,298 / 38,298 |
| Cost and agent time | $53.83 · 1 h 37 min | $48.88 · 1 h 47 min | $61.21 · 2 h 06 min |
Excused units rest on catalogued defects of the legacy source or on limits of the test instrument. The two units build 1 missed are on the card list: pressing PF8 again on the last page, legacy shows a different message from the first press, and build 1 kept the first message.
Screen by screen: units not equal to legacy and not excused, per program
| Program | Screen | Build 1 | Build 2 | Build 3 |
|---|---|---|---|---|
| COSGN00C | sign-on | 0 | 0 | 0 |
| COMEN01C | main menu | 0 | 0 | 0 |
| COADM01C | admin menu | 0 | 0 | 0 |
| COACTVWC | account view | 0 | 0 | 0 |
| COACTUPC | account update | 0 | 0 | 0 |
| COCRDLIC | card list | 2 | 0 | 0 |
| COCRDSLC | card view | 0 | 0 | 0 |
| COCRDUPC | card update | 0 | 0 | 0 |
| COTRN00C | transaction list | 0 | 0 | 0 |
| COTRN01C | transaction view | 0 | 0 | 0 |
| COTRN02C | transaction add | 0 | 0 | 0 |
| CORPT00C | report request | 0 | 0 | 0 |
| COBIL00C | bill payment | 0 | 0 | 0 |
| COUSR00C | user list | 0 | 0 | 0 |
| COUSR01C | user add | 0 | 0 | 0 |
| COUSR02C | user update | 0 | 0 | 0 |
| COUSR03C | user delete | 0 | 0 | 0 |
Abstract
Scope. This paper reports one builder, FlowX Platform MCP. The pre-registered protocol also registered a second builder, the FlowX Developer Agentic Harness, an earlier in-product builder; its arms are summarised in Appendix A so that every registered arm is accounted for, and its per-build results are in the repository. Nothing is pooled across the two.
What we did. We took AWS CardDemo, open source (Apache-2.0), a sample credit-card mainframe application. One AI read the COBOL and wrote documentation (a wiki). A second AI, a coding agent working through FlowX Platform MCP and given only that documentation, rebuilt the programs on the FlowX.AI platform. We ran old and new on the same data and compared every output record: first the four nightly batch programs, then four online screens, then the whole base application. The protocol was timestamped before any build was scored. The study was then amended. Each amendment is dated, and §1 says which were timestamped before their builds and which rest on git commits.
Change a business rule by editing the documentation. We changed one rule in the wiki, and made the same change in the COBOL to get the reference answer. The lead rule: a purchase is over limit only beyond the credit limit plus 10%. We know of no public source that proposes it; we kept no search log for this rule.
With that rule changed, the rebuild matched the edited legacy program on every record in 3 of 3 builds. A second rule (round interest to the cent) scored 98.99–99.03% in 3 of 3 builds; the one record that differs is a legacy defect the builds do not copy.
Six more rules, across all four programs: 16 of 18 builds followed the change and none kept the old rule. The other two differ on an unrelated address line they had flagged in advance.
How builds ended. Every batch build completed with no retry. One screens build was cut off by the account's usage limit and is scored as it stands.
Disguised, the documentation came within one record of the source code. On a renamed copy of the interest program, builds from the detailed wiki scored within 1 point of builds given the disguised COBOL (0.996 points; on one set of five, 0.01 over the limit).
Screens. FlowX Platform MCP built four online screens three times, scored against the original screens on a stand-in for the mainframe's online system. As registered, the payment's file state matched, and screen content, account-view data, browser behaviour and end to end did not. The screens differ from the original.
The whole base application. FlowX Platform MCP built all 17 screens and 11 batch programs three times from one wiki of the whole application. The money files were written as legacy wrote them in 3 of 3 builds. The other six registered checks (every screen reachable, screens, list paging, browser, end to end, export and import) did not hold in 3 of 3 builds, so the target claim, batch to working screens both checked against the original, was not made for version 1.0.
What we do not claim. The scale is small: four programs of 649–1,154 lines, 50 accounts, five test data sets, three builds per condition. CardDemo is a sample application, run on GnuCOBOL, not on a mainframe. We measure whether a rebuild behaves like the legacy program, not whether either is correct. This is FlowX.AI testing its own platform.
Part of the FlowX.AI paper series.
Each paper names its method and the evidence behind it, including where the method did not pay off.
