<?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: Junky Jami</title>
    <description>The latest articles on DEV Community by Junky Jami (@musicbeatz20072023).</description>
    <link>https://dev.to/musicbeatz20072023</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%2F4179023%2F5f566831-318b-4d7b-b29e-4ed1a21ca7e2.png</url>
      <title>DEV Community: Junky Jami</title>
      <link>https://dev.to/musicbeatz20072023</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/musicbeatz20072023"/>
    <language>en</language>
    <item>
      <title>grave: I Gave Every Dead Process on My Machine an Epitaph</title>
      <dc:creator>Junky Jami</dc:creator>
      <pubDate>Thu, 29 Oct 2026 14:47:16 +0000</pubDate>
      <link>https://dev.to/musicbeatz20072023/grave-i-gave-every-dead-process-on-my-machine-an-epitaph-l95</link>
      <guid>https://dev.to/musicbeatz20072023/grave-i-gave-every-dead-process-on-my-machine-an-epitaph-l95</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week4-2026-10-26"&gt;Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Programs die on my machine constantly and nobody notices. A segfault scrolls off the screen. A &lt;code&gt;kill&lt;/code&gt; goes through. The only record is a number in &lt;code&gt;$?&lt;/code&gt; that I will never look at again.&lt;/p&gt;

&lt;p&gt;So I built &lt;code&gt;grave&lt;/code&gt;, a small wrapper that treats those deaths as worth remembering.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;grave ./myprogram
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the program exits cleanly, &lt;code&gt;grave&lt;/code&gt; says nothing. If it dies, a local Gemma model writes its epitaph using only the facts of its death. Then you can hold a séance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;grave seance &lt;span class="s2"&gt;"who killed you?"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The most recent ghost answers from its own record. If the record doesn't say, it's supposed to admit it doesn't remember.&lt;/p&gt;

&lt;p&gt;It's 99 lines of C++ and does one thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;VIDEO_LINK_HERE&lt;/p&gt;

&lt;p&gt;The video is recorded with the Wi-Fi off. First a segfault, then the séance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;./grave ./crash
OUTPUT_1_HERE

&lt;span class="nv"&gt;$ &lt;/span&gt;./grave seance &lt;span class="s2"&gt;"who killed you?"&lt;/span&gt;
OUTPUT_2_HERE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;REPO_URL_HERE&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The wrapper forks and execs your command, pipes its stderr to keep its last words, and calls &lt;code&gt;wait4&lt;/code&gt; for the exit status, the killing signal, and peak memory. A clean exit is silent. Anything else becomes a fact sheet: name, seconds alive, exit code or signal, peak memory, last words.&lt;/p&gt;

&lt;p&gt;The fact sheet goes to Gemma (&lt;code&gt;gemma3:4b&lt;/code&gt;) through Ollama with one rule:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a 3 sentence epitaph for a dead process. Use ONLY these facts. Do not invent a cause of death or any detail not listed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One design decision came from testing. My first version stored the epitaphs in the same file the séance reads. That means a hallucinated epitaph would later be quoted back as fact. So the graveyard (&lt;code&gt;~/.graveyard&lt;/code&gt;) holds facts only, epitaphs live in a separate file (&lt;code&gt;~/.graveyard.epitaphs&lt;/code&gt;), and the séance only ever sees the facts of the most recent death.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limits.&lt;/strong&gt; A 4B model can still embellish no matter what the prompt says. That's why the facts and the epitaphs are kept in separate files: you can always check what the model was told against what it wrote. &lt;code&gt;grave&lt;/code&gt; also only sees what it launches, not every death on the system. And a process's stderr goes straight into the prompt, so a hostile program could write instructions into its own last words. The exit status prints first and the epitaph follows, because a local model on a laptop is not instant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;A dead process's last words are rarely harmless. They carry file paths, usernames, hostnames, and half a stack trace. I wasn't willing to send that to a server I don't control just to get a sad sentence back.&lt;/p&gt;

&lt;p&gt;With an open-weight model, the demo runs with the Wi-Fi off, which the video shows. Nothing leaves the machine, and it costs nothing per death. Swapping models is one environment variable, &lt;code&gt;GRAVE_MODEL&lt;/code&gt;, so when a better small model ships, nothing in the code changes.&lt;/p&gt;

&lt;p&gt;A closed API could write the same epitaph. It couldn't do it offline, privately, and for free.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Spirit of It
&lt;/h2&gt;

&lt;p&gt;The first thing I buried was a program I wrote to crash on purpose. It allocated 50 MB, touched every page, then dereferenced a null pointer. I knew exactly how it would die, and I still read the epitaph like it was news.&lt;/p&gt;

&lt;p&gt;This is what came back:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;EPITAPH_HERE&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then I asked the dead process who killed it. It could only answer from its record, and the record says one thing: signal 11, a segmentation fault. No murderer, just a pointer that pointed nowhere.&lt;/p&gt;

&lt;p&gt;That's what stuck with me. Every crash I've ever had was this specific and this unremarkable, and I scrolled past all of them. Something should at least say a few words.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;Best Use of Gemma&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
