DEV Community

Francisco GrandΓ³n
Francisco GrandΓ³n

Posted on Originally published at gitseance.tech

GitSΓ©ance: An Offline Digital Ofrenda Where Local Gemma Summons Deleted Code (And Refuses to Guess Why It Died)

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission πŸ‘»πŸŒΌ

                 .-"      "-.
                /   🌼  🌼   \
               |   #000dead   |
               |,  .-.  .-.  ,|
               | )(_o/  \o_)( |
               |/     /\     \|
               (_     ^^     _)
                \__|IIIIII|__/
                 | \IIIIII/ |
                 \          /
                  `--------`
Enter fullscreen mode Exit fullscreen mode

"The code you delete never truly dies: it becomes the silent foundation of every commit that follows. Viva Open Source!"

β€” Spirit #000dead (MictlΓ‘n Relic)


1. What I Built: Honoring the Code That Built Us πŸŒΌπŸ•―οΈ

git blame only speaks for the living.

It tells you who touched the lines that survived in HEADβ€”but every mature repository is built on the bones of hundreds of excised functions, retired prototypes, and emergency midnight bugfixes that were quietly erased from history.

When a regression resurfaces two years later, modern teams often commit the exact same architectural mistakes of 2022. Why? Because the reasoning behind deleted code is buried deep inside git log -p, where nobody looks.

For Hacktoberfest 2026: Week 4 ("Ghost in the Machine"), bridging Halloween with the sacred Mesoamerican tradition of DΓ­a de los Muertos (Day of the Dead), I created GitSΓ©ance:

An offline-first developer archaeologist and interactive Digital Ofrenda that scans your repository's graveyard, builds a marigold-adorned altar for departed code, and lets you conduct grounded sΓ©ances with excised functions powered by Google Gemma (gemma2:2b) running 100% locally on your own machine.

[!IMPORTANT]
Live Web Ofrenda: https://gitseance.tech

Source Repository: https://github.com/FranciscoGrandon/git-seance (Release v1.0.0 Β· 41 Automated Tests Β· 0 AST Violations)


2. The Core Problem: Small Models Love Making Up Tragic Ghost Stories

When I first fed deleted git diffs into local 2B language models and asked, "Why was this function removed?", Gemma did what small language models do best: it hallucinated.

If a commit message was informativeβ€”such as "Drop parse_xml_invoice_soap to patch XXE vulnerability (CVE-2026-0412)"β€”Gemma recited a magnificent, respectful memorial.

But what happened when the commit was a Friday 4:59 PM rush job that literally said "wip" or "cleanup"?

The model immediately fabricated an elaborate, fictional backstory about microservice migrations, imaginary database locks, or phantom compliance audits!

In software archaeology, a fictional story is worse than silence.

The Deterministic Tombstone Grounding Pipeline

To make GitSΓ©ance an authentic developer tool rather than a toy, I engineered a multi-stage deterministic safety pipeline:

                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚  git log -p Graveyard Miner β”‚
                       β”‚    (Single-Pass Pipeline)  β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β–Ό                                       β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Polyglot AST Symbol     β”‚             β”‚ Cryptic Commit Preflightβ”‚
    β”‚ Extractor (Py/JS/Go/Rs) β”‚             β”‚ (wip/cleanup Interceptorβ”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚                                       β”‚
                 β”‚ πŸ›‘οΈ Is commit cryptic?                 β”‚
                 β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ YES ───────────────► πŸ›‘οΈ Fallback
                 β”‚                                            Epitaph
                 β”‚ NO (Informative commit message)
                 β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Local Google Gemma 2B   β”‚ (Ollama localhost:11434 / temp=0.25)
    β”‚ SΓ©ance Inference Engine β”‚ ($0.00 Cloud Bill / 100% Local Privacy)
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Grounding Fact-Checker  β”‚ (Verifies Commit SHA & File Path in reply)
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Sentry Agent Tracing (`ai.seance` OpenTelemetry Spans) β”‚
    β”‚   β€’ Latency (ms)  β€’ Token Count  β€’ Hallucination Flags β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β–Ό                               β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ Terminal CLI Ofrenda    β”‚     β”‚ Single-Page App Ofrenda β”‚
    β”‚ + Quine (#000dead)      β”‚     β”‚ (Render / index.html)   β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode
  1. Streaming Single-Pass Git Miner (mine_git_graveyard): Most mining scripts spawn hundreds of slow git show subprocesses. GitSΓ©ance streams git log -p -U0 in a single pass with delimited token buffers, reconstructing author, timestamp, commit SHA, and exact unified diff deletions in under 120ms.
  2. Pre-Flight Cryptic Interceptor (is_cryptic_commit): Before burning CPU or GPU cycles on an LLM, the commit message is audited against low-signal patterns (wip, temp, cleanup, fix, chore(core): wip). If flagged, GitSΓ©ance short-circuits inference completely and delivers an honest, unvarnished epitaph: > "This function departed into the void under the cover of a cryptic commit ('wip'). No heroic epitaph can be summoned because the mortal developer left no breadcrumbs."
  3. Low-Temperature Bounded Prompting (temperature=0.25): The model is instructed to adopt the persona of the departed function speaking in the first person, bounded strictly to the verified diff lines and commit message.
  4. Post-Generation SHA Fact-Checker (verify_response_grounding): Python regex audits the response to certify it explicitly includes the actual 7-character commit SHA prefix (e.g., #8f3a91c) and the file path. If the spirit fails the audit, it is evicted in favor of verified deterministic text.

3. The Interactive Wow Factor: Audio Chimes, Falling Petals & The Self-Aware AST Quine πŸ’€βœ¨

Software should evoke wonder. The Digital Ofrenda web app is packed with three organic technical easter eggs:

1. The Self-Aware Source Code Quine (#000dead)

GitSΓ©ance contains a living mythological spirit embedded directly into the source code: Spirit #000dead (The Relic of MictlΓ‘n).

  • In Python CLI: Running python git_seance.py --mictlan dynamically introspects its own source code on disk using Python's ast module. It extracts the hex cipher MICTLAN_HEX_CIPHER, decodes it in memory, calculates its own 32-bit FNV-1a checksum (0x71790691), and summons itself as a living departed relic.
  • In the Web App: Typing mictlan anywhere on the keyboard or clicking the golden calavera skull executes awakenSourceQuineSpirit(), reading <script id="gitSeanceCoreScript">, verifying identical FNV-1a hash parity, and displaying the live self-reflection panel.

2. Zero-Asset Resonant Altar Bells (Web Audio API)

No bulky .mp3 files or external audio assets. The altar bell chimes are synthesized directly in the browser using the Web Audio API:

const notes = [293.66, 349.23, 440.0, 587.33]; // D minor harmonic arpeggio (La Bruja motif)
notes.forEach((freq, idx) => {
  setTimeout(() => playAltarChime(freq), idx * 140);
});
Enter fullscreen mode Exit fullscreen mode

Each note triggers an OscillatorNode with an exponential decay GainNode, producing an authentic, haunting bronze bell timbre.

3. Marigold Petal Rain (Canvas Physics)

Activating the altar triggers an interactive HTML5 canvas particle storm where 38 golden cempasΓΊchil and purple petals drift and rotate down the viewport with realistic harmonic sway (Math.sin(angle) * 0.4).


4. Why Open Innovation Matters Here πŸ”“

  1. Zero Proprietary Data Leaks: No engineering organization will ever upload their internal git logs, deleted security patches, or proprietary business logic to third-party cloud APIs just to analyze tech debt. Running Google Gemma locally guarantees 100% air-gapped privacy.
  2. Permanent Immortality ($0.00 Per SΓ©ance): Cloud APIs deprecate, rotate tokens, and charge per 1,000 tokens. GitSΓ©ance runs on standard git plumbing and open weights. You can run this tool in an underground bunker twenty years from now with zero internet connection.

5. Automated Pull Request Ofrenda: GitHub Actions CI/CD πŸ€–

Whenever a developer opens a Pull Request that excises dead code, GitSΓ©ance runs automatically via .github/workflows/ofrenda_pr.yml:

python3 git_seance.py --ci-summary --no-fallback --range "origin/${{ github.base_ref }}..HEAD" > ofrenda_comment.md
Enter fullscreen mode Exit fullscreen mode

It automatically posts an elegant Digital Ofrenda memorial comment to the PR discussion thread with collapsible <details> blocks for diff inspection:

Departed Symbol File Path Tombstone SHA Author & Date Guardrail Status
legacy_payment_retry_loop() src/billing/checkout.py #8f3a91c Devon Vance (2026-10-14) βœ… Grounded Epitaph
sync_legacy_cart_v1() src/checkout/cart_sync.py #d4e91b2 Marco Ruiz (2026-10-21) πŸ›‘οΈ Cryptic Commit (vague_commit blocked)

6. Sentry Agent Tracing Telemetry πŸ“Š

Every sΓ©ance transaction is instrumented with custom OpenTelemetry spans under the ai.seance namespace using the official Sentry SDK:

  • Tags Tracked: death_sha, engine_source (gemma_local vs fallback), grounded_sha, cryptic_commit_blocked, ast_quine_verified.
  • Data Payloads: Execution latency in milliseconds, token counts generated, and p95 latency percentiles.
  • Exportable Telemetry: Run python git_seance.py --export-traces seance_traces.json or inspect the live visual telemetry charts powered by Chart.js in the web dashboard!

7. Prize Categories Entered πŸ†

1. πŸ₯‡ Overall Winner ($250 + DEV++)

  • Cultural Depth Meets Engineering Rigor: Elevates the "Ghost in the Machine" prompt by pairing Halloween lore with the respectful tradition of the Mexican Ofrenda to solve a real developer challenge: software archaeology.
  • Tri-Fold Architecture: Complete Python CLI tool, reactive single-file SPA web application, and automated GitHub PR workflow.
  • Zero-Regression Suite: 41 comprehensive tests passing, zero AST violations, sub-millisecond offline execution, and pure standard library execution.

2. πŸ€– Best Use of Google Gemma ($200 β€” Google Sponsor Prize)

  • Local Private Inference via Ollama: Deploys gemma2:2b on localhost:11434 with zero external cloud dependencies or API keys.
  • Anti-Hallucination Guardrails: Intercepts vague commits with regex pre-flights and fact-checks model outputs post-generation against true git commit SHAs.
  • Determinism: Bounded by temperature=0.25 for consistent, reproducible developer tombstone summaries.

3. πŸš€ Best Use of Render ($200 β€” Render Sponsor Prize)

  • Zero-Build Static Site Deployment: Hosted on Render Static Sites directly from root index.html. Zero node_modules, zero bundler configuration, and zero lockfile vulnerabilities.
  • Instant Global Edge Delivery: Ultra-fast TTFB with automatic edge compression and 100/100 performance scores.

4. πŸ“Š Best Use of Sentry Agent Tracing ($100 β€” Sentry Sponsor Prize)

  • Custom ai.seance Spans: Full span lifecycle monitoring covering model latency, token generation counts, and automated hallucination flags.
  • Interactive UI Dashboard: Built-in telemetry dashboard with responsive latency breakdown charts and headless JSON trace export capability.

5. 🌐 Best Use of a .tech Domain ($100 β€” .tech Domains Sponsor Prize)

  • Production Deployment at gitseance.tech: Paired with an official Hacktoberfest .tech domain, establishing a crisp identity for deep developer tooling.
  • SSL/TLS Hardening: Fully secured with managed Let's Encrypt certificates routed to Render edge servers.

6. πŸ™ Best Use of GitHub Copilot / Actions ($100 β€” GitHub Sponsor Prize)

  • Automated PR Bot Workflow: Turnkey GitHub Actions CI workflow analyzing diff revision ranges (origin/main..HEAD) and commenting tombstone memorials on PRs.
  • Copilot-Engineered Polyglot AST Engine: Utilized GitHub Copilot to architect complex regular expressions and AST parsers extracting deleted symbols across Python, TypeScript, Go, Rust, Java, and C++.

8. Engineering Rigor: 41 Automated Tests & 0 AST Violations πŸ§ͺ

GitSΓ©ance was tested with the same rigor required of production infrastructure:

# Run the complete test suite
python -m unittest discover -v
Enter fullscreen mode Exit fullscreen mode
Ran 41 tests in 8.132s
OK
Enter fullscreen mode Exit fullscreen mode
  • test_git_seance.py (24 tests): Single-pass mining, unified diff chunk parsing with mixed indentation, polyglot symbol extraction, cryptic commit pre-flights, grounding verification edge cases, local HTTP Ollama mock server, and AST quine self-introspection.
  • test_html_ofrenda.py (17 tests): DOM element consistency (0 null pointer risks), cross-language FNV-1a parity, XSS HTML entity escaping, and live headless browser DOM verification using headless Microsoft Edge (msedge --headless --dump-dom).
  • AST Static Linting: 0 violations under <30ms execution via AST linting.

9. Try It on Your Own Graveyard! πŸš€

Don't let your deleted code wander the void forgotten. Summon your repository's ghosts today:

# 1. Clone the repository
git clone https://github.com/FranciscoGrandon/git-seance.git
cd git-seance

# 2. Make sure you have Ollama running with Gemma
ollama pull gemma2:2b

# 3. Hold your first sΓ©ance (works on ANY git repository!)
python git_seance.py

# 4. Or awaken the secret source code Quine
python git_seance.py --mictlan
Enter fullscreen mode Exit fullscreen mode

Prefer a visual experience? Visit the live altar at https://gitseance.tech, light a candle for legacy code, and type mictlan on your keyboard!


Built with reverence by **Francisco GrandΓ³n Vergara* for Hacktoberfest 2026: Week 4 ("Ghost in the Machine"). Viva Open Source! πŸŒΌπŸ’€*

Top comments (0)