Tuesday, 13 October 2026
The Signal, every MondayLinkedInXLog in
TNF India
AnalysisSeriesThe SignalEventsAccess
Join free
IndustriesEnergySpaceTransport, Logistics and TradeConstruction and InfrastructureManufacturing and EngineeringUtilities and Public ServicesFinancial ServicesHealthcare and Life Sciences
TNF IndiaIntelligence you can act on, and events worth being at.Connecting digital analysis with real-world conversations across India's growth industries.
LinkedInXRSS
Observer · FreeRead TNF India free as an Observer.Five articles a month, two industry reports a year, and 25% off delegate passes across TNF events worldwide.
No card needed. We handle your details as set out in our Privacy Policy.
TNF IndiaAnalysisSeriesExploreEventsAccessThe Signal
IndustriesEnergySpaceTransport, Logistics and TradeConstruction and InfrastructureManufacturing and EngineeringUtilities and Public ServicesFinancial ServicesHealthcare and Life Sciences
PillarsBridging the DeficitLogistical LeapProfit and PlanetThe Compute LayerThe Intelligence YieldThe Multinational MandateThe New Work Order
PersonasThe Growth DriverThe GuardianThe InnovatorThe OperatorThe Strategist
CompanyAbout UsCareersContact UsPartner with UsAdvertise
AccessObserver, freeSpecialistVisionaryLog in
© 2026 The Niche Foundry Asia Positive Media LLP. All rights reserved.
Terms of ServicePrivacy Policy
A conceptual illustration showing a large bowl overflowing with tangled dark blue spaghetti lines. A small human figure holds a magnifying glass over the bowl, and inside the lens, the tangled lines become a single, straight, vibrant orange path
The Strategist's Narrative12 May 20269 min read

The Spaghetti Trap For Smart Models: Don’t let GenAI Break The Legacy Ledger

GenAI can untangle decades of COBOL in a bank's core, but only with tests, telemetry and human checks in the pipeline. Why modernisation needs a different playbook.

Pillars:The Intelligence Yield
Personas:The InnovatorThe Operator
Industry:Financial Services
Sub Sectors:Banking and insurance

GenAI can untangle decades of COBOL in a bank's core, but only with tests, telemetry and human checks in the pipeline. Why modernisation needs a different playbook.

Varad DiwateHead of Content, Industry Verticals at TNF India
The InnovatorThe OperatorThe Intelligence Yield
In this articleUntangling the spaghetti trapHow to let GenAI help without breaking the ledgerPilot to production with GenAI
At a glance
Technical debt remains the silent killer of modernisation programs, especially where COBOL, batch jobs, and reconciliation engines still run the show.
In banking, GenAI modernisation needs a different playbook entirely.
GenAI can untangle decades of messy legacy code only if you bake tests, telemetry, and human checks into the pipeline.

Consider this scenario: Asha, a senior payments developer at a mid‑sized bank, runs a two‑week generative artificial intelligence (GenAI) pilot to understand a 25‑year‑old COBOL batch that posts overnight settlements. The goal is to produce a dependency map, generate unit/integration test scaffolds, and surface risky code paths for refactor. Within 48 hours, the tool ingests the repository and produces a call graph, module summaries, and about 200 test scaffolds for the busiest routines. This turns opaque code into readable documentation and cuts new‑hire onboarding from days to hours.

During sandbox replays, however, a persistent reconciliation variance appears. An undocumented, account‑specific rounding rule is implemented with subtle differences across three modules. It is a classic spaghetti pattern. GenAI produces syntactically correct outputs but misses implicit business intent. So, the team pauses automated refactor work until parity is proven with telemetry, targeted tests, and SME validation.

A minimalist vector illustration on a dark purple background showing a human figure pulling a glowing gold thread out from a massive ball of tangled grey-purple yarn. This visualizes the process of extracting clarity, order, and a clear path from chaotic, legacy "spaghetti" code
Untangling legacy system complexity requires finding the clear, logical thread within the chaos. 'Visualised using AI'

This is just one example of how GenAI can deliver tangible impact in banking technologies but can be severely limited by spaghetti code in legacy systems. According to Databricks, a data intelligence software company, 94% of Indian enterprises report using GenAI in at least one function. However, legacy cores and technical debt will materially slow and reduce realised value unless programs invest in tests, telemetry, and governance.

Treat GenAI as an assistant, not an autopilot.

A GenAI assistant can turn hours of reverse engineering into actionable maps and tests, but a single batch dependency in legacy core code can stop a pilot cold. Here, human experts and telemetry remain essential. Forrester found 21% of Indian software decision‑makers say technical debt is a top barrier to innovation, higher than the global average.

Untangling the spaghetti trap

A conceptual illustration showing a large bowl overflowing with tangled dark blue spaghetti lines. A small human figure holds a magnifying glass over it; inside the lens, the tangled lines become a single, straight orange path. This illustrates how GenAI acts as a diagnostic lens to instantly map and clarify complex legacy execution traces.
GenAI can act as a powerful lens, mapping execution traces to instantly reveal a straight path through complex legacy "spaghetti" code.

Spaghetti code describes systems whose control flow is tangled, responsibilities are mixed, and decades of ad‑hoc patches and global state make behaviour hard to follow. In banking, this becomes a “spaghetti bowl” of integrations and custom fixes. This is often seen in payment clearing, posting engines, ledgers, loan servicing, and fraud/AML logic where mainframes and COBOL still run mission‑critical workloads.

Because these applications are high‑volume and highly regulated, any change must preserve reconciliation parity and audit trails. This makes them hard to test, trace, or refactor safely. As a result, many modernisation efforts stall at discovery and documentation. In many cases, GenAI output may pass compiler or static checks but prove inadequate for meeting regulatory and reconciliation requirements.

How legacy blockers show up in practice

  • Semantic gaps: GenAI can produce syntactically correct translations, but business intent in rounding rules, exception handling, and reconciliation tolerances often lives in comments, runbooks, or tribal knowledge, not the code itself. This causes parity failures during reconciliation.

Disclaimer: Content provided by TNF India is for informational purposes only. While we aim to provide accurate data and strategic insights, information is subject to rapid market and technological shifts. This content should not replace independent due diligence or professional consultation. TNF India bears no responsibility for any actions taken, or financial losses incurred, in reliance on this material.

About the author
Varad Diwate
Varad DiwateHead of Content, Industry Verticals at TNF India
Varad Diwate shapes the editorial narratives behind India's infrastructure, energy, and technology sectors. He focuses on the sector-specific nuances and structural shifts that determine how markets actually move, and what they mean for the leaders operating inside them. Varad brings deep expertise in B2B content strategy and editorial leadership.See every article by Varad Diwate

Read next

Swipe
Rows of dark and teal squares on the left connect through dotted teal lines into a large teal block on the right, with a single amber line running out of the block and a thin amber line along the bottom.
The StrategistThe Innovator
Account Aggregator Framework at Five: What It Means for CFOs in Indian Financial ServicesVarad Diwate · 8 October 2026
Conceptual illustration of hidden data debt inside an Indian M&A acquisition target
The StrategistThe Intelligence Yield
Data Debt: Why India's M&A Boom Needs a Data Audit, Not Just a Legal OneVarad Diwate · 6 July 2026
An abstract, minimalist vector illustration showing a heavy, solid dark-purple monolith on the left being transformed from the inside out. A sleek, highly advanced digital matrix of glowing gold nodes and light blue data pipelines breaks out of the monolith and expands to the right. This visualizes the article's core concept: transforming the heavy, static burden of legal compliance into a fast, automated, and seamlessly integrated engineering system.
The GuardianThe Strategist
DPDP Compliance: The Clock Is Running. Is Your Data Stack Ready?Varad Diwate · 14 May 2026
A finished teal highway with white lane markings curving across a pale sand background, with a parallel lane of ochre paving tiles running beside it that stops partway, its remaining course traced only as a dashed outline.
The GuardianThe Intelligence Yield
NHAI Data Lake 3.0: Live Capabilities, Data Ownership and the Handover RealityNiharika Pahwa · 8 October 2026
Illustration of a robotic arm with an open gripper paused above a conveyor carrying a cube, a cylinder, a hexagonal nut, a pyramid and a sphere.
The OperatorThe Innovator
Smart Factories in India: Why Intelligence, Not Automation, Is the DifferentiatorLalita Subrahmanyam · 28 September 2026
Illustration of capital passing through an ESG risk filter onto solid fundamentals, the logic behind FDI decisions in India
The Strategist
ESG and FDI in India: A Risk Filter, Not a Reason to InvestPriya Dialani · 15 September 2026
An unfinished data hall with empty overhead cable containment, bare concrete floor and cable drums stacked against the far wall.
The OperatorThe Compute Layer
Data Centre Uptime in India: Why Commissioning Decides ItDivya Dawar · 2 September 2026
A rolled paper construction drawing weighted with a rusted steel offcut on a site table, with a line of concrete metro viaduct piers receding into haze behind it.
The InnovatorThe Intelligence Yield
BIM Adoption in India: The Savings Are Documented. The Scepticism Hasn't Moved.Priya Dialani · 31 August 2026
Diagonal split illustration: a gold sunburst representing solar power meets teal waves representing hydropower.
The StrategistThe Growth Driver
Cross-Border Electricity Trade in South Asia: From Bilateral Deals to a Regional MarketLalita Subrahmanyam · 6 August 2026

The Series

Live · Part 2 published

BRICS Market Compass

Financial Services · 15 parts

Decoding deals, developments, regulations, and government directives shaping cross-border business between India and BRICS partners.

Live · Part 1 published

The Trust Layer

Financial Services · 6 parts

Who India's financial system trusts, and on what evidence.

Live · Part 1 published

The As-Built

Construction and Infrastructure · 8 parts

What an owner should receive at handover, and what actually arrives.

  • Runtime dependencies: Batch jobs and overnight runs depend on specific sequencing, file formats, and external systems. Static outputs miss these runtime behaviors unless paired with telemetry and trace replay.
  • Audit and compliance friction: Banks must show provenance and explainability for changes. Black‑box GenAI outputs without clear lineage fail audit gates.
  • Industry guidance from IBM and recent technical work on GenAI‑driven mainframe modernisation note that while GenAI reduces boilerplate work, projects typically require staged, test‑first rewrites and extensive telemetry to satisfy audit and reconciliation requirements. Microsoft’s engineering team describes using AI agents to accelerate COBOL migration while relying on test harnesses and staged validation to avoid parity failures and audit friction.

    How to let GenAI help without breaking the ledger

    Start where value is easiest to capture

    GenAI delivers the fastest, most reliable wins in developer productivity, documentation, and routine automation. Tasks like code comprehension, generating readable module summaries, and scaffolding unit and integration tests are low‑risk and high‑leverage. Document processing and customer‑facing automation (chatbots, form extraction, templated responses) also yield measurable gains quickly. These are areas where GenAI augments human work without touching core transaction logic, so you can capture value with limited governance overhead and clear KPIs.

    Keep the core safe: Add checks where value is hardest to capture

    The hardest gains lie in automated translation or wholesale refactor of mission‑critical mainframe code and reconciliation‑sensitive posting engines. Languages and runtimes such as COBOL/JCL encode decades of implicit business rules, rounding quirks, and sequencing dependencies. Semantic fidelity matters more than syntactic correctness. Auditability, provenance, and runtime behavior must be preserved. This requires exhaustive testing, SME validation, and controlled rollouts. In practice, attempts to fully automate these migrations without heavy engineering controls produce parity failures and regulatory pushback.

    Rethink from the ground-up

    If you are looking at mid‑to‑high single‑digit to double‑digit percentage gains in operating cost and developer throughput, you must invest up front. Build test harnesses, capture execution traces, and bake governance into the pipeline before scaling GenAI. Organisations that skip these steps will see pilots stall. Those that make them turn pilots into sustained, auditable modernisation programs.

    Pilot to production with GenAI

    A sophisticated workflow diagram on a dark blue background. On the left, a human hand forming an Indian classical mudra directs shapes through preparation stages like 'Test Harness' and 'SME Sign Off'. On the right, the shapes form a perfect Kolam grid, passing through deployment stages like 'Canary' and 'Live Deploy'. This uses the cultural metaphor of a Mudra guiding a Kolam to symbolize disciplined human-in-the-loop governance and the highly structured deployment of GenAI models.
    Moving GenAI from pilot to production requires rigorous human-in-the-loop governance and a highly structured deployment matrix
    1. Discovery first, then tests: Use GenAI to map and draft tests; lock behaviour with tests before changing code.
    2. Combine static and dynamic analysis: Feed GenAI with execution traces and sample data to surface hidden side effects.
    3. Human‑in‑the‑loop governance: Require SME validation, maintain change provenance, and gate deployments with reconciliation checks.
    4. Pilot metrics: Measure time‑to‑understand, test coverage increase, and reconciliation parity to decide scale‑up.
    Discovery to Deployment: A Six-Stage Controlled Rollout Framework. GenAI - BFSI
    A visual breakdown of our six-stage controlled rollout framework designed to ensure data consistency and expert-validated scaling.

    A disciplined approach can convert the GenAI promise into measurable modernisation wins while keeping the lights on and the ledgers balanced.

    AdvertisementClean Stack Forum India, Transport and Logistics, 17 February 2027, Nagpur. Register interest.
    AdvertisementData Stack Global India, Construction and Infrastructure: the execution gap. 16 February 2027, Nagpur. Register interest.