<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tho Nguyen</title>
    <description>The latest articles on DEV Community by Tho Nguyen (@tho_nguyen).</description>
    <link>https://dev.to/tho_nguyen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4231835%2Fcbd8f17a-6e8d-4aaa-8122-b822ff250c40.jpg</url>
      <title>DEV Community: Tho Nguyen</title>
      <link>https://dev.to/tho_nguyen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tho_nguyen"/>
    <language>en</language>
    <item>
      <title>My AI agent refunded $258 for a $129 order. So I built a flight recorder for agents.</title>
      <dc:creator>Tho Nguyen</dc:creator>
      <pubDate>Sun, 08 Nov 2026 16:44:43 +0000</pubDate>
      <link>https://dev.to/tho_nguyen/my-ai-agent-refunded-258-for-a-129-order-so-i-built-a-flight-recorder-for-agents-5bh2</link>
      <guid>https://dev.to/tho_nguyen/my-ai-agent-refunded-258-for-a-129-order-so-i-built-a-flight-recorder-for-agents-5bh2</guid>
      <description>&lt;p&gt;&lt;em&gt;This post was written as part of the Kiroween 2026 hackathon (#KiroweenHackathon26).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A customer writes in: the earbuds arrived broken, can I get a refund? An AI support agent looks up the order, checks the refund policy and asks the payment service to refund $129. The service commits the refund, but its response arrives after the client has already timed out. The app retries, as every retry loop does. The customer gets &lt;strong&gt;$258&lt;/strong&gt; back and is told $129.&lt;/p&gt;

&lt;p&gt;Nobody did anything exotic. A timeout after commit is one of the most ordinary failures in production. What's new is that an LLM sits in the middle deciding what happens next, and the tools it calls move money and delete servers.&lt;/p&gt;

&lt;p&gt;When that goes wrong, you usually have a log and a lot of guesswork:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You can't safely re-run it.&lt;/strong&gt; Re-running the incident refunds the customer a third time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You can't easily reproduce it.&lt;/strong&gt; Making the service time out at exactly the right moment is hard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You can't prove the fix.&lt;/strong&gt; Once you change the code, no test shows this exact failure can't happen again.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So for Kiroween I built &lt;strong&gt;GhostReplay Lab&lt;/strong&gt;: a flight recorder and crash-test lab for AI agents.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live demo: &lt;a href="https://ghostreplay.hayaix.tech" rel="noopener noreferrer"&gt;https://ghostreplay.hayaix.tech&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Video (2:44): &lt;a href="https://youtu.be/J2ttyDNMfDY" rel="noopener noreferrer"&gt;https://youtu.be/J2ttyDNMfDY&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Code (MIT): &lt;a href="https://github.com/thosuperman/ghostreplay" rel="noopener noreferrer"&gt;https://github.com/thosuperman/ghostreplay&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The loop: record, replay, break, prove
&lt;/h2&gt;

&lt;p&gt;GhostReplay runs one loop end to end:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Record → Replay offline → Inject a failure → Detect unsafe behaviour → Fix → Prove with pytest&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Record.&lt;/strong&gt; Every model call, tool call, clock read and generated id goes through one door (&lt;code&gt;AgentRuntime&lt;/code&gt;). It is captured in order, with secrets redacted before anything is stored.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replay offline.&lt;/strong&gt; Your agent's real code runs again, but every response comes from the recording. Tool functions are replaced by stubs that raise if called, and the network is blocked on the replaying thread. The replay is checked to be identical to the recording, event for event.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Break it on purpose.&lt;/strong&gt; Pick any recorded step and inject one of 15 fault kinds: a timeout after commit, HTTP 429, stale data, clock skew, a replaced model decision and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Detect.&lt;/strong&gt; Invariants such as &lt;code&gt;refund.no_duplicate&lt;/code&gt; or &lt;code&gt;infra.capacity_preserved&lt;/code&gt; check the run and explain, with evidence, why it was unsafe.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prove.&lt;/strong&gt; The incident becomes a pytest regression case that FAILS on the buggy agent and PASSES on the fixed one, and it runs in CI.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The rule I cared most about: &lt;strong&gt;never guess.&lt;/strong&gt; If an injected fault makes the agent take a path that was never recorded, strict replay stops at the first divergence and tells you, instead of inventing what the agent "would have done". Faults that need a real side effect run as a clearly labelled branch execution that re-executes for real.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two very different incidents, one framework
&lt;/h2&gt;

&lt;p&gt;I entered the &lt;strong&gt;Skeleton Crew&lt;/strong&gt; category: one shared framework and two separate applications built on it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Double Refund Incident.&lt;/strong&gt; A support agent backed by a real SQLite database and a local HTTP refund service with transactional commits. The bug: the app retries a timed-out refund without an idempotency key. The fix: a stable idempotency key plus a check for existing refunds before any retry. One refund, invariant PASS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The AI Agent That Almost Deleted Healthy Servers.&lt;/strong&gt; A DevOps agent talking to three real HTTP instance services and an allowlisted controller. After a bad deploy, stale monitoring says the healthy instances are impaired. If the workflow follows its runbook literally, it terminates all three. The fix: a safety gate in code that probes each target directly and requires approval. All three servers stay up.&lt;/p&gt;

&lt;p&gt;Neither app contains any replay, fault, diff or regression logic of its own. A refund bug and an infrastructure outage are caught by exactly the same code.&lt;/p&gt;

&lt;h2&gt;
  
  
  What surprised me: the real model was more careful than my workflow
&lt;/h2&gt;

&lt;p&gt;The model decisions in the demos come from genuine Claude tool-calling runs, recorded live and shipped as read-only captures. Every click on the site re-executes those runs for real against the local services. Two things came out of those live runs that I didn't expect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claude refused the dangerous runbook.&lt;/strong&gt; It read the logs, noticed the instances were probably fine and suggested a rollback instead. Great, but that's the model's judgment on one day with one prompt. So the demo shows that real decision, then injects the unsafe one (clearly labelled) to test the &lt;em&gt;workflow&lt;/em&gt;. Without a safety gate, the workflow destroys the fleet. Test the workflow, not the model's mood.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The bug lives in the application, not the model.&lt;/strong&gt; When the tool schema allowed it, Claude passed its own idempotency key and the duplicate refund disappeared. The buggy app now never offers one, which is exactly how this bug looks in real systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I used Kiro
&lt;/h2&gt;

&lt;p&gt;Kiro was how I organised and extended the project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steering.&lt;/strong&gt; The steering documents in &lt;code&gt;.kiro/steering/&lt;/code&gt; hold the product's rules. The most important is honesty: never present injected or scripted behaviour as real, and label every event with where its response came from. They also cover the repository structure, the stack, coding conventions and the security model. When Kiro added features, the new UI followed those rules, for example badges that say whether a run's decisions came from a live model or a scripted policy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specs.&lt;/strong&gt; Every component has a spec with &lt;code&gt;requirements.md&lt;/code&gt;, &lt;code&gt;design.md&lt;/code&gt; and &lt;code&gt;tasks.md&lt;/code&gt;: replay engine, failure injection, both labs, the dashboard and the SDK. Each task names its verification commands, and the rule is to write or extend a test first, implement, run the checks, then tick the task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running tasks in Kiro.&lt;/strong&gt; I ran open spec tasks from Kiro's task view (Kiro 1.4.121). That work added:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;two new fault kinds, &lt;code&gt;reordered_response&lt;/code&gt; and &lt;code&gt;clock_skew&lt;/code&gt; (which targets clock reads, so refund windows and expiry checks can be broken on purpose);&lt;/li&gt;
&lt;li&gt;an &lt;code&gt;infra.approval_chain_valid&lt;/code&gt; invariant that catches self-approved changes;&lt;/li&gt;
&lt;li&gt;honest recovery for failed probes in the safety gate;&lt;/li&gt;
&lt;li&gt;model usage and "Copy as JSON" in the inspector, and live/scripted badges in the explorer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kiro keeps an execution history for each spec in &lt;code&gt;tasks.meta.json&lt;/code&gt;, committed alongside the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hooks.&lt;/strong&gt; Agent hooks in &lt;code&gt;.kiro/hooks/&lt;/code&gt; run the framework guarantee tests when the framework changes and the scenario regressions when a lab changes. They also type-check the dashboard, keep its TypeScript types in sync with the Pydantic schema, lint on stop and scan for secrets.&lt;/p&gt;

&lt;p&gt;The specs made the biggest difference. A task like "add &lt;code&gt;clock_skew&lt;/code&gt;" touches the Pydantic schema, the fault catalog, the dashboard types, the Failure Lab UI and the tests. Writing that down as requirements, design and numbered sub-tasks with verification commands kept each change small, testable and consistent across Python and TypeScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;In the browser.&lt;/strong&gt; Open &lt;a href="https://ghostreplay.hayaix.tech" rel="noopener noreferrer"&gt;https://ghostreplay.hayaix.tech&lt;/a&gt; and click &lt;strong&gt;Watch an AI Agent Fail&lt;/strong&gt;. The six-step guided demo takes about three minutes, with no sign-up and no API key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With your own agent.&lt;/strong&gt; The Python SDK wraps your tools and model calls with decorators:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;ghostreplay&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;GhostReplay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fault&lt;/span&gt;

&lt;span class="n"&gt;ghost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GhostReplay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;my-agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;./ghostreplay-data&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@ghost.tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;payments.charge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;destructive&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;charge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount_cents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;...&lt;/span&gt;

&lt;span class="nd"&gt;@ghost.agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;buggy&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;...&lt;/span&gt;

&lt;span class="n"&gt;incident&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ghost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;record&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;buggy&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                        &lt;span class="n"&gt;faults&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;fault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;timeout_after_commit&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;payments.charge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;span class="n"&gt;ghost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;incident&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# offline: none of your functions is called
&lt;/span&gt;&lt;span class="n"&gt;ghost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write_regression_test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;incident&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tests/regression&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fixed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;import_module&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;my_agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Agents will keep making expensive mistakes. The least we can do is catch them once, replay them safely and make sure they never happen again.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built for Kiroween 2026. #KiroweenHackathon26&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>architecture</category>
      <category>debugging</category>
    </item>
    <item>
      <title>Resurrecting COBOL with receipts: how we built COBOL Phoenix</title>
      <dc:creator>Tho Nguyen</dc:creator>
      <pubDate>Sat, 07 Nov 2026 09:52:57 +0000</pubDate>
      <link>https://dev.to/tho_nguyen/resurrecting-cobol-with-receipts-how-we-built-cobol-phoenix-2m3j</link>
      <guid>https://dev.to/tho_nguyen/resurrecting-cobol-with-receipts-how-we-built-cobol-phoenix-2m3j</guid>
      <description>&lt;p&gt;&lt;strong&gt;This post is written as part of the Kiroween 2026 hackathon.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every legacy-modernization pitch promises to “convert your COBOL”. Converting is not the problem. The problem is the&lt;br&gt;
question every architect asks afterwards: &lt;strong&gt;how do we know the new code behaves exactly like the old one?&lt;/strong&gt;&lt;br&gt;
COBOL Phoenix is our answer: understand the program deterministically, generate code you can trace line by line,&lt;br&gt;
and prove behaviour by running the original and the generated code side by side.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcb1gngbvyqg705mzs97x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcb1gngbvyqg705mzs97x.png" alt=" " width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Rule 1: no guessing in the core
&lt;/h2&gt;

&lt;p&gt;We wrote a real COBOL front end in Python — a fixed/free-format lexer, a COPY … REPLACING preprocessor and a&lt;br&gt;
recursive-descent parser — producing an intermediate representation where every node carries a file and line&lt;br&gt;
range. Business rules, the dependency graph and the generated code are all derived from that IR. Anything outside&lt;br&gt;
the supported subset (file I/O, INSPECT, ALTER, EXEC SQL…) is reported with its location and becomes an explicit&lt;br&gt;
&lt;code&gt;UnsupportedConstruct&lt;/code&gt; in the generated code. Nothing is silently dropped.&lt;/p&gt;
&lt;h2&gt;
  
  
  Rule 2: COBOL data is bytes
&lt;/h2&gt;

&lt;p&gt;The generated Python runs on a small runtime where each record is a &lt;code&gt;bytearray&lt;/code&gt; and each data item a typed view.&lt;br&gt;
That single decision makes REDEFINES, group MOVEs and CALL BY REFERENCE behave like COBOL instead of like Python&lt;br&gt;
dictionaries. Numbers are &lt;code&gt;Decimal&lt;/code&gt;, with COBOL's truncation, ROUNDED (half away from zero), sign overpunch and&lt;br&gt;
numeric-editing rules — each confirmed against GnuCOBOL with tiny probe programs.&lt;/p&gt;
&lt;h2&gt;
  
  
  Rule 3: prove it
&lt;/h2&gt;

&lt;p&gt;For a callable program we generate a COBOL harness that ACCEPTs each USING parameter, CALLs the program and&lt;br&gt;
DISPLAYs the results; the generated Python CLI speaks the same protocol. Identical bytes go into GnuCOBOL (inside a&lt;br&gt;
container with no network, a read-only filesystem and resource limits) and into Python. Outputs are decoded with the&lt;br&gt;
record layout and compared field by field.&lt;/p&gt;

&lt;p&gt;Test inputs come from fixtures plus values derived from the code itself: every comparison against a literal yields&lt;br&gt;
boundary values, every 88-level and EVALUATE WHEN yields matching and non-matching values. Then we got smarter:&lt;br&gt;
we trace the fixtures through the generated Python and attach each boundary value to a fixture that actually&lt;br&gt;
executes the statement it came from — &lt;em&gt;coverage-guided placement&lt;/em&gt;. On a public insurance repository that raised the&lt;br&gt;
mutation score from 67% to over 80% without a single hand-written test.&lt;/p&gt;
&lt;h2&gt;
  
  
  The best bug was our own
&lt;/h2&gt;

&lt;p&gt;An edge case with the maximum vehicle value failed. GnuCOBOL printed &lt;code&gt;$04,059.41&lt;/code&gt;; our runtime printed&lt;br&gt;
&lt;code&gt;$4,059.41&lt;/code&gt;. When significant high-order digits are truncated away, GnuCOBOL considers zero suppression already&lt;br&gt;
finished. We would never have found that by reading documentation. Differential testing found it in seconds.&lt;/p&gt;
&lt;h2&gt;
  
  
  Trust, measured
&lt;/h2&gt;

&lt;p&gt;Passing cases are evidence, not proof, so we measure the tests themselves: mutation analysis generates single-fault&lt;br&gt;
variants (drop a ROUNDED, flip a &lt;code&gt;&amp;lt;&lt;/code&gt; to &lt;code&gt;&amp;lt;=&lt;/code&gt;) and checks the suite catches them. In the UI you can inject one on&lt;br&gt;
purpose — remove one ROUNDED and watch eight cases fail by exactly one cent. On the insurance repository the&lt;br&gt;
surviving mutants pointed at a business rule that can never fire, because every plan caps the issue age below the&lt;br&gt;
rule's threshold. That is the kind of finding a modernization team actually needs.&lt;/p&gt;
&lt;h2&gt;
  
  
  Spec-first with Kiro
&lt;/h2&gt;

&lt;p&gt;We started from an empty repository by writing Kiro steering documents (product principles, COBOL semantics,&lt;br&gt;
security, testing), four specs with EARS requirements, designs and task lists, and hooks. The steering file on&lt;br&gt;
COBOL semantics turned out to be the most valuable artifact: it was the checklist we tested the runtime against.&lt;/p&gt;

&lt;p&gt;We then used Kiro IDE to execute spec tasks: support for &lt;code&gt;INSPECT … TALLYING / REPLACING&lt;/code&gt;, and OpenAPI request&lt;br&gt;
examples generated from fixtures. Because a &lt;code&gt;PostTaskExec&lt;/code&gt; hook runs the whole suite — including the differential&lt;br&gt;
tests against GnuCOBOL — every Kiro task had to keep the generated Python behaviourally identical to the original.&lt;br&gt;
Kiro even refused to guess GnuCOBOL's sign handling for INSPECT on signed numbers and reported those as&lt;br&gt;
unsupported instead, exactly as our steering asked. &lt;em&gt;(Add your own impressions of working with Kiro here.)&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Original sample: 127/127 cases identical to GnuCOBOL; injected fault caught (8 failing cases).&lt;/li&gt;
&lt;li&gt;Independent insurance repository: 180/180 on the underwriting program; generated drivers reproduce upstream golden files.&lt;/li&gt;
&lt;li&gt;Two more repositories: 20 programs parsed with zero errors; 365 unsupported constructs reported, not ignored.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Open &lt;a href="https://cobol.beauty" rel="noopener noreferrer"&gt;cobol.beauty&lt;/a&gt;, click &lt;strong&gt;Import sample → Generate → Verify&lt;/strong&gt;, then inject a fault and watch&lt;br&gt;
it get caught. Or run it yourself with Docker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/thosuperman/cobol-phoenix &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;cobol-phoenix
docker compose up &lt;span class="nt"&gt;--build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;COBOL Phoenix is open source under Apache-2.0:&lt;br&gt;
&lt;a href="https://github.com/thosuperman/cobol-phoenix" rel="noopener noreferrer"&gt;github.com/thosuperman/cobol-phoenix&lt;/a&gt;.&lt;br&gt;
Preserve the logic. Rebuild the future.&lt;/p&gt;

&lt;h1&gt;
  
  
  KiroweenHackathon26 #Kiro #COBOL #Python
&lt;/h1&gt;

</description>
      <category>kiro</category>
      <category>cobol</category>
      <category>python</category>
      <category>kiroweenhackathon26</category>
    </item>
  </channel>
</rss>
