╔══════════════════════════════════════════════════════════════════════╗
║                                                                      ║
║              🔥 LLM FAILURE DATA EXTRACTOR - QUICK START 🔥         ║
║                                                                      ║
╚══════════════════════════════════════════════════════════════════════╝

📍 USE THIS COMMAND:

  ~/Coding/metarepo/scripts/show-llm <command>

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚡ QUICK COMMANDS:

# See actual failed JSON
~/Coding/metarepo/scripts/show-llm unmarshal

# See actual bad LaTeX
~/Coding/metarepo/scripts/show-llm latex

# See full prompts & responses
~/Coding/metarepo/scripts/show-llm prompts

# Dump everything about latest failures
~/Coding/metarepo/scripts/show-llm dump

# Deep dive specific trace
~/Coding/metarepo/scripts/show-llm trace <trace-id>

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

💡 CREATE AN ALIAS:

Add to ~/.zshrc:

  alias show-llm='~/Coding/metarepo/scripts/show-llm'

Then use:

  show-llm unmarshal
  show-llm latex
  show-llm dump

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔧 PREREQUISITES:

Port-forward must be running:

  kubectl port-forward -n observability svc/loki-gateway 3100:80 --context=dev

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📖 EXAMPLES:

# Find what JSON broke
~/Coding/metarepo/scripts/show-llm unmarshal --time 1h

# Find what LaTeX broke  
~/Coding/metarepo/scripts/show-llm latex --time 30m

# See what prompts were sent
~/Coding/metarepo/scripts/show-llm prompts --time 5m

# Get trace ID from error, then see everything
~/Coding/metarepo/scripts/show-llm dump
~/Coding/metarepo/scripts/show-llm trace 4004a689b0954b4eb07dec2e78600073

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🎯 PIPING OUTPUT:

# Pipe to less for long output
~/Coding/metarepo/scripts/show-llm prompts | less

# Save to file
~/Coding/metarepo/scripts/show-llm dump > failures.txt

# Grep for specific issues
~/Coding/metarepo/scripts/show-llm unmarshal | grep -A 10 "missing"

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📚 FULL DOCS:

  ~/Coding/metarepo/scripts/LLM-DATA-EXTRACTION.md

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✅ FIXED ISSUES:

✓ Handles broken pipe errors when piping to head/less
✓ Works from any directory
✓ Shows helpful error message if port-forward not running
✓ Proper klogs path configured

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

That's it. Now you see the actual failed data. 🔥
