lesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationlesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationlesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationlesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationlesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationlesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationlesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationlesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationlesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationlesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationlesson 2 of 3 · trace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigationtrace-driven debugging — turn a 4-hour panic into a 20-minute investigation
Checkpoint
One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.
Final drill. You have three traces from this morning's on-call queue.
Each fits one of the three failure patterns from this lesson. Write
classify(trace) that returns one of "loop", "bloat", "clean"
based on these rules:
"loop"if any 3-row window has identical(tool, args)"bloat"if the last turn'stokensis more than 3× the first turn'stokens"clean"otherwise
(Note: routing bugs don't surface as a trace pattern alone — they need the tool result content to detect, which is out of scope here.)
Three traces run. Expected output:
loop
bloat
clean