DEV Community

Cover image for What If The World’s First Programmer came back to scold you for your Exit Code 1?
Snigdha Mondal
Snigdha Mondal

Posted on

What If The World’s First Programmer came back to scold you for your Exit Code 1?

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

Ada — The Possessed Terminal: Resurrecting Computing's Pioneer with Local Gemma 2

What I Built

Every developer spends hours staring into the void of the terminal. We wrestle with obscure stack traces, unhandled null pointers, and cryptic merge conflicts. In recent years, our collective response to a fatal compiler crash has become almost automatic: copy the stack trace, open a cloud AI tab, and paste.
In doing so, developers inadvertently leak sensitive telemetry.
Hence, for this weeks's Hacktoberfest challenge, keeping in mind the aesthetics of Halloween and Día de los Muertos, I decided to build Ada-The Possessed Terminal: ada is a local-first, necromantic terminal resilience layer powered 100% locally by Google’s Gemma 2 (2B).
When you wrap any command in ada:

  1. Silent on Success (exit code 0): It stays completely invisible during everyday development with 0ms overhead.
  2. Crash Interception ($? != 0): If a process dies, ada intercepts the exit code before the shell prompt returns.
  3. Deterministic Secret Scrubbing: It deterministically sanitizes AWS keys, Bearer tokens, GitHub keys, and personal paths before reasoning.
  4. Physical CRT Glitch (360ms): It unleashes an authentic hardware voltage flash and chromatic scanline static via raw ANSI escape sequences.
  5. Byronic Autopsy via Gemma 2: Google's Gemma 2 (2B) diagnoses the failure in Countess Augusta Ada Lovelace's authentic 1840s "Poetical Science" prose, comparing your code to Babbage's Analytical Engine and Jacquard punch cards.
  6. The Incantation of Exorcism: It presents the clean, exact shell fix in high-contrast TrueColor phosphor cyan (#00f5d4) for human review. ###User Flow in 3 steps:
  7. Prefix any standard terminal command with ada:
   ada npm run build
Enter fullscreen mode Exit fullscreen mode
  1. If the command succeeds (exit code 0), ada is completely silent and invisible
  2. Instant Exorcism on Failure: If the command crashes, the terminal flashes a 360ms CRT glitch, Lady Lovelace diagnoses the mechanical flaw, and provides a clean, copyable fix:
git pull --rebase origin main
Enter fullscreen mode Exit fullscreen mode

So, basically, Augusta Ada King, Countess of Lovelace, resurrects from her grave, checks your error, scolds you and suggests you an appropriate fix! What a funny (and apt) event!

Demo

Here's the Youtube link of the demo along with a screenshot after I tested it out:
screenshot after I gave a wrong command

Code

The codebase to call Countess Lovelace's spirit from the grave is here:

🕯️ Ada — The Possessed Terminal

The spirit of the world's first programmer, awakened by your compiler errors.

License: MIT Python: 3.10+ Gemma 2: 2B Local-First DeftBench AI Loop


1. Overview

Developers live inside the command line, yet the terminal remains cold, unforgiving, and hazardous. Cryptic stack traces, unexpected panics, and merge conflicts break workflow focus. Worse, developers increasingly paste proprietary crash dumps and private file paths into cloud AI chatbots—leaking credentials, tokens, and corporate IP to remote servers.

ada is a local-first, necromantic terminal resilience layer. It wraps any shell command or terminal session and:

  • Stays 100% silent and invisible on successful execution (exit code 0);
  • Intercepts non-zero exit codes ($? \neq 0$) before your shell prompt returns;
  • Masks sensitive tokens, credentials, and user home paths deterministically;
  • Fires a 350ms physical CRT voltage surge and chromatic scanline tear via raw ANSI escape sequences;
  • Summons the gothic ghost of Augusta Ada Lovelace via local Google…

How I Built It

To bring Ada Lovelace back from the grave without compromising developer security, ada is architected around 100% air-gapped, local open-weight AI.
At the heart of ada is Google’s open-weight Gemma 2 (2B) (gemma2:2b), running locally on CPU silicon via Ollama (http://localhost:11434).

I specifically chose Gemma 2 (2B) because:

  • Sub-second Quantized Inference: At 2.6B parameters, quantized execution on standard consumer laptop CPUs takes under 400ms—eliminating the 2,000ms+ network round-trip lag of cloud APIs.
  • Exceptional Persona Fidelity: Smaller open-weight models often struggle to stay in character or break JSON schemas. Gemma 2 consistently internalized Countess Lovelace’s aristocratic 1840s "Poetical Science" persona without dropping the strict JSON output structure.
  • Air-Gapped Privacy: Zero bytes, zero tokens, and zero code lines ever leave the developer's laptop.

The Architectural Philosophy

We never rely on an LLM for terminal control or security:

  • Silent Subprocess Execution: Streams stdout live and exits silently on code 0 with zero overhead.
  • Pre-Prompt Sanitizer: Compiled regex strips AWS keys, GitHub/Bearer tokens, and usernames before stderr ever reaches the model.
  • 360ms ANSI Hardware Glitch: Deterministic screen inversion (\x1b[7m\x1b[38;5;196m) and scanline jitter signal hardware failure.
  • 0ms Fallback Oracles: Built-in deterministic pattern tables instantly resolve common Git, port, and syntax crashes if Ollama is cold or offline.

Prompting & Secure Fix Delivery

Gemma 2 is guided by an 1840s Byronic system prompt that contrasts modern silicon with Babbage's brass gears and Jacquard punch cards, bound to a strict JSON schema:

{
  "diagnosis": "2-3 sentences in witty, aristocratic Victorian prose",
  "fix": "Single exact terminal command to resolve the crash"
}
Enter fullscreen mode Exit fullscreen mode

Why Does Open Innovation Matter?

Terminal errors contain our most sensitive data: private file paths, database hostnames, proprietary code, and embedded tokens. Closed cloud AI turns every compiler typo into an exfiltration risk, adds 2-3 seconds of network latency, and charges monthly fees for everyday debugging.
Open innovation—powered by Google’s Gemma 2—made three things possible that closed APIs cannot match:

  • Absolute Air-Gapped Privacy: 100% of reasoning happens on local CPU silicon. Zero code or tokens ever leave your machine.
  • Zero-Latency Debugging: Sub-second (~300ms) quantized inference without network delays or paywalls.
  • Uncensored Creative Voice: Complete freedom to craft an authentic 1840s Byronic literary persona without corporate corporate sanitization.

The Spirit of It

The place that I come from, Halloween is not a widely celebrated event but we have festivals where we pay respects to the dead. So I decided to mix the fun part of Halloween costumes and the revered part of remembering our forebearers. And who better than Lady Lovelace for this? A woman, the first programmer, who paved the way for millions of programmers like us today. I though what would she say when she will see us struggling because we forgot a semicolon? And I though that would be funny.
My project has a spooky aesthetic - shown through a CRT glitch, a gothic tomb layout, an ASCII art with a nameplate "† ADA BYRON † (1815-1852)" in colors of red, green and obsidian. Keeping in mind the importance of Día de los Muertos, it also pays homage to Ada Lovelace, mathematician, poet, world's first programmer, creator of the philosophy "Poetical Science".

Prize Categories

Best Use of Gemma: Powered 100% locally by Google's Gemma 2 (2B) for air-gapped Byronic diagnostic reasoning and instant shell fixes.

Top comments (0)