Migration (Stage 3)
Migration translates each unit in the approved plan from the source language to the target language using AI with language-pair-specific idiom mappings, dependency context, and knowledge base lookups.
Migration unlocks after you click Approve Plan → in Stage 2.
Translation Loop
For each unit, the IDE runs a 5-step loop:
- Context assembly — resolves inlined dependencies (copybooks, headers, imports) and loads the knowledge base context for the unit (type mappings, naming decisions, rule interpretations)
- Prompt build — constructs the LLM prompt with XML-tagged source, context, and output format instructions
- LLM call — sends to the configured model (uses the
Checksmodel if configured, falls back toChat) - Parse — extracts translated output from
<translation>...</translation>and metadata from<metadata>{...}</metadata>response tags using 4 extraction strategies with a lenient JSON fallback - Verify — runs 8 verification checks; blockers halt the unit, warnings are surfaced for review
Verification Checks
| Check | Type | Description |
|---|---|---|
non-empty | Blocker | Translation output is non-empty |
no-placeholders | Blocker | No TODO or [PLACEHOLDER] markers in output |
no-truncation | Blocker | Output doesn't end mid-statement |
source-lang-keywords | Warning | Source language keywords detected in target output |
balanced-braces | Warning | Unbalanced {} or [] in output |
length-sanity | Warning | Output length is plausible relative to source |
blocking-decision | Info | A blocking human decision was raised |
low-confidence | Info | Translation confidence below medium |
Language Pair Profiles
The translation engine selects a language pair profile based on the session's migration pattern. Profiles define idiom mappings, type equivalences, and naming conventions.
Supported Profiles
| Source | Target | Idioms |
|---|---|---|
| COBOL | Java | 32 idiom mappings |
| COBOL | TypeScript | 28 idiom mappings |
| PL/SQL | TypeScript | 24 idiom mappings |
| RPG | Java | 22 idiom mappings |
| Angular 1.x | Angular 18 | 20 idiom mappings |
| C (bare-metal) | C (FreeRTOS) | 18 idiom mappings |
| FORTRAN | Python | 16 idiom mappings |
| Ada | C++ | 14 idiom mappings |
| Structured Text | Python | 14 idiom mappings |
| MUMPS | Java | 12 idiom mappings |
| ABAP | TypeScript | 12 idiom mappings |
A generic profile applies when no specific profile matches the language pair.
Idiom Mapping Example (COBOL → Java)
| COBOL Construct | Java Equivalent |
|---|---|
PERFORM UNTIL | while loop |
EVALUATE WHEN | switch expression |
MOVE x TO y | y = x assignment |
PIC 9(9)V99 | java.math.BigDecimal |
WORKING-STORAGE SECTION | class fields |
FD (File Description) | DTO + repository |
GOBACK | return / throw |
COMPUTE | arithmetic expression |
Context Budget
The translation context is assembled with a 6-priority budget (trimmed if context exceeds the model's limit):
| Priority | Content |
|---|---|
| P1 (highest) | Source file content |
| P2 | Type mappings and naming decisions from KB |
| P3 | Dependency interfaces (inlined copybooks, headers) |
| P4 | Rule interpretations and compliance patterns |
| P5 | Framework rules and glossary terms |
| P6 | Annotation history from prior translation attempts |
Human Decisions
The translation model raises decisions when it encounters a construct that requires human input. Decisions are either blocking or non-blocking.
Decision Types
| Type | Description |
|---|---|
type-mapping | Source type has no direct target equivalent — choose a mapping |
naming | Identifier requires a domain-specific name choice |
rule-interpretation | Compliance rule has ambiguous application |
architecture | Pattern requires structural change — choose an approach |
Blocking decisions halt the unit and must be resolved before re-translation. Non-blocking decisions are surfaced as annotations on the translated output.
Resolved decisions are stored in the knowledge base and automatically applied to future units with the same construct.
Re-translating a Unit
You can re-translate any unit at any time:
- Click Re-translate to run with default settings
- Provide custom instructions to guide the model on specific constructs
- Re-translation creates a new version; the previous version is preserved in the unit history
Approving a Unit
After reviewing the translated output:
- Approve — marks the unit as
approvedand writes its translation to the knowledge base - Skip — marks as
skipped; the unit is excluded from cutover - Reject — marks as
rejectedfor re-translation
The compliance fingerprint comparison result is shown for each unit:
- ≥90% match: auto-approvable
- 70–89% match: warning, manual review recommended
- <70% match: compliance officer sign-off required
Progress
The migration pane shows:
- Units by phase and status (
pending,translating,awaiting-review,approved,skipped,rejected) - Overall progress percentage
- Critical path units highlighted
- Blocked units with blocker description
Last edited