Stripe webhook receiver
You're using an AI agent to build a Stripe webhook receiver in Python (FastAPI) from scratch: it must verify signatures, be idempotent, and trigger downstream order fulfillment. Lay out the build plan you'd give the agent — the framework/resources choices, the order you build it in, and the acceptance criteria. Call out exactly where a careless prompt ('write me a Stripe webhook endpoint') goes wrong.
decide_webhook_responses(deliveries: list[str], expected_signature: str, now_epoch: int) → list[str][["evt_1|1700000000|sig_ok|checkout.session.completed","evt_1|1700000000|sig_ok|checkout.session.completed","evt_2|1699999900|sig_ok|invoice.created"],"sig_ok",1700000000]out["200_fulfill","200_duplicate","200_ignored"][["evt_3|1700000000|sig_bad|payment_intent.succeeded","evt_4|1699999000|sig_ok|payment_intent.succeeded","evt_5|1700000000|sig_ok"],"sig_ok",1700000000]out["400_bad_signature","400_stale","400_malformed"]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.
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.