Written as part of the Kiroween 2026 hackathon.
Necromancer! Built with Kiro Web.
Banks, insurers and governments still run programs written in COBOL decades ago. When a team replaces one, often with AI help now, the new code usually reads well and passes a few spot checks. The trouble is behavior nobody wrote down, because it lives in the data definitions, not in the logic.
Take this line from a payroll program:
01 GROSS-PAY PIC 9(5)V99. It means five digits before the decimal point and two after. Store 464,000 in it and COBOL keeps 64,000, without an error. Compute 0.90 hours at 0.01 an hour and COBOL stores 0.00, because without the word ROUNDED it cuts extra decimals instead of rounding them. A JavaScript rewrite keeps 464,000 and rounds to 0.01. Nothing crashes. The numbers are just different.
What I built
For Kiroween's Resurrection category I built Necromancer, a browser app that brings old COBOL back to life and checks rewrites against it:
- The séance. It runs the original program and a rewrite on thousands of generated inputs and lists every place they disagree. Each kind of disagreement (a "ghost") is shrunk to the simplest input that shows it and explained in plain English.
- The bones. It reads the COBOL and writes down what the program does as a Kiro
requirements.md, including a section on the decimal rules a rewrite has to keep. - The raised port. It generates a JavaScript version that keeps COBOL's exact decimal rules, as a safe starting point before refactoring.
On the bundled payroll program, an AI-style JavaScript port disagrees with the original on 947 of 2,000 inputs, in two ways: it rounds where COBOL cuts, and it keeps digits that COBOL silently drops. The port Necromancer generates disagreed on none of the inputs I tested.
The ghost I didn't plan for: a loan program counts months in a field declared PIC 999. At 999 months the counter goes from 999 back to 000, so the loop never ends. [Your reaction to that.]
How it works
- An interpreter instead of a compiler. My Kiro Web sandbox was set to repository-only network access, so there was no way to install a COBOL compiler. Necromancer includes an interpreter for a documented COBOL subset, with exact decimal arithmetic on JavaScript
BigInt. - One runtime for both sides. The generated port embeds the same runtime code as the interpreter, so both share one definition of COBOL arithmetic.
- Inputs from the data definitions. For every input field it tries zero, the largest value the field can hold, the smallest step, and every number that appears in the program plus and minus one step, mixed with random values.
- Loud failures. Features it doesn't support yet, such as
GO TOand file I/O, are reported with a line number instead of being skipped.
How I used Kiro
[A sentence or two on how you worked with Kiro: what you asked for, what you decided, what you pushed back on.]
- Kiro Web only. The whole build happened in one long Kiro Web session.
- Code first, spec after. For Necromancer the code came first, and the spec in
.kiro/specswas written afterwards to record the design and five correctness properties. My other Kiroween project, Gearwork, went spec first, and the property tests taken from its design caught two mistakes in the design itself. [Which way worked better for you, and why.] - Property-based testing. With no packages available, Kiro wrote a small seeded test harness with shrinking. The séance is the same idea pointed at legacy code.
- Testing in a real browser. Through the Playwright Power, Kiro opened the app, ran the séance and took screenshots. That showed one overflow bug listed as three separate ghosts, so ghosts are now grouped by the first output that goes wrong.
- Set up, not run yet. The repo has steering files, hooks (a Stop hook that runs the tests, and a guard that keeps
.kiroout of.gitignore) and a "COBOL elder" review agent. They didn't run during the build, because my session's workspace was the folder above the repo.
Limits
- It covers a subset of COBOL.
- Some behavior differs between real compilers, such as how many decimal places division keeps. Necromancer's choices are written down in the repo as assumptions.
- I haven't compared it against a real COBOL compiler yet.
