> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Evaluation tasks (for AI agents)

> This guide serves as an implementation specification.

This guide serves as an implementation specification. An agent that has read it should be able to complete each task below and pass the stated check. These tasks mirror the [Verification](https://docs.cockroachlabs.com/docs/cookbook/order-management/verification.md) scenarios.

### Task 1: Win the last unit

Given `inventory.available = 1` for `SKU-HOT`, launch 50 concurrent create-order requests for 1 unit each.
**Pass:** exactly 1 order created, `available = 0`, 49 responses are `OUT_OF_STOCK`.

### Task 2: Retry a timed-out order

Send a create-order request; simulate a client timeout; retry with the **same** idempotency key.
**Pass:** exactly 1 order exists; the retry returns the original order.

### Task 3: Duplicate payment callback

Deliver the same provider capture callback twice (and once out of order).
**Pass:** payment captured once; no double capture; state advances monotonically.

### Task 4: Recover from partial failure

Reserve inventory, then force payment capture to fail.
**Pass:** a compensating action releases the reservation; inventory returns to its prior value; order ends `cancelled`.

> [!TIP]
>
> **Why these four**
> These tasks cover the four highest-risk invariants: no overselling, no double orders, no double charges, and no stuck or leaked state. An agent that passes all four has implemented the core path correctly.
