Debugging at 2 AM: A Field Guide
The bug is never where the error is. At 2 AM, the bug is occasionally in the chair.
Stage one: denial. The framework is broken. (The framework is not broken.)
Stage two: archaeology. git log reveals the suspect commit is yours, timestamped 23:47, message: quick fix.
Stage three: the print statement. All seniority converges on console.log("HERE 3").
Stage four: the shower. The fix arrives during, never after.
// 02:14 — the actual bug
if (user = admin) { // one equals sign, three hours
Stage five: write it down. Which is what this note is. The garden remembers so the next 2 AM is twenty minutes shorter.
Institutional memory: field-notes-from-the-kernel.