> ## 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.

# Concepts

> What Alibi is, and the core ideas: Record, Verify, Cases, baselines, and isolation modes.

## What Alibi is

Alibi records **ordered inbound API calls** plus **in-span state mutations and selective reads** (SQL, Redis, optional Kafka/S3/queue plugins), then verifies against that contract on a restored baseline.

| Alibi is | Alibi is not |
| - | - |
| Living side-effect contracts | A Postman clone |
| Verify-live on real sandbox stores | Mock-replay of your database |
| BYO staging + control plane for cases | Browser E2E as the source of truth |

## Record

A **Record** session starts on a project, checks out an isolated **sandbox**, and collects steps while your app runs with `ALIBI_MODE=record` (or `x-alibi-mode: record`) and the sandbox marker header.

* Live sessions stay **private to the recorder** (Laddu cannot open Junnu’s live session).
* Each recorder gets a distinct `sandboxId`.
* Steps attach mutations/reads observed by plugins in the request span.

## Verify

**Verify-live** restores the case’s pinned **baseline** into a sandbox, replays the recorded HTTP steps against your target app with `x-alibi-mode: verify`, and diffs observed mutations/reads vs the case. Failures surface cross-team drift on state — not only response JSON.

## Cases

A **case** is a saved recorded path: ordered steps, assertions, ignore rules, owner, case version, and baseline version.

* After **save-case**, the case is **project-shared** (Laddu can list and verify Junnu’s case).
* On failure: **approve** (update golden from a run), **re-record**, suppress a volatile field, or **fix** the code.

## Baselines

A **baseline** is a versioned SQL + Redis (and plugin) snapshot. Verify restores it into the checked-out sandbox so runs start from a known data plane — not “whoever last polluted staging.”

## Isolation modes (1–6)

| Mode | Key | Behavior |
| - | - | - |
| 1 | `schema_prefix` | Dedicated SQL schema + Redis key prefix |
| 2 | `dedicated_db` | Dedicated Postgres database + Redis DB index |
| 3 | `warm_pool` | **Default.** Record Start checks out a pre-warmed (1) or (2) slot |
| 4 | `docker_session` | Per-session `docker-compose.sandbox.yml` project |
| 5 | `k8s_job` | Per-session k8s Pod+Service; logical binding if kubectl/cluster absent |
| 6 | `branch_db` | Branchable Postgres (`local` TEMPLATE or Neon) + Redis prefix |

See [Isolation modes](https://alibi.itsdote.tech/examples/isolation-modes.md) for honest requirements per mode.

## Prerequisites

**Compose (recommended)** needs Docker installed and running.

Without Docker, use local services: Node 20+ / pnpm 9+, Python 3.10+, Postgres 16, and Redis 7.

Isolation extras:

| Mode | Requirement |
| - | - |
| 4 (`docker_session`) | Docker socket + Compose plugin in the CP image; `ALIBI_HOST_REPO_DIR=$(pwd)` so sandbox bind mounts resolve |
| 5 (`k8s_job`) real provision | `kubectl` + a cluster; without them CP returns a logical binding unless `ALIBI_K8S_FAIL_CLOSED=1` |
| 6 (`branch_db`) local TEMPLATE | `psql` in the CP image; prefer a frozen template via `ALIBI_BRANCH_TEMPLATE_DB`. Neon needs API creds |


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