DEV Community

Ravi Jaipal
Ravi Jaipal

Posted on

GitGeist ๐Ÿ‘ป: The Ghost in the Machines and more

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission ๐Ÿ‘ป๐ŸŒผ

*# GitGeist: The Ghost in the Machine ๐Ÿ‘ป | Offline-First AI for Haunted Git Histories

Built for the Hacktoberfest Open-Source AI Challenge โ€” Week 4: Ghost in the Machine.

Every codebase has a haunted corridor.

It's that one file containing a mysterious time.sleep(0.666), a forgotten workaround, or a comment that says: // temporary fix โ€” DO NOT TOUCH.

You run git blame to investigate, only to discover the most frightening answer in software engineering: the ghost is you, from three years ago.

But old code isn't always something to fear. Legacy functions, retired modules, and forgotten commits often tell the story of the people and decisions that kept our software running.

That inspired me to build GitGeist โ€” an offline-first Haunted Git Sรฉance and Digital Code Ofrenda that combines AI-powered code archaeology with a Halloween-inspired experience and a tribute to retired code.

The project brings together two open-weight AI models running locally: Prior Labs' TabPFN for tabular risk forecasting and Google's Gemma 3, through Ollama, for grounded explanations of Git history.

The goal is simple: investigate suspicious commits, understand their context, and keep private repository data on your own machine.

๐Ÿ”ฎ What I Built

GitGeist combines three main features.

1. The TabPFN Haunting Forecaster

The forecaster analyses Git and system telemetry, including:

  • Commit time and late-night activity
  • Lines changed and files touched
  • Cyclomatic complexity changes
  • Days since a file was last modified
  • Test coverage signals
  • CPU thermal telemetry

It produces a Haunting Risk Score, an estimated 10โ€“90% range, and the signals contributing to the forecast.

2. The Haunted Terminal Sรฉance

Using Google Gemma 3 locally through Ollama, GitGeist turns commit metadata into an understandable explanation of suspicious code.

It can reference the commit hash, author, timestamp, and forecast supplied by the risk engine. The aim is to help developers investigate why a workaround may exist before deleting it.

If Ollama is unavailable, a deterministic fallback can still format the available metadata.

3. The Digital Code Ofrenda ๐ŸŒผ

Inspired by Dรญa de los Muertos, this feature creates a digital remembrance card for retired code and the maintainers behind it.

Instead of treating deleted functions as disposable leftovers, GitGeist gives developers a creative way to document their history and acknowledge the work that came before.

Who is it for?

  • Developers maintaining legacy codebases
  • Engineers investigating regressions and unusual commits
  • Open-source maintainers exploring repository history
  • Teams that want local AI-assisted code analysis

๐ŸŽฌ Demo

GitGeist is designed to run locally, including on CPU-only systems, without requiring a paid AI API key.

It offers two interfaces:

  • Haunted Terminal CLI: python3 cli.py --preset 0
  • Web interface: python3 run.py, with the interface intended to run at http://localhost:8080

The repository also includes a Dockerfile and a Render Blueprint for deployment.

Live demo: [Add your deployed URL here, if available]

Demo video: [Add your video link here, if available]

๐Ÿ’ป Code and Quick Start

GitHub repository: https://github.com/ravindrajaipal/gitgeist

License: MIT

Clone the repository and install its dependencies:

git clone https://github.com/ravindrajaipal/gitgeist.git
cd gitgeist
pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

Run the tests:

python3 -m unittest discover tests -v
Enter fullscreen mode Exit fullscreen mode

Try the terminal experience:

python3 cli.py --preset 0
Enter fullscreen mode Exit fullscreen mode

Run the telemetry analysis:

python3 scripts/analyze.py
Enter fullscreen mode Exit fullscreen mode

Launch the web interface:

python3 run.py
Enter fullscreen mode Exit fullscreen mode

For model-backed features, follow the repository instructions for installing the required dependencies and configuring Ollama and the model weights.

โš™๏ธ How I Built It

GitGeist separates numerical forecasting from language generation.

The architecture

  1. Git scanner: Extracts repository and commit information.
  2. TabPFN forecaster: Processes tabular telemetry and estimates risk.
  3. Gemma 3 via Ollama: Uses the supplied metadata and forecast to produce a contextual explanation.
  4. Local coordinator and interfaces: Connect the components to the CLI and web UI.
  5. Code Ofrenda: Presents a remembrance experience for retired code.

Why use two different models?

A language model can explain code in natural language, but its prose should not be treated as a calibrated risk estimate.

GitGeist therefore assigns different responsibilities to its components:

  • TabPFN: Tabular forecasting
  • Gemma 3: Natural-language explanations and storytelling
  • Deterministic fallback: Basic output when the local language model is unavailable

The intention is to keep the forecast separate from the generated narrative, making the system easier to inspect and reason about.

๐Ÿงช Testing and Verification

The project includes unit tests for core behaviour, such as:

  • Ensuring the Ofrenda tribute acknowledges the author
  • Checking that the Sรฉance references the expected commit and risk score
  • Testing whether a witching-hour commit increases the forecast in the test scenario

Run the verification suite with:

python3 -m unittest discover tests -v
Enter fullscreen mode Exit fullscreen mode

The repository also contains a telemetry sensitivity analysis script:

python3 scripts/analyze.py
Enter fullscreen mode Exit fullscreen mode

These tests and scripts help make the expected behaviour reproducible. Forecast quality should still be evaluated against suitable labelled data before using risk scores to make production decisions.

๐ŸŒ Why Open Innovation Matters

๐Ÿ” Privacy by design

Git history can contain proprietary implementation details, internal incident notes, and sensitive metadata. Running analysis locally can reduce the need to send repository contents to external AI services.

๐Ÿ“ด Offline-first development

A local workflow is useful when internet access is unreliable or external APIs are unavailable. Once dependencies and model weights are installed, the intended local workflow does not require a cloud AI API.

๐Ÿ” More transparent responsibilities

Separating tabular risk estimation from narrative generation makes it easier to inspect the inputs, examine the outputs, and replace individual components.

๐Ÿ’ธ No per-request cloud AI API bill

Local inference avoids per-request charges from a hosted AI API, although hardware, electricity, storage, and setup still have costs.

Open tools give developers the freedom to experiment, inspect, adapt, and build without being tied to a single hosted provider.

๐Ÿค– My Agent Session

My development workflow focused on three ideas:

  1. Theme first: Connect the spooky debugging experience with the idea of preserving the history of retired code.
  2. Separate prediction from explanation: Have the forecasting component produce the risk estimate before the language model generates its explanation.
  3. Verify behaviour: Run unit tests and the telemetry analysis script rather than relying only on a convincing demo.

This approach helped turn a creative challenge theme into a project with a concrete technical workflow.

๐ŸŒผ The Spirit of GitGeist

Code has a history.

A strange delay, an unusual workaround, or a retired function may look meaningless today, but it might once have prevented a race condition or kept a service running during a difficult incident.

GitGeist is my attempt to make exploring that history more useful โ€” and a little more fun.

The haunted terminal brings the mystery. The risk forecaster brings a structured signal. The Digital Code Ofrenda brings a moment of appreciation for the developers and decisions that came before us.

Sometimes the ghost in the machine isn't a bug. It's a piece of engineering history waiting to be understood.

๐Ÿ† Prize Categories

The project is intended for the following challenge categories, subject to the official rules and eligibility requirements:

  • Overall Winner: The combination of Git-history analysis, local AI, and the Digital Code Ofrenda.
  • Best Use of Gemma: Gemma 3 generates contextual explanations grounded in supplied repository metadata.
  • Best Use of TabPFN: Tabular telemetry forecasting and sensitivity analysis.
  • Best Use of Render: The included Render Blueprint for a deployable web application.

๐Ÿ™Œ Thanks

Thanks to the organisers of the Hacktoberfest Open-Source AI Challenge for a theme that encouraged me to look at old code from a different perspective.

If you find GitGeist interesting, explore the repository, try the local workflow, and share feedback or ideas for improvement.

GitHub: https://github.com/ravindrajaipal/gitgeist

Built with curiosity, open-source tools, and respect for the ghosts in our codebases.

Top comments (0)