Adopt async SQLAlchemy storage and verified Alembic migrations

Keep the message and idempotency receipt in one Core CTE statement with chat-first locking. Preserve rollback, bounded dependency failures, and domain ports.

Replace the SQL runner with Alembic. Adopt legacy databases only after validating their journal and PostgreSQL schema, retain all data, and verify migrations on fresh and populated databases.
This commit is contained in:
Artyom
2026-11-05 21:38:12 +03:00
parent c376882ce8
commit 71c643c6d1
29 changed files with 1542 additions and 409 deletions
+3 -3
View File
@@ -10,7 +10,7 @@ COMPOSE ?= docker compose
RATE ?= 100
FROM_REV ?=
SHIFT ?= 0
SCRIPTS_PY = scripts/probe.py scripts/limits.py scripts/scaling.py tools
SCRIPTS_PY = alembic scripts/probe.py scripts/limits.py scripts/scaling.py tools
TRACK1 = evidence/track1
SCALING = $(PYTHON) scripts/scaling.py --fresh-db
BEFORE_REV ?= edc091d
@@ -61,14 +61,14 @@ install:
lint:
$(VENV)/bin/ruff check src student-tests $(SCRIPTS_PY)
$(VENV)/bin/ruff format --check src student-tests $(SCRIPTS_PY)
$(VENV)/bin/ty check src student-tests
$(VENV)/bin/ty check src student-tests alembic
format:
$(VENV)/bin/ruff check --fix src student-tests $(SCRIPTS_PY)
$(VENV)/bin/ruff format src student-tests $(SCRIPTS_PY)
typecheck:
$(VENV)/bin/ty check src student-tests
$(VENV)/bin/ty check src student-tests alembic
student-test:
$(VENV)/bin/pytest $(PYTEST_ARGS)