Hidden side effects in summaries
You ask an AI to summarize what this Python order-processing function does before you reuse it elsewhere. The agent gives a tidy three-bullet summary: "(1) validates the order, (2) charges the card, (3) returns a confirmation object." It reads as pure and reusable. What's the risk in that summary, and how do you confirm there isn't a critical side effect it omitted?
Implement
list_side_effects(body_lines: list[str]) → list[str]Examples
in
[["def process_order(order):"," validate(order)"," charge = gateway.charge(order.card, order.total)"," db.execute(\"UPDATE inventory SET qty = qty - %s WHERE sku = %s\", (order.qty, order.sku))"," cache.invalidate(f\"product:{order.sku}\")"," emit_event(\"order.completed\", order.id)"," return Confirmation(charge.id)"]]out["mutates:gateway.charge","mutates:db.execute","mutates:cache.invalidate","event:order.completed"]in
[["def order_total(order):"," subtotal = sum(order.lines)"," return subtotal * 1.08"]]out[]What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 16 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.