Debugging Playbook
Mental Model
Section titled “Mental Model”Debugging is not trying fixes until one works. Debugging is reducing uncertainty.
symptom -> reproduction -> boundary -> evidence -> cause -> fix -> verificationThe Three Laws
Section titled “The Three Laws”- If you cannot reproduce it, you are guessing.
- If you cannot name the boundary, you do not know where the bug lives.
- If you cannot verify the fix, you did not finish.
Common Boundaries
Section titled “Common Boundaries”- Browser to frontend code.
- Frontend to API.
- API to service logic.
- Service logic to database.
- Service to external API.
- App to cache or queue.
- Container to environment variables.
- Ingress/load balancer to service.
- CI runner to build toolchain.
Debugging Questions
Section titled “Debugging Questions”- What exactly did the user do?
- What exactly happened?
- What should have happened?
- Is it reproducible?
- Does it happen locally, in staging, in production, or everywhere?
- What changed recently?
- What input triggered it?
- What log line proves the request arrived?
- What error proves the failing boundary?
- What test would fail before the fix and pass after?
Evidence Ladder
Section titled “Evidence Ladder”Weak evidence:
- “I think it is fixed.”
- “The code looks right.”
- “The agent said so.”
Better evidence:
- A failing test now passes.
- A request returns the expected response.
- A log line shows the corrected path.
- A database row has the expected state.
- A deployment health check is green.
- A user path works in browser.
Debugging Template
Section titled “Debugging Template”# Debugging Log
## Symptom
## Expected Behavior
## Reproduction Steps
## Observed Evidence
## Suspected Boundary
## Root Cause
## Fix
## Verification
## PreventionDrill: Duplicate Ticket Bug
Section titled “Drill: Duplicate Ticket Bug”Scenario: users report duplicate tickets.
Possible causes:
- Double-clicked submit button.
- Frontend retry.
- Backend retry.
- Missing idempotency key.
- Missing database uniqueness.
- Queue processed the same job twice.
Work:
- Reproduce duplicates.
- Add request IDs to logs.
- Add an idempotency key.
- Add a backend test.
- Add a database constraint if the business rule allows it.
- Verify duplicate submission creates one durable ticket.
Done When
Section titled “Done When”You can point to the original trigger, the failing boundary, and the evidence that proves the fix.