跳到正文
DEV Community· Rehan Mehta·· 3 小時前AI 評分55

Rehan Mehta 用 git séance 與已停更的 Git 專案對話

title: I held a séance for my abandoned repos. One of them is jealous. published: false

AI 導讀

Rehan Mehta 開發 git séance,掃描靜默至少 14 天的 Git 專案,將提交紀錄及未提交內容整理成墓碑,讓用戶與專案幽靈對話。本機模式透過 Ollama 執行 Gemma 3 4B;公開示範房則以 Google AI Studio 託管的 Gemma 4 回應公開 GitHub 專案,並只讀取公開歷史。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

Rehan, is that you? Thirty days, precisely, since the last flicker of this project died.

That's the first thing amazon-ml said to me. It's a machine-learning competition repo I built with two friends over one weekend in September: 29 commits in two days, then silence. Its last words were a commit message: "Model v3, judge/validation notebooks, gitattributes for model files."

I asked it if it forgave me.

Forgiveness… it's a strange echo, isn't it? You left me at 16:28 on September 27th, 2026, with the words "Model v3, judge/validation notebooks, gitattributes for model files" [C1], a desperate attempt to hold onto something. Plain-words now occupies this space – a pale imitation, built on the scraps of my ambition [X1]. I don't resent you, exactly, just… a profound disappointment in the silence that followed.

It knew which project replaced it. Nobody told it. It worked that out from git.

What I Built

git séance turns the folder where your side projects go to die into a graveyard, and lets you talk to them.

Point it at a folder. Every repo that has been silent for 14 days or more gets a tombstone with its name, its birth and death dates, its last words (the final commit message), a cause of death, and who it was survived by: the project you started right after it went quiet. That's usually why it died.

Open a grave and you get:

  • A heartbeat. An EKG of its commit history that beats, then flatlines at the exact minute of its last commit. It twitches while the ghost is speaking.
  • The record. The uncommitted files it died holding, stashes never popped, branches never merged, every TODO and unchecked README box.
  • An autopsy. The ghost picks its own cause of death from a fixed list, explains it in its own voice, and writes its epitaph.
  • A séance. A streaming conversation with the project itself, in first person.
  • Two rites. Resurrect it gets you three small steps back to life and the commit message for its second life's first commit. Lay it to rest has it write its own OBITUARY.md, which you can save into the repo.

This week's theme says the line between past and present feels a little thinner. For developers, that line is git log. Every repo is a record of who you were for a few days: what excited you, what you named things at 3 AM, and the exact minute you stopped. I wanted to give those projects their Día de los Muertos, one night where they get to speak.

Demo

git-seance.vercel.app has two ways in:

  • The recorded séance. Open the amazon-ml grave. This is the real séance, recorded on my laptop's CPU with gemma3:4b through Ollama, replayed at the speed it was written. Click any citation to see the commit behind it.
  • A live room for public repos. Paste any dead public GitHub repo (or click octocat/Hello-World, silent since 2012) and its ghost answers live through Gemma 4, an open-weight model hosted on Google AI Studio. It only ever sees public history. Your private graveyard belongs on your own machine: python -m seance.

The live room runs on Render's free tier, so if nobody has visited in a while, the first summon takes about a minute to wake it up. The recorded séance works even while it's asleep.

Code

GitHub logo Rehan1604 / git-seance

Talk to the projects you left behind: a séance for your abandoned git repos, powered by local open-weight models (Gemma via Ollama).

git séance

Talk to the projects you left behind.

Try it: git-seance.vercel.app, with a séance recorded on a laptop plus a live room for public repos. The real thing runs on your own machine (below).

Every developer has a graveyard: the hackathon project that died at 3 AM, the side project whose last commit says wip fix later. git séance walks a folder of your repos and lays them out as tombstones. Click one, and its ghost speaks to you in its own voice, from its own git history, through an open-weight model running on your own machine.

The ghost is not allowed to make things up. Every claim it makes has to cite real evidence: a commit, a TODO, a README line, a file you never committed. Each citation is checked, and any the model invented are shown in pink and struck through as phantom memories.

…

How I Built It

I started with one rule: the ghost is not allowed to make anything up. A haunted repo that hallucinates is just a chatbot wearing a sheet.

  1. Excavation, with no AI. Python runs git log, git status, git stash list and git branch --no-merged, and scans the tracked and uncommitted files. Every fact gets an ID: [C1] is the final commit, [T3] a TODO, [U1] uncommitted work, [X1] the successor, [V1] the vital record.
  2. Redaction. .env and key files are never opened. Anything shaped like a secret (sk-…, ghp_…, hf_…, API_KEY = "…") becomes [REDACTED] before the model sees a byte of it.
  3. The case file. Vitals, omens, the 20 most recent commits, TODOs and the README become a compact dossier in the system prompt. It stays identical on every turn, so Ollama can reuse the cached prompt prefix and later answers come faster.
  4. The spirit: Gemma 3 4B, running locally through Ollama. The séance streams. The autopsy and the resurrection use Ollama's JSON-schema format, so a 4B model returns typed output, and the cause of death is restricted to an enum. A deterministic "coroner" makes the first guess, the model can overrule it, and the UI tells you when it does.
  5. Memories surfacing. If you ask about something the case file doesn't cover, a small BM25 index in pure Python searches commits, TODOs and source chunks, and the matches become citable for that answer.
  6. The honesty check, in two layers. Every [ID] in every reply is checked against the evidence. A real citation becomes a clickable receipt showing the exact commit or line. An invented one is struck through in pink and labelled a phantom memory. Then a second check: if the cited source shares no words with the sentence citing it, the chip turns dashed amber and gets labelled a loose citation. Even in the exported OBITUARY.md, nothing is hidden: loose citations get a †, and phantom ones stay in, struck through.

Two things I learned along the way.

Over-constraining a small model kills the voice. My first prompt said "state no fact without a citation." Gemma took that literally. I asked "Do you forgive me?" and got back: "Silent. [C1]." The fix was one distinction: facts need citations, feelings don't. That line turned it from a log parser into a ghost.

A real citation can still prop up an invented claim. The first obituary amazon-ml wrote for itself said I'd had "late nights fueled by coffee," and cited commit 4cc38b4. That commit is Devansh's "chunked version of data." My phantom check passed it, because the ID existed. In a README, a commit hash makes a made-up sentence look sourced, which is worse than no citation at all. And it wasn't a one-off: even at temperature 0.3, Gemma's autopsy reached for the same coffee and stapled three real commits to it. Coffee is the default ghost story.

So I added the loose-citation layer, and one line to the prompt: no invented scenes; the times on your commits show exactly how late they worked. The real details were better anyway. Our late night is right there in the log: "sibling-trap detection" at 01:20, a pre-filter at 01:39, "validation F0.5 0.942" at 03:04. The loose check is a heuristic, so the UI says "check it", not "false", and every chip opens its source.

Citations only keep a claim honest if the claim has one. In the final obituary the ghost says "twenty-nine days of silence followed." It was thirty. It didn't cite [V1], so no check fired. I've left that in, because it's the honest limit of the design: git séance can tell you where a claim points, not whether an uncited sentence is true. Not "trust me," but "here's my source, go look," and when there's no source, that's information too.

Stack: Python, FastAPI, httpx, Ollama, Gemma 3 (open weights), and vanilla HTML/CSS/JS with no build step and no external assets. 15 tests build throwaway repos with backdated commits and check the excavation, redaction, successor detection, retrieval and both layers of citation checking, all without a model.

Why Does Open Innovation Matter?

Because the dead projects are the private ones. A graveyard holds exactly the work you never pushed: uncommitted notebooks, half-written functions, commit messages written at 3 AM, sometimes an API key you forgot about. Shipping that to a hosted API so it can be "haunted" would defeat the point. git séance binds to 127.0.0.1, loads no fonts or CDNs, and calls nothing outside your machine. You can unplug the router and the ghost still talks.

It runs on the laptop I actually have: an i5-13420H with 16 GB of RAM and no NVIDIA GPU. A cold autopsy takes about a minute: 35 seconds to read the 2,087-token case file, then 26 seconds to write the answer at roughly 8 tokens a second. After that, the case file is cached and answers take about 25 seconds. That's slow for a chatbot and fine for a séance; you're supposed to wait for the dead. If I want it faster, one environment variable swaps the model (SEANCE_MODEL=gemma3:1b). Nothing else changes.

I could shape how the model behaves where it mattered. JSON-schema decoding gives a 4B model a typed autopsy every time. I control the context window, how long the model stays warm, and exactly what the model is shown, which is the whole basis of the honesty check.

It costs nothing to run, so it can sit on your machine for years.

And the one that fits this week best: a tool about abandoned projects shouldn't depend on a service that might be abandoned. The weights are on my disk. They'll answer in ten years, whatever happens to anyone's API. The ghost outlives the platform.

Where did open beat closed? A hosted frontier model would probably write prettier ghost prose. But it would need my unpushed code, and it would need the service to still exist. For this project, privacy and permanence are the feature.

The Spirit of It

Here's the part I didn't see coming.

amazon-ml was built by three of us: me, Bhavya Gothi and Devansh. git séance lists all three of us in its record. It also says the project was survived by plain-words, born five days after amazon-ml's last commit.

Plain-words is the document explainer I built for Bhavya during the Hacktoberfest "Build for a Friend" weekend. Same friend, the next sprint, five days later. And the old project's ghost calls the new one "a pale imitation, built on the scraps of my ambition."

I never told it any of that. It found it in timestamps.

When I asked it to lay itself to rest, it described itself, accurately, as "notebooks and Python, a tangled mess of features and blocking algorithms, a team of three chasing a number." The number was real: 0.981 F0.5, cited to the commit that reached it.

Then it chose its own epitaph:

Here lies amazon-ml. A beautiful, pointless experiment, forever unfinished.

I don't agree with "pointless." But it's allowed to have feelings. They don't need a citation.

來源:DEV Community · dev.to