Skip to content

chore(control): add versioned first-party migrations - #121

Merged
abruption merged 1 commit into
docs/116-v1-compatibilityfrom
chore/115-control-migrations
Sep 21, 2026
Merged

abruption merged 1 commit into
docs/116-v1-compatibilityfrom
chore/115-control-migrations

Conversation

@abruption

Copy link
Copy Markdown
Owner

The control service previously created session-peer tables from runtime constructors, so an installed Alpha database had no versioned upgrade boundary. This change adds an atomic first-party migration ledger, makes the compiled migration command install both Better Auth and session-peer schemas, and makes normal startup fail closed with migration_required without DDL.

It preserves zero-based stable principals, users, device generations, revocation tombstones, operation receipts, and the monotonic public revision. The generic and KR runbooks now require a fenced snapshot and same-identity/writer-lock migration. The KR snapshot records and validates the control schema version together with database integrity, signing-key/JWKS identity, and public/replay revision fencing.

Validation:

  • Node 22.14.0: typecheck, build, 76 tests
  • Node 24.16.0: clean install, typecheck, build, 76 tests, runtime audit 0
  • actual Node/Python control integration: 6 tests, including fresh and sanitized Alpha upgrade fixtures
  • Python: 430 tests passed, 6 optional/platform skips
  • compiled migration: two consecutive runs report schema v1; SQLite integrity is ok
  • documentation i18n contract and repository link checks passed

This PR is stacked on #120 so the migration behavior is reviewed against the v1 compatibility contract. After #120 merges, its base can be changed to main without changing this diff.

Closes #115

@abruption
abruption force-pushed the chore/115-control-migrations branch from 02e6a8f to 2e72b26 Compare September 21, 2026 01:59
@abruption
abruption force-pushed the docs/116-v1-compatibility branch from 55a64cc to ebf5c34 Compare September 21, 2026 02:00
@abruption
abruption force-pushed the chore/115-control-migrations branch 2 times, most recently from bee4634 to 82da76c Compare September 21, 2026 02:03
@abruption
abruption force-pushed the docs/116-v1-compatibility branch from ebf5c34 to c5ddc8d Compare September 21, 2026 05:35
@abruption
abruption force-pushed the chore/115-control-migrations branch from 82da76c to d52fdf3 Compare September 21, 2026 05:36
@abruption
abruption merged commit 6635990 into docs/116-v1-compatibility Sep 21, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant