Similar Items: CANTANTE: Optimizing Agentic Systems via Contrastive Credit Attribution