Mostly ready: the core flow is sound, and the hard part (charging safely with retries) is handled well. Six gaps are worth fixing in design.md before you start, and they should take about an hour. The biggest is that the reconciliation job (step 6) isn't fully specified.

## What's solid
- Using the order id as the provider's idempotency key on every retry (step 3) prevents double charges.
- The payment call sits outside the database transaction (step 3).
- Stock reservation uses a conditional `UPDATE ... WHERE available >= :qty`, so it can't oversell.
- A failed email never fails the order (step 4).
- The reconciliation job and the 30-minute alert give you a safety net for orders stuck in `PENDING`.
- The design is sized sensibly for 200 to 2,000 orders a day and doesn't over-build.

## Issues to fix before building

**1. High: stock can be restored twice, and reconciliation doesn't say it restores stock.**
- Evidence: step 5 restores stock on decline. Step 6 says reconciliation "settles them as PAID or FAILED" but never mentions restoring stock or queuing the email. You also run two instances, so both can run the job.
- Failing case: an order has 3 units reserved. Both instances' reconciliation runs see it as `PENDING`, and both mark it `FAILED` and restore stock. Stock goes up by 6.
- Fix: make every status change conditional (`UPDATE orders SET status='FAILED' WHERE id=:id AND status='PENDING'`) and restore stock only if one row changed. State that reconciliation does the same stock restore and email queue as the request path. The same guard covers a race between the reconciliation job and a request that is still retrying.

**2. High: "provider has no record of this charge" isn't handled.**
- Evidence: the process can crash after step 2 commits and before step 3 calls the provider. The order is then `PENDING` with no charge. Step 6 only covers "asks the provider for the charge status" and assumes a charge exists.
- Fix: define what reconciliation does when the provider returns not found. I suggest marking the order `FAILED` and restoring stock, since the customer was never charged. Also confirm that the provider supports status lookup by your idempotency key, and how long it keeps keys. Both are assumptions the design makes without checking.

**3. Medium: the "no module reads another module's tables" rule conflicts with step 2.**
- Evidence: step 2 updates `stock` (inventory) and inserts into `orders` (orders) in one transaction. Step 5 does the same on the way back.
- Fix: name how modules share a transaction. For example, `OrderCheckout` opens the transaction and passes it into the inventory and orders modules. Otherwise whoever builds this will decide ad hoc.

**4. Medium: concurrent duplicate `POST /orders` isn't specified.**
- Evidence: step 1 says a repeated key returns the existing order. If two requests with the same key arrive at the same moment, the second hits the unique constraint inside the step 2 transaction.
- Failing case: the client double-clicks. The second request gets a 500 instead of the existing order.
- Fix: catch the unique violation and return the existing order. Also scope the key to `(customer_id, idempotency_key)`, and decide what happens if the same key arrives with a different cart. I suggest `422`.

**5. Medium: order pricing and total have no stated source.**
- Evidence: `order_items.unit_price` and `orders.total` exist, but the design doesn't say whether prices come from the client's cart or a catalog. There is no catalog table.
- Fix: state that the server computes prices, and where it gets them. If you trust client prices, someone can pay $0.01 for anything.

**6. Medium: the tests skip the riskiest paths.**
- Evidence: the integration list has no reconciliation test, no decline-restores-stock test, no concurrent-duplicate test, and no email-failure test. Reconciliation is where issues 1 and 2 live.
- Fix: add those four. Write the reconciliation tests first, since they are what pin down the behavior in issues 1 and 2.

## Minor
- **Deadlock risk:** two orders that reserve the same SKUs in different order can deadlock in step 2. Sort items by `sku` before updating.
- **Schema gaps:** the data model has no primary keys, foreign keys, or indexes. At minimum:
  - the primary key on `stock.sku`
  - `CHECK (available >= 0)`
  - an index on `(status, created_at)` for the reconciliation query
  - an index on `order_items.order_id`
- **Request time:** step 3 allows 4 attempts at 5 s plus backoff, so one HTTP request can hold open for about 25 to 35 s. Make sure the client and load balancer timeouts are longer than that, or lower the retry count.
- **Email queue:** the queue in step 4 isn't in the infrastructure list, which has only Postgres. Say what it is. If the process crashes between the `PAID` commit and the enqueue, the email is lost. A table-backed outbox written in the same transaction would fix that, but the cost may not be worth it at this volume. If you skip it, record it as accepted debt.

## Speculative (no evidence in the doc, so your call)
- The design doesn't mention authentication or who may read an order.
- There is no refund or cancel path for a charge that succeeded after the order was marked `FAILED`.
- Multi-currency isn't addressed, though `currency` is a column.

None of these block you if they are out of scope for this release.

VERDICT: READY WITH CHANGES
