Valtech · 2025 · Architect
CodeIQ
Agentic .NET Legacy Modernization Platform
Audit-to-buildable-migration-plan time went from ~2 months of manual, AI-assisted work to about 10 days.
~70%
faster delivery cycle
200K
LOC migrated end-to-end
500K+
LOC analysed & documented
~90%
less manual validation effort
Role
Architect
Scale
~200,000 LOC legacy WinForms codebase, migrated end-to-end
The problem
Legacy modernization tools usually fail at the same point: a 200K-line WinForms codebase doesn't fit in anyone's head — human or model. Point an LLM at the raw source and ask it to plan a migration, and you get context blowout, inconsistent answers between screens, and no way to resume after a context reset. Point a human at it with Copilot-style line-by-line assistance, and it's still weeks of manual audit before a single migration decision gets made.
The failure isn't reasoning ability. It's that the problem was framed as “read the code and figure it out” instead of “structure the facts first, then reason over the structure.”
The approach: structure before reasoning
CodeIQ splits the work into a deterministic extraction stage and an agentic reasoning stage, and never lets the second one read raw source directly.
Stage 1 — Static analysis, no AI
A real compiler front-end (Roslyn) parses every file into an AST and fans it out into a relational database: classes, methods, fields, imports, inheritance, and a dependency graph built from seven independent signal types. This is deterministic and crash-safe — if it's interrupted, the structural skeleton already on disk is still valid.
Stage 2 — Targeted LLM enrichment
Only now does an LLM touch source code, and only in small, dependency-related batches, writing structured output (business rules, complexity, risk signals, architectural layer) back into the same database as JSON columns. The model never has to hold the whole codebase in context — it enriches one bounded chunk at a time.
Every downstream agent queries the database
None of them read source files directly. That single constraint is what makes the rest of the pipeline scale — a 30-function query API costs a few thousand tokens per call; the equivalent raw source would cost millions.
The architecture: sharded reports, not monolithic ones
A single migration report for a 200K-line codebase would be too large for any agent to load and still reason well. So the output itself is sharded: a spine file holds everything true project-wide (stack decisions, layer ownership rules, shared infrastructure, dependency mappings) and is small enough to load once and keep in memory for the whole session; one per-screen file exists per migration target, read only on demand and discarded after use.
This pattern repeats at every layer of the pipeline.
Architect
Produces a legacy audit, then — after a human-in-the-loop strategic decision round (target stack, auth model, data-access pattern, UI library) — a target-architecture mapping, delegating the per-screen mapping work to a serial subagent that never sees more than one screen's data at a time.
Tech Lead
Reads only the audit/mapping slice relevant to the layer it's about to dispatch — Domain and Application need business rules, Infrastructure needs data-access signals, Client needs the full event-wiring and layout detail, Api needs contracts. It never loads a slice it doesn't need.
Dev agents
Receive a fully self-contained brief — scope, contracts, audit slice, conventions — and know nothing about the rest of the project. This makes the same agent definition reusable across every architectural layer.
Adversarial reviewer
Runs in a fresh context with no memory of how the code was written, and checks test coverage, tautological tests, and contract conformance before anything is marked done.
Everything is disk-resumable by design
Mode-detection — fresh run, resume, or extend — means a context reset or a new screen entering scope never means starting over.
Quality gates, not self-report
No agent's self-reported “done” is trusted. Every layer goes through: build passes, tests pass, mutation testing above a layer-specific threshold, and an independent adversarial review pass — with the Tech Lead re-running build and test itself rather than taking the Dev agent's word for it.
Result
Run end-to-end on a ~200,000 LOC legacy WinForms estate, the pipeline took the audit-and-planning phase — the part that used to consume roughly two months of manual work even with AI-assistant tooling like Copilot in the loop — down to about ten days.
Stack