One Ledger interface (deposit, bet, confirm, reject, exclude, payout) with a
simulated implementation chosen by LEDGER_BACKEND, refused on mainnet. Every
operation is a single write-locked transaction with its audit row; the same
request key is the same operation, a key reused for something else is an
error. The server validates round, deadline, the round's own quota, limits and
funds. The balance is derived from the ledger. Tests include six processes
racing on one SQLite file; the idempotency tests were checked to fail when
the replay is removed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
LotteryConfig (single row, parameters and the three pause switches), Round
(single active round, own rules, split within the pool), Participation (one
bet per player and round, unique draw position), Movement (signed ledger,
idempotency key per player), ChainTransaction and an append-only AuditEntry
enforced by the model and by SQLite triggers. Every foreign key is PROTECT.
One test per constraint, each checked to hit the intended constraint.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Django 5.2 project (config/, apps/accounts with a custom User and
case-insensitive usernames, apps/lottery with the run_worker command,
apps/web with a placeholder home and /health/live, apps/ops), SQLite in WAL
with IMMEDIATE transactions, secrets and hosts from the environment. The
compose stack is now web + worker + caddy and serves https://localhost; the
old FastAPI service is out of the stack until roadmap D1. The three old
infrastructure tests follow the new Dockerfile and compose.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Docs-first step for the move to Django per TODO.md: framework and areas
(ADR-54, WEB-01..07), SQLite WAL with separate web/worker processes
(ADR-55), individual staff accounts with MFA deferred to phase C (ADR-56),
distinct pause commands (ADR-57), regtest alpha with a network profile
(ADR-58), framework-free PLM engine with a simulated ledger in phase A
(ADR-59), Italian-only pilot (ADR-60). The site must be browsable on
localhost before a domain exists (WEB-07).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>