**The design is mostly sound, but two gaps in the reconciliation job (step 6) would leak stock, so fix those before you start building.** The core flow is well thought through. The reservation is atomic. The charge sits outside the transaction. The provider call is idempotent. The unknown-result case is handled by a reconciler. The fixes are small paragraph-level additions to design.md, not a redesign.

## Fix before building

**1. High: reconciliation never restores stock when it settles an order as `FAILED`.**
- Evidence: step 5 restores stock on a decline. Step 6 says the job "settles them as `PAID` or `FAILED`" and says nothing about stock.
- Case: an order for 1 unit times out on every attempt and the client gets `202`. The provider later reports the charge failed. The order becomes `FAILED`, but the unit stays decremented in `stock`, so it can never be sold again.
- Fix: say that every `PENDING` → `FAILED` transition restores stock, whichever path caused it. Put that in one shared method.

**2. High: the design doesn't say what reconciliation does when the provider has no record of the charge.**
- Evidence: step 2 commits the order and step 3 charges in a separate step. If the instance crashes between them, the order is `PENDING` with stock held and no charge ever made. The reconciler asks the provider about that order id and gets "not found". Step 6 only covers `PAID` and `FAILED`.
- Case: the process is killed after commit and before the charge call. The order sits `PENDING` until the 30-minute alert fires, and a person has to clean it up.
- Fix: decide the rule. For example, "not found and older than N minutes means `FAILED` plus stock restore", or "retry the charge with the same idempotency key". Either is safe because the provider deduplicates on order id.

**3. Medium: status transitions need to be conditional, and the reconciler needs a single-runner rule.**
- Evidence: two instances sit behind the load balancer, and nothing says the job runs on only one of them. Step 5 and step 6 can also race on the same order.
- Case: both instances run the job and both see order X as `FAILED` at the provider. Both restore its stock, which double-counts the units.
- Fix: write every transition as `UPDATE orders SET status=… WHERE id=… AND status='PENDING'`, and restore stock only if one row changed. Add `FOR UPDATE SKIP LOCKED` or an advisory lock for the job.

**4. Medium: the "no module reads another module's tables" rule conflicts with steps 2 and 5.**
- Evidence: step 2 updates `stock` and inserts into `orders` in one transaction. Step 5 does the same for a status change plus a stock restore.
- Fix: name how this works. Either `OrderCheckout` passes one transaction handle into both modules, or inventory exposes `reserve(tx, …)` and `release(tx, …)`. Pick one now, because it shapes the module interfaces.

**5. Medium: concurrent carts can deadlock.**
- Evidence: step 2 updates `stock` rows one item at a time, in cart order.
- Case: cart A is [sku1, sku2] and cart B is [sku2, sku1]. Each holds one row lock and waits for the other.
- Fix: sort the SKUs before updating, and say so in the design.

**6. Medium: it's unclear where prices and totals come from.**
- Evidence: step 1 says the client sends "the cart". `order_items.unit_price` and `orders.total` have no stated source.
- Fix: state that the server looks up prices and computes the total, and that the client sends only SKUs and quantities.

## Minor

- **Idempotency key scope:** the key is unique across all customers. One customer's key could collide with another's and return the other customer's order. Make it unique on `(customer_id, idempotency_key)`. Also say what happens when the same key arrives with a different cart. `409` is a reasonable choice.
- **Duplicate insert path:** say that a unique-violation on the order insert rolls back the stock reservation and then returns the existing order. The transaction already guarantees the rollback. The design just doesn't write it down.
- **Constraints missing from the data model:** `stock.sku` needs a primary key, and `order_items` needs a key and a foreign key to `orders`. The unique constraint on `idempotency_key` is in prose but not in the table.
- **Email loss window:** step 4 queues the email after commit. A crash in between loses it silently. At 2,000 orders a day, accepting that is reasonable if you write the decision down. A queue-insert in the same transaction would remove it.
- **Test plan gaps:** nothing covers the reconciliation job (settle to `PAID`, settle to `FAILED` with stock restored, provider says not found), stock restore on decline, or two simultaneous `POST`s with the same key. Your standards call for tests first, so these should be in the plan before code starts.

## Speculative, not blocking

- **Request duration:** a request with 3 retries at 5 s each plus backoff can hold a connection for 20 s or more. This is fine unless the load balancer timeout is shorter than that, so check that setting.
- **No `GET /orders/{id}`:** after a `202`, the client can only repeat the `POST` to learn the result. You may want a read endpoint soon.
- **Abandoned `PENDING` orders:** they hold stock until the reconciler settles them. This is acceptable at your volume.

VERDICT: READY WITH CHANGES
