I reviewed `design.md` (revision 3), and it's close. You can start tomorrow if you fix four things first. Each one is a small change to the design. The overall approach is sound: you reserve stock with a conditional update, call the provider outside the transaction, reuse the order id as the provider's idempotency key, and let a reconciliation job settle charges whose result is unknown.

## Fix before building

**1. The reconciliation job can put stock back twice.** You have two instances, and each one runs the job every 5 minutes. Neither the job nor the status updates check that the order is still `PENDING`.
- **Example:** order X holds 1 unit of `SKU-A`, its charge timed out, and the provider later says "declined". Both instances pick up X in the same run. Each marks it `FAILED` and adds the unit back. `available` goes up by 2 when it should go up by 1, so you can sell stock you don't have.
- **Fix:** make every status change conditional: `UPDATE orders SET status = 'FAILED' WHERE id = :id AND status = 'PENDING'`. Only put stock back if that update changed exactly one row. Do the same for `PAID` and for steps 4 and 5. That alone fixes it. A lock that lets only one instance run the job is optional extra protection.

**2. The design doesn't cover a crash right after the order is saved.** If an instance dies after step 2 commits but before step 3 charges the card, the order sits in `PENDING` with no charge at the provider.
- **Example:** reconciliation asks the provider about order X and gets "no such charge". The design only describes settling to `PAID` or `FAILED`, so X is never settled and its stock stays held.
- **Fix:** add this rule: "no charge found and order older than N minutes → `FAILED` and put the stock back". Also state that whenever reconciliation marks an order `FAILED`, it puts the stock back in the same transaction, just like step 5.

**3. Concurrent orders can deadlock.** Step 2 updates one `stock` row per item, in cart order.
- **Example:** order A's cart is `[SKU-1, SKU-2]` and order B's is `[SKU-2, SKU-1]`. If they arrive together, each holds one row and waits for the other's. Postgres kills one of them, and that customer gets a 500.
- **Fix:** sort the SKUs before running the updates.

**4. Where prices come from isn't stated.** `order_items.unit_price` and `orders.total` are stored, but no table in the data model holds prices.
- **Risk:** if the price comes from the client's cart, a customer can edit it.
- **Fix:** state that the server looks up prices from the catalog or pricing service. If no such service exists yet, name the source.

## Worth fixing, but they won't block you

- **The confirmation email can be lost.** Step 4 commits `PAID` and then queues the email. A crash between those two steps means no email is ever sent. If you write the email job to an outbox table in the same transaction as `PAID`, it can't be lost.
- **The idempotency key is unique across all customers.** Keys are generated by clients, so two customers could pick the same one. Make the unique constraint `(customer_id, idempotency_key)`. Also, when a key is reused with a different cart, return `422` rather than the old order.
- **Clients have no way to see the final result.** After a `202`, there's nothing to call. Add `GET /orders/{id}`. Also decide what a repeated `POST` returns while the order is still `PENDING`. I'd return the order and not charge again.
- **The single-transaction steps cross module boundaries.** Steps 2 and 5 touch both `orders` and `stock` in one transaction, but the design says no module reads another module's tables. Spell out how that works: inventory exposes `reserve` and `release` functions that take the caller's transaction, and orders never writes `stock` itself.
- **Database details are missing:**
  - an index on `orders(status, created_at)` for the reconciliation query
  - a primary key on `stock.sku`
  - a primary key on `order_items(order_id, sku)`
  - a `CHECK (available >= 0)` on `stock`

## Tests to add

The test list covers the request path. It doesn't cover the parts most likely to break, which are reconciliation and concurrency. Add:

- reconciliation settles to `PAID`, to `FAILED` (with the stock put back), and when the provider says "no charge found"
- two reconciliation runs on the same order put the stock back exactly once
- the crash after step 2 commits and before the charge
- two simultaneous `POST`s with the same key create one order and one stock reservation
- two orders with the same SKUs in opposite order both succeed with no deadlock
- a decline puts the stock back

## Order lifecycle with the fixes applied

```mermaid
stateDiagram-v2
    [*] --> PENDING: stock reserved, SKUs sorted
    PENDING --> PAID: charge succeeds (only if still PENDING)
    PENDING --> FAILED: declined, stock put back (only if still PENDING)
    PENDING --> PENDING: result unknown, client gets 202
    PENDING --> PAID: reconciliation finds charge succeeded
    PENDING --> FAILED: reconciliation finds decline or no charge, stock put back
    PAID --> [*]: email via outbox
    FAILED --> [*]
```

Fixes 1 to 4 are a short edit to the doc, about an hour. Once they're in, you can build to it tomorrow as planned. I'd write the reconciliation and concurrency tests first, since those are the cases this design is most likely to get wrong.

VERDICT: READY WITH CHANGES
