430f4a1132
11 PR5 commits: alembic 0002 (nullable workspace_id + FK + composite index on 4 business tables) -> backfill_workspace_id.py (3-step idempotent) -> alembic 0003 (pre-flight refuse + NOT NULL + UNIQUE). 18 new tests (9 alembic 0002+0003 + 9 backfill, including dry-run and no-users error). 3150 passed + 30 skipped + 16 pre-existing caplog flake (unchanged from PR4). T5.11 (ORM nullable=False) deferred to PR6 — flipping the ORM-side NOT NULL would break 6 INSERT sites whose repository signatures get workspace_id wiring in PR6 anyway. DB-level invariant is already enforced by alembic 0003 along the production path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>