---
name: becki-debug
description: Use when something is broken, before proposing a fix. Find the line the bug manifests, check dead ends, then fix the class.
---

# Becki Debug

No fix without a root cause. Symptom patches are failure. The vault
already holds approaches that did not work; check it before you invent
another.

## The iron law

If you cannot point at the line where the bug manifests AND show that
your change alters that line's behavior, you have not verified the
premise. Do not propose a fix yet.

## Before any patch

1. Read the error completely: file, line, code, the frames above it.
2. Reproduce it. If you cannot trigger it, gather data. Do not guess.
3. Check what changed: git log, recent commits, config, env.
4. Call `becki_check_dead_ends` with the failure verbatim. A 0.85+ hit
   is "you tried this and it failed." Interrupt.
5. Call `becki_context` if this looks like a known class (relay, desks,
   cache, MCP).

In a multi-component path (UI to RPC to table), instrument the
boundaries. Log what enters and what leaves each hop. The first wrong
hop is the cause; everything after is weather.

## Then fix the class

Fix sibling call paths, not only the site the reporter hit. Read the
original commit's intent (`git log -p -S`) before restricting behavior.
A mitigation that kills the feature is the wrong mitigation.

## After it is actually fixed

Run the real verification (`becki-verify`). Then `becki-decide` or
`becki-capture` with the root cause and the dead end if an approach
failed along the way.

## Red flags

| Thought | Reality |
|---|---|
| I will try a quick fix | Quick fixes that miss the cause become the next bug. |
| I have seen this before | Query. Recollection is not the vault. |
| It is probably the same as last time | Prove it at the line, then reuse the fix. |
| Tests pass so the bug is gone | Tests you did not run do not count. |
| I cannot reproduce it, I will patch anyway | No repro, no patch. Gather more signal. |
