Pamyo: a séance for your codebase, where a local Gemma 4 may only quote the developers who left
I built this for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine, but it missed the deadline, so it is not a submission. Here it is anyway. What I Built Every codebase has a line nobod
I built this for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine, but it missed the deadline, so it is not a submission. Here it is anyway.
What I Built
Every codebase has a line nobody dares to touch.
MAX_RETRIES = 7
Why seven? Whoever chose it left years ago. git blame tells you who and when, but not why. The why might be in a commit message from Black Friday 2020, in Korean, three commits back. Or nowhere at all.
Pamyo is a séance for a codebase. Point it at a line and ask why:
pamyo why orders/payment.py:8 "Why 7 retries? It looks random."
Gemma 4, running on your own machine through Ollama, reads what the developers left behind in git (the commit messages that touched those lines, the changes they made, the comments nearby) and answers only by quoting them. Then Pamyo looks every quote up in git again before showing it:
- a quote that is really there is kept, and credited to whoever wrote it and when;
- a quote that isn't, because the model changed a word, translated it, paraphrased it or made it up, is struck through, in plain sight;
- a quote that only repeats the code, or says nothing but "fix", is set aside;
- and when nobody ever wrote down why, Pamyo says "The record is silent. Nobody wrote down why." instead of inventing a reason.
파묘 (pamyo) is Korean for exhuming a grave. Koreans also use it for digging up something long buried, like a post from years ago, and it's the title of a 2024 Korean occult horror film, Exhuma. It felt like the right name for a tool that digs up the dead and makes them talk, but only in their own words.
Demo
I haven't recorded the demo on my own machine yet, so there is no GIF here. The recorder is in the repo: scripts/record_demo.py asks the real model three questions, keeps its exact answers in docs/demo-answers.json and draws the GIF from them.
Trying it takes two commands on macOS or Linux:
git clone https://github.com/juwon0/pamyo && cd pamyo
bash scripts/first_run.sh
It installs Ollama if it's missing, pulls the Gemma 4 size that fits your memory, builds the haunted repository and asks it three questions. For your own code, uv tool install . once, then pamyo why src/billing.py:120 from inside any git repository.
Code
juwon0
/
pamyo
Ask why code is the way it is. A local Gemma 4 answers only with quotes from git history, and every quote is checked.
🪦 Pamyo (파묘)
Ask the developer who left why the code is like that.
Every codebase has a line nobody dares to touch: MAX_RETRIES = 7, encoding="cp949", if user_id == 1043: return False. Whoever knew why left years ago. Pamyo digs up what they left behind in git (commit messages, the lines they
changed, the comments nearby) and lets an open-weight model on your own computer answer in their own words only
Every quote is looked up in git again before it is shown. Words the model made up are struck out, and when nobody ever
wrote down why, Pamyo says so instead of guessing.
파묘 (pamyo) means exhuming a grave. Koreans also say it for digging up something long buried, like a post from years ago, and it is the title of a 2024 Korean horror film. Built for the Hacktoberfest 2026 "Ghost in the…
How I Built It
Digging. For the asked lines, Pamyo runs git log -L, which follows a range of lines back through history and returns every commit that changed it, with the change itself. git blame says who last touched each line nearby, and the 12 lines around the asked ones come along so that comments count as sources. A line with a long history keeps its 4 newest and 4 oldest commits (the original author and the latest reasons), and the prompt says how many were left out.
The séance rules. The model gets the question, the code, and the sources, each with an id (code, or a commit id like ca93d07), and must answer with JSON that matches a schema: silent, and up to four words, each a quote and the id of its source. The prompt is strict: copy character for character, never translate or shorten, quote only what says why (a reason, a limit, a warning, a ticket), never the code itself and never "fix" or "refactor", and if nothing says why, be silent.
Checking the medium. A prompt is a request, not a guarantee, so verify.py treats every quote as a claim:
- Found means found in the record after evening out whitespace, quote marks, letter case and the punctuation at its ends. "..." may skip words, as long as the pieces appear in order.
- A commit's words are its message and the lines it added. Lines it deleted were somebody else's, so a deleted comment is credited to the commit that wrote it, not the one that removed it.
- The model's choice of source isn't trusted either: a quote credited to the wrong commit is credited to the right one.
- A quote that only repeats code (the asked line, the code around it, or code a commit added) is set aside: code says what, not why. Comments and docstrings are told from code by the file's language (
#,//,/* */,--, Python docstrings), and there's a test that Python's floor division//is not a comment. - A quote too short to explain anything is set aside too: "fix", "wip", "ㅇㅇ" (Korean for "yep"), "급함" ("urgent").
- Silence is decided by what survives, not by the model. A real quote counts even if the model said "silent", and talking counts for nothing unless a quote survives.
A haunted repository to test it on. I didn't want to put words in real people's mouths, so make_haunted_repo.py builds one: dalbit-orders, the order service of a made-up Korean online shop, 26 commits from 2019 to 2023 by three developers who have all left. Some lines have their reason written down: a payment gateway that blocks the key for an hour if you go over 3 calls a second, Black Friday 504s (in Korean), accounting's Excel 2003 and its 65,536 rows, a cp949 export with "바꾸지 마세요" ("don't change it"), and a customer who must never be blocked. Others were committed as "fix", "ㅇㅇ", "asdf" and "wip". The script pins authors, dates and git settings, so it builds the same commit hashes on every machine, and a test checks that.
Measuring it. bench/questions.json asks 18 questions, in English and Korean: 12 whose reason is written down somewhere, and 6 where nobody wrote it down. Two of the six are traps. A 10-second timeout was last changed by a commit called "Retry only on 504", whose message is about something else; the VAT function has a docstring that says what it is, not why it rounds. An answerable question counts as right when a kept quote comes from the commit or comment that holds the reason; an unanswerable one, when Pamyo stays silent.
scripts/bench.py asks all 18 questions three times and writes the table into the README. I haven't run it on the real model yet, so this post has no accuracy numbers. Anyone with Ollama can produce them in one command: uv run python scripts/bench.py --model gemma4:12b --readme.
Reused from earlier weeks. The Ollama client comes from Chumsak and Jeongsan, my Week 2 and Week 3 projects (MIT). Homebrew's Ollama runs Gemma 4 on MLX and answers JSON Schema requests with a 501, so the schema moves into the prompt and the answer is still validated; thinking is off; an unusable answer gets one slightly warmer retry.
Tests. 126 tests use a fake model, so they run without Ollama: reading git history, telling comments from code, every rule in verify.py, the request sent to Ollama and its 501 fallback, the CLI, and the bench's own scoring. A perfect fake model scores full marks, and a lying one gets every quote struck.
Why Does Open Innovation Matter?
The code you most need to ask about is the code you're not allowed to paste anywhere, and its history is worse: commit messages name customers, tickets, incidents and colleagues. In 2023 Samsung restricted ChatGPT and other generative AI tools in a whole division after an engineer uploaded internal source code to check it for errors. With an open-weight model on your own machine, reading your history with an AI stops being a policy question: the code and its history go to localhost and nowhere else. Gemma 4 is released under Apache 2.0, so a team can run Pamyo for everyone without asking anyone.
Open also matters for trust. Whether a quote is real isn't the model's promise; it's decided by a short file of Python, verify.py, that anyone can read, run and argue with. The haunted repository and the questions are in the repo too, so anyone can rerun the numbers with another model and see where it lies.
My Agent Session
I built Pamyo with Claude Code as my pair, as in Weeks 2 and 3. This week I asked it to start on its own as soon as the theme was out, and it did: it read the theme, proposed the idea, started on it before I had answered, and wrote the code, the haunted repository, the questions and the tests. On the last day it copied the code onto my MacBook Pro through the Claude desktop app and ran the tests there: 126 passed. What went wrong: the Ollama install and the Gemma 4 model I had kept from Week 3 had been removed from the Mac, so the measured run and the demo recording didn't happen, and the project missed the deadline. It also drafted this write-up from the project notes, and once I said go, it made the repository public and posted this.
The Spirit of It
Día de los Muertos remembers the dead as they were, in their own words and their own photos, not with words put in their mouths. That became the one rule Pamyo enforces: the dead may only say what they really said, and when they said nothing, the honest answer is silence.
The haunted repository has one line that is pure Día de los Muertos. if user_id == 1043: return False looks like a bug. Its commit message says the customer bought 40 boxes of rice cakes for her mother's memorial rite (제사, the Korean rite of setting a table for the ancestors), the bulk-buying rule blocked her in the middle of the order, and customer service promised it would never happen again. The developer who wrote it is gone; the promise is still in git. Pamyo exists so that kind of promise outlives the people who made it.
Thanks for reading. May your codebase's ghosts have left good commit messages. 🪦
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.