# Cairn — Tech Stack

## Language & Runtime

| | |
|---|---|
| Language | Python ≥ 3.12 |
| Package manager | uv (uv_build backend) |
| Lock file | `cairn/uv.lock` |

## Core Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| FastAPI | ≥ 0.115 | HTTP API server |
| uvicorn[standard] | ≥ 0.34 | ASGI server |
| click | ≥ 8.1 | CLI framework |
| pyyaml | ≥ 6.0 | YAML config parsing + export |
| docker | ≥ 7.1.0 | Docker SDK for container management |
| requests | ≥ 2.32.3 | HTTP client (dispatcher → server) |
| pydantic | (transitive) | Data validation, config models |

## Dev Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| httpx | ≥ 0.27 | Async test client |
| pytest | ≥ 8.3 | Test framework |

## Build & Distribution

| | |
|---|---|
| Build backend | `uv_build` (PEP 517) |
| Entry point | `cairn = "cairn.cli:main"` |
| Container base | `ghcr.io/astral-sh/uv:python3.13-trixie` |
| Worker image | `ghcr.io/oritera/cairn-worker-container:latest` (linux/amd64) |

## Infrastructure

| Component | Technology |
|-----------|-----------|
| Database | SQLite (WAL mode, FK enabled) |
| Container runtime | Docker (via Docker SDK for Python) |
| Deployment | Docker Compose (server + dispatcher) |
| CI | GitHub Actions (build + publish container to GHCR) |

## Worker Backends

| Type | CLI/API | Env Keys |
|------|---------|----------|
| `claudecode` | `claude` CLI | `ANTHROPIC_MODEL`, `ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN` |
| `codex` | `codex` CLI | `CODEX_MODEL`, `CODEX_BASE_URL`, `OPENAI_API_KEY` |
| `pi` | Pi API (HTTP) | `PI_MODEL`, `PI_BASE_URL`, `PI_API_KEY`, `PI_PROVIDER_API` |
| `mock` | Probabilistic | `MOCK_REASON`, `MOCK_EXPLORE_EXECUTE`, etc. |
