promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

The four breakage classes — sort any LLM failure before you touch the prompt — step 9 of 9

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 got three user-reported failures from the support inbox this morning. Each has a trace attached. Classify them so the right team gets the right ticket — retrieval team, prompt team, ML team (hallucination), or backend team (parse).

Write classify_failure(trace) using the same priority order from the previous step:

  1. retrieved_chunks non-empty + retrieved_chunks_match_query False → "retrieval"
  2. raw_output != output_after_postprocess → "parse"
  3. retrieved_chunks empty → "hallucination"
  4. else → "prompt"

Then print one line per trace in this format: ticket_<id>: <class>

Expected output:

ticket_8821: retrieval
ticket_8822: prompt
ticket_8823: parse

full-screen editor opens — close anytime to keep reading.