The design is sound enough to start building tomorrow, but it has two gaps that would corrupt stock or strand orders, and both need a decision written into the doc before the code that depends on them. None of the fixes change the overall shape: the reserve, charge, settle and reconcile flow is right for 200 to 2,000 orders a day.

## Must fix before building the affected step

1. **Stock can be restored twice (steps 5 and 6).** The doc does not say that settling an order only happens if it is still `PENDING`. With two instances, both may run the reconciliation job on the same order.
   - Case: an order for 1 unit of SKU A is declined, and both instances mark it `FAILED` and restore stock.
   - Wrong result: `available` goes up by 2. Expected: up by 1.
   - Fix: settle with `UPDATE orders SET status = ... WHERE id = :id AND status = 'PENDING'`, and restore stock or send email only if that update changed a row.

2. **Reconciliation has no rule for "the provider has never heard of this order" (step 6).**
   - Case: the instance crashes after step 2 commits and before the charge call in step 3.
   - Wrong result: the provider returns "not found", which is neither `PAID` nor `FAILED`, so the order stays `PENDING` and holds its stock forever. The 30-minute alert fires but nothing resolves it.
   - Fix: treat "not found" as `FAILED` and restore stock. State also that "still processing" leaves the order `PENDING`.

3. **The idempotency key is unique globally, not per customer (step 1).**
   - Case: customer B sends a key that customer A already used.
   - Wrong result: B gets A's order back. Expected: B gets their own new order.
   - Fix: make the constraint unique on `(customer_id, idempotency_key)`. Also decide what happens when the same key arrives with a different cart; I recommend rejecting it with `422`.

4. **Concurrent multi-item orders can deadlock (step 2).**
   - Case: order 1 reserves SKU A then B while order 2 reserves B then A.
   - Wrong result: Postgres aborts one with a deadlock error and the customer sees a `500`. Expected: both succeed, or one gets `409` for stock.
   - Fix: update stock rows in sorted `sku` order.

## Should fix, can land during the build

- **Confirmation email can be lost or never sent.** A crash between the `PAID` commit and the queueing in step 4 loses the email. The doc also does not say that orders settled as `PAID` by the reconciliation job get an email at all. Writing an "email pending" row in the same transaction as `PAID` fixes both.
- **The transaction in step 2 crosses the module boundary.** It touches `stock` and `orders` together, while the code structure says no module reads another's tables. Name the decision: I recommend `OrderCheckout` owning the transaction and passing it into the inventory and orders modules.
- **Test plan gaps.** The list has no test for:
  - the reconciliation job: paid, declined, not found, still processing
  - two settlements of the same order at once
  - two simultaneous `POST /orders` with the same key
  - two buyers racing for the last unit
  - the crash after reserve and before charge
- **Smaller omissions in the doc:**
  - Primary keys are missing on `order_items` and `stock`.
  - There is no index for the job's "`PENDING` and older than 2 minutes" query.
  - No `GET /orders/{id}` is listed for clients to poll after a `202`.
  - Nothing says the server, not the client's cart, sets `unit_price` and `total`.

VERDICT: READY WITH CHANGES
