**design.md is close, but it has a few gaps to fix before you build.** The core flow is sound: reserve stock, then charge outside the transaction, then settle, with a reconciler as the safety net. The gaps below are all decisions you can settle in an hour.

## Fix before building

1. **The reconciler can't handle "no charge exists".** If the service crashes after step 2 commits but before step 3 calls the provider, the order stays `PENDING` and the provider has never heard of it. The reconciler asks the provider for the charge status and gets "not found", and the design doesn't say what happens next. Pick one: treat "not found after N minutes" as `FAILED`, or have the reconciler retry the charge using the same order-id key. Failing it is simpler and safe.

2. **Settling an order must be an atomic status change, or stock gets restored twice.**
   - Example: the charge is declined, and step 5 marks the order `FAILED` and restores 2 units. The reconciler picks up the same order and restores 2 more, so stock is now off by 2.
   - Step 6 also never says the reconciler restores stock when it settles an order as `FAILED`.
   - Fix: every transition is `UPDATE orders SET status=… WHERE id=:id AND status='PENDING'`, and stock is restored only if that update changed a row.

3. **Two instances will both run the reconciler.** Nothing prevents them from settling the same order at once. Use `SELECT … FOR UPDATE SKIP LOCKED`, or a Postgres advisory lock. Fix 2 makes this safe but not tidy.

4. **The module rule contradicts step 2.** "No module reads another module's tables" conflicts with one transaction that updates `stock` and inserts into `orders`. The same goes for step 5, which restores stock using `order_items`. Decide how this works. The simplest option is for inventory to expose a function that takes the caller's transaction. Write that down, because it decides your module boundaries.

5. **A concurrent duplicate `POST` isn't handled.** Two requests with the same key can both pass the "does it exist?" check. The second hits the unique constraint, and the design says nothing about catching that error and returning the first order. Also decide whether the key is unique per customer or global. Decide what happens if the same key arrives with a different cart: I'd return `422`.

6. **The schema is underspecified.**
   - `stock.sku` has no primary key, and `order_items` has no key or foreign key to `orders`.
   - The design doesn't say where `unit_price` comes from. The server should look it up, not trust the client.
   - Multi-item reservations should update rows in `sku` order to avoid deadlocks between two carts.

## Smaller points

- **Retry rules:** state which provider errors you retry (timeouts and 5xx) and which are final (a decline).
- **Email queue:** the queue technology isn't named. A crash between the commit and the enqueue loses the email. At 2,000 orders a day, accept that and name it as a known gap, or write an outbox row in the same transaction as `PAID`.
- **Alert gap:** a `PENDING` order holds stock until the reconciler settles it. The 30-minute alert covers this, but say who responds.

## Tests to add

The current list covers the happy paths well. Missing:
- Reconciler tests: it settles `PAID`, it settles `FAILED` and restores stock, and it handles "not found".
- Decline restores stock exactly once, including when the reconciler runs afterwards.
- Two concurrent buyers of the last unit, where exactly one gets `409`. The current "buying the last unit" case is a single buyer.
- Two concurrent `POST`s with the same key.
- Email failure doesn't fail the order.
- A crash between step 2 and step 3 leaves an order the reconciler can recover.

VERDICT: READY WITH CHANGES
