**Not quite ready to build as written, but close.** The core of the design is sound, and nothing below needs a redesign: each of the first four is a one- or two-line addition to design.md that would cost real money or data if discovered in production instead. Everything else can be settled while building.

## Fix before building

1. **Status changes are not guarded, so stock can be restored twice.** Both instances will run the reconciliation job. For example, both see order A as `PENDING`, both get "declined" from the provider, and both run step 5; `stock.available` goes up by 2 for a 1-unit order, and you later oversell. The fix is to make every transition `UPDATE orders SET status = … WHERE id = … AND status = 'PENDING'` and restore stock only if that changed a row. Optionally, also take an advisory lock so that only one job runs.

2. **Reconciliation has no rule for "provider has never heard of this order".** If the instance crashes after step 2 commits but before the charge call, the provider has no charge to report. Step 6 only says "settles as `PAID` or `FAILED`", so the order stays `PENDING` and holds stock indefinitely. The fix is to state that "not found" for an order past the cutoff means `FAILED` plus stock restore.

3. **The idempotency key's uniqueness scope is not stated.** If it is globally unique, customer B sending a key that customer A already used gets A's order back. The fix is to make it unique on `(customer_id, idempotency_key)`. Also decide what happens when the same key arrives with a different cart; I recommend `422`.

4. **The source of `unit_price` and `total` is not stated.** There is no price table, and the client "sends the cart". If prices come from the request, a client can set its own. State that the server looks up prices and computes the total, and from where.

## Should fix, can be done during the build

5. **Paid orders can miss the confirmation email.** A crash between "commit `PAID`" and "queue email" loses it, and step 6 does not say the reconciliation path queues one at all. Write an email-pending row in the same transaction as `PAID` (an outbox), used by both paths.

6. **Multi-item orders can deadlock.** Order 1 updates SKU X then Y while order 2 updates Y then X; Postgres aborts one and the customer gets a 500. Update stock rows in sorted SKU order.

7. **Concurrent duplicate `POST /orders` is not described.** Two requests with the same key arriving together both pass the "does it exist" check, and one hits the unique violation. That one must catch it and return the existing order, not a 500.

8. **The test list misses the riskiest paths.** Add tests for:
   - the reconciliation job: paid, declined, not found, and two runs at once;
   - two simultaneous buyers of the last unit (the list only has a single buyer);
   - concurrent duplicate POSTs;
   - a crash between steps 2 and 3;
   - email failure.

9. **The retry rule is not specific.** Retry only on timeouts and 5xx responses. Retrying a 4xx wastes up to 20 seconds of the customer's wait.

## Minor

10. **No read endpoint.** A client that gets `202` needs `GET /orders/{id}` to poll.
11. **Missing constraints.** `order_items` has no primary key, `stock` has no `CHECK (available >= 0)`, `status` has no `CHECK`, and foreign keys are not stated.
12. **Module rule versus step 2.** "No module reads another module's tables" conflicts with one transaction touching `stock` and `orders`. State that inventory exposes a reserve/restore function that accepts the caller's transaction.
13. **Worst-case response time.** Four attempts at 5 s plus backoff is roughly 30 s. Check that the load balancer and client timeouts exceed it, or cut to 2 retries.
14. **Currency precision.** `numeric(12,2)` is wrong for currencies with zero or three decimals (JPY, KWD). This is fine if you only sell in one currency; say so.
15. **Authentication.** The design does not say where `customer_id` comes from. It should come from the auth token, not the request body.
16. **Scope.** Refunds and cancellation are absent. Mark them out of scope explicitly.
17. **Alert coverage.** The 30-minute `PENDING` alert does not catch the reconciliation job itself being dead when there are no stuck orders. Add a heartbeat check.

VERDICT: READY WITH CHANGES
