PhantomLedger 👻: The Codebase Remembers What You Forgot
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine.
What I Built
What if a codebase remembered everything that its current state forgot?
PhantomLedger is a local-first developer archaeology tool that reconstructs a repository's historical memory from Git history and turns it into a Memory Ledger.
The working tree only shows what survived. PhantomLedger looks for what disappeared along the way:
- Reverted changes
- Deleted files
- Abandoned branches
- Short-lived experiments
- Unresolved TODOs and FIXMEs
- Repeatedly modified files
- Contributor inactivity
- Historical decisions that are no longer obvious from the current code
The central idea is simple:
Your repository remembers what you forgot.
The "ghosts" in PhantomLedger are the pieces of a codebase that are no longer visible in its current state, but still leave traces in its history.
PhantomLedger keeps two things deliberately separate:
Git provides deterministic historical evidence. Gemma provides local interpretation.
The application never presents generated AI text as if it were Git evidence.
Demo
â–¶ Watch the full PhantomLedger demo
The demo walks through the complete flow:
- Creating the synthetic Haunted Demo Repository
- Exploring its Git history
- Viewing the Memory Ledger
- Filtering historical memories
- Inspecting the evidence behind a memory
- Asking local Gemma for an interpretation
- Exploring the Repository Chronicle
- Showing the evidence-first fallback when AI interpretation is unavailable
Code
GitHub Repository: MANAV-MISHRA-BYTES/phantomledger
The repository contains the complete application, tests, documentation, demo generator, and MIT license.
How I Built It
PhantomLedger is built with:
- Python
- FastAPI
- Pydantic
- Vanilla HTML, CSS, and JavaScript
- Native Git CLI
- Ollama
- Gemma 4 E4B
The Git analyzer uses fixed, read-only Git commands to reconstruct repository history. Python rules then identify and score different types of historical memories.
When the user asks for an interpretation, PhantomLedger sends only the selected memory's evidence bundle to the local Ollama instance running Gemma.
Gemma is asked to return structured information covering:
- Known facts
- Unknowns
- Historical interpretation
- Confidence
Pydantic validates the response before it reaches the interface.
This creates a deliberate separation:
Git History
↓
Deterministic Evidence
↓
Memory Ledger
↓
Selected Evidence Bundle
↓
Local Gemma
↓
Evidence-Bounded Interpretation
The application also has an Evidence Mode fallback. If Ollama is unavailable, the Git evidence remains usable instead of the application inventing an AI explanation.
The analyzer does not checkout branches, modify the inspected repository, commit, push, pull, or delete user files.
Why Does Open Innovation Matter?
Developer repositories can contain private code and sensitive history. Sending that history to a remote AI service should not have to be the default.
PhantomLedger uses local Gemma through Ollama so repository history can remain on the developer's machine.
That gives the project several advantages:
- No cloud AI account is required for interpretation.
- Repository evidence does not need to be sent to a cloud AI provider.
- The model can be swapped or changed.
- The inference process can run locally.
- Developers can inspect how the evidence is collected and how the model is used.
- The tool remains useful even when the AI component is unavailable.
For this particular problem, open innovation is not just a technical choice. It makes local code archaeology practical for repositories that developers may not want to upload anywhere else.
The Ghost in the Machine
I interpreted the theme literally through software history.
A deleted file is a ghost.
An abandoned branch is a ghost.
A reverted feature is a ghost.
A TODO that survived dozens of commits is a ghost.
An experiment that existed for a few commits and then disappeared is a ghost.
The current codebase is only the living state. PhantomLedger explores the repository's afterlife.
Prize Categories
Best Use of Gemma
PhantomLedger is entered into Best Use of Gemma.
Gemma 4 E4B runs locally through Ollama and interprets evidence extracted from Git history. The model is not used to fabricate repository facts or perform the underlying Git analysis. Instead, it receives a narrow, evidence-grounded context and produces a structured historical interpretation.
AI Disclosure
AI tools were used during the development process, including Codex for implementation assistance, debugging, and testing.
The final project architecture, functionality, testing, demo workflow, README, and submission were reviewed and directed by me. I verified the application locally and made the final product and submission decisions.
Project Status
PhantomLedger is a working local MVP with:
- A FastAPI backend
- A Git history analyzer
- Deterministic memory extraction
- A synthetic Haunted Demo Repository
- Local Gemma integration through Ollama
- Evidence Mode fallback
- A browser-based interface
- Automated tests
- Documentation
- MIT licensing
The project is available publicly on GitHub:
https://github.com/MANAV-MISHRA-BYTES/phantomledger
And the full demo is available here:

Top comments (0)