# Architecture Decision Records — Demeter

This log captures the significant architecture decisions behind the Demeter
platform. Each ADR records the **context**, the **decision**, and its
**consequences**, so future contributors understand _why_ the system is shaped
the way it is — not just _what_ it does.

ADRs are immutable once accepted: to change a decision, add a new ADR that
supersedes the old one (and link them) rather than editing history.

| ADR                                           | Title                                                            | Status   |
| --------------------------------------------- | ---------------------------------------------------------------- | -------- |
| [0001](0001-postgres-drizzle-persistence.md)  | PostgreSQL + Drizzle for persistence (over in-memory stores)     | Accepted |
| [0002](0002-fastify-plugin-architecture.md)   | Fastify 5 with a plugin/route-group architecture                 | Accepted |
| [0003](0003-openapi-first-documentation.md)   | OpenAPI-first API documentation via route schemas                | Accepted |
| [0004](0004-jwt-refresh-rotation-auth.md)     | JWT access + rotating refresh tokens with family reuse-detection | Accepted |
| [0005](0005-injectable-external-providers.md) | Injectable providers for external dependencies                   | Accepted |
| [0006](0006-shared-db-namespace.md)           | Shared database with a `demeter_` table namespace                | Accepted |

## Format

```
# ADR-NNNN: <title>
Status: Proposed | Accepted | Superseded by ADR-XXXX
## Context     — the forces at play
## Decision    — what we chose
## Consequences — what follows (good and bad)
```
