**The design is mostly sound and you can start tomorrow if you settle three things first.** The core flow is well thought out. Stock is reserved in a transaction, the payment call happens outside any transaction, the provider gets the order id as an idempotency key, and a reconciliation job settles unknown outcomes. I found one high-severity problem, four medium and several low. I only read `design.md`, so none of this was run or tested.

## High

**1. Stock can be restored twice.** Two things can settle the same `PENDING` order: the request that is still handling it, and the reconciliation job. The job runs on both instances, and the design doesn't say how the two runs avoid each other.
- Example: an order is declined. Instance A's reconciler and instance B's reconciler both see it as `PENDING`, and each marks it `FAILED` and puts the stock back. Available stock goes up by 2×qty instead of qty, so you oversell.
- Fix: every status change should be `UPDATE orders SET status=… WHERE id=:id AND status='PENDING'`. Restore stock only if that update changed a row. Have the reconciler pick orders with `FOR UPDATE SKIP LOCKED`, or run it on one instance only. Add a test for double settlement.

## Medium

**2. The design assumes the provider can look up a charge by your idempotency key.** Step 6 depends on this, and nothing says it's true. It also doesn't say what the job does when the provider reports "no such charge", which happens if the process died before step 3. It should settle `FAILED` and restore stock.
- Fix: confirm the provider's API before building, and write the "not found" rule into step 6.

**3. The design doesn't say where prices and the total come from.** `POST /orders` takes a cart, but nothing says the server looks up prices. If the client sends `unit_price`, a customer can set their own price.
- Fix: add one line saying prices come from the catalog on the server.

**4. Two requests can deadlock on stock.** Step 2 updates one row per item. Two carts containing the same SKUs in different orders will deadlock.
- Fix: sort items by SKU before the updates.

**5. The email can be lost, and the reconciler may not send it.** If the process dies between the `PAID` commit and the queue insert, no email is sent. Step 6 also doesn't say whether orders the reconciler settles as `PAID` get a confirmation email.
- Fix: write the email request in the same transaction as the `PAID` update (an outbox table), or accept the loss and say so. Either way, state that the reconciler sends the email too.

## Low

**6. A concurrent duplicate request is not described.** Two requests with the same key arrive together. The second one hits the unique constraint and rolls back, which is safe, but it should return the existing order rather than a 500. A reused key with a different cart is also unspecified, and a 422 is the usual answer. The key's uniqueness scope matters too: if it's global, two customers' keys can collide, so consider making it unique per `customer_id`.

**7. The data model is missing constraints.** There is no primary key on `stock.sku`, no `CHECK (available >= 0)` as a backstop, no foreign key from `order_items`, and no index on `(status, created_at)` for the reconciler. The unique constraint on `idempotency_key` isn't listed in the table either. At 2,000 orders a day none of this hurts performance, but the constraints protect correctness.

**8. The module rule conflicts with the flow.** "No module reads another's tables" conflicts with steps 2 and 5, where `orders` and `stock` change in one transaction. That needs a shared transaction handle passed between modules. Decide how that works, and put it in `OrderCheckout` rather than letting modules reach into each other.

**9. Provider errors other than a decline are not covered.** Step 5 handles declines and step 6 handles timeouts. A provider 4xx for a bad request, or a 5xx, is neither. Say which are retried and which settle `FAILED`.

**10. The test list is thin for the risky parts.** It has no tests for the reconciler (settle as `PAID`, settle as `FAILED`, provider returns "not found", two runs at once), concurrent duplicate keys, two buyers of the last unit at the same time, an email failure, or a crash between steps 2 and 3. These are the cases that would catch problem 1.

## What to do before tomorrow
Resolve 1, 2 and 3 in the doc: a few lines of text and one call to check the provider's API. Take 4 to 10 into the build as tickets or test cases. None of them needs a redesign.

VERDICT: READY WITH CHANGES
