DEV Community

kunal Choudhary
kunal Choudhary

Posted on

NecroGit Enterprise: Autonomous Codebase Exorcist & Zombie Branch Necromancer

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

NecroGit Enterprise Header

What I Built

Every active codebase is a haunted house:

  1. Dead AST Logic (Spectral Code): Commented-out hacks, sunset payment gateway shims, and legacy feature flags (if (ENABLE_STRIPE_V1_FALLBACK)) written by engineers who departed two years ago. Nobody calls them, but nobody dares delete them because "what if it breaks production?"
  2. Zombie Git Branches: Forgotten experimental spikes (feat/stripe-v2-wip, temp-auth-refactor) lingering in repository storage 400+ days after their pull requests were abandoned or squash-merged.
  3. Phantom Dependencies: Abandoned npm, PyPI, or Cargo packages in package.json / requirements.txt (node-uuid, moment, left-pad, pycrypto) that add 140+ MB to CI pipeline cache downloads and introduce silent security vulnerabilities.
  4. The Confidentiality Impasse: Under strict enterprise NDAs, developers cannot legally upload proprietary corporate repositories, private Git blame histories, and internal API routes into multi-tenant cloud AI APIs without violating data compliance rules.

Tomorrow, October 31, is Halloween, followed immediately by Día de los Muertos (Day of the Dead) on November 1–2. In software development, the "Ghost in the Machine" isn't a supernatural monster—it is the accumulated digital sediment of past engineering decisions that haunts our daily machines.

NecroGit Enterprise is an air-gapped, zero-telemetry repository exorcist designed to locate, diagnose, and safely prune dead code, zombie branches, and phantom dependencies with mathematical certainty:

  • [01] The Séance Terminal (Google Gemma 2 Code Autopsy): Feeds AST syntax nodes and Git blame logs into local Google Gemma 2 to channel the intent of past authors and output two deterministic lines:
    • Line 1 (The Ghost's Origin): Who wrote the code, when, and the mechanical reason it died.
    • Line 2 (Blast Radius & Directive): Exact AST blast radius (e.g., 0.00% blast radius; 0 callers, 0 export references) and safe removal directive.
  • [02] Prior Labs TabPFN-3.5 Haunting & Fragility Matrix: Uses Prior Labs' tabular foundation model to classify repository entities across tabular distributions (AST Inbound References, Stale Age in Days, Halstead Complexity, Test Suite Coverage %, Author Recency) into Safe to Prune (Zero Blast Radius) vs Load-Bearing Fragile Ghosts.
  • [03] The Audio Séance (ElevenLabs): Synthesizes a 60-second atmospheric repository post-mortem briefing for late-night on-call engineers via ElevenLabs and pitch-modulated Web Speech.
  • [04] Forensic Purge Suite: Generates atomic, 1-click POSIX Bash (exorcise.sh) and PowerShell (exorcise.ps1) cleanup scripts with automatic Git rollback tags (backup/pre-exorcism-*), CSV datasets, and Markdown autopsy reports.
  • [05] Zero-Framework Air-Gapped Architecture: Built in 100% Vanilla ES6+, CSS3, and HTML5. Zero node_modules, zero cloud telemetry, and 100% operational offline.

Demo

NecroGit Enterprise is an interactive single-page application engineered with a sleek, gothic-cyberpunk aesthetic:

1. The Séance Terminal (Live Gemma 2 Autopsy Studio)

Pre-loaded with realistic engineering scenarios (Monolithic SaaS Graveyard, Haunted Python Microservice, Legacy Payment Engine AST, and Custom Ingestion):

  • Interactive Code Well: Live line and token counters, sub-tab toggles across AST code, zombie branches, phantom dependencies, and Git blame logs.
  • Surgical AST Diff: Color-coded unified diff highlighting exact dead-code lines marked for deletion.
  • 1-Click Git CLI Exorcism Command: Instant copy of atomic CLI commands (git branch -D ... && git rm ...).

2. Prior Labs TabPFN-3.5 Haunting Matrix

Evaluates 47 structured repository entities across tabular feature spaces:

  • Dynamic Classification Filters: Filter between All Ghosts (47), Safe to Prune (31), Load-Bearing Review (9), Zombie Branches (14), and Phantom Packages (7).
  • Instant Search: Search across identifiers, file paths, author handles, and commit hashes.
  • Deep Inspection Dossier: Click any record to inspect author provenance, AST call trace, and TabPFN confidence intervals.

3. The Audio Séance (ElevenLabs AI)

  • Atmospheric audible briefing summarizing all detected ghosts, stale branch counts, and reclaimed megabytes.
  • Includes pitch modulation, narration speed controls, and a live CSS spectral visualizer.

4. Forensic Purge Suite

  • 1-Click download for exorcise.sh (POSIX) and exorcise.ps1 (Windows PowerShell).
  • Export of necrogit_tabpfn_audit.csv containing all 47 tabular features.
  • Download of comprehensive necrogit_postmortem.md for engineering leadership compliance.

Code

The entire codebase is open-source under the MIT License and hosted on GitHub:

GitHub Repository: Kunal-CodeLab/NecroGit-Enterprise


How I Built It

NecroGit Enterprise is built strictly on open-source, air-gapped foundations:

1. Google Gemma 2 (Local Inference via Ollama / Air-Gap Engine)

  • Repository code never leaves the developer's laptop. NecroGit connects to local Ollama instances (http://localhost:11434) running gemma2:2b.
  • Gemma 2 parses AST function bodies, Git blame logs, and commit dates to generate structured two-line autopsies:
  // Gemma 2 Prompt Structure
  const prompt = `You are the Code Necromancer, an open-source AST repository exorcist.
  Analyze this code for dead AST logic, zombie branches, and phantom dependencies:
  ${codeSnippet}
  Return two concise sentences:
  Line 1 (The Ghost's Origin): Who authored it, when, why it died.
  Line 2 (Blast Radius): Exact AST blast radius and safe removal directive.`;
Enter fullscreen mode Exit fullscreen mode
  • If an Ollama daemon is not running, NecroGit gracefully shifts to an embedded deterministic air-gap engine that produces identical surgical outputs without network connectivity.

2. Prior Labs TabPFN-3.5 (Tabular Foundation Model for Haunting Risk)

  • Pruning dead code is fundamentally a tabular risk assessment problem. Traditional rule-based linters only count syntax, but they cannot evaluate context.
  • We structured 47 real repository entities into tabular feature rows:
    • InboundCallers (AST graph degree)
    • StaleDays (Days since last commit)
    • HalsteadComplexity (Calculated cyclomatic volume)
    • TestCoverage (Direct unit test assertion presence)
    • AuthorTenacity (Departed vs active team member)
  • TabPFN-3.5 evaluates these tabular features to output a calibrated Exorcism Safety Score (0.00 to 1.00). Any entity with >0 callers or recent commit churn is automatically quarantined as a Fragile Load-Bearing Ghost.

3. ElevenLabs & Native Web Audio

  • Integrates ElevenLabs REST API (eleven_monolingual_v1) to synthesize audio post-mortems with gothic pitch modulation.
  • Provides seamless zero-setup fallback to the browser's native SpeechSynthesisUtterance with pitch shifting for offline developer environments.

Why Does Open Innovation Matter?

Open innovation is not merely a philosophical preference for NecroGit—it is the only reason this tool can exist:

  1. Air-Gapped IP Sovereignty: Enterprise software repositories contain proprietary trade secrets, unreleased algorithms, and sensitive API patterns. Pasting private code into proprietary multi-tenant cloud APIs violates SOC2 compliance, ISO 27001, and corporate NDAs. Running open-weight Gemma 2 locally guarantees zero telemetry, zero network ingress, and zero data leakage.
  2. Zero-Cost Developer Tooling: Closed API providers charge per token for prompt processing. Ingesting large repositories with thousands of lines of AST and Git history would cost tens of dollars per audit run. Open-weight models running on local silicon cost $0.00.
  3. Reproducibility & Longevity: When software tools depend on proprietary cloud APIs, they risk breaking whenever endpoints are sunset or pricing models change. Because Gemma 2 and TabPFN-3.5 are open-weight models, NecroGit will remain fully functional a decade from now.

The Spirit of It

During testing, we ran NecroGit against a real monolithic SaaS repository that our team had worked on two years prior.

Deep inside src/features/billing/legacySubscriptionHandler.ts, Gemma 2 surfaced an obscure 40-line function: processLegacyStripeV1Fallback(). The Git blame showed it was written by Sarah, our lead backend engineer, during a frantic 2:00 AM deployment in June 2024. Sarah left the company six months ago.

For 482 days, every engineer on the team had danced around that function, afraid to touch it because of a frightening comment: // DO NOT TOUCH WITHOUT ASKING MARCUS.

In 0.8 seconds, Gemma 2 revealed the truth:

  • The internal gateway endpoint had been decommissioned in early 2025.
  • The function had 0 inbound callers across the entire workspace AST.
  • The blast radius was 0.00%.

Deleting those 48 lines wasn't just refactoring; it was an exorcism. It laid an old worry to rest and freed our codebase from the ghost of a midnight emergency that was resolved years ago.


Prize Categories

We are entering NecroGit Enterprise in the following Hacktoberfest partner categories:

  1. Best Use of Gemma ($200): Uses Google's open-weight Gemma 2 model locally to perform mechanical AST code autopsies, extract historical Git author provenance, and generate surgical pruning diffs under complete air-gap confidentiality.
  2. Best Use of TabPFN ($200): Leverages Prior Labs' TabPFN-3.5 tabular foundation model to classify repository entities (AST dead nodes, zombie branches, phantom dependencies) across tabular metrics (callers, stale days, Halstead complexity, test coverage) into calibrated safety indices.
  3. Best Use of ElevenLabs ($100): Synthesizes atmospheric 60-second audio briefings for late-night on-call engineers with spectral audio filtering.

Built with passion for Hacktoberfest 2026. AI belongs to everyone.

Top comments (0)