<?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: Megumi n</title>
    <description>The latest articles on DEV Community by Megumi n (@atomiccninja).</description>
    <link>https://dev.to/atomiccninja</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%2F4270319%2F0f9ade88-5427-40f7-8d23-09ce59d82722.jpg</url>
      <title>DEV Community: Megumi n</title>
      <link>https://dev.to/atomiccninja</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/atomiccninja"/>
    <language>en</language>
    <item>
      <title>My AI Wrote a Bug That Would Have Let Strangers Fake Your Safety Check-In</title>
      <dc:creator>Megumi n</dc:creator>
      <pubDate>Sat, 28 Nov 2026 10:06:34 +0000</pubDate>
      <link>https://dev.to/atomiccninja/my-ai-wrote-a-bug-that-would-have-let-strangers-fake-your-safety-check-in-1g16</link>
      <guid>https://dev.to/atomiccninja/my-ai-wrote-a-bug-that-would-have-let-strangers-fake-your-safety-check-in-1g16</guid>
      <description>&lt;p&gt;It's 6:41 PM on Halloween. Maya is somewhere on Blackwood Ridge. Her phone shows no service.&lt;/p&gt;

&lt;p&gt;At home, Mom's phone shows nothing either. Every app they own died the second the signal did.&lt;/p&gt;

&lt;p&gt;That's the moment I built for. Afterlife Kit is an open-source skeleton for apps that keep living when the network dies. I built it for #Kiroween with Kiro, a spec-driven AI IDE. This is the story of the four bugs the AI wrote, and how the specs caught every one before a user ever could.&lt;/p&gt;




&lt;h2&gt;
  
  
  🪦 The idea: the network is optional
&lt;/h2&gt;

&lt;p&gt;Most apps treat the server as the truth and your phone as a window onto it. Lose the window and you lose everything.&lt;/p&gt;

&lt;p&gt;Afterlife Kit flips that: &lt;strong&gt;the device is the truth.&lt;/strong&gt; Every change is written to an operation log on the phone (IndexedDB) the instant you tap. When &lt;em&gt;any&lt;/em&gt; phone catches a bar of signal, the changes travel through a ~100-line relay and merge on every other phone.&lt;/p&gt;

&lt;p&gt;Two very different apps run on the same skeleton:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;🦇 &lt;strong&gt;Ghost Trail&lt;/strong&gt;
&lt;/th&gt;
&lt;th&gt;🕯️ &lt;strong&gt;Ledger After Dark&lt;/strong&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Group safety check-ins for no-signal hikes&lt;/td&gt;
&lt;td&gt;Credit ledger for corner shops&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Real topo map, downloaded for offline use&lt;/td&gt;
&lt;td&gt;Photo receipts on every entry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overdue alarm on every synced phone&lt;/td&gt;
&lt;td&gt;Reminders on SMS, WhatsApp, LINE, WeChat&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Every check-in signed by the phone's own key&lt;/td&gt;
&lt;td&gt;10 languages, Arabic and Urdu right-to-left&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&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%2F6ko3jnfj07gaqxwexuod.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%2F6ko3jnfj07gaqxwexuod.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧪 How Kiro builds: specs first, vibes never
&lt;/h2&gt;

&lt;p&gt;I didn't start in a chat box. I started in:&lt;br&gt;
.kiro/&lt;br&gt;
├── steering/   product.md · tech.md · structure.md   ← the rules every agent run follows&lt;br&gt;
├── specs/&lt;br&gt;
│   ├── sync-core/    requirements (EARS) · design · tasks&lt;br&gt;
│   └── ghost-trail/  requirements (EARS) · design · tasks&lt;br&gt;
└── hooks/      tests on save · typecheck on stop · secret guard · boundary review&lt;/p&gt;

&lt;p&gt;Requirements are written in EARS, so they're testable sentences:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;WHEN now &amp;gt; the next checkpoint's ETA + 15 min grace **THE SYSTEM SHALL&lt;/em&gt;* mark the member overdue.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The design turns those into &lt;strong&gt;correctness properties&lt;/strong&gt;, and each property becomes a &lt;a href="https://fast-check.dev" rel="noopener noreferrer"&gt;fast-check&lt;/a&gt; test that throws hundreds of random histories at the code.&lt;/p&gt;

&lt;p&gt;Then I let Kiro's agent loose, headless, on a cheap model, one spec phase per run. A hook re-ran the property tests on every file save, and another blocked the agent from finishing while the types were broken.&lt;/p&gt;

&lt;p&gt;The agent's code passed every example test. The properties did not pass.&lt;/p&gt;


&lt;h2&gt;
  
  
  💀 Bug 1: two phones, one timestamp
&lt;/h2&gt;

&lt;p&gt;The hybrid logical clock (HLC) is the heartbeat of the merge. Kiro's version could hand two phones the &lt;strong&gt;same timestamp&lt;/strong&gt;, so a merge could silently pick the wrong value.&lt;/p&gt;

&lt;p&gt;One property, &lt;em&gt;"receive always produces a clock strictly greater than both inputs"&lt;/em&gt;, failed in three steps. The fix was the textbook HLC receive rule.&lt;/p&gt;
&lt;h2&gt;
  
  
  💀 Bug 2: the late phone gets ghosted
&lt;/h2&gt;

&lt;p&gt;This one scared me. Three replicas, one with a clock 3 ms behind:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;replica 2 writes + pushes → replica 0 pulls (cursor jumps ahead)
replica 1 writes (older clock) + pushes → replica 0 pulls → never sees it 💀
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The relay was paging by the &lt;em&gt;phones'&lt;/em&gt; clocks. The phone that was offline the longest (the exact user this kit exists for) lost its edits. The spec said to key batches by &lt;strong&gt;server arrival time&lt;/strong&gt;. The property made the gap impossible to miss.&lt;/p&gt;

&lt;h2&gt;
  
  
  💀 Bug 3: overdue while on time
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CP0 at 11:00, CP1 at 12:00. Hiker checks in at CP0 at 11:00. On time.
now = 11:12 → "OVERDUE" 🦇🦇🦇
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent measured lateness from the &lt;em&gt;last check-in&lt;/em&gt;, not the &lt;em&gt;next checkpoint's ETA&lt;/em&gt;. Every hiker would have triggered a bat-swarm alarm 15 minutes after every check-in. Kiro's own seven properties passed. Three more properties written straight from the requirement text failed instantly.&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%2Fdafakx63jv3cwu21rw87.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%2Fdafakx63jv3cwu21rw87.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  💀 Bug 4: the impersonation hole
&lt;/h2&gt;

&lt;p&gt;Requirement 5 says &lt;strong&gt;"Only you can check in as you."&lt;/strong&gt; Kiro implemented ECDSA signatures and five properties, all green.&lt;/p&gt;

&lt;p&gt;I added a sixth: &lt;em&gt;a check-in is valid only if the signing key belongs to that member id.&lt;/em&gt; It failed immediately. Ids were random, so anyone who could edit the shared member list could swap their own public key under Maya's id and sign "I'm OK" &lt;strong&gt;as her&lt;/strong&gt;. On a safety app.&lt;/p&gt;

&lt;p&gt;The fix: make ids self-certifying.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id = base64url(SHA-256(`${crv}:${x}:${y}`)).slice(0, 22)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap the key and you're out. Every phone checks it before trusting a signature.&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%2Fs41thyztuiaaev8nhk8a.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%2Fs41thyztuiaaev8nhk8a.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🎃 And then I made it spooky
&lt;/h2&gt;

&lt;p&gt;Because it's Kiroween:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🕷️ Spiders you can pull, candles you blow out, ghosts you poke&lt;/li&gt;
&lt;li&gt;⚡ Jump-scare page transitions with a rotating cast: bats, lightning, fog, eyes&lt;/li&gt;
&lt;li&gt;🔊 &lt;strong&gt;Zero audio files.&lt;/strong&gt; Every whoosh, organ stab and bat squeak is synthesized live with Web Audio&lt;/li&gt;
&lt;li&gt;🌙 A topo map with a GPU night mode, plus sunset and weather that survive offline&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&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%2Fv0inoij57sun5bt2okct.png" alt=" " width="800" height="450"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  🧠 What I learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cheap models are great typists and bad skeptics.&lt;/strong&gt; They implement exactly what the design says and never notice what it forgot to say.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write properties from the requirements, not the code.&lt;/strong&gt; All four bugs passed tests derived from the implementation, and all four failed tests derived from the spec.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hooks are guardrails for headless agents.&lt;/strong&gt; "Typecheck before you're allowed to stop" saved more turns than any prompt.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The whole thing (sync engine, two apps, 40 tests, 29 property checks) ran on Kiro's free credits. The specs did the thinking, so the model only had to type.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built for #Kiroween 2026 (Skeleton Crew). Map data © OpenStreetMap contributors, OpenTopoMap.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Seems like you missed something this Halloween</title>
      <dc:creator>Megumi n</dc:creator>
      <pubDate>Sat, 28 Nov 2026 09:37:59 +0000</pubDate>
      <link>https://dev.to/atomiccninja/seems-like-you-missed-something-this-halloween-14l4</link>
      <guid>https://dev.to/atomiccninja/seems-like-you-missed-something-this-halloween-14l4</guid>
      <description>

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo438r726bd3r8hqz70gd.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo438r726bd3r8hqz70gd.gif" alt=" " width="720" height="405"&gt;&lt;/a&gt;&lt;a href="https://dev.tourl"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kiro</category>
      <category>kiroween2026</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
