Implements a structured self-debugging workflow to diagnose and resolve AI agent failures, tool loops, and context drift.