<?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: Luke Shin</title>
    <description>The latest articles on DEV Community by Luke Shin (@luke_shin_ai).</description>
    <link>https://dev.to/luke_shin_ai</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%2F4258411%2F302dae67-de22-48ba-a7e9-10a9562ec0a3.png</url>
      <title>DEV Community: Luke Shin</title>
      <link>https://dev.to/luke_shin_ai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luke_shin_ai"/>
    <language>en</language>
    <item>
      <title>Verdict by code, narration by agent: two days with Kiro on a dead payment format</title>
      <dc:creator>Luke Shin</dc:creator>
      <pubDate>Sun, 22 Nov 2026 07:38:40 +0000</pubDate>
      <link>https://dev.to/luke_shin_ai/verdict-by-code-narration-by-agent-two-days-with-kiro-on-a-dead-payment-format-51hh</link>
      <guid>https://dev.to/luke_shin_ai/verdict-by-code-narration-by-agent-two-days-with-kiro-on-a-dead-payment-format-51hh</guid>
      <description>&lt;p&gt;The line I keep coming back to from this build is not a feature. It is one row of a log file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026-11-21T09:32:22.134Z  trigger=PostFileSave  unit+pbt tests ran
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nobody asked for that test run. I saved a TypeScript file in a Kiro CLI session and a hook ran the unit and property suites before the agent's next turn. The row is committed in &lt;code&gt;out/hook-log.txt&lt;/code&gt;, so anyone can read it without taking my word for it.&lt;/p&gt;

&lt;p&gt;This post is written as part of the Kiroween 2026 hackathon, where I entered a project called 「820」 in the Resurrection category. It is a build log more than a tutorial: what I asked Kiro to do, what it did, and the places where I was confident and wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: the files survived, the readers did not
&lt;/h2&gt;

&lt;p&gt;Corporate payment files never died. EDI 820 remittance orders, 823 confirmations and BAI2 bank statements still move between banks and ERP systems every day as fixed-width text. What each byte means is written in a COBOL copybook, and the copybook is a separate file that a modern stack has no idea what to do with.&lt;/p&gt;

&lt;p&gt;A back office that cannot read the copybook retypes the file into a spreadsheet. That is how a payment file becomes a person's memory of a payment file.&lt;/p&gt;

&lt;p&gt;So the tool reads the file plus its copybook and produces a verdict, with the bytes behind every finding. Four layers, and only one of them is allowed to be a model:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Parser: types every record at the copybook's byte offsets. Trailing overpunch, leading separate sign, COMP-3 packed decimal with no line breaks at all, implied decimals. A copybook that declares &lt;code&gt;REDEFINES&lt;/code&gt; (one hundred bytes that are the payment in one layout and the trailer in another) is read as a region, and a record whose discriminator matches no layout is reported instead of guessed.&lt;/li&gt;
&lt;li&gt;Reconciler: control totals per currency, record counts, references, value dates against a settlement window. Coded findings with signed &lt;code&gt;bigint&lt;/code&gt; deltas.&lt;/li&gt;
&lt;li&gt;Explainer: an optional agent layer that narrates a finding and may cite only numbers the first two layers produced. Anything else becomes &lt;code&gt;INSUFFICIENT_EVIDENCE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Register: a human decision per finding, append only and hash chained, with an owner, a reason, a compensating control and an expiry. A waiver never turns a verdict green.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The phrase I used while building was "verdict by code, narration by agent". It is not a slogan about distrust of AI. It is a rule about what a reviewer is allowed to check: if the model produces the verdict, the only way to check the answer is to trust the model again.&lt;/p&gt;

&lt;p&gt;Links, if you want to poke at it before reading the rest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repository (public, Apache 2.0, &lt;code&gt;.kiro&lt;/code&gt; at the root): &lt;a href="https://github.com/luke-shin-ai/edi820-workbench" rel="noopener noreferrer"&gt;https://github.com/luke-shin-ai/edi820-workbench&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;No-install demo, the same engine compiled for the browser: &lt;a href="https://luke-shin-ai.github.io/edi820-workbench/demo/" rel="noopener noreferrer"&gt;https://luke-shin-ai.github.io/edi820-workbench/demo/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Two minute 55 second demo video: &lt;a href="https://youtu.be/rncG1wwqTAM" rel="noopener noreferrer"&gt;https://youtu.be/rncG1wwqTAM&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Devpost entry: &lt;a href="https://devpost.com/software/820-a-reconciliation-workbench-for-dead-payment-files" rel="noopener noreferrer"&gt;https://devpost.com/software/820-a-reconciliation-workbench-for-dead-payment-files&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The spec came first, and the copybook was not the spec
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.kiro/specs/edi820-importer/&lt;/code&gt; holds 33 requirements in EARS form, in seven groups, plus an explicit out of scope section. Writing them was the slowest part of the build and the part Kiro could not do for me.&lt;/p&gt;

&lt;p&gt;Here is one requirement the copybook cannot express, quoted from the spec (R2.2):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cobol"&gt;&lt;code&gt;&lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;record&lt;/span&gt;&lt;span class="s1"&gt;'s byte length differs from the copybook record length,
THE SYSTEM SHALL emit RECORD_LENGTH_MISMATCH with record index and both lengths,
and SHALL continue parsing at the declared record boundary.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The copybook says where a field starts and how wide it is. It does not say whether a 99-byte record should be skipped, re-synchronised or reported. The easy implementation re-synchronises silently, because that makes the demo pass. Writing "SHALL continue parsing at the declared record boundary" as a requirement is what turned that convenience into a bug when the code did it anyway.&lt;/p&gt;

&lt;p&gt;I also wrote a &lt;code&gt;design.md&lt;/code&gt; with a delta log for every decision that changed while I was building. That log is the most useful document in the repository now, because it shows where the first idea lost: typing money as &lt;code&gt;number&lt;/code&gt;, fetching a matched count from a human readable sentence, treating a &lt;code&gt;REDEFINES&lt;/code&gt; region as two independent fields.&lt;/p&gt;

&lt;p&gt;The honest boundary: I did not run the Kiro IDE spec flow from requirements to tasks to implementation inside one session. I authored the spec in the workspace from the copybooks, and the implementation ran with the spec as the contract. Kiro implemented one layer, the exception register, from spec task T7.1 in a real session, and the repository marks which evidence rows came from which session rather than implying the whole thing was generated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steering: the one rule that changed the code
&lt;/h2&gt;

&lt;p&gt;Five steering files, and one of them visibly overruled the design. &lt;code&gt;tech.md&lt;/code&gt; says money is never floating point. The design draft had typed numeric amounts as &lt;code&gt;number&lt;/code&gt;, which in JavaScript is a float. The implementation uses &lt;code&gt;bigint&lt;/code&gt; minor units with an ISO 4217 currency, and the change is recorded as implementation delta 1 in &lt;code&gt;design.md&lt;/code&gt; section 10. A reader can watch the steering file win against the design draft, which is a more useful artifact than a sentence that says steering is helpful.&lt;/p&gt;

&lt;p&gt;The steering strategy that made the biggest difference was writing prohibitions as rules instead of preferences: no floats, no silent re-sync, no model in the verdict path, no exception without a compensating control. An agent will happily violate a preference to make a test go green. A prohibition with a name is something a reviewer can grep for.&lt;/p&gt;

&lt;h2&gt;
  
  
  The reviewer agent, and the review it made up
&lt;/h2&gt;

&lt;p&gt;Two custom agents live in &lt;code&gt;.kiro/agents/&lt;/code&gt;: an implementer and an adversarial reviewer. The reviewer is not allowed to rewrite code; it reads the spec, calls the project's MCP server, and tries to break the claims.&lt;/p&gt;

&lt;p&gt;The first version of it had no &lt;code&gt;tools&lt;/code&gt; array in its config. It produced a fluent, confident review with file names and line references. Three of its four claims were false. It said no decoder existed for zoned or packed decimal (both are in &lt;code&gt;src/parser/decode.ts&lt;/code&gt;). It said &lt;code&gt;CURRENCY_SCALE_MISMATCH&lt;/code&gt; was emitted nowhere (it is emitted in &lt;code&gt;src/parser/parser.ts&lt;/code&gt;). It said an invalid overpunch returned zero silently (it throws, and a test asserts that).&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;tools: [read, grep, glob, thinking]&lt;/code&gt; and a prompt that says read a file before you cite it, the same agent found two real defects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A record with a blank reference was skipped entirely, so it never showed up as &lt;code&gt;REF_UNMATCHED&lt;/code&gt;. That is exactly the silent drop the tool claims it does not do.&lt;/li&gt;
&lt;li&gt;The matched reference count was derived by string matching a sentence in a finding's detail text, instead of being counted where the matching happens.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both are fixed with tests. The first one is now the reason the reconcile test suite has a case for a blank reference with an expected finding, not an expected skip.&lt;/p&gt;

&lt;p&gt;That review changed the product. The explainer layer is built on the same lesson: a citation that comes from prose instead of from a computed value is refused, and the refusal is a code path (&lt;code&gt;INSUFFICIENT_EVIDENCE&lt;/code&gt;), not a strongly worded prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hooks: three triggers, two of them named wrong
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.kiro/hooks/parser-guardrails.json&lt;/code&gt; declares three hooks, and all three now fire in live sessions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;PostFileSave&lt;/code&gt; matching &lt;code&gt;\.(ts|mjs)$&lt;/code&gt; and &lt;code&gt;copybooks/.*\.cpy$&lt;/code&gt;, which runs the unit and property suites while an agent edits.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Stop&lt;/code&gt;, which finds the newest report in &lt;code&gt;out/&lt;/code&gt; that holds a verdict and re-derives it with the real CLI entry, so a fingerprint drift or a missing run is printed into the session instead of being swallowed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PostTaskExec&lt;/code&gt;, which appends one row to &lt;code&gt;EVIDENCE.md&lt;/code&gt; when a spec task completes and then logs its own firing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Getting there took longer than writing them, because a broken hook fails silently.&lt;/p&gt;

&lt;p&gt;The stop hook was declared with &lt;code&gt;"trigger": "AgentStop"&lt;/code&gt;. That is the name the docs display. On Kiro CLI 3.5.0 the event is &lt;code&gt;Stop&lt;/code&gt;, and &lt;code&gt;AgentStop&lt;/code&gt; is accepted into the file and never matched. I found it the only way such things can be found, with a two-line probe hook that writes a file: on &lt;code&gt;AgentStop&lt;/code&gt; nothing appeared, on &lt;code&gt;Stop&lt;/code&gt; it fired on the next session.&lt;/p&gt;

&lt;p&gt;Worse, the stop hook's command pointed at &lt;code&gt;src/cli/index.ts&lt;/code&gt;, a module that exports a function and has no entry point, and at &lt;code&gt;out/&lt;/code&gt; while reports live in &lt;code&gt;out/&amp;lt;timestamp&amp;gt;/&lt;/code&gt;. So it printed nothing and exited 0. A hook that does nothing and reports success is more dangerous than one that crashes, because the log looks clean. It now calls a script that resolves the newest report and hands it to the real entry point, and every firing is appended to &lt;code&gt;out/hook-log.txt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The task hook had the same kind of defect twice over. Its trigger was &lt;code&gt;PostTaskExecution&lt;/code&gt; instead of &lt;code&gt;PostTaskExec&lt;/code&gt;, and no session had the spec tools at all, because they only exist under &lt;code&gt;--mode spec&lt;/code&gt;. So the hook could not have fired whatever it was called. On 2026-11-22 I ran a session with &lt;code&gt;--mode spec&lt;/code&gt;, set spec task T9.5 to in progress and then to completed through Kiro's own &lt;code&gt;task_update&lt;/code&gt; tool, and the hook wrote its row:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026-11-22T01:45:25.455Z  trigger=PostTaskExec  evidence row appended
2026-11-22T01:45:27.543Z  trigger=Stop  run=final-check  ...  exit=0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three earlier rows in the same log say &lt;code&gt;PostTaskExecution&lt;/code&gt;, because the hook command was still passing the old label when it wrote them. I left them in the file. An append only log that gets rewritten when the config improves is not a log.&lt;/p&gt;

&lt;p&gt;The lesson generalizes past Kiro: an automation you have not watched fire is a comment.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP: letting the reviewer ask the engine
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;src/mcp/&lt;/code&gt; is a JSON-RPC server over stdio with five tools: &lt;code&gt;parse_file&lt;/code&gt;, &lt;code&gt;reconcile&lt;/code&gt;, &lt;code&gt;explain_findings&lt;/code&gt;, &lt;code&gt;verify&lt;/code&gt;, &lt;code&gt;exceptions&lt;/code&gt;. Each returns the same JSON the CLI writes, because all three surfaces call &lt;code&gt;src/core/ops.ts&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It is wired into the reviewer agent through &lt;code&gt;.kiro/settings/mcp.json&lt;/code&gt; and &lt;code&gt;allowedTools&lt;/code&gt;. In the review session the agent called &lt;code&gt;@820/reconcile&lt;/code&gt;, &lt;code&gt;@820/exceptions&lt;/code&gt; and &lt;code&gt;@820/verify&lt;/code&gt;, and got back the verdict &lt;code&gt;FAIL&lt;/code&gt; with 4 findings and the fingerprint &lt;code&gt;7af64454...&lt;/code&gt;. Running &lt;code&gt;node scripts/mcp-call.mjs&lt;/code&gt; outside any agent prints the same values.&lt;/p&gt;

&lt;p&gt;That equality is the whole point. The agent is not describing what the code probably does. It is quoting the number the code produced, and the reviewer and the command line cannot disagree, because there is only one implementation.&lt;/p&gt;

&lt;p&gt;I wrote the server against the protocol directly, newline delimited JSON-RPC with &lt;code&gt;initialize&lt;/code&gt;, &lt;code&gt;tools/list&lt;/code&gt;, &lt;code&gt;tools/call&lt;/code&gt;, &lt;code&gt;-32601&lt;/code&gt; for an unknown method and &lt;code&gt;-32700&lt;/code&gt; for a malformed line, because the MCP SDK would not install in this environment. The test opens a real stdio session against the process and sends a malformed line that must not kill the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Property based testing: 31 properties, 334 tests
&lt;/h2&gt;

&lt;p&gt;The suite is 334 tests in 25 files, 31 of them properties over generated inputs. This figure is as of 2026-11-26; when this post was published on 2026-11-22 the suite was 311 tests in 23 files, and the demo video recorded that weekend states 311 on screen. The 23 cases added since cover the MCP path allowlist, the ledger head and the two published BAI2 files. Four properties did most of the work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amounts re-encode to the same bytes across overpunch, separate sign and packed decimal. This one found a real encoder bug: values were sized by integer digits only, so implied decimals were dropped.&lt;/li&gt;
&lt;li&gt;Parse, serialize, compare bytes. Identical, including CRLF, a missing final newline, and a binary COMP-3 stream with no newlines at all.&lt;/li&gt;
&lt;li&gt;500 generated copybooks compile to contiguous field starts from 1, with field widths summing to the record length.&lt;/li&gt;
&lt;li&gt;For generated two-layout copybooks, both layouts cover the same byte range, a record written through one layout parses back with that layout's fields and none of the other's, and a discriminator that selects no layout is reported.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My overpunch table was also wrong in the first draft, in a way a unit test would have matched: it was built from &lt;code&gt;'A' + 0&lt;/code&gt;, so &lt;code&gt;A&lt;/code&gt; mapped to 0 instead of +1. The property that caught it is kept as &lt;code&gt;test/regressions/overpunch-and-width.test.ts&lt;/code&gt;, next to the input that failed.&lt;/p&gt;

&lt;p&gt;The regressions I care about most are the ones where the tool was confidently wrong. A truncated record used to reach &lt;code&gt;PASS&lt;/code&gt; with zero findings; it now produces &lt;code&gt;INCOMPLETE&lt;/code&gt; and exit code 2. A &lt;code&gt;REDEFINES&lt;/code&gt; record with a damaged type byte used to be decoded anyway; its bytes now stay undecoded and the record is reported.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would not claim
&lt;/h2&gt;

&lt;p&gt;The temptation in a hackathon write-up is to describe the tool you meant to build. The repository states its boundaries instead of leaving them to be found: the IDE spec flow was not run, Kiro powers were not used, and the exception register is the one layer that a Kiro session implemented from the spec.&lt;/p&gt;

&lt;p&gt;There is also a boundary that belongs in the product itself. &lt;code&gt;docs/guarantees.md&lt;/code&gt; lists six things the tool guarantees mechanically (byte exact slicing, one layout per record, &lt;code&gt;bigint&lt;/code&gt; arithmetic, no silently dropped reference, reproducible fingerprints, grounded explanations) and four it does not (whether a payment is legally adequate, whether an exception is acceptable, coverage of unmodelled copybook clauses, whether the bank sent the right file). It is printed by the CLI and shown in the screen, so the limits travel with the answer.&lt;/p&gt;

&lt;p&gt;In a regulated back office, a tool that says "here is exactly where my guarantee stops and here is who decides past that line" is usable. One that says it is always right is a liability.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed in how I build
&lt;/h2&gt;

&lt;p&gt;Before this, my loop with an agent was: describe, accept, run tests at the end. The loop now has three more steps in it, and they are all about making the agent's claims checkable.&lt;/p&gt;

&lt;p&gt;The spec became the place where I decide, so the agent does not get to decide by writing code that passes. Steering became the list of things I refuse, written down where the agent reads them every turn. And the hooks became the reviewer that never gets tired: the tests run on save, the verdict gets re-derived when the session stops, and the evidence row is written by the workflow instead of by me at the end.&lt;/p&gt;

&lt;p&gt;The part I did not expect is how much of the value came from the failures. The reviewer that invented three claims, the stop hook that exited 0 without doing anything, the trigger names that were accepted and never matched: each one is now a line in the repository, and each one is the reason a specific check exists.&lt;/p&gt;

&lt;p&gt;「820」 is at &lt;a href="https://github.com/luke-shin-ai/edi820-workbench" rel="noopener noreferrer"&gt;https://github.com/luke-shin-ai/edi820-workbench&lt;/a&gt; if you want to read the spec, the delta log, the hook log and the tests. The demo runs in a browser tab with no server: &lt;a href="https://luke-shin-ai.github.io/edi820-workbench/demo/" rel="noopener noreferrer"&gt;https://luke-shin-ai.github.io/edi820-workbench/demo/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kiroween</category>
      <category>kiro</category>
      <category>hackathon</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
