Inspiration

Billions of daily financial, payroll, and warehouse transactions still execute inside decades-old COBOL batch programs while the engineers who wrote those rules have retired. Most teams lack an easy way to inspect fixed-format COBOL sequence numbers, observe silent PIC 99 Y2K overflows or decimal truncations step by step, visualize GO TO spaghetti paths alongside unreachable "ghost" paragraphs, and verify byte-for-byte behavioral parity when porting logic to TypeScript or Python.

For the Resurrection category of Kiroween 2026, NecroBOL brings both COBOL-85 and the classic IBM 3270 phosphor green-screen back to life in a modern browser debugger and a live Kiro MCP server.

What it does

  1. Browser-Native COBOL-85 Lexer, Parser & Time-Travel Interpreter: Parses IDENTIFICATION DIVISION, DATA DIVISION (WORKING-STORAGE SECTION PIC 9/S9/X + VALUE), and PROCEDURE DIVISION (DISPLAY, MOVE, ADD, SUBTRACT, MULTIPLY, DIVIDE, COMPUTE, ON SIZE ERROR, IF/ELSE/END-IF, PERFORM N TIMES, PERFORM UNTIL, GO TO, ALTER, STOP RUN). Every execution step snapshots stdout and memory registers so users can scrub forward and backward (Step k / N) across mutated WORKING-STORAGE fields.
  2. Authentic IBM 3270 Experience: Supports selectable CRT phosphor palettes (3270 Green, 3278 Amber, Spectral Violet), CRT scanlines, and IBM 3270 PF shortcuts (PF3 Reset, PF5 Execute Batch, PF8 Step, PF9 Exorcise & Transpile).
  3. Exorcist Static Analyzer & Ghost Call Graph: Scans AST and control-flow reachability for 6 concrete legacy hazards: CURSE-Y2K (2-digit year fields wrapping 99 + 2 = 01), CURSE-ALTER, CURSE-GOTO, CURSE-GHOST-PARA (unreachable paragraphs), CURSE-OVERFLOW, and CURSE-PRECISION. Computes a 0 to 100 Haunting Score, lists click-to-jump line diagnostics, and renders an SVG Paragraph Control-Flow Graph highlighting ghost nodes and GO TO arcs.
  4. Deterministic TypeScript/Python Modernizer with Byte-for-Byte Parity Proof: Emits structured TypeScript, Python 3, and a runnable Vitest parity test while comparing COBOL stdout against an independent pure TypeScript evaluation (100% MATCH) without calling eval() or new Function().
  5. Kiro MCP Mainframe Bridge (necrobol-mainframe): Exposes list_legacy_samples, analyze_cobol, execute_cobol, and transpile_cobol over stdio JSON-RPC 2.0 using the exact compiled src/engine/ bundle.

How we built it (with Kiro .kiro/ Workflows)

Every subsystem was built spec-first inside the tracked .kiro/ workspace directory:

  • Steering (.kiro/steering/): product.md, tech.md, and structure.md locked in fixed-point PIC semantics, zero-mock outputs, and zero eval() execution safety.
  • Specs (.kiro/specs/): Authored separate requirements.md, design.md, and tasks.md specs for cobol-interpreter, exorcist-analyzer, modernizer-transpiler, and mcp-mainframe-bridge.
  • Agent Hooks (.kiro/hooks/): Three automated PostFileSave hooks automatically test src/engine/, rebuild and integration-test mcp-server/server.mjs, and enforce tsc --noEmit && npm run lint.
  • MCP (.kiro/settings/mcp.json): Registers necrobol-mainframe (node mcp-server/server.mjs) so coding agents can lint, execute, and transpile legacy .CBL programs directly inside Kiro.

Challenges we ran into

  • Handling ADD WS-OPEN-YEAR WS-TERM-YEARS GIVING WS-MATURE-YEAR accurately when the preposition was GIVING directly after operands rather than TO <field> GIVING <dest>, caught immediately by our Vitest Y2K rollover assertions (99 + 2 -> "01").
  • Ensuring decimal precision analysis distinguished exact PIC 9(6)V99 multiplications (e.g., 0.08) from precision-losing 3-decimal factors (0.085), ensuring clean baseline archives genuinely score 0/100 (EXORCISED).
  • Keeping the browser compiler and Node MCP server synchronized via a single TypeScript engine (npm run build:mcp via Vite library mode).

Accomplishments that we're proud of

  • Zero simulation: every runtime trace, truncation warning, call graph edge, generated file, and parity check executes a real deterministic COBOL-85 engine tested end-to-end across 4 Vitest suites (including live child-process JSON-RPC 2.0 stdio MCP calls).
  • Instant judge verification directly on https://necrobol-kiroween-2026.web.app with 4 contrasting COBOL archives (BANK-Y2K-1994, PAYROLL-CRYPT-1987, INVENTORY-1989, and LEDGER-EXORCISED-2026).

What's next for NecroBOL

  • Expand support for indexed OCCURS tables, sequential FD file records, and COPY copybook resolution across multi-file legacy COBOL repositories via the MCP server.

Built With

Share this project:

Updates

Submission history