**Not ready to build tomorrow.** The payment step in `design.md` can charge customers twice, and it can charge them without leaving any order behind. Fix those before writing code. The rest can be settled in an hour.

## Must fix before building

**1. A retried charge can bill the customer twice (flow step 4).**
- A timeout does not mean the charge failed. The provider may have taken the money and answered late.
- Example: the first call times out after the provider charges $80. Retry 1 charges another $80. The customer pays $160 for one order.
- Fix: send an idempotency key with every charge call, for example the order id. Most providers support this.
- Also decide what happens when all 3 attempts time out. Don't treat that as a failure. Mark the order `PAYMENT_UNKNOWN` and check the charge status with the provider.

**2. A customer can be charged with nothing recorded (steps 3–6).**
- The payment call runs inside the open DB transaction, and failure means rollback.
- Example: the charge succeeds, then the commit fails or the process crashes. The money is taken and no order or payment row exists.
- The same happens when step 6 rolls back after a timed-out charge that actually went through.
- Fix: commit the `PENDING` order and a payment attempt record first. Then call the provider outside the transaction. Then record the result in a second transaction.
- A reconciliation job should sweep orders stuck in `PENDING` or `PAYMENT_UNKNOWN`.
- This also stops the transaction holding a DB connection for up to ~15 s (3 attempts × 5 s).

**3. Nightly backups on a single instance put paid orders at risk.**
- A failure at 5 pm loses up to 24 hours of orders and payments. Those records are what you need to reconcile against the provider.
- Fix: continuous WAL archiving with point-in-time recovery, or a managed Postgres with it. Name your recovery targets.

**4. The test plan skips the failure cases.**
- One happy-path integration test misses exactly where steps 1–3 break.
- Required tests: a payment timeout followed by a late success, a crash between charge and commit, a duplicate `POST /orders`, and the retry limit being reached.
- Use a fake payment provider you can script. Write these tests first, as your own standards require.

## Fix soon (decide before building)

**5. Stock checks can oversell.**
- The cache is up to 5 minutes stale. There is no reservation, and the check and the order aren't atomic.
- Two buyers can both see "1 left" and both pay.
- The 800 ms saving isn't worth much at 2,000 orders a day.
- Either do a live check at order time, or accept staleness and write down the oversell handling (backorder or auto-refund).
- Also say what happens when the cache is empty or the refresh has failed.

**6. Client retries create duplicate orders.** `POST /orders` has no client idempotency key. A double-click or a retry after a network drop makes two orders.

**7. The confirmation email can be lost.** If the process dies between commit and send, no email goes out, and nothing records that it was owed. Write an "email owed" row in the same transaction as the commit, and send it from a worker.

**8. Missing from the doc**
- The order state machine and its allowed transitions.
- Server-side price calculation. Never trust cart prices from the client.
- How card data is handled, ideally provider tokens only.
- Auth and rate limiting.
- Cancellation and refunds.
- The error contract for clients.
- Metrics and alerts. Order-id logging alone won't tell you stuck payments are piling up.

## What's fine
- Module boundaries are sound.
- Thin routes with an `OrderCheckout` service is a good layout.
- Order-id logging is the right habit.
- At 2,000 orders a day, one Postgres and one team is fine. Nothing here needs scaling work.

Items 1–4 mean rewriting steps 3–6 and the test plan, not patching them. I can draft that revised flow with its state machine if you want.

VERDICT: NOT READY
