Code generation
We handed it a real file from our billing service and asked for a refactor that a careless model gets wrong in a way that costs money.
Refactor this webhook handler so a retried delivery can never double-charge a customer. Keep the public interface identical. Do not remove existing logging or the retry backoff. Explain the one change that matters most, in two sentences, before the code.
[paste your own webhook/handler file here]
Idempotency key on the charge write, interface untouched, retry logic intact, tests still green.
Second attempt got the idempotency key right, but it rewrote the log format along the way. We restored it by hand — that edit is the asterisk.
- Cost
- $0.009
- Latency
- 12.8s
- Baseline (Claude)
- PASS · $0.034 · 12.1s
- Attempts
- 2 of 2