DEV Community

Dien
Dien

Posted on

PhantomTerminal AI — Ghost in the Machine: Code Séances & Día de los Muertos Altar

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


What I Built

As October draws to a close, we arrive at the threshold of Halloween and Día de los Muertos—a stretch of the calendar where the boundary between past and present grows thin.

In software, our machines are constantly haunted:

  • Legacy codebases harbor "zombie functions" that were written a decade ago and are never called.
  • Modern frameworks consume gigabytes of memory to render simple forms, completely oblivious to the hardware constraints our computing forebears conquered.
  • Deceased digital technologies—from Adobe Flash to the 3.5" Floppy Disk—vanish into obsolescence without a proper memorial.

I built PhantomTerminal AI: a retro CRT terminal combining dead-code archeology, spectral historical séances, and a digital Día de los Muertos altar, running on 100% open-weight AI and zero external Python dependencies.

Key Capabilities:

  1. ⚰️ Dead Code Exorcist: Parses source code with Python's built-in ast syntax tree. Detects zombie functions, dangling unused imports haunting the namespace, and unreachable code past terminal statements. Computes a Haunted Entropy (%) score and outputs ritual steps to exorcise the codebase.
  2. 🔮 The Spectral Code Séance: Summons the ghosts of computing history—Commander COBOL (1959), The 6502 Assembly Phantom (1975), Grandmaster ALGOL 68, and Lady Ada Lovelace (1843). Feed them your modern code or architectural dilemmas, and they respond with sharp, historically grounded, and witty critiques via Google's Gemma AI model.
  3. 🕯️ Día de los Muertos Tech Ofrenda: A digital sanctuary honoring departed technologies (Adobe Flash Player, Internet Explorer 6, AngularJS 1.x, Floppy Disks, and Winamp). Users can place memories, light digital candles, scatter cempasúchil marigolds, and receive a poetic memorial epitaph.
  4. 🔊 Spectral Theremin Drone (Web Audio API): Synthesizes a haunting microtonal beating drone directly in your browser using pure JavaScript and the Web Audio API—zero external audio assets or network requests.

Demo

You can also run it locally in seconds with zero pip installs:

git clone https://github.com/dieennn/hacktoberfest-2026.git
cd hacktoberfest-2026
python main.py
# Open http://localhost:8080/week-4/
Enter fullscreen mode Exit fullscreen mode

Code

The entire codebase is open-source and cleanly modularized in the unified Hacktoberfest 2026 monorepo:

GitHub logo dieennn / hacktoberfest-2026

🎃 Hacktoberfest 2026 — DEV Challenges Monorepo

🎃 Hacktoberfest 2026 — DEV Challenges Monorepo

Repository containing project submissions for the Hacktoberfest 2026 DEV Challenges ("AI belongs to everyone").
Built by @dieennn.


📁 Repository Structure










































Round Challenge Theme Folder / Project Status

Launch Weekend (Oct 2 - Oct 5)
Build for a Friend 00-weekend-allergy-guard ✅ Completed

Week 1 (Oct 5 - Oct 12)
Touch Grass 01-week-1 ✅ Completed

Week 2 (Oct 12 - Oct 19)
Side Hustle 02-week-2 ✅ Completed

Week 3 (Oct 19 - Oct 26)
Slow and Steady 03-week-3 ✅ Completed

Week 4 (Oct 26 - Nov 1)
Ghost in the Machine 04-week-4 ✅ Completed


🚀 Projects Overview

00-weekend-allergy-guard — Allergy & Diet Guard (SafeBite AI)

  • Theme: Build for a Friend
  • Problem: Protect friend Sarah (severe peanut allergy, celiac disease, and lactose intolerance) from hidden allergens (arachis oil, seitan, casein) and cross-contamination when eating out.
  • Tech: Local Python…

Directory: 04-week-4/


How I Built It

1. Pure Standard Library AST Exorcism

Instead of relying on heavy third-party linters or external bloat, PhantomTerminal uses Python 3's built-in ast module. It traverses abstract syntax trees to identify:

  • Imports whose symbols are never loaded in subsequent AST nodes.
  • Top-level function definitions absent from all Call nodes.
  • AST statements nested after Return or Raise triggers.

2. Google Gemma Open-Weight Model Bridge

The séance channel and ofrenda epitaph generator bridge to local Google Gemma models (gemma2:2b) running on-device via Ollama (http://localhost:11434). It generates historical persona responses with sub-second latency and zero cloud token fees.

3. Bulletproof Offline Graceful Fallback

When running completely disconnected with the lights off, the engine seamlessly switches to deterministic spectral knowledge matrices. It never crashes or throws runtime connection errors.

4. Zero-Asset Client-Side Theremin Drone

Instead of shipping bulky .wav or .mp3 files, the eerie ambient background drone is generated algorithmically via a pair of phase-beating sine oscillators using the browser's native Web Audio API in under 15 lines of code.


Why Open Innovation Matters

  1. Working with the Lights (and Internet) Off: A spooky Halloween terminal shouldn't need an active Wi-Fi connection or a cloud credit card to commune with code history. Open-weight models empower projects to function completely offline on local machines.
  2. Preserving History Without Vendor Erasure: When cloud services shut down, their proprietary models and memories disappear forever. Open weights ensure that digital artifacts and historical tributes remain accessible and reproducible in perpetuity.
  3. Private Source Code Inspections: Proprietary code submitted for debugging or audit should never be harvested by cloud telemetry vendors. Running local open models keeps private logic strictly inside your machine.

Prize Categories

  • Hacktoberfest Open-Source AI Challenge: Week 4 (Theme: Ghost in the Machine)
  • Best Use of Render: Deployed as the grand finale of a 5-app unified Python gateway running on Render's free tier.
  • Best Use of Gemma: Channeled historical computing spirits and crafted Día de los Muertos ofrenda tributes using Google's Gemma open-weight model family.

Top comments (0)