# ADR 0002: Serialize bookings per schedulable assignee

- Status: Accepted
- Date: 2026-08-13

## Context

Meetings are variable intervals assigned to human users or AI agents. MySQL unique
indexes cannot prevent arbitrary interval overlap. A check followed by an insert
is unsafe under concurrent requests.

## Decision

Represent every bookable human/AI target with one `schedulable_assignees` row.
Creation, reassignment, cancellation, and rescheduling begin a transaction and
lock this row `FOR UPDATE`. The service revalidates active state, lead time,
availability, and half-open interval conflicts under the lock before writing.
When moving between assignees, rows are locked in ascending primary-key order to
avoid deadlocks. Deadlock/serialization failures receive a bounded retry.

UTC instants are authoritative. The original IANA timezone and local wall time are
retained for display and evidence. Intervals use `[start, end)` so back-to-back
meetings are valid.

## Consequences

Concurrent bookings for one assignee serialize, giving deterministic correctness;
different assignees remain concurrent. Every write path must use the application
service. MySQL integration tests with separate connections are mandatory.

