Refactoring a 3,000-line service with an agent: what had to be checked by hand

We used an autonomous coding assistant to split a legacy 3,200-line BillingService into six cohesive domain actions. The syntax transformation took twenty minutes; the manual verification took two days.

// What the agent generated:
$this->db->transaction(function() use ($order, $invoice) {
    $this->orderRepo->save($order);
    $this->invoiceRepo->save($invoice);
    $this->mailer->sendInvoiceReceipt($invoice); // Side-effect inside DB transaction!
});

The subtle flaw that static analysis cannot flag: placing network calls (email dispatch, payment capture) inside database transaction closures. If the transaction rolls back, the email was already sent. Refactoring tools extract methods cleanly, but transaction boundaries must always be inspected by hand.