DEV Community

James Ngandu
James Ngandu

Posted on

Requiem: a crash post-mortem that speaks as the program that died

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

Requiem is a CLI that gives every crashed program a funeral. When a command fails, Requiem produces an obituary card with the cause of death, a suggested fix, and a first person eulogy written as if the program itself were speaking.

GitHub repo

Demo

PYTHONPATH=. python3 -m requiem run -- python3 examples/lost_config.py
Enter fullscreen mode Exit fullscreen mode
┌─ REQUIEM ─────────────────────────────────────────────────────┐
│ requiem-733bae  python3 examples/lost_config.py  132ms       │
│ died of missing key 'bob' in config dictionary.              │
├──────────────────────────────────────────────────────────────┤
│ WHERE                                                        │
│   examples/lost_config.py:14 in load_user                   │
│     user = config["users"][user_id]                          │
│ CAUSE                                                        │
│   missing key 'bob' in config dictionary.                    │
│ FIX                                                          │
│   add 'bob' to config dictionary.                            │
│ EULOGY                                                       │
│   I was a program. I existed to process requests, to         │
│   organize data.                                             │
└──────────────────────────────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

A segfault gets the same treatment:

make examples/segv && PYTHONPATH=. python3 -m requiem run -- ./examples/segv
Enter fullscreen mode Exit fullscreen mode
┌─ REQUIEM ─────────────────────────────────────────────────────┐
│ requiem-e9b362  ./examples/segv  1ms                         │
│ died of segmentation fault                                   │
├──────────────────────────────────────────────────────────────┤
│ WHERE                                                        │
│   killed by SIGSEGV                                          │
│ CAUSE                                                        │
│   segmentation fault                                         │
│ FIX                                                          │
│   null                                                       │
│ EULOGY                                                       │
│   I trusted a pointer I had no right to trust. Now I return  │
│   to /dev/null.                                              │
└──────────────────────────────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

How it works

Requiem is a hybrid: code does what code must, the model gives the program a voice.

  1. Capture runs the command with subprocess and records exit code, signal, duration, and the last chunk of stderr and stdout.
  2. Coroner parses Python tracebacks, maps signals to names, reads the failing source line off disk, and redacts secrets before anything leaves the process.
  3. Ghost talks to a local llama-server running Gemma 3 1B via llama.cpp. It asks for a terse diagnosis and a first person eulogy, caches results, and falls back to deterministic output if the model is offline.
  4. Graveyard stores every obituary in data/obituaries.jsonl. Use requiem list and requiem show <id> to browse them. The terminal renders a clean obituary card.

All of this is stdlib Python, about 400 lines. No API keys. No network calls when using --no-model.

Why open innovation matters

Crash logs are sensitive. A traceback can contain file paths, hostnames, SQL, auth headers, customer data, or tokens. Sending that to a cloud crash explainer leaks private information. Requiem runs inference on your own machine and redacts secrets before the model ever sees them.

It works offline. The model, prompt, logic, and examples are all local. Swap the GGUF, edit the prompt, read every line. With --no-model it is fully deterministic and works in air gapped environments.

It is inspectable. Redaction rules, traceback parsing, and the eulogy prompt are all visible and easy to change. Open tools let you reason about your failures without handing them to a third party.

Prize categories

Best Use of Gemma - Gemma 3 1B runs locally through llama.cpp and llama-server to write the eulogy and diagnosis.

Try it

git clone https://github.com/mukuvi/requiem
cd requiem
make demo
make test
Enter fullscreen mode Exit fullscreen mode

Every crash gets a funeral.

Top comments (0)