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

# Coffee demo

> Junnu’s latte checkout on the demo coffee shop — real Postgres and Redis side effects.

Alibi ships `apps/demo-coffee-py` (FastAPI) and `apps/demo-coffee` (Express): a tiny coffee shop with **real** Postgres and Redis side effects.

## Journey (Junnu’s latte)

| Step | API | Side effects that matter |
| - | - | - |
| 1 | `GET /menu` | Reads `menu_items` (and may warm Redis `menu:v1`) |
| 2 | `POST /orders` `{ drinkId, qty }` | **INSERT** into `orders`; Redis order status key |
| 3 | `POST /orders/:id/pay` | **INSERT** into `payments`; Redis status → `paid` |

Smoke path after Compose:

```bash theme={null}
./scripts/smoke_record_verify.sh
```

## What mocks alone miss

Suppose a teammate “simplifies” payment while Junnu’s case still expects Redis `paid`:

* HTTP still returns `200` and a payment JSON body.
* But the handler **stops updating Redis**, or writes `amount_cents` wrong, or inserts two payment rows.

| Approach | Result |
| - | - |
| Assert response JSON only | **Pass** — shape looks fine |
| Record outbound DB as **mocks** and replay without a live store | **Pass** — mocks never prove today’s code still mutates state |
| **Alibi verify-live** (Laddu or CI on Junnu’s case) | **Fail** — baseline restore + live diff catches drift |

The contract is the **ordered mutations and in-span reads**, not the HTTP envelope alone.

## Concurrent recorders

1. Junnu starts Record → checks out sandbox A → orders a latte.
2. Laddu starts Record → checks out sandbox B → orders an espresso.
3. Their SQL schemas / Redis prefixes do not collide.
4. Live sessions stay **private**.
5. After Junnu **saves a case**, Laddu sees it project-wide and can verify-live or approve.

```bash theme={null}
./scripts/smoke_junnu_laddu_sandboxes.sh
```

## Failure resolution

When verify-live fails on Junnu’s case:

1. **Approve** — intentional product change; update the golden case from the run.
2. **Re-record** — journey path changed; capture a new case.
3. **Fix** — bug in the service; ship a fix and re-verify.
4. **Suppress field** — volatile id/timestamp; ignore rule, then re-verify.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.