DEV Community

Godly K Mathews
Godly K Mathews

Posted on

The Last Commit: Every Ghost Has a Commit Hash

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

Every repository has code that disappeared from its working directory but still exists in its history.

An old authentication system. A deployment script that outlived its usefulness. A feature someone carefully built, then eventually removed.

I built The Last Commit, a local museum of deleted code.

Open a Git repository, select a deleted file, and explore its timeline, last source version, and deletion diff. Then click Summon story to let a local open-weight model describe the file’s former purpose and documented fate in two short, first-person lines.

Each line includes a numbered reference that opens the original evidence.

That is my interpretation of Ghost in the Machine: the ghosts are the files we removed, and Git is where their stories remain.

I kept the interface quiet: a file list, a focused history view, and help tucked into a corner. The atmosphere comes from the history itself.

Demo

The app runs locally and includes Nightshift, a fictional repository with real Git commits created for demonstration. You can explore its deleted files immediately, then open your own repository.

History browsing works independently of the model. While a story generates, you can continue reading commits and inspecting code.

Code

The Last Commit

A small, local museum of deleted code. Browse a file’s history, inspect its last version, and ask an open-weight model to tell its story—with references back to the evidence.

Built for Ghost in the Machine. The haunting lives in the history; the interface stays quiet.

Run

Requires Node.js 22+ and Git. There are no npm dependencies or build steps.

npm start
Enter fullscreen mode Exit fullscreen mode

Open 127.0.0.1:3217. The app starts with Nightshift, a fictional Git repository generated in .data/nightshift. Its files, dates, people, and commit messages are example material—not a real project’s history.

Use Open repository to enter an absolute path to your own local repository. Pick a deleted file to see its timeline, last version, and deletion diff. Setup and help stay behind the model button and corner help icon.

Add a local narrator

Install and start Ollama, then explicitly download a model, for…

The application is MIT-licensed. The README includes setup instructions, local-model configuration, tests, and current limitations.

How I Built It

The stack is deliberately small:

  • Node.js serves the application and reads Git history.
  • Plain HTML, CSS, and JavaScript provide the interface.
  • Git supplies the commits, historical source, and deletion diffs.
  • Ollama runs the open-weight model locally.

I tested story generation with Qwen3:8B. The setup guide also suggests Qwen3:4B, and the interface lets you select another downloaded local chat model.

The AI has a specific job: turn historical evidence into a short, readable account of what a file did and what happened to it.

The server sends bounded excerpts to the model and requests structured JSON. Before displaying the result, it checks that each cited source exists and that the supplied quotation occurs in that source.

Those checks validate the references and quotations. They cannot prove that every interpretation is correct, so the original evidence remains one click away.

“RAG Beyond the Demo”, by xinyangwuethz, helped frame that distinction between source records controlled by the application and citation claims generated by a model.

Seven automated tests passed. A real Qwen3:8B run produced the two-line exhibit in 5.6 seconds with the model already loaded. That is a measurement from my machine, rather than a speed guarantee.

Why Does Open Innovation Matter?

Repository history can contain private code and decisions that were never intended to leave a developer’s machine.

Running an open-weight model locally means those excerpts can stay on hardware the developer controls. The app connects to local Ollama and rejects remote model endpoints and cloud aliases.

Once the software and model are installed, the workflow can run without an internet connection.

Open weights also make the narrator replaceable. Someone can choose a smaller model for their laptop, try a different model, or change the prompt and validation rules. The project can keep working without depending on a hosted inference provider’s pricing or continued availability.

There is no per-request API bill, although local inference still uses hardware and electricity.

For this project, open innovation makes the privacy, offline operation, and control over the narrator possible.

The Spirit of It

In the fictional Nightshift repository, a deleted session store produced this account:

I kept user sessions in an in-memory store.

I was deleted when the session store was replaced with signed cookies.

The removal commit explains why: sessions needed to survive restarts.

That small connection captures what I wanted to build. A deleted file becomes a record of a problem someone once solved, and a later decision to solve it differently.

The Last Commit gives that history a voice while keeping the evidence close enough to question it.

I used Codex to help build and test the project.

Top comments (0)