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

# Architecture

> Domain model, control plane vs SDK, and locked MVP decisions.

## Product thesis

Alibi.AI is a **living contract of API side effects**: record ordered inbound API calls plus all in-span state mutations and selective reads, then verify against that contract. Failures surface cross-team drift; resolve by **approve**, **re-record**, or **fix**.

## Domain model

```
Workspace
  └── Project          # one integrated product with SDK installed
        ├── Baseline[]   # versioned SQL+Redis snapshots; one active
        ├── Suite[]      # journey/domain (checkout, auth)
        │     └── Case[] # recorded path; pins baseline version
        │           └── Step[]  # inbound API + span side effects + asserts
        └── Run[]        # execution of case/suite; pass/fail + diffs
```

## Architecture (V1)

```
┌─────────────────────────────────────────────────────────┐
│  Alibi Control Plane (app)                              │
│  UI · case store · baselines · runs · approve/re-record │
└──────────────────────────┬──────────────────────────────┘
                           │ API
┌──────────────────────────▼──────────────────────────────┐
│  Target app (BYO staging) + Alibi SDK                   │
│  middleware (record|verify|off) · span/request id       │
│  plugins: sql · redis · kafka · s3 · queue              │
└─────────────────────────────────────────────────────────┘
         │                         │
    sandbox SQL               sandbox Redis
    (baseline restore)        (prefix / DB index)
```

### SDK

* `alibi.init({ project, plugins })` — few lines to adopt.
* Env mode: `ALIBI_MODE=off|record|verify` (default off = zero overhead).
* Sandbox traffic marker (header and/or tenant).
* Framework middleware first: Express and FastAPI.
* Plugin contract: `snapshot` · `observe` (mutations + reads) · `diff` · `restore`.

### Control plane

Surfaces (one job each):

1. Projects / Suites — organize
2. Baseline — active version, capture, reset
3. Record — Start → Record/Stop; live step timeline
4. Case detail — steps, asserts, ignore rules, approve / re-record
5. Runs — step-level pass/fail diffs

Primary visual: **step timeline**, not a metrics dashboard.

## Locked decisions

| Topic | Decision |
| - | - |
| Capture | Process boundary (SDK in backend); browser only drives the app |
| Step model | One inbound API = one step; plugins attach via request/trace span |
| Isolation | Mode flag + sandbox marker; multi-recorder = one sandbox per Record |
| Default mode | **(3) warm pool** |
| Data plane | Explicit versioned **Baseline** snapshots |
| Verify | V1 = verify-live only |
| Hosting | BYO staging default; optional hosted-env API |

Deeper lock notes live in the repo at `docs/architecture-mvp.md`.


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